emis-app/components/buns-post-edit-templates/bpe-goodsize-tmp.vue
2024-05-25 23:33:49 +08:00

94 lines
2.0 KiB
Vue

<template>
<view class="shet-cont">
<view class="jsfm-item">
<u-row justify="between">
<text class="font-28 font-weight">总件数</text>
<view>
<uni-number-box v-model="modelInfo.parcelQty" :min="1" :max="10000"></uni-number-box>
</view>
</u-row>
</view>
<view class="jsfm-item">
<u-row justify="between">
<text class="font-28 font-weight">包裹重量</text>
<view>
<tpx-input v-model:value="modelInfo.billWeight" placeholder="" inputAlign="right" suffix="kg" type="digit"></tpx-input>
</view>
</u-row>
</view>
<view class="jsfm-item">
<u-row justify="between" align="top">
<text class="font-28 pt-20 font-weight">总体积</text>
<view v-if="totalVolume || true">
<tpx-input v-model:value="modelInfo.totalVolume" placeholder="" inputAlign="right" suffix="m³" type="digit"></tpx-input>
</view>
</u-row>
</view>
</view>
</template>
<script>
import * as apiService from "@/common/api"
export default {
computed: {
modelInfo: {
get(){
return this.value
}
},
totalVolume() {
let totalVolume = this.modelInfo.totalVolume
return totalVolume
}
},
props: {
value: {
default () {
return { }
}
}
},
data() {
return {
}
},
created() {
},
onHide() {
},
unmounted() {
},
methods: {
async calceOther() {
let { totalVolume, productType, billWeight } = this.modelInfo
let voRes = await apiService.calcVolumeWeight({ productType, totalVolume })
let { volumeWeight } = voRes.data
let stRes = await apiService.calcSetteldWeight({ volumeWeight, productType, billWeight })
const { settlementWeight } = stRes.data
this.modelInfo.volumeWeight = volumeWeight
this.modelInfo.settlementWeight = this.modelInfo.totalWeight = settlementWeight
//
},
async validData() {
await this.calceOther()
}
}
}
</script>
<style scoped lang="scss">
.shet-cont{
padding: 0;
}
.jsfm-item{
margin-top: 30rpx;
}
</style>