From b194d55f72a6ac6ec41afa92066c8d77a18f2fd5 Mon Sep 17 00:00:00 2001 From: lilu Date: Wed, 21 Dec 2022 17:18:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../detail/components/sedOrder.vue | 33 +++- .../detail/modules/basicInfo.vue | 178 ++++++++++++------ .../detail/modules/rightContent.vue | 2 +- src/views/main/BookingLedger/list/index.vue | 2 - 4 files changed, 146 insertions(+), 69 deletions(-) diff --git a/src/views/main/BookingLedger/detail/components/sedOrder.vue b/src/views/main/BookingLedger/detail/components/sedOrder.vue index e0ab26e..be4bfa3 100644 --- a/src/views/main/BookingLedger/detail/components/sedOrder.vue +++ b/src/views/main/BookingLedger/detail/components/sedOrder.vue @@ -106,7 +106,8 @@ export default { inPageLoading: false, editDetails: null, editIndex: 0, - showSecNav: true + showSecNav: true, + inSecLoad: false } }, watch: { @@ -148,7 +149,6 @@ export default { }, created() { if (this.sedOrderList.length > 0) { - console.log('=== 分单加载 created ===') const data = JSON.parse(JSON.stringify(this.sedOrderList[0])) if (!data.bookingEDIExt) { data.bookingEDIExt = { @@ -159,6 +159,10 @@ export default { } } this.editDetails = data + this.inSecLoad = true + setTimeout(() => { + this.inSecLoad = false + }, 1000) } }, mounted() { @@ -202,12 +206,26 @@ export default { ediAttnMail: '' } } + // console.log('=== 分单更新 ===', !this.inSecLoad, this.ifCompare(this.sedOrderList[this.editIndex], detail)) + if (this.ifCompare(this.sedOrderList[this.editIndex], detail) && !this.inSecLoad) { + this.sedOrderList[this.editIndex].isNoSave = true + } this.editDetails = detail this.sedOrderList[this.editIndex] = detail - this.editDetails.isNoSave = true - this.sedOrderList[this.editIndex].isNoSave = true this.$forceUpdate() }, + + ifCompare(object1, object2) { + var o1keys = Object.keys(object1); + var o2keys = Object.keys(object2); + if (o2keys.length !== o1keys.length) return false; + for (let i = 0; i <= o1keys.length - 1; i++) { + let key = o1keys[i]; + if (!o2keys.includes(key)) return false; + if (object2[key] !== object1[key]) return false; + } + return true; + }, // 操作按钮 refreshPage() { // this.init() @@ -252,7 +270,7 @@ export default { } let data = JSON.parse(JSON.stringify(this.editDetails)) delete data.isNoSave - data.pid = this.$route.query.id + data.parentId = this.$route.query.id data.id = 0 data.ctnInputs.map((item, index) => { item.id = 0 @@ -263,7 +281,6 @@ export default { this.sedOrderList[this.editIndex].isNoSave = false this.editDetails.isNoSave = false this.sedOrderList[this.editIndex].id = res.data - debugger this.$message.success('保存成功') this.$emit('changeHB', this.sedOrderList) this.$forceUpdate() @@ -291,6 +308,10 @@ export default { } } this.editDetails = data + this.inSecLoad = true + setTimeout(() => { + this.inSecLoad = false + }, 1000) }, copyFun () { diff --git a/src/views/main/BookingLedger/detail/modules/basicInfo.vue b/src/views/main/BookingLedger/detail/modules/basicInfo.vue index 0479811..86fcdb8 100644 --- a/src/views/main/BookingLedger/detail/modules/basicInfo.vue +++ b/src/views/main/BookingLedger/detail/modules/basicInfo.vue @@ -370,13 +370,14 @@ - - + --> + + +
暂无数据