From 742ec072f1c3f80e2336797c20432720223938ba Mon Sep 17 00:00:00 2001 From: aihe <961836564@qq.com> Date: Wed, 19 Jun 2024 00:16:19 +0800 Subject: [PATCH] uu --- .../buns-order-templates/bo-scanlist-tmp.vue | 16 ++++- .../buns-post-edit-templates/bpe-cost-tmp.vue | 51 ++++++++++++++-- .../bpe-good-kuaidi-tmp.vue | 9 +-- pages/post/openorder.vue | 6 +- pages/tabBar/order/order.vue | 59 ++++++++++++------- pages/tms/coPackingScanning.vue | 4 +- 6 files changed, 107 insertions(+), 38 deletions(-) diff --git a/components/buns-order-templates/bo-scanlist-tmp.vue b/components/buns-order-templates/bo-scanlist-tmp.vue index 3c2a29c..36293ac 100644 --- a/components/buns-order-templates/bo-scanlist-tmp.vue +++ b/components/buns-order-templates/bo-scanlist-tmp.vue @@ -18,7 +18,12 @@ {{item.billCode}} - {{item.scanDate}} + + {{item.scanDate}} + + + + @@ -42,6 +47,11 @@ default () { return { list: [] } } + }, + canDel: { + default () { + return false + } } }, data() { @@ -57,7 +67,9 @@ }, methods: { - + handleDel(index){ + this.modelRes.list.splice(index, 1) + } } } diff --git a/components/buns-post-edit-templates/bpe-cost-tmp.vue b/components/buns-post-edit-templates/bpe-cost-tmp.vue index 71cceb3..d802786 100644 --- a/components/buns-post-edit-templates/bpe-cost-tmp.vue +++ b/components/buns-post-edit-templates/bpe-cost-tmp.vue @@ -180,7 +180,8 @@ }, data() { return { - costModal: { item: {}, show: false } + costModal: { item: {}, show: false }, + daiDianCode: '1002' } }, created() { @@ -193,17 +194,27 @@ }, methods: { + getNewCostItem(code, extData = {}){ + return { + blAutoGen: 0, // 手动添加的费用标识 + feeCode: code, + feeName: this.dicData.emis_fee_type.filter(t => t.val == code)[0].title, + ...extData + } + }, handleDelFee(index) { + // 同步变量 + if(this.modelInfo.feeItems[index].feeCode == this.daiDianCode) { + this.modelInfo.blPrepareInFreight = 0 + this.modelInfo.prepareInEstFee = undefined + } this.modelInfo.feeItems.splice(index, 1) this.calteFreight() + }, handleAddFee(val) { this.costModal.show = {} - this.costModal.item = { - blAutoGen: 0, // 手动添加的费用标识 - feeCode: val, - feeName: this.dicData.emis_fee_type.filter(t => t.val == val)[0].title - } + this.costModal.item = this.getNewCostItem() }, async calcWaybillFee(params = {}) { // calcFeeType计算入参特殊处理 @@ -217,6 +228,10 @@ setTimeout(()=> { this.calteFreight() }, 500) + // 同步外层变量 + if(item.feeCode == this.daiDianCode) { + this.modelInfo.prepareInEstFee = val + } }, handleAwPriceChange(item) { setTimeout(()=> { @@ -258,6 +273,30 @@ setTimeout(()=>{ this.calteFreight() }, 500) + }, + getCostItemByFeeCode(code){ + let item, index; + this.modelInfo.feeItems.map((t, i)=> { + if(t.feeCode == code) { + item = t; + index = i + } + }) + return { item, index } + }, + updateDaiDianFeeData() { + let { item, index } = this.getCostItemByFeeCode(this.daiDianCode) + // 开启 代垫运费开关,需要同步外层录入数据 + if(this.modelInfo.blPrepareInFreight == '1'){ + if(item) { + item.realFee = this.modelInfo.prepareInEstFee + } else { + item = this.getNewCostItem(this.daiDianCode, { realFee: this.modelInfo.prepareInEstFee }) + this.handleCostItemSure(item) + } + } else if(typeof index != 'undefined'){ + this.handleDelFee(index) + } } } } diff --git a/components/buns-post-edit-templates/bpe-good-kuaidi-tmp.vue b/components/buns-post-edit-templates/bpe-good-kuaidi-tmp.vue index f051fd9..15b6471 100644 --- a/components/buns-post-edit-templates/bpe-good-kuaidi-tmp.vue +++ b/components/buns-post-edit-templates/bpe-good-kuaidi-tmp.vue @@ -101,12 +101,9 @@ methods: { handleDDianSwitch(val){ - // if(val==1) { - // // 开启代垫运费,需要往 modelInfo.feeItems同步数据 - // let curItem = modelInfo.feeItems?.filter(t=> t.val == '1002')[0] - // if(!curItem) { - // } - // } + if(val!=1) { + this.modelInfo.prepareInEstFee = undefined + } } } } diff --git a/pages/post/openorder.vue b/pages/post/openorder.vue index c3dc4c2..603bbca 100644 --- a/pages/post/openorder.vue +++ b/pages/post/openorder.vue @@ -231,7 +231,7 @@ - + @@ -481,6 +481,10 @@ async handleGoodInfoSure() { // 校验各个组件的参数 let res = await this.$refs.goodEditInfo.validData() + // 同步 代垫运费 数据 + setTimeout(()=> { + this.$refs.bCostRef.updateDaiDianFeeData() + }, 300) }, async handleSave(type) { let saveServerHand = apiService.submitOrder diff --git a/pages/tabBar/order/order.vue b/pages/tabBar/order/order.vue index dfdef2d..4297ec7 100644 --- a/pages/tabBar/order/order.vue +++ b/pages/tabBar/order/order.vue @@ -2,32 +2,37 @@