gaoluyang
2025-03-12 89f3907f137d9e96bd56a5baef450de9383cdf03
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 + "&current=" + 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 {