|
@@ -2,7 +2,7 @@
|
2
|
2
|
* @Author: ysh
|
3
|
3
|
* @Date: 2025-03-05 15:01:52
|
4
|
4
|
* @LastEditors: Please set LastEditors
|
5
|
|
- * @LastEditTime: 2025-03-13 16:09:55
|
|
5
|
+ * @LastEditTime: 2025-03-27 13:37:00
|
6
|
6
|
-->
|
7
|
7
|
<template>
|
8
|
8
|
<div>
|
|
@@ -21,7 +21,9 @@
|
21
|
21
|
</el-form-item>
|
22
|
22
|
</el-form>
|
23
|
23
|
<right-toolbar :search="false" @queryTable="getRecordsList"></right-toolbar>
|
24
|
|
- <el-table :data="studyList" style="width: 100%" v-loading="loading">
|
|
24
|
+ <el-button type="primary" plain size="mini" icon="el-icon-plus" @click="addTrainRecord">添加参培记录</el-button>
|
|
25
|
+ <el-button type="success" plain size="mini" icon="el-icon-view" @click="trainOpen = true">查看参培记录</el-button>
|
|
26
|
+ <el-table :data="studyList" style="width: 100%" v-loading="loading" height="430px">
|
25
|
27
|
<el-table-column align="center" label="序号" type="index" />
|
26
|
28
|
<el-table-column align="center" label="资料名称" prop="resource.title" />
|
27
|
29
|
<el-table-column align="center" label="类型" prop="resource.type"></el-table-column>
|
|
@@ -47,11 +49,39 @@
|
47
|
49
|
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
|
48
|
50
|
:layout="'total, prev, pager, next,jumper'" :limit.sync="queryParams.pageSize" :autoScroll="false"
|
49
|
51
|
@pagination="getRecordsList" />
|
|
52
|
+ <el-dialog title="个人参培记录" :visible.sync="trainOpen" width="60%" append-to-body>
|
|
53
|
+ <el-table :data="trainList" style="width: 100%" v-loading="loading" height="430px">
|
|
54
|
+ <el-table-column label="序号" type="index" />
|
|
55
|
+ <el-table-column label="上报人" align="center" prop="reportUser.nickName" />
|
|
56
|
+ <el-table-column label="上报日期" align="center" prop="reportTime" width="180">
|
|
57
|
+ <template slot-scope="scope">
|
|
58
|
+ <span>{{ parseTime(scope.row.reportTime, '{y}-{m}-{d}') }}</span>
|
|
59
|
+ </template>
|
|
60
|
+ </el-table-column>
|
|
61
|
+ <el-table-column label="培训名称" align="center" prop="trainName" />
|
|
62
|
+ <el-table-column label="主要内容" align="center" prop="content" />
|
|
63
|
+ <el-table-column label="学时" align="center" prop="hours" />
|
|
64
|
+ <el-table-column label="部门审核人" align="center" prop="deptUser.nickName" />
|
|
65
|
+ <el-table-column label="部门审核时间" align="center" prop="deptTime" width="180">
|
|
66
|
+ <template slot-scope="scope">
|
|
67
|
+ <span>{{ parseTime(scope.row.deptTime, '{y}-{m}-{d}') }}</span>
|
|
68
|
+ </template>
|
|
69
|
+ </el-table-column>
|
|
70
|
+ <el-table-column label="部门审核意见" align="center" prop="deptComment" />
|
|
71
|
+ </el-table>
|
|
72
|
+ <pagination v-show="trainTotal > 0" :total="trainTotal" :page.sync="trainQueryParams.pageNum"
|
|
73
|
+ :layout="'total, prev, pager, next,jumper'" :limit.sync="trainQueryParams.pageSize" :autoScroll="false"
|
|
74
|
+ @pagination="getTrainList" />
|
|
75
|
+ </el-dialog>
|
50
|
76
|
</div>
|
51
|
77
|
</template>
|
52
|
78
|
|
53
|
79
|
<script>
|
54
|
80
|
import { listStudy, getStudy, delStudy, addStudy, updateStudy } from "@/api/oa/study/myStudy";
|
|
81
|
+import { listTrainApproval, getTrainApproval, delTrainApproval, addTrainApproval, updateTrainApproval } from "@/api/oa/study/trainApproval";
|
|
82
|
+import { Snowflake } from '@/utils/snowFlake.js';
|
|
83
|
+import { listDefinition, definitionStart } from "@/api/flowable/definition";
|
|
84
|
+import { todoList, getNextFlowNodeByStart } from "@/api/flowable/todo";
|
55
|
85
|
|
56
|
86
|
export default {
|
57
|
87
|
data() {
|
|
@@ -62,11 +92,21 @@ export default {
|
62
|
92
|
queryParams: {
|
63
|
93
|
pageNum: 1,
|
64
|
94
|
pageSize: 10
|
|
95
|
+ },
|
|
96
|
+ trainOpen: false,
|
|
97
|
+ trainLoading: true,
|
|
98
|
+ trainList: [],
|
|
99
|
+ trainTotal: 0,
|
|
100
|
+ trainQueryParams: {
|
|
101
|
+ pageNum: 1,
|
|
102
|
+ pageSize: 10,
|
|
103
|
+ userId: this.$store.getters.userId
|
65
|
104
|
}
|
66
|
105
|
}
|
67
|
106
|
},
|
68
|
107
|
created() {
|
69
|
108
|
this.getRecordsList();
|
|
109
|
+ this.getTrainList();
|
70
|
110
|
},
|
71
|
111
|
methods: {
|
72
|
112
|
getRecordsList() {
|
|
@@ -78,6 +118,15 @@ export default {
|
78
|
118
|
this.loading = false;
|
79
|
119
|
});
|
80
|
120
|
},
|
|
121
|
+ /** 查询参培审核列表 */
|
|
122
|
+ getTrainList() {
|
|
123
|
+ this.trainLoading = true;
|
|
124
|
+ listTrainApproval(this.trainQueryParams).then(response => {
|
|
125
|
+ this.trainList = response.rows;
|
|
126
|
+ this.trainTotal = response.total;
|
|
127
|
+ this.trainLoading = false;
|
|
128
|
+ });
|
|
129
|
+ },
|
81
|
130
|
/** 搜索按钮操作 */
|
82
|
131
|
handleQuery() {
|
83
|
132
|
this.queryParams.pageNum = 1;
|
|
@@ -120,6 +169,78 @@ export default {
|
120
|
169
|
return 'success'
|
121
|
170
|
}
|
122
|
171
|
},
|
|
172
|
+ async addTrainRecord() {
|
|
173
|
+ let response = await listDefinition({
|
|
174
|
+ pageNum: 1,
|
|
175
|
+ pageSize: 9999,
|
|
176
|
+ name: "参培审核",
|
|
177
|
+ category: "assess",
|
|
178
|
+ })
|
|
179
|
+ console.log(response);
|
|
180
|
+ if (response.data.total == 1) {
|
|
181
|
+ let obj = response.data.records[0]
|
|
182
|
+ this.$confirm("是否发起参培审核?", '提示', {
|
|
183
|
+ confirmButtonText: '确定',
|
|
184
|
+ cancelButtonText: '取消',
|
|
185
|
+ type: 'warning'
|
|
186
|
+ }).then(() => {
|
|
187
|
+ this.handleStartProcess(obj)
|
|
188
|
+ }).catch(() => { });
|
|
189
|
+ }
|
|
190
|
+ },
|
|
191
|
+ handleStartProcess(row) {
|
|
192
|
+ let formId = new Snowflake(1n, 1n, 0n).nextId().toString();
|
|
193
|
+ getNextFlowNodeByStart({ deploymentId: row.deploymentId, variables: { formId: formId } }).then(res => {
|
|
194
|
+ let data = res.data;
|
|
195
|
+ const variables = {};
|
|
196
|
+ const formData = {};
|
|
197
|
+ formData.disabled = true;
|
|
198
|
+ formData.formBtns = false;
|
|
199
|
+ formData.formId = formId
|
|
200
|
+ if (row.id) {
|
|
201
|
+ variables.variables = formData;
|
|
202
|
+ let routePath = this.getRoutePath(row);
|
|
203
|
+ definitionStart(row.id, JSON.stringify(variables)).then(res => {
|
|
204
|
+ this.$modal.msgSuccess(res.msg);
|
|
205
|
+ let procInstanceId = res.data;
|
|
206
|
+ todoList({
|
|
207
|
+ pageNum: 1,
|
|
208
|
+ pageSize: 99999999, processInsId: procInstanceId
|
|
209
|
+ }).then(toDoRes => {
|
|
210
|
+ let records = toDoRes.data.records;
|
|
211
|
+ if (records.length == 1) {
|
|
212
|
+ records = records[0]
|
|
213
|
+ }
|
|
214
|
+ this.$router.push({
|
|
215
|
+ path: routePath,
|
|
216
|
+ query: {
|
|
217
|
+ procInsId: records.procInsId,
|
|
218
|
+ executionId: records.executionId,
|
|
219
|
+ deployId: records.deployId,
|
|
220
|
+ taskId: records.taskId,
|
|
221
|
+ taskName: records.taskName,
|
|
222
|
+ startUser: records.startUserName + '-' + records.startDeptName,
|
|
223
|
+ formId: formData.formId,
|
|
224
|
+ procDefName: records.procDefName
|
|
225
|
+ }
|
|
226
|
+ })
|
|
227
|
+ })
|
|
228
|
+ })
|
|
229
|
+ }
|
|
230
|
+ })
|
|
231
|
+ },
|
|
232
|
+ getRoutePath(row) {
|
|
233
|
+ let path;
|
|
234
|
+ for (let p of this.publicData.pathRoute) {
|
|
235
|
+ if (p.name == row.name) {
|
|
236
|
+ path = p.path
|
|
237
|
+ break
|
|
238
|
+ } else {
|
|
239
|
+ path = '/flowable/task/todo/detail/index'
|
|
240
|
+ }
|
|
241
|
+ }
|
|
242
|
+ return path
|
|
243
|
+ },
|
123
|
244
|
},
|
124
|
245
|
}
|
125
|
246
|
</script>
|