|
|
@@ -15,7 +15,7 @@
|
|
|
>生成销售单</el-button
|
|
|
>
|
|
|
<el-button type="success" disabled size="small">
|
|
|
- 复制新单
|
|
|
+ 复制单据
|
|
|
</el-button>
|
|
|
<el-button
|
|
|
type="primary"
|
|
|
@@ -24,7 +24,7 @@
|
|
|
:loading="subLoading"
|
|
|
v-if="detailData.status != 1"
|
|
|
size="small"
|
|
|
- >{{ form.id ? "确认修改" : "确认新增" }}
|
|
|
+ >保存数据
|
|
|
</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -57,6 +57,23 @@
|
|
|
:disabled="detailData.status == 1"
|
|
|
></crop-select>
|
|
|
</template>
|
|
|
+ <template slot="corpAttn">
|
|
|
+ <el-select
|
|
|
+ size="small"
|
|
|
+ v-model="form.corpAttn"
|
|
|
+ placeholder="请选择"
|
|
|
+ @change="corpAttnChange"
|
|
|
+ clearable
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in corpsattns"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.cname"
|
|
|
+ :value="item.cname"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </template>
|
|
|
<template slot="belongToCorpId">
|
|
|
<crop-select
|
|
|
v-model="form.belongToCorpId"
|
|
|
@@ -190,7 +207,7 @@
|
|
|
size="small"
|
|
|
@click.stop="newDetails"
|
|
|
:disabled="detailData.status == 1"
|
|
|
- >新增明细</el-button
|
|
|
+ >录入明细</el-button
|
|
|
>
|
|
|
<el-button
|
|
|
type="primary"
|
|
|
@@ -411,6 +428,9 @@
|
|
|
></el-input>
|
|
|
<span v-else>{{ row.taxRate | isPercentage }}</span>
|
|
|
</template>
|
|
|
+ <template slot="itemMargin" slot-scope="{ row }">
|
|
|
+ <span>{{ row.itemMargin | isPercentage }}</span>
|
|
|
+ </template>
|
|
|
</avue-crud>
|
|
|
</basic-container>
|
|
|
<fee-info
|
|
|
@@ -513,6 +533,7 @@ import {
|
|
|
getSpecification,
|
|
|
saveSell
|
|
|
} from "@/api/basicData/customerInquiry";
|
|
|
+import { getCorpsattn } from "@/api/basicData/customerInformation";
|
|
|
import reportDialog from "@/components/report-dialog/main";
|
|
|
import priceLibrary from "@/components/price-Library/main";
|
|
|
import { isDiscount, isPercentage, micrometerFormat } from "@/util/validate";
|
|
|
@@ -522,8 +543,10 @@ import {
|
|
|
productCal,
|
|
|
sellingCal,
|
|
|
amountCal,
|
|
|
- transformCal
|
|
|
+ transformCal,
|
|
|
+ grossProfitCal
|
|
|
} from "@/util/calculate";
|
|
|
+
|
|
|
import _ from "lodash";
|
|
|
export default {
|
|
|
name: "detailsPageEdit",
|
|
|
@@ -841,7 +864,8 @@ export default {
|
|
|
goodsoptions: [],
|
|
|
priceTermsList: [],
|
|
|
paymentTermList: [],
|
|
|
- currencyList: []
|
|
|
+ currencyList: [],
|
|
|
+ corpsattns: []
|
|
|
};
|
|
|
},
|
|
|
props: {
|
|
|
@@ -923,6 +947,8 @@ export default {
|
|
|
return "padding:0;height:40px;";
|
|
|
},
|
|
|
getCorpData(row) {
|
|
|
+ this.form.corpAttn = null;
|
|
|
+ this.form.corpTel = null;
|
|
|
this.form.coefficient = row.coefficient;
|
|
|
if (this.data.length > 0) {
|
|
|
this.data.forEach(e => {
|
|
|
@@ -939,9 +965,22 @@ export default {
|
|
|
e.insurance,
|
|
|
e.discount
|
|
|
);
|
|
|
+ e.itemMargin = grossProfitCal(
|
|
|
+ e.purchaseAmount,
|
|
|
+ e.partsPrice,
|
|
|
+ e.price,
|
|
|
+ this.form.exchangeRate
|
|
|
+ );
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
+ corpAttnChange() {
|
|
|
+ this.corpsattns.forEach(e => {
|
|
|
+ if (this.form.corpId == e.pid) {
|
|
|
+ this.form.corpTel = e.tel;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
rowCorpData(row) {
|
|
|
this.data[row.index].corpName = row.cname;
|
|
|
},
|
|
|
@@ -1028,6 +1067,12 @@ export default {
|
|
|
this.data[index].insurance,
|
|
|
this.data[index].discount
|
|
|
);
|
|
|
+ this.data[index].itemMargin = grossProfitCal(
|
|
|
+ this.data[index].purchaseAmount,
|
|
|
+ this.data[index].partsPrice,
|
|
|
+ this.data[index].price,
|
|
|
+ this.form.exchangeRate
|
|
|
+ );
|
|
|
const names = [];
|
|
|
const namePrices = [];
|
|
|
rows.map(e => {
|
|
|
@@ -1083,6 +1128,12 @@ export default {
|
|
|
row.insurance,
|
|
|
row.discount
|
|
|
);
|
|
|
+ row.itemMargin = grossProfitCal(
|
|
|
+ row.purchaseAmount,
|
|
|
+ row.partsPrice,
|
|
|
+ row.price,
|
|
|
+ this.form.exchangeRate
|
|
|
+ );
|
|
|
},
|
|
|
priceChange(row) {
|
|
|
row.amount = amountCal(
|
|
|
@@ -1092,6 +1143,12 @@ export default {
|
|
|
row.insurance,
|
|
|
row.discount
|
|
|
);
|
|
|
+ row.itemMargin = grossProfitCal(
|
|
|
+ row.purchaseAmount,
|
|
|
+ row.partsPrice,
|
|
|
+ row.price,
|
|
|
+ this.form.exchangeRate
|
|
|
+ );
|
|
|
},
|
|
|
currencyChange(row) {
|
|
|
this.currencyList.forEach(e => {
|
|
|
@@ -1119,6 +1176,12 @@ export default {
|
|
|
e.insurance,
|
|
|
e.discount
|
|
|
);
|
|
|
+ e.itemMargin = grossProfitCal(
|
|
|
+ e.purchaseAmount,
|
|
|
+ e.partsPrice,
|
|
|
+ e.price,
|
|
|
+ this.form.exchangeRate
|
|
|
+ );
|
|
|
});
|
|
|
}
|
|
|
this.oldExchange = this.deepClone(this.form.exchangeRate);
|
|
|
@@ -1136,6 +1199,12 @@ export default {
|
|
|
e.insurance,
|
|
|
e.discount
|
|
|
);
|
|
|
+ e.itemMargin = grossProfitCal(
|
|
|
+ e.purchaseAmount,
|
|
|
+ e.partsPrice,
|
|
|
+ e.price,
|
|
|
+ this.form.exchangeRate
|
|
|
+ );
|
|
|
});
|
|
|
}
|
|
|
this.oldExchange = this.deepClone(row);
|
|
|
@@ -1242,6 +1311,7 @@ export default {
|
|
|
item.discount = this.reData.discount;
|
|
|
item.amount = this.reData.amount;
|
|
|
item.taxRate = this.reData.taxRate;
|
|
|
+ item.itemMargin = this.reData.taxRate;
|
|
|
item.unit = e.unit;
|
|
|
item.remarks = this.reData.remarks;
|
|
|
item.$cellEdit = true;
|
|
|
@@ -1276,6 +1346,7 @@ export default {
|
|
|
amount: 0,
|
|
|
taxRate: 0,
|
|
|
unit: e.unit,
|
|
|
+ itemMargin: 0,
|
|
|
remarks: null,
|
|
|
$cellEdit: true
|
|
|
});
|
|
|
@@ -1355,6 +1426,15 @@ export default {
|
|
|
),
|
|
|
taxRate: 0,
|
|
|
unit: e.unit,
|
|
|
+ itemMargin: grossProfitCal(
|
|
|
+ e.purchaseAmount,
|
|
|
+ 0,
|
|
|
+ sellingCal(
|
|
|
+ productCal(e.purchaseAmount, 0, this.form.coefficient),
|
|
|
+ this.form.exchangeRate
|
|
|
+ ),
|
|
|
+ this.form.exchangeRate
|
|
|
+ ),
|
|
|
remarks: null,
|
|
|
$cellEdit: true
|
|
|
});
|
|
|
@@ -1552,6 +1632,16 @@ export default {
|
|
|
this.$refs.goodsCrud.$refs.dialogColumn.columnBox = false;
|
|
|
}
|
|
|
}
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ "form.corpId": function(id) {
|
|
|
+ if (id) {
|
|
|
+ this.corpsattns = [];
|
|
|
+ getCorpsattn({ pid: id }).then(res => {
|
|
|
+ this.corpsattns = res.data.data.records;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
};
|
|
|
</script>
|