From 7c86df822b4b8d06ee89388ea75ad5f47a89373e Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期四, 14 九月 2023 17:38:43 +0800
Subject: [PATCH] 	modified:   src/App.vue 	modified:   src/assets/api/controller.js 	modified:   src/components/view/rawInsDetail.vue 	modified:   src/components/view/standard-table/material.vue 	modified:   src/components/view/standard-table/product.vue 	modified:   src/components/view/standard-table/target.vue 	modified:   src/components/view/standard-table/technology.vue 	modified:   src/components/view/standard.vue 	modified:   src/components/view/rawInsDetail.vue

---
 src/components/view/standard.vue                  |   14 ++++++-
 src/components/view/standard-table/target.vue     |    9 ++--
 src/App.vue                                       |    4 +-
 src/components/view/rawInsDetail.vue              |    3 +
 src/components/view/standard-table/technology.vue |   55 +++++++++++++++++++++++----
 src/assets/api/controller.js                      |    1 
 src/components/view/standard-table/material.vue   |    6 +-
 src/components/view/standard-table/product.vue    |    8 ++--
 8 files changed, 75 insertions(+), 25 deletions(-)

diff --git a/src/App.vue b/src/App.vue
index a1fadbe..681e786 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -118,7 +118,7 @@
       font-size: 18px;
       font-weight: bold;
       position: absolute;
-      right: -225px;
+      right: -240px;
       top: 16px;
       z-index: 999;
   }
@@ -126,7 +126,7 @@
       font-size: 18px;
       font-weight: bold;
       position: absolute;
-      right: -425px;
+      right: -440px;
       top: 16px;
       z-index: 999;
   }
diff --git a/src/assets/api/controller.js b/src/assets/api/controller.js
index f4cdb13..3e2922d 100644
--- a/src/assets/api/controller.js
+++ b/src/assets/api/controller.js
@@ -7,6 +7,7 @@
 	selectTechnologyByMaterial: "technology/select",
 	selectAll:"/material/selectAll",//鍙充晶鏁版嵁
 	technologyWrite:"/technology/write",//宸ヨ壓璺嚎锛岀Щ寮�淇濆瓨鐢熶骇瀹氶
+	writeDevice:"/technology/writeDevice",//宸ヨ壓璺嚎锛岄�夋嫨璁惧缁�,绉诲紑淇濆瓨
 	productWrite:"/product/write",//鎶�鏈寚鏍囷紝绉诲紑淇濆瓨鍐呮帶鍊煎拰鏍囧噯鍊�
 	chooseFather: "/technology/chooseFather",//鑾峰彇宸ュ簭鍒楄〃
 	chooseDevice: "/technology/chooseDevice",//鑾峰彇璁惧缁勫垪琛�
diff --git a/src/components/view/rawInsDetail.vue b/src/components/view/rawInsDetail.vue
index 7dea5b5..dbb323e 100644
--- a/src/components/view/rawInsDetail.vue
+++ b/src/components/view/rawInsDetail.vue
@@ -350,6 +350,7 @@
 </template>
 
 <script>
+import { triggerRef } from "vue";
 import RawIns from "./raw-ins.vue";
 export default {
   components: { RawIns },
@@ -383,6 +384,7 @@
       } else {
         conclusion.testState = 1;
       }
+      console.log([conclusion]);
       return [conclusion];
     }
   },
@@ -505,6 +507,7 @@
         name: "",
         required: "",
         textValue: "",
+        testState:null,
         testValueList: [],
         unit: ""
       };
diff --git a/src/components/view/standard-table/material.vue b/src/components/view/standard-table/material.vue
index 2f53cc6..f3f9eae 100644
--- a/src/components/view/standard-table/material.vue
+++ b/src/components/view/standard-table/material.vue
@@ -9,7 +9,7 @@
               </el-table-column>
               <el-table-column type="index" width="60" label="搴忓彿">
               </el-table-column>
-              <el-table-column prop="father" label="宸ュ簭" :resizable="false">
+              <el-table-column prop="father" label="宸ュ簭" width="200" :resizable="false">
                 <template slot-scope="scope">
                   <el-tag class="tag" v-if="scope.row.father != null" type="primary">01</el-tag>
                   <span style="color: #000000">
