From 614d114202f4b5c4306e3ecb88bb84c0eada79fd Mon Sep 17 00:00:00 2001 From: Joe <1712833832@qq.com> Date: Mon, 5 Feb 2024 09:38:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20=E4=B8=9A=E5=8A=A1?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=AE=A1=E7=90=86bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/ModifyDutyInformationTable.vue | 16 ++++++++++------ .../views/dutyOfficer/index.vue | 3 ++- .../components/AddNEditDialog.vue | 6 ++---- .../components/AddNEditDialog.vue | 14 ++++++-------- .../views/jurisdictionalManagement/index.vue | 2 +- 5 files changed, 21 insertions(+), 20 deletions(-) diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/businessDataManagement/views/dutyOfficer/components/ModifyDutyInformationTable.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/businessDataManagement/views/dutyOfficer/components/ModifyDutyInformationTable.vue index a91c75de..34b3e118 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/businessDataManagement/views/dutyOfficer/components/ModifyDutyInformationTable.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/businessDataManagement/views/dutyOfficer/components/ModifyDutyInformationTable.vue @@ -20,7 +20,8 @@

白天值班:

-

{{ item.name }}

+

{{ + item.name }}

未添加人员
@@ -28,7 +29,8 @@

晚上值班:

-

{{ item.name }}

+

{{ + item.name }}

未添加人员
@@ -122,8 +124,11 @@ export default { immediate: true, async handler(bool) { if (!bool) return; - if (!this.data) { + this.dayShift = [...this.data?.dayShift || []]; + this.graveyardShift = [...this.data?.graveyardShift || []]; + + if (!this.data) { const result = await getSelectOptionsStation(2); this.formList[0].options.options = (result || []); @@ -131,8 +136,6 @@ export default { } this.getPeopleList(this.data.station); - this.dayShift = [...this.data.dayShift || []]; - this.graveyardShift = [...this.data.graveyardShift || []]; } } }, @@ -214,6 +217,7 @@ export default { if (!this.data) { this.updateData(data) .then((result) => { + console.log("%c [ result ]-217-「ModifyDutyInformationTable.vue」", "font-size:15px; background:#335cf6; color:#77a0ff;", result); if (result.code != 200) return Message.error("保存失败"); Message.success("保存成功"); @@ -252,7 +256,7 @@ export default { ]) .then(([del, update]) => { if (del.status === 'rejected' && update.status === 'rejected') return Message.error("修改失败"); - if (del.value.code != '200' && update.value.code != '200') return Message.error("修改失败"); + if (del.value?.code != '200' && update.value?.code != '200') return Message.error("修改失败"); this.$emit('close') }) diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/businessDataManagement/views/dutyOfficer/index.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/businessDataManagement/views/dutyOfficer/index.vue index 1b1b4e36..0f71a041 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/businessDataManagement/views/dutyOfficer/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/businessDataManagement/views/dutyOfficer/index.vue @@ -186,7 +186,8 @@ export default { if (!bool) this.setCurrentPage(1); this.modifyDutyInformationTableVisible = bool; - this.dialogData = { + + this.dialogData = !data ? null : { ...data, dayShift: (data.dayShift || []).map(item => ({ ...item, delId: item.id, id: item.employeesId })), graveyardShift: (data.graveyardShift || []).map(item => ({ ...item, id: item.employeesId })) diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/businessDataManagement/views/emergencyAgencies/components/AddNEditDialog.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/businessDataManagement/views/emergencyAgencies/components/AddNEditDialog.vue index e24a7344..02f494fa 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/businessDataManagement/views/emergencyAgencies/components/AddNEditDialog.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/businessDataManagement/views/emergencyAgencies/components/AddNEditDialog.vue @@ -168,9 +168,8 @@ export default { handler(bool) { if (!bool) return; - if (this.data) { - this.formData = - { + this.formData = + !this.data ? null : { "parentId": this.data.dcOrganizations.parentId, "organizationType": this.data.dcOrganizations.organizationType, "organizationName": this.data.dcOrganizations.organizationName, @@ -180,7 +179,6 @@ export default { "rescueUnit": this.data.dcOrganizations.rescueUnit, "description": this.data.dcOrganizations.description } - } this.getOptions(); } diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/businessDataManagement/views/jurisdictionalManagement/components/AddNEditDialog.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/businessDataManagement/views/jurisdictionalManagement/components/AddNEditDialog.vue index b2abfb1d..e1ef72c9 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/businessDataManagement/views/jurisdictionalManagement/components/AddNEditDialog.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/businessDataManagement/views/jurisdictionalManagement/components/AddNEditDialog.vue @@ -64,13 +64,11 @@ export default { handler(bool) { if (!bool) return; - if (this.data) { - this.formData = { - ...this.data, - deptId: [], - endStakeMark: stakeMarkToArray(this.data.endStakeMark), - startStakeMark: stakeMarkToArray(this.data.startStakeMark), - } + this.formData = !this.data ? {} : { + ...this.data, + deptId: [], + endStakeMark: stakeMarkToArray(this.data.endStakeMark), + startStakeMark: stakeMarkToArray(this.data.startStakeMark), } this.getSelectOptions(); @@ -95,7 +93,7 @@ export default { if (departmentData.status != 'rejected' && departmentData.value.code == 200) { this.formList[0].options.options = departmentData.value.data; - this.formData.deptId = findPathIdByTreeId(departmentData.value.data, this.data.deptId); + if (this.data?.deptId) this.formData.deptId = findPathIdByTreeId(departmentData.value.data, this.data.deptId); this.$refs.FormConfigRef.reset(true) } diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/businessDataManagement/views/jurisdictionalManagement/index.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/businessDataManagement/views/jurisdictionalManagement/index.vue index ade3befb..9fecdff6 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/businessDataManagement/views/jurisdictionalManagement/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/businessDataManagement/views/jurisdictionalManagement/index.vue @@ -158,7 +158,7 @@ export default { handleAddEdit(bool, data) { this.editEventInformationDialogVisible = bool - this.dialogData = data + this.dialogData = data; }, handleExport() { exportFile({