From 89f3907f137d9e96bd56a5baef450de9383cdf03 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期三, 12 三月 2025 15:08:31 +0800
Subject: [PATCH] 设备搬迁-设备核查联调
---
src/views/CNAS/resourceDemand/device/component/check.vue | 61 +++++++++++++++++++-----------
1 files changed, 38 insertions(+), 23 deletions(-)
diff --git a/src/views/CNAS/resourceDemand/device/component/check.vue b/src/views/CNAS/resourceDemand/device/component/check.vue
index 40e0de3..2097352 100644
--- a/src/views/CNAS/resourceDemand/device/component/check.vue
+++ b/src/views/CNAS/resourceDemand/device/component/check.vue
@@ -181,7 +181,7 @@
<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;">
@@ -252,7 +252,13 @@
<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: {
@@ -336,7 +342,7 @@
computed: {
...mapGetters(["nickName"]),
action() {
- return this.javaApi + this.$api.personnel.saveCNASFile
+ return this.javaApi + '/personBasicInfo/saveCNASFile'
}
},
mounted() {
@@ -375,7 +381,7 @@
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
}
@@ -399,11 +405,7 @@
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()
@@ -420,7 +422,7 @@
},
// 鏌ヨ璁惧鏍告煡鍒楄〃
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
})
@@ -442,12 +444,11 @@
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
@@ -463,6 +464,22 @@
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()
@@ -498,7 +515,7 @@
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('鍒犻櫎鎴愬姛锛�')
}
@@ -512,10 +529,7 @@
},
// 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) {
@@ -525,7 +539,7 @@
},
// 鏌ョ湅璇︽儏
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 }
@@ -540,7 +554,7 @@
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('鍒犻櫎鎴愬姛锛�')
})
@@ -557,7 +571,7 @@
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('鍒犻櫎鎴愬姛锛�')
})
@@ -636,6 +650,7 @@
.btns {
text-align: right;
+ margin-top: 10px;
}
h4 {
--
Gitblit v1.9.3