ysy 2 лет назад
Родитель
Сommit
0832f3e254

+ 3 - 2
src/views/materialPlan/components/ProductModal.vue

@@ -23,6 +23,8 @@
 
 
     </el-card>
     </el-card>
 
 
+
+
     <div class="btns">
     <div class="btns">
       <el-button type="primary" size="small" @click="selected">选择</el-button>
       <el-button type="primary" size="small" @click="selected">选择</el-button>
       <el-button size="small" @click="handleClose">关闭</el-button>
       <el-button size="small" @click="handleClose">关闭</el-button>
@@ -63,7 +65,7 @@ export default {
           width: 45,
           width: 45,
           align: 'center',
           align: 'center',
           selectable: (row, index) => {
           selectable: (row, index) => {
-            return !this.processData.some((it) => it.id == row.id);
+            return !this.processData.some((it) => it.id == row.id );
           },
           },
           reserveSelection: true,
           reserveSelection: true,
           fixed: 'left'
           fixed: 'left'
@@ -151,7 +153,6 @@ export default {
     },
     },
 
 
     open(item, row) {
     open(item, row) {
-
       this.processData = item || []
       this.processData = item || []
       this.current = row;
       this.current = row;
       this.visible = true
       this.visible = true

+ 12 - 4
src/views/materialPlan/components/plan-edit-dialog.vue

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

+ 12 - 4
src/views/materialPlan/components/produce-edit-dialog.vue

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

+ 1 - 1
src/views/materialPlan/components/saleOrderPop.vue

@@ -40,7 +40,7 @@ export default {
                     width: 45,
                     width: 45,
                     align: 'center',
                     align: 'center',
                     selectable: (row, index) => {
                     selectable: (row, index) => {
-                        return !this.tableData.some((it) => it.id == row.id);
+                        return !this.tableData.some((it) => it.id == row.id ||  it.salesOrderId == row.id);
                     },
                     },
                     reserveSelection: true,
                     reserveSelection: true,
                     fixed: 'left'
                     fixed: 'left'