src/views/CNAS/resourceDemand/device/component/operationInstruction.vue
@@ -3,7 +3,7 @@
  <div>
    <div style="margin: 10px 0;text-align: right">
      <el-button size="small" type="primary" @click="getList">刷新</el-button>
      <el-button size="small" type="primary" @click="dialogVisible = true">受控申请</el-button>
      <el-button size="small" type="primary" @click="openInstructionDia">受控申请</el-button>
    </div>
    <el-table :data="tableData" border height="calc(100vh - 18em)"
>
@@ -188,7 +188,9 @@
  pageByPageQueryOfHomeworkInstructions,
  selectDeviceParameter,
} from '@/api/cnas/resourceDemand/device.js'
import draftSave from '@/mixins/draftSave'
export default {
  mixins: [draftSave],
  props: {
    clickNodeVal: {
      type: Object,
@@ -259,6 +261,8 @@
    },
    dialogVisible(newVal) {
      if (newVal === false) {
        this.draftStop('instructionForm')
        this.draftStop('instructionRows')
        this.instructionForm = {}
        this.documentTableData = []
        this.fileList1 = []
@@ -337,7 +341,17 @@
          this.documentTableData.forEach((v, k) => {
            v.index = k
          })
          this.draftRestore('instructionForm', 'instructionForm', row.instructionId, 'dialogVisible')
          this.draftRestore('instructionRows', 'documentTableData', row.instructionId, 'dialogVisible')
        }
      })
    },
    // 打开受控申请弹窗(新增)
    openInstructionDia() {
      this.dialogVisible = true
      this.$nextTick(() => {
        this.draftRestore('instructionForm', 'instructionForm', '', 'dialogVisible')
        this.draftRestore('instructionRows', 'documentTableData', '', 'dialogVisible')
      })
    },
    handleSizeChange(val) {
@@ -355,6 +369,8 @@
          newHomeworkGuidebookAdded(this.instructionForm).then(res => {
            if (res.code == 200) {
              this.$message.success('操作成功!')
              this.draftClear('instructionForm')
              this.draftClear('instructionRows')
              this.dialogVisible = false
              this.getList()
            }
@@ -396,6 +412,7 @@
    addFile() {
      this.$refs.form.validate((valid) => {
        if (valid) {
          this.draftClear('instructionRowForm')
          if (this.tableDataIndex !== undefined) {
            this.documentTableData[this.tableDataIndex] = this.form
            this.dialogVisible1 = false;
@@ -418,7 +435,7 @@
      this.form.deviceName = this.clickNodeVal.label
      this.onDeviceNameChange()
      this.fileList = []
      this.draftRestore('instructionRowForm', 'form', '', 'dialogVisible1')
    },
    editFun(row, index) {
      this.form = { ...row }
@@ -429,8 +446,10 @@
        this.fileList.push({ name: this.form.fileName })
      }
      this.dialogVisible1 = true
      this.draftRestore('instructionRowForm', 'form', row.id !== undefined ? row.id : ('row' + index), 'dialogVisible1')
    },
    closeDia() {
      this.draftStop('instructionRowForm')
      this.dialogVisible1 = false
      this.$refs['form'].resetFields()
      this.fileList = []