index.vue 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852
  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. <template #total="{ item }">
  20. <div style="width: 100%">
  21. <a style="color: #409eff; cursor: pointer" @click="pushProcessApproval(item)">{{ item.currency }}{{ item.total }}</a>
  22. </div>
  23. </template>
  24. </byTable>
  25. </div>
  26. <el-dialog title="打印" v-if="openPrint" v-model="openPrint" width="840px">
  27. <div id="pdfDom" style="width: 776px">
  28. <div style="padding: 60px 30px; font-size: 12px !important; color: black">
  29. <div style="font-size: 16px; text-align: center; padding: 8px">
  30. <span>{{ dictValueLabel(printDetails.type, fundsType) }}审批单</span>
  31. </div>
  32. <div style="padding: 8px 0">
  33. <span>{{ printDetails.corporationName }}</span>
  34. <span style="padding-left: 32px">创建时间: {{ printDetails.createTime }}</span>
  35. </div>
  36. <div style="border: 1px solid black">
  37. <div style="display: flex; border-bottom: 1px solid black">
  38. <div style="width: 126px; border-right: 1px solid black; padding: 8px">创建人</div>
  39. <div style="width: calc(100% - 126px); padding: 8px">
  40. {{ dictValueLabel(printDetails.createUser, userList) }}
  41. </div>
  42. </div>
  43. <div style="display: flex; border-bottom: 1px solid black">
  44. <div style="width: 126px; border-right: 1px solid black; padding: 8px">创建人部门</div>
  45. <div style="width: calc(100% - 126px); padding: 8px">
  46. {{ printDetails.deptName }}
  47. </div>
  48. </div>
  49. <div style="display: flex; border-bottom: 1px solid black" v-if="printDetails.type !== '3'">
  50. <div style="width: 126px; border-right: 1px solid black; padding: 4px 8px; display: flex; align-items: center">费用明细</div>
  51. <div style="width: calc(100% - 126px)">
  52. <div style="border-bottom: 1px solid black; display: flex">
  53. <div style="width: 80px; padding: 4px 8px; border-right: 1px solid black; text-align: center">费用类型</div>
  54. <div style="width: 120px; padding: 4px 8px; border-right: 1px solid black; text-align: center">关联合同</div>
  55. <div style="width: calc(100% - 360px); padding: 4px 8px; border-right: 1px solid black; text-align: center">款项说明</div>
  56. <div style="width: 60px; padding: 4px 8px; border-right: 1px solid black; text-align: center">货币</div>
  57. <div style="width: 100px; padding: 4px 8px; text-align: center">付款金额</div>
  58. </div>
  59. <template v-if="printDetails.accountRequestFundsDetailList && printDetails.accountRequestFundsDetailList.length > 0">
  60. <div v-for="(item, index) in printDetails.accountRequestFundsDetailList" :key="index">
  61. <div
  62. :style="
  63. index + 1 !== printDetails.accountRequestFundsDetailList.length ? 'border-bottom: 1px solid black; display: flex' : ' display: flex'
  64. ">
  65. <div style="width: 80px; padding: 4px 8px; border-right: 1px solid black; text-align: center">
  66. {{ dictValueLabel(item.costType, fundsCostType) }}
  67. </div>
  68. <div style="width: 120px; padding: 4px 8px; border-right: 1px solid black; display: flex; align-items: center">
  69. {{ item.contractCode }}
  70. </div>
  71. <div style="width: calc(100% - 360px); padding: 4px 8px; border-right: 1px solid black; display: flex; align-items: center">
  72. {{ item.remarks }}
  73. </div>
  74. <div style="width: 60px; padding: 4px 8px; border-right: 1px solid black; display: flex; align-items: center">
  75. {{ dictValueLabel(printDetails.currency, accountCurrency) }}
  76. </div>
  77. <div style="width: 100px; padding: 4px 8px; display: flex; align-items: center">
  78. {{ item.amount }}
  79. </div>
  80. </div>
  81. </div>
  82. </template>
  83. </div>
  84. </div>
  85. <div style="display: flex; border-bottom: 1px solid black" v-else>
  86. <div style="width: 126px; border-right: 1px solid black; padding: 4px 8px; display: flex; align-items: center">费用明细</div>
  87. <div style="width: calc(100% - 126px)">
  88. <div style="border-bottom: 1px solid black; display: flex">
  89. <div style="width: 80px; padding: 4px 8px; border-right: 1px solid black; text-align: center">费用类型</div>
  90. <div style="width: 120px; padding: 4px 8px; border-right: 1px solid black; text-align: center">关联合同</div>
  91. <div style="width: calc(100% - 420px); padding: 4px 8px; border-right: 1px solid black; text-align: center">款项说明</div>
  92. <div style="width: 60px; padding: 4px 8px; border-right: 1px solid black; text-align: center">货币</div>
  93. <div style="width: 80px; padding: 4px 8px; border-right: 1px solid black; text-align: center">预支金额</div>
  94. <div style="width: 80px; padding: 4px 8px; text-align: center">付款金额</div>
  95. </div>
  96. <template v-if="printDetails.accountRequestFundsDetailList && printDetails.accountRequestFundsDetailList.length > 0">
  97. <div v-for="(item, index) in printDetails.accountRequestFundsDetailList" :key="index">
  98. <div
  99. :style="
  100. index + 1 !== printDetails.accountRequestFundsDetailList.length ? 'border-bottom: 1px solid black; display: flex' : ' display: flex'
  101. ">
  102. <div style="width: 80px; padding: 4px 8px; border-right: 1px solid black; text-align: center">
  103. {{ dictValueLabel(item.costType, fundsCostType) }}
  104. </div>
  105. <div style="width: 120px; padding: 4px 8px; border-right: 1px solid black; display: flex; align-items: center">
  106. {{ item.contractCode }}
  107. </div>
  108. <div style="width: calc(100% - 420px); padding: 4px 8px; border-right: 1px solid black; display: flex; align-items: center">
  109. {{ item.remarks }}
  110. </div>
  111. <div style="width: 60px; padding: 4px 8px; border-right: 1px solid black; display: flex; align-items: center">
  112. {{ dictValueLabel(printDetails.currency, accountCurrency) }}
  113. </div>
  114. <div style="width: 80px; padding: 4px 8px; border-right: 1px solid black; display: flex; align-items: center">
  115. {{ item.advanceAmount }}
  116. </div>
  117. <div style="width: 80px; padding: 4px 8px; display: flex; align-items: center">
  118. {{ item.amount }}
  119. </div>
  120. </div>
  121. </div>
  122. </template>
  123. </div>
  124. </div>
  125. <div style="display: flex; border-bottom: 1px solid black" v-if="printDetails.type !== '3'">
  126. <div style="width: 126px; border-right: 1px solid black; padding: 8px">总报销金额</div>
  127. <div style="width: calc(100% - 126px); display: flex">
  128. <div style="width: calc(100% - 100px); padding: 8px; border-right: 1px solid black">{{ NumberToChinese(computeMoney("amount")) }}</div>
  129. <div style="width: 100px; padding: 8px">{{ computeMoney("amount") }}</div>
  130. </div>
  131. </div>
  132. <div v-else>
  133. <div style="display: flex; border-bottom: 1px solid black">
  134. <div style="width: 126px; border-right: 1px solid black; padding: 8px">核销总金额</div>
  135. <div style="width: calc(100% - 126px); display: flex">
  136. <div style="width: calc(100% - 80px); padding: 8px; border-right: 1px solid black">{{ NumberToChinese(computeMoney("amount")) }}</div>
  137. <div style="width: 80px; padding: 8px">{{ computeMoney("amount") }}</div>
  138. </div>
  139. </div>
  140. <div style="display: flex; border-bottom: 1px solid black">
  141. <div style="width: 126px; border-right: 1px solid black; padding: 8px">预支总金额</div>
  142. <div style="width: calc(100% - 126px); display: flex">
  143. <div style="width: calc(100% - 80px); padding: 8px; border-right: 1px solid black">{{ NumberToChinese(computeMoney("advanceAmount")) }}</div>
  144. <div style="width: 80px; padding: 8px">{{ computeMoney("advanceAmount") }}</div>
  145. </div>
  146. </div>
  147. <div style="display: flex; border-bottom: 1px solid black">
  148. <div style="width: 126px; border-right: 1px solid black; padding: 8px">差额 (核销 - 预支)</div>
  149. <div style="width: calc(100% - 126px); display: flex">
  150. <div style="width: calc(100% - 80px); padding: 8px; border-right: 1px solid black">{{ NumberToChinese(computeBalance()) }}</div>
  151. <div style="width: 80px; padding: 8px">{{ computeBalance() }}</div>
  152. </div>
  153. </div>
  154. </div>
  155. <div style="display: flex; border-bottom: 1px solid black">
  156. <div style="width: 126px; border-right: 1px solid black; padding: 8px">单据数量</div>
  157. <div style="width: calc(100% - 126px); padding: 8px">
  158. {{ printDetails.quantity }}
  159. </div>
  160. </div>
  161. <div style="display: flex; border-bottom: 1px solid black">
  162. <div style="width: 126px; border-right: 1px solid black; padding: 0 8px; display: flex; align-items: center">收款信息</div>
  163. <div style="width: calc(100% - 126px)">
  164. <div style="border-bottom: 1px solid black; display: flex">
  165. <div style="width: 19%; padding: 0 8px; border-right: 1px solid black; text-align: center">支付方式</div>
  166. <div style="width: 27%; padding: 0 8px; border-right: 1px solid black; text-align: center">收款方户名</div>
  167. <div style="width: 27%; padding: 0 8px; border-right: 1px solid black; text-align: center">开户行</div>
  168. <div style="width: 27%; padding: 0 8px; text-align: center">收款方账号</div>
  169. </div>
  170. <div style="display: flex">
  171. <div style="width: 19%; padding: 0 8px; border-right: 1px solid black; display: flex; align-items: center">
  172. {{ dictValueLabel(printDetails.paymentMethod, fundsPaymentMethod) }}
  173. </div>
  174. <div style="width: 27%; padding: 0 8px; border-right: 1px solid black; display: flex; align-items: center">
  175. {{ printDetails.name }}
  176. </div>
  177. <div style="width: 27%; padding: 0 8px; border-right: 1px solid black; display: flex; align-items: center">
  178. {{ printDetails.openingBank }}
  179. </div>
  180. <div style="width: 27%; padding: 0 8px; display: flex; align-items: center">
  181. {{ printDetails.accountOpening }}
  182. </div>
  183. </div>
  184. </div>
  185. </div>
  186. <div style="display: flex; border-bottom: 1px solid black">
  187. <div style="width: 126px; border-right: 1px solid black; padding: 8px">电子发票(PDF/JPG)</div>
  188. <div style="width: calc(100% - 126px); padding: 8px">{{ printDetails.electronicInvoiceText }}</div>
  189. </div>
  190. <div style="display: flex">
  191. <div style="width: 126px; border-right: 1px solid black; padding: 4px 8px; display: flex; align-items: center">审批流程</div>
  192. <div style="width: calc(100% - 126px)">
  193. <template v-if="printDetails.recordList && printDetails.recordList.length > 0">
  194. <div v-for="(item, index) in printDetails.recordList" :key="index">
  195. <div
  196. :style="
  197. index + 1 !== printDetails.recordList.length
  198. ? 'border-bottom: 1px solid black; padding: 4px 8px; display: flex'
  199. : 'padding: 4px 8px; display: flex'
  200. ">
  201. <div style="width: calc(100% - 120px); word-wrap: break-word">
  202. <span>{{ item.nodeName }}: </span>
  203. <span style="padding-left: 4px">{{ item.processedUser }}</span>
  204. <span style="padding-left: 4px">{{ item.remark }}</span>
  205. </div>
  206. <div style="width: 120px">{{ item.processedDate }}</div>
  207. </div>
  208. </div>
  209. </template>
  210. </div>
  211. </div>
  212. </div>
  213. <div style="padding-top: 16px">
  214. <span>打印时间: {{ presentTime }}</span>
  215. <span style="padding-left: 32px">打印人: {{ useUserStore().user.nickName }}</span>
  216. </div>
  217. </div>
  218. </div>
  219. <template #footer>
  220. <el-button @click="openPrint = false" size="large">取消</el-button>
  221. <el-button type="primary" @click="clickDownload()" size="large">下载PDF</el-button>
  222. </template>
  223. </el-dialog>
  224. <el-dialog title="高级检索" v-if="openSearch" v-model="openSearch" width="600" :before-close="cancelSearch">
  225. <byForm :formConfig="formSearchConfig" :formOption="formOption" v-model="sourceList.pagination">
  226. <template #departmentId>
  227. <div>
  228. <el-tree-select
  229. v-model="sourceList.pagination.departmentId"
  230. :data="deptTreeData"
  231. check-strictly
  232. :render-after-expand="false"
  233. node-key="deptId"
  234. style="width: 100%"
  235. :props="defaultProps"
  236. clearable />
  237. </div>
  238. </template>
  239. <template #time>
  240. <div style="width: 100%">
  241. <el-row :gutter="10">
  242. <el-col :span="11">
  243. <el-date-picker
  244. v-model="sourceList.pagination.beginTime"
  245. type="datetime"
  246. placeholder="请选择"
  247. style="width: 100%"
  248. value-format="YYYY-MM-DD HH:mm:ss" />
  249. </el-col>
  250. <el-col :span="2" style="text-align: center">到</el-col>
  251. <el-col :span="11">
  252. <el-date-picker
  253. v-model="sourceList.pagination.endTime"
  254. type="datetime"
  255. placeholder="请选择"
  256. style="width: 100%"
  257. value-format="YYYY-MM-DD HH:mm:ss" />
  258. </el-col>
  259. </el-row>
  260. </div>
  261. </template>
  262. <template #money>
  263. <div style="width: 100%">
  264. <el-row :gutter="10">
  265. <el-col :span="11">
  266. <el-input-number
  267. onmousewheel="return false;"
  268. v-model="sourceList.pagination.minAdvanceAmounts"
  269. placeholder="请输入"
  270. style="width: 100%"
  271. :precision="2"
  272. :controls="false"
  273. :min="0" />
  274. </el-col>
  275. <el-col :span="2" style="text-align: center">到</el-col>
  276. <el-col :span="11">
  277. <el-input-number
  278. onmousewheel="return false;"
  279. v-model="sourceList.pagination.maxAdvanceAmounts"
  280. placeholder="请输入"
  281. style="width: 100%"
  282. :precision="2"
  283. :controls="false"
  284. :min="0" />
  285. </el-col>
  286. </el-row>
  287. </div>
  288. </template>
  289. </byForm>
  290. <template #footer>
  291. <el-button @click="cancelSearch()" size="large">取 消</el-button>
  292. <el-button type="primary" @click="submitSearch()" size="large">确 定</el-button>
  293. </template>
  294. </el-dialog>
  295. </div>
  296. </template>
  297. <script setup>
  298. import byTable from "@/components/byTable/index";
  299. import useUserStore from "@/store/modules/user";
  300. import { ref } from "vue";
  301. import moment from "moment";
  302. import byForm from "@/components/byForm/index";
  303. const loading = ref(false);
  304. const sourceList = ref({
  305. data: [],
  306. pagination: {
  307. total: 0,
  308. pageNum: 1,
  309. pageSize: 10,
  310. type: "",
  311. keyword: "",
  312. writeOffStatus: "",
  313. corporationId: "",
  314. departmentId: "",
  315. createUser: "",
  316. currency: "",
  317. beginTime: "",
  318. endTime: "",
  319. minAdvanceAmounts: undefined,
  320. maxAdvanceAmounts: undefined,
  321. paymentRemarks: "",
  322. paymentMethod: "",
  323. status: "",
  324. paymentStatus: "",
  325. },
  326. });
  327. const { proxy } = getCurrentInstance();
  328. const fundsType = ref([]);
  329. const accountData = ref([]);
  330. const userList = ref([]);
  331. const companyData = ref([]);
  332. const accountCurrency = ref([]);
  333. const fundsCostType = ref([]);
  334. const fundsPaymentMethod = ref([]);
  335. const deptTreeData = ref([]);
  336. const status = ref([
  337. {
  338. label: "审批中",
  339. value: "10",
  340. },
  341. {
  342. label: "驳回",
  343. value: "20",
  344. },
  345. {
  346. label: "审批通过",
  347. value: "30",
  348. },
  349. ]);
  350. const paymentStatus = ref([
  351. {
  352. label: "已打款",
  353. value: "10",
  354. },
  355. {
  356. label: "未打款",
  357. value: "20",
  358. },
  359. ]);
  360. const selectConfig = computed(() => {
  361. return [
  362. {
  363. label: "类型",
  364. prop: "type",
  365. data: fundsType.value,
  366. },
  367. {
  368. label: "审批状态",
  369. prop: "status",
  370. data: status.value,
  371. },
  372. {
  373. label: "放款状态",
  374. prop: "paymentStatus",
  375. data: paymentStatus.value,
  376. },
  377. ];
  378. });
  379. const config = computed(() => {
  380. return [
  381. {
  382. attrs: {
  383. label: "归属公司",
  384. prop: "corporationName",
  385. width: 160,
  386. },
  387. },
  388. {
  389. attrs: {
  390. label: "归属部门",
  391. prop: "deptName",
  392. width: 160,
  393. },
  394. },
  395. {
  396. attrs: {
  397. label: "请款类型",
  398. prop: "type",
  399. width: 120,
  400. },
  401. render(type) {
  402. return proxy.dictValueLabel(type, fundsType.value);
  403. },
  404. },
  405. {
  406. attrs: {
  407. label: "请款人",
  408. prop: "userName",
  409. width: 140,
  410. },
  411. },
  412. {
  413. attrs: {
  414. label: "请款时间",
  415. prop: "createTime",
  416. width: 160,
  417. },
  418. },
  419. {
  420. attrs: {
  421. label: "请款金额",
  422. slot: "total",
  423. width: 120,
  424. },
  425. },
  426. {
  427. attrs: {
  428. label: "用款说明",
  429. prop: "paymentRemarks",
  430. "min-width": 200,
  431. },
  432. },
  433. {
  434. attrs: {
  435. label: "付款方式",
  436. prop: "paymentMethod",
  437. width: 120,
  438. },
  439. render(paymentMethod) {
  440. return proxy.dictValueLabel(paymentMethod, fundsPaymentMethod.value);
  441. },
  442. },
  443. {
  444. attrs: {
  445. label: "付款账户",
  446. prop: "accountManagementName",
  447. width: 140,
  448. },
  449. },
  450. {
  451. attrs: {
  452. label: "审批状态",
  453. prop: "status",
  454. width: 100,
  455. },
  456. render(status) {
  457. return status == 10 ? "审批中" : status == 20 ? "驳回" : status == 30 ? "审批通过" : "";
  458. },
  459. },
  460. {
  461. attrs: {
  462. label: "放款状态",
  463. prop: "accountPaymentStatus",
  464. width: 100,
  465. },
  466. render(status) {
  467. return proxy.dictValueLabel(status, paymentStatus.value);
  468. },
  469. },
  470. {
  471. attrs: {
  472. label: "操作",
  473. width: "80",
  474. align: "center",
  475. fixed: "right",
  476. },
  477. renderHTML(row) {
  478. return [
  479. {
  480. attrs: {
  481. label: "打印",
  482. type: "primary",
  483. text: true,
  484. },
  485. el: "button",
  486. click() {
  487. clickPrint(row);
  488. },
  489. },
  490. ];
  491. },
  492. },
  493. ];
  494. });
  495. const getList = async (req) => {
  496. sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
  497. loading.value = true;
  498. proxy.post("/accountRequestFunds/page", sourceList.value.pagination).then((message) => {
  499. sourceList.value.data = message.rows;
  500. sourceList.value.pagination.total = message.total;
  501. setTimeout(() => {
  502. loading.value = false;
  503. }, 200);
  504. });
  505. };
  506. const openModal = () => {
  507. const flowName = `${userInfo.nickName}的请款申请(发起)`;
  508. proxy.$router.replace({
  509. path: "/platform_manage/process/processApproval",
  510. query: {
  511. flowKey: "account_request_funds_flow",
  512. random: proxy.random(),
  513. flowName,
  514. },
  515. });
  516. };
  517. const userInfo = useUserStore().user;
  518. const recursive = (data) => {
  519. data.map((item) => {
  520. item.label = item.deptName;
  521. item.id = item.corporationId;
  522. if (item.children) {
  523. recursive(item.children);
  524. } else {
  525. item.children = [];
  526. }
  527. });
  528. };
  529. const getDictData = () => {
  530. proxy.getDictOne(["founds_type", "funds_payment_method", "account_currency", "funds_cost_type"]).then((res) => {
  531. fundsType.value = res["founds_type"].map((x) => ({
  532. label: x.dictValue,
  533. value: x.dictKey,
  534. }));
  535. fundsPaymentMethod.value = res["funds_payment_method"].map((x) => ({
  536. label: x.dictValue,
  537. value: x.dictKey,
  538. }));
  539. accountCurrency.value = res["account_currency"].map((x) => ({
  540. label: x.dictValue,
  541. value: x.dictKey,
  542. }));
  543. fundsCostType.value = res["funds_cost_type"].map((x) => ({
  544. label: x.dictValue,
  545. value: x.dictKey,
  546. }));
  547. });
  548. proxy.post("/accountManagement/page", { pageNum: 1, pageSize: 9999 }).then((res) => {
  549. accountData.value = res.rows.map((item) => {
  550. return {
  551. ...item,
  552. label: item.alias,
  553. value: item.id,
  554. };
  555. });
  556. });
  557. proxy
  558. .get("/tenantUser/list", {
  559. pageNum: 1,
  560. pageSize: 10000,
  561. tenantId: useUserStore().user.tenantId,
  562. })
  563. .then((res) => {
  564. if (res.rows && res.rows.length > 0) {
  565. userList.value = res.rows.map((item) => {
  566. return {
  567. deptId: item.deptId,
  568. label: item.nickName,
  569. value: item.userId,
  570. };
  571. });
  572. }
  573. });
  574. proxy.post("/corporation/page", { pageNum: 1, pageSize: 9999 }).then((res) => {
  575. if (res.rows && res.rows.length > 0) {
  576. companyData.value = res.rows.map((item) => {
  577. return {
  578. label: item.name,
  579. value: item.id,
  580. };
  581. });
  582. }
  583. });
  584. proxy
  585. .get("/tenantDept/list", {
  586. pageNum: 1,
  587. pageSize: 9999,
  588. tenantId: userInfo.tenantId,
  589. })
  590. .then((message) => {
  591. recursive(message.data);
  592. deptTreeData.value = [];
  593. let data = proxy.handleTree(message.data, "deptId");
  594. if (data && data.length > 0) {
  595. for (let i = 0; i < data.length; i++) {
  596. if (data[i].children && data[i].children.length > 0) {
  597. deptTreeData.value = deptTreeData.value.concat(data[i].children);
  598. }
  599. }
  600. }
  601. });
  602. };
  603. getDictData();
  604. getList();
  605. const openPrint = ref(false);
  606. const printDetails = ref({});
  607. const presentTime = ref("");
  608. const clickPrint = (row) => {
  609. presentTime.value = moment().format("yyyy-MM-DD HH:mm:ss");
  610. openPrint.value = true;
  611. proxy.post("/accountRequestFunds/detail", { id: row.id }).then((res) => {
  612. printDetails.value = res;
  613. proxy.post("/fileInfo/getList", { businessIdList: [row.id] }).then((resFile) => {
  614. let electronicInvoiceText = "";
  615. if (resFile[row.id] && resFile[row.id].length > 0) {
  616. for (let i = 0; i < resFile[row.id].length; i++) {
  617. if (i === 0) {
  618. electronicInvoiceText = resFile[row.id][0].fileName;
  619. } else {
  620. electronicInvoiceText = electronicInvoiceText + ", " + resFile[row.id][i].fileName;
  621. }
  622. }
  623. }
  624. printDetails.value.electronicInvoiceText = electronicInvoiceText;
  625. });
  626. if (row.flowInfoId) {
  627. proxy.post("/flowExample/getApprovalRecord", { id: row.flowInfoId }).then((record) => {
  628. printDetails.value.recordList = record.recordList;
  629. });
  630. }
  631. });
  632. };
  633. const clickDownload = () => {
  634. proxy.getPdf("请款PDF文件");
  635. };
  636. const computeMoney = (label) => {
  637. let amount = 0;
  638. if (printDetails.value.accountRequestFundsDetailList && printDetails.value.accountRequestFundsDetailList.length > 0) {
  639. for (let i = 0; i < printDetails.value.accountRequestFundsDetailList.length; i++) {
  640. if (printDetails.value.accountRequestFundsDetailList[i][label]) {
  641. amount = Number(parseFloat(Number(amount) + Number(printDetails.value.accountRequestFundsDetailList[i][label])).toFixed(2));
  642. }
  643. }
  644. }
  645. return amount;
  646. };
  647. const toDx = (n) => {
  648. //阿拉伯数字转换函数
  649. switch (n) {
  650. case "0":
  651. return "零";
  652. case "1":
  653. return "壹";
  654. case "2":
  655. return "贰";
  656. case "3":
  657. return "叁";
  658. case "4":
  659. return "肆";
  660. case "5":
  661. return "伍";
  662. case "6":
  663. return "陆";
  664. case "7":
  665. return "柒";
  666. case "8":
  667. return "捌";
  668. case "9":
  669. return "玖";
  670. }
  671. };
  672. const NumberToChinese = (m) => {
  673. let unit = ["仟", "佰", "拾", "", "仟", "佰", "拾", "", "角", "分", "厘"];
  674. m *= 1000;
  675. m = Number(parseFloat(m).toFixed(0));
  676. m += "";
  677. var x = m.length;
  678. var result = "";
  679. for (var i = 0; i < x; i++) {
  680. if (i == 3) {
  681. result = "元" + result;
  682. } else if (i == 7) {
  683. result = "万" + result;
  684. }
  685. if (m.charAt(x - i - 1) == 0) {
  686. if (i != 0 && i != 1 && i != 2) {
  687. if (result.charAt(0) != "零" && result.charAt(0) != "元" && result.charAt(0) != "万") {
  688. result = "零" + result;
  689. }
  690. }
  691. continue;
  692. }
  693. result = toDx(m.charAt(x - i - 1)) + unit[unit.length - i - 1] + result;
  694. }
  695. result += result.charAt(result.length - 1) == "元" ? "整" : "";
  696. return result;
  697. };
  698. const computeBalance = () => {
  699. let balance = 0;
  700. let advanceAmount = computeMoney("advanceAmount");
  701. let amount = computeMoney("amount");
  702. if (amount) {
  703. balance = Number(amount);
  704. }
  705. if (advanceAmount) {
  706. balance = Number(parseFloat(Number(balance) - Number(advanceAmount)).toFixed(2));
  707. }
  708. return balance;
  709. };
  710. const formOption = reactive({
  711. inline: true,
  712. labelWidth: 100,
  713. itemWidth: 100,
  714. rules: [],
  715. });
  716. const defaultProps = {
  717. children: "children",
  718. label: "deptName",
  719. };
  720. const openSearch = ref(false);
  721. const formSearchConfig = computed(() => {
  722. return [
  723. {
  724. type: "select",
  725. prop: "corporationId",
  726. label: "归属公司",
  727. data: companyData.value,
  728. clearable: true,
  729. },
  730. {
  731. type: "slot",
  732. slotName: "departmentId",
  733. label: "归属部门",
  734. itemWidth: 50,
  735. },
  736. {
  737. type: "select",
  738. prop: "createUser",
  739. label: "请款人",
  740. data: userList.value,
  741. itemWidth: 50,
  742. clearable: true,
  743. },
  744. {
  745. type: "select",
  746. prop: "type",
  747. label: "请款类型",
  748. data: fundsType.value,
  749. clearable: true,
  750. },
  751. {
  752. type: "select",
  753. prop: "currency",
  754. label: "币种",
  755. data: accountCurrency.value,
  756. clearable: true,
  757. },
  758. {
  759. type: "slot",
  760. slotName: "time",
  761. label: "请款时间",
  762. },
  763. {
  764. type: "slot",
  765. slotName: "money",
  766. label: "请款金额",
  767. },
  768. {
  769. type: "input",
  770. itemType: "textarea",
  771. prop: "paymentRemarks",
  772. label: "用款说明",
  773. },
  774. {
  775. type: "select",
  776. prop: "paymentMethod",
  777. label: "付款方式",
  778. data: fundsPaymentMethod.value,
  779. clearable: true,
  780. },
  781. {
  782. type: "select",
  783. prop: "status",
  784. label: "流程状态",
  785. data: status.value,
  786. itemWidth: 50,
  787. clearable: true,
  788. },
  789. {
  790. type: "select",
  791. prop: "paymentStatus",
  792. label: "打款状态",
  793. data: paymentStatus.value,
  794. itemWidth: 50,
  795. clearable: true,
  796. },
  797. ];
  798. });
  799. let copySearch = ref({});
  800. const moreSearch = () => {
  801. copySearch.value = proxy.deepClone(sourceList.value.pagination);
  802. openSearch.value = true;
  803. };
  804. const cancelSearch = () => {
  805. sourceList.value.pagination = copySearch.value;
  806. openSearch.value = false;
  807. };
  808. const submitSearch = () => {
  809. if (
  810. sourceList.value.pagination.minAdvanceAmounts &&
  811. sourceList.value.pagination.maxAdvanceAmounts &&
  812. Number(sourceList.value.pagination.minAdvanceAmounts) > Number(sourceList.value.pagination.maxAdvanceAmounts)
  813. ) {
  814. return ElMessage("交易金额输入错误");
  815. }
  816. if (
  817. sourceList.value.pagination.beginTime &&
  818. sourceList.value.pagination.endTime &&
  819. sourceList.value.pagination.beginTime > sourceList.value.pagination.endTime
  820. ) {
  821. return ElMessage("开始时间不能大于结束时间");
  822. }
  823. openSearch.value = false;
  824. sourceList.value.pagination.pageNum = 1;
  825. getList();
  826. };
  827. const pushProcessApproval = (row) => {
  828. proxy.$router.push({
  829. path: "/platform_manage/process/processApproval",
  830. query: {
  831. flowKey: "account_request_funds_flow",
  832. id: row.flowInfoId,
  833. processType: 20,
  834. random: proxy.random(),
  835. },
  836. });
  837. return;
  838. };
  839. </script>
  840. <style lang="scss" scoped>
  841. .tenant {
  842. padding: 20px;
  843. }
  844. ::v-deep(.el-input-number .el-input__inner) {
  845. text-align: left;
  846. }
  847. </style>