Browse Source

Merge branch 'master' of http://120.26.64.82:3000/BFFE/Foshan4A4.0

chenrui  3 years ago
parent
commit
7988d505cf

+ 33 - 6
src/components/organization/index.vue

@@ -4,7 +4,7 @@
     <div class="left">
       <div class="paren_header">
         <p>{{ title }}</p>
-        <template v-if="doesJobShow">
+        <template>
           <div class="column" v-show="vice">
             <div :class="active == index ? 'column_childs' : 'column_child'" v-for="(item, index) in colType" :key="index" @click="upStart(index)">
               {{ item.name }}
@@ -25,8 +25,20 @@
             </el-tree>
           </el-scrollbar>
         </div>
-        <div class="dptBox" v-if="doesJobShow" v-show="active == 1">
+        <!-- <div class="dptBox" v-if="doesJobShow" v-show="active == 1">
           <Rolelist :type="true" @radioChange="radioChange" :radioCheck="radioCheck" :number="8" :active="true" class="lessData" :mainData="mainData" />
+        </div> -->
+        <div v-show="active == 1" class="dptBox duoBox">
+          <el-scrollbar style="height: 100%">
+            <el-tree :data="data" show-checkbox @check-change="currentChangeDuo" :default-expanded-keys="defaultExpandedKeys" :props="defaultProps" :default-checked-keys="checkedKeysDuo" :node-key="nodekey" ref="treeDuo" highlight-current>
+              <span v-if="orgType == 'org'" slot-scope="{ data }" :title="data.OrganName" class="org-data-tree-node">
+                {{ data.OrganName }}
+              </span>
+              <span v-else slot-scope="{ data }" :title="data.AuthName" class="org-data-tree-node">
+                {{ data.AuthName }}
+              </span>
+            </el-tree>
+          </el-scrollbar>
         </div>
       </div>
     </div>
@@ -61,6 +73,11 @@ export default {
       type: Array,
       default: () => [],
     },
