Ver código fonte

新增技术交底退回按钮

余思翰 6 meses atrás
pai
commit
22ea1de35d

+ 54
- 17
oa-ui/src/assets/styles/ruoyi.scss Ver arquivo

@@ -47,8 +47,9 @@
47 47
 .mb10 {
48 48
   margin-bottom: 10px;
49 49
 }
50
+
50 51
 .ml10 {
51
-	margin-left: 10px;
52
+  margin-left: 10px;
52 53
 }
53 54
 
54 55
 .mt20 {
@@ -62,18 +63,30 @@
62 63
 .mb20 {
63 64
   margin-bottom: 20px;
64 65
 }
65
-.ml20 {
66
-	margin-left: 20px;
67
-}
68 66
 
69
-.h1, .h2, .h3, .h4, .h5, .h6, h1, h2, h3, h4, h5, h6 {
67
+.ml20 {
68
+  margin-left: 20px;
69
+}
70
+
71
+.h1,
72
+.h2,
73
+.h3,
74
+.h4,
75
+.h5,
76
+.h6,
77
+h1,
78
+h2,
79
+h3,
80
+h4,
81
+h5,
82
+h6 {
70 83
   font-family: inherit;
71 84
   font-weight: 500;
72 85
   line-height: 1.1;
73 86
   color: inherit;
74 87
 }
75 88
 
76
-.el-message-box__status + .el-message-box__message{
89
+.el-message-box__status+.el-message-box__message {
77 90
   word-break: break-word;
78 91
 }
79 92
 
@@ -89,7 +102,9 @@
89 102
 }
90 103
 
91 104
 .el-table {
92
-  .el-table__header-wrapper, .el-table__fixed-header-wrapper {
105
+
106
+  .el-table__header-wrapper,
107
+  .el-table__fixed-header-wrapper {
93 108
     th {
94 109
       word-break: break-word;
95 110
       background-color: #f8f8f9;
@@ -100,7 +115,7 @@
100 115
   }
101 116
 
102 117
   .el-table__body-wrapper {
103
-    .el-button [class*="el-icon-"] + span {
118
+    .el-button [class*="el-icon-"]+span {
104 119
       margin-left: 1px;
105 120
     }
106 121
   }
@@ -138,10 +153,11 @@
138 153
 }
139 154
 
140 155
 @media (max-width: 768px) {
141
-  .pagination-container .el-pagination > .el-pagination__jump {
156
+  .pagination-container .el-pagination>.el-pagination__jump {
142 157
     display: none !important;
143 158
   }
144
-  .pagination-container .el-pagination > .el-pagination__sizes {
159
+
160
+  .pagination-container .el-pagination>.el-pagination__sizes {
145 161
     display: none !important;
146 162
   }
147 163
 }
@@ -153,20 +169,22 @@
153 169
 }
154 170
 
155 171
 /** 表格更多操作下拉样式 */
156
-.el-table .el-dropdown-link,.el-table .el-dropdown-selfdefine {
157
-	cursor: pointer;
158
-	margin-left: 5px;
172
+.el-table .el-dropdown-link,
173
+.el-table .el-dropdown-selfdefine {
174
+  cursor: pointer;
175
+  margin-left: 5px;
159 176
 }
160 177
 
161
-.el-table .el-dropdown, .el-icon-arrow-down {
178
+.el-table .el-dropdown,
179
+.el-icon-arrow-down {
162 180
   font-size: 12px;
163 181
 }
164 182
 
165
-.el-tree-node__content > .el-checkbox {
183
+.el-tree-node__content>.el-checkbox {
166 184
   margin-right: 8px;
167 185
 }
168 186
 
169
-.list-group-striped > .list-group-item {
187
+.list-group-striped>.list-group-item {
170 188
   border-left: 0;
171 189
   border-right: 0;
172 190
   border-radius: 0;
@@ -289,7 +307,8 @@
289 307
   position: relative;
290 308
   float: right;
291 309
 }
292
-el-input.is-disabled >.el-input__inner {
310
+
311
+el-input.is-disabled>.el-input__inner {
293 312
   color: #686a6e;
294 313
 }
295 314
 
@@ -311,4 +330,22 @@ el-input.is-disabled >.el-input__inner {
311 330
 ::v-deep .el-radio__input.is-disabled .el-radio__inner,
312 331
 .el-radio__input.is-disabled.is-checked .el-radio__inner {
313 332
   border-color: var(--current-color);
333
+}
334
+
335
+.del-file {
336
+  cursor: pointer;
337
+  color: #ed5565;
338
+  display: inline-block;
339
+  line-height: 1;
340
+  padding-left: 10px;
341
+  font-family: element-icons !important;
342
+  speak: none;
343
+  font-style: normal;
344
+  font-weight: 400;
345
+  font-variant: normal;
346
+  text-transform: none;
347
+  vertical-align: baseline;
348
+}
349
+.del-file:hover{
350
+  color: #f3a5ad;
314 351
 }

+ 8
- 1
oa-ui/src/utils/deleteResource.js Ver arquivo

@@ -2,7 +2,7 @@
2 2
  * @Author: ysh
3 3
  * @Date: 2024-06-13 17:07:59
4 4
  * @LastEditors: Please set LastEditors
5
- * @LastEditTime: 2024-09-23 15:43:29
5
+ * @LastEditTime: 2024-09-27 11:41:27
6 6
  */
7 7
 import request from '@/utils/request'
8 8
 
@@ -110,6 +110,13 @@ const apiEndpoints = [
110 110
       '/oa/outsourceWork/:id'
111 111
     ]
112 112
   },
113
+  {
114
+    procDefName: '绩效审批',
115
+    apiUrl: [
116
+      '/oa/performance/:id',
117
+      '/oa/wage/batch/:id'
118
+    ]
119
+  },
113 120
 ]
114 121
 
115 122
 // 编写一个方法来处理删除请求,并同时发送所有API请求  

+ 69
- 0
oa-ui/src/views/flowable/form/components/flowBtn/returnBtn.vue Ver arquivo

@@ -0,0 +1,69 @@
1
+<!--
2
+ * @Author: ysh
3
+ * @Date: 2024-09-27 15:19:36
4
+ * @LastEditors: Please set LastEditors
5
+ * @LastEditTime: 2024-09-27 15:59:43
6
+-->
7
+<template>
8
+  <div>
9
+    <el-form ref="taskForm" :model="taskForm" label-width="80px">
10
+      <el-form-item label="退回节点" prop="targetKey">
11
+        <el-radio-group v-model="taskForm.targetKey">
12
+          <el-radio-button v-for="item in returnTaskList" :key="item.id" :label="item.id">{{ item.name }}
13
+          </el-radio-button>
14
+        </el-radio-group>
15
+      </el-form-item>
16
+      <el-form-item label="退回意见" prop="comment" :rules="[{ required: true, message: '请输入意见', trigger: 'blur' }]">
17
+        <el-input  type="textarea" v-model="taskForm.comment" placeholder="请输入意见" />
18
+      </el-form-item>
19
+    </el-form>
20
+    <div class="text-center">
21
+      <el-button @click="$emit('cancel')">取 消</el-button>
22
+      <el-button type="primary" @click="taskReturn">确 定</el-button>
23
+    </div>
24
+  </div>
25
+</template>
26
+
27
+<script>
28
+import { complete, rejectTask, returnList, returnTask, getNextFlowNode, delegate, flowTaskForm, } from "@/api/flowable/todo";
29
+export default {
30
+  props: {
31
+    taskForm: {
32
+      type: Object,
33
+      require: true
34
+    }
35
+  },
36
+  data() {
37
+    return {
38
+      form: {},
39
+      returnTaskList: []
40
+    }
41
+  },
42
+  created() {
43
+    this.handleReturn();
44
+  },
45
+  methods: {
46
+    /** 可退回任务列表 */
47
+    handleReturn() {
48
+      returnList(this.taskForm).then(res => {
49
+        this.returnTaskList = res.data.reverse();
50
+        this.taskForm.variables = null;
51
+      })
52
+    },
53
+    /** 提交退回任务 */
54
+    taskReturn() {
55
+      this.$refs["taskForm"].validate(valid => {
56
+        if (valid) {
57
+          returnTask(this.taskForm).then(res => {
58
+            this.$modal.msgSuccess(res.msg);
59
+            this.$emit('saves')
60
+            this.$emit('goBack')
61
+          });
62
+        }
63
+      });
64
+    },
65
+  },
66
+}
67
+</script>
68
+
69
+<style lang="scss" scoped></style>

+ 45
- 0
oa-ui/src/views/flowable/form/components/flowBtn/returnComment.vue Ver arquivo

@@ -0,0 +1,45 @@
1
+<template>
2
+  <div>
3
+    <div>退回意见:{{ reBackDescription }}</div>
4
+    <div>办理人:{{ assigneeName }}</div>
5
+  </div>
6
+</template>
7
+
8
+<script>
9
+import { flowRecordFull } from "@/api/flowable/finished";
10
+export default {
11
+  props: {
12
+    taskForm: {
13
+      type: Object,
14
+      require: true
15
+    }
16
+  },
17
+  data() {
18
+    return {
19
+      reBackDescription: '',
20
+      assigneeName:''
21
+    }
22
+  },
23
+  created() {
24
+    this.getComment()
25
+  },
26
+  methods: {
27
+    getComment() {
28
+      const params = { procInsId: this.taskForm.procInsId, deployId: this.taskForm.deployId }
29
+      flowRecordFull(params).then(res => {
30
+        if (res.data.flowList) {
31
+          if (res.data.flowList.length > 1 && res.data.flowList[1].comment && res.data.flowList[1].comment.type == '退回意见') {
32
+            this.reBackDescription = res.data.flowList[1].comment.comment
33
+            this.assigneeName = res.data.flowList[1].assigneeName
34
+            this.$emit('isReturn', true)
35
+          } else {
36
+            this.$emit('isReturn', false)
37
+          }
38
+        }
39
+      })
40
+    }
41
+  },
42
+}
43
+</script>
44
+
45
+<style lang="scss" scoped></style>

+ 45
- 88
oa-ui/src/views/flowable/form/technicalForm.vue Ver arquivo

@@ -1,7 +1,18 @@
1
+<!--
2
+ * @Author: ysh
3
+ * @Date: 2024-07-04 17:37:29
4
+ * @LastEditors: Please set LastEditors
5
+ * @LastEditTime: 2024-09-27 16:49:03
6
+-->
1 7
 <template>
2 8
   <div class="app-container">
3 9
     <el-row :gutter="20">
4 10
       <el-col :span="18" :xs="24">
11
+        <div class="mb20" v-if="showAlter">
12
+          <el-alert title="任务被退回,请修改后重新提交" type="error" :closable="false">
13
+            <return-comment :taskForm="taskForm" @isReturn="isReturn"></return-comment>
14
+          </el-alert>
15
+        </div>
5 16
         <el-form ref="form" :model="form" :rules="rules" label-width="150px">
6 17
           <el-form-item label="项目编号:" prop="projectId" v-if="taskForm.procDefName == '技术交底'">
7 18
             <el-input v-model="chooseProject.projectNumber" placeholder="请输入项目编号" disabled style="width: 300px" />
@@ -32,9 +43,9 @@
32 43
               :autosize="{ minRows: 8 }" />
33 44
           </el-form-item>
34 45
           <el-form-item label="附件" prop="document">
35
-            <FileUpload v-if="taskName == '技术交底'" ref="bsFile" :limit="1" :filePathName="'技术交底'"
46
+            <FileUpload v-if="!form.document" ref="bsFile" :limit="1" :filePathName="'技术交底'"
36 47
               :fileType="['doc', 'docx', 'xls', 'xlsx', 'pdf', 'rar', 'zip']" @input="getTechnicalDoc"></FileUpload>
37
-            <div v-if="form.document && taskName != '技术交底'">
48
+            <div v-if="form.document">
38 49
               <el-link type="primary" @click="reviewWord(`${baseUrl}${'/profile/upload' + form.document}`)">
39 50
                 {{ getFileName(form.document) }}
40 51
               </el-link>
@@ -42,6 +53,7 @@
42 53
                 :underline="false" target="_blank">
43 54
                 <span class="el-icon-download">下载文件</span>
44 55
               </el-link>
56
+              <span class="el-icon-delete del-file" @click="deleteDoc" v-if="taskName == '技术交底'">删除文件</span>
45 57
             </div>
46 58
           </el-form-item>
47 59
           <el-form-item label="技术交底意见" prop="disclosureComment">
@@ -96,6 +108,7 @@
96 108
           </el-row>
97 109
         </el-form>
98 110
         <div style="text-align: center;" v-if="taskName">
111
+          <el-button type="danger" @click="returnOpen = true">退 回</el-button>
99 112
           <el-button type="primary" @click="submitForm">提 交</el-button>
100 113
         </div>
101 114
       </el-col>
@@ -108,6 +121,9 @@
108 121
         </el-card>
109 122
       </el-col>
110 123
     </el-row>
124
+    <el-dialog title="退回" :visible.sync="returnOpen" width="40%" append-to-body>
125
+      <return-btn :taskForm="taskForm" @goBack="$emit('goBack')" @saves="" @cancel="returnOpen = false"></return-btn>
126
+    </el-dialog>
111 127
   </div>
112 128
 </template>
113 129
 
@@ -119,10 +135,14 @@ import flow from '@/views/flowable/task/todo/detail/flow';
119 135
 import { complete, getNextFlowNode } from "@/api/flowable/todo";
120 136
 import { flowXmlAndNode } from "@/api/flowable/definition";
121 137
 import { getUsersManageLeaderByDept, getUsersDeptLeaderByDept, getUserByPost } from '@/api/system/post'
138
+import ReturnBtn from './components/flowBtn/returnBtn.vue';
139
+import ReturnComment from './components/flowBtn/returnComment.vue';
122 140
 
123 141
 export default {
124 142
   components: {
125
-    flow
143
+    flow,
144
+    ReturnBtn,
145
+    ReturnComment,
126 146
   },
127 147
   name: "Technical",
128 148
   props: {
@@ -141,38 +161,6 @@ export default {
141 161
       disclosureUser: '',
142 162
       acceptUser: '',
143 163
       confirmUser: '',
144
-      // 遮罩层
145
-      loading: true,
146
-      // 选中数组
147
-      ids: [],
148
-      // 非单个禁用
149
-      single: true,
150
-      // 非多个禁用
151
-      multiple: true,
152
-      // 显示搜索条件
153
-      showSearch: true,
154
-      // 总条数
155
-      total: 0,
156
-      // cmc技术交底表格数据
157
-      technicalList: [],
158
-      // 弹出层标题
159
-      title: "",
160
-      // 是否显示弹出层
161
-      open: false,
162
-      // 查询参数
163
-      queryParams: {
164
-        pageNum: 1,
165
-        pageSize: 10,
166
-        projectId: null,
167
-        accepter: null,
168
-        disclosurer: null,
169
-        confirmer: null,
170
-        content: null,
171
-        document: null,
172
-        disclosureComment: null,
173
-        disclosureTime: null,
174
-        acceptTime: null
175
-      },
176 164
       userList: [],
177 165
       chooseProject: {},
178 166
       isSelect: false,
@@ -185,13 +173,14 @@ export default {
185 173
       // 表单校验
186 174
       rules: {},
187 175
       formTotal: 0,
188
-      flowData: {}
176
+      flowData: {},
177
+      returnOpen: false,
178
+      showAlter: true,
189 179
     };
190 180
   },
191 181
   created() {
192 182
     this.getProjectById();
193 183
     this.getUserList();
194
-    this.getList();
195 184
     flowXmlAndNode({ procInsId: this.taskForm.procInsId, deployId: this.taskForm.deployId }).then(res => {
196 185
       this.flowData = res.data;
197 186
     })
@@ -260,15 +249,6 @@ export default {
260 249
         this.userList = res.rows
261 250
       })
262 251
     },
263
-    /** 查询cmc技术交底列表 */
264
-    getList() {
265
-      this.loading = true;
266
-      listTechnical(this.queryParams).then(response => {
267
-        this.technicalList = response.rows;
268
-        this.total = response.total;
269
-        this.loading = false;
270
-      });
271
-    },
272 252
     isEmptyObject(obj) {
273 253
       for (var key in obj) {
274 254
         if (obj.hasOwnProperty(key)) {
@@ -277,21 +257,6 @@ export default {
277 257
       }
278 258
       return true;
279 259
     },
280
-    // 表单重置
281
-    reset() {
282
-      this.form = {
283
-        technicalId: null,
284
-        projectId: null,
285
-        accepter: null,
286
-        disclosurer: null,
287
-        content: null,
288
-        document: null,
289
-        disclosureComment: null,
290
-        disclosureTime: null,
291
-        acceptTime: null
292
-      };
293
-      this.resetForm("form");
294
-    },
295 260
     /** 提交按钮 */
296 261
     submitForm() {
297 262
       this.$refs["form"].validate(valid => {
@@ -299,43 +264,45 @@ export default {
299 264
           if (this.formTotal != 0) {
300 265
             updateTechnical(this.form).then(response => {
301 266
               this.$modal.msgSuccess("修改成功");
302
-              this.open = false;
303
-              this.getList();
304 267
             });
305 268
             const params = { taskId: this.taskForm.taskId };
306 269
             getNextFlowNode(params).then(async res => {
307
-              if (this.taskName == '技术交底')
270
+              if (this.taskName == '技术交底') {
308 271
                 this.$set(this.taskForm.variables, "approval", this.form.accepter);
272
+                this.handleComplete();
273
+              }
309 274
               else if (this.taskName == '接受交底') {
310 275
                 let res = await getUsersDeptLeaderByDept({ deptId: 109 })
311 276
                 this.$set(this.taskForm.variables, "approval", res.data.userId);
277
+                this.handleComplete();
278
+              } else if (this.taskName == '确认交底') {
279
+                this.$modal.confirm('最后一个节点,提交将结束流程,是否提交?').then(res => {
280
+                  this.handleComplete();
281
+                })
312 282
               }
313
-              complete(this.taskForm).then(response => {
314
-                this.$modal.msgSuccess(response.msg);
315
-                this.$emit('goBack')
316
-              });
317 283
             })
318 284
           } else {
319 285
             this.form.technicalId = this.taskForm.formId;
320 286
             this.form.projectId = this.taskForm.formId;
321 287
             addTechnical(this.form).then(response => {
322 288
               this.$modal.msgSuccess("新增成功");
323
-              this.open = false;
324
-              this.getList();
325 289
             });
326 290
             const params = { taskId: this.taskForm.taskId };
327 291
             getNextFlowNode(params).then(res => {
328 292
               this.$set(this.taskForm.variables, "formId", this.taskForm.formId);
329 293
               this.$set(this.taskForm.variables, "approval", this.form.accepter);
330
-              complete(this.taskForm).then(response => {
331
-                this.$modal.msgSuccess(response.msg);
332
-                this.$emit('goBack')
333
-              });
294
+              this.handleComplete();
334 295
             })
335 296
           }
336 297
         }
337 298
       });
338 299
     },
300
+    handleComplete() {
301
+      complete(this.taskForm).then(response => {
302
+        this.$modal.msgSuccess(response.msg);
303
+        this.$emit('goBack')
304
+      });
305
+    },
339 306
     getFileName(name) {
340 307
       if (name) {
341 308
         let arr = name.split('/')
@@ -351,21 +318,11 @@ export default {
351 318
         }
352 319
       }
353 320
     },
354
-    /** 删除按钮操作 */
355
-    handleDelete(row) {
356
-      const technicalIds = row.technicalId || this.ids;
357
-      this.$modal.confirm('是否确认删除cmc技术交底编号为"' + technicalIds + '"的数据项?').then(function () {
358
-        return delTechnical(technicalIds);
359
-      }).then(() => {
360
-        this.getList();
361
-        this.$modal.msgSuccess("删除成功");
362
-      }).catch(() => { });
321
+    deleteDoc() {
322
+      this.$set(this.form, 'document', undefined)
363 323
     },
364
-    /** 导出按钮操作 */
365
-    handleExport() {
366
-      this.download('oa/technical/export', {
367
-        ...this.queryParams
368
-      }, `technical_${new Date().getTime()}.xlsx`)
324
+    isReturn(val) {
325
+      this.showAlter = val
369 326
     }
370 327
   }
371 328
 };

Carregando…
Cancelar
Salvar