优化用户管理页面表单填写界面选择设备功能,车间重新选择后重置选择设备
| | |
| | | this.autoExpandParent = false |
| | | }, |
| | | queryTreeData(value) { |
| | | // this.loading = true |
| | | // this.cardLoading = true |
| | | // this.QueryProduction().then(res => { |
| | | // if (res.success) { |
| | | // this.dataList = [] |
| | | // this.allTreeKeys = [] |
| | | // this.getTreeDataSouce(res.result) |
| | | // this.treeDataSource = res.result |
| | | // this.generateList(this.treeDataSource) |
| | | // console.log('treeDataSource', this.treeDataSource) |
| | | // this.expandedKeys = this.allTreeKeys |
| | | // } else { |
| | | // this.$message.warn(res.message) |
| | | // } |
| | | // }).finally(() => { |
| | | // this.loading = false |
| | | // this.cardLoading = false |
| | | // }) |
| | | this.loading = true |
| | | this.selectedWorkshopIds = value |
| | | getAction(this.url.getDeviceTree, { ids: value }) |
| | | .then(res => { |
| | | console.log('res===============', res) |
| | | if (res.success) { |
| | | this.dataList = [] |
| | | this.allTreeKeys = [] |
| | | this.getTreeDataSouce(res.result) |
| | | this.treeDataSource = res.result |
| | | this.generateList(this.treeDataSource) |
| | | console.log('treeDataSource', this.treeDataSource) |
| | | this.expandedKeys = this.allTreeKeys |
| | | } else { |
| | | this.$notification.warning({ |
| | |
| | | }, |
| | | onCheck(value, obj) { |
| | | this.checkedKeys = value |
| | | console.log('obj,', obj) |
| | | this.deviceNodes = obj.checkedNodes.filter(item => item.data.props.equipmentId).map(item => item.data.props.equipmentId) |
| | | console.log(this.deviceNodes) |
| | | }, |
| | | handleCancel() { |
| | | this.visible = false |
| | |
| | | }, |
| | | 'model.selectedProduction': { |
| | | handler(newVal, oldVal) { |
| | | console.log('触发监听', 'newVal=', newVal, 'oldVal=', oldVal) |
| | | // if ((newVal !== oldVal && oldVal) || !newVal) this.model.equipmentIds = '' |
| | | if (newVal && this.$refs.selectDeviceModal) this.$refs.selectDeviceModal.queryTreeData(newVal) |
| | | if (newVal && this.$refs.selectDeviceModal) { |
| | | // 如果车间选择前后不一致则重置选择设备 |
| | | if ((oldVal && newVal !== oldVal)) this.model.equipmentIds = '' |
| | | this.$refs.selectDeviceModal.queryTreeData(newVal) |
| | | } |
| | | // 如果清空车间值则重置选择设备 |
| | | if (newVal === '') this.model.equipmentIds = '' |
| | | } |
| | | } |
| | | }, |
| | |
| | | that.getUserRoles(record.id) |
| | | that.getUserDeparts(record.id) |
| | | } |
| | | console.log('that.model', that.model) |
| | | }, |
| | | isDisabledAuth(code) { |
| | | return disabledAuthFilter(code) |
| | |
| | | let c = { label: item.name, value: item.id + '' } |
| | | return c |
| | | }) |
| | | console.log('this.tenantsOptions: ', this.tenantsOptions) |
| | | } |
| | | }) |
| | | }, |
| | |
| | | let c = { label: item.roleName, value: item.id } |
| | | return c |
| | | }) |
| | | console.log('this.rolesOptions: ', this.rolesOptions) |
| | | } |
| | | }) |
| | | }, |
| | | getUserRoles(userid) { |
| | | queryUserRole({ userid: userid }).then((res) => { |
| | | if (res.success) { |
| | | // this.model.selectedroles = res.result.join(',') |
| | | this.$set(this.model, 'selectedroles', res.result.join(',')) |
| | | console.log('that.model.selectedroles=', this.model.selectedroles) |
| | | } |
| | | }) |
| | | }, |
| | |
| | | }) |
| | | } |
| | | |
| | | // that.model.selecteddeparts = selectDepartKeys.join(',') |
| | | this.$set(this.model, 'selecteddeparts', selectDepartKeys.join(',')) |
| | | |
| | | that.nextDepartOptions = departOptions |
| | | console.log('that.nextDepartOptions=', that.nextDepartOptions) |
| | | } |
| | | }) |
| | | |
| | |
| | | }) |
| | | } |
| | | |
| | | // that.model.selectedProduction = selectProductKeys.join(',') |
| | | this.$set(this.model, 'selectedProduction', selectProductKeys.join(',')) |
| | | that.nextProductionOptions = ProductionOptions |
| | | console.log('that.nextProductionOptions=', that.nextProductionOptions) |
| | | } |
| | | }) |
| | | //车间的url |