| | |
| | | /> |
| | | </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="角色分配" |
| | |
| | | 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 |
| | |
| | | ></j-select-production> |
| | | </a-form-model-item> |
| | | |
| | | <!--<a-form-model-item--> |
| | | <!--label="选择设备"--> |
| | | <!--:labelCol="labelCol"--> |
| | | <!--:wrapperCol="wrapperCol"--> |
| | | <!--v-show="!factoryDisabled"--> |
| | | <!-->--> |
| | | <!--<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="首页权限"--> |
| | |
| | | </a-button> |
| | | </div> |
| | | |
| | | <!-- <select-device-modal--> |
| | | <!-- ref="selectDeviceModal"--> |
| | | <!-- @selectFinished="selectOK"--> |
| | | <!-- :title="'选择设备'"--> |
| | | <!-- />--> |
| | | <select-device-modal |
| | | ref="selectDeviceModal" |
| | | @selectFinished="selectOK" |
| | | :title="'选择设备'" |
| | | /> |
| | | </a-drawer> |
| | | </template> |
| | | |
| | |
| | | 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, |
| | |
| | | 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: '请重新输入登录密码!' }, |
| | |
| | | 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: '请维护班组' }] |
| | | }, |
| | |
| | | tenantsOptions: [], |
| | | rolesOptions: [], |
| | | nextDepartOptions: [], |
| | | nextFactoryOptions: [], |
| | | nextProductionOptions: [], |
| | | isDepartType: '', |
| | | model: { |
| | | selectedFactory: '', |
| | | selectedProduction: '' |
| | | } |
| | | } |
| | |
| | | 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': { |
| | |
| | | userIdentity: 1, |
| | | selectedroles: '', |
| | | selecteddeparts: '', |
| | | selectedFactory: '', |
| | | selectedProduction: '' |
| | | }) |
| | | }, |
| | |
| | | // 获取车间分配 |
| | | 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++) { |
| | |
| | | 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) => { |
| | |
| | | refresh() { |
| | | this.userId = '' |
| | | this.nextDepartOptions = [] |
| | | this.nextFactoryOptions = [] |
| | | this.nextProductionOptions = [] |
| | | this.departIdShow = false |
| | | }, |
| | |
| | | this.visible = false |
| | | this.disableSubmit = false |
| | | this.nextDepartOptions = [] |
| | | this.nextFactoryOptions = [] |
| | | this.nextProductionOptions = [] |
| | | this.departIdShow = false |
| | | this.$refs.form.resetFields() |
| | |
| | | }, |
| | | |
| | | 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(',') : [] |
| | | }, |
| | | |
| | | /** |