|
@@ -2,7 +2,7 @@
|
2
|
2
|
* @Author: ysh
|
3
|
3
|
* @Date: 2024-03-18 11:00:04
|
4
|
4
|
* @LastEditors: Please set LastEditors
|
5
|
|
- * @LastEditTime: 2024-08-29 14:31:38
|
|
5
|
+ * @LastEditTime: 2024-09-05 16:35:08
|
6
|
6
|
-->
|
7
|
7
|
<template>
|
8
|
8
|
<div class="project-wrapper">
|
|
@@ -66,6 +66,23 @@
|
66
|
66
|
:fileType="['doc', 'docx', 'xls', 'xlsx', 'pdf', 'rar', 'zip']" @input="setProjectDocument">
|
67
|
67
|
</FileUpload>
|
68
|
68
|
</el-form-item>
|
|
69
|
+ <el-form-item label="计划工作量:" prop="taskDocument">
|
|
70
|
+ <plan-workload ref="planworkRef" :projectId="taskForm.formId"></plan-workload>
|
|
71
|
+ </el-form-item>
|
|
72
|
+ <el-form-item label="承担部门:" prop="deptId">
|
|
73
|
+ <el-select v-model="addForm.deptId" multiple clearable style="width:100%" @change="getDeptLeader">
|
|
74
|
+ <el-option v-for="item in deptList" :key="item.deptId" :label="item.deptName" :value="item.deptId"
|
|
75
|
+ v-if="item.deptName != '四川中水成勘院测绘工程有限责任公司'">
|
|
76
|
+ </el-option>
|
|
77
|
+ </el-select>
|
|
78
|
+ </el-form-item>
|
|
79
|
+ <el-form-item label="部门负责人:" prop="deptLeader">
|
|
80
|
+ <el-select v-model="addForm.deptLeader" multiple clearable style="width:100%">
|
|
81
|
+ <el-option v-for="item in $store.state.user.userList" :key="item.userId" :label="item.nickName"
|
|
82
|
+ :value="item.userId">
|
|
83
|
+ </el-option>
|
|
84
|
+ </el-select>
|
|
85
|
+ </el-form-item>
|
69
|
86
|
<el-form-item label="资料提交要求:" prop="projectRequest">
|
70
|
87
|
<el-input v-model="addForm.projectRequest" type="textarea" :autosize="{ minRows: 4, maxRows: 10 }"></el-input>
|
71
|
88
|
</el-form-item>
|
|
@@ -104,6 +121,7 @@
|
104
|
121
|
import { parseTime } from "@/utils/ruoyi";
|
105
|
122
|
import { mapGetters } from "vuex";
|
106
|
123
|
import { listProject, getProject, addProject, updateProject, delProject, getProjectNmuber } from "@/api/oa/project/project";
|
|
124
|
+import { listDept } from '@/api/system/dept'
|
107
|
125
|
import { getUser } from "@/api/system/user";
|
108
|
126
|
import { getUsersDeptLeaderByDept } from "@/api/system/post";
|
109
|
127
|
import { complete, getNextFlowNode } from "@/api/flowable/todo";
|
|
@@ -114,8 +132,9 @@ import { listPartyA } from "@/api/oa/partyA/partyA";
|
114
|
132
|
import chooseContract from '../components/chooseContract.vue';
|
115
|
133
|
import ChoosePartyA from '@/views/flowable/form/components/choosePartyA.vue';
|
116
|
134
|
import ArrangeProject from './arrangeProject.vue';
|
|
135
|
+import planWorkload from "./planWorkload.vue";
|
117
|
136
|
export default {
|
118
|
|
- components: { chooseContract, ArrangeProject, ChoosePartyA },
|
|
137
|
+ components: { chooseContract, ArrangeProject, ChoosePartyA, planWorkload },
|
119
|
138
|
dicts: ['cmc_scale_grade', 'cmc_unit'],
|
120
|
139
|
props: {
|
121
|
140
|
disabled: {
|
|
@@ -147,6 +166,8 @@ export default {
|
147
|
166
|
},
|
148
|
167
|
projectList: [],
|
149
|
168
|
partyAList: [],
|
|
169
|
+ deptList: [],
|
|
170
|
+ deptLeaderList: [],
|
150
|
171
|
total: 0,
|
151
|
172
|
loading: true,
|
152
|
173
|
modifyOpen: false,
|
|
@@ -175,6 +196,12 @@ export default {
|
175
|
196
|
partyAId: [{ required: true, message: "请选择甲方单位", trigger: "change" }],
|
176
|
197
|
contactPerson: [{ required: true, message: "请输入联系人", trigger: "blur" }],
|
177
|
198
|
telephone: [{ required: true, message: "请输入联系人联系方式", trigger: "blur" }],
|
|
199
|
+ deptId: [
|
|
200
|
+ { required: true, message: "请选择承担部门", trigger: "change" }
|
|
201
|
+ ],
|
|
202
|
+ deptLeader: [
|
|
203
|
+ { required: true, message: "部门负责人不能为空", trigger: "change" }
|
|
204
|
+ ]
|
178
|
205
|
// projectRequest: [{ required: true, message: "请输入资料提交要求", trigger: "blur" }],
|
179
|
206
|
// taskDocument: [{ required: true, message: "请上传任务书", trigger: "blur" }]
|
180
|
207
|
},
|
|
@@ -196,6 +223,7 @@ export default {
|
196
|
223
|
this.registerTime = parseTime(new Date(), '{y}-{m}-{d}')
|
197
|
224
|
this.initProjectForm();
|
198
|
225
|
this.getPartyAList();
|
|
226
|
+ this.getDeptList();
|
199
|
227
|
this.getContractDataList();
|
200
|
228
|
// this.getList();
|
201
|
229
|
},
|
|
@@ -219,6 +247,14 @@ export default {
|
219
|
247
|
this.loading = false;
|
220
|
248
|
});
|
221
|
249
|
},
|
|
250
|
+ getDeptList() {
|
|
251
|
+ listDept({
|
|
252
|
+ deptName: undefined,
|
|
253
|
+ status: undefined
|
|
254
|
+ }).then(res => {
|
|
255
|
+ this.deptList = res.data
|
|
256
|
+ })
|
|
257
|
+ },
|
222
|
258
|
async initProjectForm() {
|
223
|
259
|
let datas = await listProject({ projectId: this.taskForm.formId });
|
224
|
260
|
if (datas.rows.length > 0) {
|
|
@@ -230,9 +266,29 @@ export default {
|
230
|
266
|
this.registrantUser = this.name;
|
231
|
267
|
}
|
232
|
268
|
},
|
|
269
|
+ async getDeptLeader(val) {
|
|
270
|
+ this.deptLeaderList = [];
|
|
271
|
+ for (let v of val) {
|
|
272
|
+ let res = await getUsersDeptLeaderByDept({ deptId: Number(v) })
|
|
273
|
+ this.deptLeaderList.push(res.data.userId);
|
|
274
|
+ }
|
|
275
|
+ this.$set(this.addForm, 'deptLeader', this.deptLeaderList);
|
|
276
|
+ this.addForm.undertakingDept = this.addForm.deptId.join(',');
|
|
277
|
+ },
|
233
|
278
|
getProjectInfo() {
|
234
|
279
|
getProject(this.taskForm.formId).then(res => {
|
235
|
280
|
this.addForm = res.data;
|
|
281
|
+ if (this.addForm.undertakingDept != null && this.addForm.undertakingDept != "" && this.addForm.undertakingDept != undefined) {
|
|
282
|
+ this.addForm.deptId = this.addForm.undertakingDeptName.split(',')
|
|
283
|
+ }
|
|
284
|
+ this.$set(this.addForm, 'deptLeader', [])
|
|
285
|
+ if (this.addForm.undertakingDept) {
|
|
286
|
+ let arr = (this.addForm.undertakingDept.split(',')).map(Number)
|
|
287
|
+ this.$set(this.addForm, 'deptId', arr)
|
|
288
|
+ this.getDeptLeader(arr);
|
|
289
|
+ } else {
|
|
290
|
+ this.$set(this.addForm, 'deptId', [])
|
|
291
|
+ }
|
236
|
292
|
})
|
237
|
293
|
},
|
238
|
294
|
getProjectWorkList() {
|
|
@@ -269,8 +325,19 @@ export default {
|
269
|
325
|
}
|
270
|
326
|
this.openContract = false;
|
271
|
327
|
},
|
|
328
|
+ updatePlanWorkload() {
|
|
329
|
+ const workList = this.$refs.planworkRef.workList;
|
|
330
|
+ const projectId = this.taskForm.formId
|
|
331
|
+ delProjectWork(projectId).then(() => {
|
|
332
|
+ workList.forEach(work => {
|
|
333
|
+ work.projectId = projectId;
|
|
334
|
+ addProjectWork(work);
|
|
335
|
+ })
|
|
336
|
+ })
|
|
337
|
+ },
|
272
|
338
|
// 暂存
|
273
|
339
|
async save() {
|
|
340
|
+ this.updatePlanWorkload();
|
274
|
341
|
// 新增项目数据
|
275
|
342
|
if (this.formTotal == 0) {
|
276
|
343
|
this.addForm.projectId = this.taskForm.formId;
|
|
@@ -283,9 +350,6 @@ export default {
|
283
|
350
|
await addProjectContract(pcobj)
|
284
|
351
|
this.$modal.msgSuccess("合同关联成功");
|
285
|
352
|
}
|
286
|
|
- // setTimeout(() => {
|
287
|
|
- // this.$router.go(0);
|
288
|
|
- // }, 500);
|
289
|
353
|
this.initProjectForm();
|
290
|
354
|
} else {
|
291
|
355
|
// 修改项目数据
|
|
@@ -304,6 +368,7 @@ export default {
|
304
|
368
|
// 获取下一个流程节点
|
305
|
369
|
this.$refs['projectAdd'].validate((vaild) => {
|
306
|
370
|
if (vaild) {
|
|
371
|
+ this.updatePlanWorkload();
|
307
|
372
|
if (this.formTotal == 0) {
|
308
|
373
|
this.addForm.projectId = this.taskForm.formId;
|
309
|
374
|
addProject(this.addForm).then(response => {
|