|
@@ -54,6 +54,7 @@
|
|
|
v-model="form.corpId"
|
|
|
:configuration="configuration"
|
|
|
:disabled="detailData.status == 1"
|
|
|
+ @getRow="rowCorpdata"
|
|
|
></select-component>
|
|
|
</template>
|
|
|
<template slot="boxNumber">
|
|
@@ -286,6 +287,14 @@
|
|
|
>新增明细</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"
|
|
@@ -434,6 +443,7 @@
|
|
|
@partClosed="partClosed"
|
|
|
@partReData="partReData"
|
|
|
/>
|
|
|
+ <price-library ref="library" @importLibray="importLibray" />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -459,6 +469,7 @@ import partDialog from "@/components/part-dialog/main";
|
|
|
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";
|
|
|
export default {
|
|
|
name: "detailsPageEdit",
|
|
|
data() {
|
|
@@ -821,7 +832,8 @@ export default {
|
|
|
feeInfo,
|
|
|
uploadFile,
|
|
|
customerDialog,
|
|
|
- partDialog
|
|
|
+ partDialog,
|
|
|
+ priceLibrary
|
|
|
},
|
|
|
async created() {
|
|
|
if (this.detailData.id) {
|
|
@@ -861,6 +873,9 @@ export default {
|
|
|
cellStyle() {
|
|
|
return "padding:0;height:40px;";
|
|
|
},
|
|
|
+ rowCorpdata(row) {
|
|
|
+ this.form.coefficient = row.coefficient;
|
|
|
+ },
|
|
|
cnameChange(row) {
|
|
|
this.goodsoptions.forEach(e => {
|
|
|
if (e.cname == row.cname) {
|
|
@@ -879,20 +894,37 @@ export default {
|
|
|
},
|
|
|
partOpen() {
|
|
|
this.partType = true;
|
|
|
- this.newDetails();
|
|
|
+ this.addLibrary();
|
|
|
+ },
|
|
|
+ addLibrary() {
|
|
|
+ if (!this.form.corpId) {
|
|
|
+ return this.$message.error("请选择客户名称");
|
|
|
+ }
|
|
|
+ this.$refs.library.init(this.partType, this.partreData != null);
|
|
|
},
|
|
|
partrePick(row, index) {
|
|
|
this.partList = row.partsList;
|
|
|
- this.$refs.part.init(row.partsList, index);
|
|
|
+ this.$refs.part.init(index);
|
|
|
},
|
|
|
importPart(rows, sum, index) {
|
|
|
this.data[index].partsList = rows;
|
|
|
this.data[index].partsPrice = sum;
|
|
|
+ const names = [];
|
|
|
+ const namePrices = [];
|
|
|
+ rows.map(e => {
|
|
|
+ names.push(e.goodName);
|
|
|
+ namePrices.push(e.goodName + ":" + e.price);
|
|
|
+ });
|
|
|
+ this.data[index].partsDescribe = names.join(",");
|
|
|
+ this.data[index].partsPriceDescribe = namePrices.join(";");
|
|
|
this.priceChange(this.data[index]);
|
|
|
},
|
|
|
partClosed() {
|
|
|
this.partList = [];
|
|
|
this.partreData = null;
|
|
|
+ if (this.partType) {
|
|
|
+ this.partType = false;
|
|
|
+ }
|
|
|
},
|
|
|
saveSell() {
|
|
|
if (!this.form.id) {
|
|
@@ -1034,41 +1066,7 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
importGoods() {
|
|
|
- if (this.partType) {
|
|
|
- if (this.partreData) {
|
|
|
- if (this.selectionList.length != 1) {
|
|
|
- return this.$message.error("重新选择的时候只能选择一条数据");
|
|
|
- } else {
|
|
|
- this.selectionList.forEach(e => {
|
|
|
- this.partList.forEach((item, index) => {
|
|
|
- if (index == this.partreData.index) {
|
|
|
- item.goodId = e.id;
|
|
|
- item.goodTypeId = e.goodsTypeId;
|
|
|
- item.goodTypeName = e.goodsTypeName;
|
|
|
- item.goodName = e.cname;
|
|
|
- item.price = this.partreData.goodNumber;
|
|
|
- item.goodNumber = this.partreData.goodNumber;
|
|
|
- item.amout = this.partreData.amout;
|
|
|
- item.$cellEdit = true;
|
|
|
- }
|
|
|
- });
|
|
|
- });
|
|
|
- }
|
|
|
- } else {
|
|
|
- this.selectionList.forEach(e => {
|
|
|
- this.partList.push({
|
|
|
- goodId: e.id,
|
|
|
- goodTypeId: e.goodsTypeId,
|
|
|
- goodTypeName: e.goodsTypeName,
|
|
|
- goodName: e.cname,
|
|
|
- price: e.price,
|
|
|
- goodNumber: 0,
|
|
|
- amout: 0,
|
|
|
- $cellEdit: true
|
|
|
- });
|
|
|
- });
|
|
|
- }
|
|
|
- } else if (this.reData) {
|
|
|
+ if (this.reData) {
|
|
|
if (this.selectionList.length != 1) {
|
|
|
return this.$message.error("重新选择的时候只能选择一条数据");
|
|
|
} else {
|
|
@@ -1133,9 +1131,6 @@ export default {
|
|
|
this.selectionList = [];
|
|
|
this.treeDeptId = "";
|
|
|
this.reData = null;
|
|
|
- if (this.partType) {
|
|
|
- this.partType = false;
|
|
|
- }
|
|
|
},
|
|
|
goodsSelectionChange(list) {
|
|
|
this.orderItemIds = [];
|
|
@@ -1169,8 +1164,82 @@ 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.id;
|
|
|
+ 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.id,
|
|
|
+ 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.id,
|
|
|
+ code: e.code,
|
|
|
+ cname: e.cname,
|
|
|
+ priceCategory: e.goodsTypeName,
|
|
|
+ purchaseAmount: e.purchaseAmount,
|
|
|
+ itemProp: e.goodNature,
|
|
|
+ corpId: e.corpId,
|
|
|
+ corpName: e.corpName,
|
|
|
+ itemDescription: null,
|
|
|
+ partsList: [],
|
|
|
+ partsPrice: 0,
|
|
|
+ itemType: null,
|
|
|
+ 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
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
//商品明细导入
|
|
|
newDetails() {
|
|
|
+ if (!this.form.corpId) {
|
|
|
+ return this.$message.error("请选择客户名称");
|
|
|
+ }
|
|
|
this.dialogVisible = !this.dialogVisible;
|
|
|
},
|
|
|
getDetail(id) {
|
|
@@ -1182,7 +1251,6 @@ export default {
|
|
|
this.data = res.data.data.orderItemsList;
|
|
|
this.orderFeesList = res.data.data.orderFeesList;
|
|
|
this.orderFilesList = res.data.data.orderFilesList;
|
|
|
- this.configuration.dicData = this.form.corpName;
|
|
|
this.oldform = res.data.data;
|
|
|
this.olddata = this.deepClone(res.data.data.orderItemsList);
|
|
|
this.oldorderFeesList = this.deepClone(res.data.data.orderFeesList);
|
|
@@ -1307,6 +1375,7 @@ export default {
|
|
|
e.contractAmount = e.amount;
|
|
|
e.srcId = e.id;
|
|
|
e.specificationAndModel = e.itemType;
|
|
|
+ e.productDesc=e.itemDescription
|
|
|
delete e.id;
|
|
|
delete e.version;
|
|
|
delete e.status;
|