spring
2025-02-26 2e87631ecb8060784c6e7a139048522cf47d5a12
搬迁测量不确定度的评定
已修改1个文件
已添加2个文件
373 ■■■■■ 文件已修改
src/api/cnas/process/uncertainty.js 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/process/uncertainty/index.vue 328 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/business/inspectionReview/index.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/cnas/process/uncertainty.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,39 @@
// ä¸ç¡®å®šåº¦è¯„定相关接口
import request from "@/utils/request";
//导出
export function exportProcessEvaluate(query) {
  return request({
    url: "/processEvaluate/exportProcessEvaluate",
    method: "get",
    responseType: "blob",
    params: query,
  });
}
// å¡«å†™ (主要上传id和备注note就好了)
export function doProcessEvaluate(data) {
  return request({
    url: "/processEvaluate/doProcessEvaluate",
    method: "post",
    data: data,
  });
}
//删除
export function delProcessEvaluate(query) {
  return request({
    url: "/processEvaluate/delProcessEvaluate",
    method: "delete",
    params: query,
  });
}
//分页
export function pageProcessEvaluate(query) {
  return request({
    url: "/processEvaluate/pageProcessEvaluate",
    method: "get",
    params: query,
  });
}
src/views/CNAS/process/uncertainty/index.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,328 @@
<template>
  <div class="uncertainty-evaluation">
    <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>
      <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>
        <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'>
          <el-button :loading="upLoading" size="small" type="primary">导入</el-button></el-upload>
      </div>
    </div>
    <div class="table">
      <lims-table :tableData="tableData" :column="column" :tableLoading="tableLoading" :height="'calc(100vh - 270px)'"
        :page="page" @pagination="pagination"></lims-table>
    </div>
    <el-dialog :visible.sync="addDialogVisible" title="评价" width="400px">
      <el-row>
        <el-col :span="24" style="margin-bottom: 16px;">
          <div class="search_thing">
            <div class="search_label">评价:</div>
            <div class="search_input"><el-input v-model="addInfo.note" clearable placeholder="请输入"
                size="small"></el-input></div>
          </div>
        </el-col>
        <el-col :span="24" style="margin-bottom: 16px;">
          <div class="search_thing">
            <div class="search_label">日期:</div>
            <div class="search_input">
              <el-date-picker v-model="addInfo.evaluateTime" format="yyyy-MM-dd" placeholder="选择日期" size="small"
                style="width: 100%;" type="date" value-format="yyyy-MM-dd">
              </el-date-picker>
            </div>
          </div>
        </el-col>
      </el-row>
      <span slot="footer" class="dialog-footer">
        <el-button @click="addDialogVisible = false">取 æ¶ˆ</el-button>
        <el-button :loading="addLoading" type="primary" @click="handleAdd">ç¡® å®š</el-button>
      </span>
    </el-dialog>
    <el-dialog :visible.sync="lookDialogVisible" fullscreen title="查看附件" top="5vh" width="800px">
      <filePreview v-if="lookDialogVisible" :currentFile="{}" :fileUrl="javaApi + '/word/' + currentInfo.reportUrl"
        style="max-height: 90vh;overflow-y: auto;" />
    </el-dialog>
  </div>
