index.vue 39 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340
  1. <template>
  2. <div class="tenant">
  3. <div class="content">
  4. <byTable
  5. :source="sourceList.data"
  6. :pagination="sourceList.pagination"
  7. :config="config"
  8. :loading="loading"
  9. highlight-current-row
  10. :selectConfig="selectConfig"
  11. :action-list="[
  12. {
  13. text: '发起请款',
  14. action: () => openModal(),
  15. },
  16. ]"
  17. @moreSearch="moreSearch"
  18. @get-list="getList"
  19. >
  20. <template #total="{ item }">
  21. <div style="width: 100%">
  22. <a
  23. style="color: #409eff; cursor: pointer"
  24. @click="pushProcessApproval(item)"
  25. >{{ item.currency }}{{ item.total }}</a
  26. >
  27. </div>
  28. </template>
  29. <template #type="{ item }">
  30. <div style="width: 100%">
  31. <span>
  32. {{ dictValueLabel(item.type, fundsType) }}
  33. </span>
  34. <span v-if="item.type == 1"
  35. >(<span v-if="item.writeOffStatus == 0">未核销</span
  36. ><span v-if="item.writeOffStatus == 1">已核销</span>)</span
  37. >
  38. </div>
  39. </template>
  40. </byTable>
  41. </div>
  42. <el-dialog title="打印" v-if="openPrint" v-model="openPrint" width="840px">
  43. <div id="pdfDom" style="width: 776px">
  44. <div
  45. style="padding: 60px 30px; font-size: 12px !important; color: black"
  46. >
  47. <div style="font-size: 16px; text-align: center; padding: 8px">
  48. <span
  49. >{{ dictValueLabel(printDetails.type, fundsType) }}审批单</span
  50. >
  51. </div>
  52. <div style="padding: 8px 0">
  53. <span>{{ printDetails.corporationName }}</span>
  54. <span style="padding-left: 32px"
  55. >创建时间: {{ printDetails.createTime }}</span
  56. >
  57. </div>
  58. <div style="border: 1px solid black">
  59. <div style="display: flex; border-bottom: 1px solid black">
  60. <div
  61. style="
  62. width: 126px;
  63. border-right: 1px solid black;
  64. padding: 8px;
  65. "
  66. >
  67. 创建人
  68. </div>
  69. <div style="width: calc(100% - 126px); padding: 8px">
  70. {{ dictValueLabel(printDetails.createUser, userList) }}
  71. </div>
  72. </div>
  73. <div style="display: flex; border-bottom: 1px solid black">
  74. <div
  75. style="
  76. width: 126px;
  77. border-right: 1px solid black;
  78. padding: 8px;
  79. "
  80. >
  81. 创建人部门
  82. </div>
  83. <div style="width: calc(100% - 126px); padding: 8px">
  84. {{ printDetails.deptName }}
  85. </div>
  86. </div>
  87. <div
  88. style="display: flex; border-bottom: 1px solid black"
  89. v-if="printDetails.type !== '3'"
  90. >
  91. <div
  92. style="
  93. width: 126px;
  94. border-right: 1px solid black;
  95. padding: 4px 8px;
  96. display: flex;
  97. align-items: center;
  98. "
  99. >
  100. 费用明细
  101. </div>
  102. <div style="width: calc(100% - 126px)">
  103. <div style="border-bottom: 1px solid black; display: flex">
  104. <div
  105. style="
  106. width: 80px;
  107. padding: 4px 8px;
  108. border-right: 1px solid black;
  109. text-align: center;
  110. "
  111. >
  112. 费用类型
  113. </div>
  114. <div
  115. style="
  116. width: 120px;
  117. padding: 4px 8px;
  118. border-right: 1px solid black;
  119. text-align: center;
  120. "
  121. >
  122. 关联合同
  123. </div>
  124. <div
  125. style="
  126. width: calc(100% - 360px);
  127. padding: 4px 8px;
  128. border-right: 1px solid black;
  129. text-align: center;
  130. "
  131. >
  132. 款项说明
  133. </div>
  134. <div
  135. style="
  136. width: 60px;
  137. padding: 4px 8px;
  138. border-right: 1px solid black;
  139. text-align: center;
  140. "
  141. >
  142. 货币
  143. </div>
  144. <div
  145. style="width: 100px; padding: 4px 8px; text-align: center"
  146. >
  147. 付款金额
  148. </div>
  149. </div>
  150. <template
  151. v-if="
  152. printDetails.accountRequestFundsDetailList &&
  153. printDetails.accountRequestFundsDetailList.length > 0
  154. "
  155. >
  156. <div
  157. v-for="(
  158. item, index
  159. ) in printDetails.accountRequestFundsDetailList"
  160. :key="index"
  161. >
  162. <div
  163. :style="
  164. index + 1 !==
  165. printDetails.accountRequestFundsDetailList.length
  166. ? 'border-bottom: 1px solid black; display: flex'
  167. : ' display: flex'
  168. "
  169. >
  170. <div
  171. style="
  172. width: 80px;
  173. padding: 4px 8px;
  174. border-right: 1px solid black;
  175. text-align: center;
  176. "
  177. >
  178. {{ dictValueLabel(item.costType, fundsCostType) }}
  179. </div>
  180. <div
  181. style="
  182. width: 120px;
  183. padding: 4px 8px;
  184. border-right: 1px solid black;
  185. display: flex;
  186. align-items: center;
  187. "
  188. >
  189. {{ item.contractCode }}
  190. </div>
  191. <div
  192. style="
  193. width: calc(100% - 360px);
  194. padding: 4px 8px;
  195. border-right: 1px solid black;
  196. display: flex;
  197. align-items: center;
  198. "
  199. >
  200. {{ item.remarks }}
  201. </div>
  202. <div
  203. style="
  204. width: 60px;
  205. padding: 4px 8px;
  206. border-right: 1px solid black;
  207. display: flex;
  208. align-items: center;
  209. "
  210. >
  211. {{
  212. dictValueLabel(printDetails.currency, accountCurrency)
  213. }}
  214. </div>
  215. <div
  216. style="
  217. width: 100px;
  218. padding: 4px 8px;
  219. display: flex;
  220. align-items: center;
  221. "
  222. >
  223. {{ item.amount }}
  224. </div>
  225. </div>
  226. </div>
  227. </template>
  228. </div>
  229. </div>
  230. <div style="display: flex; border-bottom: 1px solid black" v-else>
  231. <div
  232. style="
  233. width: 126px;
  234. border-right: 1px solid black;
  235. padding: 4px 8px;
  236. display: flex;
  237. align-items: center;
  238. "
  239. >
  240. 费用明细
  241. </div>
  242. <div style="width: calc(100% - 126px)">
  243. <div style="border-bottom: 1px solid black; display: flex">
  244. <div
  245. style="
  246. width: 80px;
  247. padding: 4px 8px;
  248. border-right: 1px solid black;
  249. text-align: center;
  250. "
  251. >
  252. 费用类型
  253. </div>
  254. <div
  255. style="
  256. width: 120px;
  257. padding: 4px 8px;
  258. border-right: 1px solid black;
  259. text-align: center;
  260. "
  261. >
  262. 关联合同
  263. </div>
  264. <div
  265. style="
  266. width: calc(100% - 420px);
  267. padding: 4px 8px;
  268. border-right: 1px solid black;
  269. text-align: center;
  270. "
  271. >
  272. 款项说明
  273. </div>
  274. <div
  275. style="
  276. width: 60px;
  277. padding: 4px 8px;
  278. border-right: 1px solid black;
  279. text-align: center;
  280. "
  281. >
  282. 货币
  283. </div>
  284. <div
  285. style="
  286. width: 80px;
  287. padding: 4px 8px;
  288. border-right: 1px solid black;
  289. text-align: center;
  290. "
  291. >
  292. 预支金额
  293. </div>
  294. <div
  295. style="width: 80px; padding: 4px 8px; text-align: center"
  296. >
  297. 付款金额
  298. </div>
  299. </div>
  300. <template
  301. v-if="
  302. printDetails.accountRequestFundsDetailList &&
  303. printDetails.accountRequestFundsDetailList.length > 0
  304. "
  305. >
  306. <div
  307. v-for="(
  308. item, index
  309. ) in printDetails.accountRequestFundsDetailList"
  310. :key="index"
  311. >
  312. <div
  313. :style="
  314. index + 1 !==
  315. printDetails.accountRequestFundsDetailList.length
  316. ? 'border-bottom: 1px solid black; display: flex'
  317. : ' display: flex'
  318. "
  319. >
  320. <div
  321. style="
  322. width: 80px;
  323. padding: 4px 8px;
  324. border-right: 1px solid black;
  325. text-align: center;
  326. "
  327. >
  328. {{ dictValueLabel(item.costType, fundsCostType) }}
  329. </div>
  330. <div
  331. style="
  332. width: 120px;
  333. padding: 4px 8px;
  334. border-right: 1px solid black;
  335. display: flex;
  336. align-items: center;
  337. "
  338. >
  339. {{ item.contractCode }}
  340. </div>
  341. <div
  342. style="
  343. width: calc(100% - 420px);
  344. padding: 4px 8px;
  345. border-right: 1px solid black;
  346. display: flex;
  347. align-items: center;
  348. "
  349. >
  350. {{ item.remarks }}
  351. </div>
  352. <div
  353. style="
  354. width: 60px;
  355. padding: 4px 8px;
  356. border-right: 1px solid black;
  357. display: flex;
  358. align-items: center;
  359. "
  360. >
  361. {{
  362. dictValueLabel(printDetails.currency, accountCurrency)
  363. }}
  364. </div>
  365. <div
  366. style="
  367. width: 80px;
  368. padding: 4px 8px;
  369. border-right: 1px solid black;
  370. display: flex;
  371. align-items: center;
  372. "
  373. >
  374. {{ item.advanceAmount }}
  375. </div>
  376. <div
  377. style="
  378. width: 80px;
  379. padding: 4px 8px;
  380. display: flex;
  381. align-items: center;
  382. "
  383. >
  384. {{ item.amount }}
  385. </div>
  386. </div>
  387. </div>
  388. </template>
  389. </div>
  390. </div>
  391. <div
  392. style="display: flex; border-bottom: 1px solid black"
  393. v-if="printDetails.type !== '3'"
  394. >
  395. <div
  396. style="
  397. width: 126px;
  398. border-right: 1px solid black;
  399. padding: 8px;
  400. "
  401. >
  402. 总报销金额
  403. </div>
  404. <div style="width: calc(100% - 126px); display: flex">
  405. <div
  406. style="
  407. width: calc(100% - 100px);
  408. padding: 8px;
  409. border-right: 1px solid black;
  410. "
  411. >
  412. {{ NumberToChinese(computeMoney("amount")) }}
  413. </div>
  414. <div style="width: 100px; padding: 8px">
  415. {{ computeMoney("amount") }}
  416. </div>
  417. </div>
  418. </div>
  419. <div v-else>
  420. <div style="display: flex; border-bottom: 1px solid black">
  421. <div
  422. style="
  423. width: 126px;
  424. border-right: 1px solid black;
  425. padding: 8px;
  426. "
  427. >
  428. 核销总金额
  429. </div>
  430. <div style="width: calc(100% - 126px); display: flex">
  431. <div
  432. style="
  433. width: calc(100% - 80px);
  434. padding: 8px;
  435. border-right: 1px solid black;
  436. "
  437. >
  438. {{ NumberToChinese(computeMoney("amount")) }}
  439. </div>
  440. <div style="width: 80px; padding: 8px">
  441. {{ computeMoney("amount") }}
  442. </div>
  443. </div>
  444. </div>
  445. <div style="display: flex; border-bottom: 1px solid black">
  446. <div
  447. style="
  448. width: 126px;
  449. border-right: 1px solid black;
  450. padding: 8px;
  451. "
  452. >
  453. 预支总金额
  454. </div>
  455. <div style="width: calc(100% - 126px); display: flex">
  456. <div
  457. style="
  458. width: calc(100% - 80px);
  459. padding: 8px;
  460. border-right: 1px solid black;
  461. "
  462. >
  463. {{ NumberToChinese(computeMoney("advanceAmount")) }}
  464. </div>
  465. <div style="width: 80px; padding: 8px">
  466. {{ computeMoney("advanceAmount") }}
  467. </div>
  468. </div>
  469. </div>
  470. <div style="display: flex; border-bottom: 1px solid black">
  471. <div
  472. style="
  473. width: 126px;
  474. border-right: 1px solid black;
  475. padding: 8px;
  476. "
  477. >
  478. 差额 (核销 - 预支)
  479. </div>
  480. <div style="width: calc(100% - 126px); display: flex">
  481. <div
  482. style="
  483. width: calc(100% - 80px);
  484. padding: 8px;
  485. border-right: 1px solid black;
  486. "
  487. >
  488. {{ NumberToChinese(computeBalance()) }}
  489. </div>
  490. <div style="width: 80px; padding: 8px">
  491. {{ computeBalance() }}
  492. </div>
  493. </div>
  494. </div>
  495. </div>
  496. <div style="display: flex; border-bottom: 1px solid black">
  497. <div
  498. style="
  499. width: 126px;
  500. border-right: 1px solid black;
  501. padding: 8px;
  502. "
  503. >
  504. 单据数量
  505. </div>
  506. <div style="width: calc(100% - 126px); padding: 8px">
  507. {{ printDetails.quantity }}
  508. </div>
  509. </div>
  510. <div style="display: flex; border-bottom: 1px solid black">
  511. <div
  512. style="
  513. width: 126px;
  514. border-right: 1px solid black;
  515. padding: 0 8px;
  516. display: flex;
  517. align-items: center;
  518. "
  519. >
  520. 收款信息
  521. </div>
  522. <div style="width: calc(100% - 126px)">
  523. <div style="border-bottom: 1px solid black; display: flex">
  524. <div
  525. style="
  526. width: 19%;
  527. padding: 0 8px;
  528. border-right: 1px solid black;
  529. text-align: center;
  530. "
  531. >
  532. 支付方式
  533. </div>
  534. <div
  535. style="
  536. width: 27%;
  537. padding: 0 8px;
  538. border-right: 1px solid black;
  539. text-align: center;
  540. "
  541. >
  542. 收款方户名
  543. </div>
  544. <div
  545. style="
  546. width: 27%;
  547. padding: 0 8px;
  548. border-right: 1px solid black;
  549. text-align: center;
  550. "
  551. >
  552. 开户行
  553. </div>
  554. <div style="width: 27%; padding: 0 8px; text-align: center">
  555. 收款方账号
  556. </div>
  557. </div>
  558. <div style="display: flex">
  559. <div
  560. style="
  561. width: 19%;
  562. padding: 0 8px;
  563. border-right: 1px solid black;
  564. display: flex;
  565. align-items: center;
  566. "
  567. >
  568. {{
  569. dictValueLabel(
  570. printDetails.paymentMethod,
  571. fundsPaymentMethod
  572. )
  573. }}
  574. </div>
  575. <div
  576. style="
  577. width: 27%;
  578. padding: 0 8px;
  579. border-right: 1px solid black;
  580. display: flex;
  581. align-items: center;
  582. "
  583. >
  584. {{ printDetails.name }}
  585. </div>
  586. <div
  587. style="
  588. width: 27%;
  589. padding: 0 8px;
  590. border-right: 1px solid black;
  591. display: flex;
  592. align-items: center;
  593. "
  594. >
  595. {{ printDetails.openingBank }}
  596. </div>
  597. <div
  598. style="
  599. width: 27%;
  600. padding: 0 8px;
  601. display: flex;
  602. align-items: center;
  603. "
  604. >
  605. {{ printDetails.accountOpening }}
  606. </div>
  607. </div>
  608. </div>
  609. </div>
  610. <div style="display: flex; border-bottom: 1px solid black">
  611. <div
  612. style="
  613. width: 126px;
  614. border-right: 1px solid black;
  615. padding: 8px;
  616. "
  617. >
  618. 电子发票(PDF/JPG)
  619. </div>
  620. <div style="width: calc(100% - 126px); padding: 8px">
  621. {{ printDetails.electronicInvoiceText }}
  622. </div>
  623. </div>
  624. <div style="display: flex">
  625. <div
  626. style="
  627. width: 126px;
  628. border-right: 1px solid black;
  629. padding: 4px 8px;
  630. display: flex;
  631. align-items: center;
  632. "
  633. >
  634. 审批流程
  635. </div>
  636. <div style="width: calc(100% - 126px)">
  637. <template
  638. v-if="
  639. printDetails.recordList &&
  640. printDetails.recordList.length > 0
  641. "
  642. >
  643. <div
  644. v-for="(item, index) in printDetails.recordList"
  645. :key="index"
  646. >
  647. <div
  648. :style="
  649. index + 1 !== printDetails.recordList.length
  650. ? 'border-bottom: 1px solid black; padding: 4px 8px; display: flex'
  651. : 'padding: 4px 8px; display: flex'
  652. "
  653. >
  654. <div
  655. style="width: calc(100% - 120px); word-wrap: break-word"
  656. >
  657. <span>{{ item.nodeName }}: </span>
  658. <span style="padding-left: 4px">{{
  659. item.processedUser
  660. }}</span>
  661. <span style="padding-left: 4px">{{ item.remark }}</span>
  662. </div>
  663. <div style="width: 120px">{{ item.processedDate }}</div>
  664. </div>
  665. </div>
  666. </template>
  667. </div>
  668. </div>
  669. </div>
  670. <div style="padding-top: 16px">
  671. <span>打印时间: {{ presentTime }}</span>
  672. <span style="padding-left: 32px"
  673. >打印人: {{ useUserStore().user.nickName }}</span
  674. >
  675. </div>
  676. </div>
  677. </div>
  678. <template #footer>
  679. <el-button @click="openPrint = false" size="large">取消</el-button>
  680. <el-button type="primary" @click="clickDownload()" size="large"
  681. >下载PDF</el-button
  682. >
  683. </template>
  684. </el-dialog>
  685. <el-dialog
  686. title="高级检索"
  687. v-if="openSearch"
  688. v-model="openSearch"
  689. width="600"
  690. :before-close="cancelSearch"
  691. >
  692. <byForm
  693. :formConfig="formSearchConfig"
  694. :formOption="formOption"
  695. v-model="sourceList.pagination"
  696. >
  697. <template #departmentId>
  698. <div>
  699. <el-tree-select
  700. v-model="sourceList.pagination.departmentId"
  701. :data="deptTreeData"
  702. check-strictly
  703. :render-after-expand="false"
  704. node-key="deptId"
  705. style="width: 100%"
  706. :props="defaultProps"
  707. clearable
  708. />
  709. </div>
  710. </template>
  711. <template #time>
  712. <div style="width: 100%">
  713. <el-row :gutter="10">
  714. <el-col :span="11">
  715. <el-date-picker
  716. v-model="sourceList.pagination.beginTime"
  717. type="datetime"
  718. placeholder="请选择"
  719. style="width: 100%"
  720. value-format="YYYY-MM-DD HH:mm:ss"
  721. />
  722. </el-col>
  723. <el-col :span="2" style="text-align: center">到</el-col>
  724. <el-col :span="11">
  725. <el-date-picker
  726. v-model="sourceList.pagination.endTime"
  727. type="datetime"
  728. placeholder="请选择"
  729. style="width: 100%"
  730. value-format="YYYY-MM-DD HH:mm:ss"
  731. />
  732. </el-col>
  733. </el-row>
  734. </div>
  735. </template>
  736. <template #money>
  737. <div style="width: 100%">
  738. <el-row :gutter="10">
  739. <el-col :span="11">
  740. <el-input-number
  741. onmousewheel="return false;"
  742. v-model="sourceList.pagination.minAdvanceAmounts"
  743. placeholder="请输入"
  744. style="width: 100%"
  745. :precision="2"
  746. :controls="false"
  747. :min="0"
  748. />
  749. </el-col>
  750. <el-col :span="2" style="text-align: center">到</el-col>
  751. <el-col :span="11">
  752. <el-input-number
  753. onmousewheel="return false;"
  754. v-model="sourceList.pagination.maxAdvanceAmounts"
  755. placeholder="请输入"
  756. style="width: 100%"
  757. :precision="2"
  758. :controls="false"
  759. :min="0"
  760. />
  761. </el-col>
  762. </el-row>
  763. </div>
  764. </template>
  765. </byForm>
  766. <template #footer>
  767. <el-button @click="cancelSearch()" size="large">取 消</el-button>
  768. <el-button type="primary" @click="submitSearch()" size="large"
  769. >确 定</el-button
  770. >
  771. </template>
  772. </el-dialog>
  773. </div>
  774. </template>
  775. <script setup>
  776. import byTable from "@/components/byTable/index";
  777. import useUserStore from "@/store/modules/user";
  778. import { ref } from "vue";
  779. import moment from "moment";
  780. import byForm from "@/components/byForm/index";
  781. import { NumberToChinese } from "@/utils/util.js";
  782. const loading = ref(false);
  783. const sourceList = ref({
  784. data: [],
  785. pagination: {
  786. total: 0,
  787. pageNum: 1,
  788. pageSize: 10,
  789. type: "",
  790. keyword: "",
  791. writeOffStatus: "",
  792. corporationId: "",
  793. departmentId: "",
  794. createUser: "",
  795. currency: "",
  796. beginTime: "",
  797. endTime: "",
  798. minAdvanceAmounts: undefined,
  799. maxAdvanceAmounts: undefined,
  800. paymentRemarks: "",
  801. paymentMethod: "",
  802. status: "",
  803. paymentStatus: "",
  804. },
  805. });
  806. const { proxy } = getCurrentInstance();
  807. const fundsType = ref([]);
  808. const accountData = ref([]);
  809. const userList = ref([]);
  810. const companyData = ref([]);
  811. const accountCurrency = ref([]);
  812. const fundsCostType = ref([]);
  813. const fundsPaymentMethod = ref([]);
  814. const deptTreeData = ref([]);
  815. const status = ref([
  816. {
  817. label: "审批中",
  818. value: "10",
  819. },
  820. {
  821. label: "驳回",
  822. value: "20",
  823. },
  824. {
  825. label: "审批通过",
  826. value: "30",
  827. },
  828. ]);
  829. const paymentStatus = ref([
  830. {
  831. label: "已打款",
  832. value: "10",
  833. },
  834. {
  835. label: "未打款",
  836. value: "20",
  837. },
  838. ]);
  839. const selectConfig = computed(() => {
  840. return [
  841. {
  842. label: "类型",
  843. prop: "type",
  844. data: fundsType.value,
  845. },
  846. {
  847. label: "审批状态",
  848. prop: "status",
  849. data: status.value,
  850. },
  851. {
  852. label: "放款状态",
  853. prop: "paymentStatus",
  854. data: paymentStatus.value,
  855. },
  856. ];
  857. });
  858. const config = computed(() => {
  859. return [
  860. {
  861. attrs: {
  862. label: "归属公司",
  863. prop: "corporationName",
  864. width: 180,
  865. },
  866. },
  867. {
  868. attrs: {
  869. label: "归属部门",
  870. prop: "deptName",
  871. width: 140,
  872. },
  873. },
  874. {
  875. attrs: {
  876. label: "请款类型",
  877. prop: "type",
  878. width: 130,
  879. slot: "type",
  880. },
  881. // render(type) {
  882. // return proxy.dictValueLabel(type, fundsType.value);
  883. // },
  884. },
  885. {
  886. attrs: {
  887. label: "请款人",
  888. prop: "userName",
  889. width: 120,
  890. },
  891. },
  892. {
  893. attrs: {
  894. label: "请款时间",
  895. prop: "createTime",
  896. width: 160,
  897. },
  898. },
  899. {
  900. attrs: {
  901. label: "请款金额",
  902. slot: "total",
  903. width: 120,
  904. },
  905. },
  906. {
  907. attrs: {
  908. label: "用款说明",
  909. prop: "paymentRemarks",
  910. 'min-width': 180
  911. },
  912. },
  913. {
  914. attrs: {
  915. label: "付款方式",
  916. prop: "paymentMethod",
  917. width: 120,
  918. },
  919. render(paymentMethod) {
  920. return proxy.dictValueLabel(paymentMethod, fundsPaymentMethod.value);
  921. },
  922. },
  923. {
  924. attrs: {
  925. label: "付款账户",
  926. prop: "accountManagementName",
  927. width: 160,
  928. },
  929. },
  930. {
  931. attrs: {
  932. label: "审批状态",
  933. prop: "status",
  934. width: 120,
  935. },
  936. render(status) {
  937. return status == 10
  938. ? "审批中"
  939. : status == 20
  940. ? "驳回"
  941. : status == 30
  942. ? "审批通过"
  943. : "";
  944. },
  945. },
  946. {
  947. attrs: {
  948. label: "放款状态",
  949. prop: "accountPaymentStatus",
  950. width: 120,
  951. },
  952. render(status) {
  953. return proxy.dictValueLabel(status, paymentStatus.value);
  954. },
  955. },
  956. {
  957. attrs: {
  958. label: "操作",
  959. width: "120",
  960. align: "center",
  961. fixed: "right",
  962. },
  963. renderHTML(row) {
  964. return [
  965. row.type == 1 && row.writeOffStatus == 0 && row.status == '30'
  966. ? {
  967. attrs: {
  968. label: "核销",
  969. type: "primary",
  970. text: true,
  971. },
  972. el: "button",
  973. click() {
  974. openModal(row);
  975. },
  976. }
  977. : {},
  978. {
  979. attrs: {
  980. label: "打印",
  981. type: "primary",
  982. text: true,
  983. },
  984. el: "button",
  985. click() {
  986. clickPrint(row);
  987. },
  988. },
  989. ];
  990. },
  991. },
  992. ];
  993. });
  994. const getList = async (req) => {
  995. sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
  996. loading.value = true;
  997. proxy
  998. .post("/accountRequestFunds/page", sourceList.value.pagination)
  999. .then((message) => {
  1000. sourceList.value.data = message.rows;
  1001. sourceList.value.pagination.total = message.total;
  1002. setTimeout(() => {
  1003. loading.value = false;
  1004. }, 200);
  1005. });
  1006. };
  1007. const openModal = (row = {}) => {
  1008. const flowName = `${userInfo.nickName}的请款申请(发起)`;
  1009. let query = {
  1010. flowKey: "account_request_funds_flow",
  1011. random: proxy.random(),
  1012. flowName,
  1013. };
  1014. if (row.id) {
  1015. query.advanceId = row.id;
  1016. query.corporationId = row.corporationId;
  1017. }
  1018. proxy.$router.replace({
  1019. path: "/platform_manage/process/processApproval",
  1020. query,
  1021. });
  1022. };
  1023. const userInfo = useUserStore().user;
  1024. const recursive = (data) => {
  1025. data.map((item) => {
  1026. item.label = item.deptName;
  1027. item.id = item.corporationId;
  1028. if (item.children) {
  1029. recursive(item.children);
  1030. } else {
  1031. item.children = [];
  1032. }
  1033. });
  1034. };
  1035. const getDictData = () => {
  1036. proxy
  1037. .getDictOne([
  1038. "founds_type",
  1039. "funds_payment_method",
  1040. "account_currency",
  1041. "funds_cost_type",
  1042. ])
  1043. .then((res) => {
  1044. fundsType.value = res["founds_type"].map((x) => ({
  1045. label: x.dictValue,
  1046. value: x.dictKey,
  1047. }));
  1048. fundsPaymentMethod.value = res["funds_payment_method"].map((x) => ({
  1049. label: x.dictValue,
  1050. value: x.dictKey,
  1051. }));
  1052. accountCurrency.value = res["account_currency"].map((x) => ({
  1053. label: x.dictValue,
  1054. value: x.dictKey,
  1055. }));
  1056. fundsCostType.value = res["funds_cost_type"].map((x) => ({
  1057. label: x.dictValue,
  1058. value: x.dictKey,
  1059. }));
  1060. });
  1061. proxy
  1062. .post("/accountManagement/page", { pageNum: 1, pageSize: 9999 })
  1063. .then((res) => {
  1064. accountData.value = res.rows.map((item) => {
  1065. return {
  1066. ...item,
  1067. label: item.alias,
  1068. value: item.id,
  1069. };
  1070. });
  1071. });
  1072. proxy
  1073. .get("/tenantUser/list", {
  1074. pageNum: 1,
  1075. pageSize: 10000,
  1076. tenantId: useUserStore().user.tenantId,
  1077. })
  1078. .then((res) => {
  1079. if (res.rows && res.rows.length > 0) {
  1080. userList.value = res.rows.map((item) => {
  1081. return {
  1082. deptId: item.deptId,
  1083. label: item.nickName,
  1084. value: item.userId,
  1085. };
  1086. });
  1087. }
  1088. });
  1089. proxy
  1090. .post("/corporation/page", { pageNum: 1, pageSize: 9999 })
  1091. .then((res) => {
  1092. if (res.rows && res.rows.length > 0) {
  1093. companyData.value = res.rows.map((item) => {
  1094. return {
  1095. label: item.name,
  1096. value: item.id,
  1097. };
  1098. });
  1099. }
  1100. });
  1101. proxy
  1102. .get("/tenantDept/list", {
  1103. pageNum: 1,
  1104. pageSize: 9999,
  1105. tenantId: userInfo.tenantId,
  1106. })
  1107. .then((message) => {
  1108. recursive(message.data);
  1109. deptTreeData.value = [];
  1110. let data = proxy.handleTree(message.data, "deptId");
  1111. if (data && data.length > 0) {
  1112. for (let i = 0; i < data.length; i++) {
  1113. if (data[i].children && data[i].children.length > 0) {
  1114. deptTreeData.value = deptTreeData.value.concat(data[i].children);
  1115. }
  1116. }
  1117. }
  1118. });
  1119. };
  1120. getDictData();
  1121. getList();
  1122. const openPrint = ref(false);
  1123. const printDetails = ref({});
  1124. const presentTime = ref("");
  1125. const clickPrint = (row) => {
  1126. presentTime.value = moment().format("yyyy-MM-DD HH:mm:ss");
  1127. openPrint.value = true;
  1128. proxy.post("/accountRequestFunds/detail", { id: row.id }).then((res) => {
  1129. printDetails.value = res;
  1130. proxy
  1131. .post("/fileInfo/getList", { businessIdList: [row.id] })
  1132. .then((resFile) => {
  1133. let electronicInvoiceText = "";
  1134. if (resFile[row.id] && resFile[row.id].length > 0) {
  1135. for (let i = 0; i < resFile[row.id].length; i++) {
  1136. if (i === 0) {
  1137. electronicInvoiceText = resFile[row.id][0].fileName;
  1138. } else {
  1139. electronicInvoiceText =
  1140. electronicInvoiceText + ", " + resFile[row.id][i].fileName;
  1141. }
  1142. }
  1143. }
  1144. printDetails.value.electronicInvoiceText = electronicInvoiceText;
  1145. });
  1146. if (row.flowInfoId) {
  1147. proxy
  1148. .post("/flowExample/getApprovalRecord", { id: row.flowInfoId })
  1149. .then((record) => {
  1150. printDetails.value.recordList = record.recordList;
  1151. });
  1152. }
  1153. });
  1154. };
  1155. const clickDownload = () => {
  1156. proxy.getPdf("请款PDF文件");
  1157. };
  1158. const computeMoney = (label) => {
  1159. let amount = 0;
  1160. if (
  1161. printDetails.value.accountRequestFundsDetailList &&
  1162. printDetails.value.accountRequestFundsDetailList.length > 0
  1163. ) {
  1164. for (
  1165. let i = 0;
  1166. i < printDetails.value.accountRequestFundsDetailList.length;
  1167. i++
  1168. ) {
  1169. if (printDetails.value.accountRequestFundsDetailList[i][label]) {
  1170. amount = Number(
  1171. parseFloat(
  1172. Number(amount) +
  1173. Number(printDetails.value.accountRequestFundsDetailList[i][label])
  1174. ).toFixed(2)
  1175. );
  1176. }
  1177. }
  1178. }
  1179. return amount;
  1180. };
  1181. const computeBalance = () => {
  1182. let balance = 0;
  1183. let advanceAmount = computeMoney("advanceAmount");
  1184. let amount = computeMoney("amount");
  1185. if (amount) {
  1186. balance = Number(amount);
  1187. }
  1188. if (advanceAmount) {
  1189. balance = Number(
  1190. parseFloat(Number(balance) - Number(advanceAmount)).toFixed(2)
  1191. );
  1192. }
  1193. return balance;
  1194. };
  1195. const formOption = reactive({
  1196. inline: true,
  1197. labelWidth: 100,
  1198. itemWidth: 100,
  1199. rules: [],
  1200. });
  1201. const defaultProps = {
  1202. children: "children",
  1203. label: "deptName",
  1204. };
  1205. const openSearch = ref(false);
  1206. const formSearchConfig = computed(() => {
  1207. return [
  1208. {
  1209. type: "select",
  1210. prop: "corporationId",
  1211. label: "归属公司",
  1212. data: companyData.value,
  1213. clearable: true,
  1214. },
  1215. {
  1216. type: "slot",
  1217. slotName: "departmentId",
  1218. label: "归属部门",
  1219. itemWidth: 50,
  1220. },
  1221. {
  1222. type: "select",
  1223. prop: "createUser",
  1224. label: "请款人",
  1225. data: userList.value,
  1226. itemWidth: 50,
  1227. clearable: true,
  1228. },
  1229. {
  1230. type: "select",
  1231. prop: "type",
  1232. label: "请款类型",
  1233. data: fundsType.value,
  1234. clearable: true,
  1235. },
  1236. {
  1237. type: "select",
  1238. prop: "currency",
  1239. label: "币种",
  1240. data: accountCurrency.value,
  1241. clearable: true,
  1242. },
  1243. {
  1244. type: "slot",
  1245. slotName: "time",
  1246. label: "请款时间",
  1247. },
  1248. {
  1249. type: "slot",
  1250. slotName: "money",
  1251. label: "请款金额",
  1252. },
  1253. {
  1254. type: "input",
  1255. itemType: "textarea",
  1256. prop: "paymentRemarks",
  1257. label: "用款说明",
  1258. },
  1259. {
  1260. type: "select",
  1261. prop: "paymentMethod",
  1262. label: "付款方式",
  1263. data: fundsPaymentMethod.value,
  1264. clearable: true,
  1265. },
  1266. {
  1267. type: "select",
  1268. prop: "status",
  1269. label: "流程状态",
  1270. data: status.value,
  1271. itemWidth: 50,
  1272. clearable: true,
  1273. },
  1274. {
  1275. type: "select",
  1276. prop: "paymentStatus",
  1277. label: "打款状态",
  1278. data: paymentStatus.value,
  1279. itemWidth: 50,
  1280. clearable: true,
  1281. },
  1282. ];
  1283. });
  1284. let copySearch = ref({});
  1285. const moreSearch = () => {
  1286. copySearch.value = proxy.deepClone(sourceList.value.pagination);
  1287. openSearch.value = true;
  1288. };
  1289. const cancelSearch = () => {
  1290. sourceList.value.pagination = copySearch.value;
  1291. openSearch.value = false;
  1292. };
  1293. const submitSearch = () => {
  1294. if (
  1295. sourceList.value.pagination.minAdvanceAmounts &&
  1296. sourceList.value.pagination.maxAdvanceAmounts &&
  1297. Number(sourceList.value.pagination.minAdvanceAmounts) >
  1298. Number(sourceList.value.pagination.maxAdvanceAmounts)
  1299. ) {
  1300. return ElMessage("交易金额输入错误");
  1301. }
  1302. if (
  1303. sourceList.value.pagination.beginTime &&
  1304. sourceList.value.pagination.endTime &&
  1305. sourceList.value.pagination.beginTime > sourceList.value.pagination.endTime
  1306. ) {
  1307. return ElMessage("开始时间不能大于结束时间");
  1308. }
  1309. openSearch.value = false;
  1310. sourceList.value.pagination.pageNum = 1;
  1311. getList();
  1312. };
  1313. const pushProcessApproval = (row) => {
  1314. proxy.$router.push({
  1315. path: "/platform_manage/process/processApproval",
  1316. query: {
  1317. flowKey: "account_request_funds_flow",
  1318. id: row.flowInfoId,
  1319. processType: 20,
  1320. random: proxy.random(),
  1321. flowName: "请款详情",
  1322. },
  1323. });
  1324. return;
  1325. };
  1326. </script>
  1327. <style lang="scss" scoped>
  1328. .tenant {
  1329. padding: 20px;
  1330. }
  1331. ::v-deep(.el-input-number .el-input__inner) {
  1332. text-align: left;
  1333. }
  1334. </style>