综合办公系统
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

borrow.vue 24KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616
  1. <!--
  2. * @Author: ysh
  3. * @Date: 2025-02-20 10:20:22
  4. * @LastEditors: Please set LastEditors
  5. * @LastEditTime: 2025-03-26 16:08:38
  6. -->
  7. <template>
  8. <view class="form-container">
  9. <!-- 表单标题 -->
  10. <view class="form-title">
  11. <text class="title-text">借款审批</text>
  12. <view class="title-line"></view>
  13. </view>
  14. <!-- 表单内容 -->
  15. <uni-forms ref="form" :modelValue="form" :rules="rules" label-position="top" label-width="150" class="custom-form">
  16. <flow-note :taskForm="taskForm" v-if="taskName"></flow-note>
  17. <!-- 当前节点 -->
  18. <uni-forms-item label="当前节点" class="form-item" v-if="taskName">
  19. <uni-tag :inverted="true" type="primary" :text="taskName"></uni-tag>
  20. </uni-forms-item>
  21. <!-- 流程发起人 -->
  22. <uni-forms-item label="填报人" class="form-item">
  23. <b style="font-size:35rpx;">{{ applierUserName }}</b>
  24. </uni-forms-item>
  25. <!-- 填报日期 -->
  26. <uni-forms-item label="填报日期" class="form-item">
  27. <text>{{ form.applyDate }}</text>
  28. </uni-forms-item>
  29. <!-- 借款类型 -->
  30. <uni-forms-item label="借款类型" required class="form-item" name="borrowUsage">
  31. <uni-data-checkbox v-model="form.borrowUsage" :localdata="borrowUsageOptions" :disabled="taskName != '借款申请'"
  32. @change="hanldeChangeType"></uni-data-checkbox>
  33. </uni-forms-item>
  34. <!-- 借款事由 -->
  35. <uni-forms-item label="借款事由" required class="form-item" name="applyReason" v-if="form.borrowUsage != 0">
  36. <uv-textarea v-model="form.applyReason" placeholder="请输入借款事由" :disabled="taskName != '借款申请'"></uv-textarea>
  37. </uni-forms-item>
  38. <!-- 选择项目 -->
  39. <uni-forms-item label="选择项目" required class="form-item" v-if="form.borrowUsage == 0" name="projectId">
  40. <u-button type="primary" @click="openProject = true" v-if="taskName == '借款申请'">+ 选择项目</u-button>
  41. <ProjectPicker :visible.sync="openProject" :selected.sync="selectedProject" @confirm="handleConfirm" />
  42. <ProjectInfo :project="projectObj"></ProjectInfo>
  43. </uni-forms-item>
  44. <!-- 借款明细 -->
  45. <uni-forms-item label="借款明细" required class="form-item">
  46. <BorrowDetail :borrowId="form.borrowId" :taskName="taskName" @getApplyAmount="setApplyAmount"
  47. @getManagerAmount="setManagerAmount"></BorrowDetail>
  48. </uni-forms-item>
  49. <!-- 最大借款金额限制 -->
  50. <uni-forms-item label="最大借款金额" class="form-item" v-if="form.borrowUsage == '0'">
  51. <view class="amount-text">¥ {{ totalBudget.toFixed(2) }}</view>
  52. </uni-forms-item>
  53. <uni-forms-item label="已申请借款" class="form-item" v-if="form.borrowUsage == '0'">
  54. <view class="amount-text">¥ {{ hasBorrow.toFixed(2) }}</view>
  55. </uni-forms-item>
  56. <uni-forms-item label="可用借款" class="form-item" v-if="form.borrowUsage == '0'">
  57. <view class="amount-text">¥ {{ (totalBudget - hasBorrow).toFixed(2) }}</view>
  58. </uni-forms-item>
  59. <uni-forms-item label="申请金额" required class="form-item">
  60. <view class="amount-text">¥ {{ (this.form.applyAmount ? this.form.applyAmount : 0).toFixed(2) }}</view>
  61. <view class="warning-text" v-if="exceed && form.borrowUsage == '0'">
  62. 超过预算金额:¥ {{ getMoreAmount('0') }}
  63. </view>
  64. </uni-forms-item>
  65. <uni-forms-item label="校准金额" required class="form-item"
  66. v-if="taskName != '借款申请' && taskName != '部门审核' && taskName != '党工团审核'">
  67. <view class="amount-text">¥ {{ (this.form.managerAmount ? this.form.managerAmount : 0).toFixed(2) }}</view>
  68. <view class="warning-text" v-if="exceed && form.borrowUsage == '0'">
  69. 超过预算金额:¥ {{ getMoreAmount('1') }}
  70. </view>
  71. </uni-forms-item>
  72. <!-- 申请人说明 -->
  73. <uni-forms-item label="申请人说明" required class="form-item" name="remark">
  74. <uv-textarea v-model="form.remark" placeholder="请输入申请人说明" :disabled="taskName != '借款申请'"></uv-textarea>
  75. </uni-forms-item>
  76. <!-- 附件上传 -->
  77. <uni-forms-item label="附件上传" class="form-item" name="borrowDocument">
  78. <file-upload :fileType="'借款/申请附件'" :showBtn="taskName == '借款申请'" :fileName="form.borrowDocument"
  79. @deleteFile="form.borrowDocument = ''" @success="uploadSuccess"></file-upload>
  80. </uni-forms-item>
  81. <view v-if="form.borrowUsage == '0' || form.borrowUsage == '1'">
  82. <!-- 部门审核 -->
  83. <uni-forms-item label="部门负责人意见" required class="form-item" v-if="taskName != '借款申请'" name="deptComment">
  84. <uv-textarea v-model="form.deptComment" placeholder="请输入部门负责人意见" :disabled="taskName != '部门审核'"></uv-textarea>
  85. <auditor :name="form.deptUser ? form.deptUser.nickName : ''" :time="form.deptTime"></auditor>
  86. </uni-forms-item>
  87. <!-- 分管审核 -->
  88. <uni-forms-item label="分管领导审核意见" required class="form-item" v-if="taskName != '借款申请'" name="managerComment">
  89. <uv-textarea v-model="form.managerComment" placeholder="请输入分管领导审核意见"
  90. :disabled="taskName != '分管审核'"></uv-textarea>
  91. <auditor :name="form.managerUser ? form.managerUser.nickName : ''" :time="form.managerTime"></auditor>
  92. </uni-forms-item>
  93. <!-- 总经理审核 -->
  94. <uni-forms-item label="总经理审核意见" required class="form-item" v-if="taskName != '借款申请'" name="zjlComment">
  95. <uv-textarea v-model="form.zjlComment" placeholder="请输入总经理审核意见" :disabled="taskName != '总经理审核'"></uv-textarea>
  96. <auditor :name="form.zjlUser ? form.zjlUser.nickName : ''" :time="form.zjlTime"></auditor>
  97. </uni-forms-item>
  98. </view>
  99. <!-- 党工团审核 -->
  100. <view v-if="form.borrowUsage != '0' && form.borrowUsage != '1'">
  101. <uni-forms-item :label="dgtLabel" required class="form-item" v-if="taskName != '借款申请'" name="unionComment">
  102. <uv-textarea v-model="form.unionComment" placeholder="请输入审核意见" :disabled="taskName != '党工团审核'"></uv-textarea>
  103. <auditor :name="form.unionUser ? form.unionUser.nickName : ''" :time="form.unionTime"></auditor>
  104. </uni-forms-item>
  105. </view>
  106. <!-- 财务处理 -->
  107. <uni-forms-item label="财务部支付备注" class="form-item" v-if="taskName != '借款申请'" name="cwComment">
  108. <uv-textarea v-model="form.cwComment" placeholder="请输入财务部支付备注" :disabled="taskName != '财务处理'"></uv-textarea>
  109. </uni-forms-item>
  110. <uni-forms-item label="支付时间" required class="form-item" v-if="taskName != '借款申请'" name="lendTime">
  111. <uni-datetime-picker type="date" :clear-icon="false" v-model="form.lendTime" :disabled="taskName != '财务处理'" />
  112. <auditor :name="form.cwUser ? form.cwUser.nickName : ''" :time="form.lendTime"></auditor>
  113. </uni-forms-item>
  114. <!-- 操作栏 -->
  115. <view class="form-button" v-if="taskName">
  116. <u-button type="warning" size="normal" @click="saves" style="margin-right: 10px" v-if="taskName">保存</u-button>
  117. <u-button type="error" size="normal" style="margin-right: 10px" @click="$refs.returnPopup.open()"
  118. v-if="taskName != '借款申请'">退回</u-button>
  119. <u-button type="primary" size="normal" @click="submit">{{ taskName == '借款申请' ? '提交申请' : '提交审核' }}</u-button>
  120. </view>
  121. </uni-forms>
  122. <!-- 退回弹窗 -->
  123. <uni-popup ref="returnPopup" background-color="#fff">
  124. <return-popup @cancel="$refs.returnPopup.close()" :taskForm="taskForm" :comment="commentByRole()"
  125. @goBack="goHome"></return-popup>
  126. </uni-popup>
  127. </view>
  128. </template>
  129. <script>
  130. import { parseTime } from "@/utils/common.js"
  131. import { listBudget } from "@/api/oa/budget/budget";
  132. import ProjectInfo from '@/pages/components/ProjectInfo.vue';
  133. import { complete, getNextFlowNode } from "@/api/flowable/todo";
  134. import ProjectPicker from '@/pages/components/ProjectPicker.vue';
  135. import { listProject, getProject } from "@/api/oa/project/project";
  136. import { listBorrow, getBorrow, delBorrow, addBorrow, updateBorrow } from "@/api/oa/borrow/borrow";
  137. import { getUserByPost, getUsersDeptLeader, getUsersDeptLeaderByDept, getUsersViceDeptLeaderByDept, getUsersManageLeaderByDept } from '@/api/system/post.js'
  138. import BorrowDetail from './borrowDetail.vue';
  139. import FlowNote from '@/pages/components/flowNote.vue';
  140. import ReturnPopup from '@/pages/components/returnPopup.vue';
  141. import FileUpload from '@/pages/components/fileUpload.vue';
  142. import Auditor from "@/pages/components/auditor.vue";
  143. export default {
  144. components: {
  145. ProjectPicker,
  146. ProjectInfo,
  147. BorrowDetail,
  148. FlowNote,
  149. ReturnPopup,
  150. FileUpload,
  151. Auditor
  152. },
  153. props: {
  154. taskForm: Object,
  155. taskName: String, // 当前节点
  156. startUserName: String, // 流程发起人
  157. },
  158. created() {
  159. this.form.borrowId = this.taskForm.formId;
  160. this.deptId = this.$store.getters.deptId;
  161. this.applierUserName = this.startUserName;
  162. this.initForm();
  163. this.initRules();
  164. uni.setNavigationBarTitle({
  165. title: '借款审批'
  166. });
  167. },
  168. watch: {
  169. form: {
  170. handler(newVal) {
  171. this.initRules();
  172. },
  173. deep: true // 启用深度监测
  174. }
  175. },
  176. data() {
  177. return {
  178. applierUserName:'',
  179. form: {
  180. submitTime: '',
  181. borrowUsage: '0',
  182. applyAmount: 0,
  183. managerAmount: 0,
  184. remark: '',
  185. applyDate: ''
  186. },
  187. rules: {},
  188. borrowUsageOptions: [{
  189. text: '项目借款',
  190. value: '0',
  191. disable: false
  192. }, {
  193. text: '非项目借款',
  194. value: '1',
  195. disable: false
  196. }, {
  197. text: '工会借款',
  198. value: '2',
  199. disable: false
  200. }, {
  201. text: '党委借款',
  202. value: '3',
  203. disable: false
  204. }, {
  205. text: '团委借款',
  206. value: '4',
  207. disable: false
  208. }
  209. ],
  210. openProject: false,
  211. selectedProject: null, //选中的项目
  212. projectObj: {}, //项目信息的项目
  213. formTotal: 0,
  214. totalBudget: 0, //预结算额
  215. exceed: false, //是否超预算
  216. hasBorrow: 0, //已申请借款
  217. deptId: undefined,
  218. returnBack: false,
  219. dgtLabel: '工会审核意见',
  220. }
  221. },
  222. methods: {
  223. initRules() {
  224. this.rules = {
  225. // 借款类型验证(必填)
  226. borrowUsage: {
  227. rules: [{
  228. required: true,
  229. errorMessage: '请选择借款类型'
  230. }]
  231. },
  232. // 借款事由验证(当 borrowUsage != 0 时必填)
  233. applyReason: {
  234. rules: [{
  235. required: this.form.borrowUsage != '0', // 动态控制必填
  236. errorMessage: '请输入借款事由'
  237. }]
  238. },
  239. // 项目选择验证(当 borrowUsage == 0 时必填)
  240. projectId: {
  241. rules: [{
  242. required: this.form.borrowUsage == '0', // 动态控制必填
  243. errorMessage: '请选择项目'
  244. }]
  245. },
  246. // 申请人说明验证(必填)
  247. remark: {
  248. rules: [{
  249. required: true,
  250. errorMessage: '请输入申请人说明'
  251. }]
  252. },
  253. // 部门意见验证(仅在部门审核步骤必填)
  254. deptComment: {
  255. rules: [{
  256. required: this.taskName === '部门审核',
  257. errorMessage: '请输入部门意见'
  258. }]
  259. },
  260. // 分管意见验证(仅在分管审核步骤必填)
  261. managerComment: {
  262. rules: [{
  263. required: this.taskName === '分管审核',
  264. errorMessage: '请输入分管意见'
  265. }]
  266. },
  267. // 总经理意见验证(仅在总经理审核步骤必填)
  268. zjlComment: {
  269. rules: [{
  270. required: this.taskName === '总经理审核',
  271. errorMessage: '请输入总经理意见'
  272. }]
  273. },
  274. lendTime: {
  275. rules: [{
  276. required: this.taskName === '财务处理',
  277. errorMessage: '请选择支付时间'
  278. }]
  279. }
  280. }
  281. },
  282. async initForm() {
  283. getBorrow(this.taskForm.formId).then(async res => {
  284. if (res.data) {
  285. this.formTotal = 1;
  286. this.form = res.data;
  287. if (!this.applierUserName) {
  288. this.applierUserName = this.form.applierUser.nickName;
  289. }
  290. this.hanldeChangeType();
  291. if (this.form.projectId) {
  292. getProject(this.form.projectId).then(res => {
  293. if (res.data) {
  294. this.selectedProject = res.data;
  295. this.projectObj = res.data;
  296. }
  297. })
  298. let budgetData = await listBudget({ projectId: this.form.projectId })
  299. if (budgetData.total == 1) {
  300. let budget = budgetData.rows[0];
  301. this.totalBudget = budget.settleExpense
  302. } else if (budgetData.total == 0) {
  303. this.totalBudget = 0
  304. }
  305. if (this.form.borrowUsage == '0') {
  306. if ((this.totalBudget - this.form.applyAmount) < 0) {
  307. this.exceed = true;
  308. } else {
  309. this.exceed = false;
  310. }
  311. } else {
  312. this.exceed = false;
  313. }
  314. let borrow = await listBorrow({ projectId: this.form.projectId })
  315. if (borrow.total != 0) {
  316. let borrowList = borrow.rows;
  317. let hasBorrow = 0;
  318. borrowList = borrowList.filter(item => item.borrowId != this.taskForm.formId)
  319. borrowList.forEach(element => {
  320. if (element.managerAmount) {
  321. hasBorrow = hasBorrow + element.managerAmount
  322. }
  323. if (!element.managerAmount && element.applyAmount) {
  324. hasBorrow = hasBorrow + element.applyAmount
  325. }
  326. });
  327. this.hasBorrow = hasBorrow
  328. }
  329. }
  330. } else {
  331. this.formTotal = 0;
  332. this.form.applier = this.$store.getters.userId;
  333. this.form.applyDate = parseTime(new Date(), "{y}-{m}-{d}");
  334. }
  335. })
  336. },
  337. hanldeChangeType() {
  338. if (this.form.borrowUsage == '2') {
  339. this.dgtLabel = '工会审核意见'
  340. } else if (this.form.borrowUsage == '3') {
  341. this.dgtLabel = '党委审核意见'
  342. } else {
  343. this.dgtLabel = '团委审核意见'
  344. }
  345. },
  346. // 计算超过预算的金额
  347. getMoreAmount(type) {
  348. let result;
  349. if (type == '0') {
  350. result = this.form.applyAmount - (this.totalBudget - this.hasBorrow);
  351. } else {
  352. result = this.form.managerAmount - (this.totalBudget - this.hasBorrow);
  353. }
  354. return result.toFixed(2)
  355. },
  356. setApplyAmount(val) {
  357. this.form.applyAmount = val
  358. },
  359. setManagerAmount(val) {
  360. this.form.managerAmount = val
  361. },
  362. handleConfirm(project) {
  363. this.selectedProject = project;
  364. this.projectObj = project;
  365. this.form.projectId = project.projectId;
  366. },
  367. // 保存
  368. async saves() {
  369. if (this.formTotal == 0) {
  370. this.form.borrowId = this.taskForm.formId;
  371. await addBorrow(this.form)
  372. this.initForm();
  373. } else {
  374. // 更新借款审批表
  375. await updateBorrow(this.form);
  376. }
  377. this.$modal.msgSuccess('保存成功');
  378. },
  379. submit() {
  380. // 显示确认提交对话框
  381. uni.showModal({
  382. title: '提示',
  383. content: '确认提交吗?',
  384. success: (res) => {
  385. if (!res.confirm) {
  386. return;
  387. }
  388. // 继续执行后续代码
  389. this.handleSubmit();
  390. }
  391. });
  392. },
  393. // 处理提交逻辑
  394. handleSubmit() {
  395. this.$refs.form.validate().then(async res => {
  396. if (this.formTotal != 0) {
  397. // 定义审核节点配置
  398. const auditConfig = {
  399. '部门审核': {
  400. userIdField: 'deptUserId',
  401. timeField: 'deptTime'
  402. },
  403. '分管审核': {
  404. userIdField: 'managerUserId',
  405. timeField: 'managerTime'
  406. },
  407. '总经理审核': {
  408. userIdField: 'zjlUserId',
  409. timeField: 'zjlTime'
  410. },
  411. '董事长批准': {
  412. userIdField: 'dszUserId',
  413. timeField: 'dszTime'
  414. },
  415. '党工团审核': {
  416. userIdField: 'unionUserId',
  417. timeField: 'unionTime'
  418. },
  419. '财务处理': {
  420. userIdField: 'cwUserId',
  421. timeField: 'lendTime'
  422. }
  423. }
  424. // 根据当前节点更新审核信息
  425. const currentConfig = auditConfig[this.taskName]
  426. if (currentConfig) {
  427. const currentUserId = this.$store.getters.userId
  428. const currentTime = parseTime(new Date(), '{y}-{m}-{d}')
  429. // 设置审核人和审核时间
  430. this.form[currentConfig.userIdField] = currentUserId
  431. this.form[currentConfig.timeField] = currentTime
  432. }
  433. // 更新借款申请
  434. await updateBorrow(this.form);
  435. const params = { taskId: this.taskForm.taskId };
  436. getNextFlowNode(params).then(async res => {
  437. // 处理不同的流程节点
  438. if (this.taskName == '借款申请') {
  439. // 处理借款申请节点
  440. await this.borrowApprovalFun();
  441. } else if (this.taskName == '部门审核') {
  442. // 得到分管领导根据部门
  443. const res = await getUsersManageLeaderByDept({ deptId: this.form.applyDept });
  444. let userIds = [];
  445. if (res.data) {
  446. res.data.forEach(item => {
  447. userIds.push(item.userId)
  448. })
  449. }
  450. this.taskForm.variables.approvalList = userIds;
  451. this.handleComplete(this.taskForm);
  452. } else if (this.taskName == '分管审核') {
  453. // 得到总经理
  454. const res = await getUserByPost({ postName: '总经理' });
  455. this.taskForm.variables.approval = res.data[0].userId;
  456. this.handleComplete(this.taskForm);
  457. } else if (this.taskName == '总经理审核') {
  458. this.exceed = false;
  459. this.taskForm.variables.exceed = this.exceed;
  460. if (!this.exceed) {
  461. this.submitFD(); // 提交给财务部门
  462. } else {
  463. const res = await getUserByPost({ postName: '董事长' });
  464. this.taskForm.variables.approval = res.data[0].userId;
  465. this.handleComplete(this.taskForm);
  466. }
  467. } else if (this.taskName == '董事长批准' || this.taskName == '党工团审核') {
  468. this.submitFD(); // 提交给财务部门
  469. } else if (this.taskName == '财务处理') {
  470. uni.showModal({
  471. title: '提示',
  472. content: '最后一个节点,提交将结束流程,是否提交?',
  473. success: (res) => {
  474. if (res.confirm) {
  475. this.handleComplete(this.taskForm);
  476. }
  477. }
  478. });
  479. }
  480. })
  481. }
  482. }).catch(err => {
  483. console.log('表单错误信息:', err);
  484. })
  485. },
  486. // 处理任务完成
  487. handleComplete(taskForm) {
  488. complete(taskForm).then(response => {
  489. this.$modal.msgSuccess(response.msg);
  490. this.goHome();
  491. })
  492. },
  493. // 借款申请提交方法
  494. async borrowApprovalFun() {
  495. let userId;
  496. if (this.form.borrowUsage == '2' || this.form.borrowUsage == '3' || this.form.borrowUsage == '4') {
  497. this.deptId = 0;
  498. }
  499. // 如果是党工团申请 deptId == 0 为党工团申请
  500. if (this.deptId === 0) {
  501. // 2为工会、3为党委
  502. if (this.form.borrowUsage == 2 || this.form.borrowUsage == 3) {
  503. const res = await getUserByPost({ postName: '党总支书记' });
  504. userId = res.data[0].userId;
  505. } else {
  506. const res = await getUserByPost({ postName: '团委书记' });
  507. userId = res.data[0].userId;
  508. }
  509. this.taskForm.variables.dept = this.deptId;
  510. this.taskForm.variables.approval = userId;
  511. this.handleComplete(this.taskForm);
  512. }
  513. else if (this.deptId == 102) { //如果是经营管理层申请,走总经理审批
  514. this.form.managerAmount = this.form.applyAmount;
  515. await updateBorrow(this.form);
  516. const res = await getUserByPost({ postName: '总经理' });
  517. this.taskForm.variables.dept = this.deptId;
  518. this.taskForm.variables.approval = res.data[0].userId;
  519. this.handleComplete(this.taskForm);
  520. } else if (this.deptId == 101) { //如果是董事会申请,走董事长批准
  521. const res = await getUserByPost({ postName: '董事长' });
  522. this.taskForm.variables.dept = this.deptId;
  523. this.taskForm.variables.approval = res.data[0].userId;
  524. this.taskForm.variables.exceed = true;
  525. this.handleComplete(this.taskForm);
  526. } else { //普通员工申请项目借款
  527. const res = await getUsersDeptLeader({ userId: this.$store.getters.userId });
  528. let userId = res.data.userId;
  529. this.taskForm.variables.approval = userId;
  530. this.taskForm.variables.dept = this.deptId;
  531. this.handleComplete(this.taskForm);
  532. }
  533. },
  534. // 提交给财务部审核
  535. async submitFD() {
  536. let approvalList = [];
  537. const res = await getUsersDeptLeaderByDept({ deptId: 106 });
  538. approvalList.push(res.data.userId);
  539. const res1 = await getUsersViceDeptLeaderByDept({ deptId: 106 });
  540. approvalList.push(res1.data.userId);
  541. this.taskForm.variables.approvalList = approvalList;
  542. this.handleComplete(this.taskForm);
  543. },
  544. commentByRole() {
  545. if (this.taskName == '部门审核') {
  546. return this.form.deptComment
  547. } else if (this.taskName == '分管审核') {
  548. return this.form.managerComment
  549. } else if (this.taskName == '总经理审核') {
  550. return this.form.zjlComment
  551. } else if (this.taskName == '董事长批准') {
  552. return this.form.dszComment
  553. } else if (this.taskName == '党工团审核') {
  554. return this.form.unionComment
  555. } else if (this.taskName == '财务处理') {
  556. return this.form.cwComment
  557. }
  558. },
  559. goHome() {
  560. uni.switchTab({
  561. url: '/pages/message/index'
  562. })
  563. },
  564. uploadSuccess(fileName) {
  565. this.form.borrowDocument = fileName
  566. updateBorrow(this.form)
  567. }
  568. },
  569. }
  570. </script>
  571. <style lang="scss" scoped>
  572. .amount-text {
  573. font-size: 16px;
  574. font-weight: bold;
  575. color: #333;
  576. text-align: right;
  577. }
  578. .warning-text {
  579. font-size: 14px;
  580. color: #ff0000;
  581. margin-top: 5px;
  582. text-align: right;
  583. }
  584. .form-button {
  585. display: flex;
  586. }
  587. .example-body {
  588. padding: 10px;
  589. background-color: #fff;
  590. }
  591. </style>