From 8abe75a9b9ae22f86cc733cb1c51257d5aedf343 Mon Sep 17 00:00:00 2001 From: lb Date: Tue, 27 Feb 2024 15:55:52 +0800 Subject: [PATCH 1/2] =?UTF-8?q?update=E5=BE=85=E7=A1=AE=E8=AE=A4=E5=B7=A1?= =?UTF-8?q?=E6=A3=80=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.dev | 3 +- .../specialEquipment/check/Content-add.vue | 17 +- .../check/Content-add_detail.vue | 515 ++++++++++++++++++ .../specialEquipment/check/Content-edit.vue | 81 ++- src/views/specialEquipment/check/Content.vue | 31 +- 5 files changed, 613 insertions(+), 34 deletions(-) create mode 100644 src/views/specialEquipment/check/Content-add_detail.vue diff --git a/.env.dev b/.env.dev index e86bf076..e6eafbc1 100644 --- a/.env.dev +++ b/.env.dev @@ -20,9 +20,10 @@ VUE_APP_TITLE = MES系统 # VUE_APP_BASE_API = 'http://192.168.1.8:48082' # VUE_APP_BASE_API = 'http://192.168.4.159:48080' # VUE_APP_BASE_API = 'http://192.168.1.104:48082' -VUE_APP_BASE_API = 'http://192.168.0.33:48082' +# VUE_APP_BASE_API = 'http://192.168.0.33:48082' # VUE_APP_BASE_API = 'http://192.168.1.62:48082' # VUE_APP_BASE_API = 'http://192.168.1.78:48082' +VUE_APP_BASE_API = 'http://192.168.1.47:48082' # socket地址 VUE_APP_Socket_API = 'ws://192.168.0.30:8888' VUE_APP_Socket_Dcs_API = 'ws://10.70.180.10:8081' diff --git a/src/views/specialEquipment/check/Content-add.vue b/src/views/specialEquipment/check/Content-add.vue index b245bc9d..21f1f702 100644 --- a/src/views/specialEquipment/check/Content-add.vue +++ b/src/views/specialEquipment/check/Content-add.vue @@ -157,12 +157,12 @@ export default { } catch (err) {} if (!valid) return; - let confirmed = false; - try { - confirmed = await this.getConfirmed(); - } catch (err) { - confirmed = false; - } + // let confirmed = false; + // try { + // confirmed = await this.getConfirmed(); + // } catch (err) { + // confirmed = false; + // } const res = await this.$axios({ url: '/base/equipment-check-order' + @@ -171,7 +171,8 @@ export default { data: { ...this.dataForm, special: true, - status: confirmed ? 2 : 1, + status: 1, + // status: confirmed ? 2 : 1, groupClass: this.dataForm.groupClass.join(','), checkPerson: this.$store.getters.userId, }, @@ -179,7 +180,9 @@ export default { if (res.code == 0) { this.$emit('refreshDataList'); this.$message.success(this.dataForm.id ? '更新成功' : '创建成功'); + return res.data; } + return null; }, }, }; diff --git a/src/views/specialEquipment/check/Content-add_detail.vue b/src/views/specialEquipment/check/Content-add_detail.vue new file mode 100644 index 00000000..d3f55e01 --- /dev/null +++ b/src/views/specialEquipment/check/Content-add_detail.vue @@ -0,0 +1,515 @@ + + + + + + + diff --git a/src/views/specialEquipment/check/Content-edit.vue b/src/views/specialEquipment/check/Content-edit.vue index 95082642..67f45456 100644 --- a/src/views/specialEquipment/check/Content-edit.vue +++ b/src/views/specialEquipment/check/Content-edit.vue @@ -14,7 +14,7 @@ custom-class="mes-drawer" size="60%" @closed="$emit('destroy')"> - 编辑 + {{ disableEdit ? '详情' : '编辑' }}
@@ -129,7 +129,7 @@
@@ -146,7 +146,7 @@ @@ -234,20 +234,6 @@ export default { formLoading: false, departmentList: [], inspectorOptions: [], - attrTableProps: [ - { - prop: 'equipmentName', - label: '设备名称', - }, - { - prop: 'program', - label: '巡检项目', - }, - { - prop: 'checkResult', - label: '巡检结果', - }, - ], attrList: [], attrTotal: 0, attrTitle: '', @@ -339,6 +325,66 @@ export default { value: item.id, })); }, + disableModifyDetail() { + return this.form && this.form.confirmTimeLimit != undefined; + }, + attrTableProps() { + return [ + { + prop: 'equipmentName', + label: '设备名称', + }, + { + prop: 'program', + label: '巡检项目', + }, + { + prop: 'checkResult', + label: '巡检结果', + subcomponent: this.disableModifyDetail + ? { + name: 'TableCellInput', + props: ['injectData'], + data() { + return { + inputvalue: null, + }; + }, + mounted() { + this.inputvalue = this.injectData.checkResult; + }, + methods: { + async handleValueChange(newCheckResult) { + document.body.style.cursor = 'wait'; + await this.$axios({ + url: '/base/equipment-check-order-det/update', + method: 'put', + data: { + orderId: this.injectData.orderId, + equipmentId: this.injectData.equipmentId, + program: this.injectData.program, + id: this.injectData.id, + checkResult: newCheckResult, + }, + }); + document.body.style.cursor = 'default'; + }, + }, + render: function (h) { + return ( + + ); + }, + } + : null, + }, + ]; + }, }, mounted() { this.formLoading = true; @@ -399,6 +445,7 @@ export default { }, async getInfo(row) { + console.log('row', row); const res = await this.$axios( '/base/equipment-check-order/get?id=' + row.id ); diff --git a/src/views/specialEquipment/check/Content.vue b/src/views/specialEquipment/check/Content.vue index 7044619a..06c1bae4 100644 --- a/src/views/specialEquipment/check/Content.vue +++ b/src/views/specialEquipment/check/Content.vue @@ -41,17 +41,17 @@ - - - + +
@@ -62,14 +62,16 @@ import add from './Content-add.vue'; import { parseTime } from '../../core/mixins/code-filter'; import CheckOrderListTable from './CheckOrderListTable.vue'; import edit from './Content-edit.vue'; +import AddCheckDet from './Content-add_detail.vue'; export default { name: 'SpecialEquipmentCheckConfig', - components: { addOrUpdata, add, edit, CheckOrderListTable }, + components: { addOrUpdata, add, edit, AddCheckDet, CheckOrderListTable }, mixins: [basicPageMixin], data() { return { editOpen: false, + detOpen: false, addOrUpdateVisible: false, addOrEditTitle: '', searchBarKeys: ['name'], @@ -188,8 +190,19 @@ export default { this.getList(); }, methods: { - handleSubmit() { - this.$refs.add.dataFormSubmit(); + async handleSubmit() { + const id = await this.$refs.add.dataFormSubmit(); + + setTimeout(() => { + this.handleAddDetail(id); + }, 500); + }, + + handleAddDetail(id) { + this.detOpen = true; + this.$nextTick(() => { + this.$refs['content-detail'].init({ id }); + }); }, successSubmit() { From 7287a1f6faa377c0665e5c8e8bc2a6de45d59a60 Mon Sep 17 00:00:00 2001 From: lb Date: Tue, 27 Feb 2024 16:13:54 +0800 Subject: [PATCH 2/2] update --- src/views/specialEquipment/check/Content-add_detail.vue | 2 +- src/views/specialEquipment/check/Content-edit.vue | 2 +- src/views/specialEquipment/check/Content.vue | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/views/specialEquipment/check/Content-add_detail.vue b/src/views/specialEquipment/check/Content-add_detail.vue index d3f55e01..b9acd19d 100644 --- a/src/views/specialEquipment/check/Content-add_detail.vue +++ b/src/views/specialEquipment/check/Content-add_detail.vue @@ -374,7 +374,7 @@ export default { handleAddAttr() { if (!this.row.id) return this.$message.error('请先选中保养记录'); this.resetAttrform(); - this.attrTitle = '添加设备属性'; + this.attrTitle = '添加巡检内容'; this.attrFormVisible = true; }, diff --git a/src/views/specialEquipment/check/Content-edit.vue b/src/views/specialEquipment/check/Content-edit.vue index 67f45456..cdb36fa0 100644 --- a/src/views/specialEquipment/check/Content-edit.vue +++ b/src/views/specialEquipment/check/Content-edit.vue @@ -558,7 +558,7 @@ export default { handleAddAttr() { if (!this.row.id) return this.$message.error('请先选中保养记录'); this.resetAttrform(); - this.attrTitle = '添加设备属性'; + this.attrTitle = '添加巡检内容'; this.attrFormVisible = true; }, diff --git a/src/views/specialEquipment/check/Content.vue b/src/views/specialEquipment/check/Content.vue index 06c1bae4..ddd1d638 100644 --- a/src/views/specialEquipment/check/Content.vue +++ b/src/views/specialEquipment/check/Content.vue @@ -281,7 +281,7 @@ export default { /** 新增按钮操作 */ handleAdd() { this.open = true; - this.title = '添加待确认巡检设置'; + this.title = '新建巡检单'; this.$nextTick(() => { this.$refs.add.init(); });