Crunchy
2025-04-29 e5454b769d44a34af423bf87ac8a740bf8c20341
src/views/CNAS/systemManagement/documentRecords/outDocumenRecordt.vue
@@ -1,44 +1,34 @@
<template>
  <!-- 外来文件确认记录 -->
  <div class="ExternalDocumentConfirmationRecords">
    <el-tabs type="border-card" v-model="activeName" style="height: 100%;">
  <div class="capacity-scope">
    <el-tabs type="border-card" v-model="activeName" style="height: 100%;" @change="getTableData">
      <el-tab-pane label="填写" name="填写" style="height: 100%;">
        <div style="display: flex;align-items: center;justify-content: flex-end;margin-right: 20px;">
        <div style="display: flex;align-items: center;justify-content: flex-end;margin-bottom: 10px">
          <el-button size="small" type="primary" @click="openAdd('新增')" style="margin-left: 20px;">新增</el-button>
          <el-upload :action="action" :multiple="false" :show-file-list="false" accept='.doc,.docx' :headers="headers"
            :on-change="beforeUpload" :on-error="onError" ref='upload' :on-success="handleSuccessUp"
            style="display:inline-block;margin-left: 20px;">
          <el-upload :action="action" :multiple="false" :show-file-list="false" accept='.doc,.docx'
            :headers="uploadHeader" :on-change="beforeUpload" :on-error="onError" ref='upload'
            :on-success="handleSuccessUp" style="display:inline-block;margin-left: 20px;">
            <el-button size="small" type="primary" :loading="upLoading">导入</el-button></el-upload>
        </div>
        <div class="table" style="height: calc(100% - 200px)">
          <!-- <ValueTable ref="ValueTable0" :url="$api.manageRecordTotal.pageManageRecordVerify"
            :componentData="componentData0" :key="upIndex0" :delUrl="$api.manageRecordTotal.delManageRecordVerify"
            :upUrl="$api.manageRecordTotal.doManageRecordVerify" /> -->
          <lims-table :tableData="tableData0" :column="column0" :page="page0" :tableLoading="tableLoading0"
            :height="'calc(100vh - 270px)'" @pagination="pagination0"></lims-table>
        </div>
        <lims-table :tableData="tableData0" :column="column0" :page="page0" :tableLoading="tableLoading0"
                    :height="'calc(100vh - 290px)'" @pagination="pagination0"></lims-table>
      </el-tab-pane>
      <el-tab-pane label="历史记录" name="历史记录" style="height: 100%;">
        <div class="search">
          <div class="search_thing">
            <div class="search_label">年:</div>
            <div class="search_input">
        <div>
          <el-form :model="queryParams" ref="queryForm" size="small" :inline="true">
            <el-form-item label="年" prop="year">
              <el-date-picker v-model="queryParams.year" type="year" placeholder="选择年" format="yyyy" value-format="yyyy"
                size="small" @change="refreshTable()">
                              size="small" @change="refreshTable()">
              </el-date-picker>
            </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>
            </el-form-item>
            <el-form-item>
              <el-button type="primary" size="mini" @click="refreshTable">查询</el-button>
              <el-button size="mini" @click="refresh">重置</el-button>
            </el-form-item>
          </el-form>
        </div>
        <div class="table">
          <!-- <ValueTable ref="ValueTable" :url="$api.manageRecordTotal.pageManageRecordTotal"
            :componentData="componentData" :key="upIndex" /> -->
          <lims-table :tableData="tableData" :column="column" :page="page" :tableLoading="tableLoading"
            :height="'calc(100vh - 280px)'" @pagination="pagination"></lims-table>
        </div>
        <lims-table :tableData="tableData" :column="column" :page="page" :tableLoading="tableLoading"
                    :height="'calc(100vh - 290px)'" @pagination="pagination"></lims-table>
      </el-tab-pane>
    </el-tabs>
    <!-- 详情/下载/审核 -->
