index.vue 18 KB

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