|
|
@@ -1,15 +1,265 @@
|
|
1
|
1
|
<template>
|
|
2
|
|
- <div>
|
|
3
|
|
- <el-empty description="正在开发中,敬请期待......"></el-empty>
|
|
|
2
|
+ <div class="app-container">
|
|
|
3
|
+ <el-row :gutter="20">
|
|
|
4
|
+ <el-col :span="isFlow ? 18 : 24" :xs="24">
|
|
|
5
|
+ <div class="mb20" v-if="showAlter">
|
|
|
6
|
+ <el-alert title="任务被退回,请修改后重新提交" type="error" :closable="false">
|
|
|
7
|
+ <return-comment :taskForm="taskForm" @isReturn="isReturn"></return-comment>
|
|
|
8
|
+ </el-alert>
|
|
|
9
|
+ </div>
|
|
|
10
|
+ <el-button type="success" icon="el-icon-printer" @click="printOpen = true">打印</el-button>
|
|
|
11
|
+ <h2 style="text-align: center;">绩效审批表</h2>
|
|
|
12
|
+ <el-form ref="form" :model="form" :rules="rules" :disabled="taskName == ''">
|
|
|
13
|
+ <el-row :gutter="20">
|
|
|
14
|
+ <el-col :span="7" :xs="24">
|
|
|
15
|
+ <el-form-item label="上报人:" prop="reporter" label-width="100px">
|
|
|
16
|
+ {{ getUserName(form.reporter) }}
|
|
|
17
|
+ </el-form-item>
|
|
|
18
|
+ </el-col>
|
|
|
19
|
+ <el-col :span="7" :xs="24">
|
|
|
20
|
+ <el-form-item label="上报部门:" prop="reportDept" label-width="100px">
|
|
|
21
|
+ {{ getDeptName(form.reportDept) }}
|
|
|
22
|
+ </el-form-item>
|
|
|
23
|
+ </el-col>
|
|
|
24
|
+ <el-col :span="7" :xs="24">
|
|
|
25
|
+ <el-form-item label="上报时间:" prop="reportTime" label-width="100px">
|
|
|
26
|
+ {{ form.reportTime }}
|
|
|
27
|
+ </el-form-item>
|
|
|
28
|
+ </el-col>
|
|
|
29
|
+ </el-row>
|
|
|
30
|
+ <el-form-item label="附件上传:" prop="document" label-width="100px">
|
|
|
31
|
+ <FileUpload v-if="!form.document" ref="orz" :limit="1" :isShowTip="false"
|
|
|
32
|
+ :filePathName="'绩效审批/' + parseTime(new Date(), '{y}-{m}-{d}-{h}-{i}-{s}')"
|
|
|
33
|
+ :fileType="['doc', 'docx', 'xls', 'xlsx', 'pdf', 'rar', 'zip']" @input="setDocument">
|
|
|
34
|
+ </FileUpload>
|
|
|
35
|
+ <div v-if="form.document" class="upload-list">
|
|
|
36
|
+ <el-link type="primary" @click="reviewWord(`${baseUrl}${'/profile/upload' + form.document}`)">
|
|
|
37
|
+ {{ getFileName(form.document) }}
|
|
|
38
|
+ </el-link>
|
|
|
39
|
+ <el-link class="ml20" type="warning" :href="`${baseUrl}${'/profile/upload' + form.document}`"
|
|
|
40
|
+ :underline="false" target="_blank">
|
|
|
41
|
+ <span class="el-icon-download">下载文件</span>
|
|
|
42
|
+ </el-link>
|
|
|
43
|
+ <span class="el-icon-delete del-file" @click="deleteDoc" v-if="taskName == '绩效上报'">删除文件</span>
|
|
|
44
|
+ </div>
|
|
|
45
|
+ </el-form-item>
|
|
|
46
|
+ <el-form-item label="绩效统计:">
|
|
|
47
|
+ <performance-wages ref="wagesRef" :deptId="form.reportDept" :performanceId="taskForm.formId"
|
|
|
48
|
+ :taskName="taskName" @getTotal="setAmount" @saves="saves()"></performance-wages>
|
|
|
49
|
+ </el-form-item>
|
|
|
50
|
+ <el-form-item label="分管审核意见:" prop="managerComment" label-width="130px">
|
|
|
51
|
+ <el-input type="textarea" v-model="form.managerComment" :autosize="{ minRows: 4 }"
|
|
|
52
|
+ :disabled="taskName != '分管审核'"></el-input>
|
|
|
53
|
+ <auditor-row ref="fgRef" :isCurrent="taskName == '分管审核'"
|
|
|
54
|
+ :signature="form.managerUserId ? form.managerUserId : null" :signTime="form.managerTime"></auditor-row>
|
|
|
55
|
+ </el-form-item>
|
|
|
56
|
+ <el-form-item label="总经理审批意见:" prop="zjlComment" label-width="130px">
|
|
|
57
|
+ <el-input type="textarea" v-model="form.zjlComment" :autosize="{ minRows: 4 }"
|
|
|
58
|
+ :disabled="taskName != '总经理审批'"></el-input>
|
|
|
59
|
+ <auditor-row ref="zjlRef" :isCurrent="taskName == '总经理审批'"
|
|
|
60
|
+ :signature="form.zjlUserId ? form.zjlUserId : null" :signTime="form.zjlTime"></auditor-row>
|
|
|
61
|
+ </el-form-item>
|
|
|
62
|
+ <el-form-item label="人事制单:" label-width="130px" v-if="taskName == '人事制单'">
|
|
|
63
|
+ <el-button type="success" icon="el-icon-printer" @click="printOpen = true">打印</el-button>
|
|
|
64
|
+ </el-form-item>
|
|
|
65
|
+ </el-form>
|
|
|
66
|
+ <el-row style="text-align: center;" v-if="taskName != ''">
|
|
|
67
|
+ <el-button type="danger" @click="returnOpen = true" v-show="taskName != '绩效上报'">退 回</el-button>
|
|
|
68
|
+ <el-button type="warning" @click="saves()">保存</el-button>
|
|
|
69
|
+ <el-button type="primary" @click="completeApply()">提交</el-button>
|
|
|
70
|
+ </el-row>
|
|
|
71
|
+ </el-col>
|
|
|
72
|
+ <el-col :span="6" :xs="24" v-if="isFlow">
|
|
|
73
|
+ <el-card>
|
|
|
74
|
+ <h2 style="text-align: center;">流程进度</h2>
|
|
|
75
|
+ <div>
|
|
|
76
|
+ <flow :flowData="flowData" />
|
|
|
77
|
+ </div>
|
|
|
78
|
+ </el-card>
|
|
|
79
|
+ </el-col>
|
|
|
80
|
+ </el-row>
|
|
|
81
|
+ <el-dialog title="退回" :visible.sync="returnOpen" width="40%" append-to-body>
|
|
|
82
|
+ <return-btn :taskForm="taskForm" @goBack="$emit('goBack')" @saves="" @cancel="returnOpen = false"></return-btn>
|
|
|
83
|
+ </el-dialog>
|
|
|
84
|
+ <el-dialog title="打印预览" :visible.sync="printOpen" width="60%" append-to-body>
|
|
|
85
|
+ <performance-print :formId="taskForm.formId" @cancel="printOpen = false"></performance-print>
|
|
|
86
|
+ </el-dialog>
|
|
4
|
87
|
</div>
|
|
5
|
88
|
</template>
|
|
6
|
89
|
|
|
7
|
90
|
<script>
|
|
8
|
|
- export default {
|
|
9
|
|
-
|
|
|
91
|
+import flow from '@/views/flowable/task/todo/detail/flow';
|
|
|
92
|
+import { flowXmlAndNode } from "@/api/flowable/definition";
|
|
|
93
|
+import { parseTime } from "@/utils/ruoyi";
|
|
|
94
|
+import { complete, rejectTask, returnList, returnTask, getNextFlowNode, delegate, flowTaskForm, } from "@/api/flowable/todo";
|
|
|
95
|
+import { listPerformance, getPerformance, addPerformance, updatePerformance, delPerformance } from "@/api/oa/performance/performance"
|
|
|
96
|
+import { listWage, getWage, addWage, updateWage, delWage } from "@/api/oa/wage/wage"
|
|
|
97
|
+import { getUsersDeptLeaderByDept, getUsersManageLeaderByDept, getUserByPost } from '@/api/system/post'
|
|
|
98
|
+import { getUserByRole } from "@/api/system/role";
|
|
|
99
|
+import PerformanceWages from './performanceWages.vue';
|
|
|
100
|
+import { scrollTo } from '@/utils/scroll-to'
|
|
|
101
|
+import AuditorRow from '@/views/flowable/form/components/auditorRow.vue';
|
|
|
102
|
+import returnBtn from '@/views/flowable/form/components/flowBtn/returnBtn.vue';
|
|
|
103
|
+import ReturnComment from '@/views/flowable/form/components/flowBtn/returnComment.vue';
|
|
|
104
|
+import PerformancePrint from '@/views/flowable/form/components/print/performancePrint.vue';
|
|
|
105
|
+export default {
|
|
|
106
|
+ components: { flow, PerformanceWages, AuditorRow, returnBtn, ReturnComment, PerformancePrint },
|
|
|
107
|
+ props: {
|
|
|
108
|
+ taskName: {
|
|
|
109
|
+ type: String,
|
|
|
110
|
+ required: true
|
|
|
111
|
+ },
|
|
|
112
|
+ taskForm: {
|
|
|
113
|
+ type: Object,
|
|
|
114
|
+ required: true
|
|
|
115
|
+ },
|
|
|
116
|
+ isFlow: {
|
|
|
117
|
+ type: Boolean,
|
|
|
118
|
+ default: true
|
|
|
119
|
+ },
|
|
|
120
|
+ },
|
|
|
121
|
+ data() {
|
|
|
122
|
+ return {
|
|
|
123
|
+ baseUrl: process.env.VUE_APP_BASE_API,
|
|
|
124
|
+ flowData: {},
|
|
|
125
|
+ rules: {
|
|
|
126
|
+ document: [
|
|
|
127
|
+ { required: true, message: '请上传统计明细附件', trigger: 'blur' }
|
|
|
128
|
+ ]
|
|
|
129
|
+ },
|
|
|
130
|
+ form: {
|
|
|
131
|
+ deptId: undefined,
|
|
|
132
|
+ applyTime: undefined,
|
|
|
133
|
+ applier: undefined,
|
|
|
134
|
+ },
|
|
|
135
|
+ performanceId: '',
|
|
|
136
|
+ formTotal: 0,
|
|
|
137
|
+ returnOpen: false,
|
|
|
138
|
+ printOpen: false,
|
|
|
139
|
+ showAlter: true,
|
|
|
140
|
+ }
|
|
|
141
|
+ },
|
|
|
142
|
+ created() {
|
|
|
143
|
+ this.initFlow();
|
|
|
144
|
+ this.initForm();
|
|
|
145
|
+ if (this.taskName == '绩效上报')
|
|
|
146
|
+ this.saves();
|
|
|
147
|
+ },
|
|
|
148
|
+ methods: {
|
|
|
149
|
+ initFlow() {
|
|
|
150
|
+ if (this.isFlow) {
|
|
|
151
|
+ flowXmlAndNode({ procInsId: this.taskForm.procInsId, deployId: this.taskForm.deployId }).then(res => {
|
|
|
152
|
+ this.flowData = res.data;
|
|
|
153
|
+ })
|
|
|
154
|
+ }
|
|
|
155
|
+ },
|
|
|
156
|
+ initForm() {
|
|
|
157
|
+ const formId = this.taskForm.formId;
|
|
|
158
|
+ this.performanceId = formId;
|
|
|
159
|
+ if (this.taskName == '绩效上报') {
|
|
|
160
|
+ this.form.reporter = this.$store.getters.userId;
|
|
|
161
|
+ this.form.reportDept = this.$store.getters.deptId;
|
|
|
162
|
+ this.form.reportTime = parseTime(new Date(), "{y}-{m}-{d}")
|
|
|
163
|
+ }
|
|
|
164
|
+ getPerformance(formId).then(res => {
|
|
|
165
|
+ if (res.data) {
|
|
|
166
|
+ this.formTotal = 1
|
|
|
167
|
+ this.form = res.data;
|
|
|
168
|
+ }
|
|
|
169
|
+ })
|
|
|
170
|
+ },
|
|
|
171
|
+ setAmount(val) {
|
|
|
172
|
+ this.amount = val[0]
|
|
|
173
|
+ this.peopleNum = val[1]
|
|
|
174
|
+ },
|
|
|
175
|
+ async saves() {
|
|
|
176
|
+ if (this.formTotal != 0) {
|
|
|
177
|
+ if (this.taskName == '分管审核') {
|
|
|
178
|
+ this.form.managerUserId = this.$refs.fgRef.localSignatureUserId;
|
|
|
179
|
+ this.form.managerTime = this.$refs.fgRef.loaclSignTime;
|
|
|
180
|
+ } else if (this.taskName == '总经理审批') {
|
|
|
181
|
+ this.form.zjlUserId = this.$refs.zjlRef.localSignatureUserId;
|
|
|
182
|
+ this.form.zjlTime = this.$refs.zjlRef.loaclSignTime;
|
|
|
183
|
+ }
|
|
|
184
|
+ await updatePerformance(this.form)
|
|
|
185
|
+ } else {
|
|
|
186
|
+ this.form.performanceId = this.taskForm.formId;
|
|
|
187
|
+ await addPerformance(this.form)
|
|
|
188
|
+ this.formTotal = 1
|
|
|
189
|
+ }
|
|
|
190
|
+ this.savesWages()
|
|
|
191
|
+ this.$message.success('保存成功')
|
|
|
192
|
+ },
|
|
|
193
|
+ async savesWages() {
|
|
|
194
|
+ const wagesList = this.$refs.wagesRef.wagesList;
|
|
|
195
|
+ for (let wages of wagesList) {
|
|
|
196
|
+ await updateWage(wages)
|
|
|
197
|
+ }
|
|
|
198
|
+ },
|
|
|
199
|
+ completeApply() {
|
|
|
200
|
+ const params = { taskId: this.taskForm.taskId };
|
|
|
201
|
+ this.$refs['form'].validate(valid => {
|
|
|
202
|
+ if (valid) {
|
|
|
203
|
+ this.saves();
|
|
|
204
|
+ getNextFlowNode(params).then(async () => {
|
|
|
205
|
+ if (this.taskName == '绩效上报') {
|
|
|
206
|
+ let result = await getUsersManageLeaderByDept({ deptId: this.form.reportDept });
|
|
|
207
|
+ const managerList = result.data.map(element => element.userId);
|
|
|
208
|
+ this.$set(this.taskForm.variables, "approvalList", managerList);
|
|
|
209
|
+ this.successComplete();
|
|
|
210
|
+ } else if (this.taskName == '分管审核') {
|
|
|
211
|
+ let result = await getUserByPost({ postName: '总经理' })
|
|
|
212
|
+ this.$set(this.taskForm.variables, "approval", result.data[0].userId);
|
|
|
213
|
+ this.successComplete();
|
|
|
214
|
+ } else if (this.taskName == '总经理审批') {
|
|
|
215
|
+ let result = await getUserByRole({ roleId: 3 })
|
|
|
216
|
+ this.$set(this.taskForm.variables, "approvalList", result.data);
|
|
|
217
|
+ this.successComplete();
|
|
|
218
|
+ } else if (this.taskName == '人事制单') {
|
|
|
219
|
+ this.$modal.confirm('最后一个节点,提交将结束流程,是否提交?').then(res => {
|
|
|
220
|
+ this.successComplete();
|
|
|
221
|
+ })
|
|
|
222
|
+ }
|
|
|
223
|
+ })
|
|
|
224
|
+ } else {
|
|
|
225
|
+ scrollTo(0, 600)
|
|
|
226
|
+ }
|
|
|
227
|
+ })
|
|
|
228
|
+ },
|
|
|
229
|
+ successComplete() {
|
|
|
230
|
+ complete(this.taskForm).then(response => {
|
|
|
231
|
+ this.$modal.msgSuccess(response.msg);
|
|
|
232
|
+ this.$emit('goBack')
|
|
|
233
|
+ })
|
|
|
234
|
+ },
|
|
|
235
|
+ setDocument(val) {
|
|
|
236
|
+ let arr = val.split('/upload')
|
|
|
237
|
+ this.$set(this.form, 'document', arr[1])
|
|
|
238
|
+ if (val == "") {
|
|
|
239
|
+ this.$set(this.form, 'document', "")
|
|
|
240
|
+ }
|
|
|
241
|
+ },
|
|
|
242
|
+ deleteDoc() {
|
|
|
243
|
+ this.$set(this.form, 'document', undefined)
|
|
|
244
|
+ },
|
|
|
245
|
+ isReturn(val) {
|
|
|
246
|
+ this.showAlter = val
|
|
|
247
|
+ }
|
|
10
|
248
|
}
|
|
|
249
|
+}
|
|
11
|
250
|
</script>
|
|
12
|
251
|
|
|
13
|
252
|
<style lang="scss" scoped>
|
|
|
253
|
+@import "@/assets/styles/element-reset.scss";
|
|
14
|
254
|
|
|
|
255
|
+::v-deep .el-descriptions-item__label.is-bordered-label {
|
|
|
256
|
+ color: #5a5757;
|
|
|
257
|
+ background: rgba($color: #a9adb3, $alpha: 0.1);
|
|
|
258
|
+ width: 150px;
|
|
|
259
|
+ min-width: 150px;
|
|
|
260
|
+}
|
|
|
261
|
+
|
|
|
262
|
+::v-deep .el-descriptions .is-bordered .el-descriptions-item__cell {
|
|
|
263
|
+ border: 1px solid #cdd0d3;
|
|
|
264
|
+}
|
|
15
|
265
|
</style>
|