|
@@ -0,0 +1,617 @@
|
|
1
|
+<!--
|
|
2
|
+ * @Author: ysh
|
|
3
|
+ * @Date: 2024-02-27 14:49:15
|
|
4
|
+ * @LastEditors: Please set LastEditors
|
|
5
|
+ * @LastEditTime: 2024-09-20 16:55:07
|
|
6
|
+-->
|
|
7
|
+<template>
|
|
8
|
+ <div class="project-wrapper">
|
|
9
|
+ <!-- 搜索栏 -->
|
|
10
|
+ <el-row>
|
|
11
|
+ <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="88px">
|
|
12
|
+ <el-form-item label="项目编号" prop="projectNumber">
|
|
13
|
+ <el-input v-model="queryParams.projectNumber" placeholder="请输入项目编号" clearable
|
|
14
|
+ @keyup.enter.native="handleQuery" />
|
|
15
|
+ </el-form-item>
|
|
16
|
+ <el-form-item label="项目名称" prop="projectName">
|
|
17
|
+ <el-input v-model="queryParams.projectName" placeholder="请输入项目名称" clearable
|
|
18
|
+ @keyup.enter.native="handleQuery" />
|
|
19
|
+ </el-form-item>
|
|
20
|
+ <el-form-item label="项目负责人" prop="projectLeader">
|
|
21
|
+ <el-select v-model="queryParams.projectLeader" clearable filterable placeholder="请输入项目负责人" size="large"
|
|
22
|
+ style="width: 240px" @keyup.enter.native="handleQuery">
|
|
23
|
+ <el-option v-for="item in userList" :key="item.userId" :label="item.nickName" :value="item.userId" />
|
|
24
|
+ </el-select>
|
|
25
|
+ </el-form-item>
|
|
26
|
+ <el-form-item label="状态" prop="isFinished">
|
|
27
|
+ <el-select v-model="queryParams.isFinished" clearable>
|
|
28
|
+ <el-option label="进行中" value="0"></el-option>
|
|
29
|
+ <el-option label="已结束" value="1"></el-option>
|
|
30
|
+ </el-select>
|
|
31
|
+ </el-form-item>
|
|
32
|
+ <el-form-item>
|
|
33
|
+ <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
|
34
|
+ </el-form-item>
|
|
35
|
+ </el-form>
|
|
36
|
+ </el-row>
|
|
37
|
+ <!-- 项目统计 -->
|
|
38
|
+ <!-- <el-row>
|
|
39
|
+ <el-col>
|
|
40
|
+ <el-row :gutter="20">
|
|
41
|
+ <el-col :span="8" :xs="24">
|
|
42
|
+ <div class="static-box">
|
|
43
|
+ <div class="title">今年项目数量</div>
|
|
44
|
+ <div class="box-content">
|
|
45
|
+ <div class="box-left">
|
|
46
|
+ <div class="number">48</div>
|
|
47
|
+ </div>
|
|
48
|
+ <dir class="box-right">
|
|
49
|
+ <div style="display: flex;">
|
|
50
|
+ <div>院内</div>
|
|
51
|
+ <div class="progress"><el-progress :percentage="100" :stroke-width="14"></el-progress></div>
|
|
52
|
+ </div>
|
|
53
|
+ <div style="display: flex;" class="mt10">
|
|
54
|
+ <div>院外</div>
|
|
55
|
+ <div class="progress"><el-progress :percentage="100" :stroke-width="14"></el-progress></div>
|
|
56
|
+ </div>
|
|
57
|
+ </dir>
|
|
58
|
+ </div>
|
|
59
|
+ </div>
|
|
60
|
+ </el-col>
|
|
61
|
+ <el-col :span="8" :xs="24">
|
|
62
|
+
|
|
63
|
+ </el-col>
|
|
64
|
+ <el-col :span="8" :xs="24">
|
|
65
|
+
|
|
66
|
+ </el-col>
|
|
67
|
+ </el-row>
|
|
68
|
+ </el-col>
|
|
69
|
+ </el-row> -->
|
|
70
|
+ <!-- 项目列表 -->
|
|
71
|
+ <el-card style="margin-top: 20px;">
|
|
72
|
+ <div slot="header" class="card-header">
|
|
73
|
+ <div style="font-weight: bold;font-size: 20px;">勘察项目列表</div>
|
|
74
|
+ <div>
|
|
75
|
+ <el-button style="float: right;margin-right: 10px;" type="success" size="mini" icon="el-icon-plus"
|
|
76
|
+ @click="handleRegister">登记项目</el-button>
|
|
77
|
+ <el-button style="float: right;margin-right: 10px;" type="warning" size="mini" icon="el-icon-download"
|
|
78
|
+ @click="handleExport">导出项目</el-button>
|
|
79
|
+ </div>
|
|
80
|
+ </div>
|
|
81
|
+ <el-table v-loading="loading" :data="projectList" style="margin-top: 30px;">
|
|
82
|
+ <el-table-column type="index" width="50">
|
|
83
|
+ </el-table-column>
|
|
84
|
+ <el-table-column prop="isFinshed" align="center" label="状态" width="90px">
|
|
85
|
+ <template slot-scope="scope">
|
|
86
|
+ <el-tag :type="scope.row.isFinished === '0' ? 'success' : 'warning'" disable-transitions>
|
|
87
|
+ {{ scope.row.isFinished == '0' ? '进行中' : '已结束' }}
|
|
88
|
+ </el-tag>
|
|
89
|
+ </template>
|
|
90
|
+ </el-table-column>
|
|
91
|
+ <el-table-column prop="percentage" align="center" label="生产进度" width="120px">
|
|
92
|
+ <template slot-scope="scope">
|
|
93
|
+ <el-progress :text-inside="true" :stroke-width="26" :status="formatStatus(scope.row.percentage)"
|
|
94
|
+ :percentage="scope.row.percentage" text-color="#fff"></el-progress>
|
|
95
|
+ </template>
|
|
96
|
+ </el-table-column>
|
|
97
|
+ <el-table-column label="项目编号" align="center" key="projectNumber" prop="projectNumber" width="120px" />
|
|
98
|
+ <el-table-column label="项目名称" align="center" key="projectName" prop="projectName" />
|
|
99
|
+ <el-table-column label="承担部门" align="center" key="undertakingDeptName" prop="undertakingDeptName" />
|
|
100
|
+ <el-table-column label="项目负责人" align="center" key="projectLeaderName" prop="projectLeaderUser.nickName"
|
|
101
|
+ width="120px" />
|
|
102
|
+ <el-table-column label="项目级别" align="center" key="projectLevel" prop="projectLevel" width="120px">
|
|
103
|
+ <template slot-scope="scope">
|
|
104
|
+ <el-tag :type="scope.row.projectLevel ? (scope.row.projectLevel === '0' ? 'info' : 'danger') : 'info'"
|
|
105
|
+ disable-transitions>
|
|
106
|
+ {{ scope.row.projectLevel ? (scope.row.projectLevel == '0' ? '一般项目' : '重大项目') : '一般项目' }}
|
|
107
|
+ </el-tag>
|
|
108
|
+ </template>
|
|
109
|
+ </el-table-column>
|
|
110
|
+ <el-table-column label="项目类型" align="center" key="projectType" prop="projectType" width="120px" />
|
|
111
|
+ <el-table-column label="操作" align="center" width="160" class-name="small-padding fixed-width">
|
|
112
|
+ <template slot-scope="scope" v-if="scope.row.userId !== 1">
|
|
113
|
+ <el-button size="mini" type="text" icon="el-icon-view" @click="handleView(scope.row)"
|
|
114
|
+ v-hasPermi="['oa:project:query']">查看</el-button>
|
|
115
|
+ <!-- <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
|
|
116
|
+ v-hasPermi="['oa:project:edit']">修改</el-button> -->
|
|
117
|
+ <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
|
118
|
+ v-hasPermi="['oa:project:remove']">删除</el-button>
|
|
119
|
+ </template>
|
|
120
|
+ </el-table-column>
|
|
121
|
+ </el-table>
|
|
122
|
+ <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
|
|
123
|
+ :autoScroll="false" @pagination="getList" />
|
|
124
|
+ </el-card>
|
|
125
|
+ <!-- 新建项目 -->
|
|
126
|
+ <el-dialog :title="title" :visible.sync="addOpen" append-to-body>
|
|
127
|
+ <el-form :model="addForm" :rules="rules" label-width="100px">
|
|
128
|
+ <el-form-item label="项目编号:" prop="projectNumber">
|
|
129
|
+ <el-input v-model="addForm.projectNumber"></el-input>
|
|
130
|
+ </el-form-item>
|
|
131
|
+ <el-form-item label="项目名称:" prop="projectName">
|
|
132
|
+ <el-input v-model="addForm.projectName"></el-input>
|
|
133
|
+ </el-form-item>
|
|
134
|
+ <el-form-item label="项目负责人:" prop="projectLeader">
|
|
135
|
+ <el-tag effect="plain" type="warning" style="margin-right: 10px;"
|
|
136
|
+ v-if="addForm.projectLeaderName != undefined">{{
|
|
137
|
+ addForm.projectLeaderName }}</el-tag>
|
|
138
|
+ <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="choosePeople">选择</el-button>
|
|
139
|
+ </el-form-item>
|
|
140
|
+ <el-form-item label="项目类型:" prop="projectType">
|
|
141
|
+ <el-input v-model="addForm.projectType"></el-input>
|
|
142
|
+ </el-form-item>
|
|
143
|
+ <el-form-item label="项目级别:" prop="projectLevel">
|
|
144
|
+ <el-radio v-model="addForm.projectLevel" label="0">一般项目</el-radio>
|
|
145
|
+ <el-radio v-model="addForm.projectLevel" label="1">重大项目</el-radio>
|
|
146
|
+ </el-form-item>
|
|
147
|
+ <el-form-item label="项目来源:" prop="projectSource">
|
|
148
|
+ <el-radio v-model="addForm.projectSource" label="0">院内</el-radio>
|
|
149
|
+ <el-radio v-model="addForm.projectSource" label="1">院外</el-radio>
|
|
150
|
+ </el-form-item>
|
|
151
|
+ <el-form-item label="甲方单位:" prop="partyA">
|
|
152
|
+ <el-input v-model="addForm.partyA"></el-input>
|
|
153
|
+ </el-form-item>
|
|
154
|
+ <el-form-item label="联系人:" prop="contactPerson">
|
|
155
|
+ <el-input v-model="addForm.contactPerson"></el-input>
|
|
156
|
+ </el-form-item>
|
|
157
|
+ <el-form-item label="联系电话:" prop="telephone">
|
|
158
|
+ <el-input v-model="addForm.telephone"></el-input>
|
|
159
|
+ </el-form-item>
|
|
160
|
+ <el-form-item label="项目概况:" prop="projectRegistrant">
|
|
161
|
+ <table border="1">
|
|
162
|
+ <tr>
|
|
163
|
+ <td style="width:250px;">工作内容</td>
|
|
164
|
+ <td>等级或比例尺</td>
|
|
165
|
+ <td>单位</td>
|
|
166
|
+ <td>工作量</td>
|
|
167
|
+ <td style="width:100px;">要求完成时间</td>
|
|
168
|
+ <td>备注</td>
|
|
169
|
+ </tr>
|
|
170
|
+ <tr v-for="(work, index) in workList" :key="index">
|
|
171
|
+ <td>
|
|
172
|
+ <el-input v-model="work.content" type="textarea" autosize clearable></el-input>
|
|
173
|
+ </td>
|
|
174
|
+ <td>
|
|
175
|
+ <el-input v-model="work.scale" clearable></el-input>
|
|
176
|
+ </td>
|
|
177
|
+ <td>
|
|
178
|
+ <el-input v-model="work.unit" clearable></el-input>
|
|
179
|
+ </td>
|
|
180
|
+ <td>
|
|
181
|
+ <el-input v-model="work.workload" clearable></el-input>
|
|
182
|
+ </td>
|
|
183
|
+ <td>
|
|
184
|
+ <el-date-picker style="width:140px;" v-model="work.deadline" value-format="yyyy-MM-dd" type="date"
|
|
185
|
+ placeholder="选择日期">
|
|
186
|
+ </el-date-picker>
|
|
187
|
+ </td>
|
|
188
|
+ <td>
|
|
189
|
+ <el-input v-model="work.remark" type="textarea" autosize clearable></el-input>
|
|
190
|
+ </td>
|
|
191
|
+ <td>
|
|
192
|
+ <el-button type="danger" icon="el-icon-minus" size="mini" circle
|
|
193
|
+ @click="deletWorkItem(index)"></el-button>
|
|
194
|
+ </td>
|
|
195
|
+ </tr>
|
|
196
|
+ </table>
|
|
197
|
+
|
|
198
|
+ <el-button icon="el-icon-plus" size="mini" @click="addWorkList"></el-button>
|
|
199
|
+ </el-form-item>
|
|
200
|
+ <el-form-item label="项目登记人:" prop="projectRegistrant">
|
|
201
|
+ <el-input v-model="addForm.projectRegistrant"></el-input>
|
|
202
|
+ </el-form-item>
|
|
203
|
+ <el-form-item label="备注:" prop="projectRegistrant">
|
|
204
|
+ <el-input v-model="addForm.remark" type="textarea" rows="3"></el-input>
|
|
205
|
+ </el-form-item>
|
|
206
|
+
|
|
207
|
+ </el-form>
|
|
208
|
+ <div slot="footer" class="dialog-footer" style="text-align: center;">
|
|
209
|
+ <el-button type="primary" @click="confirmAddForm">确 定</el-button>
|
|
210
|
+ <el-button @click="cancel">取 消</el-button>
|
|
211
|
+ </div>
|
|
212
|
+ <!-- 人员选择对话框 -->
|
|
213
|
+ <el-dialog width="30%" title="选择项目负责人" :visible.sync="peopleVisible" append-to-body>
|
|
214
|
+ <el-form>
|
|
215
|
+ <el-form-item label="部门:">
|
|
216
|
+ <el-select v-model="peopleForm.deptId" @change="handleChangeDept">
|
|
217
|
+ <el-option v-for="item in peopleForm.deptList" :key="item.deptId" :label="item.deptName"
|
|
218
|
+ :value="item.deptId" v-if="item.deptName != '四川中水成勘院测绘工程有限责任公司'">
|
|
219
|
+ </el-option>
|
|
220
|
+ </el-select>
|
|
221
|
+ </el-form-item>
|
|
222
|
+ <el-form-item label="人员:">
|
|
223
|
+ <el-select v-model="peopleForm.userId">
|
|
224
|
+ <el-option v-for="item in peopleForm.userList" :key="item.userId" :label="item.nickName"
|
|
225
|
+ :value="item.userId">
|
|
226
|
+ </el-option>
|
|
227
|
+ </el-select>
|
|
228
|
+ </el-form-item>
|
|
229
|
+ <el-form-item>
|
|
230
|
+ <el-button @click="confirmPeople" type="primary">确定</el-button>
|
|
231
|
+ <el-button @click="cancelChoosePeople">取消</el-button>
|
|
232
|
+ </el-form-item>
|
|
233
|
+ </el-form>
|
|
234
|
+ </el-dialog>
|
|
235
|
+
|
|
236
|
+ <!-- 修改项目 -->
|
|
237
|
+ <el-dialog :title="title" :visible.sync="modifyOpen">
|
|
238
|
+
|
|
239
|
+ </el-dialog>
|
|
240
|
+
|
|
241
|
+ </el-dialog>
|
|
242
|
+ </div>
|
|
243
|
+</template>
|
|
244
|
+
|
|
245
|
+<script>
|
|
246
|
+import { listInvestProject, submitProject, modifyProject, delProject } from "@/api/oa/project/project";
|
|
247
|
+import { listProjectProgress, getProjectProgress } from "@/api/oa/project/projectProgress";
|
|
248
|
+import { listDept } from '@/api/system/dept';
|
|
249
|
+import { listUser, getUser } from '@/api/system/user';
|
|
250
|
+import { mapGetters } from 'vuex';
|
|
251
|
+import { checkPermi } from '@/utils/permission';
|
|
252
|
+import { listDefinition } from "@/api/flowable/definition";
|
|
253
|
+import { definitionStart, flowXmlAndNode } from "@/api/flowable/definition";
|
|
254
|
+import { todoList, getNextFlowNodeByStart } from "@/api/flowable/todo";
|
|
255
|
+import { Snowflake } from '@/utils/snowFlake.js'
|
|
256
|
+
|
|
257
|
+export default {
|
|
258
|
+ name: 'Invest',
|
|
259
|
+ computed: {
|
|
260
|
+ ...mapGetters(['deptId', 'userId'])
|
|
261
|
+ },
|
|
262
|
+ data() {
|
|
263
|
+ return {
|
|
264
|
+ userList: [],
|
|
265
|
+ // 查询参数
|
|
266
|
+ queryParams: {
|
|
267
|
+ pageNum: 1,
|
|
268
|
+ pageSize: 10,
|
|
269
|
+ projectNumber: '',
|
|
270
|
+ projectLeader: undefined,
|
|
271
|
+ projectName: '',
|
|
272
|
+ },
|
|
273
|
+ projectList: [],
|
|
274
|
+ total: 0,
|
|
275
|
+ loading: true,
|
|
276
|
+ addOpen: false,
|
|
277
|
+ modifyOpen: false,
|
|
278
|
+ title: '',
|
|
279
|
+ addForm: {},
|
|
280
|
+ rules: {
|
|
281
|
+ projectNumber: [{ required: true, message: '请输入项目编号', trigger: 'blur' }],
|
|
282
|
+ projectName: [{ required: true, message: '请输入项目名称', trigger: 'blur' }]
|
|
283
|
+ },
|
|
284
|
+ peopleVisible: false,
|
|
285
|
+ peopleForm: {
|
|
286
|
+ deptId: '',
|
|
287
|
+ deptList: [],
|
|
288
|
+ userId: '',
|
|
289
|
+ userList: []
|
|
290
|
+ },
|
|
291
|
+ workList: [{
|
|
292
|
+ content: '',
|
|
293
|
+ scale: '',
|
|
294
|
+ unit: '',
|
|
295
|
+ workload: '',
|
|
296
|
+ deadline: '',
|
|
297
|
+ remark: ''
|
|
298
|
+ }],
|
|
299
|
+ }
|
|
300
|
+ },
|
|
301
|
+ created() {
|
|
302
|
+ this.getList();
|
|
303
|
+ this.getDeptList();
|
|
304
|
+ this.getUserList();
|
|
305
|
+ },
|
|
306
|
+ methods: {
|
|
307
|
+ // 查询项目列表
|
|
308
|
+ async getList() {
|
|
309
|
+ this.loading = true
|
|
310
|
+ if (this.deptId > 106 && this.deptId != 109) {
|
|
311
|
+ let response = await checkPermi(['oa:allproject:query'])
|
|
312
|
+ if (response == false) {
|
|
313
|
+ this.queryParams.undertakingDept = this.deptId
|
|
314
|
+ }
|
|
315
|
+ }
|
|
316
|
+ listInvestProject(this.queryParams).then(response => {
|
|
317
|
+ this.projectList = response.rows;
|
|
318
|
+ this.total = response.total;
|
|
319
|
+ this.loading = false;
|
|
320
|
+ for (let project of this.projectList) {
|
|
321
|
+ getProjectProgress(project.projectId).then(res => {
|
|
322
|
+ if (res.data) {
|
|
323
|
+ let len = res.data.length
|
|
324
|
+ if (len != 0) {
|
|
325
|
+ this.$set(project, 'percentage', Number(res.data[len - 1].percentage))
|
|
326
|
+ } else {
|
|
327
|
+ this.$set(project, 'percentage', 0)
|
|
328
|
+ }
|
|
329
|
+ if (project.isFinished == '1') {
|
|
330
|
+ this.$set(project, 'percentage', 100)
|
|
331
|
+ }
|
|
332
|
+ }
|
|
333
|
+ })
|
|
334
|
+ }
|
|
335
|
+ })
|
|
336
|
+ },
|
|
337
|
+ getDeptList() {
|
|
338
|
+ listDept({
|
|
339
|
+ deptName: undefined,
|
|
340
|
+ status: undefined
|
|
341
|
+ }).then(res => {
|
|
342
|
+ this.peopleForm.deptList = res.data
|
|
343
|
+ })
|
|
344
|
+ },
|
|
345
|
+ getUserList() {
|
|
346
|
+ listUser({ pageNum: 1, pageSize: 9999 }).then(res => {
|
|
347
|
+ this.userList = res.rows
|
|
348
|
+ })
|
|
349
|
+ },
|
|
350
|
+ handleQuery() {
|
|
351
|
+ this.queryParams.pageNum = 1;
|
|
352
|
+ this.getList();
|
|
353
|
+ },
|
|
354
|
+ handleAdd() {
|
|
355
|
+ this.title = '新增项目'
|
|
356
|
+ this.addOpen = true
|
|
357
|
+ },
|
|
358
|
+ handleView(row) {
|
|
359
|
+ let id = row.projectId
|
|
360
|
+ this.$router.push({
|
|
361
|
+ path: '/project/info',
|
|
362
|
+ query: { projectId: id }
|
|
363
|
+ })
|
|
364
|
+ },
|
|
365
|
+ handleUpdate(row) {
|
|
366
|
+ this.addForm = row;
|
|
367
|
+ this.title = '修改项目信息';
|
|
368
|
+ this.addOpen = true;
|
|
369
|
+ },
|
|
370
|
+ handleDelete(row) {
|
|
371
|
+ const projectIds = row.projectId || this.ids;
|
|
372
|
+ const projectNumbers = row.projectNumber || this.ids;
|
|
373
|
+ this.$modal.confirm('是否确认删除项目编号为"' + projectNumbers + '"的数据项?').then(function () {
|
|
374
|
+ return delProject(projectIds);
|
|
375
|
+ }).then(() => {
|
|
376
|
+ this.getList();
|
|
377
|
+ this.$modal.msgSuccess("删除成功");
|
|
378
|
+ }).catch(() => { });
|
|
379
|
+ },
|
|
380
|
+ confirmAddForm() {
|
|
381
|
+ this.addForm.workList = this.workList;
|
|
382
|
+ let formData = new FormData();
|
|
383
|
+ let form = JSON.stringify(this.addForm);
|
|
384
|
+ formData.append("form", form);
|
|
385
|
+ if (this.title == '新增项目')
|
|
386
|
+ submitProject(formData).then(response => {
|
|
387
|
+ this.$modal.msgSuccess("新增成功");
|
|
388
|
+ this.addOpen = false;
|
|
389
|
+ this.getList();
|
|
390
|
+ });
|
|
391
|
+ else
|
|
392
|
+ modifyProject(formData).then(response => {
|
|
393
|
+ this.$modal.msgSuccess("修改成功");
|
|
394
|
+ this.addOpen = false;
|
|
395
|
+ this.getList();
|
|
396
|
+ });
|
|
397
|
+ },
|
|
398
|
+ // 人员选择
|
|
399
|
+ choosePeople() {
|
|
400
|
+ this.peopleVisible = true;
|
|
401
|
+ },
|
|
402
|
+ // 改变部门选择
|
|
403
|
+ handleChangeDept(deptId) {
|
|
404
|
+ this.peopleForm.userId = '';
|
|
405
|
+ listUser({ pageSize: 999999, deptId }).then(res => {
|
|
406
|
+ this.peopleForm.userList = res.rows
|
|
407
|
+ })
|
|
408
|
+ },
|
|
409
|
+ // 确定项目负责人
|
|
410
|
+ confirmPeople() {
|
|
411
|
+ this.addForm.projectLeader = this.peopleForm.userId;
|
|
412
|
+ this.addForm.projectLeaderName = this.tagLeader()
|
|
413
|
+ this.peopleVisible = false
|
|
414
|
+ },
|
|
415
|
+ tagLeader() {
|
|
416
|
+ if (this.addForm.projectLeader == '' || this.addForm.projectLeader == undefined || this.addForm.projectLeader == null) {
|
|
417
|
+ return undefined
|
|
418
|
+ } else {
|
|
419
|
+ for (let user of this.peopleForm.userList) {
|
|
420
|
+ if (this.addForm.projectLeader == user.userId) {
|
|
421
|
+ return user.nickName
|
|
422
|
+ }
|
|
423
|
+ }
|
|
424
|
+ }
|
|
425
|
+ },
|
|
426
|
+ cancel() {
|
|
427
|
+ this.peopleForm.deptId = '';
|
|
428
|
+ this.peopleForm.userId = '';
|
|
429
|
+ this.addOpen = false;
|
|
430
|
+ this.addForm = {}
|
|
431
|
+ },
|
|
432
|
+ addWorkList() {
|
|
433
|
+ this.workList.push({
|
|
434
|
+ content: '',
|
|
435
|
+ scale: '',
|
|
436
|
+ unit: '',
|
|
437
|
+ workload: '',
|
|
438
|
+ deadline: '',
|
|
439
|
+ remark: ''
|
|
440
|
+ });
|
|
441
|
+ },
|
|
442
|
+ deletWorkItem(index) {
|
|
443
|
+ let arr = this.workList
|
|
444
|
+ if (arr.length == 1) {
|
|
445
|
+ return
|
|
446
|
+ }
|
|
447
|
+ if (index >= 0 && index < arr.length) {
|
|
448
|
+ arr.splice(index, 1);
|
|
449
|
+ }
|
|
450
|
+ },
|
|
451
|
+ cancelChoosePeople() {
|
|
452
|
+ this.peopleForm.deptId = '';
|
|
453
|
+ this.peopleForm.userId = '';
|
|
454
|
+ this.peopleVisible = false;
|
|
455
|
+ },
|
|
456
|
+ formatStatus(row) {
|
|
457
|
+ if (row <= 20) {
|
|
458
|
+ return 'exception'
|
|
459
|
+ } else if (row > 20 && row <= 50) {
|
|
460
|
+ return 'warning'
|
|
461
|
+ } else if (row > 50 && row <= 80) {
|
|
462
|
+ return ''
|
|
463
|
+ } else {
|
|
464
|
+ return 'success'
|
|
465
|
+ }
|
|
466
|
+ },
|
|
467
|
+ async handleRegister() {
|
|
468
|
+ let response = await listDefinition({
|
|
469
|
+ pageNum: 1,
|
|
470
|
+ pageSize: 9999,
|
|
471
|
+ name: "项目流转",
|
|
472
|
+ category: "project",
|
|
473
|
+ })
|
|
474
|
+ if (response.data.total == 1) {
|
|
475
|
+ let obj = response.data.records[0]
|
|
476
|
+ this.$confirm("是否发起项目流转?", '提示', {
|
|
477
|
+ confirmButtonText: '确定',
|
|
478
|
+ cancelButtonText: '取消',
|
|
479
|
+ type: 'warning'
|
|
480
|
+ }).then(() => {
|
|
481
|
+ this.handleStartProcess(obj)
|
|
482
|
+ }).catch(() => { });
|
|
483
|
+ }
|
|
484
|
+ },
|
|
485
|
+ handleExport() {
|
|
486
|
+ this.queryParams.pageSize = 99999
|
|
487
|
+ this.download('oa/project/export', {
|
|
488
|
+ ...this.queryParams
|
|
489
|
+ }, `project_${new Date().getTime()}.xlsx`).then(() => {
|
|
490
|
+ this.queryParams.pageSize = 10
|
|
491
|
+ })
|
|
492
|
+ },
|
|
493
|
+ handleStartProcess(row) {
|
|
494
|
+ let formId = new Snowflake(1n, 1n, 0n).nextId().toString();
|
|
495
|
+ getNextFlowNodeByStart({ deploymentId: row.deploymentId, variables: { formId: formId } }).then(res => {
|
|
496
|
+ let data = res.data;
|
|
497
|
+ const variables = {};
|
|
498
|
+ const formData = {};
|
|
499
|
+ formData.disabled = true;
|
|
500
|
+ formData.formBtns = false;
|
|
501
|
+ formData.formId = formId
|
|
502
|
+ if (row.id) {
|
|
503
|
+ variables.variables = formData;
|
|
504
|
+ let routePath = this.getRoutePath(row);
|
|
505
|
+ definitionStart(row.id, JSON.stringify(variables)).then(res => {
|
|
506
|
+ this.$modal.msgSuccess(res.msg);
|
|
507
|
+ let procInstanceId = res.data;
|
|
508
|
+ todoList({
|
|
509
|
+ pageNum: 1,
|
|
510
|
+ pageSize: 99999999, processInsId: procInstanceId
|
|
511
|
+ }).then(toDoRes => {
|
|
512
|
+ let records = toDoRes.data.records;
|
|
513
|
+ if (records.length == 1) {
|
|
514
|
+ records = records[0]
|
|
515
|
+ }
|
|
516
|
+ this.$router.push({
|
|
517
|
+ path: routePath,
|
|
518
|
+ query: {
|
|
519
|
+ procInsId: records.procInsId,
|
|
520
|
+ executionId: records.executionId,
|
|
521
|
+ deployId: records.deployId,
|
|
522
|
+ taskId: records.taskId,
|
|
523
|
+ taskName: records.taskName,
|
|
524
|
+ startUser: records.startUserName + '-' + records.startDeptName,
|
|
525
|
+ formId: formData.formId,
|
|
526
|
+ procDefName: records.procDefName
|
|
527
|
+ }
|
|
528
|
+ })
|
|
529
|
+ })
|
|
530
|
+ })
|
|
531
|
+ }
|
|
532
|
+ })
|
|
533
|
+ },
|
|
534
|
+ getRoutePath(row) {
|
|
535
|
+ let path;
|
|
536
|
+ for (let p of this.publicData.pathRoute) {
|
|
537
|
+ if (p.name == row.name) {
|
|
538
|
+ path = p.path
|
|
539
|
+ break
|
|
540
|
+ } else {
|
|
541
|
+ path = '/flowable/task/todo/detail/index'
|
|
542
|
+ }
|
|
543
|
+ }
|
|
544
|
+ return path
|
|
545
|
+ },
|
|
546
|
+ },
|
|
547
|
+}
|
|
548
|
+</script>
|
|
549
|
+
|
|
550
|
+<style lang="scss" scoped>
|
|
551
|
+.project-wrapper {
|
|
552
|
+ padding: 25px;
|
|
553
|
+ background-color: #f5f5f5;
|
|
554
|
+}
|
|
555
|
+
|
|
556
|
+.table-header {
|
|
557
|
+ background-color: #f5f5f5;
|
|
558
|
+}
|
|
559
|
+
|
|
560
|
+.card-header {
|
|
561
|
+ display: flex;
|
|
562
|
+ justify-content: space-between;
|
|
563
|
+ padding: 0 10px;
|
|
564
|
+}
|
|
565
|
+
|
|
566
|
+table {
|
|
567
|
+ /*居中*/
|
|
568
|
+ margin: 0 auto;
|
|
569
|
+ /*边框*/
|
|
570
|
+ /* border: 1px solid black; */
|
|
571
|
+ text-align: center;
|
|
572
|
+ border-collapse: collapse;
|
|
573
|
+ /*设置背景颜色*/
|
|
574
|
+ /* background-color: #bfa; */
|
|
575
|
+}
|
|
576
|
+
|
|
577
|
+.static-box {
|
|
578
|
+ width: 100%;
|
|
579
|
+ height: 120px;
|
|
580
|
+ background-color: #fff;
|
|
581
|
+ border-radius: 6px;
|
|
582
|
+ box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
|
583
|
+
|
|
584
|
+ .title {
|
|
585
|
+ padding-left: 30px;
|
|
586
|
+ padding-top: 10px;
|
|
587
|
+ font-size: 18px;
|
|
588
|
+ }
|
|
589
|
+
|
|
590
|
+ .box-content {
|
|
591
|
+ display: flex;
|
|
592
|
+
|
|
593
|
+ .box-left {
|
|
594
|
+ padding: 10px;
|
|
595
|
+
|
|
596
|
+ .number {
|
|
597
|
+ padding-left: 20px;
|
|
598
|
+ font-size: 36px;
|
|
599
|
+ font-family: Arial, Helvetica, sans-serif;
|
|
600
|
+ line-height: 70px;
|
|
601
|
+ min-width: 100px;
|
|
602
|
+ }
|
|
603
|
+ }
|
|
604
|
+
|
|
605
|
+ .box-right {
|
|
606
|
+ flex: 1;
|
|
607
|
+ padding: 0 10px;
|
|
608
|
+
|
|
609
|
+ .progress {
|
|
610
|
+ flex: 1;
|
|
611
|
+ padding-left: 10px;
|
|
612
|
+ }
|
|
613
|
+ }
|
|
614
|
+ }
|
|
615
|
+
|
|
616
|
+}
|
|
617
|
+</style>
|