|
@@ -2,7 +2,7 @@
|
2
|
2
|
* @Author: ysh
|
3
|
3
|
* @Date: 2024-04-15 09:35:41
|
4
|
4
|
* @LastEditors: Please set LastEditors
|
5
|
|
- * @LastEditTime: 2024-05-23 17:41:35
|
|
5
|
+ * @LastEditTime: 2024-05-24 11:49:20
|
6
|
6
|
-->
|
7
|
7
|
<template>
|
8
|
8
|
<div>
|
|
@@ -14,16 +14,37 @@
|
14
|
14
|
</div>
|
15
|
15
|
<el-form ref="progress" :model="form" :disabled="disabled" label-width="100px">
|
16
|
16
|
<el-form-item label="参与人员:">
|
17
|
|
- <el-tag class="mr10" :key="item" v-for="item in participates">{{ item.nickName }}</el-tag>
|
|
17
|
+ <el-select v-model="participates" multiple disabled style="width:84%">
|
|
18
|
+ <el-option v-for="item in userList" :label="item.nickName" :value="item.userId" :key="item.userId">
|
|
19
|
+ </el-option>
|
|
20
|
+ </el-select>
|
|
21
|
+ <!-- <el-tag class="mr10" :key="item.userId" v-for="item in participates">{{ item.nickName }}</el-tag> -->
|
18
|
22
|
<el-button class="ml10" @click="openPeople = true" type="primary" size="mini" icon="el-icon-plus"></el-button>
|
|
23
|
+ <div v-if="participates.length == 0" style="color:#F56C6C">tips:请选择参与人员</div>
|
19
|
24
|
</el-form-item>
|
20
|
25
|
<el-form-item label="驾驶员:">
|
21
|
|
- <el-tag class="mr10" :key="item" v-for="item in chooseDriver">{{ item.nickName }}</el-tag>
|
22
|
|
- <el-button class="ml10" @click="openDriver = true" type="primary" size="mini" icon="el-icon-plus"></el-button>
|
|
26
|
+ <el-tooltip :disabled="form.drivers.length == 0" class="item" effect="dark"
|
|
27
|
+ content="直接获取用车申请中的驾驶员,若无驾驶员,则需要先提交项目的用车申请" placement="top-end">
|
|
28
|
+ <el-select v-model="form.drivers" multiple disabled style="width:90%">
|
|
29
|
+ <el-option v-for="item in userList" :label="item.nickName" :value="item.userId" :key="item.userId">
|
|
30
|
+ </el-option>
|
|
31
|
+ </el-select>
|
|
32
|
+ </el-tooltip>
|
|
33
|
+ <!-- <el-tag class="mr10" :key="item" v-for="item in chooseDriver">{{ item.nickName }}</el-tag>
|
|
34
|
+ <el-button class="ml10" @click="openDriver = true" type="primary" size="mini" icon="el-icon-plus"></el-button> -->
|
23
|
35
|
</el-form-item>
|
24
|
36
|
<el-form-item label="使用车辆:">
|
25
|
|
- <el-tag class="mr10" :key="item.licensePlate" v-for="item in chooseCar">{{ item.licensePlate + item.brand }}</el-tag>
|
26
|
|
- <el-button class="ml10" @click="openCar = true" type="primary" size="mini" icon="el-icon-plus"></el-button>
|
|
37
|
+ <el-tooltip :disabled="form.cars.length == 0" class="item" effect="dark"
|
|
38
|
+ content="直接获取用车申请中的车辆,若无车辆,则需要先提交项目的用车申请" placement="top-end">
|
|
39
|
+ <el-select v-model="form.cars" multiple disabled style="width:90%">
|
|
40
|
+ <el-option v-for="item in carList" :label="item.licensePlate + item.brand" :value="item.carId"
|
|
41
|
+ :key="item.carId">
|
|
42
|
+ </el-option>
|
|
43
|
+ </el-select>
|
|
44
|
+ </el-tooltip>
|
|
45
|
+ <!-- <el-tag class="mr10" :key="item.licensePlate" v-for="item in chooseCar">{{ item.licensePlate + item.brand
|
|
46
|
+ }}</el-tag>
|
|
47
|
+ <el-button class="ml10" @click="openCar = true" type="primary" size="mini" icon="el-icon-plus"></el-button> -->
|
27
|
48
|
</el-form-item>
|
28
|
49
|
<el-row :gutter="20">
|
29
|
50
|
<el-col :span="11">
|
|
@@ -101,7 +122,7 @@
|
101
|
122
|
</el-dialog>
|
102
|
123
|
<!-- 选择司机对话框 -->
|
103
|
124
|
<el-dialog title="选择驾驶员" :visible.sync="openDriver" width="700px" append-to-body>
|
104
|
|
- <choosePeople @chooseUser="getChooseDriver"></choosePeople>
|
|
125
|
+ <choosePeople :deptId="200" @chooseUser="getChooseDriver"></choosePeople>
|
105
|
126
|
</el-dialog>
|
106
|
127
|
</div>
|
107
|
128
|
</template>
|
|
@@ -109,34 +130,13 @@
|
109
|
130
|
<script>
|
110
|
131
|
import { mapGetters } from "vuex";
|
111
|
132
|
import { parseTime } from "@/utils/ruoyi";
|
112
|
|
-import {
|
113
|
|
- complete,
|
114
|
|
- rejectTask,
|
115
|
|
- returnList,
|
116
|
|
- returnTask,
|
117
|
|
- getNextFlowNode,
|
118
|
|
- delegate,
|
119
|
|
- flowTaskForm,
|
120
|
|
-} from "@/api/flowable/todo";
|
121
|
|
-import {
|
122
|
|
- getProjectComment,
|
123
|
|
- addProjectComment,
|
124
|
|
- updateProjectComment,
|
125
|
|
-} from "@/api/oa/project/projectComment";
|
126
|
|
-import { getUsersDeptLeaderByDept } from "@/api/system/post";
|
127
|
|
-import {
|
128
|
|
- listProjectProgress,
|
129
|
|
- addProjectProgress,
|
130
|
|
- delProjectProgress,
|
131
|
|
-} from "@/api/oa/project/projectProgress";
|
132
|
|
-import { listBudgetCar } from "@/api/oa/budget/budgetCar";
|
133
|
|
-import { listBudgetDevice } from "@/api/oa/budget/budgetDevice";
|
134
|
|
-import { listBudgetSettle } from "@/api/oa/budget/budgetSettle";
|
135
|
|
-import { listBudgetStaff } from "@/api/oa/budget/budgetStaff";
|
136
|
|
-import { listBudget } from "@/api/oa/budget/budget";
|
|
133
|
+import { complete, rejectTask, returnList, returnTask, getNextFlowNode, delegate, flowTaskForm } from "@/api/flowable/todo";
|
|
134
|
+import { listProjectProgress, addProjectProgress, delProjectProgress } from "@/api/oa/project/projectProgress";
|
137
|
135
|
import { getProject, updateProject } from "@/api/oa/project/project";
|
138
|
136
|
import { getCar } from "@/api/oa/car/car";
|
|
137
|
+import { listCarApproval, getCarApproval } from '@/api/oa/car/carApproval'
|
139
|
138
|
import { listUser } from '@/api/system/user';
|
|
139
|
+import { listCar } from '@/api/oa/car/car'
|
140
|
140
|
import borrowData from '../inProgress/borrowData.vue';
|
141
|
141
|
import SettleData from '../inProgress/settleData.vue';
|
142
|
142
|
import ChoosePeople from '../budget/components/choosePeople.vue';
|
|
@@ -174,7 +174,9 @@ export default {
|
174
|
174
|
openCar: false,
|
175
|
175
|
form: {
|
176
|
176
|
licensePlate: "",
|
177
|
|
- driver: [],
|
|
177
|
+ drivers: [],
|
|
178
|
+ cars: [],
|
|
179
|
+ participates:[],
|
178
|
180
|
staff: "",
|
179
|
181
|
entryTime: "",
|
180
|
182
|
exitTime: "",
|
|
@@ -192,9 +194,10 @@ export default {
|
192
|
194
|
oldProgressList: [],
|
193
|
195
|
budgetId: "",
|
194
|
196
|
userList: [],
|
|
197
|
+ carList: [],
|
195
|
198
|
participates: [],
|
196
|
199
|
chooseCar: [],
|
197
|
|
- chooseDriver: []
|
|
200
|
+ chooseDriver: [],
|
198
|
201
|
};
|
199
|
202
|
},
|
200
|
203
|
watch: {
|
|
@@ -209,14 +212,29 @@ export default {
|
209
|
212
|
// this.doesItExistBudget(this.taskForm.formId);
|
210
|
213
|
this.initProgress();
|
211
|
214
|
this.getUserList();
|
|
215
|
+ this.getCarList();
|
212
|
216
|
}
|
213
|
217
|
},
|
|
218
|
+ mounted() {
|
|
219
|
+ },
|
214
|
220
|
methods: {
|
215
|
221
|
initProgress() {
|
216
|
222
|
getProject(this.taskForm.formId).then(res => {
|
217
|
223
|
if (res.data) {
|
218
|
224
|
this.form.entryTime = res.data.entryTime;
|
219
|
225
|
this.form.exitTime = res.data.exitTime;
|
|
226
|
+ if (res.data.participates) {
|
|
227
|
+ this.participates = (res.data.participates.split(',')).map(Number);
|
|
228
|
+ }
|
|
229
|
+ if (res.data.cars) {
|
|
230
|
+ this.form.cars = (res.data.cars.split(',')).map(Number);
|
|
231
|
+ }
|
|
232
|
+ if (res.data.drivers) {
|
|
233
|
+ this.form.drivers = (res.data.drivers.split(',')).map(Number);
|
|
234
|
+ }
|
|
235
|
+ if (!(res.data.cars && res.data.drivers)) {
|
|
236
|
+ this.getCarAndDriver();
|
|
237
|
+ }
|
220
|
238
|
}
|
221
|
239
|
});
|
222
|
240
|
listProjectProgress({ projectId: this.taskForm.formId }).then(res => {
|
|
@@ -227,7 +245,8 @@ export default {
|
227
|
245
|
});
|
228
|
246
|
},
|
229
|
247
|
getChooseUser(val) {
|
230
|
|
- this.participates = val;
|
|
248
|
+ this.participates = val.map(item => item.userId);
|
|
249
|
+ console.log(this.participates);
|
231
|
250
|
this.openPeople = false;
|
232
|
251
|
},
|
233
|
252
|
getChooseCar(val) {
|
|
@@ -238,35 +257,30 @@ export default {
|
238
|
257
|
this.chooseDriver = val;
|
239
|
258
|
this.openDriver = false;
|
240
|
259
|
},
|
241
|
|
- // 查询是否有预算表
|
242
|
|
- doesItExistBudget(projectId) {
|
243
|
|
- listBudget({ projectId }).then(res => {
|
244
|
|
- this.loading = false;
|
245
|
|
- if (res.total == 0) {
|
246
|
|
- } else {
|
247
|
|
- this.noBudget = false;
|
248
|
|
- this.budgetId = res.rows[0].budgetId;
|
249
|
|
- listBudgetCar({ budgetId: this.budgetId }).then(res => {
|
250
|
|
- let carArr = [];
|
251
|
|
- let carDriverList = [];
|
252
|
|
- for (let i of res.rows) {
|
253
|
|
- carArr.push(i.car.licensePlate);
|
254
|
|
- getCar(i.carId).then(res => {
|
255
|
|
- carDriverList.push(res.rows.driverUser.nickName);
|
256
|
|
- // this.form.driver = carDriverList.join("、");
|
|
260
|
+ // 通过用车审批表获取车辆和驾驶员信息
|
|
261
|
+ getCarAndDriver() {
|
|
262
|
+ listCarApproval({ projectId: this.taskForm.formId }).then(res => {
|
|
263
|
+ console.log(res);
|
|
264
|
+ if (res.rows) {
|
|
265
|
+ this.form.drivers = []
|
|
266
|
+ this.form.cars = []
|
|
267
|
+ for (let data of res.rows) {
|
|
268
|
+ if (data.cars) {
|
|
269
|
+ let cars = data.cars.split(',');
|
|
270
|
+ cars = cars.map(Number);
|
|
271
|
+ cars.map(item => {
|
|
272
|
+ this.form.cars.push(Number(item));
|
257
|
273
|
});
|
258
|
274
|
}
|
259
|
|
- this.form.licensePlate = carArr.join("、");
|
260
|
|
- });
|
261
|
|
- listBudgetStaff({ budgetId: this.budgetId }).then(res => {
|
262
|
|
- let userArr = [];
|
263
|
|
- for (let u of res.rows) {
|
264
|
|
- userArr.push(u.user.nickName);
|
|
275
|
+ if (data.drivers) {
|
|
276
|
+ let drivers = data.drivers.split(',');
|
|
277
|
+ drivers.map(item => {
|
|
278
|
+ this.form.drivers.push(Number(item));
|
|
279
|
+ });
|
265
|
280
|
}
|
266
|
|
- this.form.staff = userArr.join("、");
|
267
|
|
- });
|
|
281
|
+ }
|
268
|
282
|
}
|
269
|
|
- });
|
|
283
|
+ })
|
270
|
284
|
},
|
271
|
285
|
addProgressList() {
|
272
|
286
|
this.progressList.push({
|
|
@@ -302,11 +316,13 @@ export default {
|
302
|
316
|
addProjectProgress(progress);
|
303
|
317
|
}
|
304
|
318
|
}
|
305
|
|
- updateProject({
|
306
|
|
- projectId: this.taskForm.formId,
|
307
|
|
- entryTime: this.form.entryTime,
|
308
|
|
- exitTime: this.form.exitTime,
|
309
|
|
- }).then(res => {
|
|
319
|
+ this.form.projectId = this.taskForm.formId;
|
|
320
|
+ this.form.cars = this.form.cars.length != 0 ? this.form.cars.join(',') : '';
|
|
321
|
+ this.form.drivers = this.form.drivers.length != 0 ? this.form.drivers.join(',') : '';
|
|
322
|
+ // this.participates = this.participates.map(item => item.userId)
|
|
323
|
+ this.form.participates = this.participates.join(',')
|
|
324
|
+ console.log(this.form);
|
|
325
|
+ updateProject(this.form).then(res => {
|
310
|
326
|
this.$message.success("保存成功");
|
311
|
327
|
});
|
312
|
328
|
},
|
|
@@ -316,6 +332,12 @@ export default {
|
316
|
332
|
this.userList = res.rows
|
317
|
333
|
})
|
318
|
334
|
},
|
|
335
|
+ // 查询车辆列表
|
|
336
|
+ getCarList() {
|
|
337
|
+ listCar({ pageSize: 9999, pageNum: 1 }).then(res => {
|
|
338
|
+ this.carList = res.rows
|
|
339
|
+ })
|
|
340
|
+ },
|
319
|
341
|
submitNextFlow() {
|
320
|
342
|
this.preserve();
|
321
|
343
|
const params = { taskId: this.taskForm.taskId };
|
|
@@ -346,6 +368,8 @@ export default {
|
346
|
368
|
</script>
|
347
|
369
|
|
348
|
370
|
<style lang="scss" scoped>
|
|
371
|
+@import "@/assets/styles/element-reset.scss";
|
|
372
|
+
|
349
|
373
|
.auditor {
|
350
|
374
|
font-family: "华文行楷";
|
351
|
375
|
font-size: 20px;
|