From ac33e7f2c5e76412a7eee3be7c47a01a189802df Mon Sep 17 00:00:00 2001 From: aihe <961836564@qq.com> Date: Thu, 20 Jun 2024 13:43:56 +0800 Subject: [PATCH] uu --- .../buns-order-templates/bo-scanlist-tmp.vue | 16 +++- .../buns-post-edit-templates/bpe-cost-tmp.vue | 74 ++++++++++++++----- .../bpe-coststatic-tmp.vue | 2 +- .../tpx-scroll-view/tpx-scroll-view.vue | 7 +- 4 files changed, 78 insertions(+), 21 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 bd51deb..6920ceb 100644 --- a/components/buns-post-edit-templates/bpe-cost-tmp.vue +++ b/components/buns-post-edit-templates/bpe-cost-tmp.vue @@ -89,7 +89,7 @@ - @@ -114,7 +114,7 @@ suffix="CNY"> - 实收 + 实收 @@ -161,11 +161,14 @@ }, watch: { searchParam: { - handler(newVal){ + handler(newVal, oldVal){ let vals = Object.values(newVal) - // 所有关联入参都有值再 执行自动计算 + // 所有关联入参都有值再 执行自动计算,数据未变化不做计算 if(vals.length == vals.filter(v => !!v).length) { - this.calcWaybillFee(newVal); + if(JSON.stringify(newVal) != JSON.stringify(oldVal || {})) { + console.log("====watch cost calcWaybillFee===") + this.calcWaybillFee(newVal); + } } }, deep: true, @@ -180,7 +183,8 @@ }, data() { return { - costModal: { item: {}, show: false } + costModal: { item: {}, show: false }, + daiDianCode: '1002' } }, created() { @@ -193,17 +197,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) { + handleAddFee(code) { 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(code) }, async calcWaybillFee(params = {}) { // calcFeeType计算入参特殊处理 @@ -217,6 +231,10 @@ setTimeout(()=> { this.calteFreight() }, 500) + // 同步外层变量 + if(item.feeCode == this.daiDianCode) { + this.modelInfo.prepareInEstFee = val + } }, handleAwPriceChange(item) { setTimeout(()=> { @@ -249,17 +267,39 @@ this.modelInfo.freight = total }, async handleCostItemSure(data){ - if(data.feeCode == '9999') { - if(!data.realFee) { - this.showToast("实收不能为空") - return false - } + if(!data.realFee) { + this.showToast("实收不能为空") + return false } this.modelInfo.feeItems.push({ ...data }) this.costModal.show = false 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-coststatic-tmp.vue b/components/buns-post-edit-templates/bpe-coststatic-tmp.vue index c5ac822..49aaf29 100644 --- a/components/buns-post-edit-templates/bpe-coststatic-tmp.vue +++ b/components/buns-post-edit-templates/bpe-coststatic-tmp.vue @@ -64,7 +64,7 @@ 费用备注 - {{modelInfo.feeRemaker || '-'}} + {{modelInfo.feeRemark || '-'}} diff --git a/components/tpx-scroll-view/tpx-scroll-view.vue b/components/tpx-scroll-view/tpx-scroll-view.vue index 117363c..024b2fc 100644 --- a/components/tpx-scroll-view/tpx-scroll-view.vue +++ b/components/tpx-scroll-view/tpx-scroll-view.vue @@ -101,7 +101,12 @@ } this.showLoadMore = true this.page.pageNum++ - await this.getDataList() + try{ + await this.getDataList() + }catch(e){ + // 滚动下一页加载失败,重置 page.pageNum + this.page.pageNum -- + } this.showLoadMore = false }, async getDataList(reload) {