From dacb1dd4fefa18fe0199000bc693d8f61a3bd70b Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期四, 14 九月 2023 17:39:40 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.22:9001/r/mom-before

---
 src/components/view/processInspectionLook.vue       |    2 
 src/components/view/standard.vue                    |   89 +++++++++++++++++++++++++++--
 src/components/view/processInspectionUpdate.vue     |   10 ++
 src/components/view/rawInsBox.vue                   |    1 
 src/components/view/finishedProductInspectionUp.vue |    7 ++
 src/components/view/technical.vue                   |    4 
 src/components/view/processInspection.vue           |    8 ++
 src/components/view/rawInsDetail.vue                |    2 
 8 files changed, 108 insertions(+), 15 deletions(-)

diff --git a/src/components/view/finishedProductInspectionUp.vue b/src/components/view/finishedProductInspectionUp.vue
index f40a66f..7c421b3 100644
--- a/src/components/view/finishedProductInspectionUp.vue
+++ b/src/components/view/finishedProductInspectionUp.vue
@@ -323,6 +323,13 @@
                 id: this.detailId
             }).then(res => {
                 if (res.code == 200) {
+                    if(res.message==='椤圭洰鏈楠屽畬!'){
+                        this.$message({
+                        message: res.message,
+                        type: 'warning'
+                    });
+                    return
+                    }
                     this.$message({
                         message: '涓婃姤鎴愬姛',
                         type: 'success'
diff --git a/src/components/view/processInspection.vue b/src/components/view/processInspection.vue
index d352b24..da22a3b 100644
--- a/src/components/view/processInspection.vue
+++ b/src/components/view/processInspection.vue
@@ -81,7 +81,7 @@
             <!-- 鐐瑰嚮杩斿洖锛屽綋鍓嶉〉闈㈠�间负false -->
             <el-button type="primary" size="mini" style="background: #004EA2; "
               icon="el-icon-circle-plus-outline">鏂板</el-button>
-            <el-button @click="showAddPage = false" type="primary" size="mini" icon="el-icon-back"
+            <el-button @click="combackIndex" type="primary" size="mini" icon="el-icon-back"
               style="background: #004EA2; ">杩斿洖</el-button>
           </el-col>
         </el-row>
@@ -171,7 +171,7 @@
             > -->
           </el-col>
         </el-row>
-        <el-table :data="inspectionItems" max-height="420" :span-method="handleSpanMethod" height="calc(100vh - 550px)"
+        <el-table border :data="inspectionItems" max-height="420" :span-method="handleSpanMethod" height="calc(100vh - 550px)"
           style="width: 100%">
           <el-table-column type="index" label="搴忓彿" width="60"></el-table-column>
           <el-table-column label="椤圭洰" prop="father"></el-table-column>
@@ -355,6 +355,10 @@
       this.rowInfp=row
       this.showLook=true
     },
+    combackIndex(){
+      this.showAddPage=false
+      this.defaultInitializationTable()
+    },
     updateInsInfo(row){
       this.rowInfp=row
       this.showUp=true
diff --git a/src/components/view/processInspectionLook.vue b/src/components/view/processInspectionLook.vue
index 3022239..7784910 100644
--- a/src/components/view/processInspectionLook.vue
+++ b/src/components/view/processInspectionLook.vue
@@ -103,7 +103,7 @@
             > -->
                 </el-col>
             </el-row>
-            <el-table :data="inspectionItems" max-height="420" :span-method="handleSpanMethod" height="calc(100vh - 550px)"
+            <el-table border :data="inspectionItems" max-height="420" :span-method="handleSpanMethod" height="calc(100vh - 550px)"
                 style="width: 100%">
                 <el-table-column type="index" label="搴忓彿" width="60"></el-table-column>
                 <el-table-column label="椤圭洰" prop="father"></el-table-column>
diff --git a/src/components/view/processInspectionUpdate.vue b/src/components/view/processInspectionUpdate.vue
index 9b5f8f9..eb9627c 100644
--- a/src/components/view/processInspectionUpdate.vue
+++ b/src/components/view/processInspectionUpdate.vue
@@ -103,7 +103,7 @@
             > -->
                 </el-col>
             </el-row>
-            <el-table :data="inspectionItems" max-height="420" :span-method="handleSpanMethod" height="calc(100vh - 550px)"
+            <el-table border :data="inspectionItems" max-height="420" :span-method="handleSpanMethod" height="calc(100vh - 550px)"
                 style="width: 100%">
                 <el-table-column type="index" label="搴忓彿" width="60"></el-table-column>
                 <el-table-column label="椤圭洰" prop="father"></el-table-column>
@@ -323,8 +323,14 @@
             this.$axios.post(this.$api.url.processInspectUpdateProcessInspectsById, {
                 id: this.detailId
             }).then(res => {
-                console.log(res);
                 if (res.code == 200) {
+                    if(res.message==='椤圭洰鏈楠屽畬!'){
+                        this.$message({
+                        message: res.message,
+                        type: 'warning'
+                    });
+                    return
+                    }
                     this.$message({
                         message: '涓婃姤鎴愬姛',
                         type: 'success'
diff --git a/src/components/view/rawInsBox.vue b/src/components/view/rawInsBox.vue
index 57710f5..b0648e2 100644
--- a/src/components/view/rawInsBox.vue
+++ b/src/components/view/rawInsBox.vue
@@ -30,6 +30,7 @@
             console.log(this.id)
         },
         goBack() {
+            this.$parent.removeAllTab()
             this.showDetail = false
         }
     }
diff --git a/src/components/view/rawInsDetail.vue b/src/components/view/rawInsDetail.vue
index cdcdfca..e9a9490 100644
--- a/src/components/view/rawInsDetail.vue
+++ b/src/components/view/rawInsDetail.vue
@@ -488,9 +488,9 @@
       const res = await this.$axios.post(
         this.$api.url.updateRawInspectsById + `${this.detailId}`
       ).then(res=>{
-聽 聽 聽 聽 this.$parent.removeAllTab()
         this.$message.success("鎻愪氦鎴愬姛");
         this.getDetailInfo();
+        this.goBack()
 聽 聽 聽 });
     },
     // 鑾峰彇璁惧鏍戝唴瀹�
diff --git a/src/components/view/standard.vue b/src/components/view/standard.vue
index b6a6201..abef430 100644
--- a/src/components/view/standard.vue
+++ b/src/components/view/standard.vue
@@ -13,15 +13,16 @@
     </div>
     <div class="thing">
       <div class="left">
-        <el-row :gutter="5">
+        <el-row :gutter="5" style="position: fixed;top: 148px;z-index: 1;">
           <el-col :span="21">
             <el-input v-model="search" suffix-icon="el-icon-search" placeholder="璇疯緭鍏ユ悳绱㈠唴瀹�" size="small" clearable></el-input>
           </el-col>
           <el-col :span="2">
-            <el-button size="small" icon="el-icon-plus" @click="bomLeftAdd=true"></el-button>
+            <el-button size="mini" icon="el-icon-plus" @click="bomLeftAdd=true"></el-button>
           </el-col>
         </el-row>
-        <el-tree :data="list" ref="tree" default-expand-all :props="{ children: 'children', label: 'name' }"
+        <el-row style="margin-top: 16px;">
+          <el-tree :data="list" ref="tree" default-expand-all :props="{ children: 'children', label: 'name' }"
           node-key="id" :filter-node-method="filterNode" @node-click="handleNodeClick" highlight-current>
           <div class="custom-tree-node" slot-scope="{ node, data }">
             <span><i :class="`node_i ${data.code != '[5]' ? 'el-icon-folder-opened' : 'el-icon-tickets'}`"></i>
@@ -31,6 +32,7 @@
             </el-button>
           </div>
         </el-tree>
+        </el-row>
       </div>
       <div class="right">
         <div class="choose">
@@ -530,7 +532,26 @@
         this.$refs[formName].validate((valid) => {
           if (valid) {
             let obj=JSON.parse(JSON.stringify(this.leftAdd))
-            console.log(obj);
+            if(obj.type.length===1){
+              obj.type=this.getType(obj.type[0])
+                  this.$axios.post(this.$api.url.leftAddOneTwo,obj,{
+                     headers: { "Content-Type": "application/json" }
+                 }).then(res=>{
+                     this.$message({
+                      message: res.message,
+                      type: 'success'
+                      });
+                      this.leftAdd.type=[]
+                      this.leftAdd.father=null
+                      this.leftAdd.standard=null
+                      this.leftAdd.name=null
+                      this.leftAdd.specifications=null
+                      this.selectMaterialTree()
+                      this.bomLeftAdd=false  
+                      this.selectVersion() 
+                  })
+                  return
+            }
             let one=this.list.filter(item=>{
                 return item.name===obj.type[0]
               })[0]
@@ -548,7 +569,14 @@
                       message: res.message,
                       type: 'success'
                       });
-                      this.selectMaterialTree()   
+                      this.leftAdd.type=[]
+                      this.leftAdd.father=null
+                      this.leftAdd.standard=null
+                      this.leftAdd.name=null
+                      this.leftAdd.specifications=null
+                      this.selectMaterialTree()
+                      this.bomLeftAdd=false 
+                      this.selectVersion() 
                   })
               }else{
                 let three=two.children.filter(item=>{
@@ -564,7 +592,14 @@
                       message: res.message,
                       type: 'success'
                       });
-                      this.selectMaterialTree()   
+                      this.leftAdd.type=[]
+                      this.leftAdd.father=null
+                      this.leftAdd.standard=null
+                      this.leftAdd.name=null
+                      this.leftAdd.specifications=null
+                      this.selectMaterialTree()
+                      this.bomLeftAdd=false  
+                      this.selectVersion()
                   })
                 }else{
                   //鏂板鏍囧噯鍨嬪彿
@@ -584,7 +619,14 @@
                       message: res.message,
                       type: 'success'
                       });
-                      this.selectMaterialTree()   
+                      this.leftAdd.type=[]
+                      this.leftAdd.father=null
+                      this.leftAdd.standard=null
+                      this.leftAdd.name=null
+                      this.leftAdd.specifications=null
+                      this.selectMaterialTree()
+                      this.bomLeftAdd=false 
+                      this.selectVersion()  
                    })
                   }else{
                      let specificationsDto={
@@ -598,7 +640,13 @@
                       message: res.message,
                       type: 'success'
                       });
