From 301b97d4f4f7ff749eb5f0185299aa86d88d6952 Mon Sep 17 00:00:00 2001 From: WenShiJun Date: Wed, 27 Mar 2024 18:05:30 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../freight_trailer/index.vue | 30 +++++++++++- .../freight_trailer/view.vue | 4 -- .../assigned_manage/index.vue | 6 --- src/views/mechanical_files/beidou/add.vue | 20 ++++++-- src/views/mechanical_files/beidou/index.vue | 8 +++- src/views/mechanical_files/beidou/view.vue | 6 --- .../mechanical_files/inspect_annually/add.vue | 16 ++++++- src/views/mechanical_files/insure/add.vue | 15 +++++- .../mechanical_files/maintenance/add.vue | 18 ++++++- .../mechanical_files/maintenance/index.vue | 18 ++++--- .../mechanical_files/maintenance/view.vue | 14 +++--- src/views/mechanical_files/operations/add.vue | 10 +++- .../mechanical_files/operations/index.vue | 10 +++- .../mechanical_files/operations/view.vue | 12 ++--- .../production_accident/add.vue | 47 ++++++++++++------- .../production_accident/index.vue | 4 +- .../mechanical_files/scrap_manage/index.vue | 6 --- .../taxation_manage/index.vue | 23 ++++----- 18 files changed, 178 insertions(+), 89 deletions(-) diff --git a/src/views/enterprise_management/basics_info_management/freight_trailer/index.vue b/src/views/enterprise_management/basics_info_management/freight_trailer/index.vue index b66a80a..27fc30f 100644 --- a/src/views/enterprise_management/basics_info_management/freight_trailer/index.vue +++ b/src/views/enterprise_management/basics_info_management/freight_trailer/index.vue @@ -125,6 +125,11 @@ + @@ -139,7 +144,13 @@ import { } from "@/request/enterprise_management.js"; import { debounce } from "throttle-debounce"; import { ElMessageBox, ElMessage } from "element-plus"; +import { setRiskPointImport } from "@/request/risk_control.js"; +import LayoutImportFile from "@/components/import_file/index.vue"; +import { reactive } from "vue"; const router = useRouter(); +const data = reactive({ + importDialogVisible: false, +}); const { list, pagination, searchForm, fnGetData, fnResetPagination, tableRef } = useListData(getFreightTrailerList); const fnGetDataTransfer = () => { @@ -158,6 +169,21 @@ const fnResetPaginationTransfer = () => { DEPARTMENT_NAME: searchForm.value.DEPARTMENT_NAME, }); }; +const fnImportDialogChangeShow = () => { + data.importDialogVisible = !data.importDialogVisible; +}; +const fnSubmitImport = async (formData) => { + const resData = await setRiskPointImport(formData); + if (resData.resultStr) { + ElMessage({ + dangerouslyUseHTMLString: true, + message: resData.resultStr, + type: resData.resultType, + }); + } + fnImportDialogChangeShow(); + fnResetPaginationTransfer(); +}; const fnExport = async () => { const selectionData = tableRef.value.getSelectionRows(); if (selectionData.length === 0) { @@ -165,7 +191,9 @@ const fnExport = async () => { return; } await ElMessageBox.confirm("确定要导出到excel吗?", { type: "warning" }); - const DATA_IDS = selectionData.map((item) => item.RISKUNIT_ID).join(","); + const DATA_IDS = selectionData + .map((item) => item.FREIGHTTRAILER_ID) + .join(","); window.location.href = import.meta.env[import.meta.env.DEV ? "VITE_PROXY" : "VITE_BASE_URL"] + "/freightTrailer/excel?" + diff --git a/src/views/enterprise_management/basics_info_management/freight_trailer/view.vue b/src/views/enterprise_management/basics_info_management/freight_trailer/view.vue index 2d125ed..1ab2822 100644 --- a/src/views/enterprise_management/basics_info_management/freight_trailer/view.vue +++ b/src/views/enterprise_management/basics_info_management/freight_trailer/view.vue @@ -33,13 +33,9 @@ {{ info.CAR_OWNERS_TEL }} - {{ info.CONTACTS }} - - - {{ info.CONTACT_PHONE }} diff --git a/src/views/mechanical_files/assigned_manage/index.vue b/src/views/mechanical_files/assigned_manage/index.vue index 441aa49..4f9b2a4 100644 --- a/src/views/mechanical_files/assigned_manage/index.vue +++ b/src/views/mechanical_files/assigned_manage/index.vue @@ -148,12 +148,6 @@ width="140" show-overflow-tooltip /> - - + + + diff --git a/src/views/mechanical_files/beidou/view.vue b/src/views/mechanical_files/beidou/view.vue index 7945406..1965c26 100644 --- a/src/views/mechanical_files/beidou/view.vue +++ b/src/views/mechanical_files/beidou/view.vue @@ -17,12 +17,6 @@ {{ data.busInfo.TRAILER_TYPE }} - - {{ data.busInfo.VEHICLE_MODEL }} - - - {{ data.busInfo.VEHICLE_BRAND }} - {{ data.busInfo.CAR_OWNERS }} diff --git a/src/views/mechanical_files/inspect_annually/add.vue b/src/views/mechanical_files/inspect_annually/add.vue index b2954cd..695d67a 100644 --- a/src/views/mechanical_files/inspect_annually/add.vue +++ b/src/views/mechanical_files/inspect_annually/add.vue @@ -344,12 +344,26 @@ const getDueDate = () => { const getRemiderDate = (val) => { if (val) { if (form.value.DUE_DATE) { - form.value.REMINDER_DATE = subtractDaysFromDate(form.value.DUE_DATE, val); + // 计算提醒日期 + const reminderDateStr = subtractDaysFromDate(form.value.DUE_DATE, val); + const reminderDate = new Date(reminderDateStr); + const today = new Date(); + + // 检查计算出的提醒日期是否早于当前时间 + if (reminderDate < today) { + // 如果提醒日期早于当前日期,显示错误提示并重置提醒日期 + ElMessage.error("输入的提醒天数错误,提醒日期不能早于当前日期。"); + form.value.REMINDER_DATE = ""; // 重置提醒日期 + } else { + // 如果提醒日期正常,更新表单值 + form.value.REMINDER_DATE = reminderDateStr; + } } } else { form.value.REMINDER_DATE = ""; } }; + const getVehicle = async (event) => { const resData = await getTrailerList({ TRAFFIC_TYPE: event }); data.vehicleList = resData.list; diff --git a/src/views/mechanical_files/insure/add.vue b/src/views/mechanical_files/insure/add.vue index 60c170a..210ad1f 100644 --- a/src/views/mechanical_files/insure/add.vue +++ b/src/views/mechanical_files/insure/add.vue @@ -401,7 +401,20 @@ const getDueDate = (val) => { const getRemiderDate = (val) => { if (val) { if (form.value.DUE_DATE) { - form.value.REMINDER_DATE = subtractDaysFromDate(form.value.DUE_DATE, val); + // 计算提醒日期 + const reminderDateStr = subtractDaysFromDate(form.value.DUE_DATE, val); + const reminderDate = new Date(reminderDateStr); + const today = new Date(); + + // 检查计算出的提醒日期是否早于当前时间 + if (reminderDate < today) { + // 如果提醒日期早于当前日期,显示错误提示并重置提醒日期 + ElMessage.error("输入的提醒天数错误,提醒日期不能早于当前日期。"); + form.value.REMINDER_DATE = ""; // 重置提醒日期 + } else { + // 如果提醒日期正常,更新表单值 + form.value.REMINDER_DATE = reminderDateStr; + } } } else { form.value.REMINDER_DATE = ""; diff --git a/src/views/mechanical_files/maintenance/add.vue b/src/views/mechanical_files/maintenance/add.vue index 01fb4f2..565b8b3 100644 --- a/src/views/mechanical_files/maintenance/add.vue +++ b/src/views/mechanical_files/maintenance/add.vue @@ -116,7 +116,7 @@ - + { const getRemiderDate = (val) => { if (val) { if (form.value.DUE_DATE) { - form.value.REMINDER_DATE = subtractDaysFromDate(form.value.DUE_DATE, val); + // 计算提醒日期 + const reminderDateStr = subtractDaysFromDate(form.value.DUE_DATE, val); + const reminderDate = new Date(reminderDateStr); + const today = new Date(); + + // 检查计算出的提醒日期是否早于当前时间 + if (reminderDate < today) { + // 如果提醒日期早于当前日期,显示错误提示并重置提醒日期 + ElMessage.error("输入的提醒天数错误,提醒日期不能早于当前日期。"); + form.value.REMINDER_DATE = ""; // 重置提醒日期 + } else { + // 如果提醒日期正常,更新表单值 + form.value.REMINDER_DATE = reminderDateStr; + } } } else { form.value.REMINDER_DATE = ""; } }; + const getVehicle = async (event) => { const resData = await getTrailerList({ TRAFFIC_TYPE: event }); data.vehicleList = resData.list; diff --git a/src/views/mechanical_files/maintenance/index.vue b/src/views/mechanical_files/maintenance/index.vue index 8a3a29c..763c2be 100644 --- a/src/views/mechanical_files/maintenance/index.vue +++ b/src/views/mechanical_files/maintenance/index.vue @@ -98,11 +98,11 @@ - + + + @@ -119,7 +119,13 @@ 即将到期 - + + + diff --git a/src/views/mechanical_files/maintenance/view.vue b/src/views/mechanical_files/maintenance/view.vue index 4b33f26..6d30ad3 100644 --- a/src/views/mechanical_files/maintenance/view.vue +++ b/src/views/mechanical_files/maintenance/view.vue @@ -17,12 +17,12 @@ {{ data.busInfo.TRAILER_TYPE }} - - {{ data.busInfo.VEHICLE_MODEL }} - - - {{ data.busInfo.VEHICLE_BRAND }} - + + + + + + {{ data.busInfo.CAR_OWNERS }} @@ -53,7 +53,7 @@ {{ info.KILOMETERS }} - {{ info.MAINTENANCE_CYCLE }} + {{ info.MAINTENANCE_CYCLE + "天" }} {{ info.PROCESSING_DATE }} diff --git a/src/views/mechanical_files/operations/add.vue b/src/views/mechanical_files/operations/add.vue index b6a6722..76273b4 100644 --- a/src/views/mechanical_files/operations/add.vue +++ b/src/views/mechanical_files/operations/add.vue @@ -311,7 +311,15 @@ const getDueDate = () => { const getRemiderDate = (val) => { if (val) { if (form.value.DUE_DATE) { - form.value.REMINDER_DATE = subtractDaysFromDate(form.value.DUE_DATE, val); + const reminderDateStr = subtractDaysFromDate(form.value.DUE_DATE, val); + const reminderDate = new Date(reminderDateStr); + const today = new Date(); + if (reminderDate < today) { + ElMessage.error("输入的提醒天数错误,提醒日期不能早于当前日期。"); + form.value.REMINDER_DAYS = ""; + } else { + form.value.REMINDER_DATE = reminderDateStr; + } } } else { form.value.REMINDER_DATE = ""; diff --git a/src/views/mechanical_files/operations/index.vue b/src/views/mechanical_files/operations/index.vue index 8e25983..b473dcc 100644 --- a/src/views/mechanical_files/operations/index.vue +++ b/src/views/mechanical_files/operations/index.vue @@ -98,7 +98,7 @@ {{ serialNumber(pagination, $index) }} - + - + + + diff --git a/src/views/mechanical_files/operations/view.vue b/src/views/mechanical_files/operations/view.vue index 1ec7624..d54166a 100644 --- a/src/views/mechanical_files/operations/view.vue +++ b/src/views/mechanical_files/operations/view.vue @@ -17,12 +17,12 @@ {{ data.busInfo.TRAILER_TYPE }} - - {{ data.busInfo.VEHICLE_MODEL }} - - - {{ data.busInfo.VEHICLE_BRAND }} - + + + + + + {{ data.busInfo.CAR_OWNERS }} diff --git a/src/views/mechanical_files/production_accident/add.vue b/src/views/mechanical_files/production_accident/add.vue index 34e0557..10178bb 100644 --- a/src/views/mechanical_files/production_accident/add.vue +++ b/src/views/mechanical_files/production_accident/add.vue @@ -402,7 +402,7 @@