src/views/system/modules/UserModal.vue
@@ -58,13 +58,21 @@
        </a-form-model-item>
        <!--部门分配-->
        <a-form-model-item label="部门分配" :labelCol="labelCol" :wrapperCol="wrapperCol" v-show="!departDisabled">
        <a-form-model-item v-if="isDepartType== 0" label="部门分配" :labelCol="labelCol" :wrapperCol="wrapperCol" v-show="!departDisabled">
          <j-select-depart v-model="model.selecteddeparts" :multi="true" @back="backDepartInfo" :backDepart="true" :treeOpera="true">></j-select-depart>
        </a-form-model-item>
        <!--车间分配-->
        <a-form-model-item label="车间分配" :labelCol="labelCol" :wrapperCol="wrapperCol" v-show="!productionDisabled">
          <j-select-production  v-model="model.selectedProduction" :multi="true" @back="backProductionInfo" :backProduction="true" :treeProductOpera="true"></j-select-production>
        </a-form-model-item>
        <a-form-model-item label="班组分配" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="teamId">
          <j-dict-select-tag
          v-model="model.teamId"
          :triggerChange="true"
          dictCode="mom_base_team,name,id,del_flag = 0"
          placeholder="请维护班组"
          ></j-dict-select-tag>
        </a-form-model-item>
        <a-form-model-item label="负责部门" :labelCol="labelCol" :wrapperCol="wrapperCol"  v-if="departIdShow==true">
@@ -134,6 +142,8 @@
  import { disabledAuthFilter } from "@/utils/authFilter"
  import { duplicateCheck } from '@/api/api'
  import JSelectProduction from '../../../components/jeecgbiz/JSelectProduction'
  import {mapActions} from 'vuex'
  import { ajaxGetDictItems, getDictItemsFromCache } from '@/api/api'
  export default {
    name: "UserModal",
@@ -165,7 +175,9 @@
          roles:{},
          workNo:[ { required: true, message: '请输入工号' },
                  { validator: this.validateWorkNo }],
          telephone: [{ pattern: /^0\d{2,3}-[1-9]\d{6,7}$/, message: '请输入正确的座机号码' },]
          telephone: [{ pattern: /^0\d{2,3}-[1-9]\d{6,7}$/, message: '请输入正确的座机号码' },],
          teamId:[ { required: true, message: '请维护班组' }]
        },
        departIdShow:false,
        title:"操作",
@@ -194,7 +206,16 @@
        tenantsOptions: [],
        rolesOptions:[],
        nextDepartOptions:[],
        nextProductionOptions:[]
        nextProductionOptions:[],
        isDepartType:'',
      }
    },
    watch:{
      visible:{
        handler(value){
          if(value) this.initDictData('password_length')
        }
      }
    },
    created () {
@@ -202,6 +223,7 @@
      this.headers = {"X-Access-Token":token}
      this.initRoleList()
      this.initTenantList()
      this.queryTreeData()
    },
    computed:{
      uploadAction:function () {
@@ -209,6 +231,21 @@
      }
    },
    methods: {
      ...mapActions(['QueryDepartTree']),
      queryTreeData() {
        this.QueryDepartTree().then(res => {
          if (res.success) {
            this.isDepartType = res.result[0].value
          } else {
            // this.$message.warn(res.message)
            this.$notification.warning({
              message:'消息',
              description:res.message
            });
          }
        }).finally(() =>{
        })
      },
      add () {
        this.refresh();
        this.edit({activitiSync:'1',userIdentity:1});
@@ -219,9 +256,9 @@
        //根据屏幕宽度自适应抽屉宽度
        this.resetScreenSize();
        that.userId = record.id;
        that.model = Object.assign({},{selectedroles:'',selecteddeparts:''}, record);
        that.model = Object.assign({},{selectedroles:'',selectedProduction:''}, record);
        //身份为上级显示负责部门,否则不显示
        if(this.model.userIdentity==2){
          this.departIdShow=true;
@@ -233,7 +270,7 @@
          that.getUserRoles(record.id);
          that.getUserDeparts(record.id);
        }
        console.log('that.model=',that.model)
        console.log('that.model',that.model)
      },
      isDisabledAuth(code){
        return disabledAuthFilter(code);
@@ -347,8 +384,6 @@
          return c;
        })
      },
      refresh () {
        this.userId=""
@@ -514,7 +549,22 @@
        }else{
            this.departIdShow=true;
        }
      }
      },
      initDictData(dictCode) {
        //根据字典Code, 初始化字典数组
        ajaxGetDictItems(dictCode, null).then((res) => {
          if (res.success) {
            const regExp = new RegExp("^(?=.*[a-zA-Z])(?=.*\\\d)(?=.*[~!@#$%^&*()_+`\\-={}:\";'<>?,./]).{"+Number(res.result[0].value)+",}$");
            this.validatorRules.password[0]={
              required:true,
              pattern: regExp,
              message: `密码由${res.result[0].value}位数字、大小写字母和特殊符号组成!`,
            }
          }
        })
      },
    }
  }
</script>