This commit is contained in:
aihe 2024-04-29 16:13:17 +08:00
parent 4fb2f78c57
commit de38e2990e
4 changed files with 76 additions and 34 deletions

View File

@ -50,7 +50,7 @@ export const getCaculteDestSite = (data = {})=> {
// 计算运费
export const calcWaybillFee = (data = {})=> {
return coreRequest(url.calcWaybillFee, data, {}, "GET")
return coreRequest(url.calcWaybillFee, data, {})
}
// 下单-进仓列表

View File

@ -4,26 +4,28 @@
<u-row>
<view class="lft1 font-28">计费方式</view>
<view style="flex: 1;">
<u-radio-group v-model="modelInfo.calcFeeType" @change="groupChange" >
<u-radio v-for="(item, index) in dicData.emis_calc_fee_type" :label="item.title" :name="item.val"
activeColor="#B12D29" size="30" labelSize="26" :custom-style="`margin-right: ${index+1<dicData.emis_calc_fee_type.length?30:0}rpx;`"
>
<u-radio-group v-model="modelInfo.calcFeeType" @change="groupChange">
<u-radio v-for="(item, index) in dicData.emis_calc_fee_type" :label="item.title"
:name="item.val" activeColor="#B12D29" size="30" labelSize="26"
:custom-style="`margin-right: ${index+1<dicData.emis_calc_fee_type.length?30:0}rpx;`">
</u-radio>
</u-radio-group>
</u-radio-group>
</view>
</u-row>
</view>
<view v-for="(item, index) in modelInfo.feeItems" class="jsfm-item">
<u-row custom-style="gap: 20rpx;">
<u-row custom-style="flex: 1">
<text class="font-26 pr-10">{{item.feeName}}</text>
<tpx-input v-model:value="item.fee" :isWhite="true" custom-style="width: 120rpx;height: 46rpx;" suffix="CNY"></tpx-input>
<tpx-input v-model:value="item.fee" :isWhite="true" custom-style="width: 120rpx;height: 46rpx;"
suffix="CNY"></tpx-input>
</u-row>
<!-- 干线运输费才显示 续重 -->
<u-row v-if="item.feeCode == '1001'" custom-style="flex: 1">
<text class="font-26 pr-10">续重</text>
<tpx-input v-model:value="item.addWeight" :isWhite="true" custom-style="width: 120rpx;height: 46rpx;" suffix="KG"></tpx-input>
<tpx-input v-model:value="item.addWeight" :isWhite="true"
custom-style="width: 120rpx;height: 46rpx;" suffix="KG"></tpx-input>
</u-row>
<view v-if="item.__add" @click="handleDelFee(index)" class="delicon">
<u-icon name="minus-circle" size="30"></u-icon>
@ -31,47 +33,79 @@
</u-row>
<view v-if="item.calcExp" class="mt-10 clr-sub">计算公式: {{item.calcExp}}</view>
</view>
<tpx-select v-if="feeTypeOptions.length > 0" :list="feeTypeOptions" @onChange="handleAddFee" mode="drop"
>
<tpx-select v-if="feeTypeOptions.length > 0" :list="feeTypeOptions" @onChange="handleAddFee" mode="drop">
<u-row justify="center">
<u-button custom-style="border-radius: 16rpx;height:60rpx;font-size: 30rpx;margin-top: 20rpx;" :plain="true" type="primary">
<u-button custom-style="border-radius: 16rpx;height:60rpx;font-size: 30rpx;margin-top: 20rpx;"
:plain="true" type="primary">
<u-icon name="plus" size="30" color="#B12D29"></u-icon>
<text class="pl-10">增加收费项</text>
</u-button>
</u-row>
</tpx-select>
</view>
</view>
</template>
<script>
import * as apiService from "@/common/api"
export default {
watch: {
modelInfo: {
handler(newVal, oldVal) {
let params = {
"productType": newVal.productType,
"customerCode": newVal.customerCode,
"custNo": newVal.custNo,
"calcFeeType": newVal.calcFeeType,
"settlementWeight": newVal.settlementWeight,
"totalVolume": newVal.totalVolume,
"sendSiteCode": this.$store.getters.userInfo.ownerSiteCode,
"dispatchUnderlingSiteCode": newVal.dispatchUnderlingSiteCode,
}
// params = {
// "productType": "24202",
// "customerCode": "1",
// "custNo": "1",
// "calcFeeType": "1",
// "settlementWeight": "2.3",
// "totalVolume": "0.03",
// "sendSiteCode": "25001",
// "dispatchUnderlingSiteCode": "95001"
// }
// 所有的入参必须有值才可以计算
let vals = Object.values(params)
if (vals.length == vals.filter(v => !!v).length) {
this.calcWaybillFee(params)
}
},
deep: true
}
},
computed: {
modelInfo: {
get(){
get() {
return this.value
}
},
feeTypeOptions(){
feeTypeOptions() {
let list = this.dicData.emis_fee_type || []
let curVals = this.modelInfo.feeItems.map(t=> t.feeCode)
list = list.filter(t=> curVals.indexOf(t.val) == -1)
let curVals = this.modelInfo.feeItems.map(t => t.feeCode)
list = list.filter(t => curVals.indexOf(t.val) == -1)
return list
},
dicData() {
return this.$store.getters.dicData
return this.$store.getters.dicData
}
},
props: {
value: {
default () {
return { }
return {}
}
}
},
data() {
return {
}
return {}
},
created() {
@ -80,7 +114,7 @@
},
unmounted() {
},
methods: {
@ -91,34 +125,41 @@
this.modelInfo.feeItems.push({
__add: true,
feeCode: val,
feeName: this.dicData.emis_fee_type.filter(t=> t.val == val)[0].title
feeName: this.dicData.emis_fee_type.filter(t => t.val == val)[0].title
})
},
async calcWaybillFee(params) {
let res = await apiService.calcWaybillFee(params)
this.modelInfo.feeItems = res.data.feeItems
}
}
}
</script>
<style scoped lang="scss">
.shet-cont{
}
.jsfm-item{
.shet-cont {}
.jsfm-item {
background-color: #F6F6F6;
padding: 20rpx;
margin-bottom: 20rpx;
border-bottom: 2rpx solid #F6F6F6;
&:last-child{
&:last-child {
margin-bottom: 0rpx;
}
.lft1{
.lft1 {
width: 150rpx;
margin-right: 10rpx;
}
.delicon{
.delicon {
padding: 16rpx 0 16rpx 20rpx;
}
}
.nobg{
.nobg {
background-color: transparent;
}
</style>

View File

@ -34,7 +34,7 @@ export const getOrderModels = () => {
"openId": undefined,
"paymentType": undefined, // 付款方式
"calcFeeType": "1", // 计费方式
"custNo": undefined,
"custNo": undefined, // 月结账号
"transLine": '', // 路线
"productType": undefined, // 产品
"customsClear": undefined, // 清关方式
@ -72,7 +72,7 @@ export const getOrderModels = () => {
"transferBillcode": undefined,
"dispFdDate": undefined,
"takePieceEmployeeCode": undefined, // 收派员
"sendSiteCode": undefined,
"sendSiteCode": undefined, // 发件站点 -- 当前登录账号的siteCode
"destinationCode": undefined, // 目的地 code
"destinationProvince": undefined,
"destinationCity": undefined,

View File

@ -287,6 +287,7 @@
},
submitParam: {
...getOrderModels(),
sendSiteCode: this.$store.getters.userInfo.ownerSiteCode,
}
}
},