| | |
| | | <div class="btnS"> |
| | | <el-button size="small" type="primary" @click="calibrationMaintenance()">校准项目维护</el-button> |
| | | <el-button size="small" type="primary" @click="add('add')">添加校准记录</el-button> |
| | | <!-- <el-button size="small" type="primary" @click="handleDown">导出Excel</el-button> --> |
| | | </div> |
| | | <div class="tables" style="margin-top: 10px;"> |
| | | <el-table :data="tableData" height="calc(100vh - 20em)" border> |
| | |
| | | deviceMetricRecordPage, |
| | | showDeviceMetricsCopy, |
| | | deleteDeviceMetricRecord, |
| | | deviceMetricRecordExport, |
| | | deleteCNASFile, |
| | | selectDeviceMetric, |
| | | deleteDeviceMetrics, |
| | |
| | | } from '@/api/cnas/resourceDemand/device.js' |
| | | import { selectQualifiedSupplierManagementPage } from '@/api/cnas/externalService/supplierManage/supplierManage' |
| | | import { mapGetters } from "@/utils/store-compat"; |
| | | import draftSave from '@/mixins/draftSave' |
| | | export default { |
| | | props: { |
| | | clickNodeVal: { |
| | |
| | | } |
| | | } |
| | | }, |
| | | mixins: [draftSave], |
| | | data() { |
| | | return { |
| | | value: "", |
| | |
| | | add(type) { |
| | | this.operationType = type |
| | | this.dialogVisible1 = true |
| | | this.getXmsg() |
| | | this.draftRestore('calibrationRecord', 'calibrationRecord', '', 'dialogVisible1') |
| | | this.getXmsg().then(() => { |
| | | this.draftRestore('calibrationRecordParams', 'calibrateParams', '', 'dialogVisible1') |
| | | }) |
| | | }, |
| | | // 查看详情 |
| | | handleViewClick(type, row) { |
| | |
| | | handleAttachmentClick(row) { |
| | | this.$download.saveAs(row.systemFileName, row.systemFileName) |
| | | }, |
| | | //导出 |
| | | handleDown() { |
| | | this.outLoading = true |
| | | deviceMetricRecordExport({ |
| | | deviceId: this.clickNodeVal.value, |
| | | type: 'calibrate' |
| | | }).then(res => { |
| | | this.outLoading = false |
| | | const blob = new Blob([res], { type: 'application/octet-stream' }); |
| | | this.$download.saveAs(blob, '设备校准.xlsx') |
| | | }) |
| | | }, |
| | | deleteFile() { |
| | | this.$confirm('此操作将永久删除文件, 是否继续?', '提示', { |
| | | confirmButtonText: '确定', |
| | |
| | | calibrationMaintenance() { |
| | | this.dialogVisible0 = true |
| | | this.getXmsg(); |
| | | this.$nextTick(() => { |
| | | this.draftRestore('calibrationMaintain', 'form0', this.clickNodeVal.value, 'dialogVisible0') |
| | | }) |
| | | }, |
| | | // 获取设备校准参数table信息 |
| | | async getXmsg() { |
| | |
| | | if (res.code == 200) { |
| | | this.$message.success('保存成功') |
| | | this.$refs['form0'].resetFields() |
| | | this.draftClear('calibrationMaintain') |
| | | this.draftRestore('calibrationMaintain', 'form0', this.clickNodeVal.value, 'dialogVisible0') |
| | | this.getXmsg() // 刷新设备校准参数表格 |
| | | } |
| | | this.calibrateParamsLoading = false |
| | |
| | | addOrUpdateDeviceMetricRecord(this.calibrationRecord).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('添加成功') |
| | | this.draftClear('calibrationRecord') |
| | | this.draftClear('calibrationRecordParams') |
| | | this.dialogVisible1 = false |
| | | this.getTableList(this.clickNodeVal.value) |
| | | } |
| | |
| | | }, |
| | | dialogVisible1(newVal) { |
| | | if (newVal === false) { |
| | | this.draftStop('calibrationRecord') |
| | | this.draftStop('calibrationRecordParams') |
| | | this.calibrateParams = [] |
| | | this.calibrationRecord = { |
| | | unitOfMeasure: '', // 计量单位 |