index.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507
  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. @get-list="getList">
  18. <template #fileSlot="{ item }">
  19. <div style="cursor: pointer; color: #409eff" @click="handleClickFile(item)">
  20. {{ item.fileName }}
  21. </div>
  22. </template>
  23. </byTable>
  24. </div>
  25. <el-dialog title="打印" v-if="openPrint" v-model="openPrint" width="680px" v-loading="loadingPrint">
  26. <div id="pdfDom" style="width: 616px">
  27. <div style="margin: 16px 8px; border: 1px solid black; font-size: 12px !important; color: black">
  28. <div style="font-size: 16px; font-weight: 700; text-align: center; padding: 8px">
  29. <span>{{ printDetails.corporationName }}</span>
  30. <span style="margin-left: 16px">{{ dictDataEcho(printDetails.type, fundsType) }}审批单</span>
  31. </div>
  32. <div class="baseRow"></div>
  33. <div class="baseRow" style="display: flex">
  34. <div class="contentRow" style="width: 80px">请款部门</div>
  35. <div class="contentRow" style="width: calc(50% - 80px)">
  36. {{ printDetails.deptName }}
  37. </div>
  38. <div class="contentRow" style="width: 80px">货币</div>
  39. <div class="contentRow" style="width: calc(50% - 80px)">
  40. {{ dictDataEcho(printDetails.currency, accountCurrency) }}
  41. </div>
  42. </div>
  43. <div class="baseRow" style="display: flex">
  44. <div class="contentRow" style="width: 80px">请款时间</div>
  45. <div class="contentRow" style="width: calc(50% - 80px)">
  46. {{ printDetails.createTime }}
  47. </div>
  48. <div class="contentRow" style="width: 80px">发票类型</div>
  49. <div class="contentRow" style="width: calc(50% - 80px)"></div>
  50. </div>
  51. <div class="baseRow" style="display: flex" v-if="printDetails.type == '3'">
  52. <div class="contentRow" style="width: 80px">预支单</div>
  53. <div class="contentRow" style="width: calc(100% - 80px)"></div>
  54. </div>
  55. <div class="baseRow" style="display: flex">
  56. <div class="contentRow" style="width: 80px">请款说明</div>
  57. <div class="contentRow" style="width: calc(100% - 80px)">
  58. {{ printDetails.paymentRemarks }}
  59. </div>
  60. </div>
  61. <div class="baseRow" style="display: flex">
  62. <div class="contentRow" style="width: 80px">凭证</div>
  63. <div class="contentRow" style="width: calc(100% - 80px)"></div>
  64. </div>
  65. <div class="specialRow">
  66. <span>请款明细</span>
  67. </div>
  68. <div v-if="printDetails.type == '3'">
  69. <div v-if="printDetails.accountRequestFundsDetailList && printDetails.accountRequestFundsDetailList.length > 0">
  70. <div class="baseRow" style="display: flex">
  71. <div class="contentRow" style="width: 17%">费用类型</div>
  72. <div class="contentRow" style="width: 17%">关联合同</div>
  73. <div class="contentRow" style="width: 17%">预支金额</div>
  74. <div class="contentRow" style="width: 32%">核销说明</div>
  75. <div class="contentRow" style="width: 17%">核销金额</div>
  76. </div>
  77. <div v-for="item in printDetails.accountRequestFundsDetailList" :key="item.id">
  78. <div class="baseRow" style="display: flex">
  79. <div class="contentRow" style="width: 17%">
  80. {{ dictDataEcho(item.costType, fundsCostType) }}
  81. </div>
  82. <div class="contentRow" style="width: 17%">
  83. {{ item.contractCode }}
  84. </div>
  85. <div class="contentRow" style="width: 17%"></div>
  86. <div class="contentRow" style="width: 32%">
  87. {{ item.remarks }}
  88. </div>
  89. <div class="contentRow" style="width: 17%">
  90. {{ item.amount }}
  91. </div>
  92. </div>
  93. </div>
  94. </div>
  95. <div v-else>
  96. <div class="baseRow" style="display: flex">
  97. <div class="contentRow" style="width: 17%">费用类型</div>
  98. <div class="contentRow" style="width: 17%">关联合同</div>
  99. <div class="contentRow" style="width: 17%">预支金额</div>
  100. <div class="contentRow" style="width: 32%">核销说明</div>
  101. <div class="contentRow" style="width: 17%">核销金额</div>
  102. </div>
  103. <div class="baseRow" style="display: flex">
  104. <div class="contentRow" style="width: 17%"></div>
  105. <div class="contentRow" style="width: 17%"></div>
  106. <div class="contentRow" style="width: 17%"></div>
  107. <div class="contentRow" style="width: 32%"></div>
  108. <div class="contentRow" style="width: 17%"></div>
  109. </div>
  110. </div>
  111. <div class="baseRow" style="display: flex">
  112. <div class="contentRow" style="width: 80px">预支金额</div>
  113. <div class="contentRow" style="width: calc(50% - 80px)"></div>
  114. <div class="contentRow" style="width: 80px">核销总额</div>
  115. <div class="contentRow" style="width: calc(50% - 80px)">{{ printDetails.total }}</div>
  116. </div>
  117. <div class="baseRow" style="display: flex">
  118. <div class="contentRow" style="width: 80px">差额</div>
  119. <div class="contentRow" style="width: calc(50% - 80px)"></div>
  120. <div class="contentRow" style="width: 80px">单证数量</div>
  121. <div class="contentRow" style="width: calc(50% - 80px)">{{ printDetails.quantity }}</div>
  122. </div>
  123. </div>
  124. <div v-else>
  125. <div v-if="printDetails.accountRequestFundsDetailList && printDetails.accountRequestFundsDetailList.length > 0">
  126. <div class="baseRow" style="display: flex">
  127. <div class="contentRow" style="width: 25%">费用类型</div>
  128. <div class="contentRow" style="width: 25%">关联合同</div>
  129. <div class="contentRow" style="width: 25%">款项说明</div>
  130. <div class="contentRow" style="width: 25%">请款金额</div>
  131. </div>
  132. <div v-for="item in printDetails.accountRequestFundsDetailList" :key="item.id">
  133. <div class="baseRow" style="display: flex">
  134. <div class="contentRow" style="width: 25%">
  135. {{ dictDataEcho(item.costType, fundsCostType) }}
  136. </div>
  137. <div class="contentRow" style="width: 25%">
  138. {{ item.contractCode }}
  139. </div>
  140. <div class="contentRow" style="width: 25%">
  141. {{ item.remarks }}
  142. </div>
  143. <div class="contentRow" style="width: 25%">
  144. {{ item.amount }}
  145. </div>
  146. </div>
  147. </div>
  148. </div>
  149. <div v-else>
  150. <div class="baseRow" style="display: flex">
  151. <div class="contentRow" style="width: 25%">费用类型</div>
  152. <div class="contentRow" style="width: 25%">关联合同</div>
  153. <div class="contentRow" style="width: 25%">款项说明</div>
  154. <div class="contentRow" style="width: 25%">请款金额</div>
  155. </div>
  156. <div class="baseRow" style="display: flex">
  157. <div class="contentRow" style="width: 25%"></div>
  158. <div class="contentRow" style="width: 25%"></div>
  159. <div class="contentRow" style="width: 25%"></div>
  160. <div class="contentRow" style="width: 25%"></div>
  161. </div>
  162. </div>
  163. <div class="baseRow" style="display: flex">
  164. <div class="contentRow" style="width: 80px">请款总额</div>
  165. <div class="contentRow" style="width: calc(50% - 80px)">
  166. {{ printDetails.total }}
  167. </div>
  168. <div class="contentRow" style="width: 80px">单证数量</div>
  169. <div class="contentRow" style="width: calc(50% - 80px)">
  170. {{ printDetails.quantity }}
  171. </div>
  172. </div>
  173. </div>
  174. <div class="specialRow">
  175. <span>付款明细</span>
  176. </div>
  177. <div class="baseRow" style="display: flex">
  178. <div class="contentRow" style="width: 80px">付款方式</div>
  179. <div class="contentRow" style="width: calc(50% - 80px)">
  180. {{ dictDataEcho(printDetails.paymentMethod, fundsPaymentMethod) }}
  181. </div>
  182. <div class="contentRow" style="width: 80px">付款账户</div>
  183. <div class="contentRow" style="width: calc(50% - 80px)">
  184. {{ dictValueLabel(printDetails.accountManagementId, accountData) }}
  185. </div>
  186. </div>
  187. <div class="baseRow" style="display: flex">
  188. <div class="contentRow" style="width: 80px">户名</div>
  189. <div class="contentRow" style="width: calc(50% - 80px)">
  190. {{ printDetails.name }}
  191. </div>
  192. <div class="contentRow" style="width: 80px">开户银行</div>
  193. <div class="contentRow" style="width: calc(50% - 80px)">
  194. {{ printDetails.openingBank }}
  195. </div>
  196. </div>
  197. <div class="baseRow" style="display: flex">
  198. <div class="contentRow" style="width: 80px">账号</div>
  199. <div class="contentRow" style="width: calc(50% - 80px)">
  200. {{ printDetails.accountOpening }}
  201. </div>
  202. <div class="contentRow" style="width: 80px">联行号</div>
  203. <div class="contentRow" style="width: calc(50% - 80px)">
  204. {{ printDetails.interbankNumber }}
  205. </div>
  206. </div>
  207. <div class="specialRow">
  208. <span>审批记录</span>
  209. </div>
  210. <template v-if="printDetails.recordList && printDetails.recordList.length > 0">
  211. <div class="baseRow" style="display: flex" v-for="(item, index) in printDetails.recordList" :key="index">
  212. <div class="contentRow" style="width: 80px">{{ item.nodeName }}</div>
  213. <div class="contentRow" style="width: calc(100% - 240px)">
  214. <span v-if="item.remark">{{ item.remark }}</span>
  215. </div>
  216. <div class="contentRow" style="width: 160px">{{ item.processedDate }}</div>
  217. </div>
  218. </template>
  219. </div>
  220. </div>
  221. <template #footer>
  222. <el-button @click="openPrint = false" size="large">取消</el-button>
  223. <el-button type="primary" @click="clickDownload()" size="large">下载PDF</el-button>
  224. </template>
  225. </el-dialog>
  226. </div>
  227. </template>
  228. <script setup>
  229. import byTable from "@/components/byTable/index";
  230. import useUserStore from "@/store/modules/user";
  231. import { ref } from "vue";
  232. const loading = ref(false);
  233. const sourceList = ref({
  234. data: [],
  235. pagination: {
  236. total: 3,
  237. pageNum: 1,
  238. pageSize: 10,
  239. status: "",
  240. },
  241. });
  242. const { proxy } = getCurrentInstance();
  243. const selectConfig = reactive([
  244. {
  245. label: "类型",
  246. prop: "type",
  247. data: [],
  248. },
  249. {
  250. label: "审批状态",
  251. prop: "status",
  252. data: [
  253. {
  254. label: "审批中",
  255. value: "10",
  256. },
  257. {
  258. label: "驳回",
  259. value: "20",
  260. },
  261. {
  262. label: "已通过",
  263. value: "30",
  264. },
  265. ],
  266. },
  267. {
  268. label: "放款状态",
  269. prop: "paymentStatus",
  270. data: [],
  271. },
  272. ]);
  273. const config = computed(() => {
  274. return [
  275. {
  276. attrs: {
  277. label: "归属公司",
  278. prop: "corporationName",
  279. },
  280. },
  281. {
  282. attrs: {
  283. label: "归属部门",
  284. prop: "deptName",
  285. },
  286. },
  287. {
  288. attrs: {
  289. label: "请款类型",
  290. prop: "type",
  291. },
  292. render(type) {
  293. return proxy.dictDataEcho(type, fundsType.value);
  294. },
  295. },
  296. {
  297. attrs: {
  298. label: "请款人",
  299. prop: "userName",
  300. },
  301. },
  302. {
  303. attrs: {
  304. label: "请款时间",
  305. prop: "createTime",
  306. },
  307. },
  308. {
  309. attrs: {
  310. label: "请款金额",
  311. prop: "total",
  312. },
  313. },
  314. {
  315. attrs: {
  316. label: "用款说明",
  317. prop: "paymentRemarks",
  318. },
  319. },
  320. {
  321. attrs: {
  322. label: "付款方式",
  323. prop: "paymentMethod",
  324. },
  325. render(paymentMethod) {
  326. return proxy.dictDataEcho(paymentMethod, fundsPaymentMethod.value);
  327. },
  328. },
  329. {
  330. attrs: {
  331. label: "付款账户",
  332. prop: "accountManagementName",
  333. },
  334. },
  335. {
  336. attrs: {
  337. label: "审批状态",
  338. prop: "status",
  339. },
  340. render(status) {
  341. return status == 10 ? "审批中" : status == 20 ? "驳回" : status == 30 ? "已通过" : "";
  342. },
  343. },
  344. {
  345. attrs: {
  346. label: "放款状态",
  347. prop: "subscribeContent",
  348. },
  349. // render(subscribeContent) {
  350. // return proxy.dictDataEcho(subscribeContent, fundsPaymentMethod.value);
  351. // },
  352. },
  353. {
  354. attrs: {
  355. label: "操作",
  356. width: "100",
  357. align: "right",
  358. },
  359. renderHTML(row) {
  360. return [
  361. {
  362. attrs: {
  363. label: "打印",
  364. type: "primary",
  365. text: true,
  366. },
  367. el: "button",
  368. click() {
  369. clickPrint(row);
  370. },
  371. },
  372. ];
  373. },
  374. },
  375. ];
  376. });
  377. const getList = async (req) => {
  378. sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
  379. loading.value = true;
  380. proxy.post("/accountRequestFunds/page", sourceList.value.pagination).then((message) => {
  381. sourceList.value.data = message.rows;
  382. sourceList.value.pagination.total = message.total;
  383. setTimeout(() => {
  384. loading.value = false;
  385. }, 200);
  386. });
  387. };
  388. const openModal = () => {
  389. const flowName = `${userInfo.nickName}的请款申请(发起)`;
  390. proxy.$router.replace({
  391. path: "/platform_manage/process/processApproval",
  392. query: {
  393. flowKey: "account_request_funds_flow",
  394. flowName,
  395. },
  396. });
  397. };
  398. const userInfo = useUserStore().user;
  399. const tenantId = userInfo.tenantId;
  400. const fundsType = ref([]);
  401. const accountData = ref([]);
  402. const accountCurrency = ref([]);
  403. const fundsCostType = ref([]);
  404. const fundsPaymentMethod = ref([]);
  405. const getDictData = () => {
  406. // 请款类型数据
  407. proxy
  408. .post("/dictTenantData/page", {
  409. pageNum: 1,
  410. pageSize: 999,
  411. tenantId: tenantId,
  412. dictCode: "founds_type",
  413. })
  414. .then((res) => {
  415. fundsType.value = res.rows;
  416. selectConfig[0].data = res.rows.map((x) => ({
  417. label: x.dictValue,
  418. value: x.dictKey,
  419. }));
  420. });
  421. // 请款付款方式数据
  422. proxy
  423. .post("/dictTenantData/page", {
  424. pageNum: 1,
  425. pageSize: 999,
  426. tenantId: tenantId,
  427. dictCode: "funds_payment_method",
  428. })
  429. .then((res) => {
  430. fundsPaymentMethod.value = res.rows;
  431. });
  432. // 货币
  433. proxy
  434. .post("/dictTenantData/page", {
  435. pageNum: 1,
  436. pageSize: 999,
  437. dictCode: "account_currency",
  438. tenantId: useUserStore().user.tenantId,
  439. })
  440. .then((res) => {
  441. accountCurrency.value = res.rows;
  442. });
  443. proxy
  444. .post("/dictTenantData/page", {
  445. pageNum: 1,
  446. pageSize: 999,
  447. dictCode: "funds_cost_type",
  448. tenantId: useUserStore().user.tenantId,
  449. })
  450. .then((res) => {
  451. fundsCostType.value = res.rows;
  452. });
  453. proxy.post("/accountManagement/page", { pageNum: 1, pageSize: 9999 }).then((res) => {
  454. accountData.value = res.rows.map((item) => {
  455. return {
  456. ...item,
  457. label: item.alias,
  458. value: item.id,
  459. };
  460. });
  461. });
  462. };
  463. getDictData();
  464. getList();
  465. const openPrint = ref(false);
  466. const loadingPrint = ref(false);
  467. const printDetails = ref({});
  468. const clickPrint = (row) => {
  469. loadingPrint.value = true;
  470. openPrint.value = true;
  471. proxy.post("/accountRequestFunds/detail", { id: row.id }).then((res) => {
  472. printDetails.value = res;
  473. proxy.post("/flowExample/getApprovalRecord", { id: row.flowInfoId }).then((res) => {
  474. printDetails.value.recordList = res.recordList;
  475. });
  476. });
  477. };
  478. const clickDownload = () => {
  479. proxy.getPdf("请款PDF文件");
  480. };
  481. </script>
  482. <style lang="scss" scoped>
  483. .tenant {
  484. padding: 20px;
  485. }
  486. .baseRow {
  487. min-height: 24px;
  488. border-top: 1px solid black;
  489. }
  490. .contentRow {
  491. border-right: 1px solid black;
  492. line-height: 24px;
  493. padding-left: 4px;
  494. }
  495. .specialRow {
  496. font-size: 14px;
  497. font-weight: 700;
  498. text-align: center;
  499. border-top: 1px solid black;
  500. height: 30px;
  501. line-height: 30px;
  502. }
  503. </style>