index.vue 20 KB

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