From fc8f6fada78598ff9e4149f2b30355a0b25eb2f5 Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期四, 23 五月 2024 13:37:35 +0800
Subject: [PATCH] 修改检测值输入bug

---
 src/views/technology/routing/routing-form.vue |  227 ++++++++++++++++++++++++++++----------------------------
 1 files changed, 115 insertions(+), 112 deletions(-)

diff --git a/src/views/technology/routing/routing-form.vue b/src/views/technology/routing/routing-form.vue
index 2465b01..e7da9de 100644
--- a/src/views/technology/routing/routing-form.vue
+++ b/src/views/technology/routing/routing-form.vue
@@ -7,31 +7,35 @@
         <h2 v-if="!editable">鏌ョ湅-宸ヨ壓璺嚎</h2>
       </div>
       <div class="btn-group header-right" v-if="editable">
-        <el-button :disabled="isSubmit" v-thinclick="`allSave`">淇濆瓨</el-button>
+        <el-button :disabled="isSubmit" type="primary" v-thinclick="`allSave`">淇濆瓨</el-button>
       </div>
     </div>
     <div class="page-main">
       <div class="routing-basic">
         <el-form
-          :inline="true"
           :model="dataForm"
           :rules="dataRule"
           ref="dataForm"
+          label-width="100px"
           style="width: 100%"
           class="l-mes"
           :disabled="!editable"
         >
           <el-row>
-            <el-col :span="24">
-              <el-form-item prop="routingNo" label="宸ヨ壓缂栧彿">
+            <el-col :span="6">
+              <el-form-item style="width:100%" prop="routingNo" label="宸ヨ壓缂栧彿">
                 <el-input
+                  style="width:100%"
                   v-model="dataForm.routingNo"
                   placeholder="宸ヨ壓缂栧彿"
                   disabled
                 ></el-input>
               </el-form-item>
+            </el-col>
+            <el-col :span="6">
               <el-form-item prop="partNo" label="闆朵欢鍙�">
                 <el-input
+                  style="width:100%"
                   v-model="dataForm.partNo"
                   placeholder="闆朵欢鍙�"
                   disabled
@@ -43,60 +47,33 @@
                   ></el-button>
                 </el-input>
               </el-form-item>
+            </el-col>
+            <el-col :span="6">
               <el-form-item prop="partName" label="闆朵欢鍚嶇О">
+                <el-tooltip class="item" effect="dark" :content="dataForm.partName" >
                 <el-input
                   v-model="dataForm.partName"
                   placeholder="闆朵欢鍚嶇О"
                   readonly
-                  style="width: 300px"
+                  style="width: 100%"
                 ></el-input>
+                </el-tooltip>
               </el-form-item>
-              <el-form-item prop="description" label="鎻忚堪">
-                <el-input
-                  v-model="dataForm.description"
-                  placeholder="鎻忚堪"
-                  style="width: 280px"
-                ></el-input>
-              </el-form-item>
-              <el-form-item prop="wireCore" label="绾胯姱">
-                <el-input
-                  v-model="dataForm.wireCore"
-                  placeholder="绾胯姱"
-                  style="width: 60px"
-                ></el-input>
-              </el-form-item>
+            </el-col>
+            <el-col :span="6">
               <el-form-item label="BOM" prop="bomId">
-                <el-select 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"
                     :label="item.number"
-                    :value="item.id"
-                  />
+                    :value="item.id" />
                 </el-select>
               </el-form-item>
-              <el-form-item prop="version" label="宸ヨ壓鐗堟湰">
-                <el-input
-                  v-model="dataForm.version"
-                  placeholder="宸ヨ壓鐗堟湰"
-                ></el-input>
-              </el-form-item>
-              <el-form-item label="宸ヨ壓绫诲瀷" prop="bomTypeDb">
-                <el-select
-                  v-model="dataForm.bomTypeDb"
-                  placeholder="璇烽�夋嫨宸ヨ壓绫诲瀷"
-                  style="width:100%"
-                  @change="bomTypeDbChange"
-                >
-                  <el-option
-                    v-for="(item, index) in bomTypeDbOptions"
-                    :label="item.label"
-                    :value="item.value"
-                    :key="index"
-                  >
-                  </el-option>
-                </el-select>
-              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="6">
               <el-form-item label="閫愭閲囩敤鏃ユ湡" prop="phaseInDate">
                 <el-date-picker
                   v-model="dataForm.phaseInDate"
@@ -106,6 +83,8 @@
                 >
                 </el-date-picker>
               </el-form-item>
+            </el-col>
+            <el-col :span="6">
               <el-form-item label="閫愭娣樻卑鏃ユ湡" prop="phaseOutDate">
                 <el-date-picker
                   v-model="dataForm.phaseOutDate"
@@ -115,27 +94,17 @@
                 >
                 </el-date-picker>
               </el-form-item>
-              <!-- <el-form-item prop="alternativeNo" label="鏇夸唬">
+            </el-col>
+            <el-col :span="6">
+              <el-form-item prop="description" label="鎻忚堪">
                 <el-input
-                  v-model="dataForm.alternativeNo"
-                  placeholder="鏇夸唬"
+                  v-model="dataForm.description"
+                  placeholder="鎻忚堪"
+                  style="width: 100%"
                 ></el-input>
