index.vue 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987
  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. ref="accountStatementRef"
  257. @getToDoReminder="getToDoReminder"
  258. ></accountstatement>
  259. </div>
  260. <!-- 对账池:与销售订单模块复用同一组件,靠 sourceType 区分采购/销售 -->
  261. <div v-if="activeComp == 'accountPool'">
  262. <account-pool
  263. :sourceType="2"
  264. @getToDoReminder="getToDoReminder"
  265. @goto-statement-edit="handleGotoStatementEdit"
  266. ></account-pool>
  267. </div>
  268. <div v-if="activeComp == 'adjustmentNote'">
  269. <adjustmentNote
  270. :sourceType="2"
  271. @getToDoReminder="getToDoReminder"
  272. ></adjustmentNote>
  273. </div>
  274. </div>
  275. </el-card>
  276. <add-dialog
  277. ref="addDialogRef"
  278. @done="reload"
  279. :isRequired="isRequired"
  280. ></add-dialog>
  281. <addDialogNew
  282. ref="addDialogNewRef"
  283. @done="reload"
  284. :isRequired="isRequired"
  285. ></addDialogNew>
  286. <add-invoice-dialog
  287. ref="invoiceDialogRef"
  288. @done="reload"
  289. ></add-invoice-dialog>
  290. <add-return-goods-dialog
  291. ref="addReturnGoodsRef"
  292. @done="reload"
  293. ></add-return-goods-dialog>
  294. <contractr-detail ref="contractDetailRef"></contractr-detail>
  295. <detail-dialog ref="contactDetailDialogRef"></detail-dialog>
  296. <purchasingDetail ref="purchasingDetailRef"></purchasingDetail>
  297. <purchasePlanDetail ref="purchasePlanDetailRef"></purchasePlanDetail>
  298. <inquiryDetail ref="inquiryDetailRef"></inquiryDetail>
  299. <addOutSourceSend
  300. ref="addOrEditDialogRef"
  301. :add-or-edit-dialog-flag.sync="addOrEditDialogFlag"
  302. v-if="addOrEditDialogFlag"
  303. @done="reload"
  304. ></addOutSourceSend>
  305. <!-- 多选删除弹窗 -->
  306. <pop-modal
  307. :visible.sync="delVisible"
  308. content="是否确定删除?"
  309. @done="commitBtn"
  310. />
  311. <process-submit-dialog
  312. :isNotNeedProcess="true"
  313. api-fun-name="purchaseorderStatusAPI"
  314. :isCloseRefresh="false"
  315. :processSubmitDialogFlag.sync="processSubmitDialogFlag"
  316. v-if="processSubmitDialogFlag"
  317. ref="processSubmitDialogRef"
  318. @reload="reload"
  319. ></process-submit-dialog>
  320. <addInvoiceManage
  321. :add-or-edit-dialog-flag.sync="addOrEditDialogFlag1"
  322. ref="addOrEditDialogRef"
  323. v-if="addOrEditDialogFlag1"
  324. @reload="reload"
  325. ></addInvoiceManage>
  326. <importDialog
  327. ref="importDialogRef"
  328. @success="reload"
  329. :fileUrl="'/eom/purchaseorder/importTemplate'"
  330. :isWeb="false"
  331. fileName="采购订单导入模板"
  332. apiUrl="/eom/purchaseorder/importFile"
  333. />
  334. <printPurchaseOrder
  335. ref="printPurchaseOrderRef"
  336. :groupName="groupName"
  337. ></printPurchaseOrder>
  338. <add-adjust-dialog
  339. v-if="addAdjustDialogFlag"
  340. :sourceType="2"
  341. :addAdjustDialogFlag.sync="addAdjustDialogFlag"
  342. ref="addAdjustDialogRef"
  343. @done="reload"
  344. ></add-adjust-dialog>
  345. </div>
  346. </template>
  347. <script>
  348. import searchTable from './components/searchTable.vue';
  349. import addDialog from './components/addDialog.vue';
  350. import addDialogNew from './components/addDialogNew.vue';
  351. import invoice from './invoice/index.vue';
  352. import invoiceConfirm from './invoiceConfirm/index.vue';
  353. import detailDialog from './components/detailDialog.vue';
  354. import contractrDetail from '@/views/contractManage/contractBook/components/detailDialog.vue';
  355. import purchasingDetail from '@/views/purchasingManage/purchaseNeedManage/components/detailDialog.vue';
  356. import purchasePlanDetail from '@/views/purchasingManage/purchasePlanManage/components/detailDialog.vue';
  357. import inquiryDetail from '@/views/purchasingManage/inquiryManage/components/detailDialog.vue';
  358. import addInvoiceDialog from '@/views/purchasingManage/purchaseOrder/invoice/components/addInvoiceDialog';
  359. import addReturnGoodsDialog from '@/views/purchasingManage/purchaseOrder/returnGoods/components/addReturnGoodsDialog';
  360. import addOutSourceSend from '@/views/purchasingManage/purchaseOrder/outSourceSend/components/addOrEditDialog';
  361. import popModal from '@/components/pop-modal';
  362. import accountstatement from './accountstatement/index.vue';
  363. import accountPool from '@/views/saleManage/saleOrder/accountPool/index.vue';
  364. import returnGoods from './returnGoods/index.vue';
  365. import addInvoiceManage from '@/views/financialManage/invoiceManage/components/addOrEditDialog.vue';
  366. import outSourceSend from './outSourceSend/index';
  367. import {
  368. getTableList,
  369. deleteInformation,
  370. getExport,
  371. batchCompleted
  372. } from '@/api/purchasingManage/purchaseOrder';
  373. import dictMixins from '@/mixins/dictMixins';
  374. import { purchaseOrderProgressStatusEnum, reviewStatus } from '@/enum/dict';
  375. import processSubmitDialog from '@/BIZComponents/processSubmitDialog/processSubmitDialog.vue';
  376. import tabMixins from '@/mixins/tableColumnsMixin';
  377. import importDialog from '@/components/upload/import-dialog.vue';
  378. import exportButton from '@/components/upload/exportButton.vue';
  379. import { parameterGetByCode } from '@/api/main/index.js';
  380. import exceptionList from '@/views/saleManage/saleOrder/exceptionManagement/exceptionList/index.vue';
  381. import { getToDoReminder } from '@/api/common/index';
  382. import { exportTable } from '@/api/system/file/index.js';
  383. import printPurchaseOrder from '@/views/purchasingManage/purchaseOrder/invoice/components/print-PurchaseOrder.vue';
  384. import { enterprisePage } from '@/api/contractManage/contractBook';
  385. import { getSummaries } from '@/utils/util.js';
  386. // import addAdjustDialog from './adjustmentNote‌/components/addAdjustDialog.vue'
  387. import addAdjustDialog from '@/views/saleManage/saleOrder/adjustmentNote‌/components/addAdjustDialog.vue';
  388. import adjustmentNote from '@/views/saleManage/saleOrder/adjustmentNote‌/index.vue';
  389. export default {
  390. mixins: [dictMixins, tabMixins],
  391. components: {
  392. processSubmitDialog,
  393. exportButton,
  394. searchTable,
  395. returnGoods,
  396. accountstatement,
  397. accountPool,
  398. popModal,
  399. contractrDetail,
  400. addReturnGoodsDialog,
  401. addInvoiceDialog,
  402. invoice,
  403. addDialog,
  404. detailDialog,
  405. outSourceSend,
  406. addOutSourceSend,
  407. addInvoiceManage,
  408. importDialog,
  409. invoiceConfirm,
  410. exceptionList,
  411. purchasingDetail,
  412. purchasePlanDetail,
  413. inquiryDetail,
  414. printPurchaseOrder,
  415. addDialogNew,
  416. addAdjustDialog,
  417. adjustmentNote
  418. },
  419. data() {
  420. return {
  421. activeComp: 'saleorder',
  422. tabOptions: [
  423. { key: 'saleorder', name: '采购订单', reminder: 'purchaseOrderNum' },
  424. {
  425. key: 'outsourceSend',
  426. name: '委外发货单',
  427. reminder: 'outsourcingDeliveryNoteNum'
  428. },
  429. { key: 'invoice', name: '收货单', reminder: 'receiptNum' },
  430. {
  431. key: 'invoiceConfirm',
  432. name: '收货确认单',
  433. reminder: 'receiptConfirmationFormNum'
  434. },
  435. {
  436. key: 'exceptionList',
  437. name: '异常列表',
  438. reminder: 'purchaseExceptionListNum'
  439. },
  440. {
  441. key: 'returnorder',
  442. name: '退货单',
  443. reminder: 'purchaseReturnOrderNum'
  444. },
  445. {
  446. key: 'accountPool',
  447. name: '对账池',
  448. reminder: 'purchaseAccountStatementPoolNum'
  449. },
  450. {
  451. key: 'accountstatement',
  452. name: '对账单',
  453. reminder: 'purchaseStatementAccountNum'
  454. },
  455. {
  456. key: 'adjustmentNote',
  457. name: '冲差单',
  458. reminder: 'punchSlipForPurchaseOrderNum'
  459. }
  460. ],
  461. selection: [], //单选中集合
  462. delVisible: false, //批量删除弹框状态
  463. loading: false, // 加载状态
  464. processSubmitDialogFlag: false,
  465. addOrEditDialogFlag: false,
  466. addOrEditDialogFlag1: false,
  467. params: {},
  468. addAdjustDialogFlag: false, //冲差状态
  469. groupName: '',
  470. columns: [
  471. {
  472. width: 45,
  473. type: 'selection',
  474. columnKey: 'selection',
  475. align: 'center'
  476. },
  477. {
  478. columnKey: 'index',
  479. label: '序号',
  480. type: 'index',
  481. width: 55,
  482. align: 'center',
  483. showOverflowTooltip: true,
  484. fixed: 'left'
  485. },
  486. {
  487. prop: 'orderNo',
  488. label: '订单编码',
  489. align: 'center',
  490. sortable: true,
  491. slot: 'orderNo',
  492. showOverflowTooltip: true,
  493. minWidth: 200,
  494. fixed: 'left'
  495. },
  496. {
  497. prop: 'sourceTypeName',
  498. label: '订单类型',
  499. align: 'center',
  500. sortable: true,
  501. showOverflowTooltip: true,
  502. minWidth: 200,
  503. fixed: 'left'
  504. },
  505. {
  506. prop: 'progress',
  507. label: '订单进度',
  508. align: 'center',
  509. showOverflowTooltip: true,
  510. formatter: (_row, _column, cellValue) => {
  511. return purchaseOrderProgressStatusEnum.find(
  512. (val) => val.value == _row.progress
  513. )?.label;
  514. },
  515. minWidth: 120
  516. },
  517. {
  518. prop: 'relationType',
  519. label: '来源单据类型',
  520. align: 'center',
  521. showOverflowTooltip: true,
  522. minWidth: 150,
  523. formatter: (_row, _column, cellValue) => {
  524. return _row.relationType == 1
  525. ? '采购需求单'
  526. : _row.relationType == 2
  527. ? '采购计划单'
  528. : _row.relationType == 3
  529. ? '采购核价单'
  530. : _row.relationType == 4
  531. ? '采购合同'
  532. : '';
  533. }
  534. },
  535. {
  536. prop: 'relationName',
  537. label: '来源单据',
  538. align: 'center',
  539. slot: 'relationName',
  540. showOverflowTooltip: true,
  541. minWidth: 250
  542. },
  543. // {
  544. // prop: 'deliveryDate',
  545. // label: '交货日期',
  546. // align: 'center',
  547. // showOverflowTooltip: true,
  548. // minWidth: 200
  549. // },
  550. // {
  551. // prop: 'purchaseTypeName',
  552. // label: '采购订单类型',
  553. // align: 'center',
  554. // showOverflowTooltip: true,
  555. // minWidth: 140
  556. // },
  557. {
  558. prop: 'partaName',
  559. label: '采购方名称',
  560. align: 'center',
  561. showOverflowTooltip: true,
  562. minWidth: 200
  563. },
  564. {
  565. prop: 'partaLinkName',
  566. label: '采购方联系人',
  567. align: 'center',
  568. showOverflowTooltip: true,
  569. minWidth: 130
  570. },
  571. {
  572. prop: 'partaTel',
  573. label: '采购方联系电话',
  574. align: 'center',
  575. showOverflowTooltip: true,
  576. minWidth: 130
  577. },
  578. {
  579. prop: 'productNames',
  580. label: '名称',
  581. align: 'center',
  582. showOverflowTooltip: true,
  583. minWidth: 200
  584. },
  585. {
  586. prop: 'productCodes',
  587. label: '编码',
  588. align: 'center',
  589. showOverflowTooltip: true,
  590. minWidth: 140
  591. },
  592. {
  593. prop: 'batchNos',
  594. label: '批次号',
  595. align: 'center',
  596. showOverflowTooltip: true,
  597. minWidth: 140
  598. },
  599. {
  600. prop: 'productCount',
  601. label: '数量',
  602. align: 'center',
  603. showOverflowTooltip: true,
  604. minWidth: 140
  605. },
  606. {
  607. prop: 'inboundCount',
  608. label: '收货数量',
  609. align: 'center',
  610. showOverflowTooltip: true,
  611. minWidth: 140
  612. },
  613. {
  614. prop: 'partbName',
  615. label: '供应商名称',
  616. align: 'center',
  617. showOverflowTooltip: true,
  618. minWidth: 250
  619. },
  620. {
  621. prop: 'partbLinkName',
  622. label: '供应商联系人',
  623. align: 'center',
  624. showOverflowTooltip: true,
  625. minWidth: 120
  626. },
  627. {
  628. prop: 'partbTel',
  629. label: '供应商联系电话',
  630. align: 'center',
  631. showOverflowTooltip: true,
  632. minWidth: 130
  633. },
  634. {
  635. prop: 'isInspection',
  636. label: '是否来料检',
  637. align: 'center',
  638. showOverflowTooltip: true,
  639. minWidth: 130,
  640. formatter: (_row, _column, cellValue) => {
  641. return cellValue == 1 ? '是' : '否';
  642. }
  643. },
  644. {
  645. prop: 'payAmount',
  646. label: '金额(元)',
  647. align: 'center',
  648. showOverflowTooltip: true,
  649. minWidth: 140
  650. },
  651. {
  652. prop: 'createUserName',
  653. label: '创建人',
  654. align: 'center',
  655. showOverflowTooltip: true,
  656. minWidth: 170
  657. },
  658. {
  659. prop: 'createTime',
  660. label: '创建时间',
  661. align: 'center',
  662. showOverflowTooltip: true,
  663. minWidth: 170
  664. },
  665. {
  666. prop: 'orderStatus',
  667. label: '审核状态',
  668. align: 'center',
  669. showOverflowTooltip: true,
  670. minWidth: 100,
  671. formatter: (_row, _column, cellValue) => {
  672. return reviewStatus[_row.orderStatus];
  673. }
  674. },
  675. {
  676. columnKey: 'action',
  677. label: '操作',
  678. width: 260,
  679. align: 'center',
  680. resizable: false,
  681. slot: 'action',
  682. showOverflowTooltip: true,
  683. fixed: 'right'
  684. }
  685. ],
  686. cacheKeyUrl: 'eos-5f2ac512-purchaseOrder-saleorder',
  687. isRequired: true,
  688. timeR: null,
  689. toDoReminder: {}
  690. };
  691. },
  692. computed: {},
  693. created() {
  694. this.requestDict('客户状态');
  695. parameterGetByCode({
  696. code: 'order_person_info'
  697. }).then((res) => {
  698. if (res.value) {
  699. this.isRequired = res.value === '1';
  700. }
  701. });
  702. this.getToDoReminder();
  703. this.timeR = setInterval(() => {
  704. this.getToDoReminder();
  705. }, 60000);
  706. if (this.$route.query.isView) {
  707. this.activeComp = this.$route.query.activeComp;
  708. this.$nextTick(() => {
  709. if (this.activeComp == 'invoice') {
  710. this.$refs.invoiceRef.openorderDetail(
  711. {
  712. id: this.$route.query.id
  713. },
  714. 'receiveNo'
  715. );
  716. }
  717. const url = new URL(window.location.href);
  718. url.search = ''; // 清空查询参数
  719. window.history.pushState({}, '', url.href);
  720. });
  721. }
  722. },
  723. beforeDestroy() {
  724. clearInterval(this.timeR);
  725. },
  726. methods: {
  727. /**
  728. * 对账池发起对账成功后跳转【对账单-修改】:
  729. * 先切到「对账单」页签,再让对账单列表打开该单的修改弹窗。
  730. * 对账单这里用的是 v-if(没有 keep-alive),切页签会重建组件,必须等 DOM 更新后再取 ref 调用
  731. */
  732. handleGotoStatementEdit(row) {
  733. this.activeComp = 'accountstatement';
  734. this.$nextTick(() => {
  735. this.$refs.accountStatementRef &&
  736. this.$refs.accountStatementRef.openEditById(row.id);
  737. });
  738. },
  739. getSummaries(param) {
  740. return getSummaries(
  741. param,
  742. ['productCount', 'inboundCount', 'payAmount'],
  743. ' '
  744. );
  745. },
  746. getToDoReminder() {
  747. getToDoReminder().then((res) => {
  748. this.toDoReminder = res;
  749. });
  750. },
  751. //更多菜单
  752. handleCommand(command, row) {
  753. console.log(command, row);
  754. if (command === 'invoice') {
  755. this.$refs.invoiceDialogRef.open('add', {}, row.id);
  756. }
  757. if (command === 'returnOrder') {
  758. this.$refs.addReturnGoodsRef.open('add', {});
  759. }
  760. if (command === 'outsourceSend') {
  761. this.addOrEditDialogFlag = true;
  762. this.$nextTick(() => {
  763. this.$refs.addOrEditDialogRef.open('add', {}, row.id);
  764. });
  765. }
  766. if (command === 'invoiceManage') {
  767. this.addOrEditDialogFlag1 = true;
  768. this.$nextTick(() => {
  769. this.$refs.addOrEditDialogRef.createInvoice1(row, 2, 3);
  770. });
  771. }
  772. // 冲差
  773. if (command === 'adjustment') {
  774. console.log(row);
  775. this.addAdjustDialogFlag = true;
  776. this.$nextTick(() => {
  777. this.$refs.addAdjustDialogRef.open('add', row);
  778. });
  779. }
  780. },
  781. //点击左边分类
  782. handleNodeClick(data, node) {
  783. // this.curNodeData = data;
  784. this.reload({ categoryId: data.id });
  785. },
  786. /* 表格数据源 */
  787. datasource({ page, limit, where, order }) {
  788. this.params = {
  789. pageNum: page,
  790. size: limit,
  791. ...where
  792. };
  793. return getTableList(this.params);
  794. },
  795. /* 刷新表格 */
  796. reload(where) {
  797. this.$refs.table.reload({ page: 1, where });
  798. },
  799. //新增编辑
  800. openEdit(type, row) {
  801. this.$refs.addDialogRef.open(type, row, row.id);
  802. this.$refs.addDialogRef.$refs.form &&
  803. this.$refs.addDialogRef.$refs.form.clearValidate();
  804. },
  805. //新增编辑新
  806. openEditNew(type, row) {
  807. this.$refs.addDialogNewRef.open(type, row, row.id);
  808. this.$refs.addDialogNewRef.$refs.form &&
  809. this.$refs.addDialogNewRef.$refs.form.clearValidate();
  810. },
  811. uploadFile() {
  812. this.$refs.importDialogRef.open();
  813. },
  814. //打印采购订单
  815. handlePrint(ref) {
  816. if (this.selection.length > 1)
  817. return this.$message.warning('暂不支持批量打印,请选择一条');
  818. // let flag = this.selection.some((item) => [2].includes(item.reviewStatus));
  819. // if (!flag)
  820. // return this.$message.warning('抱歉需要已审核的发货单才能打印,请检查');
  821. enterprisePage({
  822. pageNum: 1,
  823. size: 200
  824. }).then((res) => {
  825. console.log(res.list);
  826. if (res.list?.length > 0) {
  827. this.groupName = res.list[0].name;
  828. }
  829. });
  830. this.$refs[ref].open(this.selection[0].id);
  831. },
  832. //批量删除
  833. allDelBtn() {
  834. if (this.selection.length === 0) return;
  835. let flag = this.selection.some((item) =>
  836. [1, 2].includes(item.orderStatus)
  837. );
  838. if (flag)
  839. return this.$message.warning(
  840. '抱歉已审核、审核中的数据不能删除,请检查'
  841. );
  842. this.delVisible = true;
  843. },
  844. //删除接口
  845. remove(delData) {
  846. deleteInformation(delData).then((res) => {
  847. this.$message.success('删除成功!');
  848. this.reload();
  849. });
  850. },
  851. //删除弹框确定
  852. commitBtn() {
  853. const dataId = this.selection.map((v) => v.id);
  854. this.remove(dataId);
  855. },
  856. finish(type, row) {
  857. if (type == 'single') {
  858. batchCompleted([row.id])
  859. .then((res) => {
  860. this.$message.success(res.message);
  861. this.reload();
  862. })
  863. .catch((err) => {});
  864. }
  865. },
  866. //查看详情
  867. openorderDetail(row) {
  868. this.$refs.contactDetailDialogRef.open(row);
  869. },
  870. saleOrderSubmit(res) {
  871. this.processSubmitDialogFlag = true;
  872. this.$nextTick(() => {
  873. let params = {
  874. businessId: res.id,
  875. businessKey: 'purchase_order_approve',
  876. formCreateUserId: res.createUserId,
  877. variables: {
  878. businessCode: res.orderNo,
  879. businessName: res.partaName,
  880. businessType: res.sourceTypeName
  881. }
  882. };
  883. this.$refs.processSubmitDialogRef.init(params);
  884. });
  885. },
  886. //查看合同详情
  887. opencontractDetail(row) {
  888. let data = {
  889. id: row.relationId
  890. };
  891. if (row.relationType == 1) {
  892. this.$refs.purchasingDetailRef.open(data);
  893. }
  894. if (row.relationType == 2) {
  895. this.$refs.purchasePlanDetailRef.open(data);
  896. }
  897. if (row.relationType == 3) {
  898. this.$refs.inquiryDetailRef.open(data);
  899. }
  900. if (row.relationType == 4) {
  901. this.$refs.contractDetailRef.open(data);
  902. }
  903. },
  904. // 导出
  905. exportRowInfo(row) {
  906. console.log(row);
  907. getExport(row.id);
  908. }
  909. }
  910. };
  911. </script>
  912. <style lang="scss" scoped>
  913. :deep .el-card__body {
  914. padding: 0;
  915. }
  916. :deep(.el-link--inner) {
  917. margin-left: 0px !important;
  918. }
  919. .sys-organization-list {
  920. height: calc(100vh - 264px);
  921. box-sizing: border-box;
  922. border-width: 1px;
  923. border-style: solid;
  924. overflow: auto;
  925. }
  926. .sys-organization-list :deep(.el-tree-node__content) {
  927. height: 40px;
  928. & > .el-tree-node__expand-icon {
  929. margin-left: 10px;
  930. }
  931. }
  932. .switch_left ul .active {
  933. border-top: 4px solid var(--color-primary);
  934. color: var(--color-primary-5);
  935. }
  936. .switch {
  937. padding-bottom: 20px;
  938. }
  939. .el-dropdown-link {
  940. cursor: pointer;
  941. color: var(--color-primary-5);
  942. }
  943. .el-icon-arrow-down {
  944. font-size: 12px;
  945. }
  946. :deep(.el-badge__content.is-fixed) {
  947. top: 4px;
  948. }
  949. </style>