From 70d4609cbcfd5f410f06cbaf248d8294099119e1 Mon Sep 17 00:00:00 2001 From: aihe <961836564@qq.com> Date: Sun, 26 May 2024 23:21:59 +0800 Subject: [PATCH] uu --- .../buns-post-edit-templates/bpe-cost-tmp.vue | 40 ++++++++++++++----- .../bpe-goodsize-tmp.vue | 21 ++++++++++ .../bpe-goodstatic-tmp.vue | 40 +++++++++++++++---- pages/post/openorder.vue | 25 ++---------- 4 files changed, 85 insertions(+), 41 deletions(-) diff --git a/components/buns-post-edit-templates/bpe-cost-tmp.vue b/components/buns-post-edit-templates/bpe-cost-tmp.vue index 5718941..f27beb4 100644 --- a/components/buns-post-edit-templates/bpe-cost-tmp.vue +++ b/components/buns-post-edit-templates/bpe-cost-tmp.vue @@ -4,7 +4,7 @@ 计费方式 - + @@ -75,6 +75,33 @@ }, dicData() { return this.$store.getters.dicData + }, + searchParam() { + let info = this.modelInfo + let param = { + productType: info.productType, + // customerCode: info.customerCode, + customsClear: info.customsClear, + customsEclaration: info.customsEclaration, + calcFeeType: info.calcFeeType, + settlementWeight: info.settlementWeight, + totalVolume: info.totalVolume, + sendSiteCode: this.$store.getters.userInfo.ownerSiteCode, + dispatchUnderlingSiteCode: info.dispatchUnderlingSiteCode, + } + return param + } + }, + watch: { + searchParam: { + handler(newVal){ + let vals = Object.values(newVal) + // 所有关联入参都有值再 执行自动计算 + if(vals.length == vals.filter(v => !!v).length) { + this.calcWaybillFee(newVal); + } + }, + deep: true, } }, props: { @@ -83,17 +110,11 @@ return {} } }, - searchParam: { - default () { - return {} - } - } }, data() { return {} }, created() { - this.calcWaybillFee(); }, onHide() { @@ -113,11 +134,8 @@ feeName: this.dicData.emis_fee_type.filter(t => t.val == val)[0].title }) }, - handleFeeTypeChange(val) { - this.calcWaybillFee({ calcFeeType: val }) - }, async calcWaybillFee(params = {}) { - let res = await apiService.calcWaybillFee({ custNo: this.modelInfo.custNo, ...this.searchParam, ...params }) + let res = await apiService.calcWaybillFee({ custNo: this.modelInfo.custNo, ...params }) this.modelInfo.feeItems = res.data.feeList this.modelInfo.freight = res.data.totalFee diff --git a/components/buns-post-edit-templates/bpe-goodsize-tmp.vue b/components/buns-post-edit-templates/bpe-goodsize-tmp.vue index 4b74def..10dcb45 100644 --- a/components/buns-post-edit-templates/bpe-goodsize-tmp.vue +++ b/components/buns-post-edit-templates/bpe-goodsize-tmp.vue @@ -42,6 +42,18 @@ return totalVolume + }, + isCargoListOnchange() { + return this.modelInfo.cargoList + } + }, + watch: { + isCargoListOnchange: { + handler(newVal){ + console.log("===bpe-goodsize-tmp isCargoListOnchange===") + this.handleCargoChange(newVal) + }, + deep: true, } }, props: { @@ -65,6 +77,15 @@ }, methods: { + handleCargoChange(list){ + let parcelQty = 0, totalVolume = 0 + list.map(t=> { + parcelQty += (+t.cargoQty) || 0 + totalVolume += (+t.volume) || 0 + }) + this.modelInfo.parcelQty = parcelQty + this.modelInfo.totalVolume = totalVolume + }, async calceOther() { let { totalVolume, productType, billWeight } = this.modelInfo let voRes = await apiService.calcVolumeWeight({ productType, totalVolume }) diff --git a/components/buns-post-edit-templates/bpe-goodstatic-tmp.vue b/components/buns-post-edit-templates/bpe-goodstatic-tmp.vue index 8bc64ea..8f5f87f 100644 --- a/components/buns-post-edit-templates/bpe-goodstatic-tmp.vue +++ b/components/buns-post-edit-templates/bpe-goodstatic-tmp.vue @@ -2,15 +2,39 @@ {{item.goodsName}} - 实发: {{item.cargoQty}} - - - {{item.nationArea}} - - - - {{item.price}} CNY + + + + + 产地{{item.nationArea}} + + + + + 实发 {{item.cargoQty}} + + + + + 单价{{item.price}} CNY + + + + + 尺寸 + {{item.length || '0'}}cm* + {{item.width || '0'}}cm* + {{item.length || '0'}}cm + + + + + 体积 + {{item.volume || '0'}}m³ + + + diff --git a/pages/post/openorder.vue b/pages/post/openorder.vue index bd87256..b73f18b 100644 --- a/pages/post/openorder.vue +++ b/pages/post/openorder.vue @@ -208,16 +208,16 @@ - + @@ -298,25 +298,6 @@ dicData() { return this.$store.getters.dicData }, - jifeiParam(){ - let info = this.submitParam - let param = { - productType: info.productType, - // customerCode: info.customerCode, - customsClear: info.customsClear, - customsEclaration: info.customsEclaration, - calcFeeType: info.calcFeeType, - settlementWeight: info.settlementWeight, - totalVolume: info.totalVolume, - sendSiteCode: this.$store.getters.userInfo.ownerSiteCode, - dispatchUnderlingSiteCode: info.dispatchUnderlingSiteCode, - } - return param - }, - isShowJifei(){ - let vals = Object.values(this.jifeiParam) - return vals.length == vals.filter(v => !!v).length - }, isShowYueJie(){ let { submitParam } = this return submitParam.paymentType == 2 || submitParam.paymentType == 4 || submitParam.paymentType == 5