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/rawMaterial/rawMaterial-form.vue                   |    3 -
 vue.config.js                                                        |    3 +
 src/views/technology/routing/routing-form.vue                        |   18 ++++----
 src/api/quality/finishedProduct.js                                   |    8 ++++
 src/views/quality/finishedProductInspection/finishedProduct-form.vue |   63 ++++++++++++++++++++++++-------
 src/views/quality/processInspect/processInspect-form.vue             |    5 +-
 6 files changed, 71 insertions(+), 29 deletions(-)

diff --git a/src/api/quality/finishedProduct.js b/src/api/quality/finishedProduct.js
index c875312..7b464d1 100644
--- a/src/api/quality/finishedProduct.js
+++ b/src/api/quality/finishedProduct.js
@@ -62,6 +62,14 @@
   })
 }
 
+export function updateFinishedInsProduct2(obj) {
+    return request({
+      url: '/mes/qualityFinishedInsProduct/updatefinishedInsProduct2',
+      method: 'post',
+      data: obj
+    })
+  }
+
 export function updateFinishedInspectById(obj) {
   return request({
     url: '/mes/qualityFinishedInspect/updateFinishedInspectById2',
diff --git a/src/views/quality/finishedProductInspection/finishedProduct-form.vue b/src/views/quality/finishedProductInspection/finishedProduct-form.vue
index 02135a1..ca7bb5f 100644
--- a/src/views/quality/finishedProductInspection/finishedProduct-form.vue
+++ b/src/views/quality/finishedProductInspection/finishedProduct-form.vue
@@ -104,6 +104,9 @@
                 <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"
+                                @click="saveTable()">淇濆瓨</el-button>
                             <el-button size="mini" @click="clickAddInspectionColumn()">娣诲姞妫�娴嬪�煎垪</el-button>
                             <el-button size="mini" @click="clickDeleteInspectionColumn()">鍒犻櫎妫�娴嬪�煎垪</el-button>
                         </el-col>
@@ -335,6 +338,7 @@
     queryById,
     updateDeviceById,
     updateFinishedInsProduct,
+    updateFinishedInsProduct2,
     updateFinishedInspectById,
     selectDeviceAPI,
     updateLocationIdById,
@@ -427,6 +431,34 @@
         this.init()
     },
     methods: {
+      saveTable(){
+        let finishedInsProducts = [];
+        if(this.inspectionItems.length>0){
+            this.inspectionItems.forEach(item=>{
+                if(item.children!=null&&item.children.length>0){
+                    item.children.forEach(item2=>{
+                        let obj = {};
+                        obj.id = item2.iid;
+                        obj.note = item2.inote;
+                        obj.required = item2.required;
+                        obj.inspectionValue = item2.empiricalValueAddss.join(',');
+                        obj.deviceId = item2.eId;
+                        finishedInsProducts.push(obj);
+                    })
+                }
+            })
+        }
+        if(finishedInsProducts.length>0){
+            updateFinishedInsProduct2(finishedInsProducts).then(res=>{
+                if(res.data.code == 0){
+                    this.$message.success("鏇存柊鎴愬姛")
+                }else{
+                    this.$message.error("鏇存柊澶辫触")
+                }
+                this.init()
+            })
+        }
+      },
       delProcessConfigFile(row) {
           this.$confirm('鏄惁鍒犻櫎璇ラ檮浠�', '鎻愮ず', {
             confirmButtonText: '纭畾',
@@ -677,20 +709,20 @@
                 if (str === undefined || str === '' || str === null ) {
                     return
                 }
-                let obj = {
-                    deviceId: row.eId,
-                    fpid: row.iid,
-                    inspectionValue: str,
-                    note : row.inote
-                }
-                updateFinishedInsProduct(obj).then(res=>{
-                    if(res.data.code == 0){
-                        this.$message.success("鏇存柊鎴愬姛")
-                    }else{
-                        this.$message.error("鏇存柊澶辫触")
-                    }
-                    this.init()
-                })
+                // let obj = {
+                //     deviceId: row.eId,
+                //     fpid: row.iid,
+                //     inspectionValue: str,
+                //     note : row.inote
+                // }
+                // updateFinishedInsProduct(obj).then(res=>{
+                //     if(res.data.code == 0){
+                //         this.$message.success("鏇存柊鎴愬姛")
+                //     }else{
+                //         this.$message.error("鏇存柊澶辫触")
+                //     }
+                //     this.init()
+                // })
             }
         },
         addTestProject() {
@@ -784,7 +816,8 @@
             } else {
                 if (this.empiricalValueAddMaxNumber != this.empiricalValueAdd - 1) {
                     this.empiricalValueAdd = this.empiricalValueAdd - 1;
-                    this.changeRowResult()
+                    // this.changeRowResult()
+                    this.saveTable()
                     this.inspectionItems.forEach(i => {
                         i.empiricalValueAddss.splice(this.empiricalValueAdd, 1);
                     });
diff --git a/src/views/quality/processInspect/processInspect-form.vue b/src/views/quality/processInspect/processInspect-form.vue
index 012c095..59e0cf4 100644
--- a/src/views/quality/processInspect/processInspect-form.vue
+++ b/src/views/quality/processInspect/processInspect-form.vue
@@ -455,7 +455,7 @@
                     item.children.forEach((child)=>{
                         let obj = {}
                         obj.id = child.iid;
-                        obj.eId = child.ieId;
+                        obj.eId = child.eId;
                         obj.note = child.inote;
                         obj.inspectionValue = child.empiricalValueAddss.join(',');
                         obj.required = child.required;
@@ -857,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=>{
diff --git a/src/views/quality/rawMaterial/rawMaterial-form.vue b/src/views/quality/rawMaterial/rawMaterial-form.vue
index d7354ef..1901015 100644
--- a/src/views/quality/rawMaterial/rawMaterial-form.vue
+++ b/src/views/quality/rawMaterial/rawMaterial-form.vue
@@ -940,7 +940,6 @@
             this.list.forEach(item=>{
                 if(item.children){
                     item.children.forEach(ele=>{
-                        console.log(ele);
                         let obj = JSON.parse(JSON.stringify(ele))
                         obj.testValue = obj.testValueList.join(",")
                         obj.id = obj.rpId
@@ -949,7 +948,7 @@
                     })
                 }
             })
-            if(this.rawInsProducts.length>0){
+            if(rawInsProducts.length>0){
                 updateRawInsProduct2(rawInsProducts).then(res => {
                     if (res.data.code == 0) {
                         this.$message.success("鏇存柊鎴愬姛")
diff --git a/src/views/technology/routing/routing-form.vue b/src/views/technology/routing/routing-form.vue
index b725d9d..cf29055 100644
--- a/src/views/technology/routing/routing-form.vue
+++ b/src/views/technology/routing/routing-form.vue
@@ -1200,15 +1200,15 @@
                 ...this.dataForm.operations.slice(obj.index - 1)
                 ]
             }
-            this.dataForm.operations.forEach((e, idx) => {
-                e.index = idx + 1
-                })
-                this.$forceUpdate()
-                this.$refs.operationTable.sort('index')
-                Promise.all([this.save()]).then((res) => {
-                    this.selectByIndex(obj.index)
-                })
-            })
+        })
+        this.dataForm.operations.forEach((e, idx) => {
+            e.index = idx + 1
+        })
+        this.$forceUpdate()
+        this.$refs.operationTable.sort('index')
+        Promise.all([this.save()]).then((res) => {
+            this.selectByIndex(obj.index)
+        })
       }else{
         operation.operationName = operation.name
         operation.operationId = operation.id
diff --git a/vue.config.js b/vue.config.js
index e94f4c8..0012965 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -7,7 +7,8 @@
 
 // const url = 'https://ztms-mes.chinaztt.cn/'
 // const url = 'http://localhost:9999'
-const url = 'http://192.168.32.45:9999'
+// const url = 'http://192.168.32.45:9999'
+const url = 'http://10.20.102.90:9999'
 
 
 const localUrl = 'http://localhost:8089'

--
Gitblit v1.9.3