|
@@ -98,6 +98,33 @@
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</template>
|
|
|
+ <template slot="currency">
|
|
|
+ <el-select
|
|
|
+ size="small"
|
|
|
+ v-model="form.currency"
|
|
|
+ placeholder="请选择"
|
|
|
+ @change="currencyChange"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in currencyList"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.dictValue"
|
|
|
+ :value="item.dictValue"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </template>
|
|
|
+ <template slot="exchangeRate">
|
|
|
+ <el-input
|
|
|
+ size="small"
|
|
|
+ v-model="form.exchangeRate"
|
|
|
+ oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d\d\d).*$/,
|
|
|
+ "$1.$2")'
|
|
|
+ placeholder="请输入 汇率"
|
|
|
+ :disabled="detailData.status == 1"
|
|
|
+ @change="exchangeRateChange"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
<template slot="boxNumber">
|
|
|
<el-input
|
|
|
size="mini"
|
|
@@ -227,6 +254,22 @@
|
|
|
</el-select>
|
|
|
<span v-else>{{ row.itemType }}</span>
|
|
|
</template>
|
|
|
+ <template slot="itemProp" slot-scope="{ row, index }">
|
|
|
+ <span v-if="row.$cellEdit" style="display:flex">
|
|
|
+ <el-input
|
|
|
+ v-model="row.itemProp"
|
|
|
+ :readonly="true"
|
|
|
+ size="small"
|
|
|
+ placeholder="请点击右边按钮"
|
|
|
+ ></el-input>
|
|
|
+ <el-button
|
|
|
+ icon="el-icon-edit"
|
|
|
+ size="mini"
|
|
|
+ @click="openProperty(row, index)"
|
|
|
+ ></el-button>
|
|
|
+ </span>
|
|
|
+ <span v-else>{{ row.itemProp }}</span>
|
|
|
+ </template>
|
|
|
<template slot="priorityReferrer" slot-scope="{ row }">
|
|
|
<el-checkbox
|
|
|
:disabled="!row.$cellEdit"
|
|
@@ -251,7 +294,7 @@
|
|
|
v-model="row.purchaseAmount"
|
|
|
size="small"
|
|
|
placeholder="请输入"
|
|
|
- @change="priceChange(row)"
|
|
|
+ @change="purchaseAmountChange(row)"
|
|
|
oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
|
|
|
></el-input>
|
|
|
<span v-else>{{ row.purchaseAmount | micrometerFormat }}</span>
|
|
@@ -438,8 +481,12 @@
|
|
|
<el-col :span="5">
|
|
|
<div>
|
|
|
<el-scrollbar>
|
|
|
- <basic-container style="margin-top:45px">
|
|
|
- <avue-tree :option="treeOption" @node-click="nodeClick" />
|
|
|
+ <basic-container>
|
|
|
+ <avue-tree
|
|
|
+ :option="treeOption"
|
|
|
+ @node-click="nodeClick"
|
|
|
+ :style="treeStyle"
|
|
|
+ />
|
|
|
</basic-container>
|
|
|
</el-scrollbar>
|
|
|
</div>
|
|
@@ -480,13 +527,12 @@
|
|
|
></report-dialog>
|
|
|
<part-dialog
|
|
|
ref="part"
|
|
|
- @partOpen="partOpen()"
|
|
|
:partList="partList"
|
|
|
@importPart="importPart"
|
|
|
@partClosed="partClosed"
|
|
|
- @partReData="partReData"
|
|
|
/>
|
|
|
<price-library ref="library" @importLibray="importLibray" />
|
|
|
+ <property-dialog ref="property" @importProperty="importProperty" />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -513,10 +559,19 @@ import { micrometerFormat } from "@/util/validate";
|
|
|
import { contrastObj, contrastList } from "@/util/contrastData";
|
|
|
import customerDialog from "@/components/customer-dialog/main";
|
|
|
import priceLibrary from "@/components/price-Library/main";
|
|
|
+import propertyDialog from "@/components/property-dialog/main";
|
|
|
+import { dateFormat } from "@/util/date";
|
|
|
+import {
|
|
|
+ productCal,
|
|
|
+ sellingCal,
|
|
|
+ amountCal,
|
|
|
+ transformCal
|
|
|
+} from "@/util/calculate";
|
|
|
export default {
|
|
|
name: "detailsPageEdit",
|
|
|
data() {
|
|
|
return {
|
|
|
+ treeStyle: "height:" + (window.innerHeight - 315) + "px",
|
|
|
configuration: {
|
|
|
multipleChoices: false,
|
|
|
multiple: false,
|
|
@@ -526,7 +581,10 @@ export default {
|
|
|
},
|
|
|
switchDialog: false,
|
|
|
form: {
|
|
|
- orderStatus: "录入"
|
|
|
+ orderStatus: "录入",
|
|
|
+ businesDate: dateFormat(new Date(), "yyyy-MM-dd") + " 00:00:00",
|
|
|
+ currency: "CNY",
|
|
|
+ exchangeRate: "1"
|
|
|
},
|
|
|
disabled: false,
|
|
|
dialogVisible: false,
|
|
@@ -555,12 +613,6 @@ export default {
|
|
|
disabled: true
|
|
|
},
|
|
|
{
|
|
|
- label: "公司主体",
|
|
|
- prop: "belongToCorpId",
|
|
|
- span: 16,
|
|
|
- row: true
|
|
|
- },
|
|
|
- {
|
|
|
label: "联系人",
|
|
|
prop: "corpAttn",
|
|
|
span: 8
|
|
@@ -582,6 +634,12 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
+ label: "公司主体",
|
|
|
+ prop: "belongToCorpId",
|
|
|
+ span: 16,
|
|
|
+ row: true
|
|
|
+ },
|
|
|
+ {
|
|
|
label: "起运港",
|
|
|
prop: "portOfLoad",
|
|
|
span: 8,
|
|
@@ -681,28 +739,19 @@ export default {
|
|
|
label: "币别",
|
|
|
prop: "currency",
|
|
|
span: 8,
|
|
|
- type: "select",
|
|
|
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=currency",
|
|
|
- props: {
|
|
|
- label: "dictValue",
|
|
|
- value: "dictValue"
|
|
|
- },
|
|
|
- change: ({ value }) => {
|
|
|
- if (value == "CNY") {
|
|
|
- this.form.exchangeRate = 1;
|
|
|
- }
|
|
|
- if (value == "USD") {
|
|
|
- this.form.exchangeRate = 6.3843;
|
|
|
+ rules: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: "",
|
|
|
+ trigger: "blur"
|
|
|
}
|
|
|
- }
|
|
|
+ ]
|
|
|
},
|
|
|
{
|
|
|
label: "汇率",
|
|
|
prop: "exchangeRate",
|
|
|
span: 8,
|
|
|
- slot: true,
|
|
|
- row: true,
|
|
|
- disabled: true
|
|
|
+ row: true
|
|
|
},
|
|
|
{
|
|
|
label: "箱型",
|
|
@@ -863,7 +912,10 @@ export default {
|
|
|
itemtypeList: [],
|
|
|
reData: null,
|
|
|
oldform: {
|
|
|
- orderStatus: "录入"
|
|
|
+ orderStatus: "录入",
|
|
|
+ businesDate: dateFormat(new Date(), "yyyy-MM-dd") + " 00:00:00",
|
|
|
+ currency: "CNY",
|
|
|
+ exchangeRate: "1"
|
|
|
},
|
|
|
olddata: [],
|
|
|
oldorderFeesList: [],
|
|
@@ -871,12 +923,12 @@ export default {
|
|
|
subLoading: false,
|
|
|
pageLoading: false,
|
|
|
showBut: true,
|
|
|
- partreData: null,
|
|
|
partType: false,
|
|
|
partList: [],
|
|
|
goodsoptions: [],
|
|
|
priceTermsList: [],
|
|
|
- paymentTermList: []
|
|
|
+ paymentTermList: [],
|
|
|
+ currencyList: []
|
|
|
};
|
|
|
},
|
|
|
props: {
|
|
@@ -890,7 +942,8 @@ export default {
|
|
|
uploadFile,
|
|
|
customerDialog,
|
|
|
partDialog,
|
|
|
- priceLibrary
|
|
|
+ priceLibrary,
|
|
|
+ propertyDialog
|
|
|
},
|
|
|
async created() {
|
|
|
if (this.detailData.id) {
|
|
@@ -928,6 +981,9 @@ export default {
|
|
|
this.getWorkDicts("payment_term").then(res => {
|
|
|
this.paymentTermList = res.data.data;
|
|
|
});
|
|
|
+ this.getWorkDicts("currency").then(res => {
|
|
|
+ this.currencyList = res.data.data;
|
|
|
+ });
|
|
|
getGoods(1, 500).then(res => {
|
|
|
this.goodsoptions = res.data.data.records;
|
|
|
});
|
|
@@ -955,6 +1011,24 @@ export default {
|
|
|
},
|
|
|
getCorpData(row) {
|
|
|
this.form.coefficient = row.coefficient;
|
|
|
+ if (this.data.length > 0) {
|
|
|
+ this.data.forEach(e => {
|
|
|
+ e.productPrice = productCal(e.purchaseAmount, this.form.coefficient);
|
|
|
+ e.price = sellingCal(
|
|
|
+ e.productPrice,
|
|
|
+ e.partsPrice,
|
|
|
+ this.form.coefficient,
|
|
|
+ this.form.exchangeRate
|
|
|
+ );
|
|
|
+ e.amount = amountCal(
|
|
|
+ e.price,
|
|
|
+ e.orderQuantity,
|
|
|
+ e.freight,
|
|
|
+ e.insurance,
|
|
|
+ e.discount
|
|
|
+ );
|
|
|
+ });
|
|
|
+ }
|
|
|
},
|
|
|
cnameChange(row) {
|
|
|
this.goodsoptions.forEach(e => {
|
|
@@ -968,19 +1042,14 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- partReData(row) {
|
|
|
- this.partreData = row;
|
|
|
- this.partOpen();
|
|
|
- },
|
|
|
- partOpen() {
|
|
|
- this.partType = true;
|
|
|
- this.addLibrary();
|
|
|
- },
|
|
|
addLibrary() {
|
|
|
if (!this.form.corpId) {
|
|
|
return this.$message.error("请选择客户名称");
|
|
|
}
|
|
|
- this.$refs.library.init(this.partType, this.partreData != null);
|
|
|
+ if (!this.form.currency) {
|
|
|
+ return this.$message.error("请选择币别");
|
|
|
+ }
|
|
|
+ this.$refs.library.init(false);
|
|
|
},
|
|
|
partrePick(row, index) {
|
|
|
this.partList = row.partsList;
|
|
@@ -989,22 +1058,50 @@ export default {
|
|
|
importPart(rows, sum, index) {
|
|
|
this.data[index].partsList = rows;
|
|
|
this.data[index].partsPrice = sum;
|
|
|
+ // 销售价=(配件采购价格+产品价格)/汇率 *(1+客户FOB系数/100)
|
|
|
+ this.data[index].productPrice = productCal(
|
|
|
+ this.data[index].purchaseAmount,
|
|
|
+ this.form.coefficient
|
|
|
+ );
|
|
|
+ this.data[index].price = sellingCal(
|
|
|
+ this.data[index].productPrice,
|
|
|
+ this.data[index].partsPrice,
|
|
|
+ this.form.coefficient,
|
|
|
+ this.form.exchangeRate
|
|
|
+ );
|
|
|
+ this.data[index].amount = amountCal(
|
|
|
+ this.data[index].price,
|
|
|
+ this.data[index].orderQuantity,
|
|
|
+ this.data[index].freight,
|
|
|
+ this.data[index].insurance,
|
|
|
+ this.data[index].discount
|
|
|
+ );
|
|
|
const names = [];
|
|
|
const namePrices = [];
|
|
|
rows.map(e => {
|
|
|
names.push(e.goodName);
|
|
|
- namePrices.push(e.goodName + ":" + e.price);
|
|
|
+ namePrices.push(e.goodName + ":" + e.amout);
|
|
|
});
|
|
|
this.data[index].partsDescribe = names.join(",");
|
|
|
this.data[index].partsPriceDescribe = namePrices.join(";");
|
|
|
this.priceChange(this.data[index]);
|
|
|
},
|
|
|
+ importProperty(row, index) {
|
|
|
+ const arr = [];
|
|
|
+ for (let key in row) {
|
|
|
+ if (row[key]) {
|
|
|
+ arr.push(row[key]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.data[index].itemProp = arr.join(",");
|
|
|
+ this.data[index].remarksOne = row.remarksOne;
|
|
|
+ this.data[index].customTwo = row.customTwo;
|
|
|
+ this.data[index].customThree = row.customThree;
|
|
|
+ this.data[index].customFour = row.customFour;
|
|
|
+ this.data[index].customFive = row.customFive;
|
|
|
+ },
|
|
|
partClosed() {
|
|
|
this.partList = [];
|
|
|
- this.partreData = null;
|
|
|
- if (this.partType) {
|
|
|
- this.partType = false;
|
|
|
- }
|
|
|
},
|
|
|
saveSell() {
|
|
|
if (!this.form.id) {
|
|
@@ -1043,54 +1140,30 @@ export default {
|
|
|
this.itemtypeList = data.map(item => ({ value: item }));
|
|
|
});
|
|
|
},
|
|
|
+ purchaseAmountChange(row) {
|
|
|
+ row.productPrice = productCal(row.purchaseAmount, this.form.coefficient);
|
|
|
+ row.price = sellingCal(
|
|
|
+ row.productPrice,
|
|
|
+ row.partsPrice,
|
|
|
+ this.form.coefficient,
|
|
|
+ this.form.exchangeRate
|
|
|
+ );
|
|
|
+ row.amount = amountCal(
|
|
|
+ row.price,
|
|
|
+ row.orderQuantity,
|
|
|
+ row.freight,
|
|
|
+ row.insurance,
|
|
|
+ row.discount
|
|
|
+ );
|
|
|
+ },
|
|
|
priceChange(row) {
|
|
|
- const sum = _.multiply(
|
|
|
- _.add(
|
|
|
- _.add(
|
|
|
- Number(
|
|
|
- _.multiply(
|
|
|
- row.price ? row.price : 0,
|
|
|
- row.orderQuantity ? row.orderQuantity : 0
|
|
|
- )
|
|
|
- ),
|
|
|
- Number(
|
|
|
- _.add(
|
|
|
- Number(row.insurance ? row.insurance : 0),
|
|
|
- Number(row.freight ? row.freight : 0)
|
|
|
- )
|
|
|
- )
|
|
|
- ),
|
|
|
- Number(row.partsPrice ? row.partsPrice : 0)
|
|
|
- ),
|
|
|
- _.divide(row.discount ? row.discount : 10, 10)
|
|
|
+ row.amount = amountCal(
|
|
|
+ row.price,
|
|
|
+ row.orderQuantity,
|
|
|
+ row.freight,
|
|
|
+ row.insurance,
|
|
|
+ row.discount
|
|
|
);
|
|
|
- row.amount = Number(sum ? sum : 0).toFixed(2);
|
|
|
- // let amountSum = 0;
|
|
|
- // let purchaseAmountSum = 0;
|
|
|
- // let grossProfitRate = 0;
|
|
|
- // this.data.forEach(e => {
|
|
|
- // amountSum = _.add(amountSum, Number(e.amount));
|
|
|
- // purchaseAmountSum = _.add(
|
|
|
- // purchaseAmountSum,
|
|
|
- // Number(
|
|
|
- // _.multiply(
|
|
|
- // Number(e.purchaseAmount ? e.purchaseAmount : 0),
|
|
|
- // Number(e.orderQuantity)
|
|
|
- // )
|
|
|
- // )
|
|
|
- // );
|
|
|
- // this.form.grossProfit = _.subtract(amountSum, purchaseAmountSum);
|
|
|
- // grossProfitRate =
|
|
|
- // amountSum != 0
|
|
|
- // ? _.multiply(
|
|
|
- // _.divide(_.subtract(amountSum, purchaseAmountSum), amountSum),
|
|
|
- // 100
|
|
|
- // )
|
|
|
- // : 0;
|
|
|
- // this.form.grossProfitRate = Number(
|
|
|
- // grossProfitRate ? grossProfitRate : 0
|
|
|
- // ).toFixed(2);
|
|
|
- // });
|
|
|
},
|
|
|
quantityChange(row) {
|
|
|
if (Number(row.orderQuantity) < Number(row.actualQuantity)) {
|
|
@@ -1100,23 +1173,88 @@ export default {
|
|
|
if (!row.orderQuantity) {
|
|
|
row.orderQuantity = 0;
|
|
|
} else {
|
|
|
- row.amount = _.multiply(row.price, row.orderQuantity).toFixed(2);
|
|
|
+ row.amount = amountCal(
|
|
|
+ row.price,
|
|
|
+ row.orderQuantity,
|
|
|
+ row.freight,
|
|
|
+ row.insurance,
|
|
|
+ row.discount
|
|
|
+ );
|
|
|
}
|
|
|
},
|
|
|
+ currencyChange(row) {
|
|
|
+ if (row == "CNY") {
|
|
|
+ this.form.exchangeRate = 1;
|
|
|
+ } else if (row == "USD") {
|
|
|
+ this.form.exchangeRate = 6.3843;
|
|
|
+ } else {
|
|
|
+ this.form.exchangeRate = 1;
|
|
|
+ }
|
|
|
+ if (this.data.length > 0) {
|
|
|
+ this.data.forEach(e => {
|
|
|
+ e.freight = transformCal(
|
|
|
+ e.freight,
|
|
|
+ this.oldExchange,
|
|
|
+ this.form.exchangeRate
|
|
|
+ );
|
|
|
+ e.insurance = transformCal(
|
|
|
+ e.insurance,
|
|
|
+ this.oldExchange,
|
|
|
+ this.form.exchangeRate
|
|
|
+ );
|
|
|
+ e.price = sellingCal(
|
|
|
+ e.productPrice,
|
|
|
+ e.partsPrice,
|
|
|
+ this.form.coefficient,
|
|
|
+ this.form.exchangeRate
|
|
|
+ );
|
|
|
+ e.amount = amountCal(
|
|
|
+ e.price,
|
|
|
+ e.orderQuantity,
|
|
|
+ e.freight,
|
|
|
+ e.insurance,
|
|
|
+ e.discount
|
|
|
+ );
|
|
|
+ });
|
|
|
+ }
|
|
|
+ this.oldExchange = this.deepClone(this.form.exchangeRate);
|
|
|
+ },
|
|
|
+ exchangeRateChange(row) {
|
|
|
+ if (this.data.length > 0) {
|
|
|
+ this.data.forEach(e => {
|
|
|
+ e.freight = transformCal(e.freight, this.oldExchange, row);
|
|
|
+ e.insurance = transformCal(e.insurance, this.oldExchange, row);
|
|
|
+ e.price = sellingCal(
|
|
|
+ e.productPrice,
|
|
|
+ e.partsPrice,
|
|
|
+ this.form.coefficient,
|
|
|
+ row
|
|
|
+ );
|
|
|
+ e.amount = amountCal(
|
|
|
+ e.price,
|
|
|
+ e.orderQuantity,
|
|
|
+ e.freight,
|
|
|
+ e.insurance,
|
|
|
+ e.discount
|
|
|
+ );
|
|
|
+ });
|
|
|
+ }
|
|
|
+ this.oldExchange = this.deepClone(row);
|
|
|
+ },
|
|
|
+ discountChange(row) {
|
|
|
+ if (row.discount >= 10) {
|
|
|
+ row.discount = null;
|
|
|
+ this.$message.error("请正确输入折扣");
|
|
|
+ }
|
|
|
+ this.priceChange(row);
|
|
|
+ },
|
|
|
taxRateChange(row) {
|
|
|
if (Number(row.taxRate) >= 100) {
|
|
|
row.taxRate = 0;
|
|
|
this.$message.error("税率不能超过100%");
|
|
|
}
|
|
|
},
|
|
|
- grossProfitRateChange(row) {
|
|
|
- if (row >= 100) {
|
|
|
- this.form.grossProfitRate = 0;
|
|
|
- this.$message.error("毛利率不能超过100%");
|
|
|
- }
|
|
|
- },
|
|
|
rowSave(row) {
|
|
|
- console.log(row);
|
|
|
this.$set(row, "$cellEdit", false);
|
|
|
},
|
|
|
rowDel(row, index) {
|
|
@@ -1154,10 +1292,15 @@ export default {
|
|
|
item.code = e.code;
|
|
|
item.cname = e.cname;
|
|
|
item.priceCategory = e.goodsTypeName;
|
|
|
- item.partsList = this.reData.partsList;
|
|
|
- item.partsPrice = this.reData.partsPrice;
|
|
|
item.itemUrl = e.url;
|
|
|
item.itemProp = this.reData.itemProp;
|
|
|
+ item.remarksOne = this.reData.remarksOne;
|
|
|
+ item.customTwo = this.reData.customTwo;
|
|
|
+ item.customThree = this.reData.customThree;
|
|
|
+ item.customFour = this.reData.customFour;
|
|
|
+ item.customFive = this.reData.customFive;
|
|
|
+ item.partsList = this.reData.partsList;
|
|
|
+ item.partsPrice = this.reData.ppartsPrice;
|
|
|
item.itemDescription = e.cnameDescription;
|
|
|
item.itemType = this.reData.itemType;
|
|
|
item.tradeTerms = this.reData.tradeTerms;
|
|
@@ -1184,6 +1327,11 @@ export default {
|
|
|
priceCategory: e.goodsTypeName,
|
|
|
itemUrl: e.url,
|
|
|
itemProp: null,
|
|
|
+ remarksOne: null,
|
|
|
+ customTwo: null,
|
|
|
+ customThree: null,
|
|
|
+ customFour: null,
|
|
|
+ customFive: null,
|
|
|
itemDescription: e.cnameDescription,
|
|
|
partsList: [],
|
|
|
partsPrice: 0,
|
|
@@ -1239,76 +1387,50 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- importLibray(rows, status) {
|
|
|
- if (status) {
|
|
|
- if (this.partreData) {
|
|
|
- rows.forEach(e => {
|
|
|
- this.partList.forEach((item, index) => {
|
|
|
- if (index == this.partreData.index) {
|
|
|
- item.goodId = e.itemId;
|
|
|
- item.goodTypeId = e.goodTypeId;
|
|
|
- item.goodTypeName = e.goodsTypeName;
|
|
|
- item.goodName = e.cname;
|
|
|
- item.price = e.purchaseAmount;
|
|
|
- item.goodNumber = this.partreData.goodNumber;
|
|
|
- item.amout = _.multiply(
|
|
|
- Number(
|
|
|
- this.partreData.goodNumber ? this.partreData.goodNumber : 0
|
|
|
- ),
|
|
|
- Number(e.purchaseAmount ? e.purchaseAmount : 0)
|
|
|
- );
|
|
|
- item.$cellEdit = true;
|
|
|
- }
|
|
|
- });
|
|
|
- });
|
|
|
- } else {
|
|
|
- rows.forEach(e => {
|
|
|
- this.partList.push({
|
|
|
- goodId: e.itemId,
|
|
|
- goodTypeId: e.goodTypeId,
|
|
|
- goodTypeName: e.goodsTypeName,
|
|
|
- goodName: e.cname,
|
|
|
- price: e.purchaseAmount,
|
|
|
- goodNumber: 0,
|
|
|
- amout: 0,
|
|
|
- $cellEdit: true
|
|
|
- });
|
|
|
- });
|
|
|
- }
|
|
|
- } else {
|
|
|
- rows.forEach(e => {
|
|
|
- this.data.push({
|
|
|
- itemId: e.itemId,
|
|
|
- code: e.code,
|
|
|
- cname: e.cname,
|
|
|
- priceCategory: e.goodsTypeName,
|
|
|
- purchaseAmount: e.purchaseAmount,
|
|
|
- itemProp: e.goodNature,
|
|
|
- corpId: e.corpId,
|
|
|
- corpName: e.corpName,
|
|
|
- itemDescription: e.cnameDescription,
|
|
|
- partsList: [],
|
|
|
- partsPrice: 0,
|
|
|
- itemType: e.specs,
|
|
|
- tradeTerms: null,
|
|
|
- price: Number(
|
|
|
- _.multiply(
|
|
|
- Number(e.purchaseAmount),
|
|
|
- Number(_.add(1, _.divide(Number(this.form.coefficient), 100)))
|
|
|
- )
|
|
|
- ).toFixed(2),
|
|
|
- orderQuantity: 0,
|
|
|
- insurance: 0,
|
|
|
- freight: 0,
|
|
|
- discount: null,
|
|
|
- amount: 0,
|
|
|
- taxRate: 0,
|
|
|
- unit: e.unit,
|
|
|
- remarks: null,
|
|
|
- $cellEdit: true
|
|
|
- });
|
|
|
+ importLibray(rows) {
|
|
|
+ rows.forEach(e => {
|
|
|
+ this.data.push({
|
|
|
+ itemId: e.itemId,
|
|
|
+ code: e.code,
|
|
|
+ cname: e.cname,
|
|
|
+ priceCategory: e.goodsTypeName,
|
|
|
+ purchaseAmount: e.purchaseAmount,
|
|
|
+ itemProp: null,
|
|
|
+ remarksOne: null,
|
|
|
+ customTwo: null,
|
|
|
+ customThree: null,
|
|
|
+ customFour: null,
|
|
|
+ customFive: null,
|
|
|
+ corpId: e.corpId,
|
|
|
+ corpName: e.corpName,
|
|
|
+ itemDescription: e.cnameDescription,
|
|
|
+ partsList: [],
|
|
|
+ partsPrice: 0,
|
|
|
+ itemType: e.specs,
|
|
|
+ tradeTerms: null,
|
|
|
+ productPrice: productCal(e.purchaseAmount, this.form.coefficient),
|
|
|
+ price: sellingCal(
|
|
|
+ productCal(e.purchaseAmount, this.form.coefficient),
|
|
|
+ 0,
|
|
|
+ this.form.coefficient,
|
|
|
+ this.form.exchangeRate
|
|
|
+ ),
|
|
|
+ orderQuantity: 1,
|
|
|
+ insurance: 0,
|
|
|
+ freight: 0,
|
|
|
+ discount: null,
|
|
|
+ amount: sellingCal(
|
|
|
+ productCal(e.purchaseAmount, this.form.coefficient),
|
|
|
+ 0,
|
|
|
+ this.form.coefficient,
|
|
|
+ this.form.exchangeRate
|
|
|
+ ),
|
|
|
+ taxRate: 0,
|
|
|
+ unit: e.unit,
|
|
|
+ remarks: null,
|
|
|
+ $cellEdit: true
|
|
|
});
|
|
|
- }
|
|
|
+ });
|
|
|
},
|
|
|
//商品明细导入
|
|
|
newDetails() {
|
|
@@ -1422,6 +1544,9 @@ export default {
|
|
|
openReport() {
|
|
|
this.switchDialog = !this.switchDialog;
|
|
|
},
|
|
|
+ openProperty(row, index) {
|
|
|
+ this.$refs.property.init(row, index);
|
|
|
+ },
|
|
|
onClose(val) {
|
|
|
this.switchDialog = val;
|
|
|
},
|