@@ -17,7 +17,7 @@
                   </span>
               </template>
               </el-table-column>
-              <el-table-column prop="tname" sortable label="宸ヨ壓鍚嶇О" :resizable="false">
+              <el-table-column prop="tname" label="宸ヨ壓鍚嶇О" width="200" :resizable="false">
                 <template slot-scope="scope">
                   <el-tag type="success" v-if="scope.row.tname != null" class="tag">02</el-tag>
                   <span style="color: #000000">
@@ -25,7 +25,7 @@
                   </span>
                   </template>
               </el-table-column>
-              <el-table-column prop="mname" label="鏉愭枡鍚嶇О" :resizable="false">
+              <el-table-column prop="mname" label="鏉愭枡鍚嶇О" width="200" :resizable="false">
                 <template slot-scope="scope">
                   <el-tag type="info" class="tag" color="#faf2ff" v-if="scope.row.mname != null">
                     <span style="color: #e1affb">03</span>
diff --git a/src/components/view/standard-table/product.vue b/src/components/view/standard-table/product.vue
index 6460137..64427a4 100644
--- a/src/components/view/standard-table/product.vue
+++ b/src/components/view/standard-table/product.vue
@@ -44,19 +44,19 @@
         :tree-props="{children: 'children', hasChildren: 'hasChildren'}">
         <el-table-column type="selection" width="55"></el-table-column>
         <el-table-column type="index" width="60" label="搴忓彿"></el-table-column>
-        <el-table-column prop="father" label="宸ュ簭" :resizable="false">
+        <el-table-column prop="father" label="宸ュ簭" width="200" :resizable="false">
             <template slot-scope="scope">
                 <el-tag type="primary" class="tag" v-if="scope.row.father != null">01</el-tag>
                 <span>{{scope.row.father}}</span>
             </template>
         </el-table-column>
-        <el-table-column prop="name" label="宸ヨ壓鍚嶇О" :resizable="false">
+        <el-table-column prop="name" label="宸ヨ壓鍚嶇О" width="200" :resizable="false">
             <template slot-scope="scope">
                 <el-tag type="success" class="tag" v-if="scope.row.name != null">02</el-tag>
                 <span>{{scope.row.name}}</span>
             </template>  
         </el-table-column>
-        <el-table-column prop="device" label="璁惧鍚嶇О" :resizable="false">
+        <el-table-column prop="device" label="璁惧鍚嶇О" width="200" :resizable="false">
             <template slot-scope="scope">
                 <el-tag type="info" class="tag" color="#faf2ff" v-if="scope.row.device != null">
                     <span style="color: #e1affb">03</span>
@@ -64,7 +64,7 @@
                 <span>{{scope.row.device}}</span>
             </template>
         </el-table-column>
-        <el-table-column prop="productFather" label="椤圭洰" :resizable="false">
+        <el-table-column prop="productFather" label="椤圭洰" width="200" :resizable="false">
           <template slot-scope="scope">
                 <el-tag type="info" class="tag" v-if="scope.row.productFather != null">04</el-tag>
                 <span>{{scope.row.productFather}}</span>
diff --git a/src/components/view/standard-table/target.vue b/src/components/view/standard-table/target.vue
index abd919f..30d27b7 100644
--- a/src/components/view/standard-table/target.vue
+++ b/src/components/view/standard-table/target.vue
@@ -7,19 +7,19 @@
         :tree-props="{children: 'children', hasChildren: 'hasChildren'}">
         <el-table-column type="selection" width="55"></el-table-column>
         <el-table-column type="index" width="60" label="搴忓彿"></el-table-column>
-        <el-table-column prop="tfather" label="宸ュ簭" :resizable="false">
+        <el-table-column prop="tfather" label="宸ュ簭" width="200" :resizable="false">
             <template slot-scope="scope">
                 <el-tag class="tag" type="primary" v-if="scope.row.tfather != null">01</el-tag>
                 <span>{{scope.row.tfather}}</span>
             </template>
         </el-table-column>
