From 2b5ab47f9e5c105f475994bcc3bfd1fc146d23b4 Mon Sep 17 00:00:00 2001
From: value <z1292839451@163.com>
Date: 星期二, 14 五月 2024 02:25:56 +0800
Subject: [PATCH] 部分调整

---
 src/components/view/b2-standard.vue |   39 ++++++++++++++++++++++++++++++++++++---
 1 files changed, 36 insertions(+), 3 deletions(-)

diff --git a/src/components/view/b2-standard.vue b/src/components/view/b2-standard.vue
index 755a9c9..46dba57 100644
--- a/src/components/view/b2-standard.vue
+++ b/src/components/view/b2-standard.vue
@@ -216,6 +216,14 @@
             </template>
           </el-table-column>
           <el-table-column prop="manHourGroup" label="宸ユ椂鍒嗙粍" width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column prop="templateId" label="妯℃澘" width="200">
+            <template slot-scope="scope">
+              <el-select v-model="scope.row.templateId" size="small" filterable
+               @change="(value)=>upStandardProductListOfTemplate(value,scope.row.id)">
+                <el-option v-for="(a, ai) in templateList" :key="ai" :label="a.name" :value="a.id"></el-option>
+              </el-select>
+            </template>
+          </el-table-column>
           <el-table-column prop="section" label="鍖洪棿" width="120" show-overflow-tooltip></el-table-column>
           <el-table-column prop="section" label="鎿嶄綔" width="120">
             <template slot-scope="scope">
@@ -419,7 +427,8 @@
         sectionUpDia: false,
         sectionLoad: false,
         sectionRow: null,
-        sectionList: []
+        sectionList: [],
+        templateList: []
       }
     },
     mounted() {
@@ -436,6 +445,7 @@
       this.selectEnumByCategoryForSpecial()
       this.selectEnumByCategoryForInspectionValueType()
       this.selectEnumByCategoryForSonLaboratory()
+      this.getStandardTemplate()
     },
     methods: {
       filterNode(value, data) {
@@ -810,6 +820,22 @@
           // this.$message.success('宸蹭繚瀛�')
         })
       },
+      upStandardProductListOfTemplate(value, index) {
+        this.$axios.post(this.$api.standardTree.upStandardProductList, {
+          id: index,
+          templateId: value
+        }, {
+          headers: {
+            'Content-Type': 'application/json'
+          }
+        }).then(res => {
+          if (res.code == 201) {
+            this.$message.error('鏈繚瀛�')
+            return
+          }
+          // this.$message.success('宸蹭繚瀛�')
+        })
+      },
       delStandardMethodByFLSSM(id) {
         this.$confirm('鏄惁鍒犻櫎褰撳墠鏁版嵁?', "璀﹀憡", {
           confirmButtonText: "纭畾",
@@ -907,7 +933,7 @@
         return '';
       },
       upProductSelect(selection, row) {
-        row.state = row.state == 1 ? 0 : 1
+        row.state = (row.state == 1 ? 0 : 1)
         this.$axios.post(this.$api.standardTree.upStandardProductList, {
           id: row.id,
           state: row.state
@@ -930,11 +956,13 @@
       handleAll(e) {
         if (e.length > 0) {
           this.productList.map(m => {
+            m.state = 0
             this.upProductSelect(null, m)
             return m
           })
         } else {
           this.productList.map(m => {
+            m.state = 1
             this.upProductSelect(null, m)
             return m
           })
@@ -1005,7 +1033,12 @@
           this.$message.success('宸蹭繚瀛�')
           this.sectionUpDia = false
         })
-      }
+      },
+      getStandardTemplate() {
+        this.$axios.get(this.$api.StandardTemplate.getStandardTemplate).then(res => {
+          this.templateList = res.data
+        })
+      },
     }
   }
 </script>

--
Gitblit v1.9.3