ysy пре 2 година
родитељ
комит
40bfe2737f

+ 13 - 16
src/views/materialPlan/components/ProductModal2.vue

@@ -134,10 +134,7 @@ export default {
       processData: [],
       current: null,
 
-      form: {
-        produceRoutingId: null,
-        taskName: null,
-      },
+
 
       produceList: []
 
@@ -238,18 +235,18 @@ export default {
       }
 
 
-      if (this.type == 'add') {
-        _arr = this.selection.map(m => {
-          m.produceRoutingList = this.produceList
-          m.categoryId = m.id + '-' + new Date().getTime()
-          m.produceSelect = true
-          m.taskId = ''
-          delete m.id
-          return {
-            ...m
-          }
-        })
-      }
+
+      _arr = this.selection.map(m => {
+        m.produceRoutingList = this.produceList
+        m.categoryId = m.id + '-' + new Date().getTime()
+        m.produceSelect = true
+        m.taskId = ''
+        this.type == 'add' ? delete m.id : ''
+        return {
+          ...m
+        }
+      })
+
 
 
 

+ 19 - 6
src/views/materialPlan/components/produce-edit-dialog.vue

@@ -109,7 +109,11 @@
                   /^(-)*(\d+)\.(\d\d\d\d\d\d).*$/,
                   '$1$2.$3'
                 ))
-                  "></el-input>
+                  ">
+                    <template slot="append">{{ row.unit }}</template>
+                </el-input>
+                 
+                 
               </template>
 
               <template v-slot:action="{ row }">
@@ -335,7 +339,8 @@ export default {
 
         {
           label: '计量单位',
-          prop: 'unit'
+          prop: 'unit',
+        
         },
 
         {
@@ -345,15 +350,16 @@ export default {
         },
 
         {
-          label: '采购数量',
+          label: '领料数量',
           slot: 'purchaseQuantity',
-          action: 'purchaseQuantity'
+          action: 'purchaseQuantity',
+          width: 160,
         },
 
         {
           columnKey: 'action',
           label: '操作',
-          width: 70,
+          width: 90,
           align: 'center',
           resizable: false,
           slot: 'action',
@@ -386,14 +392,21 @@ export default {
   methods: {
     async open(type, row) {
       this.type = type;
+      this.visible = true;
+     
       if (row) {
         this.getDetail(row.id)
+      } else {
+        this.$nextTick(() => {
+          this.$refs.table.setData([]);
+        })
       }
-      this.visible = true;
+   
     },
 
 
     getDetail(id) {
+
       getById(id).then(res => {
         this.$set(this.formData, 'name', res.name)
         this.$set(this.formData, 'remark', res.remark)