ysy 2 سال پیش
والد
کامیت
2612442b16

+ 51 - 0
src/api/technology/productParam/index.js

@@ -0,0 +1,51 @@
+import request from '@/utils/request';
+
+export default {
+  //列表
+  list: async (params) => {
+    const res = await request.get('/main/produceparam/page', { params });
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+  },
+  //详情
+  getById: async (id) => {
+    const res = await request.get(`/main/produceparam/getById/${id}`);
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+  },
+  //详情
+  getCode: async () => {
+    const res = await request.get(
+      `/main/codemanage/getCode/process_parameters`
+    );
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+  },
+  //保存
+  save: async (data) => {
+    const res = await request.post('/main/categoryparam/save', data);
+
+    if (res.data.code == 0) {
+      return '保存' + res.data.message;
+    }
+  },
+  //保存
+  update: async (data) => {
+    const res = await request.put('/main/produceparam/update', data);
+    if (res.data.code == 0) {
+      console.log('修改');
+      return '修改' + res.data.message;
+    }
+  },
+  //删除
+  delete: async (data) => {
+    const res = await request.delete('/main/produceparam/delete', { data });
+    if (res.data.code == 0) {
+      return res.data.message;
+    }
+  }
+};
+

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

@@ -250,10 +250,11 @@ export default {
 
     chooseProcess(data) {
       this.$refs.table.setData([...data, ...this.$refs.table.getData()]);
+      this.$emit('chooseProcess',[...data, ...this.$refs.table.getData()])
+
     },
 
     chooseModal(data, current) {
-   
       data.map((m => {
         m.parentId = current.id
         return {
@@ -274,26 +275,24 @@ export default {
       })
 
       this.$refs.table.setData([...tableList]);
-
+      this.$emit('chooseProcess',tableList)
     },
 
 
     /* 删除 */
     remove(row) {
       const data = this.$refs.table.getData() ?? [];
-
       if (row.id) {
         this.removeList.push(row.id);
         this.$refs.table.setData(data.filter((d) => d.id !== row.id));
       }
+
+      this.$emit('chooseProcess', this.$refs.table.getData())
     },
 
 
     remove2(row) {
-      
       const data = this.$refs.table.getData() ?? [];
-    
-
       data.forEach((e) => {
         if (row.parentId == e.id) {
           e.produceList =  e.produceList.filter((d) => d.id !== row.id);
@@ -301,6 +300,7 @@ export default {
       })
 
       this.$refs.table.setData([...data])
+      this.$emit('chooseProcess',data)
       this.$forceUpdate()
     }
 

+ 7 - 3
src/views/technology/productParam/components/user-edit.vue

@@ -179,13 +179,13 @@
     <ParamModal ref="paramRefs" @chooseModal="chooseModal"></ParamModal>
 
     <!-- 选择工序 -->
-    <Process></Process>
+    <Process @chooseProcess="chooseProcess"></Process>
 
   </ele-modal>
 </template>
 
 <script>
-import parameter from '@/api/technology/parameter';
+import parameter from '@/api/technology/productParam';
 import ProductModal from './ProductModal.vue';
 import Process from './process.vue'
 import ParamModal from './ParamModal.vue'
@@ -216,7 +216,7 @@ export default {
 
       taskParam: [
       ],
-
+      produceParam: []
 
 
     };
@@ -427,6 +427,10 @@ export default {
       console.log(this.paramList)
 
     },
+
+    chooseProcess(data) {
+      this.$set(this.form, 'produceParam', data)
+    },
   },
 
   watch: {