-              </el-form-item> -->
-              <!-- <el-form-item prop="alternativeDesc" label="鏇夸唬鎻忚堪">
-                <el-input
-                  v-model="dataForm.alternativeDesc"
-                  placeholder="鏇夸唬鎻忚堪"
-                ></el-input>
-              </el-form-item> -->
-              <!-- <el-form-item label="宸插悓姝ヨ嚦IFS" prop="ifsSync">
-                <span
-                  style="width: 146px;display: inline-block;font-size:12px;font-weight:bold;"
-                  >{{ dataForm.ifsSync ? '鏄�' : '鍚�' }}</span
-                >
-              </el-form-item> -->
-              <el-form-item label="涓诲伐鑹�" prop="master">
-                <el-switch v-model="dataForm.master"> </el-switch>
               </el-form-item>
+            </el-col>
+            <el-col :span="6">
             </el-col>
           </el-row>
         </el-form>
@@ -155,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
             >
@@ -167,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
@@ -277,13 +238,13 @@
                 <span v-if="!editable">{{ scope.row.operationName }}</span>
               </template>
             </el-table-column>
-            <el-table-column
+            <!-- <el-table-column
               prop="outsideOpItem"
               label="澶栭儴宸ュ簭椤圭洰"
               align="center"
               show-overflow-tooltip
             >
-            </el-table-column>
+            </el-table-column> -->
             <el-table-column
               prop="partName"
               label="闆朵欢"
@@ -310,7 +271,7 @@
                 }}</span>
               </template>
             </el-table-column>
-            <el-table-column
+            <!-- <el-table-column
               prop="runTimeCodeDb"
               label="鍥犵礌鍗曚綅"
               align="center"
@@ -350,7 +311,7 @@
               label="鍔冲姏璁剧疆鏃堕棿"
               align="center"
             >
-            </el-table-column>
+            </el-table-column> -->
             <el-table-column
               prop="laborClassNo"
               label="浜哄伐绫诲埆"
@@ -428,7 +389,7 @@
                 </el-input>
               </div>
 
-              <el-divider content-position="left">閰嶇疆椤�</el-divider>
+              <!-- <el-divider content-position="left">閰嶇疆椤�</el-divider>
 
               <div class="node-content-config">
                 <el-checkbox-group
@@ -462,9 +423,9 @@
                     >宸ュ崟棰勭暀</el-checkbox-button
                   >
                 </el-checkbox-group>
-              </div>
+              </div> -->
 
-              <el-divider content-position="left">鑳藉姏</el-divider>
+              <!-- <el-divider content-position="left">鑳藉姏</el-divider>
               <div class="node-content">
                 <label
                   v-if="capacities == null || capacities.length == 0"
@@ -473,7 +434,7 @@
                   娌℃湁閰嶇疆鑳藉姏
                 </label>
 
-                <el-tag
+               <el-tag
                   size="medium"
                   v-for="item in capacities"
                   :key="item.id"
@@ -485,7 +446,7 @@
                 >
                   {{ item.label }}
                 </el-tag>
-              </div>
+              </div> -->
               <el-divider content-position="left">澶囨敞</el-divider>
               <div class="node-content-remark">
                 <rich-text
@@ -615,6 +576,8 @@
 
     <operationDialog
       :currshowlist.sync="showOperation"
+      :multiSelect="multiSelect"
+      @handleSelectionChange="insertOperation"
       @listenToOperationEvent="insertOperation"
     />
     <partDialog :currshowlist.sync="showPart" @listenToPartEvent="selectPart" />
@@ -686,6 +649,7 @@
 export default {
   data() {
     return {
+      multiSelect: true,
       itemKey: '',
       typeOptions: [],
       paramTemplateSelArr: [],
@@ -714,6 +678,7 @@
         routingNo: null,
         name: null,
         partId: null,
+        partNo: null,
         partName: null,
         description: null,
         state: null,
@@ -731,15 +696,15 @@
         wireCore: null
       },
       dataRule: {
-        partName: [
-          { required: true, message: '闆朵欢涓嶈兘涓虹┖', trigger: 'change' }
+        partNo: [
+          { required: true, message: '闆朵欢涓嶈兘涓虹┖', trigger: 'blur' }
         ],
         bomTypeDb: [
           { required: true, message: '宸ヨ壓绫诲瀷涓嶈兘涓虹┖', trigger: 'change' }
         ],
         bomId: [{ required: true, message: 'BOM涓嶈兘涓虹┖', trigger: 'change' }],
         phaseInDate: [
-          { required: true, message: '閫愭閲囩敤鏃ユ湡涓嶈兘涓虹┖', trigger: 'blur' }
+          { required: true, message: '閫愭閲囩敤鏃ユ湡涓嶈兘涓虹┖', trigger: 'change' }
         ],
         alternativeNo: [
           { required: true, message: '鏇夸唬涓嶈兘涓虹┖', trigger: 'blur' }
@@ -773,6 +738,8 @@
     editRoutingOperation,
     zttdraggable
   },
+  created(){
+  },
   mounted() {
     window.addEventListener(
       'hashchange',
@@ -784,8 +751,6 @@
       },
       false
     )
-
-    // this.rowDrop()
   },
 
   computed: {
@@ -926,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) => {
@@ -1204,6 +1169,7 @@
       this.operationPart.remark = val
     },
     insertTechnologyOperation(row) {
+      this.multiSelect = false
       this.showOperation = true
       this.last = false
       this.operationIndex = row.index
@@ -1216,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) {
@@ -1434,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