|
@@ -772,58 +772,58 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
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)
|
|
|
- // })
|
|
|
- // this.calculateLoading = true
|
|
|
- // 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 => {
|
|
|
- // if (val == 1) {
|
|
|
- // 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, 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, 10)
|
|
|
- // e.price = addPrice(e.outFactoryPrice, multiply(res.data.data.amountF, e.outFactoryPrice, 10), e.shareAmount)
|
|
|
- // e.amount = amountCal(
|
|
|
- // addPrice(e.outFactoryPrice, multiply(res.data.data.amountF, e.outFactoryPrice, 10), e.shareAmount),
|
|
|
- // e.orderQuantity,
|
|
|
- // e.freight,
|
|
|
- // e.insurance,
|
|
|
- // e.discount
|
|
|
- // );
|
|
|
- // }
|
|
|
- // e.itemMargin = grossProfitCal(
|
|
|
- // e.purchaseAmount,
|
|
|
- // e.partsPrice,
|
|
|
- // e.outFactoryPrice,
|
|
|
- // this.form.exchangeRate
|
|
|
- // );
|
|
|
- // })
|
|
|
- // let arr = []
|
|
|
- // 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) })
|
|
|
- // arr.push({ feesType: 2, ...e, corpId: this.form.corpId, corpName: this.form.corpsName, amount: multiply(e.price, e.quantity), srcType: val == 1 ? '国内费用' : '国外费用' })
|
|
|
- // })
|
|
|
- // this.$emit('formGoodstoFees', arr, val == 1 ? '国内费用' : '国外费用')
|
|
|
- // });
|
|
|
- // })
|
|
|
- // .finally(() => {
|
|
|
- // this.calculateLoading = false;
|
|
|
- // });
|
|
|
+ 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)
|
|
|
+ })
|
|
|
+ this.calculateLoading = true
|
|
|
+ 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 => {
|
|
|
+ if (val == 1) {
|
|
|
+ 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, 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, 10)
|
|
|
+ e.price = addPrice(e.outFactoryPrice, multiply(res.data.data.amountF, e.outFactoryPrice, 10), e.shareAmount)
|
|
|
+ e.amount = amountCal(
|
|
|
+ addPrice(e.outFactoryPrice, multiply(res.data.data.amountF, e.outFactoryPrice, 10), e.shareAmount),
|
|
|
+ e.orderQuantity,
|
|
|
+ e.freight,
|
|
|
+ e.insurance,
|
|
|
+ e.discount
|
|
|
+ );
|
|
|
+ }
|
|
|
+ e.itemMargin = grossProfitCal(
|
|
|
+ e.purchaseAmount,
|
|
|
+ e.partsPrice,
|
|
|
+ e.outFactoryPrice,
|
|
|
+ this.form.exchangeRate
|
|
|
+ );
|
|
|
+ })
|
|
|
+ let arr = []
|
|
|
+ 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) })
|
|
|
+ arr.push({ feesType: 2, ...e, corpId: this.form.corpId, corpName: this.form.corpsName, amount: multiply(e.price, e.quantity), srcType: val == 1 ? '国内费用' : '国外费用' })
|
|
|
+ })
|
|
|
+ this.$emit('formGoodstoFees', arr, val == 1 ? '国内费用' : '国外费用')
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ this.calculateLoading = false;
|
|
|
+ });
|
|
|
},
|
|
|
khEdit(status) {
|
|
|
if (status == 'cname') {
|