From 5eeb8864bebb1dc4f97f2feef32b742d8a9a10d5 Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期三, 14 九月 2022 15:43:04 +0800
Subject: [PATCH] 1.新增报表管理菜单

---
 src/views/zzmx/gxdy.vue |  264 ++++++++++++++++++++--------------------------------
 1 files changed, 100 insertions(+), 164 deletions(-)

diff --git a/src/views/zzmx/gxdy.vue b/src/views/zzmx/gxdy.vue
index 33fb664..8f6b991 100644
--- a/src/views/zzmx/gxdy.vue
+++ b/src/views/zzmx/gxdy.vue
@@ -1,7 +1,13 @@
 <template>
   <div>
     <div class="body" :style="{height:mainHeight+'px'}">
-      <div style="padding: 10px 5px 0 0">
+
+      <div class="bodyTopButtonGroup">
+        <el-button type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">鏂板</el-button>
+        <!--        <el-button type="primary" icon="el-icon-upload2" @click="upload">瀵煎叆</el-button>-->
+      </div>
+
+      <div class="bodyTopFormGroup">
         <el-form
           ref="form"
           :model="form"
@@ -58,19 +64,14 @@
           </div>
         </el-form>
       </div>
-      <el-divider />
-      <div style="margin-left: 10px;display: flex">
-        <el-button type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">鏂板</el-button>
-        <!--        <el-button type="primary" icon="el-icon-upload2" @click="upload">瀵煎叆</el-button>-->
-      </div>
-      <el-divider />
+
       <div class="elTableDiv">
         <el-table
           :data="tableData"
           :height="tableHeight"
           border
-          stripe
-          :style="{width: 100+'%',height:tableHeight+'px',}"
+          :row-class-name="tableRowClassName"
+          :style="{width: 100+'%',height:tableHeight+'px'}"
           highlight-current-row
           :header-cell-style="this.$headerCellStyle"
           :cell-style="this.$cellStyle"
@@ -115,7 +116,12 @@
             label="宸ュ簭鎻忚堪"
             min-width="180"
             sortable="custom"
-          />
+          >
+            <template slot-scope="{row}">
+              <div v-if="row.descr">{{ row.descr }}</div>
+              <div v-else>/</div>
+            </template>
+          </el-table-column>
           <el-table-column
             prop="enable"
             label="鍚敤鐘舵��"
@@ -123,8 +129,8 @@
             width="110"
           >
             <template slot-scope="{row}">
-              <div v-if="row.enable==='Y'">鏄�</div>
-              <div v-if="row.enable==='N'">鍚�</div>
+              <div v-if="row.enable==='Y'"><svg-icon icon-class="circleYes" style="margin-right: 2px" />鏄�</div>
+              <div v-if="row.enable==='N'"> <svg-icon icon-class="circleNo" style="margin-right: 2px" />鍚�</div>
             </template>
           </el-table-column>
           <el-table-column
@@ -180,8 +186,12 @@
           >
             <template slot-scope="{row}">
               <div class="operationClass">
-                <el-button type="text" @click="edit('edit',row)">缂栬緫</el-button>
-                <el-button type="text" @click="del(row)">鍒犻櫎</el-button>
+                <el-tooltip class="item" effect="dark" content="缂栬緫" placement="top">
+                  <i class="el-icon-edit-outline" @click="edit('edit',row)" />
+                </el-tooltip>
+                <el-tooltip v-del-tab-index class="item" effect="dark" content="鍒犻櫎" placement="top">
+                  <i class="el-icon-delete" @click="del(row)" />
+                </el-tooltip>
               </div>
             </template>
           </el-table-column>
@@ -189,12 +199,11 @@
       </div>
       <!--鍒嗛〉-->
       <pagination
-        v-show="total>0"
         :total="total"
         :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="getStepSearch"
       />
@@ -397,25 +406,14 @@
   StepSearch
 } from '@/api/zzmx'
 import $ from 'jquery'
+import { validateCode } from '@/utils/global'
 
