| | |
| | | <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> |
| | | <!-- <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)"> |
| | |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <!-- 操作日志 --> |
| | | <!-- <h4>--> |
| | | <!-- <div style="display: flex;--> |
| | | <!-- align-items: center;">--> |
| | | <!-- <span class="line"></span><span>本记录状态和操作日志</span>--> |
| | | <!-- </div>--> |
| | | <!-- </h4>--> |
| | | <!-- <el-table :data="tableDataOperate" style="width: 100%">--> |
| | | <!-- <el-table-column type="index" label="序号" width="100"></el-table-column>--> |
| | | <!-- <el-table-column prop="operator" label="操作人" width="120"></el-table-column>--> |
| | | <!-- <el-table-column prop="operationTime" label="操作时间" width="180"></el-table-column>--> |
| | | <!-- <el-table-column prop="operationType" label="操作类型" width="120"></el-table-column>--> |
| | | <!-- <el-table-column prop="operationContent" label="操作内容"></el-table-column>--> |
| | | <!-- </el-table>--> |
| | | </div> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button v-if="operationType === 'add'" @click="dialogVisible1 = false">取 消</el-button> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import fileDownload from "@/utils/file"; |
| | | import { |
| | | deviceMetricRecordPage, |
| | | deviceLog, |
| | | showDeviceMetricsCopy, |
| | | deleteDeviceMetricRecord, |
| | | deviceMetricRecordExport, |
| | |
| | | selectDeviceMetric, |
| | | deleteDeviceMetrics, |
| | | addOrUpdateDeviceMetricRecord, |
| | | saveOrUpdateDeviceMetric |
| | | } from '@/api/cnas/resourceDemand/device.js' |
| | | import { mapGetters } from "vuex"; |
| | | export default { |
| | | props: { |
| | | clickNodeVal: { |
| | |
| | | ], |
| | | }, |
| | | addRecordLoading: false, |
| | | tableDataOperate: [], // 本记录状态和操作日志 |
| | | upLoading: false, |
| | | operationType: '', |
| | | search: { |
| | |
| | | }, |
| | | // 用于上传文件的信息 |
| | | computed: { |
| | | ...mapGetters(["nickName"]), |
| | | action() { |
| | | return this.javaApi + '/personBasicInfo/saveCNASFile' |
| | | } |
| | | }, |
| | | mounted() { |
| | | //获取操作记录信息 |
| | | this.getOperateMsg(); |
| | | this.getTableList(this.clickNodeVal.value) // 获取设备校准列表数据 |
| | | }, |
| | | methods: { |
| | |
| | | this.search.total = res.data.total |
| | | }) |
| | | }, |
| | | getOperateMsg() { |
| | | deviceLog(this.clickNodeVal.value).then(res => { |
| | | this.tableDataOperate = res.data |
| | | }) |
| | | }, |
| | | // 添加核查记录 |
| | | add(type) { |
| | | this.operationType = type |
| | |
| | | }, |
| | | // 查看详情 |
| | | handleViewClick(type, row) { |
| | | showDeviceMetricsCopy({ id: row.id, type: calibrate }).then(res => { |
| | | showDeviceMetricsCopy({ id: row.id, type: 'calibrate' }).then(res => { |
| | | this.calibrateParams = res.data |
| | | }) |
| | | this.calibrationRecord = { ...row } |
| | |
| | | let state = /\.(jpg|jpeg|png|gif)$/i.test(row.systemFileName) |
| | | if (state) { |
| | | let url = this.javaApi + '/img/' + row.systemFileName; |
| | | fileDownload.downloadIamge(url, row.systemFileName) |
| | | this.$download.saveAs(url, row.systemFileName) |
| | | this.$message.success('下载成功') |
| | | } else { |
| | | const url = this.javaApi + '/word/' + row.systemFileName |
| | | const link = document.createElement('a'); |
| | | link.href = url; |
| | | link.download = row.systemFileName; |
| | | link.click(); |
| | | this.$download.saveAs(url, row.systemFileName) |
| | | this.$message.success('下载成功') |
| | | } |
| | | }, |
| | |
| | | this.outLoading = true |
| | | deviceMetricRecordExport({ |
| | | deviceId: this.clickNodeVal.value, |
| | | type: calibrate |
| | | type: 'calibrate' |
| | | }).then(res => { |
| | | this.outLoading = false |
| | | const blob = new Blob([res], { type: 'application/octet-stream' }); |
| | |
| | | this.calibrateParamsLoading = true |
| | | this.addCalibrateLoading = true |
| | | this.form0.deviceId = this.clickNodeVal.value; |
| | | const user = JSON.parse(localStorage.getItem('user')) |
| | | this.form0.createdBy = user.name; |
| | | this.form0.createdBy = this.nickName; |
| | | this.form0.type = 'calibrate' |
| | | deleteDeviceMetrics(this.form0).then(res => { |
| | | saveOrUpdateDeviceMetric(this.form0).then(res => { |
| | | if (res.code == 200) { |
| | | this.$message.success('保存成功') |
| | | this.$refs['form0'].resetFields() |
| | |
| | | } |
| | | this.addRecordLoading = true |
| | | this.calibrationRecord.deviceId = this.clickNodeVal.value; |
| | | let user = JSON.parse(localStorage.getItem('user')) |
| | | this.calibrationRecord.createUser = user.name |
| | | this.calibrationRecord.createUser = this.nickName |
| | | this.calibrationRecord.type = 'calibrate' |
| | | this.calibrationRecord.deviceMetricsCopyList = this.calibrateParams |
| | | addOrUpdateDeviceMetricRecord(this.calibrationRecord).then(res => { |
| | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | function downloadImage(url) { |
| | | const link = document.createElement('a'); |
| | | link.href = url; |
| | | link.target = "_blank" |
| | | link.download = 'attachment.jpg'; // 文件名 |
| | | document.body.appendChild(link); |
| | | link.click(); |
| | | document.body.removeChild(link); |
| | | } |
| | | |
| | | </script> |