|
@@ -18,7 +18,9 @@
|
|
|
船务询价
|
|
|
</el-button>
|
|
|
<el-button type="info" size="small" @click="cnameData">刷新基础资料</el-button>
|
|
|
- <el-button type="info" size="small" @click="calculate" :disabled="detailData.status == 1">计算国内费用
|
|
|
+ <el-button type="info" size="small" @click="calculate(1)" :disabled="detailData.status == 1">计算国内费用
|
|
|
+ </el-button>
|
|
|
+ <el-button type="info" size="small" @click="calculate(2)" :disabled="detailData.status == 1">计算国外费用
|
|
|
</el-button>
|
|
|
</el-row>
|
|
|
</template>
|
|
@@ -215,6 +217,12 @@
|
|
|
oninput="value=value.replace(/[^0-9.]/g,'').replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')"
|
|
|
@change="priceChange(goodsForm)"></el-input>
|
|
|
</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>
|
|
|
+ </template>
|
|
|
//单价
|
|
|
<template slot="priceForm" slot-scope="{type,disabled}">
|
|
|
<el-input v-model="goodsForm.price" size="small"
|
|
@@ -377,6 +385,9 @@ export default {
|
|
|
},
|
|
|
form: {
|
|
|
type: Object
|
|
|
+ },
|
|
|
+ orderFeesList: {
|
|
|
+ type: Array
|
|
|
}
|
|
|
},
|
|
|
components: {
|
|
@@ -570,7 +581,7 @@ export default {
|
|
|
row.partsOtherValue = null;
|
|
|
row.partsOtherCostPrice = 0;
|
|
|
row.partsOtherSalePrice = 0;
|
|
|
- row.partsCost=0;
|
|
|
+ row.partsCost = 0;
|
|
|
row.corpId = e.corpId;
|
|
|
row.corpName = e.corpCode;
|
|
|
row.itemDescription = e.cnameDescription;
|
|
@@ -580,6 +591,7 @@ export default {
|
|
|
row.productPrice = productCal(e.purchaseAmount, 0, this.form.coefficient);
|
|
|
row.outFactoryPrice = sellingCal(productCal(e.purchaseAmount, 0, this.form.coefficient), this.form.exchangeRate);
|
|
|
row.shareAmount = 0;
|
|
|
+ row.internationalAmount = 0;
|
|
|
row.orderQuantity = 1;
|
|
|
row.insurance = 0;
|
|
|
row.freight = 0;
|
|
@@ -651,7 +663,7 @@ export default {
|
|
|
corpName: e.corpCode,
|
|
|
itemDescription: e.cnameDescription,
|
|
|
partsPrice: 0,
|
|
|
- partsCost:0,
|
|
|
+ partsCost: 0,
|
|
|
itemType: e.specs,
|
|
|
tradeTerms: null,
|
|
|
productPrice: productCal(e.purchaseAmount, 0, this.form.coefficient),
|
|
@@ -660,6 +672,7 @@ export default {
|
|
|
this.form.exchangeRate
|
|
|
),
|
|
|
shareAmount: 0,
|
|
|
+ internationalAmount: 0,
|
|
|
orderQuantity: 1,
|
|
|
insurance: 0,
|
|
|
freight: 0,
|
|
@@ -757,28 +770,40 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- calculate() {
|
|
|
+ calculate(val) {
|
|
|
this.form.totalValue = 0
|
|
|
this.data.forEach((e, index) => {
|
|
|
e.sort = Number(index) + 1
|
|
|
this.form.totalValue = sum(multiply(e.outFactoryPrice, e.orderQuantity), this.form.totalValue)
|
|
|
})
|
|
|
- calculationDomesticFees({ ...this.form, orderItemsList: this.data, }).then(res => {
|
|
|
+ calculationDomesticFees({ ...this.form, domesticAbroad: val, orderItemsList: this.data, }).then(res => {
|
|
|
this.$confirm("总费用为:" + res.data.data.amount + ",单项运费为" + res.data.data.amountF + ",是否继续更新?", {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
|
type: "warning"
|
|
|
}).then(() => {
|
|
|
this.data.forEach(e => {
|
|
|
- e.shareAmount = multiply(res.data.data.amountF, e.outFactoryPrice)
|
|
|
- e.price = addPrice(e.outFactoryPrice, multiply(res.data.data.amountF, e.outFactoryPrice))
|
|
|
- e.amount = amountCal(
|
|
|
- addPrice(e.outFactoryPrice, res.data.data.amountF),
|
|
|
- e.orderQuantity,
|
|
|
- e.freight,
|
|
|
- e.insurance,
|
|
|
- e.discount
|
|
|
- );
|
|
|
+ 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.amount = amountCal(
|
|
|
+ addPrice(e.outFactoryPrice, res.data.data.amountF, 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.amount = amountCal(
|
|
|
+ addPrice(e.outFactoryPrice, res.data.data.amountF, e.shareAmount),
|
|
|
+ e.orderQuantity,
|
|
|
+ e.freight,
|
|
|
+ e.insurance,
|
|
|
+ e.discount
|
|
|
+ );
|
|
|
+ }
|
|
|
e.itemMargin = grossProfitCal(
|
|
|
e.purchaseAmount,
|
|
|
e.partsPrice,
|
|
@@ -786,6 +811,10 @@ export default {
|
|
|
this.form.exchangeRate
|
|
|
);
|
|
|
})
|
|
|
+ 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) })
|
|
|
+ })
|
|
|
+
|
|
|
});
|
|
|
})
|
|
|
},
|
|
@@ -838,7 +867,8 @@ export default {
|
|
|
row.outFactoryPrice = sellingCal(row.productPrice, this.form.exchangeRate);
|
|
|
row.price = addPrice(
|
|
|
row.outFactoryPrice,
|
|
|
- row.shareAmount
|
|
|
+ row.shareAmount,
|
|
|
+ row.internationalAmount
|
|
|
);
|
|
|
row.amount = amountCal(
|
|
|
row.price,
|
|
@@ -855,9 +885,9 @@ export default {
|
|
|
);
|
|
|
},
|
|
|
priceChange(row) {
|
|
|
- row.price = addPrice(row.outFactoryPrice, row.shareAmount)
|
|
|
+ row.price = addPrice(row.outFactoryPrice, row.shareAmount, row.internationalAmount)
|
|
|
row.amount = amountCal(
|
|
|
- addPrice(row.outFactoryPrice, row.shareAmount),
|
|
|
+ addPrice(row.outFactoryPrice, row.shareAmount, row.internationalAmount),
|
|
|
row.orderQuantity,
|
|
|
row.freight,
|
|
|
row.insurance,
|
|
@@ -1041,7 +1071,8 @@ export default {
|
|
|
);
|
|
|
this.goodsForm.price = addPrice(
|
|
|
this.goodsForm.outFactoryPrice,
|
|
|
- this.goodsForm.shareAmount
|
|
|
+ this.goodsForm.shareAmount,
|
|
|
+ this.goodsForm.internationalAmount
|
|
|
);
|
|
|
this.goodsForm.amount = amountCal(
|
|
|
this.goodsForm.price,
|