From 10bd09b8a6456d3efa2105e384dc1d9af255af5e Mon Sep 17 00:00:00 2001 From: xusd Date: Thu, 5 Sep 2024 17:54:14 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=B4=E4=BF=AE=E5=B7=A5=E5=8D=95=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E8=AF=A6=E6=83=85=E6=9F=A5=E7=9C=8B=E7=BB=B4=E4=BF=AE?= =?UTF-8?q?=E6=8A=A5=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../maintenance/maintenanceRecord/index.vue | 11 +++- .../MaintenanceReportDetails.vue | 62 ++++++------------- 2 files changed, 28 insertions(+), 45 deletions(-) diff --git a/imt-ui/src/views/system/maintenance/maintenanceRecord/index.vue b/imt-ui/src/views/system/maintenance/maintenanceRecord/index.vue index f4305f1..b98c0a6 100644 --- a/imt-ui/src/views/system/maintenance/maintenanceRecord/index.vue +++ b/imt-ui/src/views/system/maintenance/maintenanceRecord/index.vue @@ -110,7 +110,7 @@ label="维修报告:" prop="diagnoiseReportId" > - 维修报告 + 维修报告 @@ -199,6 +199,7 @@ 关 闭 + @@ -207,9 +208,13 @@ import * as RemoteMaintenanceOrderApi from '@/api/system/maintenance/maintenance import {getEquipCascader} from '@/api/system/equip/equipInfo' import {getComponentSelection} from '@/api/system/equip/componentInfo' import {getCustomerSelection} from '@/api/system/baseData/customerInfo' +import MaintenanceReportDetails from '@/views/system/maintenance/maintenanceReport/MaintenanceReportDetails.vue'; export default { name: "RemoteMaintenanceOrder", + components: { + MaintenanceReportDetails, + }, data() { return { detailOpen: false, @@ -253,6 +258,10 @@ export default { this.initSelection(); }, methods: { + openReport(maintenanceOrderNo,id){ + console.log(id) + this.$refs["formRef"].open(maintenanceOrderNo,id); + }, closeDetails(){ this.detailOpen = false; this.detailForm = {}; diff --git a/imt-ui/src/views/system/maintenance/maintenanceReport/MaintenanceReportDetails.vue b/imt-ui/src/views/system/maintenance/maintenanceReport/MaintenanceReportDetails.vue index 0c33841..bbc9179 100644 --- a/imt-ui/src/views/system/maintenance/maintenanceReport/MaintenanceReportDetails.vue +++ b/imt-ui/src/views/system/maintenance/maintenanceReport/MaintenanceReportDetails.vue @@ -2,34 +2,34 @@
- + - - {{formData.maintenanceOrderId}} + + {{formData.maintenanceOrderNo}} - + - + {{formData.maintenanceContent}} - + {{formData.maintenanceProblem}} - + {{formData.maintenanceEvaluation}} - + {{formData.remark}} @@ -67,51 +67,25 @@ export default { }, // 表单校验 formRules: { - maintenanceOrderId: [{required: true, message: '维修工单id不能为空', trigger: 'change'}], }, }; }, methods: { /** 打开弹窗 */ - async open(id) { - this.dialogVisible = true; + open(maintenanceOrderNo,id) { this.reset(); - // 修改时,设置数据 - if (id) { - this.formLoading = true; - try { - const res = await MaintenanceReportApi.getMaintenanceReport(id); - this.formData = res.data; - this.title = "修改维修报告"; - } finally { - this.formLoading = false; - } - } - this.title = "新增维修报告"; - }, - /** 提交按钮 */ - async submitForm() { - // 校验主表 - await this.$refs["formRef"].validate(); - this.formLoading = true; - try { - const data = this.formData; - // 修改的提交 - if (data.maintenanceReportId) { - await MaintenanceReportApi.updateMaintenanceReport(data); - this.$modal.msgSuccess("修改成功"); - this.dialogVisible = false; - this.$emit('success'); + MaintenanceReportApi.getMaintenanceReport(id).then(res=>{ + if (res.data == null){ + this.$message.error('未查询到数据') return; } - // 添加的提交 - await MaintenanceReportApi.createMaintenanceReport(data); - this.$modal.msgSuccess("新增成功"); - this.dialogVisible = false; - this.$emit('success'); - } finally { + this.dialogVisible = true; + this.formLoading = true; + this.formData = res.data; + this.formData.maintenanceOrderNo = maintenanceOrderNo; this.formLoading = false; - } + this.dialogTitle = "维修报告详情"; + }) }, /** 表单重置 */ reset() {