ysy hace 1 año
padre
commit
2a4cd029ee

+ 9 - 2
src/views/productionPlan/components/EquipmentDialog.vue

@@ -72,12 +72,17 @@
     data() {
     data() {
       return {
       return {
         equipmentdialog: false,
         equipmentdialog: false,
+        selectIds: [],
         columns: [
         columns: [
           {
           {
             width: 45,
             width: 45,
             type: 'selection',
             type: 'selection',
             columnKey: 'selection',
             columnKey: 'selection',
+            selectable: (row, index) => {
+            return !this.selectIds.some((it) => it == row.id);
+          },
             align: 'center',
             align: 'center',
+
             reserveSelection: true
             reserveSelection: true
           },
           },
           {
           {
@@ -146,7 +151,9 @@
         this.tableList = data.list;
         this.tableList = data.list;
         return data;
         return data;
       },
       },
-      open() {
+      open(ids) {
+        this.selectIds = ids;
+        console.log( this.selectIds)
         this.equipmentdialog = true;
         this.equipmentdialog = true;
  
  
       },
       },
@@ -170,7 +177,7 @@
 
 
       // 选择
       // 选择
       selected() {
       selected() {
-       console.log(this.selection);
+        this.$emit('choose', this.selection);
         this.handleClose();
         this.handleClose();
       }
       }
     }
     }

+ 59 - 49
src/views/productionPlan/components/disassemblePlanPop.vue

@@ -56,14 +56,17 @@
           :selection.sync="selection"
           :selection.sync="selection"
           @update:selection="handleSelectionChange"
           @update:selection="handleSelectionChange"
           tool-class="ele-toolbar-actions"
           tool-class="ele-toolbar-actions"
-         max-height="360px"
-
+          max-height="360px"
         >
         >
           <template v-slot:toolbar>
           <template v-slot:toolbar>
             <div class="toolbar_box">
             <div class="toolbar_box">
               <div
               <div
                 ><span>基本数量</span>
                 ><span>基本数量</span>
-                <el-input placeholder="请输入" v-model.number="baseCount" disabled>
+                <el-input
+                  placeholder="请输入"
+                  v-model.number="baseCount"
+                  disabled
+                >
                 </el-input>
                 </el-input>
                 <DictSelection dictName="计量单位" v-model="unit" disabled
                 <DictSelection dictName="计量单位" v-model="unit" disabled
               /></div>
               /></div>
@@ -75,7 +78,6 @@
           </template>
           </template>
         </ele-pro-table>
         </ele-pro-table>
 
 
-
         <headerTitle title="计划列表" class="mt20"> </headerTitle>
         <headerTitle title="计划列表" class="mt20"> </headerTitle>
 
 
         <ele-pro-table
         <ele-pro-table
@@ -85,12 +87,13 @@
           :datasource="jhList"
           :datasource="jhList"
           tool-class="ele-toolbar-actions"
           tool-class="ele-toolbar-actions"
           max-height="360px"
           max-height="360px"
-
         >
         >
+        <template v-slot:requiredFormingNum="{ row }">
+            <el-input v-if="row.isManual" v-model.number="row.requiredFormingNum"></el-input>
+            <span v-else>{{ row.requiredFormingNum }}</span>
+          </template>
 
 
         </ele-pro-table>
         </ele-pro-table>
-
-
       </el-form>
       </el-form>
     </div>
     </div>
     <div slot="footer">
     <div slot="footer">
@@ -99,8 +102,6 @@
     </div>
     </div>
 
 
     <EquipmentDialog ref="equipmentRefs" @choose="choose"></EquipmentDialog>
     <EquipmentDialog ref="equipmentRefs" @choose="choose"></EquipmentDialog>
-
-
   </ele-modal>
   </ele-modal>
 </template>
 </template>
 
 
@@ -153,7 +154,6 @@
             label: '用量',
             label: '用量',
             showOverflowTooltip: true
             showOverflowTooltip: true
           },
           },
-          
 
 
           {
           {
             prop: 'unit',
             prop: 'unit',
@@ -161,7 +161,6 @@
             showOverflowTooltip: true
             showOverflowTooltip: true
           },
           },
 
 
-          
           {
           {
             prop: 'brandNo',
             prop: 'brandNo',
             label: '牌号',
             label: '牌号',
@@ -206,25 +205,23 @@
           }
           }
         ],
         ],
 
 
-
         statusOpt: {
         statusOpt: {
           '': '全部',
           '': '全部',
           0: '已停用',
           0: '已停用',
           1: '已发布'
           1: '已发布'
         },
         },
 
 
