ysy 2 лет назад
Родитель
Сommit
86439889aa

+ 23 - 2
src/views/material/product/components/index-data.vue

@@ -26,6 +26,11 @@
         </el-popconfirm>
 
 
+        <el-link v-if="row.isProduct == 1" type="primary" :underline="false" @click="openParam(row)">
+          工艺参数
+        </el-link>
+
+
         <el-link v-if="row.isProduct == 1" type="primary" :underline="false" @click="openMaterial(row)">
           物料BOM
         </el-link>
@@ -38,15 +43,20 @@
 
     <!-- 选择物料 -->
     <MaterialModal :visible.sync="materialEdit" :data="current" ref="materialRefs"></MaterialModal>
+
+    <!-- 工艺参数 -->
+    <ParamEdit  :visible.sync="paramEdit"   :paramData="current" ref="paramRefs"></ParamEdit>
   </div>
 </template>
 
 <script>
 import { getMaterialList, removeMaterial } from '@/api/material/manage.js';
 import MaterialModal from './MaterialModal.vue'
+import ParamEdit from '@/views/technology/productParam/components/user-edit.vue'
 export default {
   components: {
-    MaterialModal
+    MaterialModal,
+    ParamEdit
   },
   props: {
     // 物料组id
@@ -158,7 +168,9 @@ export default {
       id: null,
 
       materialEdit: false,
+      paramEdit: false,
       current: null,
+
     };
   },
 
@@ -212,7 +224,16 @@ export default {
       this.materialEdit = true;
       this.$refs.materialRefs.$refs.form &&
         this.$refs.materialRefs.$refs.form.clearValidate();
-    }
+    },
+
+
+    openParam(row) {
+      this.current = row;
+      this.paramEdit = true;
+      this.$refs.paramRefs.$refs.form &&
+        this.$refs.paramRefs.$refs.form.clearValidate();
+      
+    },
 
 
 

+ 1 - 0
src/views/material/product/index.vue

@@ -89,6 +89,7 @@
         </template>
       </ele-split-layout>
     </el-card>
+    
   </div>
 </template>
 <script>

+ 6 - 7
src/views/technology/productParam/components/process.vue

@@ -253,7 +253,7 @@ export default {
 
     chooseProcess(data) {
       this.$refs.table.setData([...data, ...this.$refs.table.getData()]);
-      this.$emit('chooseProcess',[...data, ...this.$refs.table.getData()])
+      this.$emit('chooseProcess', [...data, ...this.$refs.table.getData()])
 
     },
 
@@ -273,12 +273,12 @@ export default {
         if (e.id == current.id) {
           console.log(e)
           e.produceList = data
-        
+
         }
       })
 
       this.$refs.table.setData([...tableList]);
-      this.$emit('chooseProcess',tableList)
+      this.$emit('chooseProcess', tableList)
     },
 
 
@@ -298,12 +298,12 @@ export default {
       const data = this.$refs.table.getData() ?? [];
       data.forEach((e) => {
         if (row.parentId == e.id) {
-          e.produceList =  e.produceList.filter((d) => d.id !== row.id);
+          e.produceList = e.produceList.filter((d) => d.id !== row.id);
         }
       })
 
       this.$refs.table.setData([...data])
-      this.$emit('chooseProcess',data)
+      this.$emit('chooseProcess', data)
       this.$forceUpdate()
     }
 
@@ -313,9 +313,8 @@ export default {
     async taskParam(list) {
       if (list) {
         this.$refs.table.setData(list)
-            console.log()
 
-      } 
+      }
     }
   }
 };

+ 38 - 16
src/views/technology/productParam/components/user-edit.vue

@@ -8,7 +8,7 @@
 
         <el-col :span="8">
           <el-form-item label="产品名称:" prop="categoryName">
-            <el-input @click.native="chooseProduct" v-model="form.categoryName" readonly />
+            <el-input @click.native="chooseProduct" v-model="form.categoryName" :disabled="isProduct" readonly />
           </el-form-item>
         </el-col>
 