+    checkedKeysDuo: {
+      //已选中
+      type: Array,
+      default: () => [],
+    },
     lessData: {
       //副岗
       type: Array,
@@ -94,10 +111,10 @@ export default {
       active: 0,
       colType: [
         {
-          name: "组织",
+          name: "所属组织",
         },
         {
-          name: "职务",
+          name: "组织授权",
         }
       ],
       checkedDatas: [],
@@ -117,14 +134,20 @@ export default {
       },
       deep: true,
     },
+    checkedKeysDuo: {
+      handler (val) {
+        this.$refs.tree.setCheckedKeys(val)
+      },
+      deep: true,
+    },
     orgList: {
-      handler(val) {
+      handler (val) {
         this.getExpandedKeysStep.splice(1, 1, true)
       },
       deep: true
     },
     getExpandedKeysStep: {
-      handler(val) {
+      handler (val) {
         if (val.every(v => v)) {
           this.defaultExpandedKeys = [-1]
           this.checkedKeys.forEach(key => {
@@ -179,6 +202,10 @@ export default {
         }
       }
     },
+    currentChangeDuo () {
+      const arr = this.$refs.treeDuo.getCheckedNodes()
+      this.$emit("getTreeDataDuo", arr)
+    },
     // 选中后设置初始数据
     setDataObj (arr) {
       arr.forEach((item) => {

+ 16 - 3
src/components/organization/organization.scss

@@ -59,7 +59,7 @@
     > .paren_content {
       width: 100%;
       height: 83%;
-      .dptBox{
+      .dptBox {
         > .el-scrollbar {
           > .el-scrollbar__wrap {
             overflow-x: hidden;
@@ -96,8 +96,21 @@
           border-radius: 0;
         }
       }
-
+      .duoBox {
+        .el-tree {
+          .el-checkbox__inner {
+            border-radius: 2px;
+          }
+          .el-checkbox__inner::after {
+            width: 3px;
+            height: 7px;
+            left: 4px;
+            top: 1px;
+            border-radius: 0;
+            background: #747ebb;
+          }
+        }
       }
-
+    }
   }
 }

+ 2 - 2
src/utils/request.js

@@ -1,8 +1,8 @@
 /*
  * @Author: your name
  * @Date: 2022-01-06 09:45:17
- * @LastEditTime: 2022-03-02 15:03:14
- * @LastEditors: Please set LastEditors
+ * @LastEditTime: 2022-03-16 09:17:41
+ * @LastEditors: your name
  * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  * @FilePath: \vue-admin-template\src\utils\request.js
  */

+ 14 - 2
src/utils/validate.js

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-12-13 09:43:22
- * @LastEditTime: 2022-03-14 18:24:09
+ * @LastEditTime: 2022-03-16 10:57:25
  * @LastEditors: your name
  * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  * @FilePath: \Foshan4A2.0\src\utils\validate.js
@@ -292,10 +292,22 @@ function getRealLength(string) {
 
 export function lengthValidator(rule, value, callback) {
   const realLength = getRealLength(value)
-  if (realLength > rule.max) {
+  if (realLength === 0) {
+    callback()
+  } else if (rule.min && realLength < rule.min) {
+    rule.message += ` ${realLength}/${rule.min}`
+    callback(new Error('长度小于最小值'))
+  } else if (rule.max && realLength > rule.max) {
     rule.message += `  ${realLength}/${rule.max}`
     callback(new Error('长度超出最大值'))
   } else {
     callback()
   }
 }
+
+// 表单验证输入内容验证
+export const regular = {
+  integer: /^[0-9]*$/,
+  name: /^(?!_)(?!.*?_$)[a-zA-Z0-9_\u4e00-\u9fa5]+$/,
+  nameMessage: '只能包含中文、英文、数字和下划线切不能以下划线开头'
+}

+ 61 - 45
src/views/accountGroupManagement/components/accountGroupHome.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2022-01-08 09:27:43
- * @LastEditTime: 2022-03-14 10:50:41
+ * @LastEditTime: 2022-03-16 11:57:19
  * @LastEditors: your name
  * @Description: 用户组管理
  * @FilePath: \Foshan4A2.0\src\views\accountGroupManagement\components\home.vue
@@ -298,7 +298,7 @@
     <!--删除弹框-->
     <Dialog :flag="flag">
       <div class="airportInfoDialog">
-        <div class="title">删除{{ title }}</div>
+        <div class="title">删除{{ accountGroupType }}</div>
         <div class="content">是否确认删除{{ title }}?</div>
         <div class="foot right t30">
           <el-button
@@ -397,41 +397,43 @@ export default {
     async childrenRenderChange(data, index) {
       const { GroupId, flag } = data
       const Status = flag ? 1 : 0
-      try {
-        const res = await ChangeGroupStatus({
-          GroupId: GroupId,
-          Status: Status
-        })
-        if (res.code === 0) {
-          this.$message.success(res.message)
-          this.childrenData[index].Status = Status
-          if (flag) {
-            this.dataArr.find(data => {
-              if (data.GroupId === GroupId) {
-                data.Status = 1
-                data.flag = true
-                return true
-              }
-            })
-          } else {
-            this.dataArr.find(data => {
-              if (data.GroupId === GroupId) {
-                data.Status = 0
-                data.flag = false
-                return true
-              }
-            })
-            this.setChildrenDisabled(GroupId)
-          }
-          // this.getOrganTree();
-        } else {
-          this.$message.error(res.message)
-          this.childrenData[index].flag = !flag
-        }
-      } catch (error) {
-        console.log('出错了', error)
-        this.childrenData[index].flag = !flag
-      }
+      const isChildren = true
+      this.handleChange(GroupId, Status, isChildren, index)
+      // try {
+      //   const res = await ChangeGroupStatus({
+      //     GroupId: GroupId,
+      //     Status: Status
+      //   })
+      //   if (res.code === 0) {
+      //     this.$message.success(res.message)
+      //     this.childrenData[index].Status = Status
+      //     if (flag) {
+      //       this.dataArr.find(data => {
+      //         if (data.GroupId === GroupId) {
+      //           data.Status = 1
+      //           data.flag = true
+      //           return true
+      //         }
+      //       })
+      //     } else {
+      //       this.dataArr.find(data => {
+      //         if (data.GroupId === GroupId) {
+      //           data.Status = 0
+      //           data.flag = false
+      //           return true
+      //         }
+      //       })
+      //       this.setChildrenDisabled(GroupId)
+      //     }
+      //     // this.getOrganTree();
+      //   } else {
+      //     this.$message.error(res.message)
+      //     this.childrenData[index].flag = !flag
+      //   }
+      // } catch (error) {
+      //   console.log('出错了', error)
+      //   this.childrenData[index].flag = !flag
+      // }
     },
     // 删除组织
     remove() {
@@ -475,7 +477,7 @@ export default {
     },
     // -----------获取数据------------
     // 状态变更
-    async handleChange(id, val) {
+    async handleChange(id, val, isChildren = false, index) {
       try {
         const res = await ChangeGroupStatus({
           GroupId: id,
@@ -483,7 +485,11 @@ export default {
         })
         if (res.code === 0) {
           this.$message.success(res.message)
-          this.currDataArr[0].Status = val
+          if (!isChildren) {
+            this.currDataArr[0].Status = val
+          } else {
+            this.childrenData[index].Status = val
+          }
           if (val) {
             this.dataArr.find(data => {
               if (data.GroupId === id) {
@@ -500,19 +506,29 @@ export default {
                 return true
               }
             })
-            this.childrenData.forEach(data => {
-              data.Status = 0
-              data.flag = false
-            })
+            if (!isChildren) {
+              this.childrenData.forEach(data => {
+                data.Status = 0
+                data.flag = false
+              })
+            }
             this.setChildrenDisabled(id)
           }
         } else {
           this.$message.error(res.message)
-          this.currDataArr[0].flag = !val
+          if (!isChildren) {
+            this.currDataArr[0].flag = !val
+          } else {
+            this.childrenData[index].flag = !val
+          }
         }
       } catch (error) {
         console.log('出错了', error)
-        this.currDataArr[0].flag = !val
+        if (!isChildren) {
+            this.currDataArr[0].flag = !val
+          } else {
+            this.childrenData[index].flag = !val
+          }
       }
     },
     // 删除

+ 43 - 59
src/views/authorityManagement/components/authorityHome.vue

@@ -1,8 +1,8 @@
 <!--
  * @Author: your name
  * @Date: 2021-11-29 09:27:43
- * @LastEditTime: 2022-03-01 10:30:44
- * @LastEditors: Please set LastEditors
+ * @LastEditTime: 2022-03-16 12:01:30
+ * @LastEditors: your name
  * @Description: 权限管理
  * @FilePath: \Foshan4A2.0\src\views\authorityManagement\components\home.vue
 -->
@@ -119,7 +119,7 @@
                           <div v-if="data.Type > 0" class="flex details">
                             <div class="details-msg">状态:<span :class="data.Status === 1 ? 'success' : 'error'">{{data.Status === 1 ? '启用' : '禁用'}}</span></div>
                             <div v-is="['authtree_btn_state_swatch']" class="details-info">
-                              <el-switch v-model="data.flag" @click.stop.native @change="renderChange(data,index)" active-color="#6F81BC">
+                              <el-switch v-model="data.flag" @click.stop.native @change="childrenRenderChange(data,index)" active-color="#6F81BC">
                               </el-switch>
                             </div>
                           </div>
@@ -148,7 +148,7 @@
     <!--删除弹框-->
     <Dialog :flag="flag">
       <div class="airportInfoDialog">
-        <div class="title">删除{{ title }}</div>
+        <div class="title">删除{{ type === 1 ? '应用' : '权限' }}</div>
         <div class="content">是否确认删除{{ title }}?</div>
         <div class="foot right t30">
           <el-button size="medium" class="r24" @click="remove" type="danger">删除</el-button>
@@ -228,26 +228,10 @@ export default {
     },
     //下级关闭
     childrenRenderChange (data, index) {
-      try {
-        const { OrganId, flag } = data;
-        const Status = flag ? 1 : 0;
-        tissueTreeStart({
-          OrganId: OrganId,
-          Status: Status,
-        }).then((res) => {
-          if (res.code === 0) {
-            this.$message.success(res.message);
-            this.childrenData[index].Status = Status;
-            // this.getOrganTree();
-          } else {
-            this.$message.error(res.message);
-            this.childrenData[index].flag = !flag;
-          }
-        });
-      } catch (error) {
-        console.log("出错了", error);
-        this.childrenData[index].flag = !flag;
-      }
+      const { AuthId, flag, Type } = data
+      const Status = flag ? 1 : 0
+      const isChildren = true
+      this.handleChange(AuthId, Status, Type, index, isChildren)
     },
     filterNode (value, data) {
       if (!value) return true;
@@ -311,40 +295,40 @@ export default {
       return arr
     },
     //渲染节点
-    renderContent (h, data) {
-      return (
-        <div class="account-left-content-teams">
-          <div class="team">
-            <div class={[data.Type <= 1 ? 'status1' : 'status2', 'bg']}></div>
-            <div class={[data.QueryTarget == 1 ? 'activeStatus' : '', 'list']}>
-              <div class="flex info">
-                <div class="name">{data.AuthName}</div>
-                <div class="icon">
-                  <span v-show={data.Type === 0} onClick={() => this.renderAdd()} class="cap cap-plus"></span>
-                  <span v-show={data.Type === 1} onClick={() => this.renderEdit(data)} class="cap cap-edit"></span>
-                  <span v-show={data.Type === 2} onClick={() => this.renderSub(data)} class="cap cap-sub"></span>
-                  <span v-show={data.Type > 2} onClick={() => this.renderEdit(data)} class="cap cap-edit"></span>
-                  <span v-show={data.Type > 2} onClick={() => this.renderSub(data)} class="cap cap-sub"></span>
-                </div>
-              </div>
-              <div v-show={data.Type > 0} class="flex details">
-                <div class="details-msg">状态:<span class={[data.Status === 1 ? 'success' : 'error']}>{data.Status === 1 ? '启用' : '禁用'}</span></div>
-                <div class="details-info">
-                  <el-switch v-model={data.flag} onChange={() => this.renderChange(data)} active-color="#6F81BC">
-                  </el-switch>
-                </div>
-              </div>
-            </div>
-          </div>
-          <div v-show={data.Type !== 0 && data.Type !== 2} onClick={() => this.onNodeClick(data)} class="info-close">
-            <i class={[data.Type === 1 ? 'close1' : data.Type > 2 ? 'close2' : '', 'icon', 'el-icon-close']}></i>
-          </div>
-        </div>
-      )
-    },
+    // renderContent (h, data) {
+    //   return (
+    //     <div class="account-left-content-teams">
+    //       <div class="team">
+    //         <div class={[data.Type <= 1 ? 'status1' : 'status2', 'bg']}></div>
+    //         <div class={[data.QueryTarget == 1 ? 'activeStatus' : '', 'list']}>
+    //           <div class="flex info">
+    //             <div class="name">{data.AuthName}</div>
+    //             <div class="icon">
+    //               <span v-show={data.Type === 0} onClick={() => this.renderAdd()} class="cap cap-plus"></span>
+    //               <span v-show={data.Type === 1} onClick={() => this.renderEdit(data)} class="cap cap-edit"></span>
+    //               <span v-show={data.Type === 2} onClick={() => this.renderSub(data)} class="cap cap-sub"></span>
+    //               <span v-show={data.Type > 2} onClick={() => this.renderEdit(data)} class="cap cap-edit"></span>
+    //               <span v-show={data.Type > 2} onClick={() => this.renderSub(data)} class="cap cap-sub"></span>
+    //             </div>
+    //           </div>
+    //           <div v-show={data.Type > 0} class="flex details">
+    //             <div class="details-msg">状态:<span class={[data.Status === 1 ? 'success' : 'error']}>{data.Status === 1 ? '启用' : '禁用'}</span></div>
+    //             <div class="details-info">
+    //               <el-switch v-model={data.flag} onChange={() => this.renderChange(data)} active-color="#6F81BC">
+    //               </el-switch>
+    //             </div>
+    //           </div>
+    //         </div>
+    //       </div>
+    //       <div v-show={data.Type !== 0 && data.Type !== 2} onClick={() => this.onNodeClick(data)} class="info-close">
+    //         <i class={[data.Type === 1 ? 'close1' : data.Type > 2 ? 'close2' : '', 'icon', 'el-icon-close']}></i>
+    //       </div>
+    //     </div>
+    //   )
+    // },
     //-----------获取数据------------
     //应用状态变更
-    async handleChange (id, val, type, index) {
+    async handleChange (id, val, type, index, isChildren = false) {
       try {
         let res = null
         if (type === 1) {
@@ -360,7 +344,7 @@ export default {
         }
         if (res.code === 0) {
           this.$message.success(res.message)
-          if (type === 1) {
+          if (!isChildren) {
             this.currDataArr[0].Status = val
           } else {
             this.childrenData[index].Status = val
@@ -368,7 +352,7 @@ export default {
           //this.getAuthTree()
         } else {
           this.$message.error(res.message)
-          if (type === 1) {
+          if (!isChildren) {
             this.currDataArr[0].flag = !flag;
           } else {
             this.childrenData[index].flag = !flag;
@@ -376,7 +360,7 @@ export default {
         }
       } catch (error) {
         console.log('出错了', error)
-        if (type === 1) {
+        if (!isChildren) {
           this.currDataArr[0].flag = !flag;
         } else {
           this.childrenData[index].flag = !flag;

+ 2 - 2
src/views/organizationManagement/components/organizationHome.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2021-11-29 09:27:43
- * @LastEditTime: 2022-03-14 11:04:03
+ * @LastEditTime: 2022-03-16 12:02:46
  * @LastEditors: your name
  * @Description: 权限管理
  * @FilePath: \Foshan4A2.0\src\views\authorityManagement\components\home.vue
@@ -187,7 +187,7 @@
     <!--删除弹框-->
     <Dialog :flag="flag">
       <div class="airportInfoDialog">
-        <div class="title">删除{{ title }}</div>
+        <div class="title">删除组织</div>
         <div class="content">是否确认删除{{ title }}?</div>
         <div class="foot right t30">
           <el-button size="medium" class="r24" @click="remove" type="danger">删除</el-button>

+ 34 - 16
src/views/staffManagement/compontents/staffAdd.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2022-02-10 14:49:20
- * @LastEditTime: 2022-03-14 10:58:17
+ * @LastEditTime: 2022-03-16 10:57:58
  * @LastEditors: your name
  * @Description: 编辑职员
  * @FilePath: \Foshan4A4.0\src\views\staffManagement\compontents\staffEdit.vue
@@ -19,29 +19,29 @@
       <div class="addApp-form-content dialog-public-background">
         <el-form :inline="true" ref="form" :rules="rules" class="form" :model="form">
           <el-form-item prop="name" label="职员名称">
-            <el-input placeholder="请输入职员名称" v-model="form.name"></el-input>
+            <el-input placeholder="请输入职员名称" v-model.trim="form.name"></el-input>
           </el-form-item>
           <el-form-item prop="loginName" label="职员登录名">
-            <el-input placeholder="请输入职员登录名" maxlength="32" v-model="form.loginName"></el-input>
+            <el-input placeholder="请输入职员登录名" v-model.trim="form.loginName"></el-input>
           </el-form-item>
-          <el-form-item label="职员手机号">
-            <el-input placeholder="请输入职员手机号" maxlength="11" v-model="form.phone"></el-input>
+          <el-form-item prop="phone" label="职员手机号">
+            <el-input placeholder="请输入职员手机号" v-model.trim="form.phone"></el-input>
           </el-form-item>
-          <el-form-item style="margin-right: 16px" label="登录密码">
-            <el-input placeholder="*******" disabled maxlength="32" v-model="form.loginPwd"></el-input>
+          <el-form-item prop="loginPwd" style="margin-right: 16px" label="登录密码">
+            <el-input placeholder="*******" disabled v-model="form.loginPwd"></el-input>
           </el-form-item>
           <el-form-item v-is="['officer_btn_resetpwd']">
-            <el-button size="small" type="primary" @click="reSetPassWord">重置密码</el-button>
+            <el-button size="small" type="primary" @click="reSetPassWord">{{ doesPwdExist ? '重置' : '生成' }}密码</el-button>
           </el-form-item>
-          <el-form-item label="描述">
-            <el-input class="lastInput" maxlength="200" placeholder="请输入描述" v-model="form.app"></el-input>
+          <el-form-item prop="app" label="描述">
+            <el-input class="lastInput" placeholder="请输入描述" v-model.trim="form.app"></el-input>
           </el-form-item>
         </el-form>
       </div>
     </div>
     <div class="power-content flex-wrap">
       <div class="r24 flex1 part">
-        <Organization ref="Organization" :defaultProps="defaultProps" :mainData="mainData" :vice="true" :data="data" @getTreeData="getOrgan" @radioChange="radioChange" :checkedKeys="orgCheckedKeys" :radioCheck="radioNum" nodekey="OrganId" title="选择组织" />
+        <Organization ref="Organization" :defaultProps="defaultProps" :vice="true" :data="data" @getTreeData="getOrgan" @getTreeDataDuo="getTreeDataDuo" :checkedKeys="orgCheckedKeys" nodekey="OrganId" title="选择组织" />
       </div>
       <!--开启多对多-->
       <template v-if="OpenAuthData">
@@ -118,7 +118,7 @@ import {
   organgitpost,
 } from "@/api/postInterface";
 import { pwdProduce } from "@/utils/validate";
-import { lengthValidator } from '@/utils/validate';
+import { lengthValidator, regular } from '@/utils/validate';
 export default {
   name: "AuthorityPower",
   mixins: [treeData],
@@ -148,12 +148,23 @@ export default {
         //表单验证
         name: [
           { required: true, message: "请输入职员名称", trigger: "blur" },
-          { validator: lengthValidator, max: 32, message: '最多输入32个字符', trigger: ['change', 'blur'] }],
+          { pattern: regular.name, message: regular.nameMessage, trigger: ['change', 'blur'] },
+          { validator: lengthValidator, max: 32, message: '最多输入32个字符', trigger: ['change', 'blur'] }
+        ],
         loginName: [
           { required: true, message: "请输入职员登录名", trigger: "blur" },
+          { pattern: regular.name, message: regular.nameMessage, trigger: ['change', 'blur'] },
+          { validator: lengthValidator, max: 32, message: '最多输入32个字符', trigger: ['change', 'blur'] },
+        ],
+        phone: [
+          { pattern: regular.integer, message: '请输入纯数字', trigger: ['blur', 'change'] },
+          { validator: lengthValidator, min: 11, max: 11, message: '请输入11位电话号码', trigger: ['change', 'blur'] }
+        ],
+        app: [
+          { validator: lengthValidator, max: 128, message: '最多输入128个字符', trigger: ['change', 'blur'] },
         ],
         loginPwd: [
-          { required: true, message: "请输入职员登录密码", trigger: "blur" },
+          { required: true, message: "请生成职员登录密码" }
         ],
       },
       defaultProps: {
@@ -203,7 +214,8 @@ export default {
       onCheckedArr: [],//当前显示选中权限组
       alljobArr: [],//全部岗位
       GroupIds: [], //当前选中的用户组
-      userGroupKeys: [] //当前回调选中的用户组
+      userGroupKeys: [], //当前回调选中的用户组
+      doesPwdExist: false
     };
   },
   computed: {
@@ -270,12 +282,16 @@ export default {
     getTreeData (arr) {
       this.checkTrees = arr;
     },
-    //获取组织选中的数据
+    //获取组织选中的数据-单选
     getOrgan (arr) {
       const { OrganId } = arr[0];
       this.AppId = OrganId;
       this.getJobListByOrgan(OrganId);
     },
+    //获取组织选中的数据-多选
+    getTreeDataDuo (arr) {
+      this.lessData = arr;
+    },
     //获取指定数据
     decompose (data, id) {
       for (let i = 0; i < data.length; i++) {
@@ -424,6 +440,7 @@ export default {
           DepJobList: this.lessChecksData,
           GroupList: GroupIds.length ? GroupIds : [],
           JobId: this.JobId,
+          DepJobList: this.lessData,
           Status: 1,
           OrganId: this.AppId,
           OfficerId: this.OfficerId,
@@ -441,6 +458,7 @@ export default {
       }
     },
     reSetPassWord () {
+      !this.doesPwdExist && (this.doesPwdExist = true)
       const { PwdLengthBegin, PwdLengthEnd, PwdStruc } =
         typeof this.systemSet === "string"
           ? JSON.parse(this.systemSet)

+ 36 - 16
src/views/staffManagement/compontents/staffEdit.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2022-02-10 14:49:20
- * @LastEditTime: 2022-03-14 15:54:27
+ * @LastEditTime: 2022-03-16 11:04:46
  * @LastEditors: your name
  * @Description: 编辑职员
  * @FilePath: \Foshan4A4.0\src\views\staffManagement\compontents\staffEdit.vue
@@ -19,29 +19,29 @@
       <div class="addApp-form-content dialog-public-background">
         <el-form :inline="true" ref="form" :rules="rules" class="form" :model="form">
           <el-form-item prop="name" label="职员名称">
-            <el-input placeholder="请输入职员名称" v-model="form.name"></el-input>
+            <el-input placeholder="请输入职员名称" v-model.trim="form.name"></el-input>
           </el-form-item>
           <el-form-item prop="loginName" label="职员登录名">
-            <el-input placeholder="请输入职员登录名" maxlength="32" v-model="form.loginName"></el-input>
+            <el-input placeholder="请输入职员登录名" v-model.trim="form.loginName"></el-input>
           </el-form-item>
-          <el-form-item label="职员手机号">
-            <el-input placeholder="请输入职员手机号" maxlength="11" v-model="form.phone"></el-input>
+          <el-form-item prop="phone" label="职员手机号">
+            <el-input placeholder="请输入职员手机号" v-model.trim="form.phone"></el-input>
           </el-form-item>
-          <el-form-item style="margin-right: 16px" label="登录密码">
-            <el-input placeholder="*******" disabled maxlength="32" v-model="form.loginPwd"></el-input>
+          <el-form-item prop="loginPwd" style="margin-right: 16px" label="登录密码">
+            <el-input placeholder="*******" disabled v-model="form.loginPwd"></el-input>
           </el-form-item>
           <el-form-item v-is="['officer_btn_resetpwd']">
             <el-button size="small" type="primary" @click="reSetPassWord">重置密码</el-button>
           </el-form-item>
-          <el-form-item label="描述">
-            <el-input class="lastInput" maxlength="200" placeholder="请输入描述" v-model="form.app"></el-input>
+          <el-form-item prop="app" label="描述">
+            <el-input class="lastInput" placeholder="请输入描述" v-model.trim="form.app"></el-input>
           </el-form-item>
         </el-form>
       </div>
     </div>
     <div class="power-content flex-wrap">
       <div class="r24 flex1 part">
-        <Organization ref="Organization" :defaultProps="defaultProps" :mainData="mainData" :vice="true" :data="data" @getTreeData="getOrgan" @radioChange="radioChange" :checkedKeys="orgCheckedKeys" :orgList="orgList" :radioCheck="radioNum" nodekey="OrganId" title="选择组织" />
+        <Organization ref="Organization" :defaultProps="defaultProps" :vice="true" :data="data" @getTreeData="getOrgan" @radioChange="radioChange" :checkedKeys="orgCheckedKeys" :checkedKeysDuo="checkedKeysDuo" @getTreeDataDuo="getTreeDataDuo" :orgList="orgList" nodekey="OrganId" title="选择组织" />
       </div>
       <!--开启多对多-->
       <template v-if="OpenAuthData">
@@ -121,7 +121,7 @@ import {
   Staffdetails,
 } from "@/api/postInterface";
 import { pwdProduce } from "@/utils/validate";
-import { lengthValidator } from '@/utils/validate';
+import { lengthValidator, regular } from '@/utils/validate';
 export default {
   name: "AuthorityPower",
   mixins: [treeData],
@@ -151,12 +151,20 @@ export default {
         //表单验证
         name: [
           { required: true, message: "请输入职员名称", trigger: "blur" },
-          { validator: lengthValidator, max: 32, message: '最多输入32个字符', trigger: ['change', 'blur'] }],
+          { pattern: regular.name, message: regular.nameMessage, trigger: ['change', 'blur'] },
+          { validator: lengthValidator, max: 32, message: '最多输入32个字符', trigger: ['change', 'blur'] }
+        ],
         loginName: [
           { required: true, message: "请输入职员登录名", trigger: "blur" },
+          { pattern: regular.name, message: regular.nameMessage, trigger: ['change', 'blur'] },
+          { validator: lengthValidator, max: 32, message: '最多输入32个字符', trigger: ['change', 'blur'] },
+        ],
+        phone: [
+          { pattern: regular.integer, message: '请输入纯数字', trigger: ['blur', 'change'] },
+          { validator: lengthValidator, min: 11, max: 11, message: '请输入11位电话号码', trigger: ['change', 'blur'] }
         ],
-        loginPwd: [
-          { required: true, message: "请输入职员登录密码", trigger: "blur" },
+        app: [
+          { validator: lengthValidator, max: 128, message: '最多输入128个字符', trigger: ['change', 'blur'] },
         ],
       },
       defaultProps: {
@@ -167,6 +175,7 @@ export default {
       checkedKeys: [], //上级组织选中
       RoleList: [],
       checkedBoxs: [],
+      checkedKeysDuo: [],
       arrs: [],
       authArrs: [],//
       OfficerId: null,
@@ -274,7 +283,7 @@ export default {
             RoleList,
             TacList,
             GroupList,
-            UserList
+            UserList,
           } = obj;
           this.form.name = OfficerName;
           this.form.loginName = OfficerLoginName;
@@ -285,7 +294,6 @@ export default {
           this.roleDatas = RoleList;
           this.radioCheck = JobId;
           this.JobId = JobId;
-          this.lessChecksData = DepJobList;
           this.isMainJob = false;
           this.AppId = OrganId;
           this.getJobListByOrgan(OrganId);
@@ -325,6 +333,13 @@ export default {
             })
             this.checkBoxList = datas;
           }
+          if (DepJobList && DepJobList.length) {
+            const datas = [];
+            DepJobList.forEach(item => {
+              datas.push(item.organId);
+            })
+            this.checkedKeysDuo = datas;
+          }
           this.checkedList = TacList;
           this.loginCheckBoxs = TacList;
         } else {
@@ -373,6 +388,10 @@ export default {
       this.AppId = OrganId;
       this.getJobListByOrgan(OrganId);
     },
+    //获取组织选中的数据-多选
+    getTreeDataDuo (arr) {
+      this.lessData = arr;
+    },
     //获取指定数据
     decompose (data, id) {
       for (let i = 0; i < data.length; i++) {
@@ -558,6 +577,7 @@ export default {
           GroupList: GroupIds.length ? GroupIds : [],
           JobId: this.JobId,
           Status: Number(this.Status),
+          DepJobList: this.lessData,
           OrganId: this.AppId,
           OfficerId: this.OfficerId,
           UserList: this.OpenAuthData ? this.checkBoxList : []