Crunchy
2025-03-17 0a26d58a3906b9e13946c7cb46fae51a0de98920
src/views/CNAS/process/uncertainty/index.vue
@@ -1,21 +1,23 @@
<template>
  <div class="uncertainty-evaluation">
  <div class="capacity-scope">
    <div class="search">
      <div class="search_thing">
        <div class="search_label">报告名称:</div>
        <div class="search_input"><el-input v-model="queryParams.reportName" clearable placeholder="请输入" size="small"
            @keyup.enter.native="refreshTable()"></el-input></div>
      <div>
        <el-form :model="queryParams" ref="queryForm" size="small" :inline="true">
          <el-form-item label="报告名称" prop="reportName">
            <el-input v-model="queryParams.reportName" clearable placeholder="请输入" size="small"
                      @keyup.enter.native="refreshTable()"></el-input>
          </el-form-item>
          <el-form-item>
            <el-button type="primary" icon="el-icon-search" size="mini" @click="refreshTable">查 询</el-button>
            <el-button icon="el-icon-refresh" size="mini" @click="refresh">重 置</el-button>
          </el-form-item>
        </el-form>
      </div>
      <div class="search_thing" style="padding-left: 30px;">
        <el-button size="small" @click="refresh()">重 置</el-button>
        <el-button size="small" type="primary" @click="refreshTable()">查 询</el-button>
      </div>
      <div class="btn">
        <el-button :loading="outLoading" size="small" style="margin-right: 16px;margin-top: 3px;" type="primary"
          @click="handleDown0">导出</el-button>
      <div style="display: flex;align-items: center;">
        <el-button :loading="outLoading" size="small" type="primary" style="margin-right: 10px" @click="handleDown0">导出</el-button>
        <el-upload ref='upload' :action="action" :headers="uploadHeader" :on-change="beforeUpload" :on-error="onError"
          :on-success="handleSuccessUp" :show-file-list="false"
          accept='.jpg,.jpeg,.png,.gif,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.zip,.rar'>
                   :on-success="handleSuccessUp" :show-file-list="false"
                   accept='.jpg,.jpeg,.png,.gif,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.zip,.rar'>
          <el-button :loading="upLoading" size="small" type="primary">导入</el-button></el-upload>
      </div>
    </div>
@@ -66,6 +68,7 @@
} from '@/api/cnas/process/uncertainty.js'
import { mapGetters } from "vuex";
export default {
  name: 'Uncertainty',
  components: {
    limsTable,
    filePreview
@@ -144,40 +147,10 @@
    this.getList()
  },
  methods: {
    getPower() {
      let power = JSON.parse(sessionStorage.getItem('power'))
      let up = false
      let del = false
      let add = false
      let out = false
      for (var i = 0; i < power.length; i++) {
        if (power[i].menuMethod == 'doProcessEvaluate') {
          up = true
        }
        if (power[i].menuMethod == 'addProcessEvaluate') {
          add = true
        }
        if (power[i].menuMethod == 'delProcessEvaluate') {
          del = true
        }
        if (power[i].menuMethod == 'exportProcessEvaluate') {
          out = true
        }
      }
      if (!del) {
        this.componentData.do.splice(1, 1)
      }
      if (!up) {
        this.componentData.do.splice(0, 1)
      }
      this.outPower = out
      this.addPower = add
    },
    handleDown0() {
      this.outLoading = true
      exportProcessEvaluate(this.queryParams).then(res => {
        this.outLoading = false
        if (res.code === 201) return
        const blob = new Blob([res], { type: 'application/octet-stream' });
        this.$download.saveAs(blob, '测量不确定度的评定.xlsx');
      })
@@ -187,7 +160,7 @@
        this.$message.warning('暂无文件')
        return
      }
      this.$download.downloadFileFromUrl(row.reportUrl, row.reportName);
      this.$download.saveAs(row.reportUrl, row.reportName);
    },
    beforeUpload(file) {
      if (file.size > 1024 * 1024 * 10) {
@@ -223,10 +196,6 @@
        evaluateUser: this.userId
      }).then((res) => {
        this.addLoading = false;
        if (res.code == 201) {
          this.$message.error('评价失败');
          return;
        }
        this.$message.success('评价成功');
        this.addDialogVisible = false;
        this.refreshTable()
@@ -274,7 +243,6 @@
      })
        .then(() => {
          delProcessEvaluate({ id: row.id }).then((res) => {
            if (res.code == 201) return;
            this.$message.success("删除成功");
            this.refresh();
          });
@@ -286,17 +254,10 @@
</script>
<style scoped>
.title {
  height: 60px;
  line-height: 60px;
}
.search {
  background-color: #fff;
  height: 80px;
  height: 46px;
  display: flex;
  align-items: center;
  position: relative;
  justify-content: space-between;
}
.search_thing {
@@ -313,19 +274,5 @@
.search_input {
  width: calc(100% - 80px);
}
.table {
  background-color: #fff;
  height: calc(100% - 60px - 80px - 10px - 40px);
  padding: 20px;
}
.btn {
  position: absolute;
  top: 16px;
  right: 20px;
  display: flex;
  align-items: center;
}
</style>