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

---
 vue.config.js                                   |    4 
 src/views/technology/document/document-form.vue |   20 +++---
 src/api/technology/document.js                  |   17 +++++
 src/assets/main.af3c5c19.png                    |    0 
 src/views/technology/document/teststandard.vue  |  117 ++++++++++++++++++++++++++++++++++++--
 src/assets/download.png                         |    0 
 src/views/common/ztt-table.vue                  |    1 
 7 files changed, 139 insertions(+), 20 deletions(-)

diff --git a/src/api/technology/document.js b/src/api/technology/document.js
index 4c1ac31..e3bd962 100644
--- a/src/api/technology/document.js
+++ b/src/api/technology/document.js
@@ -297,4 +297,19 @@
     method: 'get',
     params: query
   })
-}
\ No newline at end of file
+}
+
+export function deleteTestStandardParam(id) {
+    return request({
+      url: `/mes/document/deleteTestStandardParam/${id}`,
+      method: 'post',
+    })
+  }
+
+  export function saveTestStandardParam(obj) {
+    return request({
+      url: '/mes/document/saveTestStandardParam',
+      method: 'post',
+      data: obj
+    })
+  }
diff --git a/src/assets/download.png b/src/assets/download.png
index b8ecb9c..e37bb2b 100644
--- a/src/assets/download.png
+++ b/src/assets/download.png
Binary files differ
diff --git a/src/assets/main.af3c5c19.png b/src/assets/main.af3c5c19.png
index 11ef0c5..3b8e260 100644
--- a/src/assets/main.af3c5c19.png
+++ b/src/assets/main.af3c5c19.png
Binary files differ
diff --git a/src/views/common/ztt-table.vue b/src/views/common/ztt-table.vue
index e681840..ab46d8f 100644
--- a/src/views/common/ztt-table.vue
+++ b/src/views/common/ztt-table.vue
@@ -1379,6 +1379,7 @@
         this.multipleSelection = selection
         this.$emit('handleSelectionChange', selection)
       } */
+      this.$emit('shoudonggouxuan',row)
     },
     handleSelectionChange(val) {
       this.multipleSelection = val
diff --git a/src/views/technology/document/document-form.vue b/src/views/technology/document/document-form.vue
index 739b013..29a5b03 100644
--- a/src/views/technology/document/document-form.vue
+++ b/src/views/technology/document/document-form.vue
@@ -130,10 +130,10 @@
               </el-col>
               <el-col :span="6">
                 <el-form-item label="BOM" prop="bomId">
-                  <el-select 
-                    :disabled="dataForm.id != null" 
-                    v-model="dataForm.bomId" 
-                    placeholder="" 
+                  <el-select
+                    :disabled="dataForm.id != null"
+                    v-model="dataForm.bomId"
+                    placeholder=""
                     style="width: 100%;"
                     filterable>
                     <el-option
@@ -147,10 +147,10 @@
               </el-col>
               <el-col :span="6">
                 <el-form-item label="宸ヨ壓璺嚎缂栧彿" prop="routingList">
-                  <el-select 
-                    :disabled="dataForm.id != null" 
-                    v-model="dataForm.routingId" 
-                    placeholder="" 
+                  <el-select
+                    :disabled="dataForm.id != null"
+                    v-model="dataForm.routingId"
+                    placeholder=""
                     style="width: 100%;"
                     filterable>
                     <el-option
@@ -170,7 +170,7 @@
                   style="width:100%"
                 ></el-input>
               </el-form-item>
-            </el-col> 
+            </el-col>
               <el-col :span="6">
                 <el-form-item label="澶囨敞" prop="remark">
                   <el-input
@@ -433,7 +433,7 @@
                       宸ュ簭鍙傛暟
                     </div>
                   </div>
- 
+
                  <!-- <div class="document-bom-div" v-show="item.showBom">
                     <el-tooltip
                       class="item"
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('鍒犻櫎澶辫触')
+          }
+        })
     }
   }
 }
diff --git a/vue.config.js b/vue.config.js
index 3b58a3e..366ce9b 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -6,8 +6,8 @@
 
 
 // const url = 'https://ztms-mes.chinaztt.cn/'
- const url = 'http://localhost:9999'
-//const url = 'http://192.168.32.45:9999'
+//  const url = 'http://localhost:9999'
+const url = 'http://192.168.32.45:9999'
 
 
 const localUrl = 'http://localhost:8089'

--
Gitblit v1.9.3