From 390e1c1cae5185a2ce9c957830de093ed97e2c94 Mon Sep 17 00:00:00 2001 From: lilu Date: Thu, 6 Apr 2023 13:10:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=B4=E6=97=B6=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/main/BookingLedger/detail/index.vue | 20 +++++++++++++------ src/views/main/BookingLedger/list/index.vue | 18 +++++++++++++---- 2 files changed, 28 insertions(+), 10 deletions(-) diff --git a/src/views/main/BookingLedger/detail/index.vue b/src/views/main/BookingLedger/detail/index.vue index 956002b..cc022ed 100644 --- a/src/views/main/BookingLedger/detail/index.vue +++ b/src/views/main/BookingLedger/detail/index.vue @@ -574,7 +574,8 @@ export default { ...mapActions(['setNeedSavePages', 'setBookingList', 'setBookingGridOptions']), getRouterHis() { this.inChildLoading = true - const newId = this.$route.query.id + const newId = this.$route.query.id ? this.$route.query.id.toString() : '' + // debugger if (Object.keys(this.historyData).includes(`copy-${newId}`) && this.$route.query.isCopy === 'true') { this.id = this.$route.query.id const $data = JSON.parse(JSON.stringify(this.historyData[`copy-${newId}`])) @@ -658,7 +659,7 @@ export default { }, 500) this.$forceUpdate() } else if (Object.keys(this.historyData).includes(newId)) { - this.id = this.$route.query.id + this.id = !this.$route.query.isCopy ? this.$route.query.id : 0 const $data = JSON.parse(JSON.stringify(this.historyData[newId])) this.bookingDetails = $data.bookingDetails this.excuteRules = $data.excuteRules @@ -686,6 +687,7 @@ export default { }, 200) if (this.isCopy && !$data.isCopy) { this.bookingDetails.mblno = '' + this.bookingDetails.id = 0 } setTimeout(() => { const key = this.$route.fullPath @@ -967,7 +969,7 @@ export default { } if (res.data.hbList.length > 0) { res.data.hbList.map((item, index) => { - item.bookingEDIExt.shipperEdiCode = item.bookingEDIExt.shipperEdiCode ? item.bookingEDIExt.shipperEdiCode : 'CN218868' + // item.bookingEDIExt.shipperEdiCode = item.bookingEDIExt.shipperEdiCode ? item.bookingEDIExt.shipperEdiCode : 'CN218868' const newBookingEDIExt = { ...JSON.parse(JSON.stringify(bookingEDIExt)), ...item.bookingEDIExt } item = { ...JSON.parse(JSON.stringify(initDetail)), ...item, ...{ bookingEDIExt: newBookingEDIExt } } if (item.ctnInputs.length > 0) { @@ -983,7 +985,7 @@ export default { }) } res.data.feeself = !!res.data.feeself - res.data.bookingEDIExt.shipperEdiCode = res.data.bookingEDIExt.shipperEdiCode ? res.data.bookingEDIExt.shipperEdiCode : 'CN218868' + // res.data.bookingEDIExt.shipperEdiCode = res.data.bookingEDIExt.shipperEdiCode ? res.data.bookingEDIExt.shipperEdiCode : 'CN218868' const $BookingEDIExt = { ...JSON.parse(JSON.stringify(bookingEDIExt)), ...res.data.bookingEDIExt } this.$set(this, 'bookingDetails', { ...this.bookingDetails, ...res.data, ...{ bookingEDIExt: $BookingEDIExt } }) this.inPageLoading = false @@ -1128,18 +1130,23 @@ export default { if (res.success) { this.$message.destroy() that.$message.success('保存成功') - if (that.isAdd) { + if (that.isAdd || this.isCopy) { this.isCopy = false this.isAdd = false this.inAddSave = true this.id = res.data.id - this.setDeatilsFun(res) const newBookingList = JSON.parse(JSON.stringify(this.bookingList)) const newBookingGridOptions = JSON.parse(JSON.stringify(this.bookingGridOptions)) newBookingGridOptions.data = [...[res.data], ...newBookingGridOptions.data] this.$set(newBookingList, res.data.id, res.data) this.setBookingList(newBookingList) this.setBookingGridOptions(newBookingGridOptions) + console.log('== 新增内容 - query ==', { + id: res.data.id, + type: res.data.carrierid, + noOpenTab: true, + mblno: res.data.mblno + }) that.$router.replace({ name: 'BookingDetail', query: { @@ -1149,6 +1156,7 @@ export default { mblno: res.data.mblno } }) + this.setDeatilsFun(res) setTimeout(() => { this.inAddSave = false }, 2000) diff --git a/src/views/main/BookingLedger/list/index.vue b/src/views/main/BookingLedger/list/index.vue index a45d5d8..17e8049 100644 --- a/src/views/main/BookingLedger/list/index.vue +++ b/src/views/main/BookingLedger/list/index.vue @@ -587,6 +587,7 @@ export default { // 查询参数 formData: formInitData, formRes: {}, + searchData: {}, formAllData: null, formMoreData: null, formBtnCol: 8, @@ -1088,7 +1089,8 @@ export default { // } this.gridOptions.pagerConfig.currentPage = currentPage this.gridOptions.pagerConfig.pageSize = pageSize - this.getList(this.formRes) + console.log('== 当前搜索内容 ==', this.searchData) + this.getList(this.searchData) }, editPageSizeSave(pageSize = 10) { @@ -1121,7 +1123,9 @@ export default { }, tableRefresh() { const data = { ...this.formRes } - this.init(this.formRes) + this.searchData = JSON.parse(JSON.stringify(data)) + console.log('查询 - 设置当前搜索', data) + this.init(this.searchData) this.formRes = data }, tableMoreRefresh() { @@ -1162,6 +1166,8 @@ export default { Object.keys(this.formRes).map((item, index) => { this.formRes[item] = '' }) + this.searchData = JSON.parse(JSON.stringify(this.formRes)) + console.log('== 重置表单内容 ==', this.searchData) Object.keys(this.$refs).map((label, index) => { if (label.includes('fromlabel-') && this.$refs[label].length > 0) { this.$refs[label][0].$data.value = '' @@ -1182,6 +1188,8 @@ export default { }) this.formRes = {} + this.searchData = {} + console.log('== 设置表头 ==', this.searchData) DjyUserConfigAdd({ type: 'booking_list_cond', configJson: JSON.stringify(arr) @@ -1212,6 +1220,7 @@ export default { } else if (form.type === 'complete') { this.formRes[form.label] = value } + console.log('修改了表单内容', this.formRes) this.$forceUpdate() }, @@ -1280,7 +1289,7 @@ export default { query.DescSort = this.tableOrderType === 'desc' } if (query.MBLNO && query.MBLNO.split(/,|,/).length > 0) { - const arr = this.formRes.MBLNO.split(/,|,/) + const arr = this.searchData.MBLNO.split(/,|,/) query.MBLNO = arr.toString() } if (isInit) { @@ -1435,7 +1444,8 @@ export default { const { property, order } = e this.tableOrderLabel = property || '' this.tableOrderType = order || '' - this.getList(this.formRes) + console.log('== 当前搜索内容 ==', this.searchData) + this.getList(this.searchData) }, enmuBookingBtn(val) { switch (val) {