From dbe4d740a7b0b5696c89f4df14b6804a71364432 Mon Sep 17 00:00:00 2001
From: zss <zss@example.com>
Date: 星期三, 08 五月 2024 14:56:56 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 src/views/technology/routing/routing-form.vue |  118 +++++++++++++++++++++++++++++++++++++---------------------
 1 files changed, 75 insertions(+), 43 deletions(-)

diff --git a/src/views/technology/routing/routing-form.vue b/src/views/technology/routing/routing-form.vue
index 411b041..e7da9de 100644
--- a/src/views/technology/routing/routing-form.vue
+++ b/src/views/technology/routing/routing-form.vue
@@ -62,7 +62,7 @@
             </el-col>
             <el-col :span="6">
               <el-form-item label="BOM" prop="bomId">
-                <el-select style="width:100%" :disabled="dataForm.id != null" v-model="dataForm.bomId" placeholder="" filterable>
+                <el-select style="width:100%"  v-model="dataForm.bomId" placeholder="" filterable>
                   <el-option
                     v-for="item in bomList"
                     :key="item.id"
@@ -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
             >
@@ -136,16 +136,8 @@
               '--dragitemwidth': '250px'
             }"
           >
-            <div
-              :style="{
-                width: 265 * dataForm.operations.length - 15 + 'px'
-              }"
-            >
-              <div
-                class="dragHead"
-                v-for="x in dataForm.operations.length"
-                :key="x"
-              >
+            <div :style="{ width: 265 * dataForm.operations.length - 15 + 'px' }">
+              <div class="dragHead" v-for="x in dataForm.operations.length"  :key="x" >
                 <div class="idx">{{ x }}</div>
               </div>
               <zttdraggable
@@ -453,7 +445,7 @@
                   effect="dark"
                 >
                   {{ item.label }}
-                </el-tag> 
+                </el-tag>
               </div> -->
               <el-divider content-position="left">澶囨敞</el-divider>
               <div class="node-content-remark">
@@ -584,6 +576,8 @@
 
     <operationDialog
       :currshowlist.sync="showOperation"
+      :multiSelect="multiSelect"
+      @handleSelectionChange="insertOperation"
       @listenToOperationEvent="insertOperation"
     />
     <partDialog :currshowlist.sync="showPart" @listenToPartEvent="selectPart" />
@@ -655,12 +649,12 @@
 export default {
   data() {
     return {
+      multiSelect: true,
       itemKey: '',
       typeOptions: [],
       paramTemplateSelArr: [],
       paramTemplateSelCol: 'operationTemplateNo',
-      // templateDefaultObj: { dataType: '鐢熶骇瑕佹眰' },
-      templateDefaultObj: {},
+      templateDefaultObj: { dataType: '鐢熶骇瑕佹眰' },
       paramSelArr: [],
       paramSelCol: 'code',
       operationIndex: null,
@@ -704,7 +698,7 @@
       dataRule: {
         partNo: [
           { required: true, message: '闆朵欢涓嶈兘涓虹┖', trigger: 'blur' }
-        ], 
+        ],
         bomTypeDb: [
           { required: true, message: '宸ヨ壓绫诲瀷涓嶈兘涓虹┖', trigger: 'change' }
         ],
@@ -744,6 +738,8 @@
     editRoutingOperation,
     zttdraggable
   },
+  created(){
+  },
   mounted() {
     window.addEventListener(
       'hashchange',
@@ -755,8 +751,6 @@
       },
       false
     )
-
-    // this.rowDrop()
   },
 
   computed: {
@@ -897,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) => {
@@ -1175,6 +1169,7 @@
       this.operationPart.remark = val
     },
     insertTechnologyOperation(row) {
+      this.multiSelect = false
       this.showOperation = true
       this.last = false
       this.operationIndex = row.index
@@ -1187,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) {
@@ -1405,6 +1429,14 @@
     },
     // 淇濆瓨鎵�鏈夊弬鏁扮殑淇敼
     saveAllParamChange() {
+      this.paramData.forEach(e=>{
+        if(e.paramValue!=null){
+        e.paramValue=e.paramValue.replace(',','锛�').replace('(','锛�').replace(')','锛�')
+          if (!isNaN(e.paramValue)) {
+            e.paramValue='='+e.paramValue
+          }
+        }
+      })
       const paramJson = { routingOperationParam: this.paramData }
       putRoutingTemplateParam(paramJson).then((response) => {
         const data = response.data

--
Gitblit v1.9.3