|
@@ -2,7 +2,7 @@
|
2
|
2
|
* @Author: ysh
|
3
|
3
|
* @Date: 2024-03-19 09:24:06
|
4
|
4
|
* @LastEditors: Please set LastEditors
|
5
|
|
- * @LastEditTime: 2024-04-07 17:31:15
|
|
5
|
+ * @LastEditTime: 2024-04-08 11:36:16
|
6
|
6
|
-->
|
7
|
7
|
<template>
|
8
|
8
|
<div class="app-container">
|
|
@@ -22,7 +22,8 @@
|
22
|
22
|
</el-select>
|
23
|
23
|
</el-form-item>
|
24
|
24
|
<el-form-item label="项目负责人" prop="projectLeader">
|
25
|
|
- <el-tag effect="plain" type="warning" style="margin-right: 10px;" v-if="form.projectLeader != ''">{{
|
|
25
|
+ <el-tag effect="plain" type="warning" style="margin-right: 10px;"
|
|
26
|
+ v-if="form.projectLeader != '' && form.projectLeader != undefined">{{
|
26
|
27
|
form.projectLeaderName }}</el-tag>
|
27
|
28
|
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="choosePeople">选择</el-button>
|
28
|
29
|
</el-form-item>
|
|
@@ -69,7 +70,7 @@ import { listDept } from '@/api/system/dept'
|
69
|
70
|
import { listUser } from '@/api/system/user'
|
70
|
71
|
import { getUsersDeptLeaderByDept } from '@/api/system/post'
|
71
|
72
|
import { complete, rejectTask, returnList, returnTask, getNextFlowNode, delegate, flowTaskForm, } from "@/api/flowable/todo";
|
72
|
|
-import { listProject, getProject, addProject, updateProject, delProject, submitProject,modifyProject } from "@/api/oa/project/project";
|
|
73
|
+import { listProject, getProject, addProject, updateProject, delProject, submitProject, modifyProject } from "@/api/oa/project/project";
|
73
|
74
|
export default {
|
74
|
75
|
props: {
|
75
|
76
|
disabled: {
|
|
@@ -83,9 +84,7 @@ export default {
|
83
|
84
|
},
|
84
|
85
|
data() {
|
85
|
86
|
return {
|
86
|
|
- form: {
|
87
|
|
- projectLeader: ''
|
88
|
|
- },
|
|
87
|
+ form: {},
|
89
|
88
|
rules: {},
|
90
|
89
|
deptList: [],
|
91
|
90
|
userList: [],
|
|
@@ -103,11 +102,30 @@ export default {
|
103
|
102
|
}
|
104
|
103
|
},
|
105
|
104
|
created() {
|
106
|
|
- this.form.projectId = this.taskForm.formId;
|
|
105
|
+ this.initForm();
|
|
106
|
+ // this.form.projectId = this.taskForm.formId;
|
107
|
107
|
this.getDeptList();
|
108
|
108
|
this.getUserList();
|
109
|
109
|
},
|
110
|
110
|
methods: {
|
|
111
|
+ initForm() {
|
|
112
|
+ getProject(this.$route.query.formId).then(res => {
|
|
113
|
+ this.form = res.data;
|
|
114
|
+ if (this.form.undertakingDept != null && this.form.undertakingDept != "" && this.form.undertakingDept != undefined) {
|
|
115
|
+ this.form.deptId = this.form.undertakingDeptName.split(',')
|
|
116
|
+ }
|
|
117
|
+ if (this.form.projectLeaderUser) {
|
|
118
|
+ this.form.projectLeaderName = this.form.projectLeaderUser.nickName
|
|
119
|
+ }
|
|
120
|
+ this.$set(this.form, 'deptLeader', [])
|
|
121
|
+ if (this.form.undertakingDept) {
|
|
122
|
+ let arr = this.form.undertakingDept.split(',')
|
|
123
|
+ this.getDeptLeader(arr);
|
|
124
|
+ } else {
|
|
125
|
+ this.$set(this.form, 'deptId', [])
|
|
126
|
+ }
|
|
127
|
+ })
|
|
128
|
+ },
|
111
|
129
|
getUserList() {
|
112
|
130
|
listUser({ pageSize: 9999, pageNum: 1 }).then(res => {
|
113
|
131
|
this.userList = res.rows
|
|
@@ -125,7 +143,8 @@ export default {
|
125
|
143
|
getDeptLeader(val) {
|
126
|
144
|
this.deptLeaderList = [];
|
127
|
145
|
for (let v of val) {
|
128
|
|
- getUsersDeptLeaderByDept({ deptId: v }).then(res => {
|
|
146
|
+ getUsersDeptLeaderByDept({ deptId: Number(v) }).then(res => {
|
|
147
|
+ debugger
|
129
|
148
|
this.deptLeaderList.push(res.data.userId);
|
130
|
149
|
this.form.deptLeader = this.deptLeaderList;
|
131
|
150
|
})
|
|
@@ -165,26 +184,24 @@ export default {
|
165
|
184
|
this.peopleVisible = false;
|
166
|
185
|
},
|
167
|
186
|
confirmPlanForm() {
|
168
|
|
- console.log(this.form);
|
|
187
|
+ this.form.undertakingDept = this.form.deptId.join(',')
|
169
|
188
|
let formData = new FormData();
|
170
|
189
|
formData.append("form", JSON.stringify(this.form));
|
171
|
|
- modifyProject(formData).then(res=>{
|
172
|
|
- console.log(res);
|
173
|
|
- })
|
|
190
|
+ modifyProject(formData)
|
174
|
191
|
const params = { taskId: this.taskForm.taskId };
|
175
|
192
|
// 获取下一个流程节点
|
176
|
|
- // getNextFlowNode(params).then(res => {
|
177
|
|
- // this.$set(this.taskForm.variables, "formId", this.taskForm.formId);
|
178
|
|
- // this.$set(this.taskForm.variables, "budgetInitiator", this.peopleForm.userId);
|
179
|
|
- // getUsersDeptLeaderByDept({ deptId: 105 }).then(res => {
|
180
|
|
- // let userId = res.data.userId;
|
181
|
|
- // this.$set(this.taskForm.variables, "approval", userId);
|
182
|
|
- // complete(this.taskForm).then(response => {
|
183
|
|
- // this.$modal.msgSuccess(response.msg);
|
184
|
|
- // this.$emit('goBack')
|
185
|
|
- // });
|
186
|
|
- // })
|
187
|
|
- // })
|
|
193
|
+ getNextFlowNode(params).then(res => {
|
|
194
|
+ this.$set(this.taskForm.variables, "formId", this.taskForm.formId);
|
|
195
|
+ this.$set(this.taskForm.variables, "budgetInitiator", this.peopleForm.userId);
|
|
196
|
+ getUsersDeptLeaderByDept({ deptId: 105 }).then(res => {
|
|
197
|
+ let userId = res.data.userId;
|
|
198
|
+ this.$set(this.taskForm.variables, "approval", userId);
|
|
199
|
+ complete(this.taskForm).then(response => {
|
|
200
|
+ this.$modal.msgSuccess(response.msg);
|
|
201
|
+ this.$emit('goBack')
|
|
202
|
+ });
|
|
203
|
+ })
|
|
204
|
+ })
|
188
|
205
|
},
|
189
|
206
|
cancel() {
|
190
|
207
|
this.form = {}
|