spring
2025-02-25 b1b8cb279ab1548348dfe0035abcbbbf3d62b380
报告结果搬迁
已修改2个文件
197 ■■■■ 文件已修改
src/api/cnas/process/reportResults.js 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/process/reportResults/index.vue 173 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/cnas/process/reportResults.js
@@ -2,11 +2,11 @@
import request from "@/utils/request";
//8报告结果-导出
export function exportProcessReport(query) {
export function exportProcessReport(data) {
  return request({
    url: "/processReport/exportProcessReport",
    method: "get",
    params: query,
    method: "post",
    data: data,
  });
}
@@ -27,3 +27,21 @@
    data: data,
  });
}
//8报告结果-删除
export function delProcessReport(query) {
  return request({
    url: "/processReport/delProcessReport",
    method: "delete",
    params: query,
  });
}
//8报告结果-列表
export function pageProcessReport(query) {
  return request({
    url: "/processReport/pageProcessReport",
    method: "get",
    params: query,
  });
}
src/views/CNAS/process/reportResults/index.vue
@@ -1,12 +1,5 @@
<template>
  <div class="report-results">
    <el-row class="title">
      <el-col :span="12" style="padding-left: 20px;text-align: left;">报告结果</el-col>
      <el-col :span="12" style="text-align: right;">
        <el-button size="medium" type="primary" @click="handleDown" :loading="outLoading" v-if="outPower">导出</el-button>
        <el-button size="medium" type="primary" @click="openAdd" v-if="addPower">新增</el-button>
      </el-col>
    </el-row>
    <div class="search">
      <div class="search_thing">
        <div class="search_label">检验报告编号:</div>
@@ -17,12 +10,15 @@
        <el-button size="small" @click="refresh()">重 置</el-button>
        <el-button size="small" type="primary" @click="refreshTable()">查 询</el-button>
      </div>
      <div class="btn">
        <el-button size="medium" type="primary" @click="handleDown" :loading="outLoading" v-if="outPower">导出</el-button>
        <el-button size="medium" type="primary" @click="openAdd" v-if="addPower">新增</el-button>
      </div>
    </div>
    <div class="table">
      <lims-table :tableData="tableData" :column="column" :tableLoading="tableLoading" :height="'calc(100vh - 290px)'"
        :page="page" @pagination="pagination"></lims-table>
      <!-- <ValueTable ref="ValueTable" :url="$api.processReport.pageProcessReport"
        :delUrl="$api.processReport.delProcessReport" :componentData="componentData" :key="upIndex" /> -->
      <lims-table :tableData="tableData" :column="column" :tableLoading="tableLoading" :height="'calc(100vh - 270px)'"
        :page="page" @pagination="pagination" :isSelection="true"
        :handleSelectionChange="handleSelectionChange"></lims-table>
    </div>
    <el-dialog :title="title" :visible.sync="addDialogVisible" width="400px" top="6vh">
      <el-row>
