综合办公系统
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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625
  1. <!--
  2. * @Author: ysh
  3. * @Date: 2025-02-20 10:20:22
  4. * @LastEditors: Please set LastEditors
  5. * @LastEditTime: 2025-05-29 10:15:51
  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"></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:30rpx;">{{ 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">¥ {{ siteExpenses.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">¥ {{ (siteExpenses - 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 { listSite, delSite } from "@/api/oa/budget/budgetSite.js";
  137. import { listBorrow, getBorrow, delBorrow, addBorrow, updateBorrow } from "@/api/oa/borrow/borrow";
  138. import { getUserByPost, getUsersDeptLeader, getUsersDeptLeaderByDept, getUsersViceDeptLeaderByDept, getUsersManageLeaderByDept } from '@/api/system/post.js'
  139. import BorrowDetail from './borrowDetail.vue';
  140. import FlowNote from '@/pages/components/flowNote.vue';
  141. import ReturnPopup from '@/pages/components/returnPopup.vue';
  142. import FileUpload from '@/pages/components/fileUpload.vue';
  143. import Auditor from "@/pages/components/auditor.vue";
  144. export default {
  145. components: {
  146. ProjectPicker,
  147. ProjectInfo,
  148. BorrowDetail,
  149. FlowNote,
  150. ReturnPopup,
  151. FileUpload,
  152. Auditor
  153. },
  154. props: {
  155. taskForm: Object,
  156. taskName: String, // 当前节点
  157. startUserName: String, // 流程发起人
  158. },
  159. created() {
  160. this.form.borrowId = this.taskForm.formId;
  161. this.deptId = this.$store.getters.deptId;
  162. this.applierUserName = this.startUserName;
  163. this.initForm();
  164. this.initRules();
  165. uni.setNavigationBarTitle({
  166. title: '借款审批'
  167. });
  168. },
  169. watch: {
  170. form: {
  171. handler(newVal) {
  172. this.initRules();
  173. },
  174. deep: true // 启用深度监测
  175. }
  176. },
  177. data() {
  178. return {
  179. applierUserName: '',
  180. form: {
  181. submitTime: '',
  182. borrowUsage: '0',
  183. applyAmount: 0,
  184. managerAmount: 0,
  185. remark: '',
  186. applyDate: ''
  187. },
  188. rules: {},
  189. borrowUsageOptions: [{
  190. text: '项目借款',
  191. value: '0',
  192. disable: false
  193. }, {
  194. text: '非项目借款',
  195. value: '1',
  196. disable: false
  197. }, {
  198. text: '工会借款',
  199. value: '2',
  200. disable: false
  201. }, {
  202. text: '党委借款',
  203. value: '3',
  204. disable: false
  205. }, {
  206. text: '团委借款',
  207. value: '4',
  208. disable: false
  209. }
  210. ],
  211. openProject: false,
  212. selectedProject: null, //选中的项目
  213. projectObj: {}, //项目信息的项目
  214. formTotal: 0,
  215. siteExpenses: 0, //预结算额
  216. exceed: false, //是否超预算
  217. hasBorrow: 0, //已申请借款
  218. deptId: undefined,
  219. returnBack: false,
  220. dgtLabel: '工会审核意见',
  221. }
  222. },
  223. methods: {
  224. initRules() {
  225. this.rules = {
  226. // 借款类型验证(必填)
  227. borrowUsage: {
  228. rules: [{
  229. required: true,
  230. errorMessage: '请选择借款类型'
  231. }]
  232. },
  233. // 借款事由验证(当 borrowUsage != 0 时必填)
  234. applyReason: {
  235. rules: [{
  236. required: this.form.borrowUsage != '0', // 动态控制必填
  237. errorMessage: '请输入借款事由'
  238. }]
  239. },
  240. // 项目选择验证(当 borrowUsage == 0 时必填)
  241. projectId: {
  242. rules: [{
  243. required: this.form.borrowUsage == '0', // 动态控制必填
  244. errorMessage: '请选择项目'
  245. }]
  246. },
  247. // 申请人说明验证(必填)
  248. remark: {
  249. rules: [{
  250. required: true,
  251. errorMessage: '请输入申请人说明'
  252. }]
  253. },
  254. // 部门意见验证(仅在部门审核步骤必填)
  255. deptComment: {
  256. rules: [{
  257. required: this.taskName === '部门审核',
  258. errorMessage: '请输入部门意见'
  259. }]
  260. },
  261. // 分管意见验证(仅在分管审核步骤必填)
  262. managerComment: {
  263. rules: [{
  264. required: this.taskName === '分管审核',
  265. errorMessage: '请输入分管意见'
  266. }]
  267. },
  268. // 总经理意见验证(仅在总经理审核步骤必填)
  269. zjlComment: {
  270. rules: [{
  271. required: this.taskName === '总经理审核',
  272. errorMessage: '请输入总经理意见'
  273. }]
  274. },
  275. lendTime: {
  276. rules: [{
  277. required: this.taskName === '财务处理',
  278. errorMessage: '请选择支付时间'
  279. }]
  280. }
  281. }
  282. },
  283. async initForm() {
  284. getBorrow(this.taskForm.formId).then(async res => {
  285. if (res.data) {
  286. this.formTotal = 1;
  287. this.form = res.data;
  288. if (!this.applierUserName) {
  289. this.applierUserName = this.form.applierUser.nickName;
  290. }
  291. this.hanldeChangeType();
  292. if (this.form.projectId) {
  293. getProject(this.form.projectId).then(res => {
  294. if (res.data) {
  295. this.selectedProject = res.data;
  296. this.projectObj = res.data;
  297. }
  298. })
  299. await this.getMaxExpense();
  300. }
  301. } else {
  302. this.formTotal = 0;
  303. this.form.applier = this.$store.getters.userId;
  304. this.form.applyDate = parseTime(new Date(), "{y}-{m}-{d}");
  305. }
  306. })
  307. },
  308. async getMaxExpense() {
  309. let budgetData = await listBudget({ projectId: this.form.projectId })
  310. if (budgetData.total == 1) {
  311. let budget = budgetData.rows[0];
  312. let siteRes = await listSite({ budgetId: budget.budgetId });
  313. let maxExpense = siteRes.rows.reduce((sum, site) => sum + (Number(site.amount) || 0), 0);
  314. this.siteExpenses = maxExpense
  315. } else {
  316. this.siteExpenses = 0
  317. }
  318. if (this.form.borrowUsage == '0') {
  319. if ((this.siteExpenses - this.form.applyAmount) < 0) {
  320. this.exceed = true;
  321. } else {
  322. this.exceed = false;
  323. }
  324. } else {
  325. this.exceed = false;
  326. }
  327. let borrow = await listBorrow({ projectId: this.form.projectId })
  328. if (borrow.total != 0) {
  329. let borrowList = borrow.rows;
  330. let hasBorrow = 0;
  331. borrowList = borrowList.filter(item => item.borrowId != this.taskForm.formId)
  332. borrowList.forEach(element => {
  333. if (element.managerAmount) {
  334. hasBorrow = hasBorrow + element.managerAmount
  335. }
  336. if (!element.managerAmount && element.applyAmount) {
  337. hasBorrow = hasBorrow + element.applyAmount
  338. }
  339. });
  340. this.hasBorrow = hasBorrow
  341. }
  342. this.getMoreAmount();
  343. },
  344. hanldeChangeType() {
  345. if (this.form.borrowUsage == '2') {
  346. this.dgtLabel = '工会审核意见'
  347. } else if (this.form.borrowUsage == '3') {
  348. this.dgtLabel = '党委审核意见'
  349. } else {
  350. this.dgtLabel = '团委审核意见'
  351. }
  352. },
  353. // 计算超过预算的金额
  354. getMoreAmount(type) {
  355. let result;
  356. if (type == '0') {
  357. result = this.form.applyAmount - (this.siteExpenses - this.hasBorrow);
  358. } else {
  359. result = this.form.managerAmount - (this.siteExpenses - this.hasBorrow);
  360. }
  361. return result.toFixed(2)
  362. },
  363. setApplyAmount(val) {
  364. this.form.applyAmount = val
  365. },
  366. setManagerAmount(val) {
  367. this.form.managerAmount = val
  368. },
  369. handleConfirm(project) {
  370. this.selectedProject = project;
  371. this.projectObj = project;
  372. this.form.projectId = project.projectId;
  373. this.getMaxExpense();
  374. },
  375. // 保存
  376. async saves() {
  377. if (this.formTotal == 0) {
  378. this.form.borrowId = this.taskForm.formId;
  379. await addBorrow(this.form)
  380. this.initForm();
  381. } else {
  382. // 更新借款审批表
  383. await updateBorrow(this.form);
  384. }
  385. this.$modal.msgSuccess('保存成功');
  386. },
  387. submit() {
  388. // 显示确认提交对话框
  389. uni.showModal({
  390. title: '提示',
  391. content: '确认提交吗?',
  392. success: (res) => {
  393. if (!res.confirm) {
  394. return;
  395. }
  396. // 继续执行后续代码
  397. this.handleSubmit();
  398. }
  399. });
  400. },
  401. // 处理提交逻辑
  402. handleSubmit() {
  403. this.$refs.form.validate().then(async res => {
  404. if (this.formTotal != 0) {
  405. // 定义审核节点配置
  406. const auditConfig = {
  407. '部门审核': {
  408. userIdField: 'deptUserId',
  409. timeField: 'deptTime'
  410. },
  411. '分管审核': {
  412. userIdField: 'managerUserId',
  413. timeField: 'managerTime'
  414. },
  415. '总经理审核': {
  416. userIdField: 'zjlUserId',
  417. timeField: 'zjlTime'
  418. },
  419. '董事长批准': {
  420. userIdField: 'dszUserId',
  421. timeField: 'dszTime'
  422. },
  423. '党工团审核': {
  424. userIdField: 'unionUserId',
  425. timeField: 'unionTime'
  426. },
  427. '财务处理': {
  428. userIdField: 'cwUserId',
  429. timeField: 'lendTime'
  430. }
  431. }
  432. // 根据当前节点更新审核信息
  433. const currentConfig = auditConfig[this.taskName]
  434. if (currentConfig) {
  435. const currentUserId = this.$store.getters.userId
  436. const currentTime = parseTime(new Date(), '{y}-{m}-{d}')
  437. // 设置审核人和审核时间
  438. this.form[currentConfig.userIdField] = currentUserId
  439. this.form[currentConfig.timeField] = currentTime
  440. }
  441. // 更新借款申请
  442. await updateBorrow(this.form);
  443. const params = { taskId: this.taskForm.taskId };
  444. getNextFlowNode(params).then(async res => {
  445. // 处理不同的流程节点
  446. if (this.taskName == '借款申请') {
  447. // 处理借款申请节点
  448. await this.borrowApprovalFun();
  449. } else if (this.taskName == '部门审核') {
  450. // 得到分管领导根据部门
  451. const res = await getUsersManageLeaderByDept({ deptId: this.form.applyDept });
  452. let userIds = [];
  453. if (res.data) {
  454. res.data.forEach(item => {
  455. userIds.push(item.userId)
  456. })
  457. }
  458. this.taskForm.variables.approvalList = userIds;
  459. this.handleComplete(this.taskForm);
  460. } else if (this.taskName == '分管审核') {
  461. // 得到总经理
  462. const res = await getUserByPost({ postName: '总经理' });
  463. this.taskForm.variables.approval = res.data[0].userId;
  464. this.handleComplete(this.taskForm);
  465. } else if (this.taskName == '总经理审核') {
  466. this.exceed = false;
  467. this.taskForm.variables.exceed = this.exceed;
  468. if (!this.exceed) {
  469. this.submitFD(); // 提交给财务部门
  470. } else {
  471. const res = await getUserByPost({ postName: '董事长' });
  472. this.taskForm.variables.approval = res.data[0].userId;
  473. this.handleComplete(this.taskForm);
  474. }
  475. } else if (this.taskName == '董事长批准' || this.taskName == '党工团审核') {
  476. this.submitFD(); // 提交给财务部门
  477. } else if (this.taskName == '财务处理') {
  478. uni.showModal({
  479. title: '提示',
  480. content: '最后一个节点,提交将结束流程,是否提交?',
  481. success: (res) => {
  482. if (res.confirm) {
  483. this.handleComplete(this.taskForm);
  484. }
  485. }
  486. });
  487. }
  488. })
  489. }
  490. }).catch(err => {
  491. console.log('表单错误信息:', err);
  492. })
  493. },
  494. // 处理任务完成
  495. handleComplete(taskForm) {
  496. complete(taskForm).then(response => {
  497. this.$modal.msgSuccess(response.msg);
  498. this.goHome();
  499. })
  500. },
  501. // 借款申请提交方法
  502. async borrowApprovalFun() {
  503. let userId;
  504. if (this.form.borrowUsage == '2' || this.form.borrowUsage == '3' || this.form.borrowUsage == '4') {
  505. this.deptId = 0;
  506. }
  507. // 如果是党工团申请 deptId == 0 为党工团申请
  508. if (this.deptId === 0) {
  509. // 2为工会、3为党委
  510. if (this.form.borrowUsage == 2 || this.form.borrowUsage == 3) {
  511. const res = await getUserByPost({ postName: '党总支书记' });
  512. userId = res.data[0].userId;
  513. } else {
  514. const res = await getUserByPost({ postName: '团委书记' });
  515. userId = res.data[0].userId;
  516. }
  517. this.taskForm.variables.dept = this.deptId;
  518. this.taskForm.variables.approval = userId;
  519. this.handleComplete(this.taskForm);
  520. }
  521. else if (this.deptId == 102) { //如果是经营管理层申请,走总经理审批
  522. this.form.managerAmount = this.form.applyAmount;
  523. await updateBorrow(this.form);
  524. const res = await getUserByPost({ postName: '总经理' });
  525. this.taskForm.variables.dept = this.deptId;
  526. this.taskForm.variables.approval = res.data[0].userId;
  527. this.handleComplete(this.taskForm);
  528. } else if (this.deptId == 101) { //如果是董事会申请,走董事长批准
  529. const res = await getUserByPost({ postName: '董事长' });
  530. this.taskForm.variables.dept = this.deptId;
  531. this.taskForm.variables.approval = res.data[0].userId;
  532. this.taskForm.variables.exceed = true;
  533. this.handleComplete(this.taskForm);
  534. } else { //普通员工申请项目借款
  535. const res = await getUsersDeptLeader({ userId: this.$store.getters.userId });
  536. let userId = res.data.userId;
  537. this.taskForm.variables.approval = userId;
  538. this.taskForm.variables.dept = this.deptId;
  539. this.handleComplete(this.taskForm);
  540. }
  541. },
  542. // 提交给财务部审核
  543. async submitFD() {
  544. let approvalList = [];
  545. const res = await getUsersDeptLeaderByDept({ deptId: 106 });
  546. approvalList.push(res.data.userId);
  547. const res1 = await getUsersViceDeptLeaderByDept({ deptId: 106 });
  548. approvalList.push(res1.data.userId);
  549. this.taskForm.variables.approvalList = approvalList;
  550. this.handleComplete(this.taskForm);
  551. },
  552. commentByRole() {
  553. if (this.taskName == '部门审核') {
  554. return this.form.deptComment
  555. } else if (this.taskName == '分管审核') {
  556. return this.form.managerComment
  557. } else if (this.taskName == '总经理审核') {
  558. return this.form.zjlComment
  559. } else if (this.taskName == '董事长批准') {
  560. return this.form.dszComment
  561. } else if (this.taskName == '党工团审核') {
  562. return this.form.unionComment
  563. } else if (this.taskName == '财务处理') {
  564. return this.form.cwComment
  565. }
  566. },
  567. goHome() {
  568. uni.switchTab({
  569. url: '/pages/message/index'
  570. })
  571. },
  572. uploadSuccess(fileName) {
  573. this.form.borrowDocument = fileName
  574. updateBorrow(this.form)
  575. }
  576. },
  577. }
  578. </script>
  579. <style lang="scss" scoped>
  580. .amount-text {
  581. font-size: 16px;
  582. font-weight: bold;
  583. color: #333;
  584. text-align: right;
  585. }
  586. .warning-text {
  587. font-size: 14px;
  588. color: #ff0000;
  589. margin-top: 5px;
  590. text-align: right;
  591. }
  592. .form-button {
  593. display: flex;
  594. }
  595. .example-body {
  596. padding: 10px;
  597. background-color: #fff;
  598. }
  599. </style>