@@ -95,8 +85,6 @@
<script>
import limsTable from "@/components/Table/lims-table.vue";
import filePreview from '@/components/Preview/filePreview.vue'
import ValueTable from '@/components/Table/value-table.vue'
import { getToken } from "@/utils/auth";
import {
  addManageRecordVerify,
  pageManageRecordVerify,
@@ -107,8 +95,8 @@
  doManageRecordVerify
} from '@/api/cnas/systemManagement/documentRecords.js'
export default {
  name: 'OutDocumenRecordt',
  components: {
    ValueTable,
    filePreview,
    limsTable,
  },
@@ -174,8 +162,8 @@
            {
              name: "批准",
              type: "text",
              clickFun: (handleApproval) => {
                this.handleSubmit(row);
              clickFun: (row) => {
                this.handleApproval(row);
              },
              disabled: (row) => {
                return !row.submitUserName || !!row.ratifyUserName
@@ -244,59 +232,20 @@
  },
  // 用于上传文件的信息
  computed: {
    headers() {
      return {
        'Authorization': "Bearer " + getToken()
      }
    },
    action() {
      return this.javaApi + '/manageRecordVerify/exportManageRecordVerify'
    }
  },
  mounted() {
    // this.entityCopy = this.HaveJson(this.componentData.entity);
    this.getList()
    this.getList0()
    this.getTableData();
  },
  methods: {
    getPower() {
      let power = JSON.parse(sessionStorage.getItem('power'))
      let add = false
      let del = false
      let up = false;
      let sub = false
      let ratify = false
      for (var i = 0; i < power.length; i++) {
        if (power[i].menuMethod == 'addManageRecordVerify') {
          add = true
        }
        if (power[i].menuMethod == 'delManageRecordVerify') {
          del = true
        }
        if (power[i].menuMethod == 'exportManageRecordVerify') {
          up = true
        }
        if (power[i].menuMethod == 'submitManageRecordTotal') {
          sub = true
        }
        if (power[i].menuMethod == 'ratifyManageRecordTotal') {
          ratify = true
        }
    getTableData() {
      if (this.activeName === '填写') {
        this.getList0()
      } else {
        this.getList()
      }
      if (!ratify) {
        this.componentData.do.splice(3, 1)
      }
      if (!sub) {
        this.componentData.do.splice(2, 1)
      }
      if (!del) {
        this.componentData0.do.splice(1, 1)
      }
      if (!add) {
        this.componentData0.do.splice(0, 1)
      }
      this.addPower = add
      this.upPower = up
    },
    openAdd(title, row) {
      this.title = title;
@@ -345,7 +294,7 @@
        });
    },
    pagination0({ page, limit }) {
      this.pag0.current = page;
      this.page0.current = page;
      this.page0.size = limit;
      this.getList0();
    },
@@ -403,8 +352,7 @@
      }).catch(err => { });
    },
    handleDown0(row) {
      let url = this.javaApi + '/word/' + row.url
      this.$download.saveAs(url, '外来文件确认记录')
      this.$download.saveAs(row.url, '外来文件确认记录')
    },
    // 提交
    handleSubmit(row) {
@@ -420,7 +368,7 @@
            type: 'success',
            message: '提交成功!'
          });
          this.refreshTable()()
          this.refreshTable()
        }).catch(err => { });
      })
    },
@@ -442,12 +390,11 @@
      }).then(res => {
        this.checkLoading = false
        this.noCheckLoading = false
        if (res.code === 201) return
        this.$message({
          type: 'success',
          message: '操作成功!'
        });
        this.refreshTable()()
        this.refreshTable()
        this.lookDialogVisible = false
      }).catch(err => { });
    },
@@ -459,7 +406,6 @@
      })
        .then(() => {
          delManageRecordVerify({ id: row.id }).then((res) => {
            if (res.code == 201) return;
            this.$message.success("删除成功");
            this.getList0()
          });