| | |
| | | /> |
| | | </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" |
| | | ></j-select-repair-depart> |
| | | </a-form-model-item> |
| | | |
| | | <a-form-model-item |
| | | label="负责部门" |
| | |
| | | import { disabledAuthFilter } from '@/utils/authFilter' |
| | | import { duplicateCheck } from '@/api/api' |
| | | import JSelectProduction from '../../../components/jeecgbiz/JSelectProduction' |
| | | import JSelectRepairDepart from '../../../components/jeecgbiz/JSelectRepairDepart' |
| | | import { mapActions } from 'vuex' |
| | | import { ajaxGetDictItems, getDictItemsFromCache } from '@/api/api' |
| | | import SelectDeviceModal from './SelectDeviceModal' |
| | |
| | | name: 'UserModal', |
| | | components: { |
| | | SelectDeviceModal, |
| | | JSelectProduction |
| | | JSelectProduction, |
| | | JSelectRepairDepart |
| | | }, |
| | | data() { |
| | | return { |
| | | departDisabled: false, //是否是我的部门调用该页面 |
| | | productionDisabled: false, //是否是我的车间调用该页面 |
| | | roleDisabled: false, //是否是角色维护调用该页面 |
| | | repairDepartDisabled: false, //是否是我的维修部门班组调用该页面 |
| | | modalWidth: 800, |
| | | drawerWidth: 700, |
| | | modaltoggleFlag: true, |
| | |
| | | userProductionList: '/sys/user/userProductionList', |
| | | userId: '/sys/user/generateUserId', // 引入生成添加用户情况下的url |
| | | syncUserByUserName: '/act/process/extActProcess/doSyncUserByUserName',//同步用户到工作流 |
| | | queryTenantList: '/sys/tenant/queryList' |
| | | queryTenantList: '/sys/tenant/queryList', |
| | | userRepairDepartList: '/sys/user/userRepairDepartList', |
| | | repairDepartTreeList: '/eam/eamBaseRepairDepart/queryTreeList' |
| | | }, |
| | | tenantsOptions: [], |
| | | rolesOptions: [], |
| | | nextDepartOptions: [], |
| | | nextProductionOptions: [], |
| | | nextRepairDepartOptions: [], |
| | | isDepartType: '', |
| | | model: { |
| | | selectedProduction: '' |
| | | selectedProduction: '', |
| | | selectedRepairDeparts: '' |
| | | } |
| | | } |
| | | }, |
| | |
| | | this.initRoleList() |
| | | this.initTenantList() |
| | | this.queryTreeData() |
| | | this.getRepairDepartTreeDataByApi() |
| | | }, |
| | | computed: { |
| | | uploadAction: function() { |
| | |
| | | }).finally(() => { |
| | | }) |
| | | }, |
| | | // 获取维修班组树 |
| | | getRepairDepartTreeDataByApi() { |
| | | getAction(this.url.repairDepartTreeList) |
| | | .then(res => { |
| | | if (res.success) { |
| | | this.repairDepartTreeData = res.result |
| | | } else { |
| | | this.$notification.warning({ |
| | | message: '消息', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | add() { |
| | | this.refresh() |
| | | this.edit({ |
| | |
| | | userIdentity: 1, |
| | | selectedroles: '', |
| | | selecteddeparts: '', |
| | | selectedProduction: '' |
| | | selectedProduction: '', |
| | | selectedRepairDeparts: '' |
| | | }) |
| | | }, |
| | | edit(record) { |
| | |
| | | if (record.hasOwnProperty('id')) { |
| | | that.getUserRoles(record.id) |
| | | that.getUserDeparts(record.id) |
| | | that.getUserProductions(record.id) |
| | | that.getUserRepairDeparts(record.id) |
| | | } |
| | | }, |
| | | isDisabledAuth(code) { |
| | |
| | | that.nextDepartOptions = departOptions |
| | | } |
| | | }) |
| | | |
| | | }, |
| | | getUserProductions(userid) { |
| | | let that = this |
| | | // 获取车间分配 |
| | | getAction(that.url.userProductionList, { userId: userid }).then((res) => { |
| | | if (res.success) { |
| | |
| | | that.nextProductionOptions = ProductionOptions |
| | | } |
| | | }) |
| | | //车间的url |
| | | }, |
| | | 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 |
| | | } |
| | | }) |
| | | }, |
| | | backDepartInfo(info) { |
| | | this.model.departIds = this.model.selecteddeparts |
| | |
| | | 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.nextRepairDepartOptions = [] |
| | | this.departIdShow = false |
| | | }, |
| | | close() { |
| | |
| | | this.disableSubmit = false |
| | | this.nextDepartOptions = [] |
| | | this.nextProductionOptions = [] |
| | | this.nextRepairDepartOptions = [] |
| | | this.departIdShow = false |
| | | this.$refs.form.resetFields() |
| | | }, |