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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
| <template>
| <div class="capacity-scope">
| <div class="search">
| <div>
| <el-form :model="searchForm" ref="searchForm" size="small" :inline="true">
| <el-form-item label="名称" prop="supplierName">
| <el-input v-model="searchForm.supplierName" clearable size="small"></el-input>
| </el-form-item>
| <el-form-item>
| <el-button type="primary" icon="el-icon-search" size="mini" @click="getTableData">查 询</el-button>
| <el-button icon="el-icon-refresh" size="mini" @click="resetSearchForm">重 置</el-button>
| </el-form-item>
| </el-form>
| </div>
| <div>
| <el-button size="medium" @click="exportExcel">导 出</el-button>
| <el-button size="medium" type="primary" @click="showDialog('add')">新 增</el-button>
| </div>
| </div>
| <div class="table">
| <lims-table :tableData="tableData" :column="tableColumn" :height="'calc(100vh - 250px)'" @pagination="pagination"
| :page="page" :tableLoading="tableLoading"></lims-table>
| </div>
| <form-dia ref="formDia" v-if="formDia" @closeDia="closeDia"></form-dia>
| </div>
| </template>
|
| <script>
| // import ZTTable from "../caorui/ZTTable/index.vue";
| // import TableCard from "../caorui/TableCard/index.vue";
| // import axios from "axios";
| import FormDia from "../supplierManage/component/formDia.vue";
| import limsTable from '@/components/Table/lims-table.vue'
| import {
| selectQualifiedSupplierManagementPage,
| exportSupplierManagement,
| delSupplierManagement
| } from '@/api/cnas/externalService/supplierManage/supplierManage'
|
| export default {
| name: "a6-supplier-manage-new",
| // import 引入的组件需要注入到对象中才能使用
| components: {
| limsTable,
| FormDia
| },
| data() {
| // 这里存放数据
| return {
| searchForm: {
| supplierName: ''
| },
| tableLoading: false,
| tableColumn: [
| {
| label: "供应商编号",
| prop: "supplierRef"
| },
| {
| label: "供应商",
| prop: "supplierName"
| },
| {
| label: "供应物品(服务)名称",
| prop: "supplierItemServiceName"
| },
| {
| label: "地址",
| prop: "adress"
| },
| {
| label: "联系电话",
| prop: "phone"
| },
| {
| dataType: 'action',
| fixed: "right",
| minWidth: '60',
| label: '操作',
| operation: [
| {
| name: '编辑',
| type: 'text',
| clickFun: (row) => {
| this.showDialog('edit', row);
| },
| },
| {
| name: '删除',
| type: 'text',
| color: '#f56c6c',
| clickFun: (row) => {
| this.deleteRow(row);
| },
| }
|
| ]
| }
| ],
| tableData: [],
| page: {
| total: 0,
| size: 10,
| current: 1
| },
| formDia: false,
| }
| },
| mounted() {
| this.getTableData()
| },
| // 方法集合
| methods: {
| // 获取表格数据
| async getTableData() {
| this.tableLoading = true;
| selectQualifiedSupplierManagementPage(this.searchForm).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
| })
| },
| // 重置
| resetSearchForm() {
| this.pagination.current = 1
| this.pagination.pageSize = 20
| this.searchForm.supplierName = ''
| this.getTableData()
| },
| // 分页切换
| pagination(page) {
| this.page.size = page.limit
| this.getTableData();
| },
| // 打开新增弹框
| showDialog(type, row) {
| this.formDia = true
| this.$nextTick(() => {
| this.$refs.formDia.openDialog(type, row)
| })
| },
| // 关闭弹框
| closeDia() {
| this.formDia = false
| this.getTableData()
| },
| // 删除记录
| deleteRow(row) {
| this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
| confirmButtonText: '确定',
| cancelButtonText: '取消',
| type: 'warning'
| }).then(() => {
| delSupplierManagement({ supplierManagementId: row.supplierManagementId }).then(res => {
| if (res.code === 200) {
| this.$message.success('删除成功!')
| this.getTableData()
| }
| })
| }).catch(() => {
| this.$message({
| type: 'info',
| message: '已取消删除'
| });
| });
| },
| // 导出excel
| async exportExcel() {
| exportSupplierManagement({ deviceId: this.clickNodeVal.value }).then(res => {
| const blob = new Blob([res], { type: 'application/octet-stream' });
| this.$download.saveAs(blob, '合格供应商.xlsx')
| })
| }
| },
| }
| </script>
|
| <style scoped>
| .search {
| height: 46px;
| display: flex;
| justify-content: space-between;
| }
| </style>
|
|