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 @@ - - + --> + + +
暂无数据