From 54c7f635a034ab4573837b00c839b7802938e01f Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期六, 26 十一月 2022 15:33:35 +0800
Subject: [PATCH] 1.节拍工价页面功能优化

---
 src/views/zzmx/jpgj.vue |   87 ++++++++++++++++++++++---------------------
 1 files changed, 44 insertions(+), 43 deletions(-)

diff --git a/src/views/zzmx/jpgj.vue b/src/views/zzmx/jpgj.vue
index 07a58ac..8c67361 100644
--- a/src/views/zzmx/jpgj.vue
+++ b/src/views/zzmx/jpgj.vue
@@ -150,7 +150,6 @@
             prop="wksp_name"
             label="鐢熶骇杞﹂棿"
             min-width="110"
-            show-tooltip-when-overflow
             sortable="custom"
           />
           <el-table-column
@@ -164,13 +163,12 @@
             prop="stepname"
             label="鍔犲伐宸ュ簭"
             sortable="custom"
-            min-width="90"
+            min-width="110"
           />
           <el-table-column
             prop="eqp_name"
-            label="鍔犲伐璁惧/渚涙柟"
+            label="鍔犲伐璁惧"
             min-width="110"
-            show-tooltip-when-overflow
             sortable="custom"
           />
           <el-table-column
@@ -258,7 +256,6 @@
               style="width: 220px"
               placeholder="璇烽�夋嫨"
               :popper-append-to-body="false"
-
               @change="partDialogChange"
             >
               <!--              @focus="getPartSelect2"-->
@@ -330,14 +327,15 @@
           class="tableFixed"
           :data="eqpDialogArr"
           :height="tableHeight"
-          :style="{width: 100+'%',height:tableHeight-50+'px',}"
+          :style="{width: 100+'%',height:tableHeight-50+'px'}"
           border
           :row-class-name="tableRowClassName"
-          highlight-current-row
           :header-cell-style="this.$headerCellStyle"
           :cell-style="this.$cellStyle"
+          highlight-current-row
           @sort-change="dialogSortChange"
         >
+          <!--          @row-click="rowClick"-->
           <el-table-column
             width="50"
             label="搴忓彿"
@@ -346,25 +344,23 @@
           />
           <el-table-column
             prop="eqpcode"
-            :label="eqpTable.steptype==='Z'?'璁惧缂栫爜':'澶栧崗渚涙柟缂栫爜'"
+            label="璁惧缂栫爜"
             sortable="custom"
             min-width="110"
           />
           <el-table-column
             prop="eqpname"
-            :label="eqpTable.steptype==='Z'?'璁惧鍚嶇О':'澶栧崗渚涙柟鍚嶇О'"
+            label="璁惧鍚嶇О"
             min-width="110"
             sortable="custom"
           />
           <el-table-column
-            v-if="eqpTable.steptype==='Z'"
             prop="wksp_name"
             sortable="custom"
             label="鐢熶骇杞﹂棿"
             min-width="110"
           />
           <el-table-column
-            v-if="eqpTable.steptype==='Z'"
             sortable="custom"
             prop="eqp_value"
             label="璁惧鑺傛媿"
@@ -384,7 +380,6 @@
             </template>
           </el-table-column>
           <el-table-column
-            v-if="eqpTable.steptype==='Z'"
             prop="stand_value"
             label="鐢熶骇鑺傛媿"
             sortable="custom"
@@ -395,7 +390,6 @@
             </template>
           </el-table-column>
           <el-table-column
-            v-if="eqpTable.steptype==='Z'"
             prop="cavity_qty"
             label="鑵斿瀷鏁�"
             sortable="custom"
@@ -437,10 +431,10 @@
           >
             <template slot-scope="{row}">
               <div class="operationClass">
-                <el-button v-if="row.isVisible===1" type="text" @click="saveRow(row)">淇濆瓨</el-button>
-                <el-button v-if="row.isVisible===1" type="text" @click="cancelRow(row)">鍙栨秷</el-button>
-                <el-button v-if="row.isVisible===0" type="text" @click="editRow(row)">缂栬緫</el-button>
-                <el-button v-if="row.isVisible===0" type="text" @click="copyRow(row)">澶嶅埗</el-button>
+                <el-button v-show="row.isVisible===1" type="text" @click="saveRow(row)">淇濆瓨</el-button>
+                <el-button v-show="row.isVisible===1" type="text" @click="cancelRow(row)">鍙栨秷</el-button>
+                <el-button v-show="row.isVisible===0" type="text" @click="editRow(row)">缂栬緫</el-button>
+                <el-button v-show="row.isVisible===0" type="text" @click="copyRow(row)">澶嶅埗</el-button>
               </div>
             </template>
           </el-table-column>
@@ -539,11 +533,10 @@
         partcode: '',
         routecode: '',
         stepcode: '',
-        steptype: '',
         page: 1,
         rows: 10,
         prop: 'eqpcode',
-        order: 'asc'
+        order: 'desc'
       },
       eqpTableLength: 0,
       isEqpTableEdit: true,
@@ -552,6 +545,7 @@
       editStepName: '', // 缂栬緫鏃跺姞宸ュ伐搴忓悕绉�
       operation: '',
       dialogFormRules: {},
+      radioChangeTempValue: '',
 
       title_value: '鏁版嵁瀵煎叆 / 鑺傛媿宸ヤ环',
       code: '24',
@@ -646,16 +640,18 @@
       this.routeDialogArr = res
       this.stepDialogArr = []
       this.eqpDialogArr = []
