diff --git a/src/views/modules/eam/eamWorkOrderForMaintenance.vue b/src/views/modules/eam/eamWorkOrderForMaintenance.vue index d5478d2..ace3ac9 100644 --- a/src/views/modules/eam/eamWorkOrderForMaintenance.vue +++ b/src/views/modules/eam/eamWorkOrderForMaintenance.vue @@ -737,6 +737,24 @@ fixed: '', columnWidth: 130, }, + { + userId: this.$store.state.user.name, + functionId: 101003004, + serialNumber: '101003004Table1LastExecutionDate', + tableId: "101003004Table1", + tableName: "维保工单表", + columnProp: 'lastExecutionDate', + headerAlign: "center", + align: "center", + columnLabel: '最晚执行日期', + columnHidden: false, + columnImage: false, + columnSortable: true, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 130, + }, { userId: this.$store.state.user.name, functionId: 101003004, diff --git a/src/views/modules/eam/eamWorkPlanForCheck.vue b/src/views/modules/eam/eamWorkPlanForCheck.vue index 355598b..7508181 100644 --- a/src/views/modules/eam/eamWorkPlanForCheck.vue +++ b/src/views/modules/eam/eamWorkPlanForCheck.vue @@ -2618,6 +2618,12 @@ // 下达 createOrder (row) { + if (row.planStartDate < this.dayjs().format("YYYY-MM-DD")) { + this.$alert('计划开始日期小于今天!请修改开始日期', '错误', { + confirmButtonText: '确定' + }) + return false + } let tempData = { site: row.site, buNo: row.buNo, @@ -2629,42 +2635,35 @@ getPlanDetailList(row).then(({data}) => { if (data && data.code === 0) { tempData.objectList = data.rows + this.$confirm(`是否下达点检工单?`, '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + this.dataListLoading = true + createEamWorkOrder(tempData).then(({data}) => { + if (data && data.code === 0) { + this.getDataList() + this.$message({ + message: '操作成功', + type: 'success', + duration: 1500, + onClose: () => {} + }) + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + this.dataListLoading = false + }) + }) } else { this.$alert(data.msg, '错误', { confirmButtonText: '确定' }) } }) - if (row.planStartDate < this.dayjs().format("YYYY-MM-DD")) { - this.$alert('计划开始日期小于今天!请修改开始日期', '错误', { - confirmButtonText: '确定' - }) - return false - } - this.$confirm(`是否下达点检工单?`, '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', - type: 'warning' - }).then(() => { - this.dataListLoading = true - createEamWorkOrder(tempData).then(({data}) => { - if (data && data.code === 0) { - this.getDataList() - this.$message({ - message: '操作成功', - type: 'success', - duration: 1500, - onClose: () => {} - }) - } else { - this.$alert(data.msg, '错误', { - confirmButtonText: '确定' - }) - } - this.dataListLoading = false - }) - }).catch(() => { - }) }, objectIDBlur () { diff --git a/src/views/modules/eam/eamWorkPlanForMaintenance.vue b/src/views/modules/eam/eamWorkPlanForMaintenance.vue index 5225208..9154fb9 100644 --- a/src/views/modules/eam/eamWorkPlanForMaintenance.vue +++ b/src/views/modules/eam/eamWorkPlanForMaintenance.vue @@ -2325,25 +2325,6 @@ } this.saveLoading = true this.modalData.objectList = this.dataListSelections - // let obj = document.getElementsByName('addWorkOrderRule') - // let s = '' - // for (let i = 0; i < obj.length; i++) { - // if (obj[i].checked) { - // s += obj[i].value + ',' - // } - // } - // s = s.substring(0,s.length-1) - // this.modalData.workOrderRule = s - // // 自动生成 - // let obj2 = document.getElementsByName('addAutoRenewalRule') - // let s2 = '' - // for (let i = 0; i < obj2.length; i++) { - // if (obj2[i].checked) { - // s2 += obj2[i].value + ',' - // } - // } - // s2 = s2.substring(0, s2.length - 1) - // this.modalData.autoRenewal = s2 eamWorkPlanSave(this.modalData).then(({data}) => { if (data && data.code === 0) { this.getDataList() @@ -2364,25 +2345,6 @@ } else { this.updateLoading = true this.modalData.objectList = this.updateObjectList - // let obj = document.getElementsByName('updateWorkOrderRule') - // let s = '' - // for (let i = 0; i < obj.length; i++) { - // if (obj[i].checked) { - // s += obj[i].value + ',' - // } - // } - // s = s.substring(0,s.length-1) - // this.modalData.workOrderRule = s - // // 自动生成 - // let obj2 = document.getElementsByName('updateAutoRenewalRule') - // let s2 = '' - // for (let i = 0; i < obj2.length; i++) { - // if (obj2[i].checked) { - // s2 += obj2[i].value + ',' - // } - // } - // s2 = s2.substring(0, s2.length - 1) - // this.modalData.autoRenewal = s2 eamWorkPlanEdit(this.modalData).then(({data}) => { if (data && data.code === 0) { this.getDataList() @@ -2608,6 +2570,12 @@ // 下达 createOrder (row) { + if (row.planStartDate < this.dayjs().format("YYYY-MM-DD")) { + this.$alert('计划开始日期小于今天!请修改开始日期', '错误', { + confirmButtonText: '确定' + }) + return false + } let tempData = { site: row.site, buNo: row.buNo, @@ -2619,43 +2587,36 @@ getPlanDetailList(row).then(({data}) => { if (data && data.code === 0) { tempData.objectList = data.rows + row.userId = this.$store.state.user.name + this.$confirm(`是否下达维保工单?`, '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + this.dataListLoading = true + createEamWorkOrder(tempData).then(({data}) => { + if (data && data.code === 0) { + this.getDataList() + this.$message({ + message: '操作成功', + type: 'success', + duration: 1500, + onClose: () => {} + }) + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + this.dataListLoading = false + }) + }) } else { this.$alert(data.msg, '错误', { confirmButtonText: '确定' }) } }) - if (row.planStartDate < this.dayjs().format("YYYY-MM-DD")) { - this.$alert('计划开始日期小于今天!请修改开始日期', '错误', { - confirmButtonText: '确定' - }) - return false - } - row.userId = this.$store.state.user.name - this.$confirm(`是否下达维保工单?`, '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', - type: 'warning' - }).then(() => { - this.dataListLoading = true - createEamWorkOrder(tempData).then(({data}) => { - if (data && data.code === 0) { - this.getDataList() - this.$message({ - message: '操作成功', - type: 'success', - duration: 1500, - onClose: () => {} - }) - } else { - this.$alert(data.msg, '错误', { - confirmButtonText: '确定' - }) - } - this.dataListLoading = false - }) - }).catch(() => { - }) }, objectIDBlur () {