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 = {})=> { export const calcWaybillFee = (data = {})=> {
return coreRequest(url.calcWaybillFee, data, {}, "GET") return coreRequest(url.calcWaybillFee, data, {})
} }
// 下单-进仓列表 // 下单-进仓列表

View File

@ -4,12 +4,12 @@
<u-row> <u-row>
<view class="lft1 font-28">计费方式</view> <view class="lft1 font-28">计费方式</view>
<view style="flex: 1;"> <view style="flex: 1;">
<u-radio-group v-model="modelInfo.calcFeeType" @change="groupChange" > <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" <u-radio v-for="(item, index) in dicData.emis_calc_fee_type" :label="item.title"
activeColor="#B12D29" size="30" labelSize="26" :custom-style="`margin-right: ${index+1<dicData.emis_calc_fee_type.length?30:0}rpx;`" :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>
</u-radio-group> </u-radio-group>
</view> </view>
</u-row> </u-row>
</view> </view>
@ -18,12 +18,14 @@
<u-row custom-style="gap: 20rpx;"> <u-row custom-style="gap: 20rpx;">
<u-row custom-style="flex: 1"> <u-row custom-style="flex: 1">
<text class="font-26 pr-10">{{item.feeName}}</text> <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>
<!-- 干线运输费才显示 续重 --> <!-- 干线运输费才显示 续重 -->
<u-row v-if="item.feeCode == '1001'" custom-style="flex: 1"> <u-row v-if="item.feeCode == '1001'" custom-style="flex: 1">
<text class="font-26 pr-10">续重</text> <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> </u-row>
<view v-if="item.__add" @click="handleDelFee(index)" class="delicon"> <view v-if="item.__add" @click="handleDelFee(index)" class="delicon">
<u-icon name="minus-circle" size="30"></u-icon> <u-icon name="minus-circle" size="30"></u-icon>
@ -32,10 +34,10 @@
<view v-if="item.calcExp" class="mt-10 clr-sub">计算公式: {{item.calcExp}}</view> <view v-if="item.calcExp" class="mt-10 clr-sub">计算公式: {{item.calcExp}}</view>
</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-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> <u-icon name="plus" size="30" color="#B12D29"></u-icon>
<text class="pl-10">增加收费项</text> <text class="pl-10">增加收费项</text>
</u-button> </u-button>
@ -45,33 +47,65 @@
</template> </template>
<script> <script>
import * as apiService from "@/common/api"
export default { 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: { computed: {
modelInfo: { modelInfo: {
get(){ get() {
return this.value return this.value
} }
}, },
feeTypeOptions(){ feeTypeOptions() {
let list = this.dicData.emis_fee_type || [] let list = this.dicData.emis_fee_type || []
let curVals = this.modelInfo.feeItems.map(t=> t.feeCode) let curVals = this.modelInfo.feeItems.map(t => t.feeCode)
list = list.filter(t=> curVals.indexOf(t.val) == -1) list = list.filter(t => curVals.indexOf(t.val) == -1)
return list return list
}, },
dicData() { dicData() {
return this.$store.getters.dicData return this.$store.getters.dicData
} }
}, },
props: { props: {
value: { value: {
default () { default () {
return { } return {}
} }
} }
}, },
data() { data() {
return { return {}
}
}, },
created() { created() {
@ -91,34 +125,41 @@
this.modelInfo.feeItems.push({ this.modelInfo.feeItems.push({
__add: true, __add: true,
feeCode: val, 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> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.shet-cont{ .shet-cont {}
}
.jsfm-item{ .jsfm-item {
background-color: #F6F6F6; background-color: #F6F6F6;
padding: 20rpx; padding: 20rpx;
margin-bottom: 20rpx; margin-bottom: 20rpx;
border-bottom: 2rpx solid #F6F6F6; border-bottom: 2rpx solid #F6F6F6;
&:last-child{
&:last-child {
margin-bottom: 0rpx; margin-bottom: 0rpx;
} }
.lft1{
.lft1 {
width: 150rpx; width: 150rpx;
margin-right: 10rpx; margin-right: 10rpx;
} }
.delicon{
.delicon {
padding: 16rpx 0 16rpx 20rpx; padding: 16rpx 0 16rpx 20rpx;
} }
} }
.nobg{
.nobg {
background-color: transparent; background-color: transparent;
} }
</style> </style>

View File

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

View File

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