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
154
155
156
157
158
159
160
161
162
163
164
| <template>
| <div>
| <TableCard :showTitle="false">
| <template slot="form">
| <div class="action-box">
| <div></div>
| <div class="flex">
| <el-button icon="el-icon-plus" size="small" type="primary" @click="showDialog">
| 添加项目
| </el-button>
| <el-button icon="el-icon-upload2" size="small" @click="exportExcel">
| 导出
| </el-button>
| </div>
| </div>
| </template>
| <template v-slot:table>
| <limsTable
| :column="columns"
| :height="'25vh'"
| :isSelection="true"
| :table-data="tableData"
| style="margin-top: 18px; padding: 0 15px;"
| >
| <template v-slot:operation="scope">
| <el-button size="small" type="text" @click="deleteData(scope.row)">删除</el-button>
| </template>
| </limsTable>
| <div class="pagination">
| <div></div>
| <el-pagination
| :page-size="pagination.pageSize"
| :page-sizes="[10, 20, 30, 40]"
| :total="pagination.total"
| layout="total, sizes, prev, pager, next, jumper"
| @current-change="handleCurrent"
| @size-change="handleSize"
| >
| </el-pagination>
| </div>
| </template>
| </TableCard>
| <AddProject ref="AddProjectRef" @submit="fetchData"/>
| </div>
| </template>
|
| <script>
| import TableCard from './index.vue';
| import limsTable from '@/components/Table/lims-table.vue'
| import Edit from "./Edit.vue"
| import AddProject from './AddProject.vue';
| import {
| deleteProcurementSuppliesExpends,
| procurementSuppliesExpendlist
| } from "@/api/cnas/externalService/serviceAndSupplyPro/serviceAndSupplyPro";
|
| export default {
| components: {
| TableCard, limsTable, Edit, AddProject
| },
| data() {
| return {
| columns: [
| // {
| // label: "编号"
| // },
| {
| label: "项目名称",
| prop: "listName"
| },
| {
| label: "消耗数量",
| prop: "amount"
| },
| {
| label: "录入人",
| prop: "enterUserName"
| },
| {
| label: "最近更新人",
| prop: "updateUserName"
| },
| {
| label: "最近更新日期",
| prop: "updateTime"
| },
| {
| label: "操作",
| dataType: "slot",
| slot: "operation"
| }
| ],
| tableData: [],
| pagination: {
| current: 1,
| pageSize: 20,
| total: 0
| },
| listId: 0,
| row: undefined
| }
| },
| mounted() {
| this.fetchData()
| },
| methods: {
| fetchListId(row) {
| if(row) {
| this.listId = row.id
| this.row = row
| }
| this.fetchData()
| },
| async fetchData() {
| if (this.listId === 0) return
| procurementSuppliesExpendlist({
| procurementSuppliesListId:this.listId
| }).then(res => {
| if (res.code === 200) {
| this.tableData = res.data
| }
| })
| },
| showDialog() {
| this.$refs.AddProjectRef.openDialog(this.row);
| },
| deleteData(row) {
| deleteProcurementSuppliesExpends({ expendId:row.expendId}).then(res => {
| if (res.code === 200) {
| this.$message.success('删除成功')
| this.fetchData()
| }
| })
| },
| handleCurrent() {
| },
| handleSize() {
| },
| exportExcel() {
| }
| }
| }
| </script>
|
| <style scoped>
| .flex {
| display: flex;
| }
|
| .action-box {
| width: 100%;
| padding-top: 10px;
| display: flex;
| align-items: center;
| justify-content: space-between;
| }
|
| .pagination {
| padding-top: 15px;
| padding-right: 10px;
| display: flex;
| justify-content: space-between
| }
| </style>
|
|