Lius
2025-07-28 fdc04183eb4e61e3dfb03ab9ec626317374054d3
update
已修改3个文件
207 ■■■■■ 文件已修改
src/views/system/UserList.vue 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/modules/SelectDeviceModal.vue 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/modules/UserModal.vue 139 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/UserList.vue
@@ -14,30 +14,6 @@
          </a-col>
          <a-col :md="6" :sm="8">
            <a-form-item label="性别">
              <a-select v-model="queryParam.sex" placeholder="请选择性别">
                <a-select-option value="">请选择</a-select-option>
                <a-select-option value="1">男</a-select-option>
                <a-select-option value="2">女</a-select-option>
              </a-select>
            </a-form-item>
          </a-col>
          <template v-if="toggleSearchStatus">
            <a-col :md="6" :sm="8">
              <a-form-item label="真实名字">
                <a-input placeholder="请输入真实名字" v-model="queryParam.realname"></a-input>
              </a-form-item>
            </a-col>
            <a-col :md="6" :sm="8">
              <a-form-item label="手机号码">
                <a-input placeholder="请输入手机号码查询" v-model="queryParam.phone"></a-input>
              </a-form-item>
            </a-col>
            <a-col :md="6" :sm="8">
              <a-form-item label="用户状态">
                <a-select v-model="queryParam.status" placeholder="请选择">
                  <a-select-option value="">请选择</a-select-option>
@@ -46,16 +22,11 @@
                </a-select>
              </a-form-item>
            </a-col>
          </template>
          <a-col :md="6" :sm="8">
            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
              <a @click="handleToggleSearch" style="margin-left: 8px">
                {{ toggleSearchStatus ? '收起' : '展开' }}
                <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
              </a>
            </span>
          </a-col>
@@ -259,6 +230,12 @@
          //   width: 100,
          //   dataIndex: 'phone'
          // },
        // {
        //   title: '岗位',
        //   align: "center",
        //   width: 80,
        //   dataIndex: 'post_dictText'
        // },
          {
            title: '部门',
            align: "center",
@@ -278,6 +255,7 @@
            width: 80,
            dataIndex: 'status_dictText'
          },
          {
            title: '操作',
            dataIndex: 'action',
@@ -361,6 +339,12 @@
                //   dataIndex: 'phone'
                // },
                {
                title: '岗位',
                align: "center",
                width: 80,
                dataIndex: 'post_dictText'
              },
              {
                  title: '车间',
                  align: "center",
                  width: 240,
@@ -426,6 +410,12 @@
                //   dataIndex: 'phone'
                // },
                {
                title: '岗位',
                align: "center",
                width: 80,
                dataIndex: 'post_dictText'
              },
              {
                  title: '部门',
                  align: "center",
                  width: 240,
src/views/system/modules/SelectDeviceModal.vue
@@ -95,11 +95,11 @@
        visible: false,
        dataSource: [],
        //系统是否实施设备管理模块
        eamModuleFlag: true,
        eamModuleFlag: false,
      }
    },
    created() {
      this.loadEamSystemConfigValue();
      // this.loadEamSystemConfigValue();
      this.closeAll()
    },
    methods: {
@@ -190,14 +190,14 @@
        this.$emit('selectFinished', this.deviceNodes)
        this.visible = false
      },
      loadEamSystemConfigValue() {
        let params = {settingKey: 'has_eam_module'};
        getSystemConfigValue(params).then(res => {
          if (res.success) {
            this.eamModuleFlag = res.result.settingValue === '1'
          }
        })
      },
      // loadEamSystemConfigValue() {
      //   let params = {settingKey: 'has_eam_module'};
      //   getSystemConfigValue(params).then(res => {
      //     if (res.success) {
      //       this.eamModuleFlag = res.result.settingValue === '1'
      //     }
      //   })
      // },
    }
  }
src/views/system/modules/UserModal.vue
@@ -97,9 +97,10 @@
          />
        </a-form-model-item>
        <!--<a-form-model-item label="职务" :labelCol="labelCol" :wrapperCol="wrapperCol">-->
        <!--<j-select-position placeholder="请选择职务" :multiple="false" v-model="model.post"/>-->
        <!--</a-form-model-item>-->
        <a-form-model-item label="岗位" :labelCol="labelCol" :wrapperCol="wrapperCol">
          <!--          <j-select-position placeholder="请选择岗位" :multiple="false" v-model="model.post"/>-->
          <j-dict-select-tag placeholder="请选择岗位" dict-code="sys_position, name, code" v-model="model.post" />
        </a-form-model-item>
        <a-form-model-item
          label="角色分配"
