Parcourir la source

修改网页端借款中存在的小问题;

修改移动端借款审批表单
余思翰 il y a 1 mois
Parent
révision
3590bfb497

+ 3
- 3
oa-ui-app/main.js Voir le fichier

@@ -1,8 +1,8 @@
1 1
 /*
2 2
  * @Author: ysh
3 3
  * @Date: 2025-01-16 11:17:07
4
- * @LastEditors: 
5
- * @LastEditTime: 2025-03-03 14:24:08
4
+ * @LastEditors: Please set LastEditors
5
+ * @LastEditTime: 2025-03-18 17:11:37
6 6
  */
7 7
 import Vue from 'vue'
8 8
 import App from './App'
@@ -19,7 +19,7 @@ Vue.prototype.$store = store
19 19
 // 创建全局的 publicData 对象
20 20
 Vue.prototype.publicData = {
21 21
   partySecretary: 4, // 党委书记
22
-  leagueSecretary: 142, // 团委书记
22
+  leagueSecretary: 15, // 团委书记
23 23
   gm: 7, //总经理
24 24
   chairman: 2,//董事长
25 25
   zg: 9,

+ 1
- 1
oa-ui-app/manifest.json Voir le fichier

@@ -60,7 +60,7 @@
60 60
             "port" : 9090,
61 61
             "https" : false
62 62
         },
