index.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687
  1. <template>
  2. <div class="ele-body">
  3. <el-card shadow="never" v-loading="loading">
  4. <div class="switch">
  5. <div class="switch_left">
  6. <ul>
  7. <li
  8. v-for="item in tabOptions"
  9. :key="item.key"
  10. :class="{ active: activeComp == item.key }"
  11. @click="activeComp = item.key"
  12. style="height: 42px; line-height: 38px"
  13. >
  14. <!-- <el-badge :value="toDoReminder[item.reminder] || 0" class="item"> -->
  15. {{ item.name }}
  16. <!-- </el-badge> -->
  17. </li>
  18. </ul>
  19. </div>
  20. </div>
  21. <div class="main" style="padding: 0 10px">
  22. <div v-if="activeComp == 'paymentPlan'">
  23. <div class="ele-border-lighter form-content" v-loading="loading">
  24. <search-table @search="reload"></search-table>
  25. <!-- 数据表格 -->
  26. <ele-pro-table
  27. ref="table"
  28. :columns="columns"
  29. :datasource="datasource"
  30. height="calc(100vh - 365px)"
  31. style="margin-bottom: 10px"
  32. full-height="calc(100vh - 116px)"
  33. tool-class="ele-toolbar-form"
  34. :selection.sync="selection"
  35. :page-size="20"
  36. @columns-change="handleColumnChange"
  37. :cache-key="cacheKeyUrl"
  38. >
  39. <!-- 表头工具栏 -->
  40. <template v-slot:toolbar>
  41. <el-button
  42. size="small"
  43. type="primary"
  44. icon="el-icon-plus"
  45. class="ele-btn-icon"
  46. @click="openEdit('add')"
  47. >
  48. 合并开票
  49. </el-button>
  50. </template>
  51. <!-- 查看详情列 -->
  52. <template v-slot:detailNo="{ row }">
  53. <el-link
  54. type="primary"
  55. :underline="false"
  56. @click="openDetail(row, 'detailNo')"
  57. >
  58. {{ row.detailNo }}
  59. </el-link>
  60. </template>
  61. <template v-slot:sourceOrderNo="{ row }">
  62. <el-link
  63. type="primary"
  64. :underline="false"
  65. @click="openDetail(row, 'sourceOrderNo')"
  66. >
  67. {{ row.sourceOrderNo }}
  68. </el-link>
  69. </template>
  70. <template v-slot:contractNo="{ row }">
  71. <el-link
  72. type="primary"
  73. :underline="false"
  74. @click="openDetail(row, 'contractNo')"
  75. >
  76. {{ row.contractNo }}
  77. </el-link>
  78. </template>
  79. <!-- <template v-slot:invoiceOrderNo="{ row }">
  80. <el-link
  81. type="primary"
  82. :underline="false"
  83. @click="openDetail(row, 'invoiceOrderNo')"
  84. >
  85. {{ row.invoiceOrderNo }}
  86. </el-link>
  87. </template> -->
  88. <template v-slot:relatedReceivableOrderNo="{ row }">
  89. <el-link
  90. type="primary"
  91. :underline="false"
  92. @click="openDetail(row, 'relatedReceivableOrderNo')"
  93. >
  94. {{ row.relatedReceivableOrderNo }}
  95. </el-link>
  96. </template>
  97. <!-- 操作列 -->
  98. <template v-slot:action="{ row }">
  99. <el-link
  100. type="primary"
  101. :underline="false"
  102. icon="el-icon-edit"
  103. v-if="
  104. (isNeed_process_is_close &&
  105. [0, 3].includes(row.orderStatus)) ||
  106. !isNeed_process_is_close
  107. "
  108. @click="openEdit('edit', row)"
  109. >
  110. 修改
  111. </el-link>
  112. <el-link
  113. type="primary"
  114. :underline="false"
  115. icon="el-icon-plus"
  116. @click="saleOrderSubmit(row)"
  117. v-if="
  118. isNeed_process_is_close && [0, 3].includes(row.orderStatus)
  119. "
  120. >
  121. 提交
  122. </el-link>
  123. <el-popconfirm
  124. class="ele-action"
  125. title="确定要删除此信息吗?"
  126. v-if="
  127. (isNeed_process_is_close &&
  128. [0, 3].includes(row.orderStatus)) ||
  129. !isNeed_process_is_close
  130. "
  131. @confirm="remove([row.id])"
  132. >
  133. <template v-slot:reference>
  134. <el-link
  135. type="danger"
  136. :underline="false"
  137. icon="el-icon-delete"
  138. >
  139. 删除
  140. </el-link>
  141. </template>
  142. </el-popconfirm>
  143. <el-link
  144. type="primary"
  145. :underline="false"
  146. icon="el-icon-plus"
  147. v-if="row.invoiceStatus != 2"
  148. @click="openEdit('add', row)"
  149. >
  150. 新增发票
  151. </el-link>
  152. </template>
  153. </ele-pro-table>
  154. </div>
  155. </div>
  156. </div>
  157. </el-card>
  158. <detailDialog ref="detailDialogRef" menu="purchase"></detailDialog>
  159. <contractr-detail ref="contractDetailRef"></contractr-detail>
  160. <purchasingDetail ref="purchasingDetailRef"></purchasingDetail>
  161. <!-- 开票 -->
  162. <addOrEditDialogNew
  163. ref="addOrEditDialogNewRef"
  164. :add-or-edit-dialog-flag.sync="addOrEditDialogNewFlag"
  165. v-if="addOrEditDialogNewFlag"
  166. :isEditType="false"
  167. @reload="reload"
  168. />
  169. <payableOrderDetailDialog ref="payableOrderDetailDialogRef" v-if="payableOrderDetailDialogFlag" :detail-dialog-flag.sync="payableOrderDetailDialogFlag"></payableOrderDetailDialog>
  170. </div>
  171. </template>
  172. <script>
  173. import searchTable from './components/searchTable.vue';
  174. import detailDialog from '@/views/financialManage/collectionPlan/components/detailDialog.vue';
  175. import contractrDetail from '@/views/contractManage/contractBook/components/detailDialog.vue';
  176. import purchasingDetail from '@/views/purchasingManage/purchaseOrder/components/detailDialog.vue';
  177. import dictMixins from '@/mixins/dictMixins';
  178. import tabMixins from '@/mixins/tableColumnsMixin';
  179. import { receiptPaymentPlanPage } from '@/api/financialManage/payAndCollectPlan';
  180. import { shippingModePurchaseOp, transactionMethodsOp, paymentTypeOp, paymentType, invoiceStatusOp } from '@/enum/dict.js';
  181. import addOrEditDialogNew from '@/views/financialManage/invoiceManage/components/addOrEditDialogNew.vue'
  182. import invoiceDetailDialog from '@/views/financialManage/invoiceManage/components/detailDialog.vue';
  183. import payableOrderDetailDialog from '@/views/financialManage/payableManage/components/detailDialog.vue';
  184. export default {
  185. mixins: [dictMixins, tabMixins],
  186. components: {
  187. searchTable,
  188. contractrDetail,
  189. purchasingDetail,
  190. detailDialog,
  191. addOrEditDialogNew,
  192. invoiceDetailDialog,
  193. payableOrderDetailDialog,
  194. },
  195. data() {
  196. return {
  197. activeComp: 'paymentPlan',
  198. payableOrderDetailDialogFlag: false,
  199. addOrEditDialogNewFlag: false,
  200. shippingModePurchaseOp,
  201. transactionMethodsOp,
  202. paymentTypeOp,
  203. paymentType,
  204. invoiceStatusOp,
  205. tabOptions: [
  206. { key: 'paymentPlan', name: '付款计划管理', reminder: 'purchaseOrderNum' },
  207. ],
  208. selection: [], //单选中集合
  209. loading: false, // 加载状态
  210. addOrEditDialogFlag: false,
  211. addOrEditDialogFlag1: false,
  212. params: {},
  213. groupName: '',
  214. columns: [
  215. {
  216. width: 45,
  217. type: 'selection',
  218. columnKey: 'selection',
  219. align: 'center',
  220. fixed: 'left'
  221. },
  222. {
  223. columnKey: 'index',
  224. label: '序号',
  225. type: 'index',
  226. width: 55,
  227. align: 'center',
  228. showOverflowTooltip: true,
  229. fixed: 'left'
  230. },
  231. {
  232. prop: 'detailNo',
  233. label: '付款计划编码',
  234. align: 'center',
  235. sortable: true,
  236. slot: 'detailNo',
  237. showOverflowTooltip: true,
  238. minWidth: 200,
  239. },
  240. {
  241. prop: 'sourceOrderNo',
  242. label: '订单编码',
  243. align: 'center',
  244. sortable: true,
  245. slot: 'sourceOrderNo',
  246. showOverflowTooltip: true,
  247. minWidth: 200,
  248. },
  249. {
  250. prop: 'sourceOrderType',
  251. label: '订单类型',
  252. align: 'center',
  253. sortable: true,
  254. showOverflowTooltip: true,
  255. minWidth: 200,
  256. formatter: (row) => {
  257. return row.sourceOrderType == 2 ? '采购订单' : '销售订单';
  258. }
  259. },
  260. {
  261. prop: 'contractNo',
  262. label: '合同编码',
  263. align: 'center',
  264. sortable: true,
  265. slot: 'contractNo',
  266. showOverflowTooltip: true,
  267. minWidth: 200,
  268. },
  269. {
  270. prop: 'contractCode',
  271. label: '合同编号',
  272. align: 'center',
  273. sortable: true,
  274. showOverflowTooltip: true,
  275. minWidth: 200,
  276. },
  277. {
  278. prop: 'contractName',
  279. label: '合同名称',
  280. align: 'center',
  281. sortable: true,
  282. showOverflowTooltip: true,
  283. minWidth: 200,
  284. },
  285. {
  286. prop: 'invoiceOrderNo',
  287. label: '发票编码',
  288. align: 'center',
  289. sortable: true,
  290. slot: 'invoiceOrderNo',
  291. showOverflowTooltip: true,
  292. minWidth: 200,
  293. },
  294. {
  295. prop: 'invoiceNos',
  296. label: '发票号',
  297. align: 'center',
  298. sortable: true,
  299. slot: 'invoiceNos',
  300. showOverflowTooltip: true,
  301. minWidth: 200,
  302. },
  303. {
  304. prop: 'relatedReceivableOrderNo',
  305. label: '关联应付编码',
  306. align: 'center',
  307. slot: 'relatedReceivableOrderNo',
  308. showOverflowTooltip: true,
  309. minWidth: 150,
  310. },
  311. {
  312. prop: 'customerCode',
  313. label: '客户编码',
  314. align: 'center',
  315. slot: 'customerCode',
  316. showOverflowTooltip: true,
  317. minWidth: 250
  318. },
  319. {
  320. prop: 'customerName',
  321. label: '客户名称',
  322. align: 'center',
  323. showOverflowTooltip: true,
  324. minWidth: 200
  325. },
  326. {
  327. prop: 'initiatorName',
  328. label: '采购方名称',
  329. align: 'center',
  330. showOverflowTooltip: true,
  331. minWidth: 200
  332. },
  333. {
  334. prop: 'settlementMode',
  335. label: '结算方式',
  336. align: 'center',
  337. showOverflowTooltip: true,
  338. minWidth: 140,
  339. formatter: (row) => {
  340. return this.getDictValue('结算方式', row.settlementMode);
  341. }
  342. },
  343. {
  344. prop: 'transactionMode',
  345. label: '交易方式',
  346. align: 'center',
  347. showOverflowTooltip: true,
  348. minWidth: 200,
  349. formatter: (row) => {
  350. return this.transactionMethodsOp.find(item => item.value == row.transactionMode)?.label || '';
  351. }
  352. },
  353. {
  354. prop: 'deliveryMode',
  355. label: '收货模式',
  356. align: 'center',
  357. showOverflowTooltip: true,
  358. minWidth: 130,
  359. formatter: (row) => {
  360. return this.shippingModePurchaseOp.find(item => item.value == row.deliveryMode)?.label || '';
  361. }
  362. },
  363. {
  364. prop: 'issueNumber',
  365. label: '期数',
  366. align: 'center',
  367. showOverflowTooltip: true,
  368. minWidth: 130
  369. },
  370. {
  371. prop: 'paymentType',
  372. label: '款项类型',
  373. align: 'center',
  374. showOverflowTooltip: true,
  375. minWidth: 200,
  376. formatter: (row) => {
  377. return this.paymentTypeOp.find(item => item.value == row.paymentType)?.label || '';
  378. }
  379. },
  380. {
  381. prop: 'moneyName',
  382. label: '款项名称',
  383. align: 'center',
  384. showOverflowTooltip: true,
  385. minWidth: 140
  386. },
  387. {
  388. prop: 'paymentRatio',
  389. label: '比例',
  390. align: 'center',
  391. showOverflowTooltip: true,
  392. minWidth: 140,
  393. formatter: (row) => {
  394. return row.paymentRatio + '%';
  395. }
  396. },
  397. {
  398. prop: 'planPaymentAmount',
  399. label: '计划付款金额',
  400. align: 'center',
  401. showOverflowTooltip: true,
  402. minWidth: 140
  403. },
  404. {
  405. prop: 'planPaymentDate',
  406. label: '计划付款日期',
  407. align: 'center',
  408. showOverflowTooltip: true,
  409. minWidth: 140
  410. },
  411. {
  412. prop: 'isInvoice',
  413. label: '是否已开票',
  414. align: 'center',
  415. showOverflowTooltip: true,
  416. minWidth: 150,
  417. formatter: (_row, _column, cellValue) => {
  418. return cellValue ? '是' : '否';
  419. }
  420. },
  421. {
  422. prop: 'invoiceAmount',
  423. label: '已开票金额',
  424. align: 'center',
  425. showOverflowTooltip: true,
  426. minWidth: 120
  427. },
  428. {
  429. prop: 'invoiceDate',
  430. label: '开票日期',
  431. align: 'center',
  432. showOverflowTooltip: true,
  433. minWidth: 130
  434. },
  435. {
  436. prop: 'isGenerateReceivablePayment',
  437. label: '是否生成应付款项',
  438. align: 'center',
  439. showOverflowTooltip: true,
  440. minWidth: 150,
  441. formatter: (_row, _column, cellValue) => {
  442. return cellValue == 1 ? '是' : '否';
  443. }
  444. },
  445. {
  446. prop: 'receivableAmount',
  447. label: '应付金额',
  448. align: 'center',
  449. showOverflowTooltip: true,
  450. minWidth: 140
  451. },
  452. {
  453. prop: 'receivedAmount',
  454. label: '已付款金额',
  455. align: 'center',
  456. showOverflowTooltip: true,
  457. minWidth: 170
  458. },
  459. {
  460. prop: 'actualReceivablePaymentDate',
  461. label: '实际付款日期',
  462. align: 'center',
  463. showOverflowTooltip: true,
  464. minWidth: 170
  465. },
  466. {
  467. prop: 'deliveryStatus',
  468. label: '收货状态',
  469. align: 'center',
  470. showOverflowTooltip: true,
  471. formatter: (_row, _column, cellValue) => {
  472. let options = [
  473. { value: 0, label: '待收货' },
  474. { value: 1, label: '部分收货' },
  475. { value: 2, label: '全部收货' }
  476. ];
  477. return options.find(item => item.value == cellValue)?.label || '';
  478. },
  479. minWidth: 120
  480. },
  481. {
  482. prop: 'reconciliationStatus',
  483. label: '对账状态',
  484. align: 'center',
  485. showOverflowTooltip: true,
  486. minWidth: 100,
  487. formatter: (_row, _column, cellValue) => {
  488. let options = [
  489. { value: 0, label: '未对账' },
  490. { value: 1, label: '部分对账' },
  491. { value: 2, label: '全部对账' }
  492. ];
  493. return options.find(item => item.value == cellValue)?.label || '';
  494. }
  495. },
  496. {
  497. prop: 'paymentStatus',
  498. label: '付款状态',
  499. align: 'center',
  500. showOverflowTooltip: true,
  501. minWidth: 100,
  502. formatter: (_row, _column, cellValue) => {
  503. return this.paymentType.find(item => item.value == cellValue)?.label || '';
  504. }
  505. },
  506. {
  507. prop: 'invoiceStatus',
  508. label: '开票状态',
  509. align: 'center',
  510. showOverflowTooltip: true,
  511. minWidth: 100,
  512. formatter: (_row, _column, cellValue) => {
  513. return this.invoiceStatusOp.find(item => item.value == cellValue)?.label || '';
  514. }
  515. },
  516. {
  517. prop: 'overdueStatus',
  518. label: '逾期状态',
  519. align: 'center',
  520. showOverflowTooltip: true,
  521. minWidth: 100,
  522. formatter: (_row, _column, cellValue) => {
  523. return _row.overdueStatus == 1 ? '逾期中' : '未逾期';
  524. }
  525. },
  526. {
  527. columnKey: 'action',
  528. label: '操作',
  529. width: 260,
  530. align: 'center',
  531. resizable: false,
  532. slot: 'action',
  533. showOverflowTooltip: true,
  534. fixed: 'right'
  535. }
  536. ],
  537. cacheKeyUrl: 'eos-5f2ac512-purchaseOrder-paymentPlan',
  538. };
  539. },
  540. computed: {},
  541. created() {
  542. this.requestDict('结算方式');
  543. this.requestDict('客户状态');
  544. },
  545. beforeDestroy() {
  546. },
  547. methods: {
  548. /* 表格数据源 1:销售订单、2:采购订单 */
  549. datasource({ page, limit, where, order }) {
  550. this.params = {
  551. pageNum: page,
  552. size: limit,
  553. sourceType: 2,
  554. ...where
  555. };
  556. return receiptPaymentPlanPage(this.params);
  557. },
  558. /* 刷新表格 */
  559. reload(where) {
  560. this.$refs.table.reload({ page: 1, where });
  561. },
  562. //新增编辑
  563. //新增编辑
  564. openEdit(type, row) {
  565. const select = []
  566. if(row) {
  567. select.push(row)
  568. } else {
  569. let customerIds = this.selection.map((item) => item.customerId);
  570. let initiatorIds = this.selection.map((item) => item.initiatorId);
  571. let invoiceStatus = this.selection.map((item) => item.invoiceStatus);
  572. console.log(customerIds, initiatorIds);
  573. if(invoiceStatus.includes(2)) {
  574. this.$message.warning('请选择未开票的计划!');
  575. return
  576. }
  577. if(this.selection.length == 0 || new Set(customerIds).size != 1 || new Set(initiatorIds).size != 1) {
  578. this.$message.warning('请选择相同客户和采购方的计划!');
  579. return
  580. }
  581. select.push(...this.selection)
  582. }
  583. this.addOrEditDialogNewFlag = true;
  584. this.$nextTick(() => {
  585. this.$refs.addOrEditDialogNewRef.createInvoice1(select, '2', 7);
  586. });
  587. // this.$refs.addOrEditDialogNewRef.$refs.form &&
  588. // this.$refs.addOrEditDialogNewRef.$refs.form.clearValidate();
  589. },
  590. //查看合同详情
  591. openDetail(row, type) {
  592. if(type == 'detailNo') {
  593. this.$refs.detailDialogRef.open(row, type);
  594. } else if(type == 'sourceOrderNo') {
  595. const params = {
  596. id: row.sourceOrderId
  597. }
  598. this.$refs.purchasingDetailRef.open(params);
  599. } else if(type == 'contractNo') {
  600. const params = {
  601. id: row.contractId
  602. }
  603. this.$refs.contractDetailRef.open(params);
  604. } else if(type == 'invoiceOrderNo') {
  605. const params = {
  606. id: row.invoiceId
  607. }
  608. this.detailDialogFlag = true;
  609. this.$nextTick(() => {
  610. this.$refs.invoiceDetailDialogRef.init(params, 'view');
  611. });
  612. } else if(type == 'relatedReceivableOrderNo') {
  613. this.payableOrderDetailDialogFlag = true;
  614. this.$nextTick(() => {
  615. this.$refs.payableOrderDetailDialogRef.init(row.relatedReceivableOrderId, 'view');
  616. });
  617. }
  618. },
  619. }
  620. };
  621. </script>
  622. <style lang="scss" scoped>
  623. :deep .el-card__body {
  624. padding: 0;
  625. }
  626. :deep(.el-link--inner) {
  627. margin-left: 0px !important;
  628. }
  629. .sys-organization-list {
  630. height: calc(100vh - 264px);
  631. box-sizing: border-box;
  632. border-width: 1px;
  633. border-style: solid;
  634. overflow: auto;
  635. }
  636. .sys-organization-list :deep(.el-tree-node__content) {
  637. height: 40px;
  638. & > .el-tree-node__expand-icon {
  639. margin-left: 10px;
  640. }
  641. }
  642. .switch_left ul .active {
  643. border-top: 4px solid var(--color-primary);
  644. color: var(--color-primary-5);
  645. }
  646. .switch {
  647. padding-bottom: 20px;
  648. }
  649. .el-dropdown-link {
  650. cursor: pointer;
  651. color: var(--color-primary-5);
  652. }
  653. .el-icon-arrow-down {
  654. font-size: 12px;
  655. }
  656. :deep(.el-badge__content.is-fixed) {
  657. top: 4px;
  658. }
  659. </style>