|
@@ -30,7 +30,18 @@
|
|
|
>
|
|
|
</template>
|
|
|
<template slot="menu" slot-scope="{ row, index }">
|
|
|
- <el-button type="text" size="small" @click.stop="rowDel(row, index)"
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ size="small"
|
|
|
+ icon="el-icon-edit"
|
|
|
+ @click.stop="rowEdit(row, index)"
|
|
|
+ >修改</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ size="small"
|
|
|
+ @click.stop="rowDel(row, index)"
|
|
|
+ icon="el-icon-delete"
|
|
|
>删除</el-button
|
|
|
>
|
|
|
</template>
|
|
@@ -120,10 +131,12 @@ export default {
|
|
|
// });
|
|
|
},
|
|
|
priceChange(row) {
|
|
|
- row.amout = Number(_.multiply(
|
|
|
- Number(row.goodNumber ? row.goodNumber : 0),
|
|
|
- Number(row.price ? row.price : 0)
|
|
|
- )).toFixed(2);
|
|
|
+ row.amout = Number(
|
|
|
+ _.multiply(
|
|
|
+ Number(row.goodNumber ? row.goodNumber : 0),
|
|
|
+ Number(row.price ? row.price : 0)
|
|
|
+ )
|
|
|
+ ).toFixed(2);
|
|
|
},
|
|
|
rowDel(row, index) {
|
|
|
this.$message({
|
|
@@ -132,6 +145,13 @@ export default {
|
|
|
});
|
|
|
this.data.splice(index, 1);
|
|
|
},
|
|
|
+ rowEdit(row, index) {
|
|
|
+ if (row.$cellEdit == true) {
|
|
|
+ this.$set(row, "$cellEdit", false);
|
|
|
+ } else {
|
|
|
+ this.$set(row, "$cellEdit", true);
|
|
|
+ }
|
|
|
+ },
|
|
|
rowAdd() {
|
|
|
this.$emit("partOpen", true);
|
|
|
},
|
|
@@ -176,7 +196,7 @@ export default {
|
|
|
let amountSum = 0;
|
|
|
this.amoutSum = 0;
|
|
|
data.forEach(e => {
|
|
|
- qtySum =_.add(qtySum, Number(e.goodNumber));
|
|
|
+ qtySum = _.add(qtySum, Number(e.goodNumber));
|
|
|
amountSum = _.add(amountSum, Number(e.amout));
|
|
|
this.amoutSum = Number(amountSum).toFixed(2);
|
|
|
});
|