index.vue 15 KB

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