-        
         jsColumns: [
         jsColumns: [
-        {
+          {
             prop: 'productCode',
             prop: 'productCode',
-            label: '产品编码',
+            label: '编码',
             align: 'center',
             align: 'center',
 
 
             minWidth: 140
             minWidth: 140
           },
           },
           {
           {
             prop: 'productName',
             prop: 'productName',
-            label: '产品名称',
+            label: '名称',
             align: 'center',
             align: 'center',
             minWidth: 140
             minWidth: 140
           },
           },
@@ -250,7 +247,6 @@
             showOverflowTooltip: true
             showOverflowTooltip: true
           },
           },
 
 
-   
           {
           {
             prop: 'produceRoutingName',
             prop: 'produceRoutingName',
             label: '工艺路线',
             label: '工艺路线',
@@ -258,7 +254,6 @@
             minWidth: 120
             minWidth: 120
           },
           },
 
 
-
           {
           {
             prop: 'requiredFormingNum',
             prop: 'requiredFormingNum',
             label: '要求生产数量',
             label: '要求生产数量',
@@ -269,11 +264,8 @@
             prop: 'unit',
             prop: 'unit',
             label: '计量单位',
             label: '计量单位',
             showOverflowTooltip: true
             showOverflowTooltip: true
-          },
-
-
-
-        ],
+          }
+        ]
       };
       };
     },
     },
     methods: {
     methods: {
@@ -299,37 +291,57 @@
       },
       },
 
 
       handleSelectionChange() {
       handleSelectionChange() {
-
-        console.log(this.selection);
-        let  _arr = []
-        _arr = this.selection.map(m => {
-         let _num =  (this.formData.requiredFormingNum || 0 )/ (this.baseCount || 0) * m.dosage;
-            _num = _num.toFixed(3);
+        let _arr = [];
+        _arr = this.selection.map((m) => {
+          let _num =
+            ((this.formData.requiredFormingNum || 0) / (this.baseCount || 0)) *
+            m.dosage;
+          _num = _num.toFixed(3);
           return {
           return {
-             productCode: m.code,
-             productName: m.name,
-             brandNo: m.brandNo,
-             specification: m.specification,
-             model: m.model,
-             produceRoutingId: '',
-             produceRoutingName: '',
-             requiredFormingNum: _num,
-             unit: this.unit,
-
-     
-          }
-        })
+            id: m.id,
+            productCode: m.code,
+            productName: m.name,
+            brandNo: m.brandNo,
+            specification: m.specification,
+            model: m.model,
+            produceRoutingId: '',
+            produceRoutingName: '',
+            requiredFormingNum: _num,
+            unit: this.unit,
+            isManual: false
+          };
+        });
         this.jhList = _arr;
         this.jhList = _arr;
-    
       },
       },
 
 
       handleAdd() {
       handleAdd() {
-        this.$refs.equipmentRefs.open();
+        let ids = [];
+        ids = this.jhList.map((m) => m.id);
+
+        // 打开设备选择弹窗
+        this.$refs.equipmentRefs.open(ids);
       },
       },
 
 
       choose(list) {
       choose(list) {
-        
-        console.log(list);
+        let _list = [];
+
+        _list = list.map((m) => {
+          return {
+            id: m.id,
+            productCode: m.code,
+            productName: m.name,
+            brandNo: m.brandNo,
+            specification: m.specification,
+            model: m.model,
+            produceRoutingId: '',
+            produceRoutingName: '',
+            requiredFormingNum: '',
+            unit: this.unit,
+            isManual: true
+          };
+        });
+
+        this.jhList.push(..._list);
       },
       },
 
 
       cancel() {
       cancel() {
@@ -337,9 +349,7 @@
         this.visible = false;
         this.visible = false;
       },
       },
 
 
-      confirm() {
-        this.$refs.form.validate(async (value) => {});
-      }
+      confirm() {}
     }
     }
   };
   };
 </script>
 </script>

+ 2 - 2
src/views/productionPlan/index.vue

@@ -349,14 +349,14 @@
 
 
           {
           {
             prop: 'productCode',
             prop: 'productCode',
-            label: '产品编码',
+            label: '编码',
             align: 'center',
             align: 'center',
 
 
             minWidth: 140
             minWidth: 140
           },
           },
           {
           {
             prop: 'productName',
             prop: 'productName',
-            label: '产品名称',
+            label: '名称',
             align: 'center',
             align: 'center',
 
 
             minWidth: 140
             minWidth: 140