63
-        "title" : "RuoYi-App",
63
+        "title" : "CMC-App",
64 64
         "router" : {
65 65
             "mode" : "hash",
66 66
             "base" : "./"

+ 100
- 0
oa-ui-app/pages/components/fileUpload.vue Voir le fichier

@@ -0,0 +1,100 @@
1
+<template>
2
+  <view>
3
+    <uv-button @click="chooseFile" text="+ 选择文件" type="primary" v-if="showBtn"></uv-button>
4
+    <view v-if="fileName" class="file-box">
5
+      <view class="link">
6
+        <uv-link :href="`${fileUrl + fileName}`" :text="docName" color="#19be6b" line-color="#19be6b"></uv-link>
7
+      </view>
8
+      <view class="delete" v-if="showBtn">
9
+        <uv-icon name="trash" color="#f56c6c" size="18px" @click="deleteFile()"></uv-icon>
10
+      </view>
11
+    </view>
12
+    <text v-if="showBtn">只能上传1个文件,重复上传将覆盖原文件</text>
13
+  </view>
14
+</template>
15
+<script>
16
+import config from '@/config';
17
+import { getToken } from '@/utils/auth'
18
+import { getFileName } from '@/utils/common';
19
+import upload from '@/utils/upload'
20
+export default {
21
+  props: {
22
+    fileType: String,
23
+    fileName: String,
24
+    showBtn: Boolean
25
+  },
26
+  data() {
27
+    return {
28
+      value: [],
29
+      tempFilePath: '',
30
+      fileUrl: config.baseUrl + '/profile/upload',
31
+      docName: ''
32
+    }
33
+  },
34
+  watch: {
35
+    fileName(newval) {
36
+      this.docName = getFileName(newval);
37
+    }
38
+  },
39
+  created() {
40
+  },
41
+  methods: {
42
+    chooseFile() {
43
+      uni.chooseFile({
44
+        count: 1,
45
+        type: 'all',
46
+        success: (res) => {
47
+          this.tempFilePath = res.tempFiles[0].path;
48
+          let params = {
49
+            url: '/common/upload',
50
+            filePath: this.tempFilePath,
51
+            name: 'file',
52
+            formData: { // 附加表单数据
53
+              fileType: this.fileType
54
+            },
55
+          }
56
+          //上传文件
57
+          upload(params).then(res => {
58
+            if (res.code == 200) {
59
+              let fileName = '/' + this.fileType + '/' + res.newFileName
60
+              this.$modal.msgSuccess(res.msg);
61
+              this.$emit('success', fileName)
62
+            }
63
+          })
64
+        },
65
+        fail: (err) => {
66
+          console.error('选择文件失败:', err);
67
+        }
68
+      });
69
+    },
70
+    deleteFile() {
71
+      uni.showModal({
72
+        title: '提示',
73
+        content: '是否删除文件?',
74
+        success: (res) => {
75
+          if (!res.confirm) {
76
+            return;
77
+          }
78
+          // 继续执行后续代码
79
+          this.$emit('deleteFile')
80
+        }
81
+      });
82
+    }
83
+  },
84
+}
85
+</script>
86
+
87
+<style lang="scss" scoped>
88
+.file-box {
89
+  display: flex;
90
+  height: 60px;
91
+  align-items: center;
92
+  border: 1px solid #ececec;
93
+  padding: 10px;
94
+
95
+  .link {
96
+    flex: 1;
97
+
98
+  }
99
+}
100
+</style>

+ 75
- 0
oa-ui-app/pages/components/flowNote.vue Voir le fichier

@@ -0,0 +1,75 @@
1
+<!--
2
+ * @Author: ysh
3
+ * @Date: 2025-03-17 10:04:51
4
+ * @LastEditors: Please set LastEditors
5
+ * @LastEditTime: 2025-03-18 10:45:52
6
+-->
7
+<template>
8
+  <view>
9
+    <uv-steps :current="currentNum">
10
+      <uv-steps-item :error="item.comment && item.comment.type == '退回意见'" v-for="item, index in flowRecordList"
11
+        :key="'f' + index" :title="item.taskName" :desc="item.finishTime"></uv-steps-item>
12
+    </uv-steps>
13
+    <view class="custom-block danger" v-if="isRetrun">
14
+      <uni-title type="h3" title="任务被退回,请修改后重新提交" color="#900"></uni-title>
15
+      <view>
16
+        <p>退回意见:{{ reBackDescription }}</p>
17
+        <p>办理人:{{ assigneeName }}</p>
18
+      </view>
19
+    </view>
20
+    <uv-divider></uv-divider>
21
+  </view>
22
+</template>
23
+
24
+<script>
25
+import { flowRecord, flowRecordFull } from "@/api/flowable/finished";
26
+export default {
27
+  props: {
28
+    taskForm: Object,
29
+  },
30
+  data() {
31
+    return {
32
+      flowRecordList: [],
33
+      currentNum: 0,
34
+      isRetrun: false,
35
+      reBackDescription: '',
36
+      assigneeName: ''
37
+    }
38
+  },
39
+  created() {
40
+    this.getFlowRecordList(this.taskForm.procInsId, this.taskForm.deployId);
41
+  },
42
+  methods: {
43
+    /** 流程流转记录 */
44
+    getFlowRecordList(procInsId, deployId) {
45
+      const params = { procInsId: procInsId, deployId: deployId }
46
+      flowRecordFull(params).then(res => {
47
+        if (res.data.flowList.length > 1 && res.data.flowList[1].comment && res.data.flowList[1].comment.type == '退回意见') {
48
+          this.reBackDescription = res.data.flowList[1].comment.comment
49
+          this.assigneeName = res.data.flowList[1].assigneeName
50
+          this.isRetrun = true
51
+        } else {
52
+          this.isRetrun = false
53
+        }
54
+        this.flowRecordList = res.data.flowList.reverse();
55
+        this.currentNum = this.flowRecordList.length - 1;
56
+      })
57
+    },
58
+  },
59
+}
60
+</script>
61
+
62
+<style lang="scss" scoped>
63
+.custom-block {
64
+  padding: 10px;
65
+  border-left-width: 2px;
66
+  border-left-style: solid;
67
+  margin: 5px 0;
68
+}
69
+
70
+.danger {
71
+  background-color: #ffe6e6;
72
+  border-color: #c00;
73
+  color: #4d0000;
74
+}
75
+</style>

+ 130
- 0
oa-ui-app/pages/components/returnPopup.vue Voir le fichier

@@ -0,0 +1,130 @@
1
+<!--
2
+ * @Author: ysh
3
+ * @Date: 2025-03-17 15:04:06
4
+ * @LastEditors: Please set LastEditors
5
+ * @LastEditTime: 2025-03-17 15:43:28
6
+-->
7
+<template>
8
+  <view class="add-popup">
9
+    <view class="popup-content">
10
+      <text class="popup-title">退回菜单</text>
11
+      <uni-forms ref="form" :modelValue="taskForm" :rules="rules" label-position="top" label-width="150">
12
+        <uni-forms-item label="退回节点" name="targetKey" required class="form-item">
13
+          <uv-radio-group v-model="taskForm.targetKey" placement="column">
14
+            <uv-radio :name="item.id" :label="item.name" v-for="(item, index) in returnTaskList" :customStyle="{margin: '8px'}" 
15
+              :key="'r' + index"></uv-radio>
16
+          </uv-radio-group>
17
+        </uni-forms-item>
18
+        <uni-forms-item label="退回意见" name="comment" required class="form-item">
19
+          <uv-textarea v-model="taskForm.comment" placeholder="请输入退回意见"></uv-textarea>
20
+        </uni-forms-item>
21
+        <view class="popup-buttons">
22
+          <u-button style="margin-right: 10px;" @click="cancel">取消</u-button>
23
+          <u-button type="primary" class="confirm" @click="taskReturn">确认</u-button>
24
+        </view>
25
+      </uni-forms>
26
+
27
+    </view>
28
+  </view>
29
+</template>
30
+
31
+<script>
32
+import { complete, rejectTask, returnList, returnTask, getNextFlowNode, delegate, flowTaskForm, } from "@/api/flowable/todo";
33
+export default {
34
+  props: {
35
+    taskForm: Object,
36
+    comment: String,
37
+  },
38
+  data() {
39
+    return {
40
+      rules: {
41
+        targetKey: {
42
+          rules: [{
43
+            required: true,
44
+            errorMessage: '请选择退回节点',
45
+          },]
46
+        },
47
+        comment: {
48
+          rules: [{
49
+            required: true,
50
+            errorMessage: '请填写退回意见',
51
+          },]
52
+        },
53
+      },
54
+      returnTaskList: [],
55
+    }
56
+  },
57
+  created() {
58
+    this.handleReturn();
59
+  },
60
+  mounted() {
61
+    if (this.comment != '') {
62
+      this.taskForm.comment = this.comment
63
+    }
64
+  },
65
+  watch: {
66
+    comment(newval) {
67
+      this.taskForm.comment = newval
68
+    }
69
+  },
70
+  methods: {
71
+    /** 可退回任务列表 */
72
+    handleReturn() {
73
+      returnList(this.taskForm).then(res => {
74
+        this.returnTaskList = res.data.reverse();
75
+        this.taskForm.variables = null;
76
+      })
77
+    },
78
+    /** 提交退回任务 */
79
+    taskReturn() {
80
+      this.$refs.form.validate().then(resopnse => {
81
+        returnTask(this.taskForm).then(res => {
82
+          this.$modal.msgSuccess(res.msg);
83
+          this.$emit('goBack')
84
+        });
85
+      }).catch(err => {
86
+        console.log('表单错误信息:', err);
87
+      })
88
+    },
89
+    cancel() {
90
+      this.$emit('cancel')
91
+    },
92
+    confirm() {
93
+
94
+    }
95
+  },
96
+}
97
+</script>
98
+
99
+<style lang="scss" scoped>
100
+.add-popup {
101
+  position: fixed;
102
+  top: 0;
103
+  left: 0;
104
+  right: 0;
105
+  bottom: 0;
106
+  background-color: rgba(0, 0, 0, 0.5);
107
+  display: flex;
108
+  justify-content: center;
109
+  align-items: center;
110
+  z-index: 999;
111
+
112
+  .popup-title {
113
+    font-size: 36rpx;
114
+    font-weight: bold;
115
+    display: block;
116
+    margin-bottom: 40rpx;
117
+  }
118
+
119
+  .popup-content {
120
+    background-color: white;
121
+    width: 600rpx;
122
+    padding: 40rpx;
123
+    border-radius: 20rpx;
124
+  }
125
+
126
+  .popup-buttons {
127
+    display: flex;
128
+  }
129
+}
130
+</style>

+ 168
- 41
oa-ui-app/pages/form/borrow/borrow.vue Voir le fichier

@@ -2,13 +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-03 17:23:02
6
--->
7
-<!--
8
- * @Author: ysh
9
- * @Date: 2025-02-20 10:20:22
10
- * @LastEditors: Please set LastEditors
11
- * @LastEditTime: 2025-03-03 17:19:59
5
+ * @LastEditTime: 2025-03-18 17:13:59
12 6
 -->
13 7
 <template>
14 8
   <view class="form-container">
@@ -19,6 +13,7 @@
19 13
     </view>
20 14
     <!-- 表单内容 -->
21 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>
22 17
       <!-- 当前节点 -->
23 18
       <uni-forms-item label="当前节点" class="form-item">
24 19
         <uni-tag :inverted="true" type="primary" :text="taskName"></uni-tag>
@@ -26,7 +21,7 @@
26 21
 
27 22
       <!-- 流程发起人 -->
28 23
       <uni-forms-item label="填报人" class="form-item">
29
-        <uni-tag :inverted="true" type="primary" :text="startUserName"></uni-tag>
24
+        <b style="font-size:35rpx;">{{ startUserName }}</b>
30 25
       </uni-forms-item>
31 26
 
32 27
       <!-- 填报日期 -->
@@ -54,62 +49,102 @@
54 49
 
55 50
       <!-- 借款明细 -->
56 51
       <uni-forms-item label="借款明细" required class="form-item">
57
-        <BorrowDetail :borrowId="form.borrowId" :taskName="taskName" @getApplyAmount="setApplyAmount"></BorrowDetail>
52
+        <BorrowDetail :borrowId="form.borrowId" :taskName="taskName" @getApplyAmount="setApplyAmount"
53
+          @getManagerAmount="setManagerAmount"></BorrowDetail>
58 54
       </uni-forms-item>
59 55
 
56
+      <!-- 最大借款金额限制 -->
57
+      <uni-forms-item label="最大借款金额" class="form-item" v-if="form.borrowUsage == '0'">
58
+        <view class="amount-text">¥ {{ totalBudget.toFixed(2) }}</view>
59
+      </uni-forms-item>
60
+      <uni-forms-item label="已申请借款" class="form-item" v-if="form.borrowUsage == '0'">
61
+        <view class="amount-text">¥ {{ hasBorrow.toFixed(2) }}</view>
62
+      </uni-forms-item>
63
+      <uni-forms-item label="可用借款" class="form-item" v-if="form.borrowUsage == '0'">
64
+        <view class="amount-text">¥ {{ (totalBudget - hasBorrow).toFixed(2) }}</view>
65
+      </uni-forms-item>
60 66
       <uni-forms-item label="申请金额" required class="form-item">
61
-        <view class="amount-text">¥ {{ (this.form.applyAmount).toFixed(2) }}</view>
67
+        <view class="amount-text">¥ {{ (this.form.applyAmount ? this.form.applyAmount : 0).toFixed(2) }}</view>
62 68
         <view class="warning-text" v-if="exceed && form.borrowUsage == '0'">
63 69
           超过预算金额:¥ {{ getMoreAmount('0') }}
64 70
         </view>
65 71
       </uni-forms-item>
66
-
67
-      <uni-forms-item label="最大借款金额" class="form-item">
68
-        <view class="amount-text">¥ {{ totalBudget.toFixed(2) }}</view>
72
+      <uni-forms-item label="校准金额" required class="form-item" v-if="taskName != '借款申请' && taskName != '部门审核'">
73
+        <view class="amount-text">¥ {{ (this.form.managerAmount ? this.form.managerAmount : 0).toFixed(2) }}</view>
74
+        <view class="warning-text" v-if="exceed && form.borrowUsage == '0'">
75
+          超过预算金额:¥ {{ getMoreAmount('1') }}
76
+        </view>
69 77
       </uni-forms-item>
70 78
 
71
-      <uni-forms-item label="已申请借款" class="form-item">
72
-        <view class="amount-text">¥ {{ hasBorrow.toFixed(2) }}</view>
79
+      <!-- 申请人说明 -->
80
+      <uni-forms-item label="申请人说明" required class="form-item" name="remark">
81
+        <uv-textarea v-model="form.remark" placeholder="请输入申请人说明" :disabled="taskName != '借款申请'"></uv-textarea>
73 82
       </uni-forms-item>
74 83
 
75
-      <uni-forms-item label="可用借款" class="form-item">
76
-        <view class="amount-text">¥ {{ (totalBudget - hasBorrow).toFixed(2) }}</view>
84
+      <!-- 附件上传 -->
85
+      <uni-forms-item label="附件上传" class="form-item" name="borrowDocument">
86
+        <file-upload :fileType="'借款/申请附件'" :showBtn="taskName == '借款申请'" :fileName="form.borrowDocument"
87
+          @deleteFile="form.borrowDocument = ''" @success="uploadSuccess"></file-upload>
77 88
       </uni-forms-item>
78
-      <uni-forms-item label="申请人说明" required class="form-item">
79
-        <uv-textarea v-model="form.remark" placeholder="请输入申请人说明" :disabled="taskName != '借款申请'"></uv-textarea>
89
+
90
+      <!-- 部门审核 -->
91
+      <uni-forms-item label="部门负责人意见" required class="form-item" v-if="taskName != '借款申请'" name="deptComment">
92
+        <uv-textarea v-model="form.deptComment" placeholder="请输入部门负责人意见" :disabled="taskName != '部门审核'"></uv-textarea>
80 93
       </uni-forms-item>
81 94
 
95
+      <!-- 分管审核 -->
96
+      <uni-forms-item label="分管领导审核意见" required class="form-item" v-if="taskName != '借款申请'" name="managerComment">
97
+        <uv-textarea v-model="form.managerComment" placeholder="请输入分管领导审核意见"
98
+          :disabled="taskName != '分管审核'"></uv-textarea>
99
+      </uni-forms-item>
82 100
 
83
-      <uni-forms-item label="部门负责人意见" required class="form-item" v-if="taskName != '借款申请'">
84
-        <uv-textarea v-model="form.deptComment" placeholder="请输入部门负责人意见"></uv-textarea>
101
+      <!-- 总经理审核 -->
102
+      <uni-forms-item label="总经理审核意见" required class="form-item" v-if="taskName != '借款申请'" name="zjlComment">
103
+        <uv-textarea v-model="form.zjlComment" placeholder="请输入总经理审核意见" :disabled="taskName != '总经理审核'"></uv-textarea>
85 104
       </uni-forms-item>
86 105
 
87
-      <view class="form-button">
88
-        <u-button type="warning" size="normal" @click="saves" style="margin-right: 10px"
89
-          v-if="taskName == '借款申请'">保存</u-button>
106
+      <!-- 非党工团审核 -->
107
+
108
+
109
+      <!-- 操作栏 -->
110
+      <view class="form-button" v-if="taskName">
111
+        <u-button type="warning" size="normal" @click="saves" style="margin-right: 10px" v-if="taskName">保存</u-button>
112
+        <u-button type="error" size="normal" style="margin-right: 10px" @click="$refs.returnPopup.open()"
113
+          v-if="taskName != '借款申请'">退回</u-button>
90 114
         <u-button type="primary" size="normal" @click="submit">{{ taskName == '借款申请' ? '提交申请' : '提交审核' }}</u-button>
91 115
       </view>
92 116
     </uni-forms>
93 117
 
118
+    <!-- 退回弹窗 -->
119
+    <uni-popup ref="returnPopup" background-color="#fff">
120
+      <return-popup @cancel="$refs.returnPopup.close()" :taskForm="taskForm" :comment="commentByRole()"
121
+        @goBack="goHome"></return-popup>
122
+    </uni-popup>
123
+
94 124
   </view>
95 125
 </template>
96 126
 
97 127
 <script>
98
-import ProjectPicker from '@/pages/components/ProjectPicker.vue';
99
-import ProjectInfo from '@/pages/components/ProjectInfo.vue';
100 128
 import { parseTime } from "@/utils/common.js"
101
-import { listBorrow, getBorrow, delBorrow, addBorrow, updateBorrow } from "@/api/oa/borrow/borrow";
102
-import { listProject, getProject } from "@/api/oa/project/project";
103 129
 import { listBudget } from "@/api/oa/budget/budget";
104
-import { getUserByPost, getUsersDeptLeader, getUsersDeptLeaderByDept, getUsersViceDeptLeaderByDept, getUsersManageLeaderByDept } from '@/api/system/post.js'
130
+import ProjectInfo from '@/pages/components/ProjectInfo.vue';
105 131
 import { complete, getNextFlowNode } from "@/api/flowable/todo";
106
-import config from '@/config'
132
+import ProjectPicker from '@/pages/components/ProjectPicker.vue';
133
+import { listProject, getProject } from "@/api/oa/project/project";
134
+import { listBorrow, getBorrow, delBorrow, addBorrow, updateBorrow } from "@/api/oa/borrow/borrow";
135
+import { getUserByPost, getUsersDeptLeader, getUsersDeptLeaderByDept, getUsersViceDeptLeaderByDept, getUsersManageLeaderByDept } from '@/api/system/post.js'
107 136
 import BorrowDetail from './borrowDetail.vue';
137
+import FlowNote from '@/pages/components/flowNote.vue';
138
+import ReturnPopup from '@/pages/components/returnPopup.vue';
139
+import FileUpload from '@/pages/components/fileUpload.vue';
108 140
 export default {
109 141
   components: {
110 142
     ProjectPicker,
111 143
     ProjectInfo,
112
-    BorrowDetail
144
+    BorrowDetail,
145
+    FlowNote,
146
+    ReturnPopup,
147
+    FileUpload,
113 148
   },
114 149
   props: {
115 150
     taskForm: Object,
@@ -120,17 +155,28 @@ export default {
120 155
     this.form.borrowId = this.taskForm.formId;
121 156
     this.deptId = this.$store.getters.deptId;
122 157
     this.initForm();
158
+    this.initRules();
123 159
     uni.setNavigationBarTitle({
124 160
       title: '借款审批'
125 161
     });
126 162
   },
163
+  watch: {
164
+    form: {
165
+      handler(newVal) {
166
+        this.initRules();
167
+      },
168
+      deep: true // 启用深度监测
169
+    }
170
+  },
127 171
   data() {
128 172
     return {
129 173
       form: {
130 174
         submitTime: '',
131 175
         borrowUsage: '0',
132 176
         applyAmount: 0,
177
+        managerAmount: 0,
133 178
         remark: '',
179
+        applyDate: ''
134 180
       },
135 181
       rules: {},
136 182
       borrowUsageOptions: [{
@@ -163,15 +209,68 @@ export default {
163 209
       exceed: false, //是否超预算
164 210
       hasBorrow: 0, //已申请借款
165 211
       deptId: undefined,
212
+      returnBack: false,
166 213
     }
167 214
   },
168 215
   methods: {
216
+    initRules() {
217
+      this.rules = {
218
+        // 借款类型验证(必填)
219
+        borrowUsage: {
220
+          rules: [{
221
+            required: true,
222
+            errorMessage: '请选择借款类型'
223
+          }]
224
+        },
225
+        // 借款事由验证(当 borrowUsage != 0 时必填)
226
+        applyReason: {
227
+          rules: [{
228
+            required: this.form.borrowUsage != '0', // 动态控制必填
229
+            errorMessage: '请输入借款事由'
230
+          }]
231
+        },
232
+        // 项目选择验证(当 borrowUsage == 0 时必填)
233
+        projectId: {
234
+          rules: [{
235
+            required: this.form.borrowUsage == '0', // 动态控制必填
236
+            errorMessage: '请选择项目'
237
+          }]
238
+        },
239
+        // 申请人说明验证(必填)
240
+        remark: {
241
+          rules: [{
242
+            required: true,
243
+            errorMessage: '请输入申请人说明'
244
+          }]
245
+        },
246
+        // 部门意见验证(仅在部门审核步骤必填)
247
+        deptComment: {
248
+          rules: [{
249
+            required: this.taskName === '部门审核',
250
+            errorMessage: '请输入部门意见'
251
+          }]
252
+        },
253
+        // 分管意见验证(仅在分管审核步骤必填)
254
+        managerComment: {
255
+          rules: [{
256
+            required: this.taskName === '分管审核',
257
+            errorMessage: '请输入分管意见'
258
+          }]
259
+        },
260
+        // 总经理意见验证(仅在总经理审核步骤必填)
261
+        zjlComment: {
262
+          rules: [{
263
+            required: this.taskName === '总经理审核',
264
+            errorMessage: '请输入总经理意见'
265
+          }]
266
+        }
267
+      }
268
+    },
169 269
     async initForm() {
170 270
       getBorrow(this.taskForm.formId).then(async res => {
171 271
         if (res.data) {
172 272
           this.formTotal = 1;
173 273
           this.form = res.data;
174
-          console.log(this.form);
175 274
           if (this.form.projectId) {
176 275
             getProject(this.form.projectId).then(res => {
177 276
               if (res.data) {
@@ -232,8 +331,10 @@ export default {
232 331
     setApplyAmount(val) {
233 332
       this.form.applyAmount = val
234 333
     },
334
+    setManagerAmount(val) {
335
+      this.form.managerAmount = val
336
+    },
235 337
     handleConfirm(project) {
236
-      console.log('选中的项目:', project);
237 338
       this.selectedProject = project;
238 339
       this.projectObj = project;
239 340
       this.form.projectId = project.projectId;
@@ -267,10 +368,6 @@ export default {
267 368
     // 处理提交逻辑
268 369
     handleSubmit() {
269 370
       this.$refs.form.validate().then(async res => {
270
-        if (this.form.borrowUsage == '0' && !this.form.projectId) {
271
-          this.$modal.msgError('请选择项目!')
272
-          return
273
-        }
274 371
         if (this.formTotal != 0) {
275 372
           // 定义审核节点配置
276 373
           const auditConfig = {
@@ -313,7 +410,6 @@ export default {
313 410
           // 更新借款申请
314 411
           await updateBorrow(this.form);
315 412
           const params = { taskId: this.taskForm.taskId };
316
-          console.log('params', params);
317 413
           getNextFlowNode(params).then(async res => {
318 414
             // 处理不同的流程节点
319 415
             if (this.taskName == '借款申请') {
@@ -369,19 +465,23 @@ export default {
369 465
     handleComplete(taskForm) {
370 466
       complete(taskForm).then(response => {
371 467
         this.$modal.msgSuccess(response.msg);
372
-        this.$emit('goBack');
468
+        this.goHome();
373 469
       })
374 470
     },
375 471
     // 借款申请提交方法
376 472
     async borrowApprovalFun() {
377 473
       let userId;
474
+      console.log(this.deptId);
475
+
378 476
       // 如果是党工团申请 deptId == 0 为党工团申请
379 477
       if (this.deptId === 0) {
380 478
         // 2为工会、3为党委
381 479
         if (this.form.borrowUsage == 2 || this.form.borrowUsage == 3) {
382
-          userId = this.publicData.partySecretary;
480
+          const res = await getUserByPost({ postName: '党总支书记' });
481
+          userId = res.data[0].userId;
383 482
         } else {
384
-          userId = this.publicData.leagueSecretary;
483
+          const res = await getUserByPost({ postName: '团委书记' });
484
+          userId = res.data[0].userId;
385 485
         }
386 486
         this.taskForm.variables.dept = this.deptId;
387 487
         this.taskForm.variables.approval = userId;
@@ -397,6 +497,7 @@ export default {
397 497
         const res = await getUserByPost({ postName: '董事长' });
398 498
         this.taskForm.variables.dept = this.deptId;
399 499
         this.taskForm.variables.approval = res.data[0].userId;
500
+        this.taskForm.variables.exceed = true;
400 501
         this.handleComplete(this.taskForm);
401 502
       } else { //普通员工申请项目借款
402 503
         const res = await getUsersDeptLeader({ userId: this.$store.getters.userId });
@@ -416,6 +517,30 @@ export default {
416 517
       this.taskForm.variables.approvalList = approvalList;
417 518
       this.handleComplete(this.taskForm);
418 519
     },
520
+    commentByRole() {
521
+      if (this.taskName == '部门审核') {
522
+        return this.form.deptComment
523
+      } else if (this.taskName == '分管审核') {
524
+        return this.form.managerComment
525
+      } else if (this.taskName == '总经理审核') {
526
+        return this.form.zjlComment
527
+      } else if (this.taskName == '董事长批准') {
528
+        return this.form.dszComment
529
+      } else if (this.taskName == '党工团审核') {
530
+        return this.form.unionComment
531
+      } else if (this.taskName == '财务处理') {
532
+        return this.form.cwComment
533
+      }
534
+    },
535
+    goHome() {
536
+      uni.switchTab({
537
+        url: '/pages/message/index'
538
+      })
539
+    },
540
+    uploadSuccess(fileName) {
541
+      this.form.borrowDocument = fileName
542
+      updateBorrow(this.form)
543
+    }
419 544
   },
420 545
 }
421 546
 </script>
@@ -425,12 +550,14 @@ export default {
425 550
   font-size: 16px;
426 551
   font-weight: bold;
427 552
   color: #333;
553
+  text-align: right;
428 554
 }
429 555
 
430 556
 .warning-text {
431 557
   font-size: 14px;
432 558
   color: #ff0000;
433 559
   margin-top: 5px;
560
+  text-align: right;
434 561
 }
435 562
 
436 563
 .form-button {

+ 43
- 8
oa-ui-app/pages/form/borrow/borrowDetail.vue Voir le fichier

@@ -2,7 +2,7 @@
2 2
  * @Author: ysh
3 3
  * @Date: 2025-02-27 10:43:04
4 4
  * @LastEditors: Please set LastEditors
5
- * @LastEditTime: 2025-03-03 16:58:18
5
+ * @LastEditTime: 2025-03-18 16:36:32
6 6
 -->
7 7
 <template>
8 8
   <view class="container">
@@ -28,6 +28,17 @@
28 28
           <text class="total-amount">¥{{ item.applyAmount }}</text>
29 29
         </view>
30 30
       </view>
31
+      <uv-divider :dashed="true" v-if="taskName != '借款申请' && taskName != '部门审核'"></uv-divider>
32
+      <view class="list-item" v-if="taskName != '借款申请' && taskName != '部门审核'">
33
+        <view class="item-left">
34
+          <text style="color:#398ade;padding-left: 10rpx;">分管审核金额</text>
35
+        </view>
36
+        <view class="item-right">
37
+          <uni-easyinput type="number" v-model="item.managerAmount" placeholder="请输入审核金额" v-if="taskName == '分管审核'"
38
+            @blur="editManagerAmount(detailList)" />
39
+          <text class="mg-amount" v-else>¥{{ item.managerAmount }}</text>
40
+        </view>
41
+      </view>
31 42
       <view class="box-button" v-if="taskName == '借款申请'">
32 43
         <u-button size="normal" icon="edit-pen" @click="editItem(item)">修改</u-button>
33 44
         <u-button size="normal" icon="trash" @click="deleteItem(item)">删除</u-button>
@@ -38,8 +49,7 @@
38 49
     <view v-if="showAddPopup" class="add-popup">
39 50
       <view class="popup-content">
40 51
         <text class="popup-title">新增借款项</text>
41
-        <uni-forms ref="form" :modelValue="newItem" :rules="rules" label-position="top" label-width="150"
42
-          class="custom-form">
52
+        <uni-forms ref="form" :modelValue="newItem" :rules="rules" label-position="top" label-width="150">
43 53
           <uni-forms-item label="开支项目" name="borrowItem" required class="form-item">
44 54
             <uni-easyinput v-model="newItem.borrowItem" placeholder="请输入开支项目" />
45 55
           </uni-forms-item>
@@ -124,24 +134,29 @@ export default {
124 134
       this.initList();
125 135
     },
126 136
     detailList(newval) {
127
-      let sum = newval.reduce((sum, item) => sum + Number(item.applyAmount), 0);
128
-      this.$emit('getApplyAmount', sum)
137
+      this.getAomunt(newval)
129 138
     }
130 139
   },
131 140
   methods: {
132 141
     initList() {
133
-      console.log('borrowId',  this.borrowId);
134 142
       listBorrowDetail({ pageSize: 999, borrowId: this.borrowId }).then(res => {
135 143
         if (res.rows.length != 0) {
136 144
           this.detailList = res.rows
145
+          if (!this.detailList[0].managerAmount) {
146
+            this.detailList.forEach(item => {
147
+              item.managerAmount = item.applyAmount;
148
+            });
149
+            this.editManagerAmount(this.detailList);
150
+          }
137 151
         }
138 152
       });
139 153
     },
140 154
     // 确认添加
141 155
     confirmAdd() {
142
-      const borrowId =  this.borrowId
156
+      const borrowId = this.borrowId
143 157
       this.$refs.form.validate().then(async res => {
144 158
         this.newItem.applyAmount = this.getTotal();
159
+        this.newItem.managerAmount = this.getTotal();
145 160
         if (this.isModify) {
146 161
           await updateBorrowDetail(this.newItem);
147 162
         } else {
@@ -189,6 +204,18 @@ export default {
189 204
       this.isModify = true;
190 205
       this.showAddPopup = true;
191 206
     },
207
+    getAomunt(list) {
208
+      let sum = list.reduce((sum, item) => sum + Number(item.applyAmount), 0);
209
+      let managerSum = list.reduce((sum, item) => sum + Number(item.managerAmount), 0);
210
+      this.$emit('getApplyAmount', sum);
211
+      this.$emit('getManagerAmount', managerSum);
212
+    },
213
+    async editManagerAmount(list) {
214
+      this.getAomunt(list);
215
+      for (let item of list) {
216
+        await updateBorrowDetail(item);
217
+      }
218
+    }
192 219
   },
193 220
 }
194 221
 </script>
@@ -255,11 +282,13 @@ export default {
255 282
   font-weight: bold;
256 283
   color: #333;
257 284
   margin-bottom: 15rpx;
285
+  padding-left: 10rpx;
258 286
 }
259 287
 
260 288
 .item-sub {
261 289
   font-size: 26rpx;
262 290
   color: #999;
291
+  padding-left: 10rpx;
263 292
 }
264 293
 
265 294
 .total-amount {
@@ -268,7 +297,12 @@ export default {
268 297
   font-weight: bold;
269 298
   padding-right: 30rpx;
270 299
 }
271
-
300
+.mg-amount{
301
+  font-size: 30rpx;
302
+  color: #398ade;
303
+  font-weight: bold;
304
+  padding-right: 30rpx;
305
+}
272 306
 .delete {
273 307
   font-size: 30rpx;
274 308
   color: #ff6a6c;
@@ -290,6 +324,7 @@ export default {
290 324
 
291 325
 
292 326
 .item-right {
327
+  flex: 1;
293 328
   min-width: 200rpx;
294 329
   text-align: right;
295 330
 }

+ 17
- 9
oa-ui-app/pages/form/declare/declare.vue Voir le fichier

@@ -8,6 +8,7 @@
8 8
 		<!-- 表单内容 -->
9 9
 		<uni-forms ref="form" :modelValue="formData" :rules="rules" label-position="top" label-width="150"
10 10
 			class="custom-form">
11
+			<flow-note :taskForm="taskForm"></flow-note>
11 12
 			<!-- 当前节点 -->
12 13
 			<uni-forms-item label="当前节点" class="form-item">
13 14
 				<uni-tag :inverted="true" type="primary" :text="taskName"></uni-tag>
@@ -15,7 +16,7 @@
15 16
 
16 17
 			<!-- 流程发起人 -->
17 18
 			<uni-forms-item label="填报人" class="form-item">
18
-				<uni-tag :inverted="true" type="primary" :text="startUserName"></uni-tag>
19
+				<b style="font-size:35rpx;">{{ startUserName }}</b>
19 20
 			</uni-forms-item>
20 21
 
21 22
 			<!-- 填报日期 -->
@@ -84,7 +85,8 @@
84 85
 			</uni-forms-item>
85 86
 			<!-- 提交按钮 -->
86 87
 			<button class="save-btn" @click="save">保存</button>
87
-			<button class="submit-btn margin-top-xs" type="primary" @click="submitForm">提交</button>
88
+			<button class="submit-btn margin-top-xs" type="primary" @click="submitForm" v-if="taskName == '工作填报'">提交</button>
89
+			<button class="submit-btn margin-top-xs" type="primary" @click="submitForm" v-else>确认审核</button>
88 90
 		</uni-forms>
89 91
 
90 92
 		<uv-modal ref="popModal" title="提示" content='是否提交表单?' :showCancelButton="true" @confirm="confirmSubmit"></uv-modal>
@@ -100,10 +102,12 @@ import { listDeclare, getDeclare, addDeclare, updateDeclare } from '@/api/oa/dec
100 102
 import { parseTime } from "@/utils/common.js"
101 103
 import { complete, getNextFlowNode } from "@/api/flowable/todo";
102 104
 import { getUsersDeptLeader, getUsersDeptLeaderByDept, getUsersManageLeaderByDept } from "@/api/system/post.js";
105
+import FlowNote from '@/pages/components/flowNote.vue';
103 106
 export default {
104 107
 	components: {
105 108
 		ProjectPicker,
106
-		ProjectInfo
109
+		ProjectInfo,
110
+		FlowNote
107 111
 	},
108 112
 	props: {
109 113
 		taskForm: Object,
@@ -311,8 +315,6 @@ export default {
311 315
 		},
312 316
 		submitForm() {
313 317
 			this.$refs.form.validate().then(res => {
314
-				console.log('表单数据信息:', res);
315
-				console.log(this.taskForm);
316 318
 				this.taskForm.variables.skip = false;
317 319
 				if (!this.projectObj.projectLeader) {
318 320
 					if (this.isScattered == 0) {
@@ -339,7 +341,9 @@ export default {
339 341
 				let approval = this.projectObj.projectLeader;
340 342
 				this.taskForm.variables.approval = approval
341 343
 			} else {
342
-				let resData = await getUsersDeptLeader({ userId: this.form.userId });
344
+				let resData = await getUsersDeptLeader({
345
+					userId: this.form.userId
346
+				});
343 347
 				if (resData.data) {
344 348
 					this.taskForm.variables.approval = resData.data.userId
345 349
 					this.taskForm.variables.skip = true;
@@ -357,7 +361,9 @@ export default {
357 361
 			if (this.taskName == '项目负责人审核') {
358 362
 				this.formData.checkStatus = '1';
359 363
 				updateDeclare(this.formData);
360
-				let resData = await getUsersDeptLeader({ userId: this.formData.userId });
364
+				let resData = await getUsersDeptLeader({
365
+					userId: this.formData.userId
366
+				});
361 367
 				if (resData.data) {
362 368
 					this.taskForm.variables.approval = resData.data.userId;
363 369
 					this.handleComplete(this.taskForm);
@@ -378,7 +384,9 @@ export default {
378 384
 			})
379 385
 		},
380 386
 		handleComplete(taskForm) {
381
-			const params = { taskId: this.taskForm.taskId };
387
+			const params = {
388
+				taskId: this.taskForm.taskId
389
+			};
382 390
 			getNextFlowNode(params).then(() => {
383 391
 				complete(taskForm).then(response => {
384 392
 					uni.showToast({
@@ -430,7 +438,7 @@ export default {
430 438
 .form-item {
431 439
 	margin-bottom: 20px;
432 440
 
433
-	/deep/ .uni-forms-item__label {
441
+	::v-deep .uni-forms-item__label {
434 442
 		font-weight: 500;
435 443
 		color: #666;
436 444
 		padding-bottom: 8px;

+ 10
- 4
oa-ui-app/pages/message/index.vue Voir le fichier

@@ -2,7 +2,7 @@
2 2
  * @Author: ysh
3 3
  * @Date: 2025-01-21 10:01:39
4 4
  * @LastEditors: Please set LastEditors
5
- * @LastEditTime: 2025-02-19 15:18:10
5
+ * @LastEditTime: 2025-03-17 16:01:12
6 6
 -->
7 7
 <template>
8 8
 	<view class="u-page">
@@ -74,8 +74,11 @@ export default {
74 74
 	created() {
75 75
 		this.getTodoList();
76 76
 	},
77
-	onLoad() {
78
-
77
+	onLoad: function (options) {
78
+		uni.startPullDownRefresh();
79
+	},
80
+	onPullDownRefresh() {
81
+		this.getTodoList();
79 82
 	},
80 83
 	methods: {
81 84
 		getTodoList() {
@@ -86,7 +89,10 @@ export default {
86 89
 			}).then(response => {
87 90
 				this.detail = response.data.total;
88 91
 				this.todoList = response.data.records;
89
-				this.acceptTime = response.data.records[0].createTime;
92
+				if (response.data.records.length != 0) {
93
+					this.acceptTime = response.data.records[0].createTime;
94
+				}
95
+				uni.stopPullDownRefresh();
90 96
 			});
91 97
 		}
92 98
 	},

+ 1
- 1
oa-ui-app/pages/work/index.vue Voir le fichier

@@ -82,7 +82,7 @@
82 82
 
83 83
     <uv-popup ref="popup" mode="bottom">
84 84
       <view class="bottom-popup">
85
-        <view v-for="item in sendFlowList">
85
+        <view v-for="item,index in sendFlowList" :key="index">
86 86
           <u-button @click="sendFlow(item)">{{ item.name }}</u-button>
87 87
         </view>
88 88
       </view>

+ 1
- 1
oa-ui-app/static/scss/global.scss Voir le fichier

@@ -148,7 +148,7 @@
148 148
 .form-item {
149 149
   margin-bottom: 20px;
150 150
 
151
-  /deep/ .uni-forms-item__label {
151
+  ::v-deep .uni-forms-item__label {
152 152
     font-weight: 500;
153 153
     color: #666;
154 154
     padding-bottom: 8px;

+ 10
- 1
oa-ui-app/utils/common.js Voir le fichier

@@ -20,7 +20,7 @@ export function showConfirm(content) {
20 20
       content: content,
21 21
       cancelText: '取消',
22 22
       confirmText: '确定',
23
-      success: function(res) {
23
+      success: function (res) {
24 24
         resolve(res)
25 25
       }
26 26
     })
@@ -102,4 +102,13 @@ export function parseTime(time, pattern) {
102 102
     return value || 0
103 103
   })
104 104
   return time_str
105
+}
106
+
107
+
108
+
109
+export function getFileName(name) {
110
+  if (name) {
111
+    let arr = name.split("/");
112
+    return arr[arr.length - 1];
113
+  }
105 114
 }

+ 2
- 2
oa-ui/src/assets/datas/publicData.js Voir le fichier

@@ -2,11 +2,11 @@
2 2
  * @Author: ysh
3 3
  * @Date: 2024-04-24 15:07:42
4 4
  * @LastEditors: Please set LastEditors
5
- * @LastEditTime: 2024-09-09 09:20:08
5
+ * @LastEditTime: 2025-03-18 17:11:26
6 6
  */
7 7
 const publicData = {
8 8
   partySecretary: 4, //党委书记
9
-  leagueSecretary: 142, //团委书记
9
+  leagueSecretary: 15, //团委书记
10 10
   gm: 7, //总经理
11 11
   chairman: 2,//董事长
12 12
   zg: 9,

+ 31
- 9
oa-ui/src/views/flowable/form/finance/borrowForm.vue Voir le fichier

@@ -114,17 +114,26 @@
114 114
           </table>
115 115
           <el-button icon="el-icon-plus" size="mini" @click="addDetailList()" type="primary" plain
116 116
             :disabled="taskName != '借款申请'"></el-button>
117
-          <!-- </el-form-item> -->
117
+
118 118
           <el-form-item label="最大借款金额" v-if="isSelect">
119
-            <el-tag>{{ totalBudget.toFixed(2) }}(大写:{{ formatNumberWithWan(totalBudget) }})</el-tag>
119
+            <el-tag>
120
+              <span class="low-money">{{ totalBudget.toFixed(2) }}</span>
121
+              <span class="up-money">(大写:{{ formatNumberWithWan(totalBudget) }})</span>
122
+            </el-tag>
120 123
           </el-form-item>
121 124
           <el-form-item label="已申请借款" v-if="isSelect">
122
-            <el-tag type="danger">{{ hasBorrow.toFixed(2) }}(大写:{{ formatNumberWithWan(hasBorrow) }})</el-tag>
125
+            <el-tag type="danger">
126
+              <span class="low-money">{{ hasBorrow.toFixed(2) }}</span>
127
+              <span class="up-money">(大写:{{ formatNumberWithWan(hasBorrow) }})</span>
128
+            </el-tag>
123 129
           </el-form-item>
124 130
           <el-form-item label="可用借款" v-if="isSelect">
125
-            <el-tag type="success">{{ (totalBudget - hasBorrow).toFixed(2) }}(大写:{{ formatNumberWithWan((totalBudget -
126
-              hasBorrow)) }})</el-tag>
131
+            <el-tag type="success">
132
+              <span class="low-money">{{ (totalBudget - hasBorrow).toFixed(2) }}</span>
133
+              <span class="up-money">(大写:{{ formatNumberWithWan((totalBudget - hasBorrow)) }})</span>
134
+            </el-tag>
127 135
           </el-form-item>
136
+
128 137
           <el-row :gutter="20">
129 138
             <el-col :span="12" :xs="24">
130 139
               <el-form-item label="申请金额" prop="applyAmount">
@@ -770,7 +779,6 @@ export default {
770 779
             // 提交到下一个流程
771 780
             getNextFlowNode(params).then(res => {
772 781
               this.borrowAprrovalFun();
773
-
774 782
             })
775 783
           }
776 784
         } else {
@@ -786,15 +794,17 @@ export default {
786 794
       })
787 795
     },
788 796
     // 借款申请提交方法
789
-    borrowAprrovalFun() {
797
+    async borrowAprrovalFun() {
790 798
       let userId;
791 799
       // 如果是党工团申请 deptId == 0 为党工团申请
792 800
       if (this.deptId == 0) {
793 801
         // 2为工会、3为党委
794 802
         if (this.form.borrowUsage == 2 || this.form.borrowUsage == 3) {
795
-          userId = this.publicData.partySecretary
803
+          const res = await getUserByPost({ postName: '党总支书记' });
804
+          userId = res.data[0].userId;
796 805
         } else {
797
-          userId = this.publicData.leagueSecretary
806
+          const res = await getUserByPost({ postName: '团委书记' });
807
+          userId = res.data[0].userId;
798 808
         }
799 809
         this.$set(this.taskForm.variables, "dept", this.deptId);
800 810
         this.$set(this.taskForm.variables, "approval", userId);
@@ -811,6 +821,7 @@ export default {
811 821
         getUserByPost({ postName: '董事长' }).then(res => {
812 822
           this.$set(this.taskForm.variables, "dept", this.deptId);
813 823
           this.$set(this.taskForm.variables, "approval", res.data[0].userId);
824
+          this.$set(this.taskForm.variables, "exceed", true);
814 825
           this.handleComplete(this.taskForm);
815 826
         })
816 827
       }
@@ -995,6 +1006,17 @@ table {
995 1006
   }
996 1007
 }
997 1008
 
1009
+.low-money {
1010
+  display: inline-block;
1011
+  width: 75px;
1012
+  text-align: right;
1013
+}
1014
+
1015
+.up-money {
1016
+  display: inline-block;
1017
+  text-align: right;
1018
+}
1019
+
998 1020
 ::v-deep .el-descriptions-item__label.is-bordered-label {
999 1021
   width: 110px;
1000 1022
 }

+ 2
- 2
oa-ui/src/views/oa/study/record.vue Voir le fichier

@@ -2,7 +2,7 @@
2 2
  * @Author: ysh
3 3
  * @Date: 2025-03-12 10:06:03
4 4
  * @LastEditors: Please set LastEditors
5
- * @LastEditTime: 2025-03-14 16:48:00
5
+ * @LastEditTime: 2025-03-17 09:28:35
6 6
 -->
7 7
 <template>
8 8
   <div class="app-container">
@@ -40,7 +40,7 @@
40 40
         <el-row :gutter="10" class="mb8">
41 41
           <el-col :span="1.5">
42 42
             <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
43
-              v-hasPermi="['oa:study:export']">导出</el-button>
43
+              v-hasPermi="['oa:record:export']">导出</el-button>
44 44
           </el-col>
45 45
           <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
46 46
         </el-row>

Loading…
Annuler
Enregistrer