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

108 lines
2.6 KiB
Vue
Raw Normal View History

2024-01-29 06:07:42 +00:00
<template>
<view class="shet-cont">
<view class="jsfm-item">
<u-row justify="between">
2024-01-29 10:05:13 +00:00
<text class="font-28">件数</text>
2024-01-29 06:07:42 +00:00
<view>
2024-04-27 15:19:55 +00:00
<uni-number-box v-model="modelInfo.parcelQty" :min="1" :max="10000"></uni-number-box>
2024-01-29 06:07:42 +00:00
</view>
</u-row>
</view>
<view class="jsfm-item">
<u-row justify="between">
2024-01-29 10:05:13 +00:00
<text class="font-28">包裹重量</text>
2024-01-29 06:07:42 +00:00
<view>
2024-05-03 17:17:45 +00:00
<tpx-input v-model:value="modelInfo.billWeight" :isWhite="true" placeholder="" suffix="kg" type="number"></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-01-29 10:05:13 +00:00
<text class="font-28 pt-20">体积</text>
2024-01-29 06:07:42 +00:00
<view style="width: 70%;">
<u-row justify="between">
<u-col span="3.7">
2024-05-03 17:17:45 +00:00
<tpx-input v-model:value="modelInfo.chang" :isWhite="true" placeholder="长" suffix="cm" type="number"></tpx-input>
2024-01-29 06:07:42 +00:00
</u-col>
<u-col span="3.7">
2024-05-03 17:17:45 +00:00
<tpx-input v-model:value="modelInfo.kuan" :isWhite="true" placeholder="宽" suffix="cm" type="number"></tpx-input>
2024-01-29 06:07:42 +00:00
</u-col>
<u-col span="3.7">
2024-05-03 17:17:45 +00:00
<tpx-input v-model:value="modelInfo.gao" :isWhite="true" placeholder="高" suffix="cm" type="number"></tpx-input>
2024-01-29 06:07:42 +00:00
</u-col>
</u-row>
2024-04-28 03:27:41 +00:00
<u-row v-if="totalVolume" customStyle="margin: 20rpx 0 0 0;" justify="end">{{modelInfo.totalVolume}}m³</u-row>
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
const { chang, kuan, gao } = this.modelInfo
if(chang && kuan && gao){
totalVolume = chang/100 * kuan/100 * gao/100
}
if(totalVolume && totalVolume.toFixed) {
totalVolume = totalVolume.toFixed(2)
2024-05-01 16:46:30 +00:00
this.modelInfo.totalVolume = totalVolume
2024-04-28 03:27:41 +00:00
}
return totalVolume
2024-01-29 06:07:42 +00:00
}
},
props: {
value: {
default () {
return { }
}
}
},
data() {
return {
}
},
created() {
},
onHide() {
},
unmounted() {
},
methods: {
2024-05-01 16:46:30 +00:00
async calceOther() {
let { totalVolume, productType, billWeight } = this.modelInfo
let res = await apiService.calcSetteldWeight({ totalVolume, productType, billWeight })
const { settlementWeight, volumeWeight } = res.data
this.modelInfo.volumeWeight = volumeWeight
this.modelInfo.settlementWeight = this.modelInfo.totalWeight = settlementWeight
},
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>