|
|
@@ -31,7 +31,7 @@
|
|
|
|
|
|
|
|
|
<template v-slot:code="{ row }">
|
|
|
- <el-input placeholder="请输入" readonly :value="row.code || row.salesOrderCode" ></el-input>
|
|
|
+ <el-input placeholder="请输入" readonly :value="row.code || row.salesOrderCode"></el-input>
|
|
|
</template>
|
|
|
|
|
|
<template v-slot:remark="{ row }">
|
|
|
@@ -167,7 +167,7 @@ export default {
|
|
|
slot: 'code',
|
|
|
showOverflowTooltip: true,
|
|
|
align: 'center',
|
|
|
- minWidth: 150
|
|
|
+ minWidth: 170
|
|
|
},
|
|
|
{
|
|
|
prop: 'customerName',
|
|
|
@@ -333,7 +333,8 @@ export default {
|
|
|
},
|
|
|
formData: {
|
|
|
name: '',
|
|
|
-
|
|
|
+ detailRemoveIds: [],
|
|
|
+ materialRemoveIds: []
|
|
|
|
|
|
},
|
|
|
|
|
|
@@ -352,7 +353,8 @@ export default {
|
|
|
|
|
|
getDetail(id) {
|
|
|
getById(id).then(res => {
|
|
|
- this.formData.name = res.name
|
|
|
+ this.$set(this.formData, 'name', res.name)
|
|
|
+ this.formData['id'] = res.id
|
|
|
this.$refs.table.setData([...res.salesOrderList]);
|
|
|
|
|
|
})
|
|
|
@@ -396,6 +398,8 @@ export default {
|
|
|
cancel() {
|
|
|
this.visible = false;
|
|
|
this.formData = {};
|
|
|
+ this.formData.detailRemoveIds = []
|
|
|
+ this.formData.materialRemoveIds = []
|
|
|
this.$refs.table.setData([]);
|
|
|
this.$refs.formRef.resetFields();
|
|
|
},
|
|
|
@@ -410,6 +414,7 @@ export default {
|
|
|
|
|
|
showAdd() {
|
|
|
this.tableData = this.$refs.table.getData();
|
|
|
+
|
|
|
this.$refs.saleOrderRef.open(this.tableData)
|
|
|
},
|
|
|
|
|
|
@@ -434,6 +439,7 @@ export default {
|
|
|
},
|
|
|
|
|
|
remove(row, index) {
|
|
|
+ this.formData.detailRemoveIds.push(row.id)
|
|
|
let _arr = this.$refs.table.getData() || [];
|
|
|
_arr.splice(index, 1);
|
|
|
this.$refs.table.setData([..._arr]);
|
|
|
@@ -446,6 +452,7 @@ export default {
|
|
|
chooseModal(data, current) {
|
|
|
data.map((m => {
|
|
|
m.detailId = current.id
|
|
|
+
|
|
|
return {
|
|
|
...m,
|
|
|
}
|
|
|
@@ -475,6 +482,7 @@ export default {
|
|
|
|
|
|
remove2(row) {
|
|
|
const data = this.$refs.table.getData() ?? [];
|
|
|
+ this.formData.materialRemoveIds.push(row.id)
|
|
|
data.forEach((e) => {
|
|
|
if (row.detailId == e.id) {
|
|
|
e.materialList = e.materialList.filter((d) => d.id !== row.id);
|