| | |
| | | <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"> |
| | |
| | | </div> |
| | | |
| | | <select-device-modal ref="selectDeviceModal" @selectFinished="selectOK" :title="'选择设备'"/> |
| | | |
| | | <select-eam-device-modal ref="selectEamDeviceModal" @selectFinished="selectEamOK" :title="'选择EAM设备'"/> |
| | | |
| | | </a-drawer> |
| | | </template> |
| | | |
| | |
| | | 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 { |
| | |
| | | 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: '', |
| | | selectedBaseFactory:'', |
| | | selectedRepairDeparts: '' |
| | | }) |
| | | }, |
| | |
| | | that.getUserDeparts(record.id) |
| | | that.getUserProductions(record.id) |
| | | that.getUserRepairDeparts(record.id) |
| | | this.getUserBaseFactorys(record.id) |
| | | } |
| | | }, |
| | | isDisabledAuth(code) { |
| | |
| | | } |
| | | }) |
| | | }, |
| | | getUserBaseFactorys(userid) { |
| | | let that = this |
| | | // 获取EAM中心/工区/工段分配 |
| | | getAction(that.url.userBaseFactoryList, { userId: userid }).then((res) => { |
| | | if (res.success) { |
| | | let BaseFactoryOptions = [] |
| | | let selectedBaseFactoryOptionsKeys = [] |
| | | for (let i = 0; i < res.result.length; i++) { |
| | | selectedBaseFactoryOptionsKeys.push(res.result[i].key) |
| | | //新增负责维修部门/班组选择下拉框 |
| | | BaseFactoryOptions.push({ |
| | | value: res.result[i].key, |
| | | label: res.result[i].title |
| | | }) |
| | | } |
| | | |
| | | this.$set(this.model, 'selectedBaseFactory', selectedBaseFactoryOptionsKeys.join(',')) |
| | | that.nextBaseFactoryOptions = BaseFactoryOptions |
| | | } |
| | | }) |
| | | }, |
| | | backDepartInfo(info) { |
| | | this.model.departIds = this.model.selecteddeparts |
| | | this.nextDepartOptions = info.map((item, index, arr) => { |
| | |
| | | backProductionInfo(info) { |
| | | this.model.productionIds = this.model.selectedProduction |
| | | this.nextProductionOptions = info.map((item, index, arr) => { |
| | | let c = { label: item.text, value: item.value + '' } |
| | | return c |
| | | }) |
| | | }, |
| | | 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 |
| | | }) |
| | |
| | | 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(',')) |
| | | } |
| | | } |
| | | } |