@@ -139,22 +140,6 @@
          label="车间分配"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          v-show="!factoryDisabled"
        >
          <j-select-factory
            v-model="model.selectedFactory"
            :multi="true"
            @back="backFactoryInfo"
            :backProduction="true"
            :treeProductOpera="true"
          ></j-select-factory>
        </a-form-model-item>
        <!--车间分配-->
        <a-form-model-item
          label="MDC车间分配"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          v-show="!productionDisabled"
        >
          <j-select-production
@@ -166,21 +151,26 @@
          ></j-select-production>
        </a-form-model-item>
        <!--<a-form-model-item-->
          <!--label="选择设备"-->
          <!--:labelCol="labelCol"-->
          <!--:wrapperCol="wrapperCol"-->
          <!--v-show="!factoryDisabled"-->
        <!--&gt;-->
          <!--<a-input-search-->
            <!--:readOnly="true"-->
            <!--v-model="model.equipmentIds"-->
            <!--@search="deviceSearch"-->
            <!--enter-button-->
            <!--placeholder="请选择设备"-->
            <!--:disabled="!model.selectedFactory"-->
          <!--/>-->
        <!--</a-form-model-item>-->
        <a-form-model-item
          label="选择设备"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          v-show="!productionDisabled"
        >
          <a-tooltip title="选择设备后,用户就只有这些设备的权限!不选择设备,则会根据车间分配控制设备的权限!"
                     placement="topRight">
            <a-input-search
              :readOnly="true"
              v-model="model.equipmentIds"
              @search="deviceSearch"
              enter-button
              placeholder="请选择设备"
              :disabled="!model.selectedProduction"
            />
          </a-tooltip>
        </a-form-model-item>
        <!--<a-form-model-item-->
          <!--label="首页权限"-->
@@ -350,11 +340,11 @@
      </a-button>
    </div>
<!--    <select-device-modal-->
<!--      ref="selectDeviceModal"-->
<!--      @selectFinished="selectOK"-->
<!--      :title="'选择设备'"-->
<!--    />-->
    <select-device-modal
      ref="selectDeviceModal"
      @selectFinished="selectOK"
      :title="'选择设备'"
    />
  </a-drawer>
</template>
@@ -366,23 +356,20 @@
  import { addUser, editUser, queryUserRole, queryall } from '@/api/api'
  import { disabledAuthFilter } from '@/utils/authFilter'
  import { duplicateCheck } from '@/api/api'
  import JSelectFactory from '../../../components/jeecgbiz/JSelectFactory'
import JSelectProduction from '../../../components/jeecgbiz/JSelectProduction'
  import { mapActions } from 'vuex'
  import { ajaxGetDictItems, getDictItemsFromCache } from '@/api/api'
  import JSelectProduction from '../../../components/jeecgbiz/JSelectProduction'
  // import SelectDeviceModal from './SelectDeviceModal'
