This commit is contained in:
aihe 2024-06-11 12:55:37 +08:00
parent 6c9ed9e20d
commit 06eb546d9a
6 changed files with 113 additions and 61 deletions

View File

@ -13,10 +13,7 @@
>
<tpx-text-item label="同行快递">
<template v-slot:right>
<u-input placeholder="" v-model="modelInfo.prepareInExpress" inputAlign="right"
custom-style="border:0;border-radius: 10rpx;background-color: #F6F6F6;padding: 11rpx 20rpx;"
placeholder-style="color: #999; "
></u-input>
<tpx-input v-model:value="modelInfo.prepareInExpress" inputAlign="right"></tpx-input>
</template>
</tpx-text-item>
</tpx-select>
@ -25,10 +22,7 @@
<view class="edm-input-item">
<tpx-text-item label="快递单号">
<template v-slot:right>
<u-input placeholder="" v-model="modelInfo.prepareInBillCode" inputAlign="right"
custom-style="border:0;border-radius: 10rpx;background-color: #F6F6F6;padding: 11rpx 20rpx;"
placeholder-style="color: #999; "
></u-input>
<tpx-input v-model:value="modelInfo.prepareInBillCode" inputAlign="right"></tpx-input>
</template>
</tpx-text-item>
</view>
@ -44,14 +38,7 @@
<view v-if="modelInfo.blPrepareInFreight" class="edm-input-item">
<tpx-text-item label="代垫预估">
<template v-slot:right>
<u-input placeholder="" v-model="modelInfo.prepareInEstFee" inputAlign="right"
custom-style="width: 366rpx;flex: none;border:0;border-radius: 10rpx;background-color: #F6F6F6;padding: 11rpx 20rpx;"
placeholder-style="color: #999; " _digit="5"
>
<template #suffix>
<text class="font-26 clr-sub pl-10">CNY</text>
</template>
</u-input>
<tpx-input v-model:value="modelInfo.prepareInEstFee" _digit="5" inputAlign="right" suffix="CNY"></tpx-input>
</template>
</tpx-text-item>
</view>
@ -59,10 +46,7 @@
<view class="edm-input-item">
<tpx-text-item label="供应商">
<template v-slot:right>
<u-input placeholder="" v-model="modelInfo.prepareInSupplier" inputAlign="right"
custom-style="border:0;border-radius: 10rpx;background-color: #F6F6F6;padding: 11rpx 20rpx;"
placeholder-style="color: #999; "
></u-input>
<tpx-input v-model:value="modelInfo.prepareInSupplier" inputAlign="right"></tpx-input>
</template>
</tpx-text-item>
</view>
@ -70,28 +54,11 @@
<view class="edm-input-item">
<tpx-text-item label="自定义标记">
<template v-slot:right>
<u-input placeholder="" v-model="modelInfo.prepareInRemark" inputAlign="right"
custom-style="border:0;border-radius: 10rpx;background-color: #F6F6F6;padding: 11rpx 20rpx;"
placeholder-style="color: #999; "
></u-input>
<tpx-input v-model:value="modelInfo.prepareInRemark" inputAlign="right"></tpx-input>
</template>
</tpx-text-item>
</view>
<!-- <view class="edm-input-item">
<u-row justify="between">
<u-col span="4">
<text class="font-26 font-weight">备注</text>
</u-col>
<u-col span="7">
<u-input placeholder="" v-model="value1" inputAlign="right"
custom-style="border:0;border-radius: 10rpx;background-color: #F6F6F6;padding: 11rpx 20rpx;"
placeholder-style="color: #999; "
></u-input>
</u-col>
</u-row>
</view> -->
</template>
<script>

View File

@ -6,13 +6,21 @@
<tpx-text-item label="货物大类" :value="modelInfo.goodsType"></tpx-text-item>
</tpx-select>
</view>
<view class="edm-input-item mb-10">
<view class="edm-input-item ">
<tpx-text-item label="货物名称">
<template v-slot:right>
<tpx-input v-model:value="modelInfo.goodsInfo" inputAlign="right"></tpx-input>
</template>
</tpx-text-item>
</view>
<view class="edm-input-item mb-10">
<u-row justify="between">
<text class="font-28 font-weight">总件数</text>
<view>
<u-number-box v-model="modelInfo.parcelQty" :min="1" :max="100000" buttonSize="50" inputWidth="100" iconStyle="font-size: 18rpx;"></u-number-box>
</view>
</u-row>
</view>
<view v-for="(item, index) in modelInfo.cargoList" class="yditem">
<view class="ydi-lab mb-10">
@ -35,6 +43,24 @@
</u-row>
</u-button>
<view class="edm-input-item mt-20">
<u-row justify="between">
<text class="font-28 font-weight">包裹重量</text>
<view>
<tpx-input v-model:value="modelInfo.billWeight" placeholder="" inputAlign="right" suffix="kg" _digit="5"></tpx-input>
</view>
</u-row>
</view>
<view class="edm-input-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³" _digit="5"></tpx-input>
</view>
</u-row>
</view>
</template>
<script>
@ -51,6 +77,15 @@
},
dicData() {
return this.$store.getters.dicData
},
totalVolume() {
let totalVolume = this.modelInfo.totalVolume
return totalVolume
},
isCargoListOnchange() {
return this.modelInfo.cargoList
}
},
watch: {
@ -70,6 +105,13 @@
this.modelInfo.cargoList.splice(maxCaIndex + 1, this.modelInfo.cargoList.length -1 - maxCaIndex)
}
}
},
isCargoListOnchange: {
handler(newVal){
console.log("===bpe-goodsize-tmp isCargoListOnchange===")
this.handleCargoChange(newVal)
},
deep: true,
}
},
props: {
@ -110,6 +152,27 @@
},
handleChooseGood(val, name){
this.modelInfo.goodsInfo = name
},
handleCargoChange(list){
let parcelQty = 0, totalVolume = 0
list.map(t=> {
totalVolume += (+t.volume) || 0
})
this.modelInfo.totalVolume = totalVolume.toFixed(5)
},
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()
}
}
}

