| | |
| | | <el-button v-if="operationType === 'add'" slot="append" icon="el-icon-delete-solid" |
| | | @click="deleteFile"></el-button> |
| | | </el-input> |
| | | <el-upload v-if="operationType === 'add'" ref="upload" :action="action" :before-upload="beforeUpload" :headers="headers" |
| | | <el-upload v-if="operationType === 'add'" ref="upload" :action="action" :before-upload="beforeUpload" :headers="uploadHeader" |
| | | :limit="1" :on-error="onError" :on-success="handleSuccessUp" |
| | | :show-file-list="false" |
| | | style="float: right;"> |
| | |
| | | <script> |
| | | import file from '@/utils/file'; |
| | | import { mapGetters } from "vuex"; |
| | | import {deviceMetricRecordExport} from "@/api/cnas/resourceDemand/device"; |
| | | import { |
| | | addOrUpdateDeviceMetricRecord, deleteCNASFile, deleteDeviceMetricRecord, deleteDeviceMetrics, |
| | | deviceMetricRecordExport, |
| | | deviceMetricRecordPage, |
| | | saveOrUpdateDeviceMetric, |
| | | selectDeviceMetric, showDeviceMetricsCopy |
| | | } from "@/api/cnas/resourceDemand/device"; |
| | | export default { |
| | | components: {}, |
| | | props: { |
| | |
| | | computed: { |
| | | ...mapGetters(["nickName"]), |
| | | action() { |
| | | return this.javaApi + this.$api.personnel.saveCNASFile |
| | | return this.javaApi + '/personBasicInfo/saveCNASFile' |
| | | } |
| | | }, |
| | | mounted() { |
| | |
| | | async getXmsg() { |
| | | this.calibrateParamsLoading = true |
| | | try { |
| | | await this.$axios.get(this.$api.deviceCheck.selectDeviceMetric + "?deviceId=" + this.clickNodeVal.value + "&type=examine").then(res => { |
| | | await selectDeviceMetric({deviceId: this.clickNodeVal.value, type: 'examine'}).then(res => { |
| | | if (res.code == 200) { |
| | | this.calibrateParams = res.data |
| | | } |
| | |
| | | this.form0.deviceId = this.clickNodeVal.value; |
| | | this.form0.createdBy = this.nickName; |
| | | this.form0.type = 'examine' |
| | | this.$axios.post(this.$api.deviceCheck.saveOrUpdateDeviceMetric, this.form0, { |
| | | headers: { |
| | | 'Content-Type': 'application/json' |
| | | } |
| | | }).then(res => { |
| | | saveOrUpdateDeviceMetric(this.form0).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('保存成功') |
| | | this.$refs['form0'].resetFields() |
| | |
| | | }, |
| | | // 查询设备核查列表 |
| | | getTableList(deviceId) { |
| | | this.$axios.get(this.$api.deviceCheck.deviceMetricRecordPage + '?deviceId=' + deviceId + "&size=" + this.search.size + "¤t=" + this.search.current + "&type=examine").then(res => { |
| | | deviceMetricRecordPage({deviceId: deviceId, size: this.search.size, current: this.search.current, type: 'examine'}).then(res => { |
| | | this.tableData = res.data.records |
| | | this.search.total = res.data.total |
| | | }) |
| | |
| | | this.calibrationRecord.deviceId = this.clickNodeVal.value; |
| | | this.calibrationRecord.createUser = this.nickName |
| | | this.calibrationRecord.deviceMetricsCopyList = this.calibrateParams |
| | | this.calibrationRecord.deviceMetricsCopyList.forEach(ele => { |
| | | delete ele.creationTime |
| | | }) |
| | | this.calibrationRecord.type = 'examine' |
| | | this.$axios.post(this.$api.deviceCheck.addOrUpdateDeviceMetricRecord, this.calibrationRecord, { |
| | | headers: { |
| | | 'Content-Type': 'application/json' |
| | | } |
| | | }).then(res => { |
| | | addOrUpdateDeviceMetricRecord(this.calibrationRecord).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('添加成功') |
| | | this.dialogVisible1 = false |
| | |
| | | this.$message.warning('有必填项未填'); |
| | | } |
| | | }) |
| | | }, |
| | | handleClose(done) { |
| | | this. calibrationRecord = { |
| | | unitOfMeasure: '', // 核查人 |
| | | calibrationDate: '', // 核查日期 |
| | | nextCalibrationDate: '', // 下次核查日期 |
| | | calculatingApparatus: '', // 核查器具 |
| | | standardRange: '', // 核查标准量程 |
| | | calibrationStandardUncertainty: '', // 核查标准不确定度 |
| | | byDocument: '', // 核查指导书 |
| | | certificateSerialNumber: '', // 检查报告指导书 |
| | | fileName: '', // 附件 |
| | | status: '', // 核查总结论 |
| | | remark: '', // 备注 |
| | | } |
| | | this.dialogVisible1 = false |
| | | }, |
| | | resetcalibrationRecord() { |
| | | this.$refs.calibrationRecord.resetFields() |
| | |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | this.$axios.delete(this.$api.personnel.deleteCNASFile + "?fileName=" + this.form.systemFileName).then(res => { |
| | | deleteCNASFile({fileName: this.form.systemFileName}).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('删除成功!') |
| | | } |
| | |
| | | }, |
| | | // end |
| | | handleAttachmentClick(row) { |
| | | // 模拟下载附件 |
| | | const imageUrl = this.javaApi + '/img/' + row.systemFileName; // 图片 URL |
| | | file.downloadIamge(imageUrl, row.fileName) |
| | | // downloadImage(imageUrl, row.fileName); |
| | | this.$download.saveAs(row.systemFileName, row.fileName) |
| | | }, |
| | | // 添加核查记录 |
| | | add(type) { |
| | |
| | | }, |
| | | // 查看详情 |
| | | handleViewClick(type, row) { |
| | | this.$axios.get(this.$api.deviceCheck.showDeviceMetricsCopy + "?id=" + row.id + "&type=examine").then(res => { |
| | | showDeviceMetricsCopy({id: row.id, type: 'examine'}).then(res => { |
| | | this.calibrateParams = res.data |
| | | }) |
| | | this.calibrationRecord = { ...row } |
| | |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | this.$axios.delete(this.$api.deviceCheck.deleteDeviceMetricRecord + "?id=" + row.id).then(res => { |
| | | deleteDeviceMetricRecord({id: row.id}).then(res => { |
| | | this.getTableList(this.clickNodeVal.value) // 获取设备校准列表数据 |
| | | this.$message.success('删除成功!') |
| | | }) |
| | |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | this.$axios.delete(this.$api.deviceCheck.deleteDeviceMetrics + "?id=" + row.id).then(res => { |
| | | deleteDeviceMetrics({id: row.id}).then(res => { |
| | | this.getXmsg(); |
| | | this.$message.success('删除成功!') |
| | | }) |
| | |
| | | |
| | | .btns { |
| | | text-align: right; |
| | | margin-top: 10px; |
| | | } |
| | | |
| | | h4 { |