From a65112ecf7580c7d5a2ae60d05150cac34e59f5d Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期一, 26 九月 2022 16:30:33 +0800
Subject: [PATCH] 1.工艺路线工艺设置下拉选中之后自动回车2.工序定义检验人员选中默认当前登录人员

---
 src/views/sbgl/bybz.vue |   94 +++++++++++++++++++++++++---------------------
 1 files changed, 51 insertions(+), 43 deletions(-)

diff --git a/src/views/sbgl/bybz.vue b/src/views/sbgl/bybz.vue
index 974b262..f4fd3b8 100644
--- a/src/views/sbgl/bybz.vue
+++ b/src/views/sbgl/bybz.vue
@@ -25,7 +25,7 @@
               <el-input v-model="form.repairstanddescr" placeholder="璇疯緭鍏�" style="width: 200px" />
             </el-form-item>
           </div>
-          <div style="display: flex;align-items: start;margin-top: 5px;z-index: 2">
+          <div class="bodySearchReset">
             <el-button type="primary" icon="el-icon-search" @click="search">鏌ヨ</el-button>
             <el-button type="info" icon="el-icon-refresh" @click="reset">閲嶇疆</el-button>
           </div>
@@ -34,9 +34,11 @@
 
       <div class="elTableDiv">
         <el-table
+          ref="tableDataRef"
           :data="tableData"
           :height="tableHeight+'px'"
           border
+          class="tableFixed"
           :row-class-name="tableRowClassName"
           :style="{width: 100+'%',height:tableHeight+'px',}"
           highlight-current-row
@@ -51,6 +53,7 @@
           <el-table-column
             prop="RowNum"
             width="50"
+            fixed
             label="搴忓彿"
           />
           <el-table-column
@@ -76,19 +79,26 @@
             </template>
           </el-table-column>
           <el-table-column
-            prop="iscontr"
+            prop="main_cycle"
             label="淇濆吇鍛ㄦ湡"
             sortable="custom"
-          />
+          >
+            <template slot-scope="{row}">
+              <div v-if="row.main_cycle==='Y'">骞�</div>
+              <div v-if="row.main_cycle==='S'">瀛�</div>
+              <div v-if="row.main_cycle==='M'">鏈�</div>
+              <div v-if="row.main_cycle==='W'">鍛�</div>
+            </template>
+          </el-table-column>
           <el-table-column
-            prop="is_checkeqp"
+            prop="is_repaireqp"
             label="鍏宠仈璁惧"
             sortable="custom"
           >
             <template slot-scope="{row}">
-              <i v-if="row.is_checkeqp==='Y'" class="el-icon-share" @click="checkeqpClick(row)" />
+              <i v-if="row.is_repaireqp==='Y'" class="el-icon-share" @click="checkeqpClick(row)" />
               <i
-                v-if="row.is_checkeqp==='N'"
+                v-if="row.is_repaireqp==='N'"
                 class="el-icon-share"
                 style="color: rgb(180 ,181, 185)"
                 @click="checkeqpClick(row)"
@@ -130,7 +140,7 @@
         :page.sync="form.page"
         :limit.sync="form.rows"
         align="right"
-        layout="prev, pager, next,sizes"
+        layout="total,prev, pager, next,sizes"
         popper-class="select_bottom"
         @pagination="getDeviceRepairStandArdSearch"
       />
@@ -244,6 +254,7 @@
           <el-table-column
             prop="repairitem_descr"
             label="淇濆吇瑕佹眰"
+            show-tooltip-when-overflow
           >
             <template slot-scope="{row}">
               <div v-if="row.isVisible===0">{{ row.repairitem_descr }}</div>
@@ -379,46 +390,26 @@
 
 <script>
 import Pagination from '@/components/Pagination'
-import { AddUpdateOrganization, DeleteOrganization, OrganizationSearch, PrentOrganization } from '@/api/jcsz'
-import { getCookie } from '@/utils/auth'
+
 import ImportPicker from '@/components/ImportPicker'
 import {
-  AddUpdateDeviceCheckStandArd, AddUpdateDeviceRepairStandArd,
-  DeleteDeviceCheckStaned, DeleteDeviceRepairStaned,
-  DeviceCheckItemSelect,
-  DeviceCheckStandArdSearch,
-  DeviceCheckStanedAssociationEqp, DeviceRepairItemSelect,
-  DeviceRepairStandArdSearch, DeviceRepairStanedAssociationEqp,
-  SaveDeviceCheckStanedAssociationEqp, SaveDeviceRepairStanedAssociationEqp,
-  ViewDeviceCheckStanedSearch
+  AddUpdateDeviceRepairStandArd,
+  DeleteDeviceRepairStaned,
+  DeviceRepairItemSelect,
+  DeviceRepairStandArdSearch,
+  DeviceRepairStanedAssociationEqp,
+  SaveDeviceRepairStanedAssociationEqp,
+  ViewDeviceRepairStanedSearch
 } from '@/api/sbgl'
 import $ from 'jquery'