@@ -27,11 +27,7 @@
           </el-form-item>
         </el-col>
 
-        <el-col :span="8">
-          <el-form-item label="牌号:" prop="categoryBrandNum">
-            <el-input disabled v-model="form.categoryBrandNum" placeholder="自动带入" />
-          </el-form-item>
-        </el-col>
+
 
 
         <el-col :span="8">
@@ -40,10 +36,15 @@
           </el-form-item>
         </el-col>
 
+        <el-col :span="8">
+          <el-form-item label="牌号:" prop="categoryBrandNum">
+            <el-input disabled v-model="form.categoryBrandNum" placeholder="自动带入" />
+          </el-form-item>
+        </el-col>
 
         <el-col :span="8">
-          <el-form-item label="生产版本:" prop="produceVersionId" >
-            <el-select v-model="form.produceVersionId" filterable placeholder="清选择"  :style="{ width: '100%' }" >
+          <el-form-item label="生产版本:" prop="produceVersionId">
+            <el-select v-model="form.produceVersionId" filterable placeholder="清选择" :style="{ width: '100%' }">
               <el-option v-for="item in versionList" :key="item.id" :label="item.code + '-' + item.name" :value="item.id">
               </el-option>
             </el-select>
@@ -74,7 +75,7 @@
 
         <el-col :span="8">
           <el-form-item label="舟皿规格:" prop="palletSpecification	">
-            <el-input disabled placeholder="自动带入" v-model="form.palletSpecification	" />
+            <el-input disabled placeholder="自动带入" v-model="form.palletSpecification" />
           </el-form-item>
         </el-col>
 
@@ -190,7 +191,7 @@ import ProductModal from './ProductModal.vue';
 import Process from './process.vue'
 import ParamModal from './ParamModal.vue'
 
-import {  pageList } from '@/api/technology/version/version.js';
+import { pageList } from '@/api/technology/version/version.js';
 export default {
   components: {
     ProductModal,
@@ -201,11 +202,13 @@ export default {
     // 弹窗是否打开
     visible: Boolean,
     // 修改回显的数据
-    data: Object
+    data: Object,
+    paramData: Object
   },
   data() {
     const defaultForm = {
       id: null,
+      categoryId: '',
       categoryName: '',
       categoryCode: '',
       categoryModelType: '',
@@ -214,7 +217,8 @@ export default {
       produceVersionId: '',
       moldingAgent: '',
 
-  
+
+
 
       palletId: '',
       palletName: '',
@@ -322,6 +326,7 @@ export default {
           showOverflowTooltip: true
         }
       ],
+      isProduct: false
 
     };
   },
@@ -375,7 +380,7 @@ export default {
 
     /* 表格数据源 */
     datasource({ page, limit, where }) {
-     return []
+      return []
     },
 
     remove(row) {
@@ -434,7 +439,7 @@ export default {
         size: 100
       });
       this.paramList = res.list
-    
+
 
     },
 
@@ -457,18 +462,35 @@ export default {
         this.getParamList()
         this.getVersionList()
 
+        // 产品工艺参数
         if (this.data) {
           const res = await parameter.getById(this.data.id);
 
           this.$util.assignObject(this.form, {
             ...res
           });
-     
+
           this.$refs.table.setData(res.produceParam)
           this.taskParam = res.taskParam
           this.isUpdate = true;
-        } else {
+        } else if (this.paramData) {
+         this.isProduct = true
+          let param = {
+            categoryId: this.paramData.id,
+            categoryName:this.paramData.name,
+            categoryCode: this.paramData.code,
+            categoryModelType:this.paramData.modelType,
+            categoryBrandNum: this.paramData.brandNum,
+            categorySpecification: this.paramData.specification,
+           
+          }
+
+          this.$util.assignObject(this.form, {
+            ...param
+          });
+        }
 
+        else {
           this.isUpdate = false;
         }