-const SER_HZ = /^[\u4e00-\u9fa5]+$/
 export default {
   name: 'GXDY',
   components: {
     Pagination
   },
   data() {
-    const validateName = (rule, value, callback) => {
-      if (!value) {
-        return callback(new Error('璇疯緭鍏ョ紪鐮�'))
-      } else {
-        if (SER_HZ.test(value)) {
-          return callback(new Error('缂栫爜涓嶈兘涓轰腑鏂�'))
-        } else {
-          callback()
-        }
-      }
-    }
     return {
       isIpad: false,
       mainHeight: 0,
@@ -455,7 +453,7 @@
       operation: '',
       dialogFormRules: {
         stepcode: [
-          { required: true, validator: validateName, trigger: ['blur', 'change'] }
+          { required: true, validator: validateCode, trigger: ['blur', 'change'] }
         ],
         stepname: [
           { required: true, message: '璇疯緭鍏ュ悕绉�', trigger: ['blur', 'change'] }
@@ -497,6 +495,9 @@
     this.getHeight()
   },
   methods: {
+    tableRowClassName({ row, rowIndex }) {
+      return 'custom-row'
+    },
     async getStepSearch() {
       const res = await StepSearch(this.form)
       this.tableData = res.data
@@ -561,6 +562,9 @@
         DeleteStep({ stepcode: row.stepcode }).then(res => {
           if (res.code === '200') {
             this.$message.success('鍒犻櫎鎴愬姛!')
+            if (this.form.page > 1 && this.tableData.length === 1) {
+              this.form.page--
+            }
             this.getStepSearch()
           }
         })
@@ -609,12 +613,13 @@
     // 鑾峰彇椤甸潰楂樺害
     getHeight() {
       this.$nextTick(() => {
-        this.mainHeight = window.innerHeight - 250
-        this.tableHeight = this.mainHeight - 50
+        // this.mainHeight = window.innerHeight - 250
+        this.mainHeight = window.innerHeight - 85
+        this.tableHeight = this.mainHeight - 200
         if (window.innerHeight < 769) {
-          this.tableHeight = this.tableHeight - 50
+          this.tableHeight = this.tableHeight - 40
         }
-        this.isIpad = window.innerHeight < 769
+        this.isIpad = window.innerHeight < 769 && window.innerWidth < 1367
       })
     },
     /* 鍏宠仈宸ヤ綔绔欐ā鍧�*/
@@ -624,7 +629,8 @@
       this.workDialogForm.stepcode = row.stepcode
       this.workDialogForm.stepname = row.stepname
       const { data: res } = await StepAssociationEqp({ stepcode: this.workDialogForm.stepcode })
-      this.workDialogForm.workArr = res
+      this.workDialogForm.workArr = res.filter(item => item.children.length !== 0)
+
       let workGatherArr = []
       if (row.flwtype === 'W') { // 澶栧崗鎯呭喌涓�
         workGatherArr = this.workDialogForm.workArr.filter(item => item.type === 'W')
@@ -956,71 +962,10 @@
   }
 }
 </script>
-
 <style lang="scss" scoped>
 $main_color: #42b983;
-::v-deep .el-button--primary {
-  background-color: $main_color !important;
-  height: 30px;
-  display: flex;
-  align-items: center;
-  //border: 1px solid $main_color;
-  border: none;
-  padding: 0 20px;
-}
-
-::v-deep .el-button--primary:hover {
-  border: none;
-}
-
-::v-deep .el-button--info {
-  height: 30px;
-  display: flex;
-  align-items: center;
-  padding: 0 20px;
-}
-
-::v-deep .el-pagination.is-background .el-pager li:not(.disabled).active {
-  background-color: $main_color !important;
-}
-
-::v-deep .el-dialog__footer {
-  display: flex;
-  justify-content: flex-end;
-}
-
-.footerButton {
-  display: flex;
-  justify-content: end;
-}
-
-::v-deep .el-button--default {
-  background-color: #ffffff !important;
-  height: 30px;
-  display: flex;
-  align-items: center;
-  padding: 0 20px;
-}
-
-::v-deep .el-button--default:hover {
-  color: #606266;
-}
-
-::v-deep .el-dialog__body {
-  padding: 20px 100px !important;
-}
-
-.defectDialogVisible {
-  ::v-deep .el-dialog__body {
-    padding: 20px 20px !important;
-  }
-}
 
 .workDialogVisible {
-  ::v-deep .el-dialog__body {
-    padding: 20px 20px !important;
-  }
-
   .myCheckboxGroup {
     display: flex;
     flex-wrap: wrap;
@@ -1074,27 +1019,60 @@
   }
 }
 
-::v-deep .el-radio__input.is-checked .el-radio__inner {
-  background-color: $main_color;
-  border-color: $main_color;
+</style>
+<!--鍏叡椤甸潰鏍峰紡-->
+<style lang="scss" scoped>
+$main_color: #42b983;
+.el-icon-share, .el-icon-delete, .el-icon-edit-outline {
+  color: $main_color;
+  cursor: pointer;
 }
 
-::v-deep .el-radio__input.is-checked + .el-radio__label {
-  color: $main_color !important;
+.el-icon-edit-outline {
+  margin-right: 15px;
 }
 
-::v-deep .el-checkbox__input.is-checked .el-checkbox__inner {
-  border-color: $main_color;
-  background-color: $main_color;
+::v-deep .el-button--primary, .el-button--default, .el-button--info {
+  height: 34px;
+  display: flex;
+  align-items: center;
+  padding: 0 15px;
+}
+
+::v-deep .el-button--primary {
+  //background-color: $main_color !important;
+}
+
+::v-deep .el-button--default {
+  background-color: #f8f8fa;
+  border: none;
 }
 
 ::v-deep .el-input__inner {
-  height: 30px;
-  line-height: 30px;
+  height: 34px;
+  line-height: 34px;
+  //color: #a7a7a7;
 }
 
-::v-deep .el-input__inner:focus {
-  border-color: $main_color;
+::v-deep .el-dialog__body {
+  padding: 20px 100px !important;
+}
+
+::v-deep .workDialogVisible .el-dialog__body {
+  padding: 20px 20px !important;
+}
+
+::v-deep .defectDialogVisible .el-dialog__body {
+  padding: 20px 20px !important;
+}
+
+::v-deep .importPickerClass .el-dialog__body {
+  padding: 20px 20px !important;
+}
+
+::v-deep .el-dialog__footer {
+  display: flex;
+  justify-content: flex-end;
 }
 
 ::v-deep .el-table .caret-wrapper {
@@ -1102,57 +1080,25 @@
 }
 
 ::v-deep .cell {
-  display: flex !important;
-  align-items: center !important;
-  justify-content: space-between !important;
-}
-
-::v-deep .el-button--text {
-  color: $main_color;
-  font-size: 14px;
-  cursor: pointer;
-}
-
-.operationClass {
-  height: 23px;
   display: flex;
-  justify-content: space-between;
   align-items: center;
+  justify-content: space-between;
 }
 
-.el-icon-share {
-  color: $main_color;
-  cursor: pointer;
+::v-deep .el-table::before {
+  height: 0;
 }
 
-.el-checkbox.is-bordered.is-checked {
-  border-color: $main_color;
+::v-deep .el-table__body-wrapper {
+  background-color: #f8f8fa;
 }
 
-::v-deep .el-radio__input.is-checked .el-radio__inner {
-  border-color: $main_color;
-  background: $main_color;
+::v-deep .el-table__body .el-table__row.hover-row td {
+  background-color: #eaecef;
 }
 
-::v-deep .el-checkbox__input.is-indeterminate .el-checkbox__inner {
-  border-color: $main_color;
-  background: $main_color;
-}
-
-::v-deep .el-checkbox__input.is-checked + .el-checkbox__label {
-  color: $main_color !important;
-}
-
-::v-deep .el-checkbox.is-bordered + .el-checkbox.is-bordered {
-  margin: 10px 30px 0px 0;
-}
-
-::v-deep .el-radio__input.is-checked + .el-radio__label {
-  color: $main_color;
-}
-
-::v-deep .el-radio.is-bordered + .el-radio.is-bordered {
-  margin: 10px 30px 0px 0;
+::v-deep .el-form--inline .el-form-item__label {
+  color: #a7a7a7;
 }
 
 .body ::v-deep .el-divider {
@@ -1165,24 +1111,14 @@
   margin-bottom: 0;
 }
 
-::v-deep .el-input__inner:focus {
-  border-color: $main_color;
+.userDialogVisible ::v-deep .el-form-item {
+  margin-bottom: 0;
 }
 
-::v-deep .el-select .el-input__inner:focus {
-  border-color: $main_color;
-}
+</style>
+<style>
 
-::v-deep .el-select-dropdown__item.selected {
-  color: $main_color;
+.el-table .custom-row {
+  background: #f8f8fa;
 }
-
-::v-deep .el-checkbox__inner:hover {
-  border-color: $main_color;
-}
-
-::v-deep .el-textarea__inner:focus {
-  border-color: $main_color;
-}
-
 </style>

--
Gitblit v1.9.3