Quellcode durchsuchen

修改项目流转的人员、车辆、驾驶员

余思翰 vor 1 Jahr
Ursprung
Commit
fc6863ef29

+ 8563
- 3311
oa-back/sql/cmc_oa(小余测试数据).sql
Datei-Diff unterdrückt, da er zu groß ist
Datei anzeigen


+ 5
- 0
oa-ui/src/assets/styles/element-reset.scss Datei anzeigen

38
 // 描述框
38
 // 描述框
39
 ::v-deep .el-descriptions-item__label.is-bordered-label{
39
 ::v-deep .el-descriptions-item__label.is-bordered-label{
40
   color: #686a6e;
40
   color: #686a6e;
41
+}
42
+
43
+// 多选框
44
+::v-deep .el-tag.el-tag--info {
45
+  color: #535559;
41
 }
46
 }

+ 1
- 2
oa-ui/src/views/flowable/form/projectProcess/arrangeProject.vue Datei anzeigen

2
  * @Author: ysh
2
  * @Author: ysh
3
  * @Date: 2024-03-19 09:24:06
3
  * @Date: 2024-03-19 09:24:06
4
  * @LastEditors: Please set LastEditors
4
  * @LastEditors: Please set LastEditors
5
- * @LastEditTime: 2024-05-21 09:41:42
5
+ * @LastEditTime: 2024-05-24 09:28:54
6
 -->
6
 -->
7
 <template>
7
 <template>
8
   <div class="app-container">
8
   <div class="app-container">
