|
@@ -543,7 +543,8 @@ import {
|
|
|
saveShipping,
|
|
|
getPorts,
|
|
|
getSpecification,
|
|
|
- saveSell
|
|
|
+ saveSell,
|
|
|
+ getPricedetail
|
|
|
} from "@/api/basicData/customerInquiry";
|
|
|
import { getCorpsattn } from "@/api/basicData/customerInformation";
|
|
|
import reportDialog from "@/components/report-dialog/main";
|
|
@@ -1032,6 +1033,8 @@ export default {
|
|
|
if (e.id == row.itemId) {
|
|
|
row.cname = e.cname;
|
|
|
row.code = e.code;
|
|
|
+ row.corpId = e.corpId;
|
|
|
+ row.corpName = e.corpName;
|
|
|
row.priceCategory = e.goodsTypeName;
|
|
|
row.itemUrl = e.url;
|
|
|
row.itemDescription = e.cnameDescription;
|
|
@@ -1067,6 +1070,55 @@ export default {
|
|
|
);
|
|
|
}
|
|
|
});
|
|
|
+ getPricedetail({ itemId: row.itemId, corpId: row.corpId }).then(res => {
|
|
|
+ if (res.data.data) {
|
|
|
+ this.goodsoptions.forEach(e => {
|
|
|
+ if (e.id == row.itemId) {
|
|
|
+ row.purchaseAmount = res.data.data.purchaseAmount;
|
|
|
+ row.productPrice = productCal(
|
|
|
+ res.data.data.purchaseAmount,
|
|
|
+ row.partsPrice,
|
|
|
+ this.form.coefficient
|
|
|
+ );
|
|
|
+ row.price = sellingCal(
|
|
|
+ productCal(
|
|
|
+ res.data.data.purchaseAmount,
|
|
|
+ row.partsPrice,
|
|
|
+ this.form.coefficient
|
|
|
+ ),
|
|
|
+ this.form.exchangeRate
|
|
|
+ );
|
|
|
+ row.amount = amountCal(
|
|
|
+ sellingCal(
|
|
|
+ productCal(
|
|
|
+ res.data.data.purchaseAmount,
|
|
|
+ row.partsPrice,
|
|
|
+ this.form.coefficient
|
|
|
+ ),
|
|
|
+ this.form.exchangeRate
|
|
|
+ ),
|
|
|
+ row.orderQuantity,
|
|
|
+ row.freight,
|
|
|
+ row.insurance,
|
|
|
+ row.discount
|
|
|
+ );
|
|
|
+ row.itemMargin = grossProfitCal(
|
|
|
+ res.data.data.purchaseAmount,
|
|
|
+ row.partsPrice,
|
|
|
+ sellingCal(
|
|
|
+ productCal(
|
|
|
+ res.data.data.purchaseAmount,
|
|
|
+ row.partsPrice,
|
|
|
+ this.form.coefficient
|
|
|
+ ),
|
|
|
+ this.form.exchangeRate
|
|
|
+ ),
|
|
|
+ this.form.exchangeRate
|
|
|
+ );
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
saveSell() {
|
|
|
if (!this.form.id) {
|
|
@@ -1340,6 +1392,8 @@ export default {
|
|
|
item.itemId = e.id;
|
|
|
item.code = e.code;
|
|
|
item.cname = e.cname;
|
|
|
+ item.corpId = e.corpId;
|
|
|
+ item.corpName = e.corpName;
|
|
|
item.priceCategory = e.goodsTypeName;
|
|
|
item.itemUrl = e.url;
|
|
|
item.itemProp = this.reData.itemProp;
|
|
@@ -1349,18 +1403,52 @@ export default {
|
|
|
item.customFour = this.reData.customFour;
|
|
|
item.customFive = this.reData.customFive;
|
|
|
item.partsList = this.reData.partsList;
|
|
|
- item.partsPrice = this.reData.ppartsPrice;
|
|
|
+ item.partsPrice = this.reData.partsPrice;
|
|
|
item.itemDescription = e.cnameDescription;
|
|
|
item.itemType = this.reData.itemType;
|
|
|
item.tradeTerms = this.reData.tradeTerms;
|
|
|
- item.price = this.reData.price;
|
|
|
+ item.purchaseAmount = 0;
|
|
|
+ item.productPrice = productCal(
|
|
|
+ 0,
|
|
|
+ this.reData.partsPrice,
|
|
|
+ this.form.coefficient
|
|
|
+ );
|
|
|
+ item.price = sellingCal(
|
|
|
+ productCal(0, this.reData.partsPrice, this.form.coefficient),
|
|
|
+ this.form.exchangeRate
|
|
|
+ );
|
|
|
item.orderQuantity = this.reData.orderQuantity;
|
|
|
item.insurance = this.reData.insurance;
|
|
|
item.freight = this.reData.freight;
|
|
|
item.discount = this.reData.discount;
|
|
|
- item.amount = this.reData.amount;
|
|
|
+ item.amount = amountCal(
|
|
|
+ sellingCal(
|
|
|
+ productCal(
|
|
|
+ 0,
|
|
|
+ this.reData.partsPrice,
|
|
|
+ this.form.coefficient
|
|
|
+ ),
|
|
|
+ this.form.exchangeRate
|
|
|
+ ),
|
|
|
+ this.reData.orderQuantity,
|
|
|
+ this.reData.freight,
|
|
|
+ this.reData.insurance,
|
|
|
+ this.reData.discount
|
|
|
+ );
|
|
|
item.taxRate = this.reData.taxRate;
|
|
|
- item.itemMargin = this.reData.taxRate;
|
|
|
+ item.itemMargin = grossProfitCal(
|
|
|
+ 0,
|
|
|
+ this.reData.partsPrice,
|
|
|
+ sellingCal(
|
|
|
+ productCal(
|
|
|
+ 0,
|
|
|
+ this.reData.partsPrice,
|
|
|
+ this.form.coefficient
|
|
|
+ ),
|
|
|
+ this.form.exchangeRate
|
|
|
+ ),
|
|
|
+ this.form.exchangeRate
|
|
|
+ );
|
|
|
item.unit = e.unit;
|
|
|
item.remarks = this.reData.remarks;
|
|
|
item.$cellEdit = true;
|
|
@@ -1374,6 +1462,8 @@ export default {
|
|
|
itemId: e.id,
|
|
|
code: e.code,
|
|
|
cname: e.cname,
|
|
|
+ corpId: e.corpId,
|
|
|
+ corpName: e.corpName,
|
|
|
priceCategory: e.goodsTypeName,
|
|
|
itemUrl: e.url,
|
|
|
itemProp: null,
|
|
@@ -1387,6 +1477,7 @@ export default {
|
|
|
partsPrice: 0,
|
|
|
itemType: null,
|
|
|
tradeTerms: null,
|
|
|
+ purchaseAmount: 0,
|
|
|
price: 0,
|
|
|
orderQuantity: 0,
|
|
|
insurance: 0,
|
|
@@ -1645,9 +1736,9 @@ export default {
|
|
|
}
|
|
|
return sums;
|
|
|
},
|
|
|
- openEdit(){
|
|
|
+ openEdit() {
|
|
|
this.detailData.status = 2;
|
|
|
- this.option=this.$options.data().option
|
|
|
+ this.option = this.$options.data().option;
|
|
|
},
|
|
|
async saveColumn() {
|
|
|
const inSave = await this.saveColumnData(
|