|
@@ -544,10 +544,10 @@ export default {
|
|
|
value: "dictValue"
|
|
|
},
|
|
|
change: ({ value }) => {
|
|
|
- if (value == "人民币") {
|
|
|
+ if (value == "CNY") {
|
|
|
this.form.exchangeRate = 1;
|
|
|
}
|
|
|
- if (value == "美元") {
|
|
|
+ if (value == "USD") {
|
|
|
this.form.exchangeRate = 6.3843;
|
|
|
}
|
|
|
}
|
|
@@ -704,8 +704,7 @@ export default {
|
|
|
res.data.data;
|
|
|
});
|
|
|
this.getWorkDicts("unit").then(res => {
|
|
|
- this.findObject(this.tableOption.column, "unit").dicData =
|
|
|
- res.data.data;
|
|
|
+ this.findObject(this.tableOption.column, "unit").dicData = res.data.data;
|
|
|
});
|
|
|
getPorts().then(res => {
|
|
|
this.findObject(this.option.column, "portOfLoad").dicData = res.data;
|
|
@@ -737,6 +736,7 @@ export default {
|
|
|
saveSell(this.form.id).then(res => {
|
|
|
if (res.data.code == 200) {
|
|
|
this.$message.success("生成成功");
|
|
|
+ this.getDetail(this.detailData.id);
|
|
|
}
|
|
|
});
|
|
|
});
|
|
@@ -784,33 +784,37 @@ export default {
|
|
|
_.divide(row.discount ? row.discount : 10, 10)
|
|
|
);
|
|
|
row.amount = Number(sum ? sum : 0).toFixed(2);
|
|
|
- let amountSum = 0;
|
|
|
- let purchaseAmountSum = 0;
|
|
|
- let grossProfitRate = 0;
|
|
|
- let grossProfit = 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)
|
|
|
- )
|
|
|
- )
|
|
|
- );
|
|
|
- grossProfit = _.subtract(amountSum, purchaseAmountSum);
|
|
|
- grossProfitRate = _.multiply(
|
|
|
- _.divide(_.subtract(amountSum, purchaseAmountSum), amountSum),
|
|
|
- 100
|
|
|
- );
|
|
|
- this.form.grossProfit = Number(grossProfit ? grossProfit : 0).toFixed(
|
|
|
- 2
|
|
|
- );
|
|
|
- this.form.grossProfitRate = Number(
|
|
|
- grossProfitRate ? grossProfitRate : 0
|
|
|
- ).toFixed(2);
|
|
|
- });
|
|
|
+ // let amountSum = 0;
|
|
|
+ // let purchaseAmountSum = 0;
|
|
|
+ // let grossProfitRate = 0;
|
|
|
+ // let grossProfit = 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)
|
|
|
+ // )
|
|
|
+ // )
|
|
|
+ // );
|
|
|
+ // grossProfit = _.subtract(amountSum, purchaseAmountSum);
|
|
|
+ // grossProfitRate =
|
|
|
+ // amountSum != 0
|
|
|
+ // ? _.multiply(
|
|
|
+ // _.divide(_.subtract(amountSum, purchaseAmountSum), amountSum),
|
|
|
+ // 100
|
|
|
+ // )
|
|
|
+ // : 0;
|
|
|
+ // this.form.grossProfit = Number(grossProfit ? grossProfit : 0).toFixed(
|
|
|
+ // 2
|
|
|
+ // );
|
|
|
+
|
|
|
+ // this.form.grossProfitRate = Number(
|
|
|
+ // grossProfitRate ? grossProfitRate : 0
|
|
|
+ // ).toFixed(2);
|
|
|
+ // });
|
|
|
},
|
|
|
discountChange(row) {
|
|
|
if (row.discount >= 10) {
|
|
@@ -1151,7 +1155,8 @@ export default {
|
|
|
this.$refs.goodsCrud.$refs.dialogColumn.columnBox = false;
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
+ },
|
|
|
+
|
|
|
};
|
|
|
</script>
|
|
|
|