148
     initForm() {
148
     initForm() {
149
       getProject(this.taskForm.formId).then(res => {
149
       getProject(this.taskForm.formId).then(res => {
150
         this.form = res.data;
150
         this.form = res.data;
151
-        console.log(this.form);
152
         if (this.form.undertakingDept != null && this.form.undertakingDept != "" && this.form.undertakingDept != undefined) {
151
         if (this.form.undertakingDept != null && this.form.undertakingDept != "" && this.form.undertakingDept != undefined) {
153
           this.form.deptId = this.form.undertakingDeptName.split(',')
152
           this.form.deptId = this.form.undertakingDeptName.split(',')
154
         }
153
         }

+ 89
- 65
oa-ui/src/views/flowable/form/projectProcess/inProgress.vue Datei anzeigen

2
  * @Author: ysh
2
  * @Author: ysh
3
  * @Date: 2024-04-15 09:35:41
3
  * @Date: 2024-04-15 09:35:41
4
  * @LastEditors: Please set LastEditors
4
  * @LastEditors: Please set LastEditors
5
- * @LastEditTime: 2024-05-23 17:41:35
5
+ * @LastEditTime: 2024-05-24 11:49:20
6
 -->
6
 -->
7
 <template>
7
 <template>
8
   <div>
8
   <div>
14
       </div>
14
       </div>
15
       <el-form ref="progress" :model="form" :disabled="disabled" label-width="100px">
15
       <el-form ref="progress" :model="form" :disabled="disabled" label-width="100px">
16
         <el-form-item label="参与人员:">
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
           <el-button class="ml10" @click="openPeople = true" type="primary" size="mini" icon="el-icon-plus"></el-button>
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
         </el-form-item>
24
         </el-form-item>
20
         <el-form-item label="驾驶员:">
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
         </el-form-item>
35
         </el-form-item>
24
         <el-form-item label="使用车辆:">
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
         </el-form-item>
48
         </el-form-item>
28
         <el-row :gutter="20">
49
         <el-row :gutter="20">
29
           <el-col :span="11">
50
           <el-col :span="11">
101
     </el-dialog>
122
     </el-dialog>
102
     <!-- 选择司机对话框 -->
123
     <!-- 选择司机对话框 -->
103
     <el-dialog title="选择驾驶员" :visible.sync="openDriver" width="700px" append-to-body>
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
     </el-dialog>
126
     </el-dialog>
106
   </div>
127
   </div>
107
 </template>
128
 </template>
109
 <script>
130
 <script>
110
 import { mapGetters } from "vuex";
131
 import { mapGetters } from "vuex";
111
 import { parseTime } from "@/utils/ruoyi";
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
 import { getProject, updateProject } from "@/api/oa/project/project";
135
 import { getProject, updateProject } from "@/api/oa/project/project";
138
 import { getCar } from "@/api/oa/car/car";
136
 import { getCar } from "@/api/oa/car/car";
137
+import { listCarApproval, getCarApproval } from '@/api/oa/car/carApproval'
139
 import { listUser } from '@/api/system/user';
138
 import { listUser } from '@/api/system/user';
139
+import { listCar } from '@/api/oa/car/car'
140
 import borrowData from '../inProgress/borrowData.vue';
140
 import borrowData from '../inProgress/borrowData.vue';
141
 import SettleData from '../inProgress/settleData.vue';
141
 import SettleData from '../inProgress/settleData.vue';
142
 import ChoosePeople from '../budget/components/choosePeople.vue';
142
 import ChoosePeople from '../budget/components/choosePeople.vue';
174
       openCar: false,
174
       openCar: false,
175
       form: {
175
       form: {
176
         licensePlate: "",
176
         licensePlate: "",
177
-        driver: [],
177
+        drivers: [],
178
+        cars: [],
179
+        participates:[],
178
         staff: "",
180
         staff: "",
179
         entryTime: "",
181
         entryTime: "",
180
         exitTime: "",
182
         exitTime: "",
192
       oldProgressList: [],
194
       oldProgressList: [],
193
       budgetId: "",
195
       budgetId: "",
194
       userList: [],
196
       userList: [],
197
+      carList: [],
195
       participates: [],
198
       participates: [],
196
       chooseCar: [],
199
       chooseCar: [],
197
-      chooseDriver: []
200
+      chooseDriver: [],
198
     };
201
     };
199
   },
202
   },
200
   watch: {
203
   watch: {
209
       // this.doesItExistBudget(this.taskForm.formId);
212
       // this.doesItExistBudget(this.taskForm.formId);
210
       this.initProgress();
213
       this.initProgress();
211
       this.getUserList();
214
       this.getUserList();
215
+      this.getCarList();
212
     }
216
     }
213
   },
217
   },
218
+  mounted() {
219
+  },
214
   methods: {
220
   methods: {
215
     initProgress() {
221
     initProgress() {
216
       getProject(this.taskForm.formId).then(res => {
222
       getProject(this.taskForm.formId).then(res => {
217
         if (res.data) {
223
         if (res.data) {
218
           this.form.entryTime = res.data.entryTime;
224
           this.form.entryTime = res.data.entryTime;
219
           this.form.exitTime = res.data.exitTime;
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
       listProjectProgress({ projectId: this.taskForm.formId }).then(res => {
240
       listProjectProgress({ projectId: this.taskForm.formId }).then(res => {
227
       });
245
       });
228
     },
246
     },
229
     getChooseUser(val) {
247
     getChooseUser(val) {
230
-      this.participates = val;
248
+      this.participates = val.map(item => item.userId);
249
+      console.log(this.participates);
231
       this.openPeople = false;
250
       this.openPeople = false;
232
     },
251
     },
233
     getChooseCar(val) {
252
     getChooseCar(val) {
238
       this.chooseDriver = val;
257
       this.chooseDriver = val;
239
       this.openDriver = false;
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
     addProgressList() {
285
     addProgressList() {
272
       this.progressList.push({
286
       this.progressList.push({
302
           addProjectProgress(progress);
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
         this.$message.success("保存成功");
326
         this.$message.success("保存成功");
311
       });
327
       });
312
     },
328
     },
316
         this.userList = res.rows
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
     submitNextFlow() {
341
     submitNextFlow() {
320
       this.preserve();
342
       this.preserve();
321
       const params = { taskId: this.taskForm.taskId };
343
       const params = { taskId: this.taskForm.taskId };
346
 </script>
368
 </script>
347
 
369
 
348
 <style lang="scss" scoped>
370
 <style lang="scss" scoped>
371
+@import "@/assets/styles/element-reset.scss";
372
+
349
 .auditor {
373
 .auditor {
350
   font-family: "华文行楷";
374
   font-family: "华文行楷";
351
   font-size: 20px;
375
   font-size: 20px;

Laden…
Abbrechen
Speichern