|
|
@@ -31,7 +31,7 @@
|
|
|
:disabled="detailData.status == 1" circle></el-button>
|
|
|
</template>
|
|
|
<template slot="codeHeader" slot-scope="{column}">
|
|
|
- <span style="color: #409EFF;cursor: pointer" @click.stop="khEdit('cname')">{{column.label}}</span>
|
|
|
+ <span style="color: #409EFF;cursor: pointer" @click.stop="khEdit('cname')">{{ column.label }}</span>
|
|
|
</template>
|
|
|
//操作栏
|
|
|
<template slot="menu" slot-scope="{ row, index }">
|
|
|
@@ -111,10 +111,10 @@
|
|
|
<template slot="partsValveNameForm" slot-scope="{type,disabled}">
|
|
|
<div style="display:flex;">
|
|
|
<el-input v-model="goodsForm.partsValveName" size="small" placeholder="" :disabled="disabled">
|
|
|
- <template
|
|
|
- slot="append">{{goodsForm.partsValveSalePrice?goodsForm.partsValveSalePrice:0}}</template>
|
|
|
+ <template slot="append">{{ goodsForm.partsValveSalePrice ? goodsForm.partsValveSalePrice : 0
|
|
|
+ }}</template>
|
|
|
</el-input>
|
|
|
- <el-button icon="el-icon-edit" size="mini" @click="openpart(0,goodsForm.partsValveValue)"
|
|
|
+ <el-button icon="el-icon-edit" size="mini" @click="openpart(0, goodsForm.partsValveValue)"
|
|
|
:disabled="disabled"></el-button>
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -122,9 +122,10 @@
|
|
|
<template slot="partsCapNameForm" slot-scope="{type,disabled}">
|
|
|
<div style="display:flex;">
|
|
|
<el-input v-model="goodsForm.partsCapName" size="small" placeholder="" :disabled="disabled">
|
|
|
- <template slot="append">{{goodsForm.partsCapSalePrice?goodsForm.partsCapSalePrice:0}}</template>
|
|
|
+ <template slot="append">{{ goodsForm.partsCapSalePrice ? goodsForm.partsCapSalePrice : 0
|
|
|
+ }}</template>
|
|
|
</el-input>
|
|
|
- <el-button icon="el-icon-edit" size="mini" @click="openpart(1,goodsForm.partsCapValue)"
|
|
|
+ <el-button icon="el-icon-edit" size="mini" @click="openpart(1, goodsForm.partsCapValue)"
|
|
|
:disabled="disabled"></el-button>
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -132,10 +133,10 @@
|
|
|
<template slot="partsHandleNameForm" slot-scope="{type,disabled}">
|
|
|
<div style="display:flex;">
|
|
|
<el-input v-model="goodsForm.partsHandleName" size="small" placeholder="" :disabled="disabled">
|
|
|
- <template
|
|
|
- slot="append">{{goodsForm.partsHandleSalePrice?goodsForm.partsHandleSalePrice:0}}</template>
|
|
|
+ <template slot="append">{{ goodsForm.partsHandleSalePrice ? goodsForm.partsHandleSalePrice : 0
|
|
|
+ }}</template>
|
|
|
</el-input>
|
|
|
- <el-button icon="el-icon-edit" size="mini" @click="openpart(2,goodsForm.partsHandleValue)"
|
|
|
+ <el-button icon="el-icon-edit" size="mini" @click="openpart(2, goodsForm.partsHandleValue)"
|
|
|
:disabled="disabled"></el-button>
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -143,10 +144,10 @@
|
|
|
<template slot="partsColourNameForm" slot-scope="{type,disabled}">
|
|
|
<div style="display:flex;">
|
|
|
<el-input v-model="goodsForm.partsColourName" size="small" placeholder="" :disabled="disabled">
|
|
|
- <template
|
|
|
- slot="append">{{goodsForm.partsColourSalePrice?goodsForm.partsColourSalePrice:0}}</template>
|
|
|
+ <template slot="append">{{ goodsForm.partsColourSalePrice ? goodsForm.partsColourSalePrice : 0
|
|
|
+ }}</template>
|
|
|
</el-input>
|
|
|
- <el-button icon="el-icon-edit" size="mini" @click="openpart(3,goodsForm.partsColourValue)"
|
|
|
+ <el-button icon="el-icon-edit" size="mini" @click="openpart(3, goodsForm.partsColourValue)"
|
|
|
:disabled="disabled"></el-button>
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -154,10 +155,10 @@
|
|
|
<template slot="partsModeNameForm" slot-scope="{type,disabled}">
|
|
|
<div style="display:flex;">
|
|
|
<el-input v-model="goodsForm.partsModeName" size="small" placeholder="" :disabled="disabled">
|
|
|
- <template
|
|
|
- slot="append">{{goodsForm.partsModeSalePrice?goodsForm.partsModeSalePrice:0}}</template>
|
|
|
+ <template slot="append">{{ goodsForm.partsModeSalePrice ? goodsForm.partsModeSalePrice : 0
|
|
|
+ }}</template>
|
|
|
</el-input>
|
|
|
- <el-button icon="el-icon-edit" size="mini" @click="openpart(4,goodsForm.partsModeValue)"
|
|
|
+ <el-button icon="el-icon-edit" size="mini" @click="openpart(4, goodsForm.partsModeValue)"
|
|
|
:disabled="disabled"></el-button>
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -166,10 +167,11 @@
|
|
|
<div style="display:flex;">
|
|
|
<el-input v-model="goodsForm.partsAuthenticationName" size="small" placeholder=""
|
|
|
:disabled="disabled">
|
|
|
- <template
|
|
|
- slot="append">{{goodsForm.partsAuthenticationSalePrice?goodsForm.partsAuthenticationSalePrice:0}}</template>
|
|
|
+ <template slot="append">{{ goodsForm.partsAuthenticationSalePrice ?
|
|
|
+ goodsForm.partsAuthenticationSalePrice : 0
|
|
|
+ }}</template>
|
|
|
</el-input>
|
|
|
- <el-button icon="el-icon-edit" size="mini" @click="openpart(5,goodsForm.partsAuthenticationValue)"
|
|
|
+ <el-button icon="el-icon-edit" size="mini" @click="openpart(5, goodsForm.partsAuthenticationValue)"
|
|
|
:disabled="disabled">
|
|
|
</el-button>
|
|
|
</div>
|
|
|
@@ -178,10 +180,10 @@
|
|
|
<template slot="partsOtherNameForm" slot-scope="{type,disabled}">
|
|
|
<div style="display:flex;">
|
|
|
<el-input v-model="goodsForm.partsOtherName" size="small" placeholder="" :disabled="disabled">
|
|
|
- <template
|
|
|
- slot="append">{{goodsForm.partsOtherSalePrice?goodsForm.partsOtherSalePrice:0}}</template>
|
|
|
+ <template slot="append">{{ goodsForm.partsOtherSalePrice ? goodsForm.partsOtherSalePrice : 0
|
|
|
+ }}</template>
|
|
|
</el-input>
|
|
|
- <el-button icon="el-icon-edit" size="mini" @click="openpart(6,goodsForm.partsOtherValue)"
|
|
|
+ <el-button icon="el-icon-edit" size="mini" @click="openpart(6, goodsForm.partsOtherValue)"
|
|
|
:disabled="disabled"></el-button>
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -320,7 +322,8 @@ import {
|
|
|
amountCal,
|
|
|
grossProfitCal,
|
|
|
costCal,
|
|
|
- addPrice
|
|
|
+ addPrice,
|
|
|
+ divide
|
|
|
} from "@/util/calculate";
|
|
|
import _ from "lodash";
|
|
|
export default {
|
|
|
@@ -777,35 +780,31 @@ 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 + ",是否继续更新?", {
|
|
|
+ if (val == 1) {
|
|
|
+ let numSum = 0
|
|
|
+ this.orderFeesList.forEach(e => {
|
|
|
+ if (e.feesType == 2 && e.currency == "CNY") {
|
|
|
+ console.log(sum, e.amount)
|
|
|
+ numSum = sum(numSum, e.amount)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ let num = 0;
|
|
|
+ num = divide(divide(numSum, this.form.totalValue,10), this.form.exchangeRate,10)
|
|
|
+ this.$confirm("总运费:" + divide(numSum, this.form.exchangeRate) + ",单价分摊运费:" + num + ",是否继续更新?", {
|
|
|
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.shareAmount = multiply(num, e.outFactoryPrice, 10)
|
|
|
+ e.price = addPrice(e.outFactoryPrice, multiply(num, e.outFactoryPrice, 10), e.internationalAmount)
|
|
|
+ e.amount = amountCal(
|
|
|
+ addPrice(e.outFactoryPrice, multiply(num, e.outFactoryPrice, 10), e.internationalAmount),
|
|
|
+ e.orderQuantity,
|
|
|
+ e.freight,
|
|
|
+ e.insurance,
|
|
|
+ e.discount
|
|
|
+ );
|
|
|
e.itemMargin = grossProfitCal(
|
|
|
e.purchaseAmount,
|
|
|
e.partsPrice,
|
|
|
@@ -813,17 +812,41 @@ export default {
|
|
|
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 ? '国内费用' : '国外费用' })
|
|
|
+ })
|
|
|
+
|
|
|
+ } else {
|
|
|
+ let numSum = 0
|
|
|
+ this.orderFeesList.forEach(e => {
|
|
|
+ if (e.feesType == 2 && e.currency == "USD") {
|
|
|
+ numSum = sum(numSum, e.amount)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ let num = 0;
|
|
|
+ num = divide(numSum, this.form.totalValue,10)
|
|
|
+ this.$confirm("总运费:" + numSum + ",单价分摊运费:" + num + ",是否继续更新?", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ this.data.forEach(e => {
|
|
|
+ e.internationalAmount = multiply(num, e.outFactoryPrice, 10)
|
|
|
+ e.price = addPrice(e.outFactoryPrice, multiply(num, e.outFactoryPrice, 10), e.shareAmount)
|
|
|
+ e.amount = amountCal(
|
|
|
+ addPrice(e.outFactoryPrice, multiply(num, 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
|
|
|
+ );
|
|
|
})
|
|
|
- this.$emit('formGoodstoFees', arr, val == 1 ? '国内费用' : '国外费用')
|
|
|
- });
|
|
|
- })
|
|
|
- .finally(() => {
|
|
|
- this.calculateLoading = false;
|
|
|
- });
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
khEdit(status) {
|
|
|
if (status == 'cname') {
|