From ec296bb426785702e7907b6395c9353b6b219619 Mon Sep 17 00:00:00 2001 From: lilu Date: Fri, 3 Mar 2023 16:58:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=86=E5=8D=95=E4=BF=9D=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../detail/components/sedOrder.vue | 75 +++++++++++-------- src/views/main/BookingLedger/detail/index.vue | 10 ++- .../detail/modules/basicInfo.vue | 10 ++- .../BookingLedger/detail/modules/billInfo.vue | 4 +- .../detail/modules/goodsTable.vue | 2 +- .../detail/modules/rightContent.vue | 14 ++-- src/views/main/BookingLedger/list/index.vue | 2 +- .../BookingLedger/list/modules/formLabel.vue | 4 + .../BookingLedger/list/modules/initData.js | 4 +- 9 files changed, 76 insertions(+), 49 deletions(-) diff --git a/src/views/main/BookingLedger/detail/components/sedOrder.vue b/src/views/main/BookingLedger/detail/components/sedOrder.vue index 4fdab5a..228e3e9 100644 --- a/src/views/main/BookingLedger/detail/components/sedOrder.vue +++ b/src/views/main/BookingLedger/detail/components/sedOrder.vue @@ -370,12 +370,15 @@ export default { }, hasTableRules: false, inSave: false, - sedOrderList: JSON.parse(JSON.stringify(this.parSedOrderList)) || [] + sedOrderList: JSON.parse(JSON.stringify(this.parSedOrderList)) || [], + // inLoading: false } }, watch: { parSedOrderList: { handler(nval, oval) { + // this.inLoading = true + this.inSecLoad = true const _data = JSON.parse(JSON.stringify(nval)) if (_data.length > 0) { if (!_data[this.editIndex].bookingEDIExt) { @@ -387,12 +390,14 @@ export default { } } this.editDetails = _data[this.editIndex] - this.inSecLoad = true setTimeout(() => { this.inSecLoad = false - }, 200) + }, 1500) } else { this.editDetails = null + setTimeout(() => { + this.inSecLoad = false + }, 1500) } }, deep: true @@ -426,7 +431,7 @@ export default { }, editDetails: { handler(nval, oval) { - if (!this.inSave) { + if (!this.inSave && !this.inSecLoad) { this.$emit('changeHB', this.sedOrderList) } // if (nval !== oval) { @@ -441,6 +446,7 @@ export default { immediate: true, handler(nD, oD) { this.id = this.$route.query.id + this.init() if (this.$refs.basicInfo) { this.$refs.basicInfo.$refs.basicFrom.clearValidate() this.$refs.mailingInfo.$refs.mailingFrom.clearValidate() @@ -455,30 +461,7 @@ export default { } }, created() { - if (this.parSedOrderList.length > 0) { - this.sedOrderList = JSON.parse(JSON.stringify(this.parSedOrderList)) - this.sedOrderList.map((item, index) => { - item.isNoSave = false - // console.log('初始获取列表,保存状态', index, item.isNoSave) - }) - const data = JSON.parse(JSON.stringify(this.sedOrderList[0])) - if (!data.bookingEDIExt) { - data.bookingEDIExt = { - weiTuoFang: '', - ediAttn: '', - ediAttnTel: '', - ediAttnMail: '' - } - } - this.editDetails = data - // console.log('当前编辑中分单保存信息:', this.editDetails.isNoSave) - this.inSecLoad = true - // console.log('分单加载中', this.inSecLoad) - setTimeout(() => { - this.inSecLoad = false - // console.log('分单加载完成', this.inSecLoad) - }, 200) - } + this.init() }, mounted() { this.checkFromInit() @@ -487,6 +470,32 @@ export default { // }, 1500) }, methods: { + init() { + if (this.parSedOrderList.length > 0) { + this.sedOrderList = JSON.parse(JSON.stringify(this.parSedOrderList)) + this.sedOrderList.map((item, index) => { + item.isNoSave = false + // console.log('初始获取列表,保存状态', index, item.isNoSave) + }) + const data = JSON.parse(JSON.stringify(this.sedOrderList[0])) + if (!data.bookingEDIExt) { + data.bookingEDIExt = { + weiTuoFang: '', + ediAttn: '', + ediAttnTel: '', + ediAttnMail: '' + } + } + this.editDetails = data + // console.log('当前编辑中分单保存信息:', this.editDetails.isNoSave) + this.inSecLoad = true + // console.log('分单加载中', this.inSecLoad) + setTimeout(() => { + this.inSecLoad = false + // console.log('分单加载完成', this.inSecLoad) + }, 200) + } + }, checkFromInit() { Object.keys(this.basicRules).map((item, index) => { if (this.checkFrom.includes(item)) { @@ -612,10 +621,13 @@ export default { }, FnBookingOrderGet() { BookingOrderGet({ - id: this.id + id: this.editDetails.id }).then(res => { - this.sedOrderList = { ...res.data.hbList } - this.editDetails = { ...res.data.hbList[this.editIndex] } + this.sedOrderList.splice(this.editIndex, 1, res.data) + // console.log(this.sedOrderList) + this.editDetails = res.data + this.$emit('changeHB', this.sedOrderList) + console.log('== 测试点1,调用更新 ==', this.editDetails) this.$forceUpdate() }) }, @@ -704,6 +716,7 @@ export default { this.$set(this.sedOrderList[this.editIndex], 'isNoSave', false) this.$set(this.editDetails, 'isNoSave', false) this.$emit('changeHB', this.sedOrderList) + console.log('== 测试点3,调用更新 ==', this.sedOrderList) // console.log(`2. == 保存, 当前id ==${res.data} , 是否已保存:${this.sedOrderList[this.editIndex].isNoSave}`) setTimeout(() => { this.inSave = false diff --git a/src/views/main/BookingLedger/detail/index.vue b/src/views/main/BookingLedger/detail/index.vue index 148d7ef..2aa832b 100644 --- a/src/views/main/BookingLedger/detail/index.vue +++ b/src/views/main/BookingLedger/detail/index.vue @@ -167,6 +167,7 @@ { - return item.isNoSave + const arr = [] + data.map((item, index) => { + arr.push(item.isNoSave) }) // console.log('3. === 分单更新 ===', arr, arr.includes(true)) if (arr.includes(true)) { - // console.log('4. == 分单有更新数据 ==') + this.$set(this.bookingDetails, 'hbList', data) this.checkSaveFun({ type: 'hbList', hasChange: true }) } else { // console.log('4. == 分单无更新数据 ==') diff --git a/src/views/main/BookingLedger/detail/modules/basicInfo.vue b/src/views/main/BookingLedger/detail/modules/basicInfo.vue index ec9e1da..3123a83 100644 --- a/src/views/main/BookingLedger/detail/modules/basicInfo.vue +++ b/src/views/main/BookingLedger/detail/modules/basicInfo.vue @@ -33,9 +33,11 @@ show-search :dropdownMatchSelectWidth="false" :filter-option="filterOption" + optionLabelProp="label" > - - {{ customer.shortName }} + + {{ customer.shortName }} / ({{ customer.codeName }}) +
-
- {{ child.field || '字段' }} : - {{ child.oldValue }} -
-
改为:
+
{{ child.field || '字段' }}:{{ child.newValue }} @@ -313,7 +315,7 @@ export default { this.fileList = [] this.remarkList = [] this.logList = [] - } else { + } else if (nD.id && this.$route.name === 'BookingDetail') { this.init() } } diff --git a/src/views/main/BookingLedger/list/index.vue b/src/views/main/BookingLedger/list/index.vue index 4fc82ac..7a30b9b 100644 --- a/src/views/main/BookingLedger/list/index.vue +++ b/src/views/main/BookingLedger/list/index.vue @@ -471,7 +471,6 @@ import { BookingOrderBachUpdate, GetCarrierlist, DjyCustomerSuggest, - getVesselInfoService, GetYardlist, GetSysUserPage, DjyCustomerpage, @@ -1024,6 +1023,7 @@ export default { formChange(data) { const { form, value } = data + console.log('== 表单 - 搜索更新 ==', form, value) if (form.type === 'input') { this.formRes[form.label] = value } else if (form.type === 'date') { diff --git a/src/views/main/BookingLedger/list/modules/formLabel.vue b/src/views/main/BookingLedger/list/modules/formLabel.vue index 1931419..d0e6c4a 100644 --- a/src/views/main/BookingLedger/list/modules/formLabel.vue +++ b/src/views/main/BookingLedger/list/modules/formLabel.vue @@ -159,6 +159,10 @@ export default { }) }, completeChange (value) { + this.$emit('change', { + form: this.labelData, + value: value || '' + }) console.log(value, this.value) this.$emit('getCompleteList', { form: this.labelData, diff --git a/src/views/main/BookingLedger/list/modules/initData.js b/src/views/main/BookingLedger/list/modules/initData.js index 367774b..dad811e 100644 --- a/src/views/main/BookingLedger/list/modules/initData.js +++ b/src/views/main/BookingLedger/list/modules/initData.js @@ -63,7 +63,7 @@ export default { { field: 'lanename', label: 'LANENAME', width: 160, title: '航线', showHeaderOverflow: true, sortable: true }, { field: 'servicecontractno', label: 'SERVICECONTRACTNO', width: 160, title: '客户合同号', showHeaderOverflow: true, sortable: true }, // 没有设置该字段的地方 { field: 'bsstatusname', label: 'BSSTATUSNAME', width: 160, title: '业务状态', showHeaderOverflow: true, sortable: true }, - { field: 'bsno', label: 'BSNO', width: 160, title: '业务编号', showHeaderOverflow: true, sortable: true }, + { field: 'bookingno', label: 'BOOKINGNO', width: 160, title: '业务编号', showHeaderOverflow: true, sortable: true }, { field: 'agentid', label: 'AGENTID', width: 160, title: '国外代理', showHeaderOverflow: true, sortable: true }, { field: 'trucker', label: 'TRUCKER', width: 160, title: '车队', showHeaderOverflow: true, sortable: true }, { field: 'tempset', label: 'TEMPSET', width: 160, title: '设置温度', showHeaderOverflow: true, sortable: true }, @@ -120,7 +120,7 @@ export default { { title: '单证员', align: 'center', width: 120, label: 'DOC', type: 'complete', showLabel: 'name' }, { title: '报关行', align: 'center', width: 120, label: 'CUSTOMSER', type: 'complete', showLabel: 'shortName' }, { title: '订舱编号', align: 'center', width: 120, label: 'CUSTNO', type: 'input' }, - { title: '业务编号', align: 'center', width: 120, label: 'BSNO', type: 'input' }, + { title: '业务编号', align: 'center', width: 120, label: 'BOOKINGNO', type: 'input' }, { title: '业务状态', align: 'center', width: 120, label: 'BSSTATUS', type: 'input' }, { title: '客户合同号', align: 'center', width: 120, label: 'SERVICECONTRACTNO', type: 'input' }, { title: '航线代码', align: 'center', width: 120, label: 'LANECODE', type: 'input' },