</template>
<script>
import limsTable from "@/components/Table/lims-table.vue";
import filePreview from "@/components/Preview/filePreview.vue";
import {
  exportProcessEvaluate,
  doProcessEvaluate,
  delProcessEvaluate,
  pageProcessEvaluate,
} from '@/api/cnas/process/uncertainty.js'
import { mapGetters } from "vuex";
export default {
  components: {
    limsTable,
    filePreview
  },
  data() {
    return {
      addPower: false,
      outPower: false,
      outLoading: false,
      upLoading: false,
      addDialogVisible: false,
      addInfo: {},
      addLoading: false,
      currentInfo: {},
      lookDialogVisible: false,
      queryParams: {},
      tableData: [],
      column: [
        { label: "报告名称", prop: "reportName" },
        { label: "评价人", prop: "evaluateUserName" },
        { label: "评价日期", prop: "evaluateTime" },
        { label: "备注", prop: "note" },
        {
          dataType: "action",
          fixed: "right",
          label: "操作",
          operation: [
            {
              name: "评价",
              type: "text",
              clickFun: (row) => {
                this.handleTell(row);
              },
            },
            {
              name: "删除",
              type: "text",
              clickFun: (row) => {
                this.handleDelete(row);
              },
            },
            {
              name: "下载",
              type: "text",
              clickFun: (row) => {
                this.handleDown(row);
              },
            },
            {
              name: "查看附件",
              type: "text",
              clickFun: (row) => {
                this.handleLook(row);
              },
            },
          ],
        },
      ],
      page: {
        total: 0,
        size: 10,
        current: 0,
      },
      tableLoading: false,
    }
  },
  // ç”¨äºŽä¸Šä¼ æ–‡ä»¶çš„信息
  computed: {
    ...mapGetters(["userId"]),
    action() {
      return this.javaApi + '/processEvaluate/addProcessEvaluate'
    }
  },
  mounted() {
    // this.entityCopy = this.HaveJson(this.componentData.entity);
    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');
      })
    },
    handleDown(row) {
      let url = this.javaApi + '/word/' + row.reportUrl
      this.$download.saveAs(url, row.reportName);
    },
    beforeUpload(file) {
      if (file.size > 1024 * 1024 * 10) {
        this.$message.error('上传文件不超过10M');
        this.$refs.upload.clearFiles()
        return false;
      } else {
        // this.upLoading = true;
        return true;
      }
    },
    onError(err, file, fileList) {
      this.$message.error('上传失败')
      this.$refs.upload.clearFiles()
    },
    handleSuccessUp(response) {
      this.upLoading = false;
      if (response.code == 200) {
        this.$message.success('上传成功');
        this.refreshTable()
      }
    },
    handleTell(row) {
      this.addInfo = row;
      this.addDialogVisible = true;
    },
    handleAdd() {
      this.addLoading = true;
      doProcessEvaluate({
        id: this.addInfo.id,
        note: this.addInfo.note,
        evaluateTime: this.addInfo.evaluateTime,
        evaluateUser: this.userId
      }).then((res) => {
        this.addLoading = false;
        if (res.code == 201) {
          this.$message.error('评价失败');
          return;
        }
        this.$message.success('评价成功');
        this.addDialogVisible = false;
        this.refreshTable()
      })
    },
    getList() {
      this.tableLoading = true;
      let param = { ...this.queryParams, ...this.page };
      delete param.total;
      pageProcessEvaluate({ ...param })
        .then((res) => {
          this.tableLoading = false;
          if (res.code === 200) {
            this.tableData = res.data.records;
            this.page.total = res.data.total;
          }
        })
        .catch((err) => {
          this.tableLoading = false;
        });
    },
    pagination({ page, limit }) {
      this.page.current = page;
      this.page.size = limit;
      this.getList();
    },
    refresh() {
      this.queryParams = {};
      this.page.current = 1;
      this.getList();
    },
    refreshTable() {
      this.page.current = 1;
      this.getList();
    },
    handleLook(row) {
      this.currentInfo = row;
      this.lookDialogVisible = true;
    },
    handleDelete(row) {
      this.$confirm("是否删除该条数据?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          delProcessEvaluate({ id: row.id }).then((res) => {
            if (res.code == 201) return;
            this.$message.success("删除成功");
            this.refresh();
          });
        })
        .catch(() => { });
    },
  }
}
</script>
<style scoped>
.title {
  height: 60px;
  line-height: 60px;
}
.search {
  background-color: #fff;
  height: 80px;
  display: flex;
  align-items: center;
  position: relative;
}
.search_thing {
  width: 350px;
  display: flex;
  align-items: center;
}
.search_label {
  width: 80px;
  font-size: 14px;
  text-align: right;
}
.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>
src/views/business/inspectionReview/index.vue
@@ -3,8 +3,7 @@
    <div>
      <el-form :model="entity" ref="entity" size="small" :inline="true">
        <el-form-item label="委托编号" prop="entrustCode">
          <el-input size="small" placeholder="请输入" clearable
                    v-model="entity.entrustCode"
          <el-input size="small" placeholder="请输入" clearable v-model="entity.entrustCode"
                    @keyup.enter.native="refreshTable()"></el-input>
        </el-form-item>
        <el-form-item label="下单类别" prop="entrustCode">
@@ -31,7 +30,8 @@
    <el-dialog title="报告查看" :visible.sync="issuedVisible" width="80vw" :modal-append-to-body="false"
               :fullscreen="fullscreen">
      <div class="full-screen">
        <i class="el-icon-full-screen" style="cursor: pointer;font-size: 18px" @click="fullscreen=true;" v-if="!fullscreen"></i>
        <i class="el-icon-full-screen" style="cursor: pointer;font-size: 18px" @click="fullscreen = true;"
          v-if="!fullscreen"></i>
        <img src="@/assets/images/no-full.svg" alt="" v-else style="cursor: pointer;" @click="fullscreen=false;" >
      </div>
      <div style="height: 80vh;" v-if="issuedVisible">