| | |
| | | <span style="width: 90px;margin-left: 10px">被授权人:</span> |
| | | <el-select v-model="delegatedUser" clearable filterable multiple |
| | | placeholder="请选择" size="small" style="width: 100%;"> |
| | | <el-option v-for="item in responsibleOptions" :key="item.name" :label="item.name" :value="item.name"> |
| | | <el-option v-for="item in inspectorOptions" :key="item.name" :label="item.name" :value="item.name"> |
| | | </el-option> |
| | | </el-select> |
| | | </div> |
| | |
| | | } from "@/api/cnas/resourceDemand/device"; |
| | | import {selectUserCondition} from "@/api/system/user"; |
| | | import {mapGetters} from "@/utils/store-compat"; |
| | | import draftSave from '@/mixins/draftSave' |
| | | |
| | | export default { |
| | | name: '', |
| | | // import 引入的组件需要注入到对象中才能使用 |
| | | components: {limsTable}, |
| | | mixins: [draftSave], |
| | | props: { |
| | | clickNodeVal: { |
| | | type: Object, |
| | |
| | | } |
| | | ], |
| | | responsibleOptions: [], |
| | | inspectorOptions: [], |
| | | operationType: '', |
| | | usageTableDia: false, |
| | | deviceImpowerDetails: [], |
| | |
| | | this.deviceImpowerDetails.forEach(item => { |
| | | item['delegatedUserArr'] = item.delegatedUser.split(',') |
| | | }) |
| | | this.restoreImpowerDraft() |
| | | } |
| | | }).catch(error => { |
| | | console.error(error) |
| | | }) |
| | | } else { |
| | | this.restoreImpowerDraft() |
| | | } |
| | | this.getEquipOptions() |
| | | this.getUserList() |
| | | }, |
| | | restoreImpowerDraft() { |
| | | if (this.operationType === 'add' || this.operationType === 'edit') { |
| | | const rid = this.operationType === 'edit' ? this.impowerId : '' |
| | | this.draftRestore('usageAuthorizationForm', 'form', rid, 'usageTableDia') |
| | | this.draftRestore('usageAuthorizationRows', 'deviceImpowerDetails', rid, 'usageTableDia') |
| | | } |
| | | }, |
| | | closeDialog () { |
| | | this.usageTableDia = false |
| | |
| | | // 添加设备 |
| | | addTableRow() { |
| | | this.addEquipDia = true |
| | | this.delegatedUser = this.responsibleOptions.map((item) => item.name); |
| | | this.delegatedUser = this.inspectorOptions.map((item) => item.name); |
| | | this.getEquipOptions() |
| | | }, |
| | | // 删除表格行 |
| | |
| | | addImpower(this.form).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('新增成功') |
| | | this.draftClear('usageAuthorizationForm') |
| | | this.draftClear('usageAuthorizationRows') |
| | | this.usageTableDia = false |
| | | this.refreshTableList() |
| | | } |
| | |
| | | updateImpower(this.form).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('修改成功') |
| | | this.draftClear('usageAuthorizationForm') |
| | | this.draftClear('usageAuthorizationRows') |
| | | this.usageTableDia = false |
| | | this.refreshTableList() |
| | | } |
| | |
| | | this.responsibleOptions = res.data |
| | | } |
| | | }) |
| | | // 被授权人下拉只取检测员角色人员 |
| | | selectUserCondition({type: 3}).then(res => { |
| | | if (res.code == 200) { |
| | | this.inspectorOptions = res.data |
| | | } |
| | | }) |
| | | }, |
| | | }, |
| | | watch: { |