@@ -114,7 +110,9 @@
import {
  exportProcessReport,
  doProcessReport,
  addProcessReport
  addProcessReport,
  pageProcessReport,
  delProcessReport
} from '@/api/cnas/process/reportResults.js'
import {
  selectUserCondition,
@@ -128,50 +126,6 @@
      outLoading: false,
      addPower: true,
      outPower: true,
      componentData: {
        entity: {
          insReportCode: null,
          // sendUserName: null,
          orderBy: {
            field: 'createTime',
            order: 'desc'
          }
        },
        isIndex: true,
        showSelect: true,
        select: true,
        selectMethod: 'handleChangeTask',
        do: [
          {
            id: 'handleWork',
            font: '修改',
            type: 'text',
            method: 'handleWork'
          },
          {
            id: 'delete',
            font: '删除',
            type: 'text',
            method: 'doDiy'
          }
        ],
        tagField: {},
        selectField: {
          sendUser: {
            select: []
          },
          signatory: {
            select: []
          },
        },
        // addUpload:['signatoryUrl'],
        requiredAdd: [],
        requiredUp: [],
        needSort: [],
        inputType: ''
      },
      entityCopy: {},
      upIndex: 0,
      personList: [],
      title: '新增',
      addDialogVisible: false,
@@ -183,20 +137,18 @@
      queryParams: {},
      tableData: [],
      column: [
        { label: "编号", prop: "number" },
        { label: "辅助项目名称", prop: "auxiliaryProject", width: "120px" },
        { label: "检验报告编号", prop: "insReportCode" },
        { label: "页数", prop: "pages", width: "120px" },
        {
          label: "实验室",
          prop: "laboratory",
          dataType: "tag",
          formatData: (params) => {
            return this.laboratoryList.find((m) => m.value == params).label;
          },
          label: "发送份数",
          prop: "number",
        },
        { label: "单位", prop: "unit" },
        { label: "核准工时", prop: "approvedWorkingHour" },
        { label: "部门", prop: "department" },
        { label: "备注", prop: "remarks" },
        { label: "发往何处", prop: "send" },
        { label: "发送方式", prop: "method" },
        { label: "发送日期", prop: "sendTime" },
        { label: "发送人", prop: "sendUserName" },
        { label: "签收人", prop: "signatoryName" },
        { label: "备注", prop: "remark" },
        {
          dataType: "action",
          fixed: "right",
@@ -206,12 +158,7 @@
              name: "编辑",
              type: "text",
              clickFun: (row) => {
                this.openAdd("编辑", row);
              },
              showHide: (row) => {
                return this.checkPermi([
                  "performance:manHour:workTimeConfig:edit",
                ]);
                this.handleWork(row);
              },
            },
            {
@@ -219,11 +166,6 @@
              type: "text",
              clickFun: (row) => {
                this.handleDelete(row);
              },
              showHide: (row) => {
                return this.checkPermi([
                  "performance:manHour:workTimeConfig:del",
                ]);
              },
            },
          ],
@@ -239,7 +181,7 @@
  },
  mounted() {
    // this.entityCopy = this.HaveJson(this.componentData.entity);
    // this.getPower()
    this.getList()
    this.getAuthorizedPerson()
  },
  methods: {
@@ -277,14 +219,12 @@
        this.$message.warning('请选择要导出的数据')
        return
      }
      // html导出为word,样子太丑了,代码先放着吧
      // exportHtmlToWord(this.$refs.content,'检验报告发放登记表')
      this.outLoading = true
      exportProcessReport({ ids: this.mutilSelect.map(m => m.id) }).then(res => {
        this.outLoading = false
        if (res.code === 201) return
        this.$message.success('导出成功')
        const url = this.javaApi + '/word/' + res.message;
        const url = this.javaApi + '/word/' + res.data;
        this.$download.saveAs(url, "报告结果");
      })
    },
@@ -295,13 +235,38 @@
      }
      this.addDialogVisible = true;
    },
    refreshTable() {
      this.$refs['ValueTable'].selectList()
    getList() {
      this.tableLoading = true;
      let param = { ...this.queryParams, ...this.page };
      delete param.total;
      pageProcessReport({ ...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.componentData.entity = this.HaveJson(this.entityCopy)
      this.upIndex++
      this.refreshTable()
      this.queryParams = {};
      this.page.current = 1;
      this.getList();
    },
    refreshTable() {
      this.page.current = 1;
      this.getList();
    },
    handleSelectionChange(val) {
      this.mutilSelect = val
    },
    getAuthorizedPerson() {
      selectUserCondition().then(res => {
@@ -362,22 +327,33 @@
    },
    handleChangeTask(list) {
      this.mutilSelect = list
    }
    },
    handleDelete(row) {
      this.$confirm("是否删除该条数据?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          delProcessReport({ 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 {
@@ -397,9 +373,7 @@
}
.table {
  margin-top: 10px;
  background-color: #fff;
  width: calc(100% - 40px);
  height: calc(100% - 60px - 80px - 10px - 40px);
  padding: 20px;
}
@@ -407,7 +381,6 @@
.tables {
  table-layout: fixed;
  width: 100%;
  margin-top: 10px;
}
.tables td {
@@ -428,4 +401,10 @@
  white-space: normal;
  /* 默认换行 */
}
.btn {
  position: absolute;
  top: 16px;
  right: 20px;
}
</style>