|
|
@@ -9,21 +9,34 @@
|
|
|
:disabled="detailData.status == 1">导入商品</el-button> -->
|
|
|
<!-- <el-button type="primary" icon="el-icon-plus" size="small" @click.stop="addLibrary"
|
|
|
:disabled="detailData.status == 1">出口价格库</el-button> -->
|
|
|
- <el-button type="info" icon="el-icon-printer" size="small" @click.stop="openReport()">报表打印
|
|
|
+ <el-button type="primary" icon="el-icon-printer" size="small" @click.stop="openReport()">报表打印
|
|
|
</el-button>
|
|
|
- <el-button type="info" size="small" @click.stop="savePurchase" :disabled="detailData.status == 1">
|
|
|
+ <el-button type="warning" size="small" @click.stop="savePurchase" :disabled="detailData.status == 1">
|
|
|
采购询价
|
|
|
</el-button>
|
|
|
- <el-button type="info" size="small" @click.stop="saveShipping" :disabled="detailData.status == 1">
|
|
|
+ <el-button type="warning" size="small" @click.stop="saveShipping" :disabled="detailData.status == 1">
|
|
|
船务询价
|
|
|
</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="warning" size="small" @click="cnameData">刷新基础资料</el-button>
|
|
|
+ <el-button type="success" 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"
|
|
|
- :loading="calculateLoading">分摊海运费
|
|
|
+ <el-button type="success" size="small" @click="calculate(2)" :disabled="detailData.status == 1"
|
|
|
+ :loading="calculateLoading">分摊海运费到单价
|
|
|
</el-button>
|
|
|
+ <el-button type="success" size="small" @click="oceanUSD" :disabled="detailData.status == 1">海运费单列
|
|
|
+ </el-button>
|
|
|
+ <el-popover placement="top" width="160" v-model="visible">
|
|
|
+ <div style="text-align: center;">
|
|
|
+ <el-input-number v-model="priceAD" size="small" :controls="false"></el-input-number> %
|
|
|
+ </div>
|
|
|
+ <div style="text-align: right; margin: 0">
|
|
|
+ <el-button size="mini" type="text" @click="visible = false">取消</el-button>
|
|
|
+ <el-button size="mini" type="text" @click="submitPriceAD">确定</el-button>
|
|
|
+ </div>
|
|
|
+ <el-button type="success" size="small" slot="reference"
|
|
|
+ :disabled="detailData.status == 1">调整出厂价</el-button>
|
|
|
+ </el-popover>
|
|
|
</el-row>
|
|
|
</template>
|
|
|
<template slot="headerSerial">
|
|
|
@@ -34,37 +47,37 @@
|
|
|
<span style="color: #409EFF;cursor: pointer" @click.stop="khEdit('cname')">{{ column.label }}</span>
|
|
|
</template>
|
|
|
<template slot="orderQuantity" slot-scope="{row}">
|
|
|
- {{ row.orderQuantity|decimalFormat2 }}
|
|
|
+ {{ row.orderQuantity | decimalFormat2 }}
|
|
|
</template>
|
|
|
<template slot="amount" slot-scope="{row}">
|
|
|
- {{ row.amount|decimalFormat2 }}
|
|
|
+ {{ row.amount | decimalFormat2 }}
|
|
|
</template>
|
|
|
<template slot="partsCost" slot-scope="{row}">
|
|
|
- {{ row.partsCost|decimalFormat2 }}
|
|
|
+ {{ row.partsCost | decimalFormat2 }}
|
|
|
</template>
|
|
|
<template slot="partsPrice" slot-scope="{row}">
|
|
|
- {{ row.partsPrice|decimalFormat2 }}
|
|
|
+ {{ row.partsPrice | decimalFormat2 }}
|
|
|
</template>
|
|
|
<template slot="productPrice" slot-scope="{row}">
|
|
|
- {{ row.productPrice|decimalFormat2 }}
|
|
|
+ {{ row.productPrice | decimalFormat2 }}
|
|
|
</template>
|
|
|
<template slot="outFactoryPrice" slot-scope="{row}">
|
|
|
- {{ row.outFactoryPrice|decimalFormat2 }}
|
|
|
+ {{ row.outFactoryPrice | decimalFormat2 }}
|
|
|
</template>
|
|
|
<template slot="shareAmount" slot-scope="{row}">
|
|
|
- {{ row.shareAmount|decimalFormat2 }}
|
|
|
+ {{ row.shareAmount | decimalFormat2 }}
|
|
|
</template>
|
|
|
<template slot="internationalAmount" slot-scope="{row}">
|
|
|
- {{ row.internationalAmount|decimalFormat2 }}
|
|
|
+ {{ row.internationalAmount | decimalFormat2 }}
|
|
|
</template>
|
|
|
<template slot="price" slot-scope="{row}">
|
|
|
- {{ row.price|decimalFormat2 }}
|
|
|
+ {{ row.price | decimalFormat2 }}
|
|
|
</template>
|
|
|
<template slot="purchaseCost" slot-scope="{row}">
|
|
|
- {{ row.purchaseCost|decimalFormat2 }}
|
|
|
+ {{ row.purchaseCost | decimalFormat2 }}
|
|
|
</template>
|
|
|
<template slot="purchaseAmount" slot-scope="{row}">
|
|
|
- {{ row.purchaseAmount|decimalFormat2 }}
|
|
|
+ {{ row.purchaseAmount | decimalFormat2 }}
|
|
|
</template>
|
|
|
//操作栏
|
|
|
<template slot="menu" slot-scope="{ row, index }">
|
|
|
@@ -350,9 +363,11 @@ import {
|
|
|
sellingCal,
|
|
|
amountCal,
|
|
|
grossProfitCal,
|
|
|
+ goodsGrossProfitCal,
|
|
|
costCal,
|
|
|
addPrice,
|
|
|
- divide
|
|
|
+ divide,
|
|
|
+ priceaAjustment
|
|
|
} from "@/util/calculate";
|
|
|
import { micrometerFormat2, decimalFormat2 } from "@/util/validate";
|
|
|
import _ from "lodash";
|
|
|
@@ -360,6 +375,8 @@ export default {
|
|
|
name: "customerInformation",
|
|
|
data() {
|
|
|
return {
|
|
|
+ priceAD: 0,
|
|
|
+ visible: false,
|
|
|
calculateLoading: false,
|
|
|
switchDialog: false,
|
|
|
loading: false,
|
|
|
@@ -659,6 +676,7 @@ export default {
|
|
|
row.taxRate = 0;
|
|
|
row.unit = e.unit;
|
|
|
row.itemMargin = grossProfitCal(e.purchaseAmount, 0, sellingCal(productCal(e.purchaseAmount, 0, this.form.coefficient), this.form.exchangeRate), this.form.exchangeRate);
|
|
|
+ row.goodsGrossProfit = goodsGrossProfitCal(e.purchaseAmount, 0, sellingCal(productCal(e.purchaseAmount, 0, this.form.coefficient), this.form.exchangeRate), this.form.exchangeRate);
|
|
|
row.partsDescribe = null;
|
|
|
row.remarks = null;
|
|
|
row.exchangeRate = this.form.exchangeRate;
|
|
|
@@ -755,6 +773,15 @@ export default {
|
|
|
),
|
|
|
this.form.exchangeRate
|
|
|
),
|
|
|
+ goodsGrossProfit: goodsGrossProfitCal(
|
|
|
+ e.purchaseAmount,
|
|
|
+ 0,
|
|
|
+ sellingCal(
|
|
|
+ productCal(e.purchaseAmount, 0, this.form.coefficient),
|
|
|
+ this.form.exchangeRate
|
|
|
+ ),
|
|
|
+ this.form.exchangeRate
|
|
|
+ ),
|
|
|
partsDescribe: null,
|
|
|
remarks: null,
|
|
|
exchangeRate: this.form.exchangeRate,
|
|
|
@@ -803,6 +830,9 @@ export default {
|
|
|
if (!this.form.id) {
|
|
|
return this.$message.error("此单据没有提交记录,请先提交");
|
|
|
}
|
|
|
+ if (!this.form.documenterId) {
|
|
|
+ return this.$message.error("船务员必填");
|
|
|
+ }
|
|
|
this.$confirm("是否生成船务询价单?", {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
|
@@ -830,6 +860,15 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ oceanUSD() {
|
|
|
+ this.$confirm('是否将应付的海运费(USD)复制到应收?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ this.$emit('oceanUSD')
|
|
|
+ })
|
|
|
+ },
|
|
|
calculate(val) {
|
|
|
this.form.totalValue = 0
|
|
|
this.data.forEach((e, index) => {
|
|
|
@@ -840,7 +879,6 @@ export default {
|
|
|
let numSum = 0
|
|
|
this.orderFeesList.forEach(e => {
|
|
|
if (e.feesType == 2 && e.currency == "CNY") {
|
|
|
- console.log(sum, e.amount)
|
|
|
numSum = sum(numSum, e.amount)
|
|
|
}
|
|
|
})
|
|
|
@@ -867,6 +905,19 @@ export default {
|
|
|
e.outFactoryPrice,
|
|
|
this.form.exchangeRate
|
|
|
);
|
|
|
+ e.goodsGrossProfit = goodsGrossProfitCal(
|
|
|
+ e.purchaseAmount,
|
|
|
+ e.partsPrice,
|
|
|
+ e.outFactoryPrice,
|
|
|
+ this.form.exchangeRate
|
|
|
+ );
|
|
|
+ // 处理单品毛利率是 -00.00 的问题
|
|
|
+ if (Number(e.itemMargin) === 0) {
|
|
|
+ e.itemMargin = Number(e.itemMargin) + ''
|
|
|
+ }
|
|
|
+ if (Number(e.goodsGrossProfit) == 0) {
|
|
|
+ e.goodsGrossProfit = Number(e.goodsGrossProfit)
|
|
|
+ }
|
|
|
})
|
|
|
})
|
|
|
|
|
|
@@ -900,6 +951,19 @@ export default {
|
|
|
e.outFactoryPrice,
|
|
|
this.form.exchangeRate
|
|
|
);
|
|
|
+ e.goodsGrossProfit = goodsGrossProfitCal(
|
|
|
+ e.purchaseAmount,
|
|
|
+ e.partsPrice,
|
|
|
+ e.outFactoryPrice,
|
|
|
+ this.form.exchangeRate
|
|
|
+ );
|
|
|
+ // 处理单品毛利率是 -00.00 的问题
|
|
|
+ if (Number(e.itemMargin) === 0) {
|
|
|
+ e.itemMargin = Number(e.itemMargin) + ''
|
|
|
+ }
|
|
|
+ if (Number(e.goodsGrossProfit) == 0) {
|
|
|
+ e.goodsGrossProfit = Number(e.goodsGrossProfit)
|
|
|
+ }
|
|
|
})
|
|
|
})
|
|
|
}
|
|
|
@@ -944,6 +1008,45 @@ export default {
|
|
|
moveDown(row, index) {
|
|
|
this.data[index] = this.data.splice(index + 1, 1, row)[0]
|
|
|
},
|
|
|
+ submitPriceAD() {
|
|
|
+ this.visible = false;
|
|
|
+ this.data.forEach(e => {
|
|
|
+ e.outFactoryPrice = priceaAjustment(e.outFactoryPrice, this.priceAD)
|
|
|
+ e.totalValue = multiply(e.outFactoryPrice, e.orderQuantity)
|
|
|
+ e.price = addPrice(e.outFactoryPrice, e.shareAmount, e.internationalAmount)
|
|
|
+ e.amount = amountCal(
|
|
|
+ addPrice(e.outFactoryPrice, e.shareAmount, e.internationalAmount),
|
|
|
+ e.orderQuantity,
|
|
|
+ e.freight,
|
|
|
+ e.insurance,
|
|
|
+ e.discount
|
|
|
+ );
|
|
|
+ e.itemMargin = grossProfitCal(
|
|
|
+ e.purchaseAmount,
|
|
|
+ e.partsPrice,
|
|
|
+ e.outFactoryPrice,
|
|
|
+ this.form.exchangeRate
|
|
|
+ );
|
|
|
+ e.goodsGrossProfit = goodsGrossProfitCal(
|
|
|
+ e.purchaseAmount,
|
|
|
+ e.partsPrice,
|
|
|
+ e.outFactoryPrice,
|
|
|
+ this.form.exchangeRate
|
|
|
+ );
|
|
|
+ // 处理单品毛利率是 -00.00 的问题
|
|
|
+ if (Number(e.itemMargin) === 0) {
|
|
|
+ e.itemMargin = Number(e.itemMargin) + ''
|
|
|
+ }
|
|
|
+ if (Number(e.goodsGrossProfit) == 0) {
|
|
|
+ e.goodsGrossProfit = Number(e.goodsGrossProfit)
|
|
|
+ }
|
|
|
+ // 出厂价格为零,单品毛利润为零
|
|
|
+ if (e.outFactoryPrice == 0) {
|
|
|
+ e.itemMargin = 0
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.priceAD = 0
|
|
|
+ },
|
|
|
purchaseAmountChange(row) {
|
|
|
row.productPrice = productCal(
|
|
|
row.purchaseAmount,
|
|
|
@@ -969,6 +1072,15 @@ export default {
|
|
|
row.outFactoryPrice,
|
|
|
this.form.exchangeRate
|
|
|
);
|
|
|
+ row.goodsGrossProfit = goodsGrossProfitCal(
|
|
|
+ row.purchaseAmount,
|
|
|
+ row.partsPrice,
|
|
|
+ row.outFactoryPrice,
|
|
|
+ this.form.exchangeRate
|
|
|
+ );
|
|
|
+ if (Number(row.goodsGrossProfit) == 0) {
|
|
|
+ row.goodsGrossProfit = Number(row.goodsGrossProfit)
|
|
|
+ }
|
|
|
},
|
|
|
priceChange(row) {
|
|
|
row.price = addPrice(row.outFactoryPrice, row.shareAmount, row.internationalAmount)
|
|
|
@@ -985,6 +1097,15 @@ export default {
|
|
|
row.outFactoryPrice,
|
|
|
this.form.exchangeRate
|
|
|
);
|
|
|
+ row.goodsGrossProfit = goodsGrossProfitCal(
|
|
|
+ row.purchaseAmount,
|
|
|
+ row.partsPrice,
|
|
|
+ row.outFactoryPrice,
|
|
|
+ this.form.exchangeRate
|
|
|
+ );
|
|
|
+ if (Number(row.goodsGrossProfit) == 0) {
|
|
|
+ row.goodsGrossProfit = Number(row.goodsGrossProfit)
|
|
|
+ }
|
|
|
},
|
|
|
itemTypeFocus(row) {
|
|
|
this.itemtypeList = [];
|
|
|
@@ -1173,6 +1294,15 @@ export default {
|
|
|
this.goodsForm.outFactoryPrice,
|
|
|
this.form.exchangeRate
|
|
|
);
|
|
|
+ this.goodsForm.goodsGrossProfit = goodsGrossProfitCal(
|
|
|
+ this.goodsForm.purchaseAmount,
|
|
|
+ this.goodsForm.partsPrice,
|
|
|
+ this.goodsForm.outFactoryPrice,
|
|
|
+ this.form.exchangeRate
|
|
|
+ );
|
|
|
+ if (Number(this.goodsForm.goodsGrossProfit) == 0) {
|
|
|
+ this.goodsForm.goodsGrossProfit = Number(this.goodsForm.goodsGrossProfit)
|
|
|
+ }
|
|
|
const names = [this.goodsForm.partsModeName, this.goodsForm.partsHandleName, this.goodsForm.partsCapName, this.goodsForm.partsValveName, this.goodsForm.partsColourName, this.goodsForm.partsAuthenticationName, this.goodsForm.partsOtherName];
|
|
|
const name = []
|
|
|
names.forEach(e => {
|