From 889f4472e65d35e9ff2f3cefe071a0692c3a75e8 Mon Sep 17 00:00:00 2001 From: lb Date: Thu, 29 Feb 2024 16:49:54 +0800 Subject: [PATCH] bugfix equipmentRepair --- .../maintain/CustomDialogForm.vue | 27 ++-- .../specialEquipment/maintain/Repair--add.vue | 127 +++++++----------- .../specialEquipment/maintain/Repair.vue | 3 + 3 files changed, 68 insertions(+), 89 deletions(-) diff --git a/src/views/specialEquipment/maintain/CustomDialogForm.vue b/src/views/specialEquipment/maintain/CustomDialogForm.vue index 32f87620..e5b8052f 100644 --- a/src/views/specialEquipment/maintain/CustomDialogForm.vue +++ b/src/views/specialEquipment/maintain/CustomDialogForm.vue @@ -23,7 +23,7 @@ - {{ parseTime(dataForm.faultTime) }} + {{ parseTime(dataForm.faultTime) }} @@ -43,7 +43,7 @@ - + {{ getDictDataLabel('fault-level', dataForm.faultLevel) }} @@ -51,7 +51,7 @@ - + {{ getDictDataLabel('fault-type', dataForm.faultType) }} @@ -59,19 +59,19 @@ - {{ dataForm.repairman }} + {{ dataForm.repairman }} - {{ dataForm.repairmanPhone }} + {{ dataForm.repairmanPhone }} - + {{ getDictDataLabel('repair-mode', dataForm.repairMode) }} @@ -88,25 +88,25 @@ :disabled="disabled" @delete="!disabled && handleDeleteFile(file, col.prop)" /> -

暂无附件

+

暂无附件

- {{ parseTime(dataForm.createTime) }} + {{ parseTime(dataForm.createTime) }} - {{ dataForm.creator }} + {{ dataForm.creator }} - {{ dataForm.remark }} + {{ dataForm.remark || '- 无 -' }}
@@ -159,8 +159,7 @@ const uploadedFile = { document.body.removeChild(link); }, }, - mounted() { - }, + mounted() {}, render: function (h) { return (
>> .el-form-item__label { + font-weight: 700; +} + .drawer-body__footer { display: flex; justify-content: flex-end; diff --git a/src/views/specialEquipment/maintain/Repair--add.vue b/src/views/specialEquipment/maintain/Repair--add.vue index 05165a96..95caa00a 100644 --- a/src/views/specialEquipment/maintain/Repair--add.vue +++ b/src/views/specialEquipment/maintain/Repair--add.vue @@ -29,7 +29,7 @@ - + - + @@ -116,16 +116,7 @@ - + - + - + - + - + { - this.equipmentOptions = this.equipmentList - .filter((item) => item.special) - .filter( - (item) => item.specialType === this.form.equipmentCategory - ) - .map((item) => ({ label: item.name, value: item.id })); - }, 1000); - } + // if (this.form.equipmentCategory != null) { + // setTimeout(() => { + // this.equipmentOptions = this.equipmentList + // .filter((item) => item.special) + // .filter( + // (item) => item.specialType === this.form.equipmentCategory + // ) + // .map((item) => ({ label: item.name, value: item.id })); + // }, 1000); + // } if (this.hasFiles) { if (typeof this.hasFiles == 'boolean' && this.hasFiles) { this.form.files = this.form.files ?? []; @@ -591,9 +563,9 @@ export default { this.formLoading = true; await this.getCode(); await this.initEquipment(); - await this.initLines(); + // await this.initLines(); await this.initWorker(); - await this.initSections(); + // await this.initSections(); this.formLoading = false; this.isInit = false; this.setInitWorker(); @@ -602,36 +574,37 @@ export default { /** 设置默认维修工为用户自己 */ setInitWorker() { /** 获取用户自身id */ - const userId = this.$store.getters.userId; + const nickname = this.$store.getters.nickname; this.$nextTick(() => { - this.form.repairman = [userId]; + this.form.repairman = [nickname]; }); }, /** 获取产线 */ - async initLines() { - const res = await this.$axios('/base/core-production-line/listAll'); - this.lineOptions = (res.data || []).map((item) => ({ - label: item.name, - value: item.id, - })); - }, + // async initLines() { + // const res = await this.$axios('/base/core-production-line/listAll'); + // this.lineOptions = (res.data || []).map((item) => ({ + // label: item.name, + // value: item.id, + // })); + // }, + + // /** 获取工段 */ + // async initSections(byLineId) { + // this.formLoading = !this.isInit && true; + // const res = await this.$axios({ + // url: + // byLineId && !this.isInit + // ? '/base/core-workshop-section/listByParentId?id=' + byLineId + // : '/base/core-workshop-section/listAll', + // }); + // this.sectionOptions = (res.data || []).map((item) => ({ + // label: item.name, + // value: item.id, + // })); + // this.formLoading = !this.isInit && false; + // }, - /** 获取工段 */ - async initSections(byLineId) { - this.formLoading = !this.isInit && true; - const res = await this.$axios({ - url: - byLineId && !this.isInit - ? '/base/core-workshop-section/listByParentId?id=' + byLineId - : '/base/core-workshop-section/listAll', - }); - this.sectionOptions = (res.data || []).map((item) => ({ - label: item.name, - value: item.id, - })); - this.formLoading = !this.isInit && false; - }, /** 获取设备 */ async initEquipment(type = 'special-equipment') { const response = await this.$axios('/base/core-equipment/listAll'); @@ -642,8 +615,8 @@ export default { label: item.name, value: item.id, })); - this.equipmentOptions = equipmentOptions; - this.allSpeicalEquipments = equipmentOptions; + this.equipmentOptions = [...equipmentOptions]; + this.allSpeicalEquipments = [...equipmentOptions]; }, /** 获取维修工 - 同时从用户表和员工表拉取数据 */ async initWorker() { @@ -659,7 +632,7 @@ export default { list = list.concat( (userList.data?.list || []).map((item) => ({ label: item.nickname, - value: item.id, + value: item.nickname, })) ); /** worker */ @@ -669,7 +642,7 @@ export default { list = list.concat( (workerList.data || []).map((item) => ({ label: item.name, - value: item.id, + value: item.name, })) ); /** setting */ diff --git a/src/views/specialEquipment/maintain/Repair.vue b/src/views/specialEquipment/maintain/Repair.vue index 188db221..4a60ecd9 100644 --- a/src/views/specialEquipment/maintain/Repair.vue +++ b/src/views/specialEquipment/maintain/Repair.vue @@ -42,6 +42,7 @@ @@ -146,6 +147,7 @@ export default { label: '故障明细', minWidth: 120, showOverflowtooltip: true, + subcomponent: htmls, }, { prop: 'maintenanceStartTime', @@ -172,6 +174,7 @@ export default { label: '维修描述', showOverflowtooltip: true, width: 110, + subcomponent: htmls, }, { prop: 'remark',