From 4660b68d3c3cd49c5dec355067cdf45b0abdd2e9 Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期五, 12 四月 2024 13:30:48 +0800
Subject: [PATCH] 修改工艺路线

---
 src/views/quality/processInspect/processInspect-form.vue |   82 ++++++++++++++++++++++++++++------------
 1 files changed, 57 insertions(+), 25 deletions(-)

diff --git a/src/views/quality/processInspect/processInspect-form.vue b/src/views/quality/processInspect/processInspect-form.vue
index 99272dd..59e0cf4 100644
--- a/src/views/quality/processInspect/processInspect-form.vue
+++ b/src/views/quality/processInspect/processInspect-form.vue
@@ -110,6 +110,10 @@
                     <el-tab-pane label="妫�楠岄」鐩�">
                         <el-row>
                             <el-col v-if="resultVal == null" :span="24" class="inspectionProject_span" style="text-align: right;">
+                                <el-button size="small"
+                                type="primary"
+                                v-if="inspectionItems&&inspectionItems.length>0"
+                                @click="saveTable()">淇濆瓨</el-button>
                                 <el-button size="mini" @click="clickAddInspectionColumn()">娣诲姞妫�娴嬪�煎垪</el-button>
                                 <el-button size="mini" @click="clickDeleteInspectionColumn()">鍒犻櫎妫�娴嬪�煎垪</el-button>
                             </el-col>
@@ -350,6 +354,7 @@
     queryById,
     updateDeviceBypppId,
     updateProcessInsProduct,
+    updateProcessInsProduct2,
     updateProcessInspectsById,
 } from '@/api/quality/processInspect'
 import {
@@ -443,6 +448,32 @@
         this.init()
     },
     methods: {
+        saveTable(){
+            let processInsProduct = [];
+            this.inspectionItems.forEach((item) => {
+                if(item.children&&item.children.length>0){
+                    item.children.forEach((child)=>{
+                        let obj = {}
+                        obj.id = child.iid;
+                        obj.eId = child.eId;
+                        obj.note = child.inote;
+                        obj.inspectionValue = child.empiricalValueAddss.join(',');
+                        obj.required = child.required;
+                        processInsProduct.push(obj)
+                    })
+                }
+            })
+            if(processInsProduct.length>0){
+                updateProcessInsProduct2(processInsProduct).then(res => {
+                    if (res.data.code == 0) {
+                        this.$message.success("鏇存柊鎴愬姛")
+                    } else {
+                        this.$message.error("鏇存柊澶辫触")
+                    }
+                    this.init()
+                })
+            }
+        },
         delProcessConfigFile(row) {
           this.$confirm('鏄惁鍒犻櫎璇ラ檮浠�', '鎻愮ず', {
             confirmButtonText: '纭畾',
@@ -711,30 +742,30 @@
                     return
                 }
             }
-            if (row.iid != null && row.iid != '') {
-                let str = ""
-                row.empiricalValueAddss.forEach(e => {
-                    str += e + ","
-                })
-                str = str.slice(0, -1);
-                if (str === undefined || str === '' || str === null) {
-                    return
-                }
-                let obj = {
-                    devideId: row.eId,
-                    ppid: row.iid,
-                    inspectionValue: str,
-                    note : row.inote
-                }
-                updateProcessInsProduct(obj).then(res => {
-                    if (res.data.code == 0) {
-                        this.$message.success("鏇存柊鎴愬姛")
-                    } else {
-                        this.$message.error("鏇存柊澶辫触")
-                    }
-                    this.init()
-                })
-            }
+            // if (row.iid != null && row.iid != '') {
+            //     let str = ""
+            //     row.empiricalValueAddss.forEach(e => {
+            //         str += e + ","
+            //     })
+            //     str = str.slice(0, -1);
+            //     if (str === undefined || str === '' || str === null) {
+            //         return
+            //     }
+            //     let obj = {
+            //         devideId: row.eId,
+            //         ppid: row.iid,
+            //         inspectionValue: str,
+            //         note : row.inote
+            //     }
+            //     updateProcessInsProduct(obj).then(res => {
+            //         if (res.data.code == 0) {
+            //             this.$message.success("鏇存柊鎴愬姛")
+            //         } else {
+            //             this.$message.error("鏇存柊澶辫触")
+            //         }
+            //         this.init()
+            //     })
+            // }
         },
         addTestProject() {
             let val = this.processInspectVo
@@ -826,7 +857,8 @@
             } else {
                 if (_than.empiricalValueAddMaxNumber != _than.empiricalValueAdd - 1) {
                     _than.empiricalValueAdd = _than.empiricalValueAdd - 1;
-                    _than.changeRowResult()
+                    // _than.changeRowResult()
+                    _than.saveTable();
                     _than.inspectionItems.forEach(i => {
                         if(i.children){
                             i.children.forEach(ele=>{

--
Gitblit v1.9.3