uu
This commit is contained in:
parent
471577f735
commit
ac33e7f2c5
@ -18,7 +18,12 @@
|
||||
<text class="">{{item.billCode}}</text>
|
||||
</u-col>
|
||||
<u-col span="4">
|
||||
<text class="clr-sub">{{item.scanDate}}</text>
|
||||
<u-row>
|
||||
<text class="clr-sub">{{item.scanDate}}</text>
|
||||
<u-row v-if="canDel" @click="handleDel(index)" justify="center" custom-style="height: 60rpx;width: 60rpx;">
|
||||
<u-icon name="trash" size="32"></u-icon>
|
||||
</u-row>
|
||||
</u-row>
|
||||
</u-col>
|
||||
</u-row>
|
||||
</view>
|
||||
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -89,7 +89,7 @@
|
||||
</u-row>
|
||||
</view>
|
||||
<view class="pt-20">
|
||||
<u-textarea v-model="modelInfo.feeRemaker" border="surround" height="120" placeholder="费用备注"
|
||||
<u-textarea v-model="modelInfo.feeRemark" border="surround" height="120" placeholder="费用备注"
|
||||
maxlength="50" count></u-textarea>
|
||||
</view>
|
||||
</view>
|
||||
@ -114,7 +114,7 @@
|
||||
suffix="CNY"></tpx-input>
|
||||
</u-row>
|
||||
<u-row custom-style="width:300rpx;">
|
||||
<text :class="`font-26 label-text ${tempObject.value.feeCode == '9999'?'label-text-required':''} `">实收</text>
|
||||
<text :class="`font-26 label-text label-text-required `">实收</text>
|
||||
<tpx-input v-model:value="tempObject.value.realFee" _digit="5" :isWhite="true" custom-style="width: 120rpx;height: 46rpx;"
|
||||
suffix="CNY"></tpx-input>
|
||||
</u-row>
|
||||
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -64,7 +64,7 @@
|
||||
<u-row justify="between">
|
||||
<u-row>
|
||||
<text class="clr-sub pr-10">费用备注</text>
|
||||
<text>{{modelInfo.feeRemaker || '-'}}</text>
|
||||
<text>{{modelInfo.feeRemark || '-'}}</text>
|
||||
</u-row>
|
||||
</u-row>
|
||||
</view>
|
||||
|
||||
@ -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) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user