import SelectDeviceModal from './SelectDeviceModal'
  export default {
    name: 'UserModal',
    components: {
      // SelectDeviceModal,
      JSelectFactory,
    SelectDeviceModal,
      JSelectProduction
    },
    data() {
      return {
        departDisabled: false, //是否是我的部门调用该页面
        factoryDisabled: false, //是否是我的车间调用该页面
        productionDisabled: false, //是否是我的车间调用该页面
        roleDisabled: false, //是否是角色维护调用该页面
        modalWidth: 800,
@@ -393,12 +380,14 @@
        disableSubmit: false,
        dateFormat: 'YYYY-MM-DD',
        validatorRules: {
        workNo:[{ required: true, message: '请输入工号!' }],
          username: [{ required: true, message: '请输入用户账号!' },
            { validator: this.validateUsername }],
          password: [{
        password: [
          {
            required: true,
            pattern: /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,./]).{8,}$/,
            message: '密码由8位数字、大小写字母和特殊符号组成!'
            // pattern: /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,./]).{8,}$/,
            message: '请输入登录密码!'
          },
            { validator: this.validateToNextPassword, trigger: 'change' }],
          confirmpassword: [{ required: true, message: '请重新输入登录密码!' },
@@ -407,8 +396,8 @@
          phone: [{ required: false, message: '请输入手机号!' }, { validator: this.validatePhone }],
          email: [{ validator: this.validateEmail }],
          roles: {},
          workNo: [{ required: true, message: '请输入工号' },
            { validator: this.validateWorkNo }],
        // workNo: [{ required: true, message: '请输入工号' },
        //   { validator: this.validateWorkNo }],
          telephone: [{ pattern: /^0\d{2,3}-[1-9]\d{6,7}$/, message: '请输入正确的座机号码' }],
          teamId: [{ required: false, message: '请维护班组' }]
        },
@@ -439,11 +428,9 @@
        tenantsOptions: [],
        rolesOptions: [],
        nextDepartOptions: [],
        nextFactoryOptions: [],
        nextProductionOptions: [],
        isDepartType: '',
        model: {
          selectedFactory: '',
          selectedProduction: ''
        }
      }
@@ -452,17 +439,6 @@
      visible: {
        handler(value) {
          if (value) this.initDictData('password_length')
        }
      },
      'model.selectedFactory': {
        handler(newVal, oldVal) {
          if (newVal) {
            // 如果车间选择前后不一致则重置选择设备
            if ((oldVal && newVal !== oldVal)) this.model.equipmentIds = ''
            //this.$refs.selectDeviceModal.queryTreeData(newVal)
          }
          // 如果清空车间值则重置选择设备
          if (newVal === '') this.model.equipmentIds = ''
        }
      },
      'model.selectedProduction': {
@@ -513,7 +489,6 @@
          userIdentity: 1,
          selectedroles: '',
          selecteddeparts: '',
          selectedFactory: '',
          selectedProduction: ''
        })
      },
@@ -611,24 +586,6 @@
        // 获取车间分配
        getAction(that.url.userProductionList, { userId: userid }).then((res) => {
          if (res.success) {
            let FactoryOptions = []
            let selectFactoryKeys = []
            for (let i = 0; i < res.result.length; i++) {
              selectFactoryKeys.push(res.result[i].key)
              //新增负责部门选择下拉框
              FactoryOptions.push({
                value: res.result[i].key,
                label: res.result[i].title
              })
            }
            this.$set(this.model, 'selectedFactory', selectFactoryKeys.join(','))
            that.nextFactoryOptions = FactoryOptions
          }
        })
        getAction(that.url.userProductionList, { userId: userid }).then((res) => {
          if (res.success) {
            let ProductionOptions = []
            let selectProductKeys = []
            for (let i = 0; i < res.result.length; i++) {
@@ -653,14 +610,6 @@
          return c
        })
      },
      backFactoryInfo(info) {
        this.model.factoryIds = this.model.selectedFactory
        this.nextFactoryOptions = info.map((item, index, arr) => {
          let c = { label: item.text, value: item.value + '' }
          return c
        })
      },
      backProductionInfo(info) {
        this.model.productionIds = this.model.selectedProduction
        this.nextProductionOptions = info.map((item, index, arr) => {
@@ -672,7 +621,6 @@
      refresh() {
        this.userId = ''
        this.nextDepartOptions = []
        this.nextFactoryOptions = []
        this.nextProductionOptions = []
        this.departIdShow = false
      },
@@ -681,7 +629,6 @@
        this.visible = false
        this.disableSubmit = false
        this.nextDepartOptions = []
        this.nextFactoryOptions = []
        this.nextProductionOptions = []
        this.departIdShow = false
        this.$refs.form.resetFields()
@@ -853,10 +800,10 @@
      },
      deviceSearch() {
        //this.$refs.selectDeviceModal.visible = true
        //this.$refs.selectDeviceModal.selectedRowKeys = []
        //this.$refs.selectDeviceModal.selectedRows = []
        //this.$refs.selectDeviceModal.checkedKeys = this.model.equipmentIds ? this.model.equipmentIds.split(',') : []
      this.$refs.selectDeviceModal.visible = true
      this.$refs.selectDeviceModal.selectedRowKeys = []
      this.$refs.selectDeviceModal.selectedRows = []
      this.$refs.selectDeviceModal.checkedKeys = this.model.equipmentIds ? this.model.equipmentIds.split(',') : []
      },
      /**