|
@@ -1,8 +1,8 @@
|
1
|
1
|
<!--
|
2
|
2
|
* @Author: ysh
|
3
|
3
|
* @Date: 2024-02-29 11:44:28
|
4
|
|
- * @LastEditors: wrh
|
5
|
|
- * @LastEditTime: 2024-05-22 18:54:31
|
|
4
|
+ * @LastEditors: Please set LastEditors
|
|
5
|
+ * @LastEditTime: 2024-05-23 19:22:26
|
6
|
6
|
-->
|
7
|
7
|
|
8
|
8
|
<template>
|
|
@@ -46,25 +46,27 @@
|
46
|
46
|
</el-radio-group>
|
47
|
47
|
</el-form-item>
|
48
|
48
|
<el-form-item label="项目编号:" prop="projectId" v-if="form.carUsage == '0'">
|
49
|
|
- <el-select v-model="form.projectId" filterable placeholder="请选择" @change="handleSelectProject"
|
|
49
|
+ <el-button type="primary" size="mini" @click="openProject = true"
|
|
50
|
+ v-if="taskName == '用车申请'">选择项目</el-button>
|
|
51
|
+ <!-- <el-select v-model="form.projectId" filterable placeholder="请选择" @change="handleSelectProject"
|
50
|
52
|
:disabled="taskName != '用车申请'" clearable>
|
51
|
53
|
<el-option v-for="item in projectList" :key="item.value" :label="item.projectNumber"
|
52
|
54
|
:value="item.projectId">
|
53
|
55
|
</el-option>
|
54
|
|
- </el-select>
|
|
56
|
+ </el-select> -->
|
55
|
57
|
<el-descriptions border v-if="isSelect" style="margin-top: 10px;" :column="1">
|
56
|
58
|
<el-descriptions-item label="项目编号" label-class-name="my-label">{{ chooseProject.projectNumber
|
57
|
|
- }}</el-descriptions-item>
|
|
59
|
+ }}</el-descriptions-item>
|
58
|
60
|
<el-descriptions-item label="项目名称" label-class-name="my-label">{{ chooseProject.projectName
|
59
|
|
- }}</el-descriptions-item>
|
|
61
|
+ }}</el-descriptions-item>
|
60
|
62
|
<el-descriptions-item label="项目负责人" label-class-name="my-label">{{ chooseProject.projectLeaderUser ?
|
61
|
|
- chooseProject.projectLeaderUser.nickName : ''
|
62
|
|
- }}</el-descriptions-item>
|
|
63
|
+ chooseProject.projectLeaderUser.nickName : ''
|
|
64
|
+ }}</el-descriptions-item>
|
63
|
65
|
<el-descriptions-item label="承担部门" label-class-name="my-label">
|
64
|
66
|
<el-tag size="small">{{ chooseProject.undertakingDeptName }}</el-tag>
|
65
|
67
|
</el-descriptions-item>
|
66
|
68
|
<el-descriptions-item label="项目类型" label-class-name="my-label">{{ chooseProject.projectType
|
67
|
|
- }}</el-descriptions-item>
|
|
69
|
+ }}</el-descriptions-item>
|
68
|
70
|
</el-descriptions>
|
69
|
71
|
</el-form-item>
|
70
|
72
|
<el-form-item label="用车事由:" prop="applyReason">
|
|
@@ -75,7 +77,8 @@
|
75
|
77
|
<el-row>
|
76
|
78
|
<el-col :span="7" :xs="24">
|
77
|
79
|
<el-form-item label="乘车人数:" prop="passengers">
|
78
|
|
- <el-input-number v-model="form.passengers" :min="1" :disabled="taskName != '用车申请'"></el-input-number>
|
|
80
|
+ <el-input-number v-model="form.passengers" :min="1"
|
|
81
|
+ :disabled="taskName != '用车申请'"></el-input-number>
|
79
|
82
|
</el-form-item>
|
80
|
83
|
</el-col>
|
81
|
84
|
<el-col :span="6" :xs="24">
|
|
@@ -195,19 +198,15 @@
|
195
|
198
|
<el-checkbox-group v-model="form.cars" :disabled="taskName != '安排用车'">
|
196
|
199
|
<el-checkbox :label="item.carId" v-for="item in carList" :key="item.carId" :value="item.carId"
|
197
|
200
|
v-if="item.remark == null">
|
198
|
|
- {{ item.licensePlate }}
|
|
201
|
+ {{ item.licensePlate + item.brand }}
|
199
|
202
|
</el-checkbox>
|
200
|
203
|
</el-checkbox-group>
|
201
|
204
|
</el-form-item>
|
202
|
205
|
<el-form-item label="驾驶员:">
|
203
|
|
- <!-- <el-checkbox-group v-model="form.drivers" :disabled="taskName != '安排用车'"
|
204
|
|
- v-if="chooseOtherDrivers == false">
|
205
|
|
- <el-checkbox :label="item.userId" v-for="item in driverList" :key="item.userId" :value="item.userId">
|
206
|
|
- {{ item.nickName }}
|
207
|
|
- </el-checkbox>
|
208
|
|
- </el-checkbox-group> -->
|
209
|
|
- <el-select v-model="form.drivers" filterable multiple clearable style="width:220px"
|
210
|
|
- :disabled="taskName != '安排用车'">
|
|
206
|
+ <el-tag :key="'d' + index" class="mr10" v-for="item, index in chooseDriver">{{ item.nickName }}</el-tag>
|
|
207
|
+ <el-button v-if="taskName == '安排用车'" icon="el-icon-plus" @click="openCar = true"></el-button>
|
|
208
|
+ <el-select v-if="taskName != '安排用车'" v-model="form.drivers" filterable multiple clearable
|
|
209
|
+ style="width:420px" :disabled="taskName != '安排用车'">
|
211
|
210
|
<el-option v-for="item in userList" :key="item.userId" :label="item.nickName" :value="item.userId"
|
212
|
211
|
v-if="item.nickName != 'admin'">
|
213
|
212
|
</el-option>
|
|
@@ -219,7 +218,7 @@
|
219
|
218
|
</el-row>
|
220
|
219
|
<el-row style="text-align: center;" v-else>
|
221
|
220
|
<el-button type="primary" :disabled="taskName == ''" @click="completeApply">{{ taskName == '申请确认' ? "确认" :
|
222
|
|
- "完成审批" }}</el-button>
|
|
221
|
+ "完成审批" }}</el-button>
|
223
|
222
|
</el-row>
|
224
|
223
|
</div>
|
225
|
224
|
</el-card>
|
|
@@ -234,7 +233,12 @@
|
234
|
233
|
</el-card>
|
235
|
234
|
</el-col>
|
236
|
235
|
</el-row>
|
237
|
|
-
|
|
236
|
+ <el-dialog title="选择驾驶员" :visible.sync="openCar" width="700px" append-to-body>
|
|
237
|
+ <choose-user :deptId="200" @chooseUser="getChooseDriver"></choose-user>
|
|
238
|
+ </el-dialog>
|
|
239
|
+ <el-dialog title="选择项目" :visible.sync="openProject" width="70%" append-to-body>
|
|
240
|
+ <project-choose @chooseProject="confirmProject"></project-choose>
|
|
241
|
+ </el-dialog>
|
238
|
242
|
</div>
|
239
|
243
|
</template>
|
240
|
244
|
|
|
@@ -250,9 +254,13 @@ import flow from '@/views/flowable/task/todo/detail/flow'
|
250
|
254
|
import { flowXmlAndNode } from "@/api/flowable/definition";
|
251
|
255
|
import { listUser } from '@/api/system/user';
|
252
|
256
|
import { getUserByRole } from "@/api/system/role";
|
|
257
|
+import chooseUser from "@/views/flowable/form/budget/components/choosePeople.vue";
|
|
258
|
+import projectChoose from '@/views/flowable/form/components/chooseProject.vue';
|
253
|
259
|
export default {
|
254
|
260
|
components: {
|
255
|
|
- flow
|
|
261
|
+ flow,
|
|
262
|
+ chooseUser,
|
|
263
|
+ projectChoose
|
256
|
264
|
},
|
257
|
265
|
props: {
|
258
|
266
|
taskName: {
|
|
@@ -348,7 +356,10 @@ export default {
|
348
|
356
|
flowData: {},
|
349
|
357
|
dept: 0,
|
350
|
358
|
dgtAdvice: '审核意见',//党工团审核意见的label
|
351
|
|
- userList: []
|
|
359
|
+ userList: [],
|
|
360
|
+ chooseDriver: [],
|
|
361
|
+ openCar: false,
|
|
362
|
+ openProject: false,
|
352
|
363
|
}
|
353
|
364
|
},
|
354
|
365
|
mounted() {
|
|
@@ -372,10 +383,13 @@ export default {
|
372
|
383
|
let data = res.data;
|
373
|
384
|
// 初始化党工团审核意见的label
|
374
|
385
|
if (data.carUsage == '2') {
|
|
386
|
+ this.dept = 0;
|
375
|
387
|
this.dgtAdvice = '工会审核意见'
|
376
|
388
|
} else if (data.carUsage == '3') {
|
|
389
|
+ this.dept = 0;
|
377
|
390
|
this.dgtAdvice = '党委审核意见'
|
378
|
|
- } else {
|
|
391
|
+ } else if (data.carUsage == '4') {
|
|
392
|
+ this.dept = 0;
|
379
|
393
|
this.dgtAdvice = '团委审核意见'
|
380
|
394
|
}
|
381
|
395
|
if (res.data.drivers == null || res.data.drivers == undefined || res.data.drivers == "") {
|
|
@@ -399,6 +413,7 @@ export default {
|
399
|
413
|
data.cars = arr;
|
400
|
414
|
}
|
401
|
415
|
this.form = data;
|
|
416
|
+ console.log(this.form);
|
402
|
417
|
if (data.projectId) {
|
403
|
418
|
getProject(data.projectId).then(response => {
|
404
|
419
|
this.chooseProject = response.data;
|
|
@@ -413,6 +428,7 @@ export default {
|
413
|
428
|
this.$refs['carForm'].validate((valid) => {
|
414
|
429
|
if (valid) {
|
415
|
430
|
this.form.carApplyId = this.taskForm.formId;
|
|
431
|
+ this.form.drivers = this.chooseDriver;
|
416
|
432
|
let formData = new FormData();
|
417
|
433
|
let jsonForm = JSON.stringify(this.form);
|
418
|
434
|
formData.append("form", jsonForm);
|
|
@@ -424,7 +440,7 @@ export default {
|
424
|
440
|
this.form.drivers = '';
|
425
|
441
|
addCarApproval(this.form);
|
426
|
442
|
}
|
427
|
|
- // 获取下一个流程节点
|
|
443
|
+ // // 获取下一个流程节点
|
428
|
444
|
getNextFlowNode(params).then(res => {
|
429
|
445
|
const data = res.data;
|
430
|
446
|
this.taskForm.formData = formData;
|
|
@@ -451,33 +467,38 @@ export default {
|
451
|
467
|
// 获取下一个审批人
|
452
|
468
|
getNextFlowNodeApproval() {
|
453
|
469
|
if (this.taskName == '用车申请') {
|
454
|
|
- getUsersDeptLeader({ userId: this.$store.getters.userId }).then(res => {
|
455
|
|
- this.$set(this.taskForm.variables, "dept", this.dept);
|
456
|
|
- if (res.data && this.dept != 0) {
|
457
|
|
- this.$set(this.taskForm.variables, "approval", res.data.userId);
|
|
470
|
+ this.$set(this.taskForm.variables, "dept", this.dept);
|
|
471
|
+ if (this.dept == 102) {
|
|
472
|
+ getUserByPost({ postName: '总经理' }).then(result => {
|
|
473
|
+ this.$set(this.taskForm.variables, "approval", result.data[0].userId);
|
458
|
474
|
complete(this.taskForm).then(response => {
|
459
|
475
|
this.$modal.msgSuccess(response.msg);
|
460
|
476
|
this.$emit('goBack')
|
461
|
477
|
})
|
462
|
|
- } else if (this.dept == 102) {
|
463
|
|
- getUserByPost({ postName: '总经理' }).then(result => {
|
464
|
|
- this.$set(this.taskForm.variables, "approval", result.data[0].userId);
|
465
|
|
- complete(this.taskForm).then(response => {
|
466
|
|
- this.$modal.msgSuccess(response.msg);
|
467
|
|
- this.$emit('goBack')
|
468
|
|
- })
|
|
478
|
+ })
|
|
479
|
+ }
|
|
480
|
+ else if (this.dept == 0) {
|
|
481
|
+ let postName = this.getChooseType()
|
|
482
|
+ getUserByPost({ postName: postName }).then(result => {
|
|
483
|
+ this.$set(this.taskForm.variables, "approval", result.data[0].userId);
|
|
484
|
+ complete(this.taskForm).then(response => {
|
|
485
|
+ this.$modal.msgSuccess(response.msg);
|
|
486
|
+ this.$emit('goBack')
|
469
|
487
|
})
|
470
|
|
- } else {
|
471
|
|
- let postName = this.getChooseType()
|
472
|
|
- getUserByPost({ postName: postName }).then(result => {
|
473
|
|
- this.$set(this.taskForm.variables, "approval", result.data[0].userId);
|
|
488
|
+ })
|
|
489
|
+ }
|
|
490
|
+ else {
|
|
491
|
+ getUsersDeptLeader({ userId: this.$store.getters.userId }).then(res => {
|
|
492
|
+ debugger
|
|
493
|
+ if (res.data) {
|
|
494
|
+ this.$set(this.taskForm.variables, "approval", res.data.userId);
|
474
|
495
|
complete(this.taskForm).then(response => {
|
475
|
496
|
this.$modal.msgSuccess(response.msg);
|
476
|
497
|
this.$emit('goBack')
|
477
|
498
|
})
|
478
|
|
- })
|
479
|
|
- }
|
480
|
|
- })
|
|
499
|
+ }
|
|
500
|
+ })
|
|
501
|
+ }
|
481
|
502
|
} else if (this.taskName == '部门审核') {
|
482
|
503
|
getUsersManageLeader({ userId: this.$store.getters.userId }).then(res => {
|
483
|
504
|
let userId = res.data.userId;
|
|
@@ -556,6 +577,29 @@ export default {
|
556
|
577
|
this.userList = res.rows
|
557
|
578
|
})
|
558
|
579
|
},
|
|
580
|
+
|
|
581
|
+ getChooseDriver(val) {
|
|
582
|
+ this.chooseDriver = val;
|
|
583
|
+ if (val.length != 0) {
|
|
584
|
+ let drivers = []
|
|
585
|
+ for (let d of this.chooseDriver) {
|
|
586
|
+ drivers.push(d.userId)
|
|
587
|
+ }
|
|
588
|
+ this.form.drivers = drivers;
|
|
589
|
+ }
|
|
590
|
+ this.openCar = false;
|
|
591
|
+ },
|
|
592
|
+ confirmProject(val) {
|
|
593
|
+ if (val.length > 1) {
|
|
594
|
+ this.$message.error('请选择一个项目');
|
|
595
|
+ return
|
|
596
|
+ } else if (val.length == 1) {
|
|
597
|
+ this.chooseProject = val[0]
|
|
598
|
+ this.isSelect = true
|
|
599
|
+ this.form.projectId = val[0].projectId
|
|
600
|
+ }
|
|
601
|
+ this.openProject = false
|
|
602
|
+ },
|
559
|
603
|
calculateDay() {
|
560
|
604
|
if (this.form.beginDate && this.form.endDate) {
|
561
|
605
|
let y1 = new Date(this.form.beginDate);
|
|
@@ -591,21 +635,29 @@ export default {
|
591
|
635
|
showFormItem(name) {
|
592
|
636
|
let isShow = false;
|
593
|
637
|
if (name == '部门审核')
|
594
|
|
- isShow = (this.dept > 102 && this.taskName == '用车申请') || (this.taskName == '部门审核' || this.taskName == '分管审核') || ((this.taskName == '安排用车' || this.taskName == '申请确认') && this.form.deptUserId != null);
|
|
638
|
+ isShow = (this.dept > 102 && this.taskName == '用车申请') || (this.taskName == '部门审核' || this.taskName == '分管审核') || ((this.taskName == '安排用车' || this.taskName == '申请确认') && this.form.deptUserId != null)
|
|
639
|
+ || (this.dept > 102 && this.taskName == '' && (this.form.carUsage == '0' || this.form.carUsage == '1'));
|
595
|
640
|
else if (name == '分管审核')
|
596
|
|
- isShow = (this.dept > 102 && this.taskName == '用车申请') || (this.taskName == '部门审核' || this.taskName == '分管审核') || ((this.taskName == '安排用车' || this.taskName == '申请确认') && this.form.managerUserId != null);
|
|
641
|
+ isShow = (this.dept > 102 && this.taskName == '用车申请') || (this.taskName == '部门审核' || this.taskName == '分管审核') || ((this.taskName == '安排用车' || this.taskName == '申请确认') && this.form.managerUserId != null)
|
|
642
|
+ || (this.dept > 102 && this.taskName == '' && (this.form.carUsage == '0' || this.form.carUsage == '1'));
|
597
|
643
|
else if (name == '党工团审核')
|
598
|
|
- isShow = (this.dept == 0 && this.taskName == '用车申请') || this.taskName == '党工团审核' || ((this.taskName == '安排用车' || this.taskName == '申请确认') && this.form.unionUserId != null);
|
|
644
|
+ isShow = (this.dept == 0 && this.taskName == '用车申请') || this.taskName == '党工团审核' || ((this.taskName == '安排用车' || this.taskName == '申请确认') && this.form.unionUserId != null)
|
|
645
|
+ || (this.dept == 0 && this.taskName == '' && (this.form.carUsage == 2 || this.form.carUsage == 3 || this.form.carUsage == 4));
|
599
|
646
|
else if (name == '总经理审核')
|
600
|
|
- isShow = (this.dept == 102 && this.taskName == '用车申请') || this.taskName == '总经理审核' || ((this.taskName == '安排用车' || this.taskName == '申请确认') && this.form.gmUserId != null);
|
|
647
|
+ isShow = (this.dept == 102 && this.taskName == '用车申请') || this.taskName == '总经理审核' || ((this.taskName == '安排用车' || this.taskName == '申请确认') && this.form.gmUserId != null)
|
|
648
|
+ || (this.dept == 102 && this.taskName == '' && (this.form.carUsage == '0' || this.form.carUsage == '1'));
|
601
|
649
|
else if (name == '部门审核签名')
|
602
|
|
- isShow = (this.taskName == '部门审核' || this.taskName == '分管审核') || ((this.taskName == '安排用车' || this.taskName == '申请确认') && this.form.deptUserId != null);
|
|
650
|
+ isShow = (this.taskName == '部门审核' || this.taskName == '分管审核') || ((this.taskName == '安排用车' || this.taskName == '申请确认') && this.form.deptUserId != null)
|
|
651
|
+ || (this.dept > 102 && this.taskName == '' && (this.form.carUsage == '0' || this.form.carUsage == '1'));
|
603
|
652
|
else if (name == '分管审核签名')
|
604
|
|
- isShow = this.taskName == '分管审核' || ((this.taskName == '安排用车' || this.taskName == '申请确认') && this.form.managerUserId != null);
|
|
653
|
+ isShow = this.taskName == '分管审核' || ((this.taskName == '安排用车' || this.taskName == '申请确认') && this.form.managerUserId != null)
|
|
654
|
+ || (this.dept > 102 && this.taskName == '' && (this.form.carUsage == '0' || this.form.carUsage == '1'));
|
605
|
655
|
else if (name == '党工团审核签名')
|
606
|
|
- isShow = this.taskName == '党工团审核' || ((this.taskName == '安排用车' || this.taskName == '申请确认') && this.form.unionUserId != null);
|
|
656
|
+ isShow = this.taskName == '党工团审核' || ((this.taskName == '安排用车' || this.taskName == '申请确认') && this.form.unionUserId != null)
|
|
657
|
+ || (this.dept == 0 && this.taskName == '' && (this.form.carUsage == 2 || this.form.carUsage == 3 || this.form.carUsage == 4));
|
607
|
658
|
else if (name == '总经理审核签名')
|
608
|
|
- isShow = this.taskName == '总经理审核' || ((this.taskName == '安排用车' || this.taskName == '申请确认') && this.form.gmUserId != null);
|
|
659
|
+ isShow = this.taskName == '总经理审核' || ((this.taskName == '安排用车' || this.taskName == '申请确认') && this.form.gmUserId != null)
|
|
660
|
+ || (this.dept == 102 && this.taskName == '' && (this.form.carUsage == '0' || this.form.carUsage == '1'));
|
609
|
661
|
return isShow;
|
610
|
662
|
},
|
611
|
663
|
},
|