+import { validateCode } from '@/utils/global'
 
-const SER_HZ = /^[\u4e00-\u9fa5]+$/
 export default {
   name: 'Zzjg',
   components: {
     Pagination, ImportPicker
   },
   data() {
-    const validateName = (rule, value, callback) => {
-      if (!value) {
-        return callback(new Error('璇疯緭鍏ョ紪鐮�'))
-      } else {
-        if (SER_HZ.test(value)) {
-          return callback(new Error('缂栫爜涓嶈兘涓轰腑鏂�'))
-        } else {
-          callback()
-        }
-      }
-    }
-    const validateTypeCode = (rule, value, callback) => {
-      if (!value) {
-        return callback(new Error('璇烽�夋嫨涓婄骇'))
-      } else {
-        callback()
-      }
-    }
     return {
       mainHeight: 0,
       tableHeight: 0,
@@ -454,7 +445,7 @@
       dialogFormRules: {
 
         code: [
-          { required: true, validator: validateName, trigger: ['blur', 'change'] }
+          { required: true, validator: validateCode, trigger: ['blur', 'change'] }
         ],
         name: [
           { required: true, message: '璇疯緭鍏ユ爣鍑嗗悕绉�', trigger: ['blur', 'change'] }
@@ -566,7 +557,7 @@
     // 淇敼鎸夐挳
     edit(operation, row) {
       this.operation = operation
-      this.getViewDeviceCheckStanedSearch(row.code)
+      this.getViewDeviceRepairStanedSearch(row.code)
       this.dialogVisible = true
 
       this.$nextTick(() => {
@@ -580,8 +571,8 @@
       // })
     },
     // 淇敼鍓嶈姹傛帴鍙�
-    async getViewDeviceCheckStanedSearch(checkstand_code) {
-      const { data: res } = await ViewDeviceCheckStanedSearch({ checkstand_code })
+    async getViewDeviceRepairStanedSearch(repairstand_code) {
+      const { data: res } = await ViewDeviceRepairStanedSearch({ repairstand_code	 })
       this.tableDataDialog = res.Data
 
       this.dialogForm.code = res.code
@@ -593,7 +584,7 @@
         item.isVisible = 0
         item.repairitem_code = item.code
         item.repairitem_name = item.name
-        item.repairitem_descr = item.chkdesc
+        item.repairitem_descr = item.chk_desc
       })
 
       this.repairItemSelectArr = [...this.repairItemSelectArr].filter(x => [...this.tableDataDialog].every(y => y.repairitem_code !== x.code))
@@ -608,6 +599,9 @@
         DeleteDeviceRepairStaned({ repairstand_code: row.code }).then(res => {
           if (res.code === '200') {
             this.$message.success('鍒犻櫎鎴愬姛!')
+            if (this.form.page > 1 && this.tableData.length === 1) {
+              this.form.page--
+            }
             this.getDeviceRepairStandArdSearch()
           }
         })
@@ -771,6 +765,7 @@
       this.$nextTick(() => {
         this.mainHeight = window.innerHeight - 85
         this.tableHeight = this.mainHeight - 200
+        this.$refs.tableDataRef.doLayout()
       })
     },
     tableRowClassName({ row, rowIndex }) {
@@ -781,8 +776,8 @@
       this.dialogFormEqp.name = row.name
       this.dialogFormEqp.code = row.code
 
-      const { data: res } = await DeviceRepairStanedAssociationEqp({ checkstand_code: row.code })
-      this.dialogFormEqp.eqpAll = res
+      const { data: res } = await DeviceRepairStanedAssociationEqp({ repairstand_code: row.code })
+      this.dialogFormEqp.eqpAll = res.filter(item => item.children.length > 0)
 
       if (this.dialogFormEqp.eqpAll.length > 0) {
         this.dialogFormEqp.eqpAll.forEach((item, index) => {
@@ -834,6 +829,9 @@
           this.dialogFormEqp.eqpAll[index].name = '鍏ㄩ儴'
           this.dialogFormEqp.eqpTree = [this.dialogFormEqp.eqpAll[index]]
         }
+      })
+      this.$nextTick(() => { // 鏍戝舰鍥炴樉
+        this.$refs.epqTree.setCheckedKeys(this.dialogFormEqp.eqpCodeSelectedArr)
       })
     },
     // 灏忕洅瀛愮偣鍑�
@@ -1161,6 +1159,16 @@
   align-items: center;
   justify-content: center;
 }
+
+.tableFixed{
+  ::v-deep .el-table__fixed-right{
+    height: 100% !important;
+  }
+  ::v-deep .el-table__fixed{
+    height: 100% !important;
+  }
+}
+
 </style>
 <style>
 

--
Gitblit v1.9.3