uu
This commit is contained in:
parent
474ca51066
commit
7c47e42322
@ -42,22 +42,24 @@
|
|||||||
<u-row custom-style="flex: 1">
|
<u-row custom-style="flex: 1">
|
||||||
<text class="font-26 pr-10">首重费</text>
|
<text class="font-26 pr-10">首重费</text>
|
||||||
<tpx-input v-model:value="item.initialWeightFee" @change="(val)=> { handleIwFeeChange(item, val) }" _digit="4" :isWhite="true"
|
<tpx-input v-model:value="item.initialWeightFee" @change="(val)=> { handleIwFeeChange(item, val) }" _digit="4" :isWhite="true"
|
||||||
:disabled="modelInfo.blSpecialQuote != 1" custom-style="width: 120rpx;height: 46rpx;" suffix="CNY"></tpx-input>
|
:disabled="modelInfo.blSpecialQuote != 1" custom-style="width: 120rpx;height: 46rpx;" :suffix="item.currency"></tpx-input>
|
||||||
</u-row>
|
</u-row>
|
||||||
<u-row custom-style="flex: 1">
|
<u-row custom-style="flex: 1">
|
||||||
<text class="font-26 pr-10">续重单价</text>
|
<text class="font-26 pr-10">续重单价</text>
|
||||||
<tpx-input v-model:value="item.addWeightPrice" @change="(val)=> { handleAwPriceChange(item, val) }" _digit="4" :isWhite="true"
|
<tpx-input v-model:value="item.addWeightPrice" @change="(val)=> { handleAwPriceChange(item, val) }" _digit="4" :isWhite="true"
|
||||||
:disabled="modelInfo.blSpecialQuote != 1" custom-style="width: 120rpx;height: 46rpx;" suffix="CNY"></tpx-input>
|
:disabled="modelInfo.blSpecialQuote != 1" custom-style="width: 120rpx;height: 46rpx;" :suffix="item.currency"></tpx-input>
|
||||||
</u-row>
|
</u-row>
|
||||||
</u-row>
|
</u-row>
|
||||||
<u-row style="margin-top:10rpx;" justify="between">
|
<u-row style="margin-top:10rpx;" justify="between">
|
||||||
<view>
|
<view>
|
||||||
<text class="">应收:</text> {{item.fee || 0}}
|
<text class="">应收:</text> {{item.fee || 0}} {{item.currency}}
|
||||||
</view>
|
</view>
|
||||||
<u-row custom-style="width:360rpx;">
|
<u-row custom-style="width:360rpx;">
|
||||||
<text class="font-26 pr-20">实收</text>
|
<text class="font-26 pr-20">实收</text>
|
||||||
<tpx-input v-model:value="item.realFee" @change="(val)=> { handleRlFeeChange(item, val) }" _digit="4" :isWhite="true" custom-style="width: 120rpx;height: 46rpx;"
|
<tpx-input v-model:value="item.realFee" @change="(val)=> { handleRlFeeChange(item, val) }" _digit="4" :isWhite="true" custom-style="width: 120rpx;height: 46rpx;"
|
||||||
:disabled="modelInfo.blSpecialQuote != 1" suffix="CNY"></tpx-input>
|
:disabled="modelInfo.blSpecialQuote != 1 || (item.initialWeightFee || item.addWeightPrice)"
|
||||||
|
:suffix="item.currency"
|
||||||
|
></tpx-input>
|
||||||
</u-row>
|
</u-row>
|
||||||
</u-row>
|
</u-row>
|
||||||
<!-- <view v-if="item.calcExp" class="mt-10">
|
<!-- <view v-if="item.calcExp" class="mt-10">
|
||||||
@ -95,28 +97,36 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<buns-edit-sheet percentHeight="40" :title="costModal.item.feeName" v-model:show="costModal.show" v-model:value="costModal.item" v-slot="tempObject" @onSure="handleCostItemSure" :okCloseModal="false">
|
<buns-edit-sheet percentHeight="40" :title="costModal.item.feeName" v-model:show="costModal.show" v-model:value="costModal.item" v-slot="tempObject" @onSure="handleCostItemSure" :okCloseModal="false">
|
||||||
<u-row custom-style="gap: 20rpx;margin-top:10rpx;">
|
<tpx-select v-model:value="tempObject.value.currency" :list="costRateList"
|
||||||
|
@onChange="handleCurrencyChange" mode="drop"
|
||||||
|
>
|
||||||
|
<u-row custom-style="gap: 20rpx;margin-top:10rpx;" justify="between">
|
||||||
|
<text class="font-26 label-text">币种</text>
|
||||||
|
<tpx-text-dic :value="tempObject.value.currency" :list="costRateList"></tpx-text-dic>
|
||||||
|
</u-row>
|
||||||
|
</tpx-select>
|
||||||
|
<u-row custom-style="gap: 20rpx;margin-top:30rpx;">
|
||||||
<u-row custom-style="flex: 1">
|
<u-row custom-style="flex: 1">
|
||||||
<text class="font-26 label-text">首重费</text>
|
<text class="font-26 label-text">首重费</text>
|
||||||
<tpx-input v-model:value="tempObject.value.initialWeightFee" _digit="4" :isWhite="true"
|
<tpx-input v-model:value="tempObject.value.initialWeightFee" _digit="4" :isWhite="true"
|
||||||
custom-style="width: 120rpx;height: 46rpx;" suffix="CNY"></tpx-input>
|
custom-style="width: 120rpx;height: 46rpx;" :suffix="tempObject.value.currency"></tpx-input>
|
||||||
</u-row>
|
</u-row>
|
||||||
<u-row custom-style="flex: 1">
|
<u-row custom-style="flex: 1">
|
||||||
<text class="font-26 label-text">续重单价</text>
|
<text class="font-26 label-text">续重单价</text>
|
||||||
<tpx-input v-model:value="tempObject.value.addWeightPrice" _digit="4" :isWhite="true"
|
<tpx-input v-model:value="tempObject.value.addWeightPrice" _digit="4" :isWhite="true"
|
||||||
custom-style="width: 120rpx;height: 46rpx;" suffix="CNY"></tpx-input>
|
custom-style="width: 120rpx;height: 46rpx;" :suffix="tempObject.value.currency"></tpx-input>
|
||||||
</u-row>
|
</u-row>
|
||||||
</u-row>
|
</u-row>
|
||||||
<u-row style="margin-top:30rpx;" justify="between">
|
<u-row style="margin-top:30rpx;" justify="between">
|
||||||
<u-row custom-style="width:300rpx;">
|
<u-row custom-style="width:300rpx;">
|
||||||
<text class="label-text">应收</text>
|
<text class="label-text">应收</text>
|
||||||
<tpx-input v-model:value="tempObject.value.fee" _digit="4" :isWhite="true" custom-style="width: 120rpx;height: 46rpx;"
|
<tpx-input v-model:value="tempObject.value.fee" _digit="4" :isWhite="true" custom-style="width: 120rpx;height: 46rpx;"
|
||||||
suffix="CNY"></tpx-input>
|
:suffix="tempObject.value.currency"></tpx-input>
|
||||||
</u-row>
|
</u-row>
|
||||||
<u-row custom-style="width:300rpx;">
|
<u-row custom-style="width:300rpx;">
|
||||||
<text :class="`font-26 label-text label-text-required `">实收</text>
|
<text :class="`font-26 label-text label-text-required `">实收</text>
|
||||||
<tpx-input v-model:value="tempObject.value.realFee" _digit="4" :isWhite="true" custom-style="width: 120rpx;height: 46rpx;"
|
<tpx-input v-model:value="tempObject.value.realFee" _digit="4" :isWhite="true" custom-style="width: 120rpx;height: 46rpx;"
|
||||||
suffix="CNY"></tpx-input>
|
:suffix="tempObject.value.currency"></tpx-input>
|
||||||
</u-row>
|
</u-row>
|
||||||
</u-row>
|
</u-row>
|
||||||
<view class="mt-30">
|
<view class="mt-30">
|
||||||
@ -187,11 +197,15 @@
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
costModal: { item: {}, show: false },
|
costModal: { item: {}, show: false },
|
||||||
daiDianCode: '1002'
|
daiDianCode: '1002',
|
||||||
|
costRateList: [].concat(costRateList),
|
||||||
|
costRateTypeEnum: { ...costRateTypeEnum },
|
||||||
|
usdToCnyRate: 1
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
async created() {
|
||||||
this.getRateData()
|
let data = await this.getRateData(costRateTypeEnum.usd)
|
||||||
|
this.usdToCnyRate = data
|
||||||
},
|
},
|
||||||
onHide() {
|
onHide() {
|
||||||
|
|
||||||
@ -203,6 +217,7 @@
|
|||||||
methods: {
|
methods: {
|
||||||
getNewCostItem(code, extData = {}){
|
getNewCostItem(code, extData = {}){
|
||||||
return {
|
return {
|
||||||
|
currency: costRateTypeEnum.cny,
|
||||||
blAutoGen: 0, // 手动添加的费用标识
|
blAutoGen: 0, // 手动添加的费用标识
|
||||||
feeCode: code,
|
feeCode: code,
|
||||||
feeName: this.dicData.emis_fee_type.filter(t => t.val == code)[0].title,
|
feeName: this.dicData.emis_fee_type.filter(t => t.val == code)[0].title,
|
||||||
@ -219,7 +234,7 @@
|
|||||||
this.calteFreight()
|
this.calteFreight()
|
||||||
|
|
||||||
},
|
},
|
||||||
handleAddFee(code) {
|
async handleAddFee(code) {
|
||||||
this.costModal.show = {}
|
this.costModal.show = {}
|
||||||
this.costModal.item = this.getNewCostItem(code)
|
this.costModal.item = this.getNewCostItem(code)
|
||||||
},
|
},
|
||||||
@ -231,18 +246,27 @@
|
|||||||
this.modelInfo.freight = res.data.totalFee
|
this.modelInfo.freight = res.data.totalFee
|
||||||
|
|
||||||
},
|
},
|
||||||
async getRateData(){
|
async getRateData(from){
|
||||||
let res = await apiService.getValidExchangeRate({ from: 'USD', to: 'CNY' })
|
// 外币 to 人民币汇率
|
||||||
debugger
|
let toCnyRate = 1
|
||||||
|
if(from != costRateTypeEnum.cny) {
|
||||||
|
let res = await apiService.getValidExchangeRate({ from, to: 'CNY' })
|
||||||
|
res.data && (toCnyRate = res.data)
|
||||||
|
}
|
||||||
|
return toCnyRate
|
||||||
|
},
|
||||||
|
async handleCurrencyChange(val){
|
||||||
|
|
||||||
},
|
},
|
||||||
handleRlFeeChange(item, val){
|
handleRlFeeChange(item, val){
|
||||||
setTimeout(()=> {
|
setTimeout(()=> {
|
||||||
this.calteFreight()
|
this.calteShiRealfee(item, false)
|
||||||
}, 500)
|
}, 500)
|
||||||
// 同步外层变量
|
// 同步外层变量
|
||||||
if(item.feeCode == this.daiDianCode) {
|
if(item.feeCode == this.daiDianCode) {
|
||||||
this.modelInfo.prepareInEstFee = val
|
this.modelInfo.prepareInEstFee = val
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
handleAwPriceChange(item) {
|
handleAwPriceChange(item) {
|
||||||
setTimeout(()=> {
|
setTimeout(()=> {
|
||||||
@ -254,23 +278,36 @@
|
|||||||
this.calteShiRealfee(item)
|
this.calteShiRealfee(item)
|
||||||
}, 500)
|
}, 500)
|
||||||
},
|
},
|
||||||
calteShiRealfee(item){
|
calteShiRealfee(item, execRealFee = true){
|
||||||
if(item.blAutoGen == 1 && item.calcExp) {
|
let { initialWeightFee, addWeightPrice } = item
|
||||||
let { settlementWeight } = this.modelInfo
|
let { settlementWeight } = this.modelInfo
|
||||||
let { initialWeightFee, addWeightPrice, calcExp } = item
|
let calcExp = item.blAutoGen == 0 ? 's+w*d' : item.calcExp
|
||||||
|
if(execRealFee && calcExp && initialWeightFee && addWeightPrice && settlementWeight) {
|
||||||
let expr = calcExp;
|
let expr = calcExp;
|
||||||
expr = expr.replace("s", initialWeightFee);
|
expr = expr.replace("s", initialWeightFee);
|
||||||
expr = expr.replace("d", addWeightPrice);
|
expr = expr.replace("d", addWeightPrice);
|
||||||
expr = expr.replace("w", settlementWeight);
|
expr = expr.replace("w", settlementWeight);
|
||||||
item.realFee = parseFloat(eval(expr)).toFixed(2);
|
item.realFee = parseFloat(eval(expr)).toFixed(2);
|
||||||
this.calteFreight()
|
|
||||||
}
|
}
|
||||||
|
// 手动添加的 应收=实收
|
||||||
|
if(item.blAutoGen == 0) {
|
||||||
|
item.fee = item.realFee
|
||||||
|
}
|
||||||
|
if(item.currency == costRateTypeEnum.usd) {
|
||||||
|
// 记录realFee转换人民币后的值
|
||||||
|
item.remark = `汇率:${this.usdToCnyRate},${(item.realFee*this.usdToCnyRate).toFixed(2)}(${costRateTypeEnum.cny})`
|
||||||
|
}
|
||||||
|
this.calteFreight()
|
||||||
},
|
},
|
||||||
// 更新总费用
|
// 更新总费用
|
||||||
calteFreight(){
|
calteFreight(){
|
||||||
let total = 0
|
let total = 0
|
||||||
this.modelInfo.feeItems.map(t=> {
|
this.modelInfo.feeItems.map(t=> {
|
||||||
total += (+(t.realFee || 0))
|
let realFee = (+(t.realFee || 0))
|
||||||
|
if(t.currency == costRateTypeEnum.usd) {
|
||||||
|
realFee = (+(realFee * (+this.usdToCnyRate)).toFixed(2))
|
||||||
|
}
|
||||||
|
total += realFee
|
||||||
})
|
})
|
||||||
this.modelInfo.freight = total
|
this.modelInfo.freight = total
|
||||||
},
|
},
|
||||||
@ -279,6 +316,7 @@
|
|||||||
this.showToast("实收不能为空")
|
this.showToast("实收不能为空")
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
this.calteShiRealfee(data)
|
||||||
this.modelInfo.feeItems.push({ ...data })
|
this.modelInfo.feeItems.push({ ...data })
|
||||||
this.costModal.show = false
|
this.costModal.show = false
|
||||||
setTimeout(()=>{
|
setTimeout(()=>{
|
||||||
|
|||||||
@ -9,20 +9,20 @@
|
|||||||
<view>
|
<view>
|
||||||
<u-row justify="between">
|
<u-row justify="between">
|
||||||
<view>
|
<view>
|
||||||
<text class="clr-sub">实收</text> {{item.realFee || 0}}<text class="clr-sub pl-10">CNY</text>
|
<text class="clr-sub">实收</text> {{item.realFee || 0}}<text class="clr-sub pl-10">{{item.currency}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view >
|
<view >
|
||||||
<text class="clr-sub">应收</text> {{item.fee || 0}}<text class="clr-sub pl-10">CNY</text>
|
<text class="clr-sub">应收</text> {{item.fee || 0}}<text class="clr-sub pl-10">{{item.currency}}</text>
|
||||||
</view>
|
</view>
|
||||||
</u-row>
|
</u-row>
|
||||||
</view>
|
</view>
|
||||||
<view class="pt-10">
|
<view class="pt-10">
|
||||||
<u-row justify="between">
|
<u-row justify="between">
|
||||||
<view >
|
<view >
|
||||||
<text class="clr-sub">首重费</text> {{item.initialWeightFee || 0}}<text class="clr-sub pl-10">CNY</text>
|
<text class="clr-sub">首重费</text> {{item.initialWeightFee || 0}}<text class="clr-sub pl-10">{{item.currency}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view>
|
||||||
<text class="clr-sub">续重单价</text> {{item.addWeightPrice || 0}}<text class="clr-sub pl-10">CNY</text>
|
<text class="clr-sub">续重单价</text> {{item.addWeightPrice || 0}}<text class="clr-sub pl-10">{{item.currency}}</text>
|
||||||
</view>
|
</view>
|
||||||
</u-row>
|
</u-row>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
"appid" : "__UNI__BCB0FB5",
|
"appid" : "__UNI__BCB0FB5",
|
||||||
"description" : "探路国际速运",
|
"description" : "探路国际速运",
|
||||||
"versionName" : "1.0.1",
|
"versionName" : "1.0.1",
|
||||||
"versionCode" : "1037",
|
"versionCode" : "1038",
|
||||||
"transformPx" : false,
|
"transformPx" : false,
|
||||||
/* 5+App特有相关 */
|
/* 5+App特有相关 */
|
||||||
"app-plus" : {
|
"app-plus" : {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user