From d69611b526c9b269727c8b301ca1a6b7b108c887 Mon Sep 17 00:00:00 2001
From: zss <zss@example.com>
Date: 星期三, 24 四月 2024 10:16:20 +0800
Subject: [PATCH] 参数及模板,工艺路线,车间订单里面参数要求值英文符号替换

---
 src/views/technology/routing/routing-form.vue |  104 +++++++++++++++++++++++++++++++++------------------
 1 files changed, 67 insertions(+), 37 deletions(-)

diff --git a/src/views/technology/routing/routing-form.vue b/src/views/technology/routing/routing-form.vue
index 9b71564..e7da9de 100644
--- a/src/views/technology/routing/routing-form.vue
+++ b/src/views/technology/routing/routing-form.vue
@@ -124,7 +124,7 @@
             <el-button
               style="float: right; padding: 3px 0"
               type="text"
-              @click=";(showOperation = true), (last = true)"
+              @click=";(showOperation = true), (last = true),(multiSelect=true)"
               v-if="editable"
               >娣诲姞</el-button
             >
@@ -576,6 +576,8 @@
 
     <operationDialog
       :currshowlist.sync="showOperation"
+      :multiSelect="multiSelect"
+      @handleSelectionChange="insertOperation"
       @listenToOperationEvent="insertOperation"
     />
     <partDialog :currshowlist.sync="showPart" @listenToPartEvent="selectPart" />
@@ -647,6 +649,7 @@
 export default {
   data() {
     return {
+      multiSelect: true,
       itemKey: '',
       typeOptions: [],
       paramTemplateSelArr: [],
@@ -735,6 +738,8 @@
     editRoutingOperation,
     zttdraggable
   },
+  created(){
+  },
   mounted() {
     window.addEventListener(
       'hashchange',
@@ -746,8 +751,6 @@
       },
       false
     )
-
-    // this.rowDrop()
   },
 
   computed: {
@@ -888,11 +891,11 @@
                 operationsFlag = false
               }
             })
-            if (!operationsFlag) {
+           /*  if (!operationsFlag) {
               this.$message.error('姣忎釜宸ュ簭閮介渶娣诲姞瀵瑰簲闆朵欢')
               this.isSubmit = false
               return
-            }
+            } */
             if (this.dataForm.id) {
               putObj(this.dataForm)
                 .then((response) => {
@@ -1166,6 +1169,7 @@
       this.operationPart.remark = val
     },
     insertTechnologyOperation(row) {
+      this.multiSelect = false
       this.showOperation = true
       this.last = false
       this.operationIndex = row.index
@@ -1178,30 +1182,59 @@
           type: 'warning'
         })
       }
-      operation.operationName = operation.name
-      operation.operationId = operation.id
-      operation.id = null
-      if (this.last) {
-        // 琛屾渶鍚庢坊鍔�
-        operation.index = this.dataForm.operations.length + 1
-        this.dataForm.operations.push(operation)
-      } else {
-        // 鎻掑叆鍓嶄竴琛�
-        operation.index = this.operationIndex
-        this.dataForm.operations = [
-          ...this.dataForm.operations.slice(0, operation.index - 1),
-          operation,
-          ...this.dataForm.operations.slice(operation.index - 1)
-        ]
+      if(this.multiSelect){
+        operation.forEach(item => {
+            let obj = {};
+            obj.operationName = item.name;
+            obj.operationId = item.id;
+            if (this.last){
+                // 琛屾渶鍚庢坊鍔�
+                obj.index = this.dataForm.operations.length + 1
+                this.dataForm.operations.push(obj)
+            }else{
+                // 鎻掑叆鍓嶄竴琛�
+                obj.index = this.operationIndex
+                this.dataForm.operations = [
+                ...this.dataForm.operations.slice(0, obj.index - 1),
+                obj,
+                ...this.dataForm.operations.slice(obj.index - 1)
+                ]
+            }
+        })
+        this.dataForm.operations.forEach((e, idx) => {
+            e.index = idx + 1
+        })
+        this.$forceUpdate()
+        this.$refs.operationTable.sort('index')
+        Promise.all([this.save()]).then((res) => {
+            this.selectByIndex(obj.index)
+        })
+      }else{
+        operation.operationName = operation.name
+        operation.operationId = operation.id
+        operation.id = null
+        if (this.last) {
+            // 琛屾渶鍚庢坊鍔�
+            operation.index = this.dataForm.operations.length + 1
+            this.dataForm.operations.push(operation)
+        } else {
+            // 鎻掑叆鍓嶄竴琛�
+            operation.index = this.operationIndex
+            this.dataForm.operations = [
+            ...this.dataForm.operations.slice(0, operation.index - 1),
+            operation,
+            ...this.dataForm.operations.slice(operation.index - 1)
+            ]
+        }
+        this.dataForm.operations.forEach((e, idx) => {
+            e.index = idx + 1
+        })
+        this.$forceUpdate()
+        this.$refs.operationTable.sort('index')
+        Promise.all([this.save()]).then((res) => {
+            this.selectByIndex(operation.index)
+        })
       }
-      this.dataForm.operations.forEach((e, idx) => {
-        e.index = idx + 1
-      })
-      this.$forceUpdate()
-      this.$refs.operationTable.sort('index')
-      Promise.all([this.save()]).then((res) => {
-        this.selectByIndex(operation.index)
-      })
     },
 
     handleDelete(row) {
@@ -1396,18 +1429,15 @@
     },
     // 淇濆瓨鎵�鏈夊弬鏁扮殑淇敼
     saveAllParamChange() {
-      const paramJson = { routingOperationParam: this.paramData }
-      let num = 0
       this.paramData.forEach(e=>{
-        var regex=/^[^\(\)|^,]+$/;
-        if(!regex.test(e.paramValue)){
-            num+=1
+        if(e.paramValue!=null){
+        e.paramValue=e.paramValue.replace(',','锛�').replace('(','锛�').replace(')','锛�')
+          if (!isNaN(e.paramValue)) {
+            e.paramValue='='+e.paramValue
+          }
         }
       })
-      if(num>0){
-        this.$message.error("鍙傛暟鍊间笉鑳藉寘鍚嫳鏂囨嫭鍙锋垨閫楀彿,璇锋鏌�")
-        return
-      }
+      const paramJson = { routingOperationParam: this.paramData }
       putRoutingTemplateParam(paramJson).then((response) => {
         const data = response.data
         if (data.code == 0) {

--
Gitblit v1.9.3