From 13b7f3db6fa3544dd51eb6eaa95a3821a0fdb142 Mon Sep 17 00:00:00 2001 From: lilu Date: Mon, 17 Apr 2023 09:07:02 +0800 Subject: [PATCH 1/3] -- --- src/views/main/BookingLedger/list/modules/formLabel.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/views/main/BookingLedger/list/modules/formLabel.vue b/src/views/main/BookingLedger/list/modules/formLabel.vue index 2b0cfd3..5af6ac6 100644 --- a/src/views/main/BookingLedger/list/modules/formLabel.vue +++ b/src/views/main/BookingLedger/list/modules/formLabel.vue @@ -291,9 +291,10 @@ export default { }) }, completeChange (value) { + const val = value.split('-')[1] this.$emit('change', { form: this.labelData, - value: value || '' + value: val || '' }) console.log(value, this.value) this.$emit('getCompleteList', { From 2456b57fea4133529701f9be082eb8e5d89344e2 Mon Sep 17 00:00:00 2001 From: lilu Date: Mon, 17 Apr 2023 09:16:44 +0800 Subject: [PATCH 2/3] -- --- src/views/main/BookingLedger/list/modules/formLabel.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/views/main/BookingLedger/list/modules/formLabel.vue b/src/views/main/BookingLedger/list/modules/formLabel.vue index 5af6ac6..0b8b227 100644 --- a/src/views/main/BookingLedger/list/modules/formLabel.vue +++ b/src/views/main/BookingLedger/list/modules/formLabel.vue @@ -292,11 +292,12 @@ export default { }, completeChange (value) { const val = value.split('-')[1] + let res = val || value || '' + console.log('== 模糊搜索中 ==', value, val, res) this.$emit('change', { form: this.labelData, - value: val || '' + value: val || value || '' }) - console.log(value, this.value) this.$emit('getCompleteList', { form: this.labelData, value: value || '' From f6f2dff2af9f3ca95ca22957f5334c99f3f3bc1a Mon Sep 17 00:00:00 2001 From: lilu Date: Mon, 17 Apr 2023 13:54:56 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E8=A1=A8=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/main/BookingLedger/detail/index.vue | 20 ++++++++--- .../BookingLedger/list/modules/formLabel.vue | 35 +++++++++++++------ 2 files changed, 41 insertions(+), 14 deletions(-) diff --git a/src/views/main/BookingLedger/detail/index.vue b/src/views/main/BookingLedger/detail/index.vue index ef2b5de..044d841 100644 --- a/src/views/main/BookingLedger/detail/index.vue +++ b/src/views/main/BookingLedger/detail/index.vue @@ -88,8 +88,8 @@ @changeDetail="changeDetailFun" @changeTotal="changeTotalFun" @changeCtnInfo="changeCtnInfoFun" - v-if="!inPageLoading" > +
@@ -588,6 +588,7 @@ export default { const hbListChange = !!this.needSavePages[key].hbList this.checkSaveFun({ type: 'hbList', hasChange: hbListChange }) + console.log('== details 发生变化 - 路由变化1 ==') this.inChildLoading = false }, 500) this.$forceUpdate() @@ -631,6 +632,7 @@ export default { const hbListChange = !!this.needSavePages[key].hbList this.checkSaveFun({ type: 'hbList', hasChange: hbListChange }) + console.log('== details 发生变化 - 路由变化2 ==') this.inChildLoading = false }, 500) this.$forceUpdate() @@ -691,7 +693,8 @@ export default { const hbListChange = !!this.needSavePages[key].hbList this.checkSaveFun({ type: 'hbList', hasChange: hbListChange }) - console.log(`详情历史改变数据:${detailsChange}, 分单历史改变数据: ${hbListChange}`) + console.log('== details 发生变化 - 路由变化3 ==') + // console.log(`详情历史改变数据:${detailsChange}, 分单历史改变数据: ${hbListChange}`) this.inChildLoading = false }, 500) this.$forceUpdate() @@ -712,6 +715,7 @@ export default { const hbListChange = !!this.needSavePages[key].hbList this.checkSaveFun({ type: 'hbList', hasChange: hbListChange }) this.inChildLoading = false + console.log('== details 发生变化 - 路由变化4 ==') }, 500) } this.$refs.basicInfo.$refs.basicFrom.clearValidate() @@ -985,10 +989,14 @@ export default { } const $BookingEDIExt = { ...JSON.parse(JSON.stringify(bookingEDIExt)), ...res.data.bookingEDIExt } this.$set(this, 'bookingDetails', { ...this.bookingDetails, ...newData, ...{ bookingEDIExt: $BookingEDIExt } }) - this.inPageLoading = false this.getDefaultVal() + this.inPageLoading = false setTimeout(() => { - this.checkSaveFun({ type: 'details', hasChange: false }) + // 问题在这里呦 + setTimeout(() => { + this.checkSaveFun({ type: 'details', hasChange: false }) + console.log('== details 发生变化 - 加载完成 ==') + }, 1200) this.detailsLoadOver = true this.inChildLoading = false this.$message.success({ content: '加载完成' }) @@ -1032,6 +1040,7 @@ export default { const { detail, type } = data if (this.ifCompare(this.bookingDetails, detail) && !this.inChildLoading) { this.checkSaveFun({ type: 'details', hasChange: true }) + console.log('== details 发生变化 - changeDetailFun ==', data) } this.bookingDetails = detail }, @@ -1402,6 +1411,7 @@ export default { }, 200) }, changeHBFun(data) { + console.log('== details 发生变化 - changeHBFun ==') const arr = [] data.map((item, index) => { arr.push(item.isNoSave) @@ -1414,6 +1424,7 @@ export default { } }, checkSaveFun(data) { + console.log('== details 发生变化 - 保存 ==', data, this.inGoodsSave, this.detailsLoadOver) if (this.inGoodsSave) { return false } const key = this.$route.fullPath const lastPages = this.needSavePages @@ -1428,6 +1439,7 @@ export default { } this.$set(lastPages, key, $data) this.setNeedSavePages(lastPages) + console.log('保存信息设置完成', this.needSavePages) }, inGoodsSaveFun (data) { this.inGoodsSave = data diff --git a/src/views/main/BookingLedger/list/modules/formLabel.vue b/src/views/main/BookingLedger/list/modules/formLabel.vue index 0b8b227..ae4f55a 100644 --- a/src/views/main/BookingLedger/list/modules/formLabel.vue +++ b/src/views/main/BookingLedger/list/modules/formLabel.vue @@ -291,7 +291,7 @@ export default { }) }, completeChange (value) { - const val = value.split('-')[1] + const val = value ? value.split('-')[1] : '' let res = val || value || '' console.log('== 模糊搜索中 ==', value, val, res) this.$emit('change', { @@ -300,23 +300,38 @@ export default { }) this.$emit('getCompleteList', { form: this.labelData, - value: value || '' + value: value.includes('-') ? val || '' : value || '' }) }, completeChangeFirst (value) { + console.log('点击:', value) if (this.value) { return false } - // 这里未完成,先改用户问题 - // console.log(this.type, this.bookingInitData) - // const label = this.labelData.label.toLowerCase() - // const arr = this.bookingInitData[`${label}InitList`] - // if (arr.length > 0) { - // this.dataSourceList = arr - // } else { + console.log(this.type, this.bookingInitData) + let label, arr; + if (['CUSTOMERNAME', 'FORWARDER', 'SALE', 'CUSTSERVICE', 'OP', 'DOC', 'ROUTE', 'PAYABLEAT', 'ISSUEPLACE', 'PREPARDAT', 'SERVICE', 'TRUCKER', 'SHIPAGENCY', 'CUSTOMSER'].includes(this.labelData.label)) { + label = this.labelData.label.toLowerCase() + arr = this.bookingInitData[`${label}InitList`] + } else if (['PORTDISCHARGE', 'PORTLOAD', 'PLACERECEIPT', 'DESTINATION', 'PLACEDELIVERY'].includes(this.labelData.label)) { + label = this.labelData.label.toLowerCase() + 'id' + arr = this.bookingInitData[`${label}InitList`] + } else if (['PLACERECEIPT', 'DESTINATION', 'PLACEDELIVERY'].includes(this.labelData.label)) { + label = this.labelData.label.toLowerCase() + 'name' + arr = this.bookingInitData[`${label}InitList`] + } else if (this.labelData.label === 'AGENTID') { + label = 'agentname' + arr = this.bookingInitData[`${label}InitList`] + } else { + label = '' + arr = [] + } + if (arr.length > 0) { + this.dataSourceList = arr + } else { this.$emit('getCompleteList', { form: this.labelData, value: value || '' }) - // } + } }, inputChange (data) { this.changeInput(data)