Переглянути джерело

网页端:修改我的学习页面,新增添加参培记录和查看参培记录;修改借款的最大借款额;

移动端:修改我的流程里查看表单信息
余思翰 2 місяці тому
джерело
коміт
1357a30c70

+ 3
- 3
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/domain/CmcResource.java Переглянути файл

@@ -59,7 +59,7 @@ public class CmcResource extends BaseEntity
59 59
 
60 60
     /** 学习时长 */
61 61
     @Excel(name = "学习时长")
62
-    private Long hours;
62
+    private Double hours;
63 63
 
64 64
     public void setResourceId(Integer resourceId) 
65 65
     {
@@ -142,12 +142,12 @@ public class CmcResource extends BaseEntity
142 142
     {
143 143
         return uploadTime;
144 144
     }
145
-    public void setHours(Long hours) 
145
+    public void setHours(Double hours)
146 146
     {
147 147
         this.hours = hours;
148 148
     }
149 149
 
150
-    public Long getHours() 
150
+    public Double getHours()
151 151
     {
152 152
         return hours;
153 153
     }

+ 1
- 1
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcTrainApprovalMapper.xml Переглянути файл

@@ -48,7 +48,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
48 48
         <where>  
49 49
             <if test="userId != null "> and ta.user_id = #{userId}</if>
50 50
             <if test="deptId != null "> and ta.dept_id = #{deptId}</if>
51
-            <if test="reportTime != null "> and ta.report_time = #{reportTime}</if>
51
+            <if test="reportTime != null "> and YEAR(ta.report_time) = YEAR(#{reportTime})</if>
52 52
             <if test="trainName != null  and trainName != ''"> and ta.train_name like concat('%', #{trainName}, '%')</if>
53 53
             <if test="content != null  and content != ''"> and ta.content = #{content}</if>
54 54
             <if test="document != null  and document != ''"> and ta.document = #{document}</if>

+ 7
- 13
oa-ui-app/pages/components/flowable/FlowRecord.vue Переглянути файл

@@ -1,16 +1,8 @@
1 1
 <template>
2 2
   <view class="box">
3
-    <!-- <uni-steps :options="flowRecordList" active-color="#007AFF" :active="active" direction="column">
4
-      <uni-card>
5
-        <text>这是一个基础卡片示例,内容较少,此示例展示了一个没有任何属性不带阴影的卡片。</text>
6
-      </uni-card>
7
-    </uni-steps> -->
8 3
     <scroll-view scroll-y="true" class="scroll-box">
9
-      <uv-steps :current="active" direction="column">
4
+      <uv-steps :current="activeStep" direction="column">
10 5
         <uv-steps-item v-for="item, index in flowRecordList" :key="'f' + index" :title="item.taskName">
11
-          <!-- <template v-slot:icon>
12
-            <uv-icon name="checkmark-circle-fill" color="#53c21d"></uv-icon>
13
-          </template> -->
14 6
           <template v-slot:desc>
15 7
             <view class="desc">
16 8
               <view class="desc-item">
@@ -61,7 +53,7 @@ export default {
61 53
     return {
62 54
       flowRecordList: [], // 流程流转数据
63 55
       flowList: [],
64
-      active: 0,
56
+      activeStep: 0,
65 57
     }
66 58
   },
67 59
   methods: {
@@ -86,16 +78,18 @@ export default {
86 78
     },
87 79
     /** 流程流转记录 */
88 80
     getFlowRecordList() {
81
+      this.activeStep = 0;
89 82
       const params = { procInsId: this.rows.procInsId, deployId: this.rows.deployId }
90 83
       flowRecord(params).then(res => {
91 84
         this.flowRecordList = res.data.flowList.reverse();
92
-        console.log(this.flowRecordList);
93
-        this.active = this.flowRecordList[i].length - 1
94 85
         for (let i = 0; i < this.flowRecordList.length; i++) {
95 86
           if (!this.flowRecordList[i].finishTime) {
96
-            this.active = i
87
+            this.activeStep = i
97 88
           }
98 89
         }
90
+        if (this.activeStep == 0) {
91
+          this.activeStep = this.flowRecordList.length
92
+        }
99 93
       }).catch(res => {
100 94
 
101 95
       })

+ 9
- 4
oa-ui-app/pages/form/borrow/borrow.vue Переглянути файл

@@ -2,7 +2,7 @@
2 2
  * @Author: ysh
3 3
  * @Date: 2025-02-20 10:20:22
4 4
  * @LastEditors: Please set LastEditors
5
- * @LastEditTime: 2025-03-19 14:19:17
5
+ * @LastEditTime: 2025-03-26 16:08:38
6 6
 -->
7 7
 <template>
8 8
   <view class="form-container">
@@ -13,15 +13,15 @@
13 13
     </view>
14 14
     <!-- 表单内容 -->
15 15
     <uni-forms ref="form" :modelValue="form" :rules="rules" label-position="top" label-width="150" class="custom-form">
16
-      <flow-note :taskForm="taskForm"></flow-note>
16
+      <flow-note :taskForm="taskForm" v-if="taskName"></flow-note>
17 17
       <!-- 当前节点 -->
18
-      <uni-forms-item label="当前节点" class="form-item">
18
+      <uni-forms-item label="当前节点" class="form-item" v-if="taskName">
19 19
         <uni-tag :inverted="true" type="primary" :text="taskName"></uni-tag>
20 20
       </uni-forms-item>
21 21
 
22 22
       <!-- 流程发起人 -->
23 23
       <uni-forms-item label="填报人" class="form-item">
24
-        <b style="font-size:35rpx;">{{ startUserName }}</b>
24
+        <b style="font-size:35rpx;">{{ applierUserName }}</b>
25 25
       </uni-forms-item>
26 26
 
27 27
       <!-- 填报日期 -->
@@ -176,6 +176,7 @@ export default {
176 176
   created() {
177 177
     this.form.borrowId = this.taskForm.formId;
178 178
     this.deptId = this.$store.getters.deptId;
179
+    this.applierUserName = this.startUserName;
179 180
     this.initForm();
180 181
     this.initRules();
181 182
     uni.setNavigationBarTitle({
@@ -192,6 +193,7 @@ export default {
192 193
   },
193 194
   data() {
194 195
     return {
196
+      applierUserName:'',
195 197
       form: {
196 198
         submitTime: '',
197 199
         borrowUsage: '0',
@@ -300,6 +302,9 @@ export default {
300 302
         if (res.data) {
301 303
           this.formTotal = 1;
302 304
           this.form = res.data;
305
+          if (!this.applierUserName) {
306
+            this.applierUserName = this.form.applierUser.nickName;
307
+          }
303 308
           this.hanldeChangeType();
304 309
           if (this.form.projectId) {
305 310
             getProject(this.form.projectId).then(res => {

+ 17
- 2
oa-ui-app/pages/message/myProcess/index.vue Переглянути файл

@@ -2,7 +2,7 @@
2 2
  * @Author: ysh
3 3
  * @Date: 2025-02-19 15:36:34
4 4
  * @LastEditors: Please set LastEditors
5
- * @LastEditTime: 2025-03-20 15:27:00
5
+ * @LastEditTime: 2025-03-26 15:35:31
6 6
 -->
7 7
 <template>
8 8
   <view class="page-container">
@@ -177,7 +177,22 @@ export default {
177 177
       this.active = 'record';
178 178
       this.$refs.drawer.open();
179 179
     },
180
-    handleFlowNote(row) { /* ... */ },
180
+    handleFlowNote(row) {
181
+      console.log(row);
182
+      const query = {
183
+        procInsId: row.procInsId,
184
+        executionId: row.executionId,
185
+        deployId: row.deployId,
186
+        taskId: row.taskId,
187
+        taskName: '',
188
+        startUserName: row.startUserName,
189
+        procDefName: row.procDefName
190
+      }
191
+      const encodedParams = encodeURIComponent(JSON.stringify(query));
192
+      uni.navigateTo({
193
+        url: `/pages/message/apply/detail?params=${encodedParams}`
194
+      })
195
+    },
181 196
     handleDelete(row) { /* ... */ },
182 197
     beDeleted(row) { /* ... */ },
183 198
   },

+ 1
- 1
oa-ui/src/views/flowable/form/finance/borrowForm.vue Переглянути файл

@@ -566,7 +566,7 @@ export default {
566 566
       let budgetData = await listBudget({ projectId: this.form.projectId })
567 567
       if (budgetData.total == 1) {
568 568
         let budget = budgetData.rows[0];
569
-        this.totalBudget = budget.settleExpense
569
+        this.totalBudget = Number(budget.settleExpense) + Number(budget.otherExpense) +  Number(budget.rentExpense)
570 570
       }
571 571
       if (budgetData.total == 0) {
572 572
         this.totalBudget = 0

+ 1
- 1
oa-ui/src/views/oa/study/approval.vue Переглянути файл

@@ -46,7 +46,7 @@
46 46
       </el-table-column>
47 47
       <el-table-column label="培训名称" align="center" prop="trainName" />
48 48
       <el-table-column label="主要内容" align="center" prop="content" />
49
-      <el-table-column label="时" align="center" prop="hours" />
49
+      <el-table-column label="时" align="center" prop="hours" />
50 50
       <el-table-column label="部门审核人" align="center" prop="deptUser.nickName" />
51 51
       <el-table-column label="部门审核时间" align="center" prop="deptTime" width="180">
52 52
         <template slot-scope="scope">

+ 21
- 10
oa-ui/src/views/oa/study/components/studyHead.vue Переглянути файл

@@ -2,7 +2,7 @@
2 2
  * @Author: ysh
3 3
  * @Date: 2025-03-05 14:19:02
4 4
  * @LastEditors: Please set LastEditors
5
- * @LastEditTime: 2025-03-11 17:00:41
5
+ * @LastEditTime: 2025-03-27 13:57:08
6 6
 -->
7 7
 <template>
8 8
   <div class="head-bg">
@@ -32,6 +32,7 @@
32 32
 
33 33
 <script>
34 34
 import { listStudy, getStudy, delStudy, addStudy, updateStudy } from "@/api/oa/study/myStudy";
35
+import { listTrainApproval, getTrainApproval, delTrainApproval, addTrainApproval, updateTrainApproval } from "@/api/oa/study/trainApproval";
35 36
 
36 37
 export default {
37 38
   data() {
@@ -43,15 +44,25 @@ export default {
43 44
     this.getYearHours();
44 45
   },
45 46
   methods: {
46
-    getYearHours() {
47
-      let lastTime = new Date().getFullYear() + '-01-01'
48
-      listStudy({ userId: this.$store.getters.userId, lastTime: lastTime }).then(res => {
49
-        console.log(res);
50
-        if (res.total > 0) {
51
-          this.hours = res.rows.reduce((sum, item) => sum + Number(item.getHours), 0)
52
-        }
53
-
54
-      })
47
+    async getYearHours() {
48
+      let lastTime = new Date().getFullYear() + '-01-01';
49
+      let studyHours = 0, approvalHours = 0;
50
+      let studyRes = await listStudy({ userId: this.$store.getters.userId, lastTime: lastTime })
51
+      if (studyRes.total > 0) {
52
+        studyHours = studyRes.rows.reduce((sum, item) => sum + Number(item.getHours), 0)
53
+      }
54
+      let approvalRes = await listTrainApproval({ userId: this.$store.getters.userId, reportTime: lastTime })
55
+      if (approvalRes.total > 0) {
56
+        approvalHours = approvalRes.rows.reduce((sum, item) => {
57
+          if (item.deptTime) {
58
+            return sum + Number(item.hours)
59
+          } else {
60
+            return sum + 0
61
+          }
62
+        }, 0)
63
+      }
64
+      console.log(approvalHours);
65
+      this.hours = studyHours + approvalHours;
55 66
     }
56 67
   },
57 68
 }

+ 123
- 2
oa-ui/src/views/oa/study/components/studyLeft.vue Переглянути файл

@@ -2,7 +2,7 @@
2 2
  * @Author: ysh
3 3
  * @Date: 2025-03-05 15:01:52
4 4
  * @LastEditors: Please set LastEditors
5
- * @LastEditTime: 2025-03-13 16:09:55
5
+ * @LastEditTime: 2025-03-27 13:37:00
6 6
 -->
7 7
 <template>
8 8
   <div>
@@ -21,7 +21,9 @@
21 21
       </el-form-item>
22 22
     </el-form>
23 23
     <right-toolbar :search="false" @queryTable="getRecordsList"></right-toolbar>
24
-    <el-table :data="studyList" style="width: 100%" v-loading="loading">
24
+    <el-button type="primary" plain size="mini" icon="el-icon-plus" @click="addTrainRecord">添加参培记录</el-button>
25
+    <el-button type="success" plain size="mini" icon="el-icon-view" @click="trainOpen = true">查看参培记录</el-button>
26
+    <el-table :data="studyList" style="width: 100%" v-loading="loading" height="430px">
25 27
       <el-table-column align="center" label="序号" type="index" />
26 28
       <el-table-column align="center" label="资料名称" prop="resource.title" />
27 29
       <el-table-column align="center" label="类型" prop="resource.type"></el-table-column>
@@ -47,11 +49,39 @@
47 49
     <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
48 50
       :layout="'total, prev, pager, next,jumper'" :limit.sync="queryParams.pageSize" :autoScroll="false"
49 51
       @pagination="getRecordsList" />
52
+    <el-dialog title="个人参培记录" :visible.sync="trainOpen" width="60%" append-to-body>
53
+      <el-table :data="trainList" style="width: 100%" v-loading="loading" height="430px">
54
+        <el-table-column label="序号" type="index" />
55
+        <el-table-column label="上报人" align="center" prop="reportUser.nickName" />
56
+        <el-table-column label="上报日期" align="center" prop="reportTime" width="180">
57
+          <template slot-scope="scope">
58
+            <span>{{ parseTime(scope.row.reportTime, '{y}-{m}-{d}') }}</span>
59
+          </template>
60
+        </el-table-column>
61
+        <el-table-column label="培训名称" align="center" prop="trainName" />
62
+        <el-table-column label="主要内容" align="center" prop="content" />
63
+        <el-table-column label="学时" align="center" prop="hours" />
64
+        <el-table-column label="部门审核人" align="center" prop="deptUser.nickName" />
65
+        <el-table-column label="部门审核时间" align="center" prop="deptTime" width="180">
66
+          <template slot-scope="scope">
67
+            <span>{{ parseTime(scope.row.deptTime, '{y}-{m}-{d}') }}</span>
68
+          </template>
69
+        </el-table-column>
70
+        <el-table-column label="部门审核意见" align="center" prop="deptComment" />
71
+      </el-table>
72
+      <pagination v-show="trainTotal > 0" :total="trainTotal" :page.sync="trainQueryParams.pageNum"
73
+        :layout="'total, prev, pager, next,jumper'" :limit.sync="trainQueryParams.pageSize" :autoScroll="false"
74
+        @pagination="getTrainList" />
75
+    </el-dialog>
50 76
   </div>
51 77
 </template>
52 78
 
53 79
 <script>
54 80
 import { listStudy, getStudy, delStudy, addStudy, updateStudy } from "@/api/oa/study/myStudy";
81
+import { listTrainApproval, getTrainApproval, delTrainApproval, addTrainApproval, updateTrainApproval } from "@/api/oa/study/trainApproval";
82
+import { Snowflake } from '@/utils/snowFlake.js';
83
+import { listDefinition, definitionStart } from "@/api/flowable/definition";
84
+import { todoList, getNextFlowNodeByStart } from "@/api/flowable/todo";
55 85
 
56 86
 export default {
57 87
   data() {
@@ -62,11 +92,21 @@ export default {
62 92
       queryParams: {
63 93
         pageNum: 1,
64 94
         pageSize: 10
95
+      },
96
+      trainOpen: false,
97
+      trainLoading: true,
98
+      trainList: [],
99
+      trainTotal: 0,
100
+      trainQueryParams: {
101
+        pageNum: 1,
102
+        pageSize: 10,
103
+        userId: this.$store.getters.userId
65 104
       }
66 105
     }
67 106
   },
68 107
   created() {
69 108
     this.getRecordsList();
109
+    this.getTrainList();
70 110
   },
71 111
   methods: {
72 112
     getRecordsList() {
@@ -78,6 +118,15 @@ export default {
78 118
         this.loading = false;
79 119
       });
80 120
     },
121
+    /** 查询参培审核列表 */
122
+    getTrainList() {
123
+      this.trainLoading = true;
124
+      listTrainApproval(this.trainQueryParams).then(response => {
125
+        this.trainList = response.rows;
126
+        this.trainTotal = response.total;
127
+        this.trainLoading = false;
128
+      });
129
+    },
81 130
     /** 搜索按钮操作 */
82 131
     handleQuery() {
83 132
       this.queryParams.pageNum = 1;
@@ -120,6 +169,78 @@ export default {
120 169
         return 'success'
121 170
       }
122 171
     },
172
+    async addTrainRecord() {
173
+      let response = await listDefinition({
174
+        pageNum: 1,
175
+        pageSize: 9999,
176
+        name: "参培审核",
177
+        category: "assess",
178
+      })
179
+      console.log(response);
180
+      if (response.data.total == 1) {
181
+        let obj = response.data.records[0]
182
+        this.$confirm("是否发起参培审核?", '提示', {
183
+          confirmButtonText: '确定',
184
+          cancelButtonText: '取消',
185
+          type: 'warning'
186
+        }).then(() => {
187
+          this.handleStartProcess(obj)
188
+        }).catch(() => { });
189
+      }
190
+    },
191
+    handleStartProcess(row) {
192
+      let formId = new Snowflake(1n, 1n, 0n).nextId().toString();
193
+      getNextFlowNodeByStart({ deploymentId: row.deploymentId, variables: { formId: formId } }).then(res => {
194
+        let data = res.data;
195
+        const variables = {};
196
+        const formData = {};
197
+        formData.disabled = true;
198
+        formData.formBtns = false;
199
+        formData.formId = formId
200
+        if (row.id) {
201
+          variables.variables = formData;
202
+          let routePath = this.getRoutePath(row);
203
+          definitionStart(row.id, JSON.stringify(variables)).then(res => {
204
+            this.$modal.msgSuccess(res.msg);
205
+            let procInstanceId = res.data;
206
+            todoList({
207
+              pageNum: 1,
208
+              pageSize: 99999999, processInsId: procInstanceId
209
+            }).then(toDoRes => {
210
+              let records = toDoRes.data.records;
211
+              if (records.length == 1) {
212
+                records = records[0]
213
+              }
214
+              this.$router.push({
215
+                path: routePath,
216
+                query: {
217
+                  procInsId: records.procInsId,
218
+                  executionId: records.executionId,
219
+                  deployId: records.deployId,
220
+                  taskId: records.taskId,
221
+                  taskName: records.taskName,
222
+                  startUser: records.startUserName + '-' + records.startDeptName,
223
+                  formId: formData.formId,
224
+                  procDefName: records.procDefName
225
+                }
226
+              })
227
+            })
228
+          })
229
+        }
230
+      })
231
+    },
232
+    getRoutePath(row) {
233
+      let path;
234
+      for (let p of this.publicData.pathRoute) {
235
+        if (p.name == row.name) {
236
+          path = p.path
237
+          break
238
+        } else {
239
+          path = '/flowable/task/todo/detail/index'
240
+        }
241
+      }
242
+      return path
243
+    },
123 244
   },
124 245
 }
125 246
 </script>

+ 2
- 1
oa-ui/src/views/oa/study/components/studyRight.vue Переглянути файл

@@ -2,7 +2,7 @@
2 2
  * @Author: ysh
3 3
  * @Date: 2025-03-05 15:36:17
4 4
  * @LastEditors: Please set LastEditors
5
- * @LastEditTime: 2025-03-25 16:50:59
5
+ * @LastEditTime: 2025-03-26 09:12:56
6 6
 -->
7 7
 <template>
8 8
   <div>
@@ -23,6 +23,7 @@
23 23
         <el-table :data="videoList" style="width: 100%">
24 24
           <el-table-column align="center" label="序号" type="index" />
25 25
           <el-table-column align="center" label="名称" prop="title" />
26
+          <el-table-column align="center" label="类型" prop="type" />
26 27
           <el-table-column align="center" label="学时" prop="hours" />
27 28
           <el-table-column align="center" label="操作">
28 29
             <template slot-scope="{row}">

+ 1
- 1
oa-ui/src/views/oa/study/myStudy.vue Переглянути файл

@@ -2,7 +2,7 @@
2 2
  * @Author: ysh
3 3
  * @Date: 2025-03-05 14:00:18
4 4
  * @LastEditors: Please set LastEditors
5
- * @LastEditTime: 2025-03-25 14:12:17
5
+ * @LastEditTime: 2025-03-27 09:16:49
6 6
 -->
7 7
 <template>
8 8
   <div>

+ 2
- 2
oa-ui/src/views/oa/study/resource.vue Переглянути файл

@@ -2,7 +2,7 @@
2 2
  * @Author: ysh
3 3
  * @Date: 2025-03-05 09:15:54
4 4
  * @LastEditors: Please set LastEditors
5
- * @LastEditTime: 2025-03-25 13:59:38
5
+ * @LastEditTime: 2025-03-27 10:08:59
6 6
 -->
7 7
 <template>
8 8
   <div class="app-container">
@@ -155,7 +155,7 @@
155 155
               </el-tree>
156 156
             </el-form-item>
157 157
             <el-form-item label="学时" prop="hours">
158
-              <el-input-number v-model="form.hours" :min="0" :precision="1" />
158
+              <el-input-number v-model="form.hours" :min="0" :precision="1"/>
159 159
             </el-form-item>
160 160
             <el-form-item label="上传人" prop="uploader">
161 161
               {{ getUserName(form.uploader) }}

Завантаження…
Відмінити
Зберегти