+                      this.leftAdd.type=[]
+                      this.leftAdd.father=null
+                      this.leftAdd.standard=null
+                      this.leftAdd.name=null
+                      this.leftAdd.specifications=null
                       this.selectMaterialTree()
+                      this.bomLeftAdd=false  
                       this.selectVersion()
                    })
                   }
@@ -1039,6 +1087,29 @@
             arr[idx].name = '鍗婃垚鍝�'
           }
         })
+        if(res.data.length<1){
+          let obj={
+            name: '鎴愬搧',
+          }
+          let obj2={
+            name: '鍗婃垚鍝�',
+          }
+          this.list.push(obj)
+          this.list.push(obj2)
+        }
+        if(res.data.length===1){
+          if(res.data[0].name==='鎴愬搧'){
+            this.list.push({
+            name: '鍗婃垚鍝�',
+          })
+          }
+          if(res.data[0].name==='鍗婃垚鍝�'){
+            this.list.push({
+            name: '鎴愬搧',
+          })
+          }
+        }
+        console.log(this.list);
         this.selectDataList()
         // 榛樿绗竴涓簲绾ц妭鐐规悳绱紝鏂板閰嶇疆椤�
         const treeOptions = JSON.parse(JSON.stringify(this.list));
@@ -1136,12 +1207,16 @@
     handler(newVal, oldVal) {
     if(this.isLeftAdd){
       let tree=JSON.parse(JSON.stringify(this.list))
+      console.log(tree);
       let father=null;
       if(newVal.father!=null&&newVal.father!=''&&newVal.type.length>0){
           let one=tree.filter(item=>{
             return item.name===newVal.type[0]
           })[0]
           console.log(one);
+          if(one.children===undefined){
+            return
+          }
           let two=one.children.filter(item=>{
             return item.name===newVal.father
           })[0]
diff --git a/src/components/view/technical.vue b/src/components/view/technical.vue
index ff9bf51..aa90cdd 100644
--- a/src/components/view/technical.vue
+++ b/src/components/view/technical.vue
@@ -99,7 +99,7 @@
               <template slot-scope="scope">
                 <!-- <el-button type="text" size="small" @click="showDetails(scope.row)">鏌ョ湅璇︽儏</el-button>
                 <el-button type="text" size="small">缂栬緫闄勪欢</el-button> -->
-                <el-button type="text" size="small" @click="authorizedstrength(scope.row)">缂栧埗</el-button>
+                <el-button v-if="scope.row.type===0" type="text" size="small" @click="authorizedstrength(scope.row)">缂栧埗</el-button>
               </template>
             </el-table-column>
       </el-table>
@@ -262,8 +262,8 @@
               id:this.compiledata.id
         }).then( res =>{
         this.$message.success('缂栧埗瀹屾垚')
-      })
         this.getTechnicalTableData()
+      })
       },
 
       async showDetails(row){

--
Gitblit v1.9.3