|
@@ -86,7 +86,9 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column label="小计" prop="sum">
|
|
|
<template slot-scope="scope">
|
|
|
- <span>{{ scope.row.unitPrice * scope.row.quantity }}</span>
|
|
|
+ <div>
|
|
|
+ {{ (scope.row.quantity * scope.row.unitPrice).toFixed(2) }}
|
|
|
+ </div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
|
|
@@ -199,10 +201,13 @@ export default {
|
|
|
handleCancel() {
|
|
|
this.$emit("cancel");
|
|
|
},
|
|
|
- handleChange() {
|
|
|
- this.form.goodsList.forEach((x) => {
|
|
|
- x.sum = (x.quantity * (Number(x.unitPrice) * 100)) / 100;
|
|
|
- });
|
|
|
+ handleChange() {},
|
|
|
+ deleteRow(index) {
|
|
|
+ if (this.form.goodsList.length === 1) {
|
|
|
+ return this.msgInfo("已经是最后一条数据啦!");
|
|
|
+ }
|
|
|
+ this.form.goodsList.splice(index, 1);
|
|
|
+ this.msgSuccess("删除成功");
|
|
|
},
|
|
|
handleChangeSupply(val) {
|
|
|
const productIdList = this.form.goodsList.map((x) => {
|
|
@@ -220,7 +225,6 @@ export default {
|
|
|
}
|
|
|
} else {
|
|
|
this.form.goodsList[i].unitPrice = "";
|
|
|
- return;
|
|
|
}
|
|
|
}
|
|
|
});
|