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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
| <template>
| <div>
| <div class="search">
| <div>
| <el-form :model="searchForm" ref="searchForm" size="small" :inline="true">
| <el-form-item label="内审目的" prop="purpose">
| <el-input v-model="searchForm.purpose" clearable size="small"></el-input>
| </el-form-item>
| <el-form-item>
| <el-button type="primary" size="mini" @click="searchList">查询</el-button>
| <el-button size="mini" @click="resetSearchForm">重置</el-button>
| </el-form-item>
| </el-form>
| </div>
| <div>
| <el-button size="small" type="primary" @click="openFormDia('add')">新 增</el-button>
| </div>
| </div>
| <div class="table">
| <limsTable :column="tableColumn" :height="'calc(100vh - 23em)'" :table-data="tableData"
| :table-loading="tableLoading" @pagination="pagination" :page="page">
| </limsTable>
| </div>
| <year-plan-dia v-if="yearPlanDia" ref="yearPlanDia" @closeYearDia="closeYearDia"></year-plan-dia>
| </div>
| </template>
|
| <script>
| import limsTable from "@/components/Table/lims-table.vue";
| import YearPlanDia from './yearPlanDia.vue';
| import {
| pageInternalPlan,
| delInternalPlan,
| exportInternalPlan,
| } from '@/api/cnas/systemManagement/internalAuditManagement.js'
|
| export default {
| name: 'yearPlan',
| // import 引入的组件需要注入到对象中才能使用
| components: { YearPlanDia, limsTable },
| data() {
| // 这里存放数据
| return {
| searchForm: {
| purpose: '',
| },
| tableColumn: [
| {
| label: '内审目的',
| prop: 'purpose',
| minWidth: '100'
| },
| {
| label: '内审范围',
| prop: 'scope',
| minWidth: '100'
| },
| {
| label: '内审依据',
| prop: 'basis',
| minWidth: '100'
| },
| {
| label: '组长',
| prop: 'leader',
| minWidth: '100'
| },
| {
| label: '组员',
| prop: 'crew',
| minWidth: '100'
| },
| {
| dataType: 'tag',
| label: '审核状态',
| prop: 'examineStatus',
| minWidth: '100',
| formatData: (params) => {
| if (params === 0) {
| return '不通过';
| } else if (params === 1) {
| return '通过';
| } else {
| return null;
| }
| },
| formatType: (params) => {
| if (params === 0) {
| return 'danger';
| } else if (params === 1) {
| return 'success';
| } else {
| return null;
| }
| }
| }, {
| label: '审核内容',
| prop: 'examineRemark',
| minWidth: '100'
| }, {
| label: '审核人',
| prop: 'examineUserName',
| minWidth: '100'
| }, {
| label: '审核日期',
| prop: 'examineTime',
| minWidth: '160'
| }, {
| dataType: 'tag',
| label: '批准状态',
| prop: 'ratifyStatus',
| minWidth: '100',
| formatData: (params) => {
| if (params === 0) {
| return '不批准';
| } else if (params === 1) {
| return '批准';
| } else {
| return null;
| }
| },
| formatType: (params) => {
| if (params === 0) {
| return 'danger';
| } else if (params === 1) {
| return 'success';
| } else {
| return null;
| }
| }
| }, {
| label: '批准内容',
| prop: 'ratifyRemark',
| minWidth: '100'
| }, {
| label: '批准人',
| prop: 'ratifyUserName',
| minWidth: '100'
| }, {
| label: '批准日期',
| prop: 'ratifyTime',
| minWidth: '160'
| },
| {
| dataType: 'action',
| fixed: 'right',
| minWidth: '220',
| label: '操作',
| operation: [
| {
| name: '导出',
| type: 'text',
| clickFun: (row) => {
| this.handleDown(row)
| }
| },
| {
| name: '编辑',
| type: 'text',
| clickFun: (row) => {
| this.openFormDia('edit', row);
| },
| disabled: (row) => {
| if (row.ratifyStatus === 1) {
| return true
| } else {
| return false
| }
| },
| },
| {
| name: '审核',
| type: 'text',
| clickFun: (row) => {
| this.openFormDia('examine', row);
| },
| disabled: (row) => {
| if (row.examineStatus === 1) {
| return true
| } else {
| return false
| }
| },
| },
| {
| name: '批准',
| type: 'text',
| clickFun: (row) => {
| this.openFormDia('ratify', row);
| },
| disabled: (row) => {
| if (row.ratifyStatus === 1 || row.examineStatus === 0 || row.examineStatus === null) {
| return true
| } else {
| return false
| }
| },
| },
| {
| name: '删除',
| type: 'text',
| color: '#f56c6c',
| clickFun: (row) => {
| this.delPlan(row)
| },
| disabled: (row) => {
| if (row.ratifyStatus === 1) {
| return true
| } else {
| return false
| }
| },
| }
| ]
| }
| ],
| tableData: [],
| tableLoading: false,
| page: {
| size: 20,
| current: 1,
| total: 0,
| },
| yearPlanDia: false,
| };
| },
| mounted() {
| this.searchList()
| },
| // 方法集合
| methods: {
| // 查询列表
| searchList() {
| const entity = this.searchForm
| const page = this.page
| this.tableLoading = true
| pageInternalPlan({ ...entity, ...page }).then(res => {
| this.tableLoading = false
| this.tableData = res.data.records
| this.page.total = res.data.total
| }).catch(err => {
| console.log('err---', err);
| this.tableLoading = false
| })
| },
| // 删除
| delPlan(row) {
| this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
| confirmButtonText: '确定',
| cancelButtonText: '取消',
| type: 'warning'
| }).then(() => {
| this.tableLoading = true
| delInternalPlan({ planId: row.planId }).then(res => {
| this.tableLoading = false
| this.$message.success('删除成功')
| this.searchList()
| }).catch(err => {
| this.tableLoading = false
| console.log('err---', err);
| })
| }).catch(() => {
| this.$message({
| type: 'info',
| message: '已取消删除'
| });
| });
| },
| // 新增,编辑,批准弹框
| openFormDia(type, row) {
| this.yearPlanDia = true
| this.$nextTick(() => {
| this.$refs.yearPlanDia.openDia(type, row)
| })
| },
| // 导出
| handleDown(row) {
| exportInternalPlan({ planId: row.planId }).then(res => {
| this.outLoading = false
| const blob = new Blob([res], { type: 'application/msword' });
| this.$download.saveAs(blob, '内审年度计划' + '.docx');
| })
| },
| closeYearDia() {
| this.yearPlanDia = false
| this.searchList()
| },
| // 重置查询条件
| resetSearchForm() {
| this.searchForm.purpose = '';
| this.searchList()
| },
| pagination({ page, limit }) {
| this.page.current = page;
| this.page.size = limit;
| this.searchList();
| },
| }
| };
| </script>
|
| <style scoped>
| .search {
| height: 46px;
| display: flex;
| justify-content: space-between;
| }
| </style>
|
|