index.vue 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973
  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 == 'saleorder'">
  23. <div class="ele-border-lighter form-content" v-loading="loading">
  24. <search-table @search="reload"></search-table>
  25. <div class="table-container">
  26. <!-- 数据表格 -->
  27. <ele-pro-table
  28. ref="table"
  29. :columns="columns"
  30. :datasource="datasource"
  31. height="calc(100vh - 365px)"
  32. style="margin-bottom: 10px"
  33. full-height="calc(100vh - 116px)"
  34. tool-class="ele-toolbar-form"
  35. :selection.sync="selection"
  36. :page-size="20"
  37. @columns-change="handleColumnChange"
  38. :cache-key="cacheKeyUrl"
  39. show-summary
  40. :summary-method="getSummaries"
  41. @header-dragend="handleHeaderDragend"
  42. >
  43. <!-- 表头工具栏 -->
  44. <template v-slot:toolbar>
  45. <el-button
  46. size="small"
  47. type="primary"
  48. icon="el-icon-plus"
  49. class="ele-btn-icon"
  50. @click="openEditNew('add', {})"
  51. >
  52. 新建
  53. </el-button>
  54. <el-button
  55. size="small"
  56. type="danger"
  57. el-icon-delete
  58. class="ele-btn-icon"
  59. @click="allDelBtn"
  60. :disabled="selection?.length === 0"
  61. >
  62. 批量删除
  63. </el-button>
  64. <el-button
  65. type="primary"
  66. size="small"
  67. icon="el-icon-upload2"
  68. @click="uploadFile"
  69. >导入</el-button
  70. >
  71. <exportButton
  72. fileName="采购订单"
  73. apiUrl="/eom/purchaseorder/export"
  74. :params="params"
  75. ></exportButton>
  76. <el-dropdown
  77. trigger="click"
  78. :disabled="selection?.length === 0"
  79. >
  80. <el-button
  81. type="primary"
  82. class="el-icon-printer"
  83. size="small"
  84. >
  85. 打印<i class="el-icon-arrow-down el-icon--right"></i>
  86. </el-button>
  87. <el-dropdown-menu slot="dropdown">
  88. <el-dropdown-item
  89. @click.native="handlePrint('printPurchaseOrderRef')"
  90. >采购订单</el-dropdown-item
  91. >
  92. </el-dropdown-menu>
  93. </el-dropdown>
  94. </template>
  95. <!-- 查看详情列 -->
  96. <template v-slot:relationName="{ row }">
  97. <el-link
  98. type="primary"
  99. :underline="false"
  100. @click="opencontractDetail(row)"
  101. >
  102. {{ row.relationName }}
  103. </el-link>
  104. </template>
  105. <template v-slot:orderNo="{ row }">
  106. <el-link
  107. type="primary"
  108. :underline="false"
  109. @click="openorderDetail(row)"
  110. >
  111. {{ row.orderNo }}
  112. </el-link>
  113. </template>
  114. <!-- 操作列 -->
  115. <template v-slot:action="{ row }">
  116. <el-link
  117. type="primary"
  118. :underline="false"
  119. icon="el-icon-edit"
  120. v-if="
  121. (isNeed_process_is_close &&
  122. [0, 3].includes(row.orderStatus)) ||
  123. !isNeed_process_is_close
  124. "
  125. @click="openEditNew('edit', row)"
  126. >
  127. 修改
  128. </el-link>
  129. <el-link
  130. type="primary"
  131. :underline="false"
  132. icon="el-icon-plus"
  133. @click="saleOrderSubmit(row)"
  134. v-if="
  135. isNeed_process_is_close &&
  136. [0, 3].includes(row.orderStatus)
  137. "
  138. >
  139. 提交
  140. </el-link>
  141. <el-popconfirm
  142. class="ele-action"
  143. title="确定要删除此信息吗?"
  144. v-if="
  145. (isNeed_process_is_close &&
  146. [0, 3].includes(row.orderStatus)) ||
  147. !isNeed_process_is_close
  148. "
  149. @confirm="remove([row.id])"
  150. >
  151. <template v-slot:reference>
  152. <el-link
  153. type="danger"
  154. :underline="false"
  155. icon="el-icon-delete"
  156. >
  157. 删除
  158. </el-link>
  159. </template>
  160. </el-popconfirm>
  161. <el-link
  162. type="primary"
  163. :underline="false"
  164. icon="el-icon-plus"
  165. @click="handleCommand('outsourceSend', row)"
  166. v-if="
  167. ['3', '4', '5', '6', '8', '9', '10'].includes(
  168. row.sourceType
  169. ) &&
  170. [2].includes(row.orderStatus) &&
  171. row.progress < 200
  172. "
  173. >
  174. 委外发货单
  175. </el-link>
  176. <el-link
  177. type="primary"
  178. :underline="false"
  179. icon="el-icon-plus"
  180. @click="handleCommand('invoice', row)"
  181. v-if="
  182. !['3', '4', '5', '6', '8', '9', '10'].includes(
  183. row.sourceType
  184. ) &&
  185. [2].includes(row.orderStatus) &&
  186. row.progress < 200 &&
  187. row.isShowReceiptButton == 1
  188. "
  189. >
  190. 收货单
  191. </el-link>
  192. <el-link
  193. type="primary"
  194. :underline="false"
  195. icon="el-icon-plus"
  196. v-if="
  197. row.allowDifference == 1 &&
  198. $hasPermission('eom:purchaseorder:adjustment')
  199. "
  200. @click="handleCommand('adjustment', row)"
  201. >
  202. 冲差
  203. </el-link>
  204. <!-- <el-link
  205. type="primary"
  206. :underline="false"
  207. icon="el-icon-plus"
  208. @click="handleCommand('invoiceManage', row)"
  209. v-if="!row.hasInvoiceApply && [2].includes(row.orderStatus)"
  210. >
  211. 新增发票
  212. </el-link> -->
  213. <el-link
  214. v-if="$hasPermission('eom:purchaseorder:rowExport')"
  215. type="primary"
  216. :underline="false"
  217. icon="el-icon-download"
  218. @click="exportRowInfo(row)"
  219. >
  220. 导出
  221. </el-link>
  222. <el-link
  223. type="primary"
  224. :underline="false"
  225. @click="finish('single', row)"
  226. v-if="[2].includes(row.orderStatus) && row.progress != 1000"
  227. >
  228. 完结
  229. </el-link>
  230. </template>
  231. </ele-pro-table>
  232. </div>
  233. </div>
  234. </div>
  235. <div v-if="activeComp == 'outsourceSend'">
  236. <outSourceSend @getToDoReminder="getToDoReminder"></outSourceSend>
  237. </div>
  238. <div v-if="activeComp == 'invoice'">
  239. <invoice
  240. @getToDoReminder="getToDoReminder"
  241. ref="invoiceRef"
  242. ></invoice>
  243. </div>
  244. <div v-if="activeComp == 'invoiceConfirm'">
  245. <invoiceConfirm @getToDoReminder="getToDoReminder"></invoiceConfirm>
  246. </div>
  247. <div v-if="activeComp == 'returnorder'" class="returnorder">
  248. <return-goods @getToDoReminder="getToDoReminder"></return-goods>
  249. </div>
  250. <div v-if="activeComp == 'exceptionList'">
  251. <exceptionList :relationType="'2'" @getToDoReminder="getToDoReminder">
  252. </exceptionList>
  253. </div>
  254. <div v-if="activeComp == 'accountstatement'">
  255. <accountstatement
  256. @getToDoReminder="getToDoReminder"
  257. ></accountstatement>
  258. </div>
  259. <!-- 对账池:与销售订单模块复用同一组件,靠 sourceType 区分采购/销售 -->
  260. <div v-if="activeComp == 'accountPool'">
  261. <account-pool
  262. :sourceType="2"
  263. @getToDoReminder="getToDoReminder"
  264. ></account-pool>
  265. </div>
  266. <div v-if="activeComp == 'adjustmentNote'">
  267. <adjustmentNote
  268. :sourceType="2"
  269. @getToDoReminder="getToDoReminder"
  270. ></adjustmentNote>
  271. </div>
  272. </div>
  273. </el-card>
  274. <add-dialog
  275. ref="addDialogRef"
  276. @done="reload"
  277. :isRequired="isRequired"
  278. ></add-dialog>
  279. <addDialogNew
  280. ref="addDialogNewRef"
  281. @done="reload"
  282. :isRequired="isRequired"
  283. ></addDialogNew>
  284. <add-invoice-dialog
  285. ref="invoiceDialogRef"
  286. @done="reload"
  287. ></add-invoice-dialog>
  288. <add-return-goods-dialog
  289. ref="addReturnGoodsRef"
  290. @done="reload"
  291. ></add-return-goods-dialog>
  292. <contractr-detail ref="contractDetailRef"></contractr-detail>
  293. <detail-dialog ref="contactDetailDialogRef"></detail-dialog>
  294. <purchasingDetail ref="purchasingDetailRef"></purchasingDetail>
  295. <purchasePlanDetail ref="purchasePlanDetailRef"></purchasePlanDetail>
  296. <inquiryDetail ref="inquiryDetailRef"></inquiryDetail>
  297. <addOutSourceSend
  298. ref="addOrEditDialogRef"
  299. :add-or-edit-dialog-flag.sync="addOrEditDialogFlag"
  300. v-if="addOrEditDialogFlag"
  301. @done="reload"
  302. ></addOutSourceSend>
  303. <!-- 多选删除弹窗 -->
  304. <pop-modal
  305. :visible.sync="delVisible"
  306. content="是否确定删除?"
  307. @done="commitBtn"
  308. />
  309. <process-submit-dialog
  310. :isNotNeedProcess="true"
  311. api-fun-name="purchaseorderStatusAPI"
  312. :isCloseRefresh="false"
  313. :processSubmitDialogFlag.sync="processSubmitDialogFlag"
  314. v-if="processSubmitDialogFlag"
  315. ref="processSubmitDialogRef"
  316. @reload="reload"
  317. ></process-submit-dialog>
  318. <addInvoiceManage
  319. :add-or-edit-dialog-flag.sync="addOrEditDialogFlag1"
  320. ref="addOrEditDialogRef"
  321. v-if="addOrEditDialogFlag1"
  322. @reload="reload"
  323. ></addInvoiceManage>
  324. <importDialog
  325. ref="importDialogRef"
  326. @success="reload"
  327. :fileUrl="'/eom/purchaseorder/importTemplate'"
  328. :isWeb="false"
  329. fileName="采购订单导入模板"
  330. apiUrl="/eom/purchaseorder/importFile"
  331. />
  332. <printPurchaseOrder
  333. ref="printPurchaseOrderRef"
  334. :groupName="groupName"
  335. ></printPurchaseOrder>
  336. <add-adjust-dialog
  337. v-if="addAdjustDialogFlag"
  338. :sourceType="2"
  339. :addAdjustDialogFlag.sync="addAdjustDialogFlag"
  340. ref="addAdjustDialogRef"
  341. @done="reload"
  342. ></add-adjust-dialog>
  343. </div>
  344. </template>
  345. <script>
  346. import searchTable from './components/searchTable.vue';
  347. import addDialog from './components/addDialog.vue';
  348. import addDialogNew from './components/addDialogNew.vue';
  349. import invoice from './invoice/index.vue';
  350. import invoiceConfirm from './invoiceConfirm/index.vue';
  351. import detailDialog from './components/detailDialog.vue';
  352. import contractrDetail from '@/views/contractManage/contractBook/components/detailDialog.vue';
  353. import purchasingDetail from '@/views/purchasingManage/purchaseNeedManage/components/detailDialog.vue';
  354. import purchasePlanDetail from '@/views/purchasingManage/purchasePlanManage/components/detailDialog.vue';
  355. import inquiryDetail from '@/views/purchasingManage/inquiryManage/components/detailDialog.vue';
  356. import addInvoiceDialog from '@/views/purchasingManage/purchaseOrder/invoice/components/addInvoiceDialog';
  357. import addReturnGoodsDialog from '@/views/purchasingManage/purchaseOrder/returnGoods/components/addReturnGoodsDialog';
  358. import addOutSourceSend from '@/views/purchasingManage/purchaseOrder/outSourceSend/components/addOrEditDialog';
  359. import popModal from '@/components/pop-modal';
  360. import accountstatement from './accountstatement/index.vue';
  361. import accountPool from '@/views/saleManage/saleOrder/accountPool/index.vue';
  362. import returnGoods from './returnGoods/index.vue';
  363. import addInvoiceManage from '@/views/financialManage/invoiceManage/components/addOrEditDialog.vue';
  364. import outSourceSend from './outSourceSend/index';
  365. import {
  366. getTableList,
  367. deleteInformation,
  368. getExport,
  369. batchCompleted
  370. } from '@/api/purchasingManage/purchaseOrder';
  371. import dictMixins from '@/mixins/dictMixins';
  372. import { purchaseOrderProgressStatusEnum, reviewStatus } from '@/enum/dict';
  373. import processSubmitDialog from '@/BIZComponents/processSubmitDialog/processSubmitDialog.vue';
  374. import tabMixins from '@/mixins/tableColumnsMixin';
  375. import importDialog from '@/components/upload/import-dialog.vue';
  376. import exportButton from '@/components/upload/exportButton.vue';
  377. import { parameterGetByCode } from '@/api/main/index.js';
  378. import exceptionList from '@/views/saleManage/saleOrder/exceptionManagement/exceptionList/index.vue';
  379. import { getToDoReminder } from '@/api/common/index';
  380. import { exportTable } from '@/api/system/file/index.js';
  381. import printPurchaseOrder from '@/views/purchasingManage/purchaseOrder/invoice/components/print-PurchaseOrder.vue';
  382. import { enterprisePage } from '@/api/contractManage/contractBook';
  383. import { getSummaries } from '@/utils/util.js';
  384. // import addAdjustDialog from './adjustmentNote‌/components/addAdjustDialog.vue'
  385. import addAdjustDialog from '@/views/saleManage/saleOrder/adjustmentNote‌/components/addAdjustDialog.vue';
  386. import adjustmentNote from '@/views/saleManage/saleOrder/adjustmentNote‌/index.vue';
  387. export default {
  388. mixins: [dictMixins, tabMixins],
  389. components: {
  390. processSubmitDialog,
  391. exportButton,
  392. searchTable,
  393. returnGoods,
  394. accountstatement,
  395. accountPool,
  396. popModal,
  397. contractrDetail,
  398. addReturnGoodsDialog,
  399. addInvoiceDialog,
  400. invoice,
  401. addDialog,
  402. detailDialog,
  403. outSourceSend,
  404. addOutSourceSend,
  405. addInvoiceManage,
  406. importDialog,
  407. invoiceConfirm,
  408. exceptionList,
  409. purchasingDetail,
  410. purchasePlanDetail,
  411. inquiryDetail,
  412. printPurchaseOrder,
  413. addDialogNew,
  414. addAdjustDialog,
  415. adjustmentNote
  416. },
  417. data() {
  418. return {
  419. activeComp: 'saleorder',
  420. tabOptions: [
  421. { key: 'saleorder', name: '采购订单', reminder: 'purchaseOrderNum' },
  422. {
  423. key: 'outsourceSend',
  424. name: '委外发货单',
  425. reminder: 'outsourcingDeliveryNoteNum'
  426. },
  427. { key: 'invoice', name: '收货单', reminder: 'receiptNum' },
  428. {
  429. key: 'invoiceConfirm',
  430. name: '收货确认单',
  431. reminder: 'receiptConfirmationFormNum'
  432. },
  433. {
  434. key: 'exceptionList',
  435. name: '异常列表',
  436. reminder: 'purchaseExceptionListNum'
  437. },
  438. {
  439. key: 'returnorder',
  440. name: '退货单',
  441. reminder: 'purchaseReturnOrderNum'
  442. },
  443. {
  444. key: 'accountPool',
  445. name: '对账池',
  446. reminder: 'purchaseAccountStatementPoolNum'
  447. },
  448. {
  449. key: 'accountstatement',
  450. name: '对账单',
  451. reminder: 'purchaseStatementAccountNum'
  452. },
  453. {
  454. key: 'adjustmentNote',
  455. name: '冲差单',
  456. reminder: 'punchSlipForPurchaseOrderNum'
  457. }
  458. ],
  459. selection: [], //单选中集合
  460. delVisible: false, //批量删除弹框状态
  461. loading: false, // 加载状态
  462. processSubmitDialogFlag: false,
  463. addOrEditDialogFlag: false,
  464. addOrEditDialogFlag1: false,
  465. params: {},
  466. addAdjustDialogFlag: false, //冲差状态
  467. groupName: '',
  468. columns: [
  469. {
  470. width: 45,
  471. type: 'selection',
  472. columnKey: 'selection',
  473. align: 'center'
  474. },
  475. {
  476. columnKey: 'index',
  477. label: '序号',
  478. type: 'index',
  479. width: 55,
  480. align: 'center',
  481. showOverflowTooltip: true,
  482. fixed: 'left'
  483. },
  484. {
  485. prop: 'orderNo',
  486. label: '订单编码',
  487. align: 'center',
  488. sortable: true,
  489. slot: 'orderNo',
  490. showOverflowTooltip: true,
  491. minWidth: 200,
  492. fixed: 'left'
  493. },
  494. {
  495. prop: 'sourceTypeName',
  496. label: '订单类型',
  497. align: 'center',
  498. sortable: true,
  499. showOverflowTooltip: true,
  500. minWidth: 200,
  501. fixed: 'left'
  502. },
  503. {
  504. prop: 'progress',
  505. label: '订单进度',
  506. align: 'center',
  507. showOverflowTooltip: true,
  508. formatter: (_row, _column, cellValue) => {
  509. return purchaseOrderProgressStatusEnum.find(
  510. (val) => val.value == _row.progress
  511. )?.label;
  512. },
  513. minWidth: 120
  514. },
  515. {
  516. prop: 'relationType',
  517. label: '来源单据类型',
  518. align: 'center',
  519. showOverflowTooltip: true,
  520. minWidth: 150,
  521. formatter: (_row, _column, cellValue) => {
  522. return _row.relationType == 1
  523. ? '采购需求单'
  524. : _row.relationType == 2
  525. ? '采购计划单'
  526. : _row.relationType == 3
  527. ? '采购核价单'
  528. : _row.relationType == 4
  529. ? '采购合同'
  530. : '';
  531. }
  532. },
  533. {
  534. prop: 'relationName',
  535. label: '来源单据',
  536. align: 'center',
  537. slot: 'relationName',
  538. showOverflowTooltip: true,
  539. minWidth: 250
  540. },
  541. // {
  542. // prop: 'deliveryDate',
  543. // label: '交货日期',
  544. // align: 'center',
  545. // showOverflowTooltip: true,
  546. // minWidth: 200
  547. // },
  548. // {
  549. // prop: 'purchaseTypeName',
  550. // label: '采购订单类型',
  551. // align: 'center',
  552. // showOverflowTooltip: true,
  553. // minWidth: 140
  554. // },
  555. {
  556. prop: 'partaName',
  557. label: '采购方名称',
  558. align: 'center',
  559. showOverflowTooltip: true,
  560. minWidth: 200
  561. },
  562. {
  563. prop: 'partaLinkName',
  564. label: '采购方联系人',
  565. align: 'center',
  566. showOverflowTooltip: true,
  567. minWidth: 130
  568. },
  569. {
  570. prop: 'partaTel',
  571. label: '采购方联系电话',
  572. align: 'center',
  573. showOverflowTooltip: true,
  574. minWidth: 130
  575. },
  576. {
  577. prop: 'productNames',
  578. label: '名称',
  579. align: 'center',
  580. showOverflowTooltip: true,
  581. minWidth: 200
  582. },
  583. {
  584. prop: 'productCodes',
  585. label: '编码',
  586. align: 'center',
  587. showOverflowTooltip: true,
  588. minWidth: 140
  589. },
  590. {
  591. prop: 'batchNos',
  592. label: '批次号',
  593. align: 'center',
  594. showOverflowTooltip: true,
  595. minWidth: 140
  596. },
  597. {
  598. prop: 'productCount',
  599. label: '数量',
  600. align: 'center',
  601. showOverflowTooltip: true,
  602. minWidth: 140
  603. },
  604. {
  605. prop: 'inboundCount',
  606. label: '收货数量',
  607. align: 'center',
  608. showOverflowTooltip: true,
  609. minWidth: 140
  610. },
  611. {
  612. prop: 'partbName',
  613. label: '供应商名称',
  614. align: 'center',
  615. showOverflowTooltip: true,
  616. minWidth: 250
  617. },
  618. {
  619. prop: 'partbLinkName',
  620. label: '供应商联系人',
  621. align: 'center',
  622. showOverflowTooltip: true,
  623. minWidth: 120
  624. },
  625. {
  626. prop: 'partbTel',
  627. label: '供应商联系电话',
  628. align: 'center',
  629. showOverflowTooltip: true,
  630. minWidth: 130
  631. },
  632. {
  633. prop: 'isInspection',
  634. label: '是否来料检',
  635. align: 'center',
  636. showOverflowTooltip: true,
  637. minWidth: 130,
  638. formatter: (_row, _column, cellValue) => {
  639. return cellValue == 1 ? '是' : '否';
  640. }
  641. },
  642. {
  643. prop: 'payAmount',
  644. label: '金额(元)',
  645. align: 'center',
  646. showOverflowTooltip: true,
  647. minWidth: 140
  648. },
  649. {
  650. prop: 'createUserName',
  651. label: '创建人',
  652. align: 'center',
  653. showOverflowTooltip: true,
  654. minWidth: 170
  655. },
  656. {
  657. prop: 'createTime',
  658. label: '创建时间',
  659. align: 'center',
  660. showOverflowTooltip: true,
  661. minWidth: 170
  662. },
  663. {
  664. prop: 'orderStatus',
  665. label: '审核状态',
  666. align: 'center',
  667. showOverflowTooltip: true,
  668. minWidth: 100,
  669. formatter: (_row, _column, cellValue) => {
  670. return reviewStatus[_row.orderStatus];
  671. }
  672. },
  673. {
  674. columnKey: 'action',
  675. label: '操作',
  676. width: 260,
  677. align: 'center',
  678. resizable: false,
  679. slot: 'action',
  680. showOverflowTooltip: true,
  681. fixed: 'right'
  682. }
  683. ],
  684. cacheKeyUrl: 'eos-5f2ac512-purchaseOrder-saleorder',
  685. isRequired: true,
  686. timeR: null,
  687. toDoReminder: {}
  688. };
  689. },
  690. computed: {},
  691. created() {
  692. this.requestDict('客户状态');
  693. parameterGetByCode({
  694. code: 'order_person_info'
  695. }).then((res) => {
  696. if (res.value) {
  697. this.isRequired = res.value === '1';
  698. }
  699. });
  700. this.getToDoReminder();
  701. this.timeR = setInterval(() => {
  702. this.getToDoReminder();
  703. }, 60000);
  704. if (this.$route.query.isView) {
  705. this.activeComp = this.$route.query.activeComp;
  706. this.$nextTick(() => {
  707. if (this.activeComp == 'invoice') {
  708. this.$refs.invoiceRef.openorderDetail(
  709. {
  710. id: this.$route.query.id
  711. },
  712. 'receiveNo'
  713. );
  714. }
  715. const url = new URL(window.location.href);
  716. url.search = ''; // 清空查询参数
  717. window.history.pushState({}, '', url.href);
  718. });
  719. }
  720. },
  721. beforeDestroy() {
  722. clearInterval(this.timeR);
  723. },
  724. methods: {
  725. getSummaries(param) {
  726. return getSummaries(
  727. param,
  728. ['productCount', 'inboundCount', 'payAmount'],
  729. ' '
  730. );
  731. },
  732. getToDoReminder() {
  733. getToDoReminder().then((res) => {
  734. this.toDoReminder = res;
  735. });
  736. },
  737. //更多菜单
  738. handleCommand(command, row) {
  739. console.log(command, row);
  740. if (command === 'invoice') {
  741. this.$refs.invoiceDialogRef.open('add', {}, row.id);
  742. }
  743. if (command === 'returnOrder') {
  744. this.$refs.addReturnGoodsRef.open('add', {});
  745. }
  746. if (command === 'outsourceSend') {
  747. this.addOrEditDialogFlag = true;
  748. this.$nextTick(() => {
  749. this.$refs.addOrEditDialogRef.open('add', {}, row.id);
  750. });
  751. }
  752. if (command === 'invoiceManage') {
  753. this.addOrEditDialogFlag1 = true;
  754. this.$nextTick(() => {
  755. this.$refs.addOrEditDialogRef.createInvoice1(row, 2, 3);
  756. });
  757. }
  758. // 冲差
  759. if (command === 'adjustment') {
  760. console.log(row);
  761. this.addAdjustDialogFlag = true;
  762. this.$nextTick(() => {
  763. this.$refs.addAdjustDialogRef.open('add', row);
  764. });
  765. }
  766. },
  767. //点击左边分类
  768. handleNodeClick(data, node) {
  769. // this.curNodeData = data;
  770. this.reload({ categoryId: data.id });
  771. },
  772. /* 表格数据源 */
  773. datasource({ page, limit, where, order }) {
  774. this.params = {
  775. pageNum: page,
  776. size: limit,
  777. ...where
  778. };
  779. return getTableList(this.params);
  780. },
  781. /* 刷新表格 */
  782. reload(where) {
  783. this.$refs.table.reload({ page: 1, where });
  784. },
  785. //新增编辑
  786. openEdit(type, row) {
  787. this.$refs.addDialogRef.open(type, row, row.id);
  788. this.$refs.addDialogRef.$refs.form &&
  789. this.$refs.addDialogRef.$refs.form.clearValidate();
  790. },
  791. //新增编辑新
  792. openEditNew(type, row) {
  793. this.$refs.addDialogNewRef.open(type, row, row.id);
  794. this.$refs.addDialogNewRef.$refs.form &&
  795. this.$refs.addDialogNewRef.$refs.form.clearValidate();
  796. },
  797. uploadFile() {
  798. this.$refs.importDialogRef.open();
  799. },
  800. //打印采购订单
  801. handlePrint(ref) {
  802. if (this.selection.length > 1)
  803. return this.$message.warning('暂不支持批量打印,请选择一条');
  804. // let flag = this.selection.some((item) => [2].includes(item.reviewStatus));
  805. // if (!flag)
  806. // return this.$message.warning('抱歉需要已审核的发货单才能打印,请检查');
  807. enterprisePage({
  808. pageNum: 1,
  809. size: 200
  810. }).then((res) => {
  811. console.log(res.list);
  812. if (res.list?.length > 0) {
  813. this.groupName = res.list[0].name;
  814. }
  815. });
  816. this.$refs[ref].open(this.selection[0].id);
  817. },
  818. //批量删除
  819. allDelBtn() {
  820. if (this.selection.length === 0) return;
  821. let flag = this.selection.some((item) =>
  822. [1, 2].includes(item.orderStatus)
  823. );
  824. if (flag)
  825. return this.$message.warning(
  826. '抱歉已审核、审核中的数据不能删除,请检查'
  827. );
  828. this.delVisible = true;
  829. },
  830. //删除接口
  831. remove(delData) {
  832. deleteInformation(delData).then((res) => {
  833. this.$message.success('删除成功!');
  834. this.reload();
  835. });
  836. },
  837. //删除弹框确定
  838. commitBtn() {
  839. const dataId = this.selection.map((v) => v.id);
  840. this.remove(dataId);
  841. },
  842. finish(type, row) {
  843. if (type == 'single') {
  844. batchCompleted([row.id])
  845. .then((res) => {
  846. this.$message.success(res.message);
  847. this.reload();
  848. })
  849. .catch((err) => {});
  850. }
  851. },
  852. //查看详情
  853. openorderDetail(row) {
  854. this.$refs.contactDetailDialogRef.open(row);
  855. },
  856. saleOrderSubmit(res) {
  857. this.processSubmitDialogFlag = true;
  858. this.$nextTick(() => {
  859. let params = {
  860. businessId: res.id,
  861. businessKey: 'purchase_order_approve',
  862. formCreateUserId: res.createUserId,
  863. variables: {
  864. businessCode: res.orderNo,
  865. businessName: res.partaName,
  866. businessType: res.sourceTypeName
  867. }
  868. };
  869. this.$refs.processSubmitDialogRef.init(params);
  870. });
  871. },
  872. //查看合同详情
  873. opencontractDetail(row) {
  874. let data = {
  875. id: row.relationId
  876. };
  877. if (row.relationType == 1) {
  878. this.$refs.purchasingDetailRef.open(data);
  879. }
  880. if (row.relationType == 2) {
  881. this.$refs.purchasePlanDetailRef.open(data);
  882. }
  883. if (row.relationType == 3) {
  884. this.$refs.inquiryDetailRef.open(data);
  885. }
  886. if (row.relationType == 4) {
  887. this.$refs.contractDetailRef.open(data);
  888. }
  889. },
  890. // 导出
  891. exportRowInfo(row) {
  892. console.log(row);
  893. getExport(row.id);
  894. }
  895. }
  896. };
  897. </script>
  898. <style lang="scss" scoped>
  899. :deep .el-card__body {
  900. padding: 0;
  901. }
  902. :deep(.el-link--inner) {
  903. margin-left: 0px !important;
  904. }
  905. .sys-organization-list {
  906. height: calc(100vh - 264px);
  907. box-sizing: border-box;
  908. border-width: 1px;
  909. border-style: solid;
  910. overflow: auto;
  911. }
  912. .sys-organization-list :deep(.el-tree-node__content) {
  913. height: 40px;
  914. & > .el-tree-node__expand-icon {
  915. margin-left: 10px;
  916. }
  917. }
  918. .switch_left ul .active {
  919. border-top: 4px solid var(--color-primary);
  920. color: var(--color-primary-5);
  921. }
  922. .switch {
  923. padding-bottom: 20px;
  924. }
  925. .el-dropdown-link {
  926. cursor: pointer;
  927. color: var(--color-primary-5);
  928. }
  929. .el-icon-arrow-down {
  930. font-size: 12px;
  931. }
  932. :deep(.el-badge__content.is-fixed) {
  933. top: 4px;
  934. }
  935. </style>