+      this.dialogForm.routecode = ''
     },
     async routeDialogChange(val) {
       const { data: res } = await RouteSelectStep({ routecode: val })
-      this.stepDialogArr = res.filter(i => i.flag === 'Z')
-      console.log(this.stepDialogArr)
+      this.stepDialogArr = res
       this.eqpDialogArr = []
+      this.radioChangeTempValue = ''
     },
     radioChange(val) {
       this.isEqpTableEdit = true
 
+      this.radioChangeTempValue = val
       // this.dialogForm.stepcode = this.stepDialogArr.find(item => item.name === val).code
       this.getEqpTable(val)
     },
@@ -673,20 +669,17 @@
     },
     async getEqpTable(val) {
       if (typeof val === 'string') {
-        console.log('鎵ц1')
-        this.eqpTable.steptype = this.stepDialogArr.find(item => item.name === val).flag
         this.eqpTable.partcode = this.dialogForm.partcode
         this.eqpTable.routecode = this.dialogForm.routecode
         this.eqpTable.stepcode = this.stepDialogArr.find(item => item.name === val).code
-      } else if (typeof val === 'number') {
-        console.log('鎵ц2')
-        // console.log(this.stepDialogArr)
-        this.eqpTable.steptype = this.stepDialogArr[0].flag
+        // } else if (typeof val === 'number') {
+      } else {
         this.eqpTable.partcode = this.dialogForm.partcode
         this.eqpTable.routecode = this.dialogForm.routecode
         this.eqpTable.stepcode = this.stepDialogArr[0].code
         this.dialogForm.stepcode = this.stepDialogArr[0].name
       }
+
       const res = await StepSelectEqpList(this.eqpTable)
       this.eqpDialogArr = res.data
       this.eqpTableLength = res.count
@@ -715,7 +708,7 @@
       if (res.code === '200') {
         this.isEqpTableEdit = true
         this.$message.success('淇濆瓨鎴愬姛锛�')
-        await this.getEqpTable()
+        this.radioChange(this.radioChangeTempValue)
       }
     },
     // 鍙栨秷琛�
@@ -740,8 +733,13 @@
         return this.$message.info('鍙兘涓�琛屼竴琛屼慨鏀癸紒')
       }
     },
+    // rowClick(row, column, event) {
+    //   console.log(row, column, event, 3)
+    //   console.log(this.dialogForm.stepcode, 4)
+    //   this.getEqpTable(this.dialogForm.stepcode)
+    // },
     // 澶嶅埗琛�
-    async  copyRow(row) {
+    async copyRow(row) {
       let currentData = {}// 褰撳墠琛屽璞�
       let nextData = {}// 涓嬩竴琛屽璞�
       if (row.RowNum === this.eqpDialogArr.length) {
@@ -769,7 +767,7 @@
       const res = await SaveBeatRate(newData)
       if (res.code === '200') {
         this.$message.success('澶嶅埗鎴愬姛锛�')
-        await this.getEqpTable()
+        this.radioChange(this.radioChangeTempValue)
         this.isEqpTableEdit = true
       }
     },
@@ -796,7 +794,7 @@
       this.getPartSelect2()
     },
     // 淇敼鎸夐挳
-    async  edit(operation, row) {
+    async edit(operation, row) {
       this.operation = operation
       this.dialogVisible = true
 
@@ -804,13 +802,11 @@
       this.editRouteName = row.route_name
       this.editStepName = row.stepname
 
-      // this.$nextTick(() => {
+      await this.partDialogChange(row.partcode)
+      await this.routeDialogChange(row.route_code)
       this.dialogForm.partcode = row.partcode
       this.dialogForm.routecode = row.route_code
       this.dialogForm.stepcode = row.stepcode
-      // })
-      await this.partDialogChange(row.partcode)
-      await this.routeDialogChange(row.route_code)
       await this.radioChange(0)
     },
     // 鍒犻櫎鎸夐挳
@@ -910,15 +906,17 @@
 <!--鍏叡椤甸潰鏍峰紡-->
 <style lang="scss" scoped>
 $main_color: #42b983;
-.el-button--text{
+.el-button--text {
   font-size: 14px;
   cursor: pointer;
 }
-.el-icon-share ,.el-icon-delete,.el-icon-edit-outline{
+
+.el-icon-share, .el-icon-delete, .el-icon-edit-outline {
   color: $main_color;
   cursor: pointer;
 }
-.el-icon-edit-outline{
+
+.el-icon-edit-outline {
   margin-right: 15px;
 }
 
@@ -979,8 +977,8 @@
   background-color: #f8f8fa;
 }
 
-::v-deep .el-table__body .el-table__row.hover-row td{
-  background-color: #eaecef ;
+::v-deep .el-table__body .el-table__row.hover-row td {
+  background-color: #eaecef;
 }
 
 ::v-deep .el-form--inline .el-form-item__label {
@@ -996,14 +994,17 @@
 .body ::v-deep .el-form-item {
   margin-bottom: 0;
 }
+
 .userDialogVisible ::v-deep .el-form-item {
   margin-bottom: 0;
 }
-.tableFixed{
-  ::v-deep .el-table__fixed-right{
+
+.tableFixed {
+  ::v-deep .el-table__fixed-right {
     height: 100% !important;
   }
-  ::v-deep .el-table__fixed{
+
+  ::v-deep .el-table__fixed {
     height: 100% !important;
   }
 }

--
Gitblit v1.9.3