-        <el-table-column prop="tname" label="宸ヨ壓鍚嶇О" :resizable="false">
+        <el-table-column prop="tname" label="宸ヨ壓鍚嶇О" width="200" :resizable="false">
             <template slot-scope="scope">
                 <el-tag type="success" v-if="scope.row.tname != null" class="tag">02</el-tag>
                 <span>{{scope.row.tname}}</span>
             </template>  
         </el-table-column>
-        <el-table-column prop="pfather" label="椤圭洰" :resizable="false">
+        <el-table-column prop="pfather" label="椤圭洰" width="200" :resizable="false">
             <template slot-scope="scope">
                 <el-tag type="info" color="#faf2ff" v-if="scope.row.pfather != null" class="tag">
                   <span style="color: #e1affb">03</span>
@@ -27,7 +27,7 @@
                 <span>{{scope.row.pfather}}</span>
             </template>  
         </el-table-column>
-        <el-table-column prop="pname" label="鎸囨爣鍚嶇О" :resizable="false">
+        <el-table-column prop="pname" label="鎸囨爣鍚嶇О" width="200" :resizable="false">
             <template slot-scope="scope">
                 <span>{{scope.row.pname}}</span>
             </template>
@@ -142,7 +142,6 @@
           }).then(res=>{
             this.$message.success(res.message);
           }).catch(error=>{
-            this.$message.error(error.message);
           })
         },
       }
diff --git a/src/components/view/standard-table/technology.vue b/src/components/view/standard-table/technology.vue
index 166d41a..d9cb1e6 100644
--- a/src/components/view/standard-table/technology.vue
+++ b/src/components/view/standard-table/technology.vue
@@ -10,7 +10,7 @@
             </el-table-column>
             <el-table-column type="index" width="60" label="搴忓彿" :resizable="false">
             </el-table-column>
-            <el-table-column prop="father" label="宸ュ簭" :resizable="false">
+            <el-table-column prop="father" label="宸ュ簭" width="200" :resizable="false">
               <template slot-scope="scope">
                     <el-tag class="tag" v-if="scope.row.children" type="primary">01</el-tag>
                     <span style="color: black">
@@ -18,17 +18,17 @@
                     </span>
             </template>
             </el-table-column>
-            <el-table-column sortable label="宸ヨ壓鍚嶇О" :resizable="false">
+            <el-table-column label="宸ヨ壓鍚嶇О" width="200" :resizable="false">
               <template slot-scope="scope">
                 <el-tag class="tag" type="success" v-if="!scope.row.children">02</el-tag>
                 <span style="color: black">{{ scope.row.name  }}</span>
               </template>
             </el-table-column>
-            <el-table-column prop="dg" label="璁惧缁�" :resizable="false">
+            <el-table-column prop="dg" label="璁惧缁�" width="200" :resizable="false">
               <template slot-scope="scope">
                 <div class="showDiv">
                   <span>{{scope.row.dg}}</span>
-                  <div @click="showDialog">閫夋嫨</div>
+                  <div @click="showDialog(scope.row)">閫夋嫨</div>
                 </div>
               </template>
             </el-table-column>
@@ -46,9 +46,18 @@
           title="閫夋嫨璁惧缁�"
           :visible.sync="deviceGroupDialog"
           width="30%">
-          <span>杩欐槸涓�娈典俊鎭�</span>
+          <el-form :model="formData">
+            <el-form-item prop="deviceGroup" label="璁惧缁勶細"
+            :rules="{required:true,message:'璁惧缁勪笉鑳戒负绌�',trigger:'change'}">
+                <el-select placeholder="璇烽�夋嫨璁惧缁�" size="small"
+                v-model="formData.deviceGroup">
+                <el-option :value="item.father" 
+                v-for="(item,index) in deviceList" :key="index" :label="item.father"></el-option>
+                </el-select>
+            </el-form-item>
+          </el-form>
           <span slot="footer" class="dialog-footer">
-            <el-button type="primary" @click="deviceGroupDialog = false">纭� 瀹�</el-button>
+            <el-button type="primary" @click="confirmUpdate()">纭� 瀹�</el-button>
             <el-button @click="deviceGroupDialog = false">鍙� 娑�</el-button>
           </span>
         </el-dialog>
