src/views/CNAS/resourceDemand/device/component/calibration.vue
@@ -4,7 +4,6 @@
    <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>
@@ -110,8 +109,10 @@
          <el-row>
            <el-col :span="6">
              <el-form-item label="校准服务机构:" prop="unitOfMeasure">
                <el-input v-model="calibrationRecord.unitOfMeasure" :disabled="operationType === 'view'"
                  size="small"></el-input>
                <el-select v-model="calibrationRecord.unitOfMeasure" :disabled="operationType === 'view'" clearable filterable
                  size="small" style="width: 100%">
                  <el-option v-for="name in calibrationServiceOptions" :key="name" :label="name" :value="name"></el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="8">
@@ -256,13 +257,13 @@
  deviceMetricRecordPage,
  showDeviceMetricsCopy,
  deleteDeviceMetricRecord,
  deviceMetricRecordExport,
  deleteCNASFile,
  selectDeviceMetric,
  deleteDeviceMetrics,
  addOrUpdateDeviceMetricRecord,
  saveOrUpdateDeviceMetric
} from '@/api/cnas/resourceDemand/device.js'
import { selectQualifiedSupplierManagementPage } from '@/api/cnas/externalService/supplierManage/supplierManage'
import { mapGetters } from "@/utils/store-compat";
export default {
  props: {
@@ -295,7 +296,7 @@
        fileName: '', //
      },
      formRules: {
        unitOfMeasure: [{ required: true, message: '请输入校准服务机构', trigger: 'blur' }],
        unitOfMeasure: [{ required: true, message: '请选择校准服务机构', trigger: 'change' }],
        calibrationDate: [{ required: true, message: '请选择校准日期', trigger: 'change' }],
        calculatingApparatus: [{ required: true, message: '请输入计算器具', trigger: 'blur' }],
        standardRange: [{ required: true, message: '请输入计算标准量程', trigger: 'blur' }],
@@ -332,6 +333,7 @@
      addRecordLoading: false,
      upLoading: false,
      operationType: '',
      qualifiedSupplierNames: [],
      search: {
        size: 20,
        current: 1,
@@ -341,16 +343,33 @@
  },
  // 用于上传文件的信息
  computed: {
    // 校准服务机构下拉选项(合格供应商 + 当前值兜底)
    calibrationServiceOptions() {
      const list = this.qualifiedSupplierNames.slice();
      const value = this.calibrationRecord.unitOfMeasure;
      if (value && list.indexOf(value) === -1) list.push(value);
      return list;
    },
    ...mapGetters(["nickName"]),
    action() {
      return this.javaApi + '/personBasicInfo/saveCNASFile'
    }
  },
  mounted() {
    this.obtainQualifiedSupplierList()
    //获取操作记录信息
    this.getTableList(this.clickNodeVal.value) // 获取设备校准列表数据
  },
  methods: {
    // 拉取合格供应商列表(校准服务机构下拉选项)
    obtainQualifiedSupplierList() {
      selectQualifiedSupplierManagementPage({ current: 1, size: 999 }).then(res => {
        if (res.code === 200) {
          const rows = (res.data && res.data.records) || [];
          this.qualifiedSupplierNames = [...new Set(rows.map(r => r.supplierName).filter(Boolean))];
        }
      });
    },
    //状态判定
    checkRadio() {
      let resultList = this.calibrateParams.map(ele => ele.result)
@@ -418,18 +437,6 @@
    },
    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('此操作将永久删除文件, 是否继续?', '提示', {
@@ -684,7 +691,7 @@
.el-table {
  font-size: 14px;
  color: #333;
  color: var(--lims-text);
}
.el-table thead {