|
@@ -12,9 +12,11 @@
|
|
|
:disabled="detailData.status == 1 || orderItemIds.length == 0" @click="getInvoice">生成发货单
|
|
|
</el-button>
|
|
|
<el-button type="info" size="small" @click="cnameData">刷新基础资料</el-button>
|
|
|
- <el-button type="info" size="small" @click="calculate(1)" :disabled="detailData.status == 1">计算国内费用
|
|
|
+ <el-button type="info" size="small" @click="calculate(1)" :disabled="detailData.status == 1"
|
|
|
+ :loading="calculateLoading">计算国内费用
|
|
|
</el-button>
|
|
|
- <el-button type="info" size="small" @click="calculate(2)" :disabled="detailData.status == 1">计算国外费用
|
|
|
+ <el-button type="info" size="small" @click="calculate(2)" :disabled="detailData.status == 1"
|
|
|
+ :loading="calculateLoading">计算国外费用
|
|
|
</el-button>
|
|
|
</el-row>
|
|
|
</template>
|
|
@@ -195,15 +197,13 @@
|
|
|
</template>
|
|
|
//分摊金额
|
|
|
<template slot="shareAmountForm" slot-scope="{type,disabled}">
|
|
|
- <el-input v-model="goodsForm.shareAmount" size="small"
|
|
|
- oninput="value=value.replace(/[^0-9.]/g,'').replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')"
|
|
|
- @change="priceChange(goodsForm)"></el-input>
|
|
|
+ <el-input-number v-model="goodsForm.shareAmount" size="small" style="width:100%"
|
|
|
+ @change="priceChange(goodsForm)" :controls="false" :precision="10"></el-input-number>
|
|
|
</template>
|
|
|
//分摊金额
|
|
|
<template slot="internationalAmountForm" slot-scope="{type,disabled}">
|
|
|
- <el-input v-model="goodsForm.internationalAmount" size="small"
|
|
|
- oninput="value=value.replace(/[^0-9.]/g,'').replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')"
|
|
|
- @change="priceChange(goodsForm)"></el-input>
|
|
|
+ <el-input-number v-model="goodsForm.internationalAmount" size="small" style="width:100%"
|
|
|
+ @change="priceChange(goodsForm)" :controls="false" :precision="10"></el-input-number>
|
|
|
</template>
|
|
|
//单价
|
|
|
<template slot="priceForm" slot-scope="{type,disabled}">
|
|
@@ -307,6 +307,7 @@ export default {
|
|
|
name: "customerInformation",
|
|
|
data() {
|
|
|
return {
|
|
|
+ calculateLoading: false,
|
|
|
switchDialog: false,
|
|
|
loading: false,
|
|
|
itemtypeList: [],
|
|
@@ -756,28 +757,29 @@ export default {
|
|
|
e.sort = Number(index) + 1
|
|
|
this.form.totalValue = sum(multiply(e.outFactoryPrice, e.orderQuantity), this.form.totalValue)
|
|
|
})
|
|
|
+ this.calculateLoading = true
|
|
|
calculationDomesticFees({ ...this.form, domesticAbroad: val, orderItemsList: this.data, }).then(res => {
|
|
|
- this.$confirm("总费用为:" + res.data.data.amount + ",单项运费为" + res.data.data.amountF + ",是否继续更新?", {
|
|
|
+ this.$confirm("总运费:" + res.data.data.amount + ",单价分摊运费:" + res.data.data.amountF + ",是否继续更新?", {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
|
type: "warning"
|
|
|
}).then(() => {
|
|
|
this.data.forEach(e => {
|
|
|
if (val == 1) {
|
|
|
- e.shareAmount = multiply(res.data.data.amountF, e.outFactoryPrice)
|
|
|
- e.price = addPrice(e.outFactoryPrice, multiply(res.data.data.amountF, e.outFactoryPrice), e.internationalAmount)
|
|
|
+ e.shareAmount = multiply(res.data.data.amountF, e.outFactoryPrice, 10)
|
|
|
+ e.price = addPrice(e.outFactoryPrice, multiply(res.data.data.amountF, e.outFactoryPrice, 10), e.internationalAmount)
|
|
|
e.amount = amountCal(
|
|
|
- addPrice(e.outFactoryPrice, res.data.data.amountF, e.internationalAmount),
|
|
|
+ addPrice(e.outFactoryPrice, multiply(res.data.data.amountF, e.outFactoryPrice, 10), e.internationalAmount),
|
|
|
e.orderQuantity,
|
|
|
e.freight,
|
|
|
e.insurance,
|
|
|
e.discount
|
|
|
);
|
|
|
} else {
|
|
|
- e.internationalAmount = multiply(res.data.data.amountF, e.outFactoryPrice)
|
|
|
- e.price = addPrice(e.outFactoryPrice, multiply(res.data.data.amountF, e.outFactoryPrice), e.shareAmount)
|
|
|
+ e.internationalAmount = multiply(res.data.data.amountF, e.outFactoryPrice, 10)
|
|
|
+ e.price = addPrice(e.outFactoryPrice, multiply(res.data.data.amountF, e.outFactoryPrice, 10), e.shareAmount)
|
|
|
e.amount = amountCal(
|
|
|
- addPrice(e.outFactoryPrice, res.data.data.amountF, e.shareAmount),
|
|
|
+ addPrice(e.outFactoryPrice, multiply(res.data.data.amountF, e.outFactoryPrice, 10), e.shareAmount),
|
|
|
e.orderQuantity,
|
|
|
e.freight,
|
|
|
e.insurance,
|
|
@@ -793,10 +795,15 @@ export default {
|
|
|
})
|
|
|
res.data.data.fees.forEach(e => {
|
|
|
// this.orderFeesList.push({ feesType: 2, ...e, corpId: this.form.corpId, corpName: this.form.corpsName, amount: multiply(e.price, e.quantity) })
|
|
|
- this.$emit('formGoodstoFees',{ feesType: 2, ...e, corpId: this.form.corpId, corpName: this.form.corpsName, amount: multiply(e.price, e.quantity) })
|
|
|
+ if (e.price > 0) {
|
|
|
+ this.$emit('formGoodstoFees', { feesType: 2, ...e, corpId: this.form.corpId, corpName: this.form.corpsName, amount: multiply(e.price, e.quantity) })
|
|
|
+ }
|
|
|
})
|
|
|
});
|
|
|
})
|
|
|
+ .finally(() => {
|
|
|
+ this.calculateLoading = false;
|
|
|
+ });
|
|
|
},
|
|
|
khEdit(status) {
|
|
|
if (status == 'cname') {
|