index.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570
  1. <template>
  2. <div class="ele-body">
  3. <el-card shadow="never" v-loading="loading">
  4. <search-table @search="reload"></search-table>
  5. <!-- 数据表格 -->
  6. <div>
  7. <ele-pro-table
  8. ref="table"
  9. :columns="columns"
  10. :datasource="datasource"
  11. height="calc(100vh - 375px)"
  12. full-height="calc(100vh - 116px)"
  13. tool-class="ele-toolbar-form"
  14. :selection.sync="selection"
  15. :page-size="20"
  16. @columns-change="handleColumnChange"
  17. :cache-key="cacheKeyUrl"
  18. show-summary
  19. :summary-method="getSummaries"
  20. @header-dragend="handleHeaderDragend"
  21. >
  22. <!-- 表头工具栏 -->
  23. <template v-slot:toolbar>
  24. <!-- <el-button
  25. v-if="$hasPermission('eom:finpayable:push')"
  26. size="small"
  27. type="primary"
  28. class="ele-btn-icon"
  29. @click="allPushBtn"
  30. :disabled="selection?.length === 0"
  31. >
  32. 批量推送
  33. </el-button> -->
  34. </template>
  35. <!-- 操作 -->
  36. <template v-slot:action="{ row }">
  37. <el-link
  38. type="primary"
  39. v-if="canAddInvoice(row)"
  40. :underline="false"
  41. icon="el-icon-plus"
  42. @click="openEdit(row)"
  43. >
  44. 新增发票
  45. </el-link>
  46. <!-- <el-link
  47. type="primary"
  48. v-if="[2].includes(row.approvalStatus)"
  49. :underline="false"
  50. icon="el-icon-plus"
  51. @click="handleCollection(row, 'update')"
  52. >
  53. 付款
  54. </el-link> -->
  55. <!-- <el-link
  56. type="primary"
  57. :underline="false"
  58. icon="el-icon-plus"
  59. @click="sub(row)"
  60. v-if="[0, 3].includes(row.approvalStatus)"
  61. >
  62. 提交
  63. </el-link> -->
  64. </template>
  65. <!-- 收款信息 -->
  66. <template v-slot:detailCode="{ row }">
  67. <el-link
  68. type="primary"
  69. :underline="false"
  70. @click="handleDetail(row, 'view')"
  71. >
  72. {{ row.detailCode }}
  73. </el-link>
  74. </template>
  75. <!-- 开票信息 -->
  76. <template v-slot:invoiceCode="{ row }">
  77. <div v-for="(code, index) in splitInvoiceCodes(row.invoiceCode)" :key="`code-${index}`">
  78. <span v-if="index > 0">,</span>
  79. <el-link
  80. type="primary"
  81. :underline="false"
  82. @click="handleInvoiceDetail(row, code, 'view')"
  83. >
  84. {{ code }}
  85. </el-link>
  86. </div>
  87. </template>
  88. </ele-pro-table>
  89. </div>
  90. </el-card>
  91. <!-- 付款信息-->
  92. <payment-dialog1
  93. ref="collectionDialogRef"
  94. v-if="paymentDialogFlag"
  95. :payment-dialog-flag.sync="paymentDialogFlag"
  96. @reload="reload"
  97. ></payment-dialog1>
  98. <detail-dialog
  99. ref="detailDialogRef"
  100. v-if="detailDialogFlag"
  101. :detail-dialog-flag.sync="detailDialogFlag"
  102. ></detail-dialog>
  103. <!--开票详情-->
  104. <invoice-detail-dialog
  105. ref="invoiceDetailDialogRef"
  106. v-if="invoiceDetailDialogFlag"
  107. :detailDialogFlag.sync="invoiceDetailDialogFlag"
  108. ></invoice-detail-dialog>
  109. <process-submit-dialog
  110. api-fun-name="fininvoiceapplyStatusAPI"
  111. :processSubmitDialogFlag.sync="processSubmitDialogFlag"
  112. isCloseRefresh="false"
  113. v-if="processSubmitDialogFlag"
  114. ref="processSubmitDialogRef"
  115. @reload="reload"
  116. ></process-submit-dialog>
  117. <!-- 开票 -->
  118. <!-- <addOrEditDialogNew
  119. ref="addOrEditDialogNewRef"
  120. :add-or-edit-dialog-flag.sync="addOrEditDialogNewFlag"
  121. v-if="addOrEditDialogNewFlag"
  122. :isEditType="false"
  123. @reload="reload"
  124. /> -->
  125. </div>
  126. </template>
  127. <script>
  128. import { getSummaries } from '@/utils/util.js';
  129. import { reviewStatus } from '@/enum/dict';
  130. import dictMixins from '@/mixins/dictMixins';
  131. import { finPayablePageListAPI, purchasePayableBill } from '@/api/financialManage/payableManage';
  132. import paymentDialog1 from '@/views/financialManage/payableManage/components/paymentDialog1.vue';
  133. import searchTable from '@/views/financialManage/payableManage/searchTable.vue';
  134. import detailDialog from '@/views/financialManage/payableManage/components/detailDialog.vue';
  135. import invoiceDetailDialog from '@/views/financialManage/invoiceManage/components/detailDialog.vue';
  136. import processSubmitDialog from '@/BIZComponents/processSubmitDialog/processSubmitDialog.vue';
  137. import tabMixins from '@/mixins/tableColumnsMixin';
  138. import { shippingModeOp, transactionMethodsOp, paymentTypeOp, paymentType, invoiceStatusOp } from '@/enum/dict.js';
  139. // import addOrEditDialogNew from '@/views/financialManage/invoiceManage/components/addOrEditDialogNew.vue'
  140. export default {
  141. mixins: [dictMixins, tabMixins],
  142. components: {
  143. searchTable,
  144. paymentDialog1,
  145. detailDialog,
  146. invoiceDetailDialog,
  147. processSubmitDialog,
  148. // addOrEditDialogNew
  149. },
  150. data() {
  151. return {
  152. // 加载状态
  153. loading: false,
  154. paymentDialogFlag: false,
  155. detailDialogFlag: false,
  156. invoiceDetailDialogFlag: false,
  157. processSubmitDialogFlag: false,
  158. shippingModeOp,
  159. invoiceStatusOp,
  160. transactionMethodsOp,
  161. paymentTypeOp,
  162. selection: [],
  163. addOrEditDialogNewFlag: false,
  164. paymentType,
  165. statusList: [
  166. {
  167. label: '未付款',
  168. value: 0
  169. },
  170. {
  171. label: '部分付款',
  172. value: 1
  173. },
  174. {
  175. label: '已付全款',
  176. value: 2
  177. }
  178. ],
  179. cacheKeyUrl: 'eos-202606251119-paidManagement-index',
  180. columnsVersion: 1
  181. };
  182. },
  183. computed: {
  184. canAddInvoice() {
  185. return function(row) {
  186. if (!row) return false;
  187. // 审核通过 && 先款后票 && 票没开完 && 未开票金额 > 0
  188. return [2].includes(row.approvalStatus) && row.transactionMode == 2 && row.invoiceStatus != 2 && row.unInvoiceAmount && +row.unInvoiceAmount > 0;
  189. };
  190. },
  191. columns() {
  192. // 当columnsVersion变化时会重新计算,用作更新列配置
  193. const version = this.columnsVersion;
  194. return this.applyColumnWidth([
  195. {
  196. width: 45,
  197. type: 'selection',
  198. columnKey: 'selection',
  199. align: 'center'
  200. },
  201. {
  202. width: 60,
  203. label: '序号',
  204. type: 'index',
  205. columnKey: 'index',
  206. align: 'center'
  207. },
  208. {
  209. minWidth: 150,
  210. prop: 'detailCode',
  211. label: '已付编码',
  212. align: 'center',
  213. slot: 'detailCode',
  214. showOverflowTooltip: true
  215. },
  216. {
  217. minWidth: 150,
  218. prop: 'code',
  219. label: '应付编码',
  220. align: 'center',
  221. slot: 'code',
  222. showOverflowTooltip: true
  223. },
  224. {
  225. minWidth: 160,
  226. prop: 'receiptPlanOrderNo',
  227. label: '付款计划编码',
  228. align: 'center',
  229. slot: 'receiptPlanOrderNo',
  230. showOverflowTooltip: true
  231. },
  232. {
  233. minWidth: 160,
  234. prop: 'saleOrderNo',
  235. label: '订单编码',
  236. align: 'center',
  237. slot: 'saleOrderNo',
  238. showOverflowTooltip: true
  239. },
  240. {
  241. minWidth: 150,
  242. prop: 'contractCode',
  243. label: '合同编码',
  244. align: 'center',
  245. slot: 'contractCode',
  246. showOverflowTooltip: true
  247. },
  248. {
  249. minWidth: 150,
  250. prop: 'contractNo',
  251. label: '合同编号',
  252. align: 'center',
  253. slot: 'contractNo',
  254. showOverflowTooltip: true
  255. },
  256. {
  257. minWidth: 150,
  258. prop: 'contractName',
  259. label: '合同名称',
  260. align: 'center',
  261. slot: 'contractName',
  262. showOverflowTooltip: true
  263. },
  264. {
  265. minWidth: 150,
  266. prop: 'invoiceCode',
  267. label: '关联发票编码',
  268. slot: 'invoiceCode',
  269. align: 'center',
  270. showOverflowTooltip: true
  271. },
  272. {
  273. minWidth: 150,
  274. prop: 'invoiceNos',
  275. label: '发票号',
  276. align: 'center',
  277. slot: 'invoiceNos',
  278. showOverflowTooltip: true
  279. },
  280. {
  281. minWidth: 150,
  282. prop: 'customerNo',
  283. label: '客户编码',
  284. align: 'center',
  285. slot: 'customerNo',
  286. showOverflowTooltip: true
  287. },
  288. {
  289. minWidth: 150,
  290. prop: 'contactName',
  291. label: '客户名称',
  292. align: 'center',
  293. slot: 'contactName',
  294. showOverflowTooltip: true
  295. },
  296. {
  297. minWidth: 130,
  298. prop: 'paymentTypeName',
  299. label: '款项类型',
  300. align: 'center',
  301. slot: 'paymentTypeName',
  302. showOverflowTooltip: true
  303. },
  304. {
  305. minWidth: 100,
  306. prop: 'payableTotalPrice',
  307. label: '应付金额',
  308. align: 'center',
  309. slot: 'payableTotalPrice',
  310. showOverflowTooltip: true
  311. },
  312. {
  313. minWidth: 100,
  314. prop: 'paidTotalPrice',
  315. label: '已付金额',
  316. align: 'center',
  317. slot: 'paidTotalPrice',
  318. showOverflowTooltip: true
  319. },
  320. {
  321. minWidth: 100,
  322. prop: 'unpaidTotalPrice',
  323. label: '未付金额',
  324. align: 'center',
  325. slot: 'unpaidTotalPrice',
  326. showOverflowTooltip: true
  327. },
  328. {
  329. minWidth: 100,
  330. prop: 'invoiceAmount',
  331. label: '已开票金额',
  332. align: 'center',
  333. slot: 'invoiceAmount',
  334. showOverflowTooltip: true
  335. },
  336. {
  337. minWidth: 100,
  338. prop: 'unInvoiceAmount',
  339. label: '未开票金额',
  340. align: 'center',
  341. slot: 'unInvoiceAmount',
  342. showOverflowTooltip: true
  343. },
  344. {
  345. minWidth: 140,
  346. prop: 'payableDate',
  347. label: '实际付款日期',
  348. slot: 'payableDate',
  349. align: 'center',
  350. showOverflowTooltip: true
  351. },
  352. {
  353. minWidth: 120,
  354. prop: 'createUserName',
  355. label: '创建人',
  356. align: 'center',
  357. slot: 'createUserName',
  358. showOverflowTooltip: true
  359. },
  360. {
  361. minWidth: 120,
  362. prop: 'createTime',
  363. label: '创建时间',
  364. align: 'center',
  365. slot: 'createTime',
  366. showOverflowTooltip: true
  367. },
  368. {
  369. minWidth: 120,
  370. prop: 'accountingSubjectName',
  371. label: '会计科目',
  372. align: 'center',
  373. slot: 'accountingSubjectName',
  374. showOverflowTooltip: true
  375. },
  376. {
  377. prop: 'transactionMode',
  378. label: '交易方式',
  379. align: 'center',
  380. showOverflowTooltip: true,
  381. minWidth: 200,
  382. formatter: (row) => {
  383. return this.transactionMethodsOp.find(item => item.value == row.transactionMode)?.label || '';
  384. }
  385. },
  386. {
  387. prop: 'invoiceStatus',
  388. label: '开票状态',
  389. align: 'center',
  390. showOverflowTooltip: true,
  391. minWidth: 100,
  392. formatter: (_row, _column, cellValue) => {
  393. return this.invoiceStatusOp.find(item => item.value == cellValue)?.label || '';
  394. }
  395. },
  396. {
  397. minWidth: 100,
  398. prop: 'status',
  399. label: '付款状态',
  400. align: 'center',
  401. slot: 'status',
  402. showOverflowTooltip: true,
  403. formatter: (_row, _column, cellValue) => {
  404. return this.paymentType.find((item) => item.value == cellValue)
  405. .label;
  406. }
  407. },
  408. {
  409. minWidth: 130,
  410. prop: 'remark',
  411. label: '来源备注',
  412. align: 'center',
  413. showOverflowTooltip: true
  414. },
  415. {
  416. prop: 'externalId',
  417. label: '是否推送',
  418. align: 'center',
  419. showOverflowTooltip: true,
  420. minWidth: 120,
  421. formatter: (_row, _column, cellValue) => {
  422. return _row.externalId? '已推送' : '未推送';
  423. }
  424. },
  425. {
  426. minWidth: 100,
  427. prop: 'approvalStatus',
  428. label: '审核状态',
  429. align: 'center',
  430. slot: 'approvalStatus',
  431. formatter: (_row, _column, cellValue) => {
  432. return reviewStatus[_row.approvalStatus];
  433. }
  434. },
  435. {
  436. columnKey: 'action',
  437. label: '操作',
  438. width: 150,
  439. align: 'center',
  440. resizable: false,
  441. slot: 'action',
  442. showOverflowTooltip: true,
  443. fixed: 'right'
  444. }
  445. ]);
  446. }
  447. },
  448. created() {},
  449. methods: {
  450. getSummaries(param) {
  451. return getSummaries(
  452. param,
  453. ['payableTotalPrice', 'paidTotalPrice', 'unpaidTotalPrice', 'invoiceAmount', 'unInvoiceAmount'],
  454. ' '
  455. );
  456. },
  457. //新增发票
  458. openEdit(row) {
  459. this.addOrEditDialogNewFlag = true;
  460. this.$nextTick(() => {
  461. this.$refs.addOrEditDialogNewRef.createInvoice1([row], '2', 4);
  462. });
  463. // this.$refs.addOrEditDialogNewRef.$refs.form &&
  464. // this.$refs.addOrEditDialogNewRef.$refs.form.clearValidate();
  465. },
  466. allPushBtn() {
  467. const dataId = this.selection.map((v) => v.id);
  468. purchasePayableBill(dataId).then((res) => {
  469. this.$message.success('推送成功!');
  470. this.reload();
  471. });
  472. },
  473. handleCollection(row = {}, type) {
  474. this.paymentDialogFlag = true;
  475. this.$nextTick(() => {
  476. this.$refs.collectionDialogRef.open(row, type);
  477. });
  478. },
  479. handleDetail(row = {}, type) {
  480. this.detailDialogFlag = true;
  481. this.$nextTick(() => {
  482. this.$refs.detailDialogRef.init(row.id);
  483. });
  484. },
  485. splitInvoiceCodes(invoiceCode) {
  486. if (!invoiceCode) {
  487. return [];
  488. }
  489. return String(invoiceCode)
  490. .split(',')
  491. .map((item) => item.trim())
  492. .filter(Boolean);
  493. },
  494. handleInvoiceDetail(row = {}, invoiceCode, type) {
  495. const code = row.invoiceInfoList ? row.invoiceInfoList[invoiceCode] : row.invoiceId;
  496. if (!code) {
  497. this.$message.warning(`未找到发票${invoiceCode}的详情`);
  498. return;
  499. }
  500. this.invoiceDetailDialogFlag = true;
  501. this.$nextTick(() => {
  502. let params = {
  503. id: code
  504. };
  505. this.$refs.invoiceDetailDialogRef.init(params, type);
  506. });
  507. },
  508. /* 表格数据源 */
  509. datasource({ page, limit, where, order }) {
  510. return finPayablePageListAPI({
  511. paymentStatus: 1,
  512. receiptStatus: 1,
  513. pageNum: page,
  514. size: limit,
  515. ...where
  516. });
  517. },
  518. sub(res) {
  519. this.processSubmitDialogFlag = true;
  520. let params = {
  521. businessId: res.id,
  522. businessKey: 'fin_payable_approve',
  523. formCreateUserId: res.createUserId,
  524. variables: {
  525. businessCode: res.code,
  526. businessName: res.contactName,
  527. businessType: '应付'
  528. }
  529. };
  530. this.$nextTick(() => {
  531. this.$refs.processSubmitDialogRef.init(params);
  532. });
  533. },
  534. /* 刷新表格 */
  535. reload(where) {
  536. this.$nextTick(() => {
  537. this.$refs.table.reload({ page: 1, where });
  538. });
  539. }
  540. }
  541. };
  542. </script>
  543. <style lang="scss" scoped>
  544. :deep(.el-link--inner) {
  545. margin-left: 0px !important;
  546. }
  547. .sys-organization-list {
  548. height: calc(100vh - 264px);
  549. box-sizing: border-box;
  550. border-width: 1px;
  551. border-style: solid;
  552. overflow: auto;
  553. }
  554. .sys-organization-list :deep(.el-tree-node__content) {
  555. height: 40px;
  556. & > .el-tree-node__expand-icon {
  557. margin-left: 10px;
  558. }
  559. }
  560. </style>