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/jcsz/yhqd.vue |   70 +++++++++++++++++++---------------
 1 files changed, 39 insertions(+), 31 deletions(-)

diff --git a/src/views/jcsz/yhqd.vue b/src/views/jcsz/yhqd.vue
index 89eb180..e23f23f 100644
--- a/src/views/jcsz/yhqd.vue
+++ b/src/views/jcsz/yhqd.vue
@@ -1,10 +1,14 @@
 <template>
   <div>
     <div class="body" :style="{height:mainHeight+'px'}">
-      <div class="bodyTopButtonGroup">
+      <div class="bodyTopButtonGroup" style="justify-content: space-between">
+
         <el-button type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">鏂板</el-button>
-        <el-button icon="el-icon-menu" @click="workingTramClick">鐢熶骇鐝粍</el-button>
-        <el-button icon="el-icon-download" @click="upload">瀵煎叆</el-button>
+
+        <div style="display: flex">
+          <el-button icon="el-icon-menu" @click="workingTramClick">鐢熶骇鐝粍</el-button>
+          <el-button icon="el-icon-download" @click="upload">瀵煎叆</el-button>
+        </div>
       </div>
 
       <div class="bodyTopFormGroup">
@@ -119,13 +123,23 @@
             label="鎵�灞炵粍缁�"
             min-width="110"
             sortable="custom"
-          />
+          >
+            <template slot-scope="{row}">
+              <div v-if="row.org_name">{{ row.org_name }}</div>
+              <div v-else>/</div>
+            </template>
+          </el-table-column>
           <el-table-column
             prop="group_name"
             label="鐢熶骇鐝粍"
             min-width="110"
             sortable="custom"
-          />
+          >
+            <template slot-scope="{row}">
+              <div v-if="row.group_name">{{ row.group_name }}</div>
+              <div v-else>/</div>
+            </template>
+          </el-table-column>
           <el-table-column
             prop="wagetype"
             label="宸ヨ祫绫诲瀷"
@@ -223,7 +237,6 @@
       </div>
       <!--鍒嗛〉-->
       <pagination
-        v-show="total>0"
         :total="total"
         :page.sync="form.page"
         :limit.sync="form.rows"
@@ -445,7 +458,7 @@
           sortable="custom"
         >
           <template slot-scope="{row}">
-            <el-input v-if="row.isVisible===1" v-model="row.group_code" placeholder="璇疯緭鍏�" />
+            <el-input v-if="row.isVisible===1" v-model="row.group_code" oninput="value=value.replace(/[^0-9a-zA-Z]/g,'')" placeholder="璇疯緭鍏�" />
             <div v-else> {{ row.group_code }}</div>
           </template>
         </el-table-column>
@@ -481,7 +494,6 @@
       </el-table>
       <!--鍒嗛〉-->
       <pagination
-        v-show="workingTableDataLength>0"
         :total="workingTableDataLength"
         :page.sync="formWorking.page"
         :limit.sync="formWorking.rows"
@@ -522,27 +534,15 @@
 } from '@/api/jcsz'
 import { getCookie } from '@/utils/auth'
 import $ from 'jquery'
-import clearAllChildren from '@/utils/global'
+import clearAllChildren, { validateCode } from '@/utils/global'
 import { MesOrderStepReportSelectUserGroup } from '@/api/scgl'
 
-const SER_HZ = /^[\u4e00-\u9fa5]+$/
 export default {
   name: 'YYQD',
   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 validateMobile = (rule, value, callback) => {
       if (!value) {
         callback()
@@ -572,7 +572,6 @@
         }
       }
     }
-
     return {
       isIpad: false,
       mainHeight: 0,
@@ -607,7 +606,7 @@
         id: '',
         UserCode: '',
         UserName: '',
-        Password: '',
+        Password: '123456',
         Enable: 'Y',
         StuOrg: '',
         Mobile: '',
@@ -615,7 +614,7 @@
         groupcode: '',
         Operator: '',
         OperType: '',
-        wagetype: ''
+        wagetype: '2'
       },
       usergroupArr: [], // 鐢熶骇鐝粍鏁扮粍
       wagetypeArr: [
@@ -625,7 +624,7 @@
       operation: '',
       dialogFormRules: {
         UserCode: [
-          { required: true, validator: validateName, trigger: ['blur', 'change'] }
+          { required: true, validator: validateCode, trigger: ['blur', 'change'] }
         ],
         UserName: [
           { required: true, message: '璇疯緭鍏ョ敤鎴峰悕绉�', trigger: ['blur', 'change'] }
@@ -810,6 +809,9 @@
         DeleteUser({ Userid: id }).then(res => {
           if (res.code === '200') {
             this.$message.success('鍒犻櫎鎴愬姛!')
+            if (this.form.page > 1 && this.tableData.length === 1) {
+              this.form.page--
+            }
             this.getUserSearch()
           }
         })
@@ -822,14 +824,14 @@
       this.dialogForm.UserCode = ''
       this.dialogForm.UserCode = ''
       this.dialogForm.UserName = ''
-      this.dialogForm.Password = ''
+      this.dialogForm.Password = '123456'
       this.dialogForm.Enable = 'Y'
       this.$refs.dialogCascader.checkedValue = ''
       this.dialogForm.StuOrg = ''
       this.dialogForm.Mobile = ''
       this.dialogForm.Email = ''
       this.dialogForm.groupcode = ''
-      this.dialogForm.wagetype = ''
+      this.dialogForm.wagetype = '2'
       this.$refs.dialogForm.clearValidate()
     },
     // 瀵硅瘽妗嗗彇娑�
@@ -888,10 +890,10 @@
       this.dialogFormRoles.username = row.username
       this.dialogFormRoles.usercode = row.usercode
       const { data: res } = await UserAssociationRole({ usercode: row.usercode })
-      this.rolesAll = res
+      this.rolesAll = res.filter(item => item.children.length !== 0)
 
       const nodeKey = []// 鏍戝舰鍥炴樉key
-      res.forEach((item, index) => {
+      this.rolesAll.forEach((item, index) => {
         this.dialogFormRoles.rolesArr.push({
           code: item.code,
           name: item.name,
@@ -918,8 +920,6 @@
           }
         }
       })
-      console.log(this.dialogFormRoles.roleTreeSelectedArr, 11)
-      console.log(this.dialogFormRoles.rolesArr, 888)
 
       this.dialogFormRoles.rolesArr[0].isSelected1 = true// 榛樿閫変腑绗竴涓�
       // this.dialogFormRoles.rolesArr[0].name = '鍏ㄩ儴'
@@ -1222,6 +1222,9 @@
         UserGroupDelete({ UserGrupCode: row.group_code }).then(res => {
           if (res.code === '200') {
             this.$message.success('鍒犻櫎鎴愬姛!')
+            if (this.formWorking.page > 1 && this.workingTableData.length === 1) {
+              this.formWorking.page--
+            }
             this.getUserGroupSearch()
           }
         })
@@ -1342,6 +1345,11 @@
 <!--鍏叡椤甸潰鏍峰紡-->
 <style lang="scss" scoped>
 $main_color: #42b983;
+
+::v-deep .el-button--text{
+  font-size: 14px ;
+  cursor: pointer ;
+}
 .el-icon-share ,.el-icon-delete,.el-icon-edit-outline{
   color: $main_color;
   cursor: pointer;

--
Gitblit v1.9.3