From f6811caf6c66d4e2a55393f3b6dc169efd28d863 Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期四, 25 四月 2024 14:45:02 +0800
Subject: [PATCH] 修改工艺文件

---
 src/views/technology/document/teststandard.vue |  117 +++++++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 110 insertions(+), 7 deletions(-)

diff --git a/src/views/technology/document/teststandard.vue b/src/views/technology/document/teststandard.vue
index a523ebd..8b3d2bc 100644
--- a/src/views/technology/document/teststandard.vue
+++ b/src/views/technology/document/teststandard.vue
@@ -6,6 +6,7 @@
           :table="table"
           @handleSelectionChange="handleSelectionChange"
           @currentChange="handleCurrentChange"
+          @shoudonggouxuan="handleCurrentChange"
           :uploadInfo="uploadInfo"
           :prelang="prelang"
           :options="options"
@@ -18,14 +19,30 @@
         </ttable>
       </el-col>
       <el-col :span="12" style="padding-left: 10px">
+        <div style="float: right;margin-bottom: 8px;" v-if="editable && currentRow&&currentRow.id">
+        <el-button
+            style="padding: 3px 0"
+            type="text"
+            size="medium"
+            @click="saveAllParamChange"
+            >淇濆瓨
+        </el-button>
+        <!-- <el-button
+            style="padding: 3px 0"
+            type="text"
+            size="medium"
+            @click="openTempalteParamDialog"
+            >娣诲姞
+        </el-button> -->
+        </div>
         <el-table
           :data="testStandardParams"
           id="testStandardParamTable"
           ref="testStandardParam"
           :default-sort="{ prop: 'index' }"
           highlight-current-row
-          height="500"
-          style="width: 100%"
+          max-height="500"
+          style="width: 100%;overflow-x: auto;"
         >
           <el-table-column
             prop="index"
@@ -39,10 +56,54 @@
             label="瑕佹眰鍊�"
             prop="referenceValue"
             align="center"
-          />
-          <el-table-column label="鍗曚綅" prop="unit" align="center" />
-          <el-table-column label="娴嬭瘯鏂规硶" prop="method" align="center" />
-          <el-table-column label="娴嬭瘯鐩殑" prop="purpose" align="center" />
+            width="120px"
+          >
+          <template slot-scope="scope">
+                <el-input
+                v-model="scope.row.referenceValue"
+                placeholder="鍊�"
+                :disabled="!editable"
+                ></el-input>
+            </template>
+            </el-table-column>
+          <el-table-column label="鍗曚綅" prop="unit" align="center" width="120px">
+            <template slot-scope="scope">
+                <el-input
+                v-model="scope.row.unit"
+                placeholder="鍗曚綅"
+                :disabled="!editable"
+                ></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column label="娴嬭瘯鏂规硶" prop="method" align="center">
+            <template slot-scope="scope">
+                <el-input
+                v-model="scope.row.method"
+                placeholder=""
+                :disabled="!editable"
+                ></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column label="娴嬭瘯鐩殑" prop="purpose" align="center">
+            <template slot-scope="scope">
+                <el-input
+                v-model="scope.row.purpose"
+                placeholder=""
+                :disabled="!editable"
+                ></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column label="鎿嶄綔" align="center" fixed="right">
+        <template slot-scope="scope">
+            <el-button
+            type="text"
+            size="mini"
+            v-if="editable && currentRow&&currentRow.id"
+            @click.stop="handleParamDelete(scope.row, scope.$index)"
+            >鍒犻櫎
+            </el-button>
+        </template>
+        </el-table-column>
         </el-table>
       </el-col>
     </el-row>
@@ -60,7 +121,9 @@
   deleteTestStandard,
   getTestStand,
   saveTestStandard,
-  getTestStandardParams
+  getTestStandardParams,
+  deleteTestStandardParam,
+  saveTestStandardParam,
 } from '@/api/technology/document'
 import qualityStandardDialog from '@/views/common/teststandardradio.vue'
 
@@ -289,6 +352,46 @@
     handleSelectionChange(val) {
       // 澶氳閫変腑
       this.multipleSelection = val
+    },
+    saveAllParamChange(){
+        this.testStandardParams.forEach(e=>{
+        if(e.referenceValue!=null){
+        e.referenceValue=e.referenceValue.replace(',','锛�').replace('(','锛�').replace(')','锛�')
+          if (!isNaN(e.referenceValue)) {
+            e.referenceValue='='+e.referenceValue
+          }
+        }
+      })
+      saveTestStandardParam(this.testStandardParams).then((response) => {
+        const data = response.data
+        if (data.code == 0) {
+          this.$message.success('淇濆瓨鎴愬姛')
+          this.getTestStandardParamData(this.currentRow.id)
+        } else {
+          this.$message.error('淇濆瓨澶辫触')
+        }
+      })
+    },
+    openTempalteParamDialog(){},
+    handleParamDelete(row, index){
+        this.$confirm('鏄惁纭鍒犻櫎鍙傛暟椤逛负' + row.parameterItem, '鎻愮ず', {
+        confirmButtonText: '纭畾',
+        cancelButtonText: '鍙栨秷',
+        type: 'warning'
+      })
+        .then(function() {
+          return deleteTestStandardParam(row.id)
+        })
+        .then((response) => {
+          const data = response.data
+          if (data.code == 0) {
+            // 鍒犻櫎褰撳墠琛�
+            this.testStandardParams.splice(index, 1)
+            this.$message.success('鍒犻櫎鎴愬姛')
+          } else {
+            this.$message.error('鍒犻櫎澶辫触')
+          }
+        })
     }
   }
 }

--
Gitblit v1.9.3