emis-app/components/buns-post-edit-templates/bpe-goodsize-tmp.vue

113 lines
2.5 KiB
Vue
Raw Normal View History

2024-01-29 06:07:42 +00:00
<template>
<view class="shet-cont">
2024-06-03 06:49:14 +00:00
<view class="jsfm-item" style="margin-top: 0;">
2024-01-29 06:07:42 +00:00
<u-row justify="between">
2024-05-25 15:33:49 +00:00
<text class="font-28 font-weight">总件数</text>
2024-01-29 06:07:42 +00:00
<view>
2024-06-02 08:37:54 +00:00
<u-number-box v-model="modelInfo.parcelQty" :min="1" :max="100000" buttonSize="50" inputWidth="100" iconStyle="font-size: 18rpx;"></u-number-box>
2024-01-29 06:07:42 +00:00
</view>
</u-row>
</view>
<view class="jsfm-item">
<u-row justify="between">
2024-05-25 15:33:49 +00:00
<text class="font-28 font-weight">包裹重量</text>
2024-01-29 06:07:42 +00:00
<view>
2024-05-27 03:01:17 +00:00
<tpx-input v-model:value="modelInfo.billWeight" placeholder="" inputAlign="right" suffix="kg" _digit="5"></tpx-input>
2024-01-29 06:07:42 +00:00
</view>
</u-row>
</view>
<view class="jsfm-item">
<u-row justify="between" align="top">
2024-05-25 15:33:49 +00:00
<text class="font-28 pt-20 font-weight">总体积</text>
<view v-if="totalVolume || true">
2024-05-27 03:01:17 +00:00
<tpx-input v-model:value="modelInfo.totalVolume" placeholder="" inputAlign="right" suffix="m³" _digit="5"></tpx-input>
2024-01-31 06:45:51 +00:00
</view>
2024-01-29 06:07:42 +00:00
</u-row>
</view>
</view>
</template>
<script>
2024-05-01 16:46:30 +00:00
import * as apiService from "@/common/api"
2024-01-29 06:07:42 +00:00
export default {
computed: {
2024-04-27 15:19:55 +00:00
modelInfo: {
2024-01-29 06:07:42 +00:00
get(){
return this.value
}
2024-04-28 03:27:41 +00:00
},
totalVolume() {
let totalVolume = this.modelInfo.totalVolume
2024-05-25 15:33:49 +00:00
2024-04-28 03:27:41 +00:00
return totalVolume
2024-05-26 15:21:59 +00:00
},
isCargoListOnchange() {
return this.modelInfo.cargoList
}
},
watch: {
isCargoListOnchange: {
handler(newVal){
console.log("===bpe-goodsize-tmp isCargoListOnchange===")
this.handleCargoChange(newVal)
},
deep: true,
2024-01-29 06:07:42 +00:00
}
},
props: {
value: {
default () {
return { }
}
}
},
data() {
return {
}
},
created() {
},
onHide() {
},
unmounted() {
},
methods: {
2024-05-26 15:21:59 +00:00
handleCargoChange(list){
let parcelQty = 0, totalVolume = 0
list.map(t=> {
totalVolume += (+t.volume) || 0
})
2024-05-27 04:25:22 +00:00
this.modelInfo.totalVolume = totalVolume.toFixed(5)
2024-05-26 15:21:59 +00:00
},
2024-05-01 16:46:30 +00:00
async calceOther() {
let { totalVolume, productType, billWeight } = this.modelInfo
2024-05-12 05:25:11 +00:00
let voRes = await apiService.calcVolumeWeight({ productType, totalVolume })
let { volumeWeight } = voRes.data
let stRes = await apiService.calcSetteldWeight({ volumeWeight, productType, billWeight })
const { settlementWeight } = stRes.data
2024-05-01 16:46:30 +00:00
this.modelInfo.volumeWeight = volumeWeight
this.modelInfo.settlementWeight = this.modelInfo.totalWeight = settlementWeight
2024-05-12 05:25:11 +00:00
//
2024-05-01 16:46:30 +00:00
},
async validData() {
await this.calceOther()
2024-04-28 05:25:25 +00:00
}
2024-01-29 06:07:42 +00:00
}
}
</script>
<style scoped lang="scss">
.shet-cont{
2024-02-01 07:51:22 +00:00
padding: 0;
2024-01-29 06:07:42 +00:00
}
.jsfm-item{
margin-top: 30rpx;
}
</style>