spring
2025-04-01 4fb12efd2e19ed835a47112a1eb937eccb80a549
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
<template>
  <div class="capacity-scope">
    <div class="search">
      <el-form :model="queryParams" ref="queryParams" size="small" :inline="true">
        <el-form-item label="更新人" prop="name">
          <el-input v-model="queryParams.name" clearable placeholder="请输入" size="small"
            @keyup.enter.native="refreshTable()"></el-input>
        </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>
    <lims-table :tableData="tableData" :column="column" :page="page" :tableLoading="tableLoading"
      :height="'calc(100vh - 250px)'" @pagination="pagination"></lims-table>
  </div>
</template>
 
<script>
import limsTable from "@/components/Table/lims-table.vue";
export default {
  components: {
    limsTable,
  },
  data() {
    return {
      queryParams: {},
      tableData: [],
      column: [
        { label: "更新原因", prop: "number" },
        { label: "更新时间", prop: "name" },
        { label: "更新人", prop: "remark" },
        { label: "状态", prop: "remark" },
        {
          dataType: "action",
          label: "操作",
          operation: [
            {
              name: "上传附件",
              type: "upload",
              accept: '.jpg,.jpeg,.png,.gif,.doc,.docx,.xls,.xlsx,.pdf',
              url: '/insReport/inReport',
              uploadIdFun: (row) => {
                return row.id
              }
            },
            {
              name: "审批",
              type: "text",
              clickFun: (row) => {
                this.handleCheck(row);
              },
              // showHide: (row) => {
              //   return this.checkPermi(["standard:model:del"]);
              // },
            },
            {
              name: "查看",
              type: "text",
              clickFun: (row) => {
                this.handleLook(row);
              },
            },
            {
              name: "下载附件",
              type: "text",
              clickFun: (row) => {
                this.handleDown(row);
              },
            },
          ],
        },
      ],
      page: {
        total: 0,
        size: 10,
        current: 0,
      },
      tableLoading: false,
    }
  },
  methods: {
    getList() {
      this.tableLoading = true;
      let param = { ...this.queryParams, ...this.page };
      delete param.total;
      selectStandardTemplatePageList({ ...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();
    },
    refreshTable(e) {
      this.page.current = 1;
      this.getList();
    },
    refresh() {
      this.queryParams = {};
      this.page.current = 1;
      this.getList();
    },
    // 审核
    handleCheck(row) {
      this.$confirm("是否审核通过?", "审核", {
        confirmButtonText: "通过",
        cancelButtonText: "不通过",
        type: "warning",
        closeOnClickModal: false, // 禁止点击遮罩层关闭
        distinguishCancelAndClose: true,
        beforeClose: (action, instance, done) => {
          if (action === 'confirm') {
            // 通过
            this.refresh();
          } else if (action === 'cancel') {
            // 不通过
            this.refresh();
          } else if (action === 'close') {
            // 点击“×”按钮,不允许关闭
            done();
            console.log("×按钮点击事件,不关闭弹框");
          }
        }
      })
    },
    // 查看
    handleLook(row) { },
    // 下载附件
    handleDown(row) {
      this.$download.saveAs(row.fileUrl, row.fileName);
    },
  }
}
</script>
 
<style scoped>
.search {
  height: 46px;
  display: flex;
  justify-content: space-between;
}
</style>