@@ -60,7 +69,12 @@
     data() {
       return {
         deviceGroupDialog:false,
+        formData:{
+          deviceGroup:''
+        },
+        row:{},
         selects: [],
+        deviceList:[],
         isAllSelect:false,
       }
     },
@@ -69,6 +83,32 @@
     mounted() {
     },
     methods: {
+      //宸ヨ壓璺嚎--鑾峰彇璁惧缁勫垪琛�
+      getDeviceList(){
+        this.$axios.get(this.$api.url.chooseDevice).then(res=>{
+          this.deviceList = res.data;
+        }).catch(error=>{
+          this.$message.error(error.message);
+        })
+      },
+      showDialog(row){
+          this.getDeviceList();
+          this.formData.deviceGroup = row.dg;
+          this.row = row;
+          this.deviceGroupDialog = true
+      },
+      confirmUpdate(){
+        this.$axios.post(this.$api.url.writeDevice,{
+          id : this.row.id,
+          deviceGroup : this.formData.deviceGroup
+        }).then(res=>{
+          this.$emit("updateDevice",true);
+          this.$message.success(res.message);
+          this.deviceGroupDialog = false
+        }).catch(error=>{
+
+        })
+      },
       // 琛ㄦ牸鏍戝叏閮ㄩ�変腑閰嶇疆
       // 鍏ㄩ��/鍙栨秷閫夋搷浣�
       //閫夋嫨鏌愯
@@ -133,9 +173,6 @@
         }
       },
       // 琛ㄦ牸鏍戝叏閮ㄩ�変腑閰嶇疆  缁撴潫
-      showDialog(){
-          this.deviceGroupDialog = true
-      },
       updatePq(row){
         this.$axios.post(this.$api.url.technologyWrite,{
             id : row.id,
diff --git a/src/components/view/standard.vue b/src/components/view/standard.vue
index c75c027..b6a6201 100644
--- a/src/components/view/standard.vue
+++ b/src/components/view/standard.vue
@@ -56,7 +56,7 @@
         </div>
 
         <div class="contentTable" v-if="this.typeselect == 0">
-          <technology @childData="getChildData"  :tableType="tableType" :tableData="tableData"></technology>
+          <technology @childData="getChildData" @updateDevice="updateDevice"  :tableType="tableType" :tableData="tableData"></technology>
         </div>
         <div class="contentTable" v-if="this.typeselect == 1">
           <target @childData="getChildData" :tableType="tableType" :tableData="tableData"></target>
@@ -391,6 +391,7 @@
     return {
       //瀛愮粍浠朵紶鐨刬d鍒楄〃
       childIds:[],
+      isUpdateDevice:false,
       //宸ュ簭鍒楄〃
       fatherList:[],
       deviceList:[],
@@ -505,6 +506,9 @@
     this.selectVersion()
   },
   methods: {
+    updateDevice(val){
+      this.isUpdateDevice = val;
+    },
     changeLeftAdd(){
         if(this.leftAdd.type.length===2){
           this.leftAdd.father=null
@@ -730,6 +734,7 @@
       this.materialVisible = false;
       this.productVisible = false;
     },
+    //娓呯┖鏂板bom琛ㄥ崟
     clearBomAddModel(){
       if(this.typeselect == 0){
         this.deviceList=[];
@@ -740,6 +745,7 @@
         this.$refs["targetForm"].resetFields();
       }else if(this.typeselect == 2){
         this.mIdList = [];
+        this.materialForm.tableList = [];
         this.$refs["materialForm"].resetFields();
       }else{
         this.productDeviceList=[];
@@ -999,7 +1005,6 @@
         let arr = res.data;
         this.formatData(arr)
         this.tableData = arr;
-        console.log("arr--",arr);
       })
     },
     formatData(data){
@@ -1119,6 +1124,11 @@
     }
   },
   watch:{
+    isUpdateDevice(val){
+      if(val){
+        this.selectAll();
+      }
+    },
     search(val) {
         this.$refs.tree.filter(val);
     },

--
Gitblit v1.9.3