index.vue 16 KB

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