index.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722
  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 == 'collectionPlan'">
  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:relationName="{ row }">
  53. <el-link
  54. type="primary"
  55. :underline="false"
  56. @click="openDetail(row)"
  57. >
  58. {{ row.relationName }}
  59. </el-link>
  60. </template>
  61. <template v-slot:orderNo="{ row }">
  62. <el-link
  63. type="primary"
  64. :underline="false"
  65. @click="openDetail(row)"
  66. >
  67. {{ row.orderNo }}
  68. </el-link>
  69. </template>
  70. <!-- 操作列 -->
  71. <template v-slot:action="{ row }">
  72. <el-link
  73. type="primary"
  74. :underline="false"
  75. icon="el-icon-edit"
  76. v-if="
  77. (isNeed_process_is_close &&
  78. [0, 3].includes(row.orderStatus)) ||
  79. !isNeed_process_is_close
  80. "
  81. @click="openEdit('edit', row)"
  82. >
  83. 修改
  84. </el-link>
  85. <el-link
  86. type="primary"
  87. :underline="false"
  88. icon="el-icon-plus"
  89. @click="saleOrderSubmit(row)"
  90. v-if="
  91. isNeed_process_is_close && [0, 3].includes(row.orderStatus)
  92. "
  93. >
  94. 提交
  95. </el-link>
  96. <el-popconfirm
  97. class="ele-action"
  98. title="确定要删除此信息吗?"
  99. v-if="
  100. (isNeed_process_is_close &&
  101. [0, 3].includes(row.orderStatus)) ||
  102. !isNeed_process_is_close
  103. "
  104. @confirm="remove([row.id])"
  105. >
  106. <template v-slot:reference>
  107. <el-link
  108. type="danger"
  109. :underline="false"
  110. icon="el-icon-delete"
  111. >
  112. 删除
  113. </el-link>
  114. </template>
  115. </el-popconfirm>
  116. <el-link
  117. type="primary"
  118. :underline="false"
  119. icon="el-icon-plus"
  120. @click="handleCommand('invoiceManage', row)"
  121. v-if="!row.hasInvoiceApply && [2].includes(row.orderStatus)"
  122. >
  123. 新增发票
  124. </el-link>
  125. </template>
  126. </ele-pro-table>
  127. </div>
  128. </div>
  129. </div>
  130. </el-card>
  131. <detailDialog ref="detailDialogRef"></detailDialog>
  132. <contractr-detail ref="contractDetailRef"></contractr-detail>
  133. <purchasingDetail ref="purchasingDetailRef"></purchasingDetail>
  134. <purchasePlanDetail ref="purchasePlanDetailRef"></purchasePlanDetail>
  135. <inquiryDetail ref="inquiryDetailRef"></inquiryDetail>
  136. <!-- 多选删除弹窗 -->
  137. <pop-modal
  138. :visible.sync="delVisible"
  139. content="是否确定删除?"
  140. @done="commitBtn"
  141. />
  142. <process-submit-dialog
  143. :isNotNeedProcess="true"
  144. :isCloseRefresh="false"
  145. :processSubmitDialogFlag.sync="processSubmitDialogFlag"
  146. v-if="processSubmitDialogFlag"
  147. ref="processSubmitDialogRef"
  148. @reload="reload"
  149. ></process-submit-dialog>
  150. <importDialog
  151. ref="importDialogRef"
  152. @success="reload"
  153. :fileUrl="'/eom/purchaseorder/importTemplate'"
  154. :isWeb="false"
  155. fileName="采购订单导入模板"
  156. apiUrl="/eom/purchaseorder/importFile"
  157. />
  158. <printPurchaseOrder
  159. ref="printPurchaseOrderRef"
  160. :groupName="groupName"
  161. ></printPurchaseOrder>
  162. </div>
  163. </template>
  164. <script>
  165. import searchTable from './components/searchTable.vue';
  166. import detailDialog from '@/views/financialManage/collectionPlan/components/detailDialog.vue';
  167. import contractrDetail from '@/views/contractManage/contractBook/components/detailDialog.vue';
  168. import purchasingDetail from '@/views/purchasingManage/purchaseNeedManage/components/detailDialog.vue';
  169. import purchasePlanDetail from '@/views/purchasingManage/purchasePlanManage/components/detailDialog.vue';
  170. import inquiryDetail from '@/views/purchasingManage/inquiryManage/components/detailDialog.vue';
  171. import popModal from '@/components/pop-modal';
  172. import {
  173. getTableList,
  174. deleteInformation,
  175. getExport
  176. } from '@/api/purchasingManage/purchaseOrder';
  177. import dictMixins from '@/mixins/dictMixins';
  178. import { purchaseOrderProgressStatusEnum, reviewStatus } from '@/enum/dict';
  179. import processSubmitDialog from '@/BIZComponents/processSubmitDialog/processSubmitDialog.vue';
  180. import tabMixins from '@/mixins/tableColumnsMixin';
  181. import importDialog from '@/components/upload/import-dialog.vue';
  182. import exportButton from '@/components/upload/exportButton.vue';
  183. import { parameterGetByCode } from '@/api/main/index.js';
  184. import exceptionList from '@/views/saleManage/saleOrder/exceptionManagement/exceptionList/index.vue';
  185. import { getToDoReminder } from '@/api/common/index';
  186. import printPurchaseOrder from '@/views/purchasingManage/purchaseOrder/invoice/components/print-PurchaseOrder.vue';
  187. import { enterprisePage } from '@/api/contractManage/contractBook';
  188. export default {
  189. mixins: [dictMixins, tabMixins],
  190. components: {
  191. processSubmitDialog,
  192. exportButton,
  193. searchTable,
  194. popModal,
  195. contractrDetail,
  196. importDialog,
  197. exceptionList,
  198. purchasingDetail,
  199. purchasePlanDetail,
  200. inquiryDetail,
  201. printPurchaseOrder,
  202. detailDialog
  203. },
  204. data() {
  205. return {
  206. activeComp: 'collectionPlan',
  207. tabOptions: [
  208. { key: 'collectionPlan', name: '收款计划管理', reminder: 'purchaseOrderNum' },
  209. ],
  210. selection: [], //单选中集合
  211. delVisible: false, //批量删除弹框状态
  212. loading: false, // 加载状态
  213. processSubmitDialogFlag: false,
  214. addOrEditDialogFlag: false,
  215. addOrEditDialogFlag1: false,
  216. params: {},
  217. groupName: '',
  218. columns: [
  219. {
  220. width: 45,
  221. type: 'selection',
  222. columnKey: 'selection',
  223. align: 'center',
  224. fixed: 'left'
  225. },
  226. {
  227. columnKey: 'index',
  228. label: '序号',
  229. type: 'index',
  230. width: 55,
  231. align: 'center',
  232. showOverflowTooltip: true,
  233. fixed: 'left'
  234. },
  235. {
  236. prop: 'orderNo',
  237. label: '付款计划编码',
  238. align: 'center',
  239. sortable: true,
  240. slot: 'orderNo',
  241. showOverflowTooltip: true,
  242. minWidth: 200,
  243. },
  244. {
  245. prop: 'orderNo',
  246. label: '订单编码',
  247. align: 'center',
  248. sortable: true,
  249. slot: 'orderNo',
  250. showOverflowTooltip: true,
  251. minWidth: 200,
  252. },
  253. {
  254. prop: 'sourceTypeName',
  255. label: '订单类型',
  256. align: 'center',
  257. sortable: true,
  258. showOverflowTooltip: true,
  259. minWidth: 200,
  260. },
  261. {
  262. prop: 'sourceTypeName',
  263. label: '合同编码',
  264. align: 'center',
  265. sortable: true,
  266. showOverflowTooltip: true,
  267. minWidth: 200,
  268. },
  269. {
  270. prop: 'sourceTypeName',
  271. label: '合同编号',
  272. align: 'center',
  273. sortable: true,
  274. showOverflowTooltip: true,
  275. minWidth: 200,
  276. },
  277. {
  278. prop: 'sourceTypeName',
  279. label: '合同名称',
  280. align: 'center',
  281. sortable: true,
  282. showOverflowTooltip: true,
  283. minWidth: 200,
  284. },
  285. {
  286. prop: 'sourceTypeName',
  287. label: '发票号',
  288. align: 'center',
  289. sortable: true,
  290. showOverflowTooltip: true,
  291. minWidth: 200,
  292. },
  293. {
  294. prop: 'relationType',
  295. label: '关联应付编码',
  296. align: 'center',
  297. showOverflowTooltip: true,
  298. minWidth: 150,
  299. formatter: (_row, _column, cellValue) => {
  300. return _row.relationType == 1
  301. ? '采购需求单'
  302. : _row.relationType == 2
  303. ? '采购计划单'
  304. : _row.relationType == 3
  305. ? '采购核价单'
  306. : _row.relationType == 4
  307. ? '采购合同'
  308. : '';
  309. }
  310. },
  311. {
  312. prop: 'relationName',
  313. label: '客户编码',
  314. align: 'center',
  315. slot: 'relationName',
  316. showOverflowTooltip: true,
  317. minWidth: 250
  318. },
  319. {
  320. prop: 'deliveryDate',
  321. label: '客户名称',
  322. align: 'center',
  323. showOverflowTooltip: true,
  324. minWidth: 200
  325. },
  326. {
  327. prop: 'purchaseTypeName',
  328. label: '结算方式',
  329. align: 'center',
  330. showOverflowTooltip: true,
  331. minWidth: 140
  332. },
  333. {
  334. prop: 'partaName',
  335. label: '交易方式',
  336. align: 'center',
  337. showOverflowTooltip: true,
  338. minWidth: 200
  339. },
  340. {
  341. prop: 'partaLinkName',
  342. label: '发货模式',
  343. align: 'center',
  344. showOverflowTooltip: true,
  345. minWidth: 130
  346. },
  347. {
  348. prop: 'partaTel',
  349. label: '期数',
  350. align: 'center',
  351. showOverflowTooltip: true,
  352. minWidth: 130
  353. },
  354. {
  355. prop: 'productNames',
  356. label: '款项类型',
  357. align: 'center',
  358. showOverflowTooltip: true,
  359. minWidth: 200
  360. },
  361. {
  362. prop: 'productCodes',
  363. label: '款项名称',
  364. align: 'center',
  365. showOverflowTooltip: true,
  366. minWidth: 140
  367. },
  368. {
  369. prop: 'batchNos',
  370. label: '比例',
  371. align: 'center',
  372. showOverflowTooltip: true,
  373. minWidth: 140
  374. },
  375. {
  376. prop: 'productCount',
  377. label: '计划收款金额',
  378. align: 'center',
  379. showOverflowTooltip: true,
  380. minWidth: 140
  381. },
  382. {
  383. prop: 'inboundCount',
  384. label: '计划收款日期',
  385. align: 'center',
  386. showOverflowTooltip: true,
  387. minWidth: 140
  388. },
  389. {
  390. prop: 'partbName',
  391. label: '是否已开票',
  392. align: 'center',
  393. showOverflowTooltip: true,
  394. minWidth: 250
  395. },
  396. {
  397. prop: 'partbLinkName',
  398. label: '已开票金额',
  399. align: 'center',
  400. showOverflowTooltip: true,
  401. minWidth: 120
  402. },
  403. {
  404. prop: 'partbTel',
  405. label: '开票日期',
  406. align: 'center',
  407. showOverflowTooltip: true,
  408. minWidth: 130
  409. },
  410. {
  411. prop: 'isInspection',
  412. label: '是否生成应付款项',
  413. align: 'center',
  414. showOverflowTooltip: true,
  415. minWidth: 130,
  416. formatter: (_row, _column, cellValue) => {
  417. return cellValue == 1 ? '是' : '否';
  418. }
  419. },
  420. {
  421. prop: 'payAmount',
  422. label: '应付金额',
  423. align: 'center',
  424. showOverflowTooltip: true,
  425. minWidth: 140
  426. },
  427. {
  428. prop: 'createUserName',
  429. label: '已付款金额',
  430. align: 'center',
  431. showOverflowTooltip: true,
  432. minWidth: 170
  433. },
  434. {
  435. prop: 'createTime',
  436. label: '实际付款日期',
  437. align: 'center',
  438. showOverflowTooltip: true,
  439. minWidth: 170
  440. },
  441. {
  442. prop: 'progress',
  443. label: '收货状态',
  444. align: 'center',
  445. showOverflowTooltip: true,
  446. formatter: (_row, _column, cellValue) => {
  447. return purchaseOrderProgressStatusEnum.find(
  448. (val) => val.value == _row.progress
  449. )?.label;
  450. },
  451. minWidth: 120
  452. },
  453. {
  454. prop: 'orderStatus',
  455. label: '审核状态',
  456. align: 'center',
  457. showOverflowTooltip: true,
  458. minWidth: 100,
  459. formatter: (_row, _column, cellValue) => {
  460. return reviewStatus[_row.orderStatus];
  461. }
  462. },
  463. {
  464. prop: 'orderStatus',
  465. label: '对账状态',
  466. align: 'center',
  467. showOverflowTooltip: true,
  468. minWidth: 100,
  469. formatter: (_row, _column, cellValue) => {
  470. return reviewStatus[_row.orderStatus];
  471. }
  472. },
  473. {
  474. prop: 'orderStatus',
  475. label: '付款状态',
  476. align: 'center',
  477. showOverflowTooltip: true,
  478. minWidth: 100,
  479. formatter: (_row, _column, cellValue) => {
  480. return reviewStatus[_row.orderStatus];
  481. }
  482. },
  483. {
  484. prop: 'orderStatus',
  485. label: '逾期状态',
  486. align: 'center',
  487. showOverflowTooltip: true,
  488. minWidth: 100,
  489. formatter: (_row, _column, cellValue) => {
  490. return reviewStatus[_row.orderStatus];
  491. }
  492. },
  493. {
  494. columnKey: 'action',
  495. label: '操作',
  496. width: 260,
  497. align: 'center',
  498. resizable: false,
  499. slot: 'action',
  500. showOverflowTooltip: true,
  501. fixed: 'right'
  502. }
  503. ],
  504. cacheKeyUrl: 'eos-5f2ac512-purchaseOrder-collectionPlan',
  505. isRequired: true,
  506. timeR: null,
  507. toDoReminder: {}
  508. };
  509. },
  510. computed: {},
  511. created() {
  512. this.requestDict('客户状态');
  513. parameterGetByCode({
  514. code: 'order_person_info'
  515. }).then((res) => {
  516. if (res.value) {
  517. this.isRequired = res.value === '1';
  518. }
  519. });
  520. this.getToDoReminder();
  521. this.timeR = setInterval(() => {
  522. this.getToDoReminder();
  523. }, 60000);
  524. },
  525. beforeDestroy() {
  526. clearInterval(this.timeR);
  527. },
  528. methods: {
  529. getToDoReminder() {
  530. getToDoReminder().then((res) => {
  531. this.toDoReminder = res;
  532. });
  533. },
  534. //更多菜单
  535. handleCommand(command, row) {
  536. console.log(command, row);
  537. if (command === 'invoice') {
  538. this.$refs.invoiceDialogRef.open('add', {}, row.id);
  539. }
  540. if (command === 'returnOrder') {
  541. this.$refs.addReturnGoodsRef.open('add', {});
  542. }
  543. if (command === 'outsourceSend') {
  544. this.addOrEditDialogFlag = true;
  545. this.$nextTick(() => {
  546. this.$refs.addOrEditDialogRef.open('add', {}, row.id);
  547. });
  548. }
  549. if (command === 'invoiceManage') {
  550. this.addOrEditDialogFlag1 = true;
  551. this.$nextTick(() => {
  552. this.$refs.addOrEditDialogRef.createInvoice1(row, 2, 3);
  553. });
  554. }
  555. },
  556. //点击左边分类
  557. handleNodeClick(data, node) {
  558. // this.curNodeData = data;
  559. this.reload({ categoryId: data.id });
  560. },
  561. /* 表格数据源 */
  562. datasource({ page, limit, where, order }) {
  563. this.params = {
  564. pageNum: page,
  565. size: limit,
  566. ...where
  567. };
  568. return getTableList(this.params);
  569. },
  570. /* 刷新表格 */
  571. reload(where) {
  572. this.$refs.table.reload({ page: 1, where });
  573. },
  574. //新增编辑
  575. openEdit(type, row) {
  576. this.$refs.addDialogRef.open(type, row, row.id);
  577. this.$refs.addDialogRef.$refs.form &&
  578. this.$refs.addDialogRef.$refs.form.clearValidate();
  579. },
  580. uploadFile() {
  581. this.$refs.importDialogRef.open();
  582. },
  583. //打印采购订单
  584. handlePrint(ref) {
  585. if (this.selection.length > 1)
  586. return this.$message.warning('暂不支持批量打印,请选择一条');
  587. // let flag = this.selection.some((item) => [2].includes(item.reviewStatus));
  588. // if (!flag)
  589. // return this.$message.warning('抱歉需要已审核的发货单才能打印,请检查');
  590. enterprisePage({
  591. pageNum: 1,
  592. size: 200
  593. }).then((res) => {
  594. console.log(res.list);
  595. if (res.list?.length > 0) {
  596. this.groupName = res.list[0].name;
  597. }
  598. });
  599. this.$refs[ref].open(this.selection[0].id);
  600. },
  601. //批量删除
  602. allDelBtn() {
  603. if (this.selection.length === 0) return;
  604. let flag = this.selection.some((item) =>
  605. [1, 2].includes(item.orderStatus)
  606. );
  607. if (flag)
  608. return this.$message.warning('抱歉已审核、审核中的数据不能删除,请检查');
  609. this.delVisible = true;
  610. },
  611. //删除接口
  612. remove(delData) {
  613. deleteInformation(delData).then((res) => {
  614. this.$message.success('删除成功!');
  615. this.reload();
  616. });
  617. },
  618. //删除弹框确定
  619. commitBtn() {
  620. const dataId = this.selection.map((v) => v.id);
  621. this.remove(dataId);
  622. },
  623. //查看详情
  624. openorderDetail(row) {
  625. this.$refs.contactDetailDialogRef.open(row);
  626. },
  627. saleOrderSubmit(res) {
  628. this.processSubmitDialogFlag = true;
  629. this.$nextTick(() => {
  630. let params = {
  631. businessId: res.id,
  632. businessKey: 'purchase_order_approve',
  633. formCreateUserId: res.createUserId,
  634. variables: {
  635. businessCode: res.orderNo,
  636. businessName: res.partaName,
  637. businessType: res.sourceTypeName
  638. }
  639. };
  640. this.$refs.processSubmitDialogRef.init(params);
  641. });
  642. },
  643. //查看合同详情
  644. openDetail(row) {
  645. this.$refs.detailDialogRef.open(row);
  646. },
  647. // 导出
  648. exportRowInfo(row) {
  649. console.log(row);
  650. getExport(row.id);
  651. }
  652. }
  653. };
  654. </script>
  655. <style lang="scss" scoped>
  656. :deep .el-card__body {
  657. padding: 0;
  658. }
  659. :deep(.el-link--inner) {
  660. margin-left: 0px !important;
  661. }
  662. .sys-organization-list {
  663. height: calc(100vh - 264px);
  664. box-sizing: border-box;
  665. border-width: 1px;
  666. border-style: solid;
  667. overflow: auto;
  668. }
  669. .sys-organization-list :deep(.el-tree-node__content) {
  670. height: 40px;
  671. & > .el-tree-node__expand-icon {
  672. margin-left: 10px;
  673. }
  674. }
  675. .switch_left ul .active {
  676. border-top: 4px solid var(--color-primary);
  677. color: var(--color-primary-5);
  678. }
  679. .switch {
  680. padding-bottom: 20px;
  681. }
  682. .el-dropdown-link {
  683. cursor: pointer;
  684. color: var(--color-primary-5);
  685. }
  686. .el-icon-arrow-down {
  687. font-size: 12px;
  688. }
  689. :deep(.el-badge__content.is-fixed) {
  690. top: 4px;
  691. }
  692. </style>