| | |
| | | <a-input-search :readOnly="true" v-model="model.equipmentIds" @search="deviceSearch" enter-button placeholder="请选择设备" :disabled="!model.selectedProduction"/> |
| | | </a-form-model-item> |
| | | |
| | | <a-form-model-item label="EAM中心分配" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="areaId"> |
| | | <j-multi-select-tag :triggerChange="true" v-model="model.eamFactoryIds" dictCode="mom_base_area,name,id,del_flag = 0 and type = 1" placeholder="请维护中心"/> |
| | | <a-form-model-item label="EAM中心分配" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="eamFactoryIds"> |
| | | <JSelectBaseFactory v-model="model.selectedBaseFactory" :multi="true" @back="backBaseFactoryInfo" :backProduction="true" :treeProductOpera="true"/> |
| | | </a-form-model-item> |
| | | |
| | | <a-form-model-item label="EAM设备分配" :labelCol="labelCol" :wrapperCol="wrapperCol" v-show="!productionDisabled"> |
| | | <a-input-search :readOnly="true" v-model="model.eamEquipmentIds" @search="deviceSearch" enter-button placeholder="请选择设备" :disabled="!model.selectedProduction"/> |
| | | <a-input-search :readOnly="true" v-model="model.eamEquipmentIds" @search="eamDeviceSearch" enter-button placeholder="请选择EAM设备" :disabled="!model.selectedBaseFactory"/> |
| | | </a-form-model-item> |
| | | |
| | | <a-form-model-item label="维修部门/班组分配" :labelCol="labelCol" :wrapperCol="wrapperCol" v-show="!repairDepartDisabled"> |
| | | <j-select-repair-depart v-model="model.selectedRepairDeparts" :multi="true" @back="backRepairDepartInfo" :backRepairDepart="true" :treeRepairDepartOpera="true"/> |
| | | </a-form-model-item> |
| | | <!-- <a-form-model-item label="维修部门/班组分配" :labelCol="labelCol" :wrapperCol="wrapperCol" v-show="!repairDepartDisabled">--> |
| | | <!-- <j-select-repair-depart v-model="model.selectedRepairDeparts" :multi="true" @back="backRepairDepartInfo" :backRepairDepart="true" :treeRepairDepartOpera="true"/>--> |
| | | <!-- </a-form-model-item>--> |
| | | |
| | | <a-form-model-item label="负责部门" :labelCol="labelCol" :wrapperCol="wrapperCol" v-if="departIdShow==true"> |
| | | <j-multi-select-tag :disabled="disableSubmit" v-model="model.departIds" :options="nextDepartOptions" placeholder="请选择负责部门"/> |
| | |
| | | </div> |
| | | |
| | | <select-device-modal ref="selectDeviceModal" @selectFinished="selectOK" :title="'选择设备'"/> |
| | | |
| | | <select-eam-device-modal ref="selectEamDeviceModal" @selectFinished="selectEamOK" :title="'选择EAM设备'"/> |
| | | |
| | | </a-drawer> |
| | | </template> |
| | | |
| | |
| | | import { disabledAuthFilter } from '@/utils/authFilter' |
| | | import { duplicateCheck } from '@/api/api' |
| | | import JSelectProduction from '../../../components/jeecgbiz/JSelectProduction' |
| | | import JSelectRepairDepart from '../../../components/jeecgbiz/JSelectRepairDepart' |
| | | // import JSelectRepairDepart from '../../../components/jeecgbiz/JSelectRepairDepart' |
| | | import { mapActions } from 'vuex' |
| | | import { ajaxGetDictItems, getDictItemsFromCache } from '@/api/api' |
| | | import SelectDeviceModal from './SelectDeviceModal' |
| | | import SelectEamDeviceModal from './SelectEamDeviceModal' |
| | | import JSelectBaseFactory from "@comp/jeecgbiz/JSelectBaseFactory.vue"; |
| | | |
| | | export default { |
| | | name: 'UserModal', |
| | | components: { |
| | | JSelectBaseFactory, |
| | | SelectDeviceModal, |
| | | JSelectProduction, |
| | | JSelectRepairDepart |
| | | // JSelectRepairDepart, |
| | | SelectEamDeviceModal |
| | | }, |
| | | data() { |
| | | return { |
| | | departDisabled: false, //是否是我的部门调用该页面 |
| | | productionDisabled: false, //是否是我的车间调用该页面 |
| | | roleDisabled: false, //是否是角色维护调用该页面 |
| | | repairDepartDisabled: false, //是否是我的维修部门班组调用该页面 |
| | | // repairDepartDisabled: false, //是否是我的维修部门班组调用该页面 |
| | | modalWidth: 800, |
| | | drawerWidth: 700, |
| | | modaltoggleFlag: true, |
| | |
| | | validatorRules: { |
| | | username: [{ required: true, message: '请输入用户账号!' }, |
| | | { validator: this.validateUsername }], |
| | | password: [{ |
| | | required: true, |
| | | pattern: /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,./]).{8,}$/, |
| | | message: '密码由8位数字、大小写字母和特殊符号组成!' |
| | | }, |
| | | { validator: this.validateToNextPassword, trigger: 'change' }], |
| | | // password: [{ |
| | | // required: true, |
| | | // pattern: /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,./]).{8,}$/, |
| | | // message: '密码由8位数字、大小写字母和特殊符号组成!' |
| | | // }, |
| | | // { validator: this.validateToNextPassword, trigger: 'change' }], |
| | | confirmpassword: [{ required: true, message: '请重新输入登录密码!' }, |
| | | { validator: this.compareToFirstPassword }], |
| | | realname: [{ required: true, message: '请输入用户名称!' }], |
| | |
| | | syncUserByUserName: '/act/process/extActProcess/doSyncUserByUserName',//同步用户到工作流 |
| | | queryTenantList: '/sys/tenant/queryList', |
| | | userRepairDepartList: '/sys/user/userRepairDepartList', |
| | | userBaseFactoryList: '/sys/user/userBaseFactoryList', |
| | | repairDepartTreeList: '/eam/eamBaseRepairDepart/queryTreeList' |
| | | }, |
| | | tenantsOptions: [], |
| | | rolesOptions: [], |
| | | nextDepartOptions: [], |
| | | nextProductionOptions: [], |
| | | nextBaseFactoryOptions:[], |
| | | nextRepairDepartOptions: [], |
| | | isDepartType: '', |
| | | model: { |
| | | selectedProduction: '', |
| | | selectedRepairDeparts: '' |
| | | // selectedRepairDeparts: '', |
| | | selectedBaseFactory:'', |
| | | } |
| | | } |
| | | }, |
| | |
| | | } |
| | | // 如果清空车间值则重置选择设备 |
| | | if (newVal === '') this.model.equipmentIds = '' |
| | | } |
| | | }, |
| | | 'model.selectedBaseFactory': { |
| | | handler(newVal, oldVal) { |
| | | if (newVal && this.$refs.selectEamDeviceModal) { |
| | | // 如果车间选择前后不一致则重置选择设备 |
| | | if ((oldVal && newVal !== oldVal)) this.model.eamEquipmentIds = '' |
| | | this.$refs.selectEamDeviceModal.queryTreeData(newVal) |
| | | } |
| | | // 如果清空车间值则重置选择设备 |
| | | if (newVal === '') this.model.eamEquipmentIds = '' |
| | | } |
| | | } |
| | | }, |
| | |
| | | selectedroles: '', |
| | | selecteddeparts: '', |
| | | selectedProduction: '', |
| | | selectedRepairDeparts: '' |
| | | selectedBaseFactory:'', |
| | | // selectedRepairDeparts: '' |
| | | }) |
| | | }, |
| | | edit(record) { |
| | |
| | | that.getUserDeparts(record.id) |
| | | that.getUserProductions(record.id) |
| | | that.getUserRepairDeparts(record.id) |
| | | this.getUserBaseFactorys(record.id) |
| | | } |
| | | }, |
| | | isDisabledAuth(code) { |
| | |
| | | } |
| | | }) |
| | | }, |
| | | getUserRepairDeparts(userid) { |
| | | // getUserRepairDeparts(userid) { |
| | | // let that = this |
| | | // // 获取维修部门/班组分配 |
| | | // getAction(that.url.userRepairDepartList, { userId: userid }).then((res) => { |
| | | // if (res.success) { |
| | | // let repairDepartOptions = [] |
| | | // let selectedRepairDepartKeys = [] |
| | | // for (let i = 0; i < res.result.length; i++) { |
| | | // selectedRepairDepartKeys.push(res.result[i].key) |
| | | // //新增负责维修部门/班组选择下拉框 |
| | | // repairDepartOptions.push({ |
| | | // value: res.result[i].key, |
| | | // label: res.result[i].title |
| | | // }) |
| | | // } |
| | | // |
| | | // this.$set(this.model, 'selectedRepairDeparts', selectedRepairDepartKeys.join(',')) |
| | | // that.nextRepairDepartOptions = repairDepartOptions |
| | | // } |
| | | // }) |
| | | // }, |
| | | getUserBaseFactorys(userid) { |
| | | let that = this |
| | | // 获取维修部门/班组分配 |
| | | getAction(that.url.userRepairDepartList, { userId: userid }).then((res) => { |
| | | // 获取EAM中心/工区/工段分配 |
| | | getAction(that.url.userBaseFactoryList, { userId: userid }).then((res) => { |
| | | if (res.success) { |
| | | let repairDepartOptions = [] |
| | | let selectedRepairDepartKeys = [] |
| | | let BaseFactoryOptions = [] |
| | | let selectedBaseFactoryOptionsKeys = [] |
| | | for (let i = 0; i < res.result.length; i++) { |
| | | selectedRepairDepartKeys.push(res.result[i].key) |
| | | selectedBaseFactoryOptionsKeys.push(res.result[i].key) |
| | | //新增负责维修部门/班组选择下拉框 |
| | | repairDepartOptions.push({ |
| | | BaseFactoryOptions.push({ |
| | | value: res.result[i].key, |
| | | label: res.result[i].title |
| | | }) |
| | | } |
| | | |
| | | this.$set(this.model, 'selectedRepairDeparts', selectedRepairDepartKeys.join(',')) |
| | | that.nextRepairDepartOptions = repairDepartOptions |
| | | this.$set(this.model, 'selectedBaseFactory', selectedBaseFactoryOptionsKeys.join(',')) |
| | | that.nextBaseFactoryOptions = BaseFactoryOptions |
| | | } |
| | | }) |
| | | }, |
| | |
| | | return c |
| | | }) |
| | | }, |
| | | backRepairDepartInfo(info) { |
| | | this.model.repairDepartIds = this.model.selectedRepairDeparts |
| | | this.nextRepairDepartOptions = info.map((item, index, arr) => { |
| | | backBaseFactoryInfo(info) { |
| | | this.model.eamFactoryIds = this.model.selectedBaseFactory |
| | | this.nextBaseFactoryOptions = info.map((item, index, arr) => { |
| | | let c = { label: item.text, value: item.value + '' } |
| | | return c |
| | | }) |
| | | }, |
| | | // backRepairDepartInfo(info) { |
| | | // this.model.repairDepartIds = this.model.selectedRepairDeparts |
| | | // this.nextRepairDepartOptions = info.map((item, index, arr) => { |
| | | // let c = { label: item.text, value: item.value + '' } |
| | | // return c |
| | | // }) |
| | | // }, |
| | | |
| | | refresh() { |
| | | this.userId = '' |
| | | this.nextDepartOptions = [] |
| | | this.nextProductionOptions = [] |
| | | this.nextBaseFactoryOptions = [] |
| | | this.nextRepairDepartOptions = [] |
| | | this.departIdShow = false |
| | | }, |
| | |
| | | this.visible = false |
| | | this.disableSubmit = false |
| | | this.nextDepartOptions = [] |
| | | this.nextProductionOptions = [] |
| | | this.nextProductionOptions = [] |
| | | this.nextRepairDepartOptions = [] |
| | | this.departIdShow = false |
| | |
| | | this.$refs.selectDeviceModal.checkedKeys = this.model.equipmentIds ? this.model.equipmentIds.split(',') : [] |
| | | }, |
| | | |
| | | eamDeviceSearch(){ |
| | | this.$refs.selectEamDeviceModal.visible = true |
| | | this.$refs.selectEamDeviceModal.selectedRowKeys = [] |
| | | this.$refs.selectEamDeviceModal.selectedRows = [] |
| | | this.$refs.selectEamDeviceModal.checkedKeys = this.model.eamEquipmentIds ? this.model.eamEquipmentIds.split(',') : [] |
| | | }, |
| | | |
| | | /** |
| | | * 选择已有设备后点击确定时触发 |
| | | * @param data 已选择的设备数组 |
| | |
| | | selectOK(data) { |
| | | console.log('data=', data) |
| | | this.$set(this.model, 'equipmentIds', data.join(',')) |
| | | }, |
| | | selectEamOK(data) { |
| | | console.log('data=', data) |
| | | this.$set(this.model, 'eamEquipmentIds', data.join(',')) |
| | | } |
| | | } |
| | | } |