| | |
| | | <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)" |
| | | > |
| | |
| | | pageByPageQueryOfHomeworkInstructions, |
| | | selectDeviceParameter, |
| | | } from '@/api/cnas/resourceDemand/device.js' |
| | | import draftSave from '@/mixins/draftSave' |
| | | export default { |
| | | mixins: [draftSave], |
| | | props: { |
| | | clickNodeVal: { |
| | | type: Object, |
| | |
| | | }, |
| | | dialogVisible(newVal) { |
| | | if (newVal === false) { |
| | | this.draftStop('instructionForm') |
| | | this.draftStop('instructionRows') |
| | | this.instructionForm = {} |
| | | this.documentTableData = [] |
| | | this.fileList1 = [] |
| | |
| | | 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) { |
| | |
| | | newHomeworkGuidebookAdded(this.instructionForm).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('操作成功!') |
| | | this.draftClear('instructionForm') |
| | | this.draftClear('instructionRows') |
| | | this.dialogVisible = false |
| | | this.getList() |
| | | } |
| | |
| | | addFile() { |
| | | this.$refs.form.validate((valid) => { |
| | | if (valid) { |
| | | this.draftClear('instructionRowForm') |
| | | if (this.tableDataIndex !== undefined) { |
| | | this.documentTableData[this.tableDataIndex] = this.form |
| | | this.dialogVisible1 = false; |
| | |
| | | this.form.deviceName = this.clickNodeVal.label |
| | | this.onDeviceNameChange() |
| | | this.fileList = [] |
| | | |
| | | this.draftRestore('instructionRowForm', 'form', '', 'dialogVisible1') |
| | | }, |
| | | editFun(row, index) { |
| | | this.form = { ...row } |
| | |
| | | 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 = [] |