View File

@ -26,16 +26,15 @@
</tpx-select>
</view>
<view class="edm-input-item">
<tpx-text-item label="物品数量">
<!-- <view class="edm-input-item">
<tpx-text-item label="件数">
<template v-slot:right>
<tpx-input placeholder="请填写" v-model:value="modelInfo.cargoQty" inputAlign="right" type="number" suffix="件" :_maxNum="cargoQtyMaxNum"></tpx-input>
</template>
</tpx-text-item>
</view>
</view> -->
<bpe-gooditemsize-tmp v-model:value="modelInfo"></bpe-gooditemsize-tmp>
<bpe-gooditemsize-tmp v-model:value="modelInfo" :submitVal="submitVal"></bpe-gooditemsize-tmp>
<view v-if="showMode!=1">
<view class="edm-input-item">

View File

@ -3,8 +3,8 @@
<view class="jsfm-item">
<u-row justify="between" align="top">
<text class="font-28 pt-20 font-weight">尺寸</text>
<view style="width: 70%;">
<!-- <text class="font-28 pt-20 font-weight">尺寸</text> -->
<view style="width: 100%;">
<u-row justify="between">
<u-col span="3.7">
<tpx-input v-model:value="modelInfo.length" placeholder="长" inputAlign="right" suffix="cm" _digit="5"></tpx-input>
@ -20,12 +20,20 @@
</u-row>
</view>
<view class="jsfm-item">
<u-row justify="between" align="top">
<text class="font-28 font-weight">体积</text>
<view style="">
{{modelInfo.volume || '0'}}
<text class="clr-sub">m³</text>
</view>
<u-row justify="between">
<u-row>
<text class="font-28 font-weight pr-10">件数</text>
<view style="width: 200rpx;">
<tpx-input placeholder="请填写" v-model:value="modelInfo.cargoQty" inputAlign="right" type="number" suffix="件" :_maxNum="cargoQtyMaxNum"></tpx-input>
</view>
</u-row>
<u-row>
<text class="font-28 font-weight pr-10">体积</text>
<view style="">
{{modelInfo.volume || '0'}}
<text class="clr-sub">m³</text>
</view>
</u-row>
</u-row>
</view>
</view>
@ -44,6 +52,21 @@
return {
length, width, height, cargoQty
}
},
cargoQtyMaxNum(){
// 限制数量的最大值
let { cargoList, parcelQty } = this.submitVal
let curQty = (+this.modelInfo.cargoQty) || 0
let qtMaxNum = parcelQty + curQty
cargoList.map(t=> {
if(t.cargoQty) {
qtMaxNum = qtMaxNum - t.cargoQty
}
})
if(qtMaxNum < 0) {
qtMaxNum = 0
}
return qtMaxNum
}
},
watch: {
@ -59,7 +82,12 @@
default () {
return { }
}
}
},
submitVal: {
default () {
return {}
}
},
},
data() {
return {

View File

@ -33,9 +33,6 @@
<view class="com-section mt-30">托寄货物描述</view>
<view class="blcok-white">
<bpe-gooditem-edit-tmp v-model:value="submitParam"></bpe-gooditem-edit-tmp>
<view class="mt-30">
<bpe-goodsize-tmp ref="goodSize" :value="submitParam"></bpe-goodsize-tmp>
</view>
</view>
@ -71,12 +68,11 @@
import BpeGooditemEditTmp from "@/components/buns-post-edit-templates/bpe-gooditem-edit-tmp"
import BpeGoodphotoTmp from "@/components/buns-post-edit-templates/bpe-goodphoto-tmp"
import BoDetailTmp from "@/components/buns-order-templates/bo-detail-tmp"
import BpeGoodsizeTmp from "@/components/buns-post-edit-templates/bpe-goodsize-tmp"
import * as apiService from "@/common/api"
import { scanTypeEnum, getScanParams, ansScanResponse } from "@/common/scanUtil"
export default {
components: { BpeAddressjiamiTmp, BpeGooditemEditTmp, BpeGoodphotoTmp, BoDetailTmp, BpeGoodsizeTmp },
components: { BpeAddressjiamiTmp, BpeGooditemEditTmp, BpeGoodphotoTmp, BoDetailTmp },
props: {
// hasLeftWin: {
// type: Boolean

View File

@ -260,9 +260,8 @@
</tpx-layout>
<buns-edit-sheet percentHeight="70" title="商品信息" v-model:show="goodChooseModal.show" v-model:value="submitParam" v-slot="tempObject" @onSure="handleGoodInfoSure">
<bpe-goodsize-tmp ref="goodSize" :value="tempObject.value"></bpe-goodsize-tmp>
<view class="mt-30">
<bpe-gooditem-edit-tmp :value="tempObject.value"></bpe-gooditem-edit-tmp>
<bpe-gooditem-edit-tmp ref="goodEditInfo" :value="tempObject.value"></bpe-gooditem-edit-tmp>
</view>
<view class="mt-30">
<bpe-goodphoto-tmp :value="tempObject.value" filedName="goodsPics">
@ -459,7 +458,7 @@
},
async handleGoodInfoSure() {
// 校验各个组件的参数
let res = await this.$refs.goodSize.validData()
let res = await this.$refs.goodEditInfo.validData()
},
async handleSave(type) {
let saveServerHand = apiService.submitOrder