src/views/CNAS/resourceDemand/device/component/usageAuthorization.vue
@@ -80,7 +80,7 @@
        <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>
@@ -122,11 +122,13 @@
} 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,
@@ -229,6 +231,7 @@
        }
      ],
      responsibleOptions: [],
      inspectorOptions: [],
      operationType: '',
      usageTableDia: false,
      deviceImpowerDetails: [],
@@ -322,13 +325,23 @@
            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
@@ -337,7 +350,7 @@
    // 添加设备
    addTableRow() {
      this.addEquipDia = true
      this.delegatedUser = this.responsibleOptions.map((item) => item.name);
      this.delegatedUser = this.inspectorOptions.map((item) => item.name);
      this.getEquipOptions()
    },
    // 删除表格行
@@ -355,6 +368,8 @@
        addImpower(this.form).then(res => {
          if (res.code == 200) {
            this.$message.success('新增成功')
            this.draftClear('usageAuthorizationForm')
            this.draftClear('usageAuthorizationRows')
            this.usageTableDia = false
            this.refreshTableList()
          }
@@ -366,6 +381,8 @@
        updateImpower(this.form).then(res => {
          if (res.code == 200) {
            this.$message.success('修改成功')
            this.draftClear('usageAuthorizationForm')
            this.draftClear('usageAuthorizationRows')
            this.usageTableDia = false
            this.refreshTableList()
          }
@@ -453,6 +470,12 @@
          this.responsibleOptions = res.data
        }
      })
      // 被授权人下拉只取检测员角色人员
      selectUserCondition({type: 3}).then(res => {
        if (res.code == 200) {
          this.inspectorOptions = res.data
        }
      })
    },
  },
  watch: {