diff --git a/src/views/material/repair/repairManage/component/home.vue b/src/views/material/repair/repairManage/component/home.vue index 8dc395ce..1317d18a 100644 --- a/src/views/material/repair/repairManage/component/home.vue +++ b/src/views/material/repair/repairManage/component/home.vue @@ -46,9 +46,9 @@ - - + + @@ -280,6 +280,7 @@ import { import { getInfo, h } from '@/api/login' import vueEasyPrint from "vue-easy-print"; +import { formatTime } from '@/utils/bonus' export default { name: '', dicts: ['repair_task_status'], @@ -375,10 +376,10 @@ export default { onDictReady(dict) { // 获取repair_task_status的所有选项,并过滤出有效的选项(值为0、1、2、4) const allOptions = dict.type.repair_task_status || [] - const validOptions = allOptions.filter(item => + const validOptions = allOptions.filter(item => item.value == 0 || item.value == 1 || item.value == 2 || item.value == 4 ) - + // 如果有有效选项,设置第一个为默认值 if (validOptions.length > 0) { this.queryParams.repairStatus = validOptions[0].value @@ -386,7 +387,7 @@ export default { if (validOptions.length > 1) { this.queryParams.repairStatus = validOptions[1].value } - + // 执行查询 this.getList() }, @@ -458,16 +459,6 @@ export default { }, /** 导出按钮操作 */ handleExport() { - const formatTime = (date) => { - const year = date.getFullYear(); - const month = String(date.getMonth() + 1).padStart(2, '0'); - const day = String(date.getDate()).padStart(2, '0'); - const hours = String(date.getHours()).padStart(2, '0'); - const minutes = String(date.getMinutes()).padStart(2, '0'); - const seconds = String(date.getSeconds()).padStart(2, '0'); - return `${year}${month}${day}_${hours}${minutes}${seconds}`; - }; - const currentTime = formatTime(new Date()); this.download( 'material/repair/export', diff --git a/src/views/material/repair/testExamine/component/homeApply.vue b/src/views/material/repair/testExamine/component/homeApply.vue index 385d7dc5..4c9e2c8d 100644 --- a/src/views/material/repair/testExamine/component/homeApply.vue +++ b/src/views/material/repair/testExamine/component/homeApply.vue @@ -123,29 +123,50 @@ prop="unitName" /> + - + + + @@ -224,6 +245,7 @@ import { outerAudit, } from "@/api/repair/testExamine"; import router from "@/router"; +import { formatTime } from '@/utils/bonus' export default { name: "Home", dicts: ['repair_task_status'], @@ -307,15 +329,15 @@ export default { onDictReady(dict) { // 获取repair_task_status的所有选项,并过滤出有效的选项(值为10、11、12) const allOptions = dict.type.repair_task_status || [] - const validOptions = allOptions.filter(item => + const validOptions = allOptions.filter(item => item.value == 10 || item.value == 11 || item.value == 12 ) - + // 如果有有效选项,设置第一个为默认值 if (validOptions.length > 0) { this.queryParams.taskStatus = validOptions[0].value } - + // 执行查询 this.getList() }, @@ -510,17 +532,8 @@ export default { }, /** 导出按钮操作 */ - handleExport() { - const formatTime = (date) => { - const year = date.getFullYear(); - const month = String(date.getMonth() + 1).padStart(2, '0'); - const day = String(date.getDate()).padStart(2, '0'); - const hours = String(date.getHours()).padStart(2, '0'); - const minutes = String(date.getMinutes()).padStart(2, '0'); - const seconds = String(date.getSeconds()).padStart(2, '0'); - return `${year}${month}${day}_${hours}${minutes}${seconds}`; - }; + handleExport() { const currentTime = formatTime(new Date()); this.download( "/material/repair_audit_details/export", @@ -529,7 +542,7 @@ export default { startTime: this.queryParams.time && this.queryParams.time[0], endTime: this.queryParams.time && this.queryParams.time[1], }, - `修试审核_${currentTime}.xlsx` + `修试审核数据一览表_${currentTime}.xlsx` ); }, diff --git a/src/views/materialsStation/toolsLease/apply/leaseRecord.vue b/src/views/materialsStation/toolsLease/apply/leaseRecord.vue index 6ee47a10..334572dd 100644 --- a/src/views/materialsStation/toolsLease/apply/leaseRecord.vue +++ b/src/views/materialsStation/toolsLease/apply/leaseRecord.vue @@ -231,6 +231,7 @@ import { getLeaseInfoDetailsApi, getLeaseInfoDetailsNoPageListApi, getSecondLeaseInfoApi, getImpUnitListApi, getDepartListByImpUnitApi, getProListByDepartApi, getTeamList, getSubUnitList } from '@/api/materialsStation' +import { formatTime } from '@/utils/bonus' export default { name: '', @@ -546,7 +547,7 @@ export default { { ...this.queryParams }, - `工器具领料记录_${new Date().getTime()}.xlsx` + `工器具领料记录_${formatTime(new Date())}.xlsx` ) }, //查看在库编码数据