index.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548
  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:code="{ row }">
  66. <el-link
  67. type="primary"
  68. :underline="false"
  69. @click="handleDetail(row, 'view')"
  70. >
  71. {{ row.code }}
  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 './components/paymentDialog.vue';
  129. import searchTable from './searchTable.vue';
  130. import detailDialog from './components/detailDialog.vue';
  131. import invoiceDetailDialog from '../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-7a7a5e23-payableManage',
  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: 'code',
  206. label: '应付编码',
  207. align: 'center',
  208. slot: 'code',
  209. showOverflowTooltip: true
  210. },
  211. {
  212. minWidth: 160,
  213. prop: 'receiptPlanOrderNo',
  214. label: '付款计划编码',
  215. align: 'center',
  216. slot: 'receiptPlanOrderNo',
  217. showOverflowTooltip: true
  218. },
  219. {
  220. minWidth: 160,
  221. prop: 'saleOrderNo',
  222. label: '订单编码',
  223. align: 'center',
  224. slot: 'saleOrderNo',
  225. showOverflowTooltip: true
  226. },
  227. {
  228. minWidth: 150,
  229. prop: 'contractCode',
  230. label: '合同编码',
  231. align: 'center',
  232. slot: 'contractCode',
  233. showOverflowTooltip: true
  234. },
  235. {
  236. minWidth: 150,
  237. prop: 'contractNo',
  238. label: '合同编号',
  239. align: 'center',
  240. slot: 'contractNo',
  241. showOverflowTooltip: true
  242. },
  243. {
  244. minWidth: 150,
  245. prop: 'contractName',
  246. label: '合同名称',
  247. align: 'center',
  248. slot: 'contractName',
  249. showOverflowTooltip: true
  250. },
  251. {
  252. minWidth: 150,
  253. prop: 'invoiceCode',
  254. label: '关联发票编码',
  255. slot: 'invoiceCode',
  256. align: 'center',
  257. showOverflowTooltip: true
  258. },
  259. {
  260. minWidth: 150,
  261. prop: 'invoiceNos',
  262. label: '发票号',
  263. align: 'center',
  264. slot: 'invoiceNos',
  265. showOverflowTooltip: true
  266. },
  267. {
  268. minWidth: 150,
  269. prop: 'customerNo',
  270. label: '客户编码',
  271. align: 'center',
  272. slot: 'customerNo',
  273. showOverflowTooltip: true
  274. },
  275. {
  276. minWidth: 150,
  277. prop: 'contactName',
  278. label: '客户名称',
  279. align: 'center',
  280. slot: 'contactName',
  281. showOverflowTooltip: true
  282. },
  283. {
  284. minWidth: 130,
  285. prop: 'paymentTypeName',
  286. label: '款项类型',
  287. align: 'center',
  288. slot: 'paymentTypeName',
  289. showOverflowTooltip: true
  290. },
  291. {
  292. minWidth: 100,
  293. prop: 'orderAmount',
  294. label: '订单总额',
  295. align: 'center',
  296. showOverflowTooltip: true
  297. },
  298. {
  299. minWidth: 100,
  300. prop: 'payableTotalPrice',
  301. label: '应付金额',
  302. align: 'center',
  303. slot: 'payableTotalPrice',
  304. showOverflowTooltip: true
  305. },
  306. {
  307. minWidth: 100,
  308. prop: 'paidTotalPrice',
  309. label: '已付金额',
  310. align: 'center',
  311. slot: 'paidTotalPrice',
  312. showOverflowTooltip: true
  313. },
  314. {
  315. minWidth: 100,
  316. prop: 'unpaidTotalPrice',
  317. label: '未付金额',
  318. align: 'center',
  319. slot: 'unpaidTotalPrice',
  320. showOverflowTooltip: true
  321. },
  322. {
  323. minWidth: 100,
  324. prop: 'invoiceAmount',
  325. label: '已开票金额',
  326. align: 'center',
  327. slot: 'invoiceAmount',
  328. showOverflowTooltip: true
  329. },
  330. {
  331. minWidth: 100,
  332. prop: 'unInvoiceAmount',
  333. label: '未开票金额',
  334. align: 'center',
  335. slot: 'unInvoiceAmount',
  336. showOverflowTooltip: true
  337. },
  338. {
  339. minWidth: 140,
  340. prop: 'payableDate',
  341. label: '实际付款日期',
  342. slot: 'payableDate',
  343. align: 'center',
  344. showOverflowTooltip: true
  345. },
  346. {
  347. minWidth: 120,
  348. prop: 'createUserName',
  349. label: '创建人',
  350. align: 'center',
  351. slot: 'createUserName',
  352. showOverflowTooltip: true
  353. },
  354. {
  355. minWidth: 120,
  356. prop: 'createTime',
  357. label: '创建时间',
  358. align: 'center',
  359. slot: 'createTime',
  360. showOverflowTooltip: true
  361. },
  362. {
  363. minWidth: 120,
  364. prop: 'accountingSubjectName',
  365. label: '会计科目',
  366. align: 'center',
  367. slot: 'accountingSubjectName',
  368. showOverflowTooltip: true
  369. },
  370. {
  371. prop: 'transactionMode',
  372. label: '交易方式',
  373. align: 'center',
  374. showOverflowTooltip: true,
  375. minWidth: 200,
  376. formatter: (row) => {
  377. return this.transactionMethodsOp.find(item => item.value == row.transactionMode)?.label || '';
  378. }
  379. },
  380. {
  381. prop: 'invoiceStatus',
  382. label: '开票状态',
  383. align: 'center',
  384. showOverflowTooltip: true,
  385. minWidth: 100,
  386. formatter: (_row, _column, cellValue) => {
  387. return this.invoiceStatusOp.find(item => item.value == cellValue)?.label || '';
  388. }
  389. },
  390. {
  391. minWidth: 100,
  392. prop: 'status',
  393. label: '付款状态',
  394. align: 'center',
  395. slot: 'status',
  396. showOverflowTooltip: true,
  397. formatter: (_row, _column, cellValue) => {
  398. return this.paymentType.find((item) => item.value == cellValue)
  399. .label;
  400. }
  401. },
  402. {
  403. minWidth: 130,
  404. prop: 'remark',
  405. label: '来源备注',
  406. align: 'center',
  407. showOverflowTooltip: true
  408. },
  409. {
  410. prop: 'externalId',
  411. label: '是否推送',
  412. align: 'center',
  413. showOverflowTooltip: true,
  414. minWidth: 120,
  415. formatter: (_row, _column, cellValue) => {
  416. return _row.externalId? '已推送' : '未推送';
  417. }
  418. },
  419. {
  420. minWidth: 100,
  421. prop: 'approvalStatus',
  422. label: '审核状态',
  423. align: 'center',
  424. slot: 'approvalStatus',
  425. formatter: (_row, _column, cellValue) => {
  426. return reviewStatus[_row.approvalStatus];
  427. }
  428. },
  429. {
  430. columnKey: 'action',
  431. label: '操作',
  432. width: 150,
  433. align: 'center',
  434. resizable: false,
  435. slot: 'action',
  436. showOverflowTooltip: true,
  437. fixed: 'right'
  438. }
  439. ];
  440. }
  441. },
  442. created() {},
  443. methods: {
  444. getSummaries(param) {
  445. return getSummaries(
  446. param,
  447. ['payableTotalPrice', 'paidTotalPrice', 'unpaidTotalPrice', 'invoiceAmount', 'unInvoiceAmount'],
  448. ' '
  449. );
  450. },
  451. //新增发票
  452. openEdit(row) {
  453. this.addOrEditDialogNewFlag = true;
  454. this.$nextTick(() => {
  455. this.$refs.addOrEditDialogNewRef.createInvoice1([row], '2', 4);
  456. });
  457. // this.$refs.addOrEditDialogNewRef.$refs.form &&
  458. // this.$refs.addOrEditDialogNewRef.$refs.form.clearValidate();
  459. },
  460. allPushBtn() {
  461. const dataId = this.selection.map((v) => v.id);
  462. purchasePayableBill(dataId).then((res) => {
  463. this.$message.success('推送成功!');
  464. this.reload();
  465. });
  466. },
  467. handleCollection(row = {}, type) {
  468. this.paymentDialogFlag = true;
  469. this.$nextTick(() => {
  470. this.$refs.collectionDialogRef.init(row, type);
  471. });
  472. },
  473. handleDetail(row = {}, type) {
  474. this.detailDialogFlag = true;
  475. this.$nextTick(() => {
  476. this.$refs.detailDialogRef.init(row.id);
  477. });
  478. },
  479. handleInvoiceDetail(row = {}, type) {
  480. this.invoiceDetailDialogFlag = true;
  481. this.$nextTick(() => {
  482. let params = {
  483. id: row.invoiceId
  484. };
  485. this.$refs.invoiceDetailDialogRef.init(params, type);
  486. });
  487. },
  488. /* 表格数据源 */
  489. datasource({ page, limit, where, order }) {
  490. return finPayablePageListAPI({
  491. pageNum: page,
  492. size: limit,
  493. ...where
  494. });
  495. },
  496. sub(res) {
  497. this.processSubmitDialogFlag = true;
  498. let params = {
  499. businessId: res.id,
  500. businessKey: 'fin_payable_approve',
  501. formCreateUserId: res.createUserId,
  502. variables: {
  503. businessCode: res.code,
  504. businessName: res.contactName,
  505. businessType: '应付'
  506. }
  507. };
  508. this.$nextTick(() => {
  509. this.$refs.processSubmitDialogRef.init(params);
  510. });
  511. },
  512. /* 刷新表格 */
  513. reload(where) {
  514. this.$nextTick(() => {
  515. this.$refs.table.reload({ page: 1, where });
  516. });
  517. }
  518. }
  519. };
  520. </script>
  521. <style lang="scss" scoped>
  522. :deep(.el-link--inner) {
  523. margin-left: 0px !important;
  524. }
  525. .sys-organization-list {
  526. height: calc(100vh - 264px);
  527. box-sizing: border-box;
  528. border-width: 1px;
  529. border-style: solid;
  530. overflow: auto;
  531. }
  532. .sys-organization-list :deep(.el-tree-node__content) {
  533. height: 40px;
  534. & > .el-tree-node__expand-icon {
  535. margin-left: 10px;
  536. }
  537. }
  538. </style>