index.vue 46 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465
  1. <template>
  2. <div class="ele-body">
  3. <el-card shadow="never" v-loading="loading">
  4. <div class="switch" v-if="!contactData?.id">
  5. <div class="switch_left">
  6. <ul>
  7. <li
  8. style="height: 42px; line-height: 38px"
  9. v-for="item in tabOptions"
  10. :key="item.key"
  11. :class="{ active: activeComp == item.key }"
  12. @click="activeComp = item.key"
  13. >
  14. <el-badge
  15. :value="toDoReminder[item.reminder] || 0"
  16. class="item"
  17. v-if="item.reminder"
  18. >
  19. {{ item.name }}
  20. </el-badge>
  21. <span v-else>{{ item.name }}</span>
  22. </li>
  23. </ul>
  24. </div>
  25. </div>
  26. <div class="main" style="padding: 0 10px">
  27. <div v-show="activeComp == 'saleorder'">
  28. <div class="ele-border-lighter form-content" v-loading="loading">
  29. <search-table @search="reload"></search-table>
  30. <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
  31. <el-tab-pane label="全部" name="all"></el-tab-pane>
  32. <el-tab-pane label="待发货" name="700"></el-tab-pane>
  33. <el-tab-pane label="部分发货" name="701"></el-tab-pane>
  34. <el-tab-pane label="全部发货" name="800"></el-tab-pane>
  35. </el-tabs>
  36. <!-- 数据表格 -->
  37. <div v-table-scroll-sync class="table-container">
  38. <ele-pro-table
  39. ref="table"
  40. :columns="columns"
  41. :datasource="datasource"
  42. height="calc(100vh - 400px)"
  43. style="margin-bottom: 10px"
  44. full-height="calc(100vh - 116px)"
  45. tool-class="ele-toolbar-form"
  46. :selection.sync="selection"
  47. :page-size="pageSize"
  48. @columns-change="handleColumnChange"
  49. :cache-key="cacheKeyUrl"
  50. show-summary
  51. :summary-method="getSummaries"
  52. @header-dragend="handleHeaderDragend"
  53. >
  54. <!-- 表头工具栏 -->
  55. <template v-slot:toolbar>
  56. <el-button
  57. size="small"
  58. type="primary"
  59. icon="el-icon-plus"
  60. class="ele-btn-icon"
  61. @click="openEditNew('add', {})"
  62. v-if="$hasPermission('eom:saleorder:save')"
  63. >
  64. 新建
  65. </el-button>
  66. <el-button
  67. size="small"
  68. type="danger"
  69. icon="el-icon-delete"
  70. class="ele-btn-icon"
  71. @click="allDelBtn"
  72. v-if="$hasPermission('eom:saleorder:delete')"
  73. :disabled="selection?.length === 0"
  74. >
  75. 批量删除
  76. </el-button>
  77. <el-button
  78. size="small"
  79. type="primary"
  80. icon="el-icon-plus"
  81. class="ele-btn-icon"
  82. @click="invoiceAll"
  83. v-if="$hasPermission('eom:saleManage:invoiceAll')"
  84. :disabled="selection?.length === 0"
  85. >
  86. 批量发货
  87. </el-button>
  88. <el-button
  89. type="primary"
  90. size="small"
  91. icon="el-icon-upload2"
  92. @click="uploadFile"
  93. v-if="$hasPermission('eom:saleorder:save')"
  94. >导入</el-button
  95. >
  96. <exportButton
  97. btnName="列表导出"
  98. fileName="销售订单"
  99. apiUrl="/eom/saleorder/export"
  100. :params="exportParams"
  101. ></exportButton>
  102. <el-button
  103. v-if="$hasPermission('eom:saleorder:push')"
  104. size="small"
  105. type="primary"
  106. class="ele-btn-icon"
  107. @click="allPushBtn"
  108. :disabled="selection?.length === 0"
  109. >
  110. 批量推送
  111. </el-button>
  112. <el-dropdown
  113. trigger="click"
  114. :disabled="selection?.length === 0"
  115. >
  116. <el-button
  117. type="primary"
  118. class="el-icon-printer"
  119. size="small"
  120. >
  121. 打印<i class="el-icon-arrow-down el-icon--right"></i>
  122. </el-button>
  123. <el-dropdown-menu slot="dropdown">
  124. <el-dropdown-item
  125. v-if="$hasPermission('eom:saleorder:print')"
  126. @click.native="handlePrint"
  127. >打印</el-dropdown-item
  128. >
  129. <el-dropdown-item
  130. v-if="$hasPermission('eom:saleorder:printRt')"
  131. @click.native="handleRtPrint"
  132. >打印(润天)</el-dropdown-item
  133. >
  134. <el-dropdown-item
  135. v-if="$hasPermission('eom:saleorder:print')"
  136. @click.native="handleBatchPrint"
  137. >打印(批次)</el-dropdown-item
  138. >
  139. <el-dropdown-item
  140. v-if="$hasPermission('eom:saleorder:print')"
  141. @click.native="handleStockPrint"
  142. >打印(备货单)</el-dropdown-item
  143. >
  144. <el-dropdown-item
  145. v-if="$hasPermission('eom:saleorder:print')"
  146. @click.native="handleSaleOrderPrint"
  147. >打印(销售订单)</el-dropdown-item
  148. >
  149. <el-dropdown-item
  150. v-if="$hasPermission('eom:saleorder:print')"
  151. @click.native="handleOutboundPrint"
  152. >打印(出库单)</el-dropdown-item
  153. >
  154. <el-dropdown-item
  155. v-if="$hasPermission('eom:saleorder:print')"
  156. @click.native="handlePrintWithWarehouse"
  157. >打印(含仓库)</el-dropdown-item
  158. >
  159. </el-dropdown-menu>
  160. </el-dropdown>
  161. <!-- <el-button
  162. size="small"
  163. type="primary"
  164. class="ele-btn-icon"
  165. @click="handleStockUnlock"
  166. :disabled="selection?.length === 0"
  167. >
  168. 库存解锁
  169. </el-button> -->
  170. </template>
  171. <!-- 查看详情列 -->
  172. <template v-slot:relationCode="{ row }">
  173. <el-link
  174. type="primary"
  175. :underline="false"
  176. @click="openRelationCodeDetail(row)"
  177. >
  178. {{ row.relationCode }}
  179. </el-link>
  180. </template>
  181. <template v-slot:orderNo="{ row }">
  182. <el-link
  183. type="primary"
  184. :underline="false"
  185. @click="openorderDetail(row)"
  186. >
  187. {{ row.orderNo }}
  188. </el-link>
  189. </template>
  190. <!-- 预销售订单编码 -->
  191. <template v-slot:preOrderNo="{ row }">
  192. <el-input
  193. v-model="row.preOrderNo"
  194. @keyup.enter.native="handlePreOrderNoBlur(row)"
  195. style="width: 100%; padding: 0 4px"
  196. placeholder="请输入预销售编码"
  197. ></el-input>
  198. </template>
  199. <!-- 操作列 -->
  200. <template v-slot:action="{ row }">
  201. <el-link
  202. type="primary"
  203. :underline="false"
  204. icon="el-icon-edit"
  205. @click="openEditNew('edit', row)"
  206. v-if="
  207. $hasPermission('eom:saleorder:update') &&
  208. [0, 3].includes(row.orderStatus)
  209. "
  210. >
  211. 修改
  212. </el-link>
  213. <el-link
  214. type="primary"
  215. :underline="false"
  216. icon="el-icon-plus"
  217. @click="saleOrderSubmitOrGenerate(row)"
  218. v-if="
  219. [0, 3].includes(row.orderStatus) &&
  220. $hasPermission('eom:saleorder:update')
  221. "
  222. >
  223. 提交
  224. </el-link>
  225. <!-- <el-link
  226. type="primary"
  227. :underline="false"
  228. icon="el-icon-plus"
  229. @click="handleAutoGenerate(row.id)"
  230. v-if="
  231. [2].includes(row.orderStatus) &&
  232. row.needProduce &&
  233. !!!row.purchasePlanNum
  234. "
  235. >
  236. 生成采购计划
  237. </el-link> -->
  238. <el-popconfirm
  239. class="ele-action"
  240. title="确定要删除此信息吗?"
  241. @confirm="remove([row.id])"
  242. v-if="
  243. [0, 3].includes(row.orderStatus) &&
  244. $hasPermission('eom:saleorder:delete')
  245. "
  246. >
  247. <template v-slot:reference>
  248. <el-link
  249. type="danger"
  250. :underline="false"
  251. icon="el-icon-delete"
  252. >
  253. 删除
  254. </el-link>
  255. </template>
  256. </el-popconfirm>
  257. <el-link
  258. type="primary"
  259. :underline="false"
  260. icon="el-icon-plus"
  261. @click="handleCommand('adjustment', row)"
  262. v-if="row.allowDifference == 1 && $hasPermission('eom:saleorder:adjustment')"
  263. >
  264. 冲差
  265. </el-link>
  266. <el-link
  267. type="primary"
  268. :underline="false"
  269. icon="el-icon-plus"
  270. @click="handleCommand('invoice', row)"
  271. v-if="
  272. [2].includes(row.orderStatus) &&
  273. ((row.saleTypeName.includes('受托') &&
  274. row.isEntrustedReceive == 1) ||
  275. !row.saleTypeName.includes('受托')) &&
  276. $hasPermission('eom:saleordersendrecord:save') &&
  277. ((isTotalCount == '1' &&
  278. row.sendTotalCount < row.productCount) ||
  279. isTotalCount == 0) && row.isLock != 1
  280. "
  281. >
  282. 发货单
  283. </el-link>
  284. <el-link
  285. type="primary"
  286. :underline="false"
  287. icon="el-icon-plus"
  288. @click="handleCommand('entrustedReceive', row)"
  289. v-if="
  290. [2].includes(row.orderStatus) &&
  291. row.saleTypeName.includes('受托') &&
  292. row.isEntrustedReceive != 1
  293. "
  294. >
  295. 受托收货单
  296. </el-link>
  297. <el-link
  298. type="primary"
  299. :underline="false"
  300. icon="el-icon-plus"
  301. @click="handleCommand('saleOrderReminder', row)"
  302. v-if="
  303. [2].includes(row.orderStatus) &&
  304. clientEnvironmentId != 5 &&
  305. row.progress < 800
  306. "
  307. >
  308. 催单
  309. </el-link>
  310. <el-link
  311. type="primary"
  312. :underline="false"
  313. @click="finish('single', row)"
  314. v-if="
  315. [2].includes(row.orderStatus) &&
  316. row.progress != 1000
  317. "
  318. >
  319. 完结
  320. </el-link>
  321. <!-- <el-link
  322. type="primary"
  323. :underline="false"
  324. icon="el-icon-plus"
  325. @click="handleCommand('invoiceManage', row)"
  326. v-if="
  327. [2].includes(row.orderStatus) &&
  328. !row.hasInvoiceApply &&
  329. $hasPermission('eom:fininvoiceapply:save')
  330. "
  331. >
  332. 新增发票
  333. </el-link> -->
  334. </template>
  335. </ele-pro-table>
  336. </div>
  337. </div>
  338. </div>
  339. <keep-alive>
  340. <component
  341. v-if="currentTabComponent"
  342. :is="currentTabComponent"
  343. @getToDoReminder="getToDoReminder"
  344. ></component>
  345. </keep-alive>
  346. </div>
  347. </el-card>
  348. <add-dialog
  349. :isRequired="isRequired"
  350. ref="addDialogRef"
  351. @done="reload"
  352. :contactData="contactData"
  353. ></add-dialog>
  354. <add-dialog-new
  355. :isRequired="isRequired"
  356. ref="addDialogNewRef"
  357. @done="reload"
  358. :contactData="contactData"
  359. ></add-dialog-new>
  360. <add-invoice-dialog
  361. ref="invoiceDialogRef"
  362. @done="reload"
  363. :contactData="contactData"
  364. ></add-invoice-dialog>
  365. <add-return-goods-dialog
  366. ref="addReturnGoodsRef"
  367. :contactData="contactData"
  368. @done="reload"
  369. ></add-return-goods-dialog>
  370. <contractr-detail ref="contractDetailRef"></contractr-detail>
  371. <detail-dialog ref="contactDetailDialogRef"></detail-dialog>
  372. <autogenerate-dialog
  373. ref="autogenerateDialogRef"
  374. @handleSubmit="saleOrderSubmit"
  375. @reload="reload"
  376. ></autogenerate-dialog>
  377. <!-- 多选删除弹窗 -->
  378. <pop-modal
  379. :visible.sync="delVisible"
  380. content="是否确定删除?"
  381. @done="commitBtn"
  382. />
  383. <drawer ref="drawerRef"></drawer>
  384. <process-submit-dialog
  385. :isNotNeedProcess="true"
  386. :processSubmitDialogFlag.sync="processSubmitDialogFlag"
  387. v-if="processSubmitDialogFlag"
  388. :isCloseRefresh="false"
  389. ref="processSubmitDialogRef"
  390. @reload="reload"
  391. :callBack="callBack"
  392. ></process-submit-dialog>
  393. <addInvoiceManage
  394. :add-or-edit-dialog-flag.sync="addOrEditDialogFlag1"
  395. ref="addOrEditDialogRef"
  396. v-if="addOrEditDialogFlag1"
  397. @reload="reload"
  398. ></addInvoiceManage>
  399. <importDialog
  400. ref="importDialogRef"
  401. @success="reload"
  402. :fileUrl="'/eom/saleorder/importTemplate'"
  403. :isWeb="false"
  404. fileName="销售订单导入模板"
  405. apiUrl="/eom/saleorder/importFile"
  406. />
  407. <bomDialog ref="bomDialogRef" :isCloseRefresh="false" @handleSubmit="bomDialogSuccess" @reload="reload"></bomDialog>
  408. <opportunityDetail ref="opportunityDetailRef"></opportunityDetail>
  409. <quotationDetail ref="quotationDetailRef"></quotationDetail>
  410. <addEntrustedReceive
  411. ref="addEntrustedReceiveRef"
  412. @done="reload"
  413. :add-or-edit-dialog-flag.sync="addEntrustedReceiveFlag"
  414. v-if="addEntrustedReceiveFlag"
  415. ></addEntrustedReceive>
  416. <printTemplateSaleOrder
  417. :groupName="groupName"
  418. ref="printTemplateSaleOrderRef"
  419. ></printTemplateSaleOrder>
  420. <printTemplateHt ref="printTemplateHtRef" :groupName="groupName"></printTemplateHt>
  421. <printTemplateRt ref="printTemplateRtRef" :groupName="groupName"></printTemplateRt>
  422. <printTemplateHtBatch
  423. ref="printTemplateHtBatchRef"
  424. :groupName="groupName"
  425. ></printTemplateHtBatch>
  426. <printTemplateHtStock
  427. ref="printTemplateHtStockRef"
  428. :groupName="groupName"
  429. ></printTemplateHtStock>
  430. <printTemplateSaleOrderSimple
  431. ref="printTemplateSaleOrderSimpleRef"
  432. :groupName="groupName"
  433. ></printTemplateSaleOrderSimple>
  434. <printTemplateHt1
  435. ref="printTemplateHt1Ref"
  436. :groupName="groupName"
  437. ></printTemplateHt1>
  438. <add-adjust-dialog
  439. v-if="addAdjustDialogFlag"
  440. :addAdjustDialogFlag.sync="addAdjustDialogFlag"
  441. ref="addAdjustDialogRef"
  442. @done="reload"
  443. ></add-adjust-dialog>
  444. </div>
  445. </template>
  446. <script>
  447. import { getSummaries } from '@/utils/util.js';
  448. import searchTable from './components/searchTable.vue';
  449. import addDialog from './components/addDialog.vue';
  450. import addDialogNew from './components/addDialogNew.vue';
  451. import invoice from './invoice/index.vue';
  452. import invoiceConfirm from './invoiceConfirm/index.vue';
  453. import detailDialog from './components/detailDialog.vue';
  454. import exceptionList from './exceptionManagement/exceptionList';
  455. import bomDialog from './components/bomDialog';
  456. import suspend from './suspend/index.vue';
  457. import drawer from './components/drawer.vue';
  458. import contractrDetail from '@/views/contractManage/contractBook/components/detailDialog.vue';
  459. import addInvoiceDialog from '@/views/saleManage/saleOrder/invoice/components/addInvoiceDialog';
  460. import addReturnGoodsDialog from '@/views/saleManage/saleOrder/returnGoods/components/addReturnGoodsDialog';
  461. import popModal from '@/components/pop-modal';
  462. import accountstatement from './accountstatement/index.vue';
  463. import customerReturnOrder from './customerReturnOrder/index.vue';
  464. import returnGoods from './returnGoods/index.vue';
  465. import palletManagement from './palletManagement/index.vue';
  466. import addInvoiceManage from '@/views/financialManage/invoiceManage/components/addOrEditDialog.vue';
  467. import addEntrustedReceive from '@/views/saleManage/saleOrder/entrustedReceive/components/addOrEditDialog';
  468. import adjustmentNote from './adjustmentNote‌/index.vue';
  469. import addAdjustDialog from '@/views/saleManage/saleOrder/adjustmentNote‌/components/addAdjustDialog.vue';
  470. import {
  471. deleteInformation,
  472. getSaleOrderDetail,
  473. getTableList,
  474. saleOrderReminder,
  475. getByRepeatBomAttribute,
  476. saveOrderBomList,
  477. updateOrderInfo,
  478. saleOrderAdd,
  479. batchCompleted
  480. } from '@/api/saleManage/saleorder';
  481. import { getToDoReminder } from '@/api/common/index';
  482. import { exportSaleorder } from '@/api/system/file/index.js';
  483. import dictMixins from '@/mixins/dictMixins';
  484. import { reviewStatus, saleOrderProgressStatusEnum, saleOrderStatusEnum } from '@/enum/dict';
  485. import entrustedReceive from '@/views/saleManage/saleOrder/entrustedReceive/index.vue';
  486. import autogenerateDialog from '@/BIZComponents/autogenerateDialog.vue';
  487. import processSubmitDialog from '@/BIZComponents/processSubmitDialog/processSubmitDialog.vue';
  488. import tabMixins from '@/mixins/tableColumnsMixin';
  489. import importDialog from '@/components/upload/import-dialog.vue';
  490. import exportButton from '@/components/upload/exportButton.vue';
  491. import { parameterGetByCode } from '@/api/main/index.js';
  492. import opportunityDetail from '@/views/saleManage/businessOpportunity/components/opportunityDetailDialog.vue';
  493. import quotationDetail from '@/views/saleManage/quotation/components/detailDialog.vue';
  494. import printTemplateSaleOrder from './components/printTemplateSaleOrder.vue';
  495. import { enterprisePage } from '@/api/contractManage/contractBook';
  496. import { listOrganizations } from '@/api/system/organization';
  497. import printTemplateHt from './components/printTemplateHt.vue';
  498. import printTemplateRt from './components/printTemplateRt.vue';
  499. import printTemplateHtBatch from './components/printTemplateHtBatch.vue';
  500. import printTemplateHtStock from './components/printTemplateHtStock.vue';
  501. import printTemplateSaleOrderSimple from './components/printTemplateSaleOrderSimple.vue';
  502. import printTemplateHt1 from './invoice/components/print-template-ht-1.vue';
  503. import stockUnlock from './components/stockUnlock.vue';
  504. export default {
  505. mixins: [dictMixins, tabMixins],
  506. components: {
  507. processSubmitDialog,
  508. autogenerateDialog,
  509. searchTable,
  510. returnGoods,
  511. accountstatement,
  512. popModal,
  513. contractrDetail,
  514. addReturnGoodsDialog,
  515. addInvoiceDialog,
  516. invoice,
  517. addDialog,
  518. detailDialog,
  519. customerReturnOrder,
  520. entrustedReceive,
  521. invoiceConfirm,
  522. drawer,
  523. exceptionList,
  524. addInvoiceManage,
  525. palletManagement,
  526. exportButton,
  527. importDialog,
  528. bomDialog,
  529. opportunityDetail,
  530. quotationDetail,
  531. addEntrustedReceive,
  532. printTemplateSaleOrder,
  533. adjustmentNote,
  534. addAdjustDialog,
  535. suspend,
  536. addDialogNew,
  537. printTemplateHt,
  538. printTemplateRt,
  539. printTemplateHtBatch,
  540. printTemplateHtStock,
  541. printTemplateSaleOrderSimple,
  542. printTemplateHt1,
  543. stockUnlock
  544. },
  545. //客户管理数据
  546. props: {
  547. contactData: {
  548. type: Object,
  549. default: () => {
  550. return {};
  551. }
  552. }
  553. },
  554. data() {
  555. return {
  556. activeName: 'all',
  557. activeComp: 'saleorder',
  558. tabOptions: [
  559. { key: 'saleorder', name: '销售订单', reminder: 'salesOrderNum' },
  560. {
  561. key: 'entrustedReceive',
  562. name: '受托收货单',
  563. reminder: 'entrustedReceiptNum'
  564. },
  565. { key: 'invoice', name: '发货单', reminder: 'deliveryNoteNum' },
  566. {
  567. key: 'invoiceConfirm',
  568. name: '发货确认单',
  569. reminder: 'deliveryConfirmationFormNum'
  570. },
  571. { key: 'trayList', name: '托盘清单' },
  572. {
  573. key: 'exceptionList',
  574. name: '异常列表',
  575. reminder: 'exceptionListNum'
  576. },
  577. { key: 'returnorder', name: '退货单', reminder: 'returnOrderNum' },
  578. {
  579. key: 'customerReturnOrder',
  580. name: '退货处理单',
  581. reminder: 'returnProcessingFormNum'
  582. },
  583. {
  584. key: 'accountstatement',
  585. name: '对账单',
  586. reminder: 'statementAccountNum'
  587. },
  588. {
  589. key: 'adjustmentNote',
  590. name: '冲差单',
  591. reminder: 'punchSlipOrderNum'
  592. },
  593. {
  594. key: 'suspend',
  595. name: '挂单',
  596. reminder: 'suspendNum'
  597. },
  598. ],
  599. selection: [], //单选中集合
  600. delVisible: false, //批量删除弹框状态
  601. loading: false, // 加载状态
  602. processSubmitDialogFlag: false, // 加载状态
  603. addOrEditDialogFlag1: false,
  604. addEntrustedReceiveFlag: false,
  605. addAdjustDialogFlag: false, //冲差状态
  606. params: {},
  607. tableList: [],
  608. current: null,
  609. cacheKeyUrl: 'eos-c2e9664a-saleManage-saleOrder',
  610. isRequired: true,
  611. isTotalCount: '0',
  612. columnsVersion: 1,
  613. pageSize: 20,
  614. timeR: null,
  615. toDoReminder: {},
  616. groupName: '',
  617. organizations: []
  618. };
  619. },
  620. created() {
  621. enterprisePage({
  622. pageNum: 1,
  623. size: 200
  624. }).then((res) => {
  625. if (res.list?.length > 0) {
  626. this.groupName = res.list[0].name;
  627. }
  628. });
  629. this.requestDict('客户状态');
  630. parameterGetByCode({
  631. code: 'order_person_info'
  632. }).then((res) => {
  633. if (res.value) {
  634. this.isRequired = res.value === '1';
  635. }
  636. });
  637. //销售发货数量是否限制不能大于采购总数//0否 1是
  638. parameterGetByCode({
  639. code: 'saleOrder_invoice_productList_totalCount'
  640. }).then((res) => {
  641. this.isTotalCount = res.value;
  642. });
  643. this.getToDoReminder();
  644. this.getInfo();
  645. this.timeR = setInterval(() => {
  646. this.getToDoReminder();
  647. }, 60000);
  648. if (this.$route.query.isView) {
  649. this.activeComp = this.$route.query.activeComp;
  650. this.$nextTick(() => {
  651. if (this.activeComp == 'entrustedReceive') {
  652. this.$refs.entrustedReceiveRef.openorderDetail(
  653. {
  654. id: this.$route.query.id
  655. },
  656. 'code'
  657. );
  658. }
  659. const url = new URL(window.location.href);
  660. url.search = ''; // 清空查询参数
  661. window.history.pushState({}, '', url.href);
  662. });
  663. }
  664. // if (!('Notification' in window)) {
  665. // console.log('此浏览器不支持桌面通知');
  666. // } else if (Notification.permission === 'granted') {
  667. // // 如果用户已经授权,直接创建通知
  668. // var notification = new Notification('标题', {
  669. // body: '这是通知的内容。'
  670. // });
  671. // } else if (Notification.permission !== 'denied') {
  672. // // 请求权限
  673. // Notification.requestPermission().then(function (permission) {
  674. // if (permission === 'granted') {
  675. // var notification = new Notification('标题', {
  676. // body: '消息提醒1'
  677. // });
  678. // }
  679. // });
  680. // }
  681. },
  682. beforeDestroy() {
  683. clearInterval(this.timeR);
  684. },
  685. computed: {
  686. // 根据当前页签返回对应的子组件(用于 keep-alive + 单一动态组件,避免多 v-if 兄弟节点导致缓存错乱)
  687. currentTabComponent() {
  688. const map = {
  689. invoice: invoice,
  690. invoiceConfirm: invoiceConfirm,
  691. entrustedReceive: entrustedReceive,
  692. returnorder: returnGoods,
  693. accountstatement: accountstatement,
  694. customerReturnOrder: customerReturnOrder,
  695. exceptionList: exceptionList,
  696. trayList: palletManagement,
  697. adjustmentNote: adjustmentNote,
  698. suspend: suspend
  699. };
  700. return map[this.activeComp] || null;
  701. },
  702. exportParams() {
  703. return {
  704. ...this.params,
  705. orderIds: this.selection.map(item => item.id)
  706. }
  707. },
  708. clientEnvironmentId() {
  709. return this.$store.state.user.info.clientEnvironmentId;
  710. },
  711. columns() {
  712. let columnsVersion = this.columnsVersion;
  713. const list = [
  714. {
  715. width: 45,
  716. type: 'selection',
  717. columnKey: 'selection',
  718. align: 'center'
  719. },
  720. {
  721. columnKey: 'index',
  722. label: '序号',
  723. type: 'index',
  724. width: 55,
  725. align: 'center',
  726. showOverflowTooltip: true,
  727. fixed: 'left'
  728. },
  729. {
  730. prop: 'orderNo',
  731. label: '订单编码',
  732. align: 'center',
  733. slot: 'orderNo',
  734. showOverflowTooltip: true,
  735. sortable: true,
  736. minWidth: 200,
  737. fixed: 'left'
  738. },
  739. {
  740. prop: 'needProduce',
  741. label: '订单类型',
  742. align: 'center',
  743. showOverflowTooltip: true,
  744. minWidth: 150,
  745. formatter: (_row, _column, cellValue) => {
  746. let businessType =
  747. cellValue == 1
  748. ? '有客户生产性订单'
  749. : cellValue == 2
  750. ? '无客户生产性订单'
  751. : cellValue == 4
  752. ? '不定向订单'
  753. : cellValue == 5
  754. ? '委外订单'
  755. : '库存式订单';
  756. return businessType;
  757. }
  758. },
  759. {
  760. prop: 'preOrderNo',
  761. label: '预销售订单编码',
  762. align: 'center',
  763. slot: 'preOrderNo',
  764. showOverflowTooltip: true,
  765. sortable: true,
  766. minWidth: 200,
  767. fixed: 'left'
  768. },
  769. {
  770. prop: 'createDept',
  771. columnKey: 'createDept',
  772. label: '发起人所属部门',
  773. minWidth: 200,
  774. align: 'center',
  775. showOverflowTooltip: true,
  776. formatter: (_row, _column, cellValue) => {
  777. if (!cellValue) return '';
  778. const matchedDept = this.organizations.find(
  779. (dept) => dept.id === cellValue
  780. );
  781. return matchedDept ? matchedDept.name : '';
  782. }
  783. },
  784. {
  785. prop: 'relationType',
  786. label: '来源类型',
  787. align: 'center',
  788. showOverflowTooltip: true,
  789. minWidth: 150,
  790. formatter: (_row, _column, cellValue) => {
  791. let businessType =
  792. cellValue == 1
  793. ? '商机'
  794. : cellValue == 2
  795. ? '报价'
  796. : cellValue == 3
  797. ? '销售合同'
  798. : cellValue == 4
  799. ? '项目'
  800. : '';
  801. return businessType;
  802. }
  803. },
  804. {
  805. prop: 'relationCode',
  806. label: '来源单据',
  807. align: 'center',
  808. slot: 'relationCode',
  809. showOverflowTooltip: true,
  810. minWidth: 200,
  811. formatter: (_row, _column, cellValue) => {
  812. return _row.relationCode;
  813. }
  814. },
  815. {
  816. prop: 'progress',
  817. label: '订单进度',
  818. align: 'center',
  819. showOverflowTooltip: true,
  820. formatter: (_row, _column, cellValue) => {
  821. return saleOrderProgressStatusEnum.find(
  822. (val) => val.value == _row.progress
  823. )?.label;
  824. },
  825. minWidth: 120
  826. },
  827. // {
  828. // prop: 'deliveryDate',
  829. // label: '交货日期',
  830. // align: 'center',
  831. // showOverflowTooltip: true,
  832. // minWidth: 200
  833. // },
  834. {
  835. prop: 'productNames',
  836. label: '产品名称',
  837. align: 'center',
  838. showOverflowTooltip: true,
  839. minWidth: 140
  840. },
  841. {
  842. prop: 'productCodes',
  843. label: '编码',
  844. align: 'center',
  845. showOverflowTooltip: true,
  846. minWidth: 140
  847. },
  848. {
  849. minWidth: 160,
  850. prop: 'productionCodes',
  851. label: '生产编号',
  852. align: 'center'
  853. },
  854. {
  855. prop: 'batchNos',
  856. label: '批次号',
  857. align: 'center',
  858. showOverflowTooltip: true,
  859. minWidth: 140
  860. },
  861. {
  862. prop: 'productCount',
  863. label: '数量',
  864. align: 'center',
  865. showOverflowTooltip: true,
  866. minWidth: 140
  867. },
  868. {
  869. prop: 'inventoryQuantity',
  870. label: '库存数',
  871. align: 'center',
  872. showOverflowTooltip: true,
  873. minWidth: 140
  874. },
  875. {
  876. prop: 'sendTotalCount',
  877. label: '发货数量',
  878. align: 'center',
  879. showOverflowTooltip: true,
  880. minWidth: 120
  881. },
  882. {
  883. prop: 'outboundTotalCount',
  884. label: '出库数量',
  885. align: 'center',
  886. showOverflowTooltip: true,
  887. minWidth: 140
  888. },
  889. {
  890. prop: 'returnTotalCount',
  891. label: '退货数量',
  892. align: 'center',
  893. showOverflowTooltip: true,
  894. minWidth: 120
  895. },
  896. {
  897. prop: 'inventoryQuantity1',
  898. label: '库存状态',
  899. align: 'center',
  900. showOverflowTooltip: true,
  901. minWidth: 140,
  902. formatter: (_row, _column, cellValue) => {
  903. return _row.inventoryQuantity > 0 ? '有库存' : '无库存';
  904. }
  905. },
  906. {
  907. prop: 'saleTypeName',
  908. label: '销售类型',
  909. align: 'center',
  910. showOverflowTooltip: true,
  911. minWidth: 140
  912. },
  913. {
  914. prop: 'projectName',
  915. label: '项目名称',
  916. align: 'center',
  917. showOverflowTooltip: true,
  918. minWidth: 180
  919. },
  920. {
  921. prop: 'partaName',
  922. label: '客户名称',
  923. align: 'center',
  924. showOverflowTooltip: true,
  925. minWidth: 180
  926. },
  927. {
  928. prop: 'partaLinkName',
  929. label: '客户联系人',
  930. align: 'center',
  931. showOverflowTooltip: true,
  932. minWidth: 130
  933. },
  934. {
  935. prop: 'partaTel',
  936. label: '客户联系电话',
  937. align: 'center',
  938. showOverflowTooltip: true,
  939. minWidth: 130
  940. },
  941. {
  942. prop: 'partbName',
  943. label: '售出方名称',
  944. align: 'center',
  945. showOverflowTooltip: true,
  946. minWidth: 130
  947. },
  948. {
  949. prop: 'partbLinkName',
  950. label: '售出方联系人',
  951. align: 'center',
  952. showOverflowTooltip: true,
  953. minWidth: 130
  954. },
  955. {
  956. prop: 'partbTel',
  957. label: '售出方联系电话',
  958. align: 'center',
  959. showOverflowTooltip: true,
  960. minWidth: 130
  961. },
  962. {
  963. prop: 'payAmount',
  964. label: '金额(元)',
  965. align: 'center',
  966. showOverflowTooltip: true,
  967. minWidth: 170
  968. },
  969. {
  970. prop: 'arrivalWays',
  971. label: '到货方式',
  972. align: 'center',
  973. showOverflowTooltip: true,
  974. minWidth: 170,
  975. formatter: (_row, _column, cellValue) => {
  976. return _row.arrivalWays
  977. ? _row.arrivalWays
  978. .split(',')
  979. .map((val) => {
  980. return val == 1 ? '一次性到货' : val == 2 ? '分批到货' : '';
  981. })
  982. .toString()
  983. : '';
  984. }
  985. },
  986. {
  987. prop: 'externalId',
  988. label: '是否推送',
  989. align: 'center',
  990. showOverflowTooltip: true,
  991. minWidth: 120,
  992. formatter: (_row, _column, cellValue) => {
  993. return _row.preOrderNo? '已推送' : '未推送';
  994. }
  995. },
  996. {
  997. prop: 'orderStatus',
  998. label: '审核状态',
  999. align: 'center',
  1000. showOverflowTooltip: true,
  1001. minWidth: 100,
  1002. formatter: (_row, _column, cellValue) => {
  1003. return reviewStatus[_row.orderStatus];
  1004. }
  1005. },
  1006. {
  1007. prop: 'salesmanName',
  1008. label: '业务员',
  1009. align: 'center',
  1010. showOverflowTooltip: true,
  1011. minWidth: 80
  1012. },
  1013. {
  1014. prop: 'createUserName',
  1015. label: '创建人',
  1016. align: 'center',
  1017. showOverflowTooltip: true,
  1018. minWidth: 80
  1019. },
  1020. {
  1021. prop: 'createTime',
  1022. label: '创建时间',
  1023. align: 'center',
  1024. showOverflowTooltip: true,
  1025. minWidth: 170
  1026. },
  1027. {
  1028. prop: 'reviewTime',
  1029. label: '审核时间',
  1030. align: 'center',
  1031. showOverflowTooltip: true,
  1032. minWidth: 170
  1033. },
  1034. {
  1035. columnKey: 'action',
  1036. label: '操作',
  1037. width: 280,
  1038. align: 'center',
  1039. resizable: false,
  1040. slot: 'action',
  1041. showOverflowTooltip: true,
  1042. fixed: 'right'
  1043. }
  1044. ];
  1045. return this.applyColumnWidth(list);
  1046. }
  1047. },
  1048. watch: {
  1049. // 切回销售订单主列表时,保持搜索条件与页码不变,仅刷新列表数据
  1050. activeComp(val) {
  1051. if (val === 'saleorder') {
  1052. this.$nextTick(() => {
  1053. if (this.$refs.table) {
  1054. this.$refs.table.reload();
  1055. if (this.$refs.table.doLayout) this.$refs.table.doLayout();
  1056. }
  1057. });
  1058. }
  1059. }
  1060. },
  1061. methods: {
  1062. handleStockUnlock() {
  1063. console.log('库存解锁', this.selection);
  1064. },
  1065. getSummaries(param) {
  1066. return getSummaries(
  1067. param,
  1068. ['productCount', 'sendTotalCount', 'outboundTotalCount', 'payAmount'],
  1069. ' '
  1070. );
  1071. },
  1072. async getInfo() {
  1073. try {
  1074. const res = await listOrganizations(); // 假设接口直接返回部门数组(如用户提供的示例数据)
  1075. this.organizations = res; // 存储部门列表到状态中
  1076. console.log('部门列表加载完成:', this.organizations);
  1077. } catch (err) {
  1078. console.error('加载部门列表失败:', err);
  1079. this.organizations = []; // 异常时置空,避免匹配错误
  1080. }
  1081. },
  1082. getToDoReminder() {
  1083. getToDoReminder().then((res) => {
  1084. this.toDoReminder = res;
  1085. });
  1086. },
  1087. // 预销售编码输入框失焦回车事件
  1088. handlePreOrderNoBlur(row) {
  1089. updateOrderInfo({
  1090. preOrderNo: row.preOrderNo
  1091. })
  1092. .then((res) => {
  1093. console.log(res);
  1094. this.$message.success('预销售编码更新成功');
  1095. })
  1096. .catch((err) => {});
  1097. },
  1098. finish(type, row) {
  1099. if (type == 'single') {
  1100. batchCompleted([row.id]).then((res) => {
  1101. this.$message.success(res.message);
  1102. this.reload();
  1103. }).catch((err) => {});
  1104. }
  1105. },
  1106. //更多菜单
  1107. handleCommand(command, row) {
  1108. if (command === 'invoice') {
  1109. this.$refs.invoiceDialogRef.open('add', {}, [row.id]);
  1110. }
  1111. if (command === 'entrustedReceive') {
  1112. this.addEntrustedReceiveFlag = true;
  1113. this.$nextTick(() => {
  1114. this.$refs.addEntrustedReceiveRef.open('add', {}, row.id);
  1115. });
  1116. }
  1117. if (command === 'returnOrder') {
  1118. this.$refs.addReturnGoodsRef.open('add', {});
  1119. }
  1120. if (command === 'saleOrderReminder') {
  1121. saleOrderReminder(row.id).then((res) => {
  1122. this.$message.success('催单成功');
  1123. });
  1124. }
  1125. if (command === 'invoiceManage') {
  1126. this.addOrEditDialogFlag1 = true;
  1127. this.$nextTick(() => {
  1128. this.$refs.addOrEditDialogRef.createInvoice1(row, 1, 3);
  1129. });
  1130. }
  1131. // 冲差
  1132. if (command === 'adjustment') {
  1133. console.log(row);
  1134. this.addAdjustDialogFlag = true;
  1135. this.$nextTick(() => {
  1136. this.$refs.addAdjustDialogRef.open('add', row);
  1137. });
  1138. }
  1139. },
  1140. allPushBtn() {
  1141. const dataId = this.selection.map((v) => v.id);
  1142. saleOrderAdd(dataId).then((res) => {
  1143. this.$message.success('推送成功!');
  1144. this.reload();
  1145. });
  1146. },
  1147. invoiceAll() {
  1148. let partaIds = this.selection.map((item) => item.partaId);
  1149. if (new Set(partaIds).size != 1) {
  1150. return this.$message.warning('请选择相同客户的订单!');
  1151. }
  1152. let saleTypeS = this.selection.map((item) => item.saleType);
  1153. if (new Set(saleTypeS).size != 1) {
  1154. return this.$message.warning('请选择相同销售类型的订单!');
  1155. }
  1156. let processObj = this.selection.filter((item) => item.progress == 800);
  1157. if (processObj?.length && this.isTotalCount == '1') {
  1158. return this.$message.warning(
  1159. '订单' +
  1160. processObj.map((item) => item.orderNo).toString() +
  1161. '已全部发货,不能创建发货单'
  1162. );
  1163. }
  1164. if(!this.selection.every((item) => item.isLock == 0) && item.needProduce == 1){
  1165. return this.$message.warning('生产性订单未入库前不允许发货');
  1166. }
  1167. if (
  1168. this.selection.filter((item) => item.needProduce == 4)?.length &&
  1169. this.selection.filter((item) => item.needProduce == 4)?.length !=
  1170. this.selection.length
  1171. ) {
  1172. return this.$message.warning(
  1173. '不定向订单不能与其它类型的订单一起创建发货单!'
  1174. );
  1175. }
  1176. this.$refs.invoiceDialogRef.open(
  1177. 'add',
  1178. {},
  1179. this.selection.map((item) => item.id)
  1180. );
  1181. },
  1182. //点击左边分类
  1183. handleNodeClick(data, node) {
  1184. // this.curNodeData = data;
  1185. this.reload({ categoryId: data.id });
  1186. },
  1187. /* 表格数据源 */
  1188. datasource({ page, limit, where, order }) {
  1189. console.log('where~~~', where, limit);
  1190. // 捕获并持久化每页条数变化
  1191. this.handlePageSize(limit);
  1192. if(where?.needProduces?.length){
  1193. where['needProduces'] = where.needProduces.join(',');
  1194. }
  1195. if (this.contactData.id) {
  1196. where['contactId'] = this.contactData.id;
  1197. }
  1198. // 构建进度列表参数
  1199. const progressList = [];
  1200. // 添加标签页进度筛选(如果不是'all'标签)
  1201. if (this.activeName !== 'all') {
  1202. progressList.push(this.activeName);
  1203. }
  1204. // 添加搜索条件中的进度筛选
  1205. if (where?.progress) {
  1206. progressList.push(where.progress);
  1207. }
  1208. // 构建请求参数
  1209. this.params = {
  1210. pageNum: page,
  1211. size: limit,
  1212. ...where
  1213. };
  1214. delete this.params.progress;
  1215. // 仅当进度列表有值时添加到请求参数
  1216. if (progressList.length > 0) {
  1217. this.params.progressList = progressList.join(',');
  1218. }
  1219. return getTableList(this.params);
  1220. },
  1221. /* 刷新表格 */
  1222. reload(where) {
  1223. this.$refs.table.reload({ page: 1, where });
  1224. this.getToDoReminder();
  1225. },
  1226. handleClick() {
  1227. this.$refs.table.reload({
  1228. page: 1,
  1229. // where: { progress: this.activeName == 'all' ? '' : this.activeName }
  1230. });
  1231. },
  1232. //新增编辑
  1233. openEdit(type, row) {
  1234. this.$refs.addDialogRef.open(type, row, row.id);
  1235. this.$refs.addDialogRef.$refs.form &&
  1236. this.$refs.addDialogRef.$refs.form.clearValidate();
  1237. },
  1238. //新增编辑新
  1239. openEditNew(type, row) {
  1240. this.$refs.addDialogNewRef.open(type, row, row.id);
  1241. this.$refs.addDialogNewRef.$refs.form &&
  1242. this.$refs.addDialogNewRef.$refs.form.clearValidate();
  1243. },
  1244. //批量删除
  1245. allDelBtn() {
  1246. if (this.selection.length === 0) return;
  1247. let flag = this.selection.some((item) =>
  1248. [1, 2].includes(item.orderStatus)
  1249. );
  1250. if (flag)
  1251. return this.$message.warning('抱歉已审核、审核中的数据不能删除,请检查');
  1252. this.delVisible = true;
  1253. },
  1254. //删除接口
  1255. remove(delData) {
  1256. deleteInformation(delData).then((res) => {
  1257. this.$message.success('删除成功!');
  1258. this.reload();
  1259. });
  1260. },
  1261. //删除弹框确定
  1262. commitBtn() {
  1263. const dataId = this.selection.map((v) => v.id);
  1264. this.remove(dataId);
  1265. },
  1266. //查看详情
  1267. openorderDetail(row) {
  1268. this.$refs.drawerRef.open(row);
  1269. },
  1270. async saleOrderSubmit(id) {
  1271. this.$refs.addDialogRef && this.$refs.addDialogRef.cancel();
  1272. // const data = await getSaleOrderDetail(id);
  1273. this.processSubmitDialogFlag = true;
  1274. let businessType =
  1275. this.current.needProduce == 1
  1276. ? '有客户生产性订单'
  1277. : this.current.needProduce == 2
  1278. ? '无客户生产性订单'
  1279. : this.current.needProduce == 4
  1280. ? '不定向订单'
  1281. : '库存式订单';
  1282. this.$nextTick(() => {
  1283. let params = {
  1284. businessId: this.current.id,
  1285. businessKey: 'sales_order_approve',
  1286. formCreateUserId: this.current.createUserId,
  1287. variables: {
  1288. businessCode: this.current.orderNo,
  1289. businessName: this.current.partaName,
  1290. businessType: businessType
  1291. }
  1292. };
  1293. this.$refs.processSubmitDialogRef.init(params);
  1294. });
  1295. },
  1296. async callBack() {
  1297. if (!this.current.generatePurchase && !this.current.generateProduce) {
  1298. return 0;
  1299. }
  1300. const code = saveOrderBomList({
  1301. categoryDTOList: this.tableList || [],
  1302. orderId: this.current.id
  1303. });
  1304. return code;
  1305. },
  1306. async saleOrderSubmitOrGenerate(res) {
  1307. this.tableList = [];
  1308. this.current = await getSaleOrderDetail(res.id);
  1309. if (!this.current.generatePurchase && !this.current.generateProduce) {
  1310. this.saleOrderSubmit(res.id);
  1311. } else {
  1312. const data = await getByRepeatBomAttribute(res.id);
  1313. if (data && data.length) {
  1314. this.$refs.bomDialogRef.open(data);
  1315. return;
  1316. }
  1317. this.saleOrderSubmit(res.id);
  1318. }
  1319. },
  1320. bomDialogSuccess(tableList) {
  1321. this.tableList = tableList;
  1322. // this.callBack()
  1323. this.saleOrderSubmit(this.current.id);
  1324. },
  1325. //生成
  1326. handleAutoGenerate(id, isAuto = false) {
  1327. this.$refs.autogenerateDialogRef.init(id, isAuto);
  1328. },
  1329. //查看来源详情
  1330. openRelationCodeDetail(row) {
  1331. let data = {
  1332. id: row.relationId
  1333. };
  1334. if (row.relationType == 1) {
  1335. this.$refs.opportunityDetailRef.open(data);
  1336. }
  1337. if (row.relationType == 2) {
  1338. this.$refs.quotationDetailRef.open(data);
  1339. }
  1340. if (row.relationType == 3) {
  1341. this.$refs.contractDetailRef.open(data);
  1342. }
  1343. },
  1344. uploadFile() {
  1345. this.$refs.importDialogRef.open();
  1346. },
  1347. exportFn() {
  1348. console.log(this.params);
  1349. exportSaleorder(this.params);
  1350. },
  1351. handlePrint() {
  1352. console.log(this.selection[0]);
  1353. // if (this.selection.length > 1) return this.$message.warning('请选择一条');
  1354. this.$refs.printTemplateHtRef.open(this.selection.map((v) => v.id));
  1355. },
  1356. handleRtPrint() {
  1357. this.$refs.printTemplateRtRef.open(this.selection.map((v) => v.id));
  1358. },
  1359. handleBatchPrint() {
  1360. this.$refs.printTemplateHtBatchRef.open(this.selection.map((v) => v.id));
  1361. },
  1362. handleStockPrint() {
  1363. this.$refs.printTemplateHtStockRef.open(this.selection.map((v) => v.id));
  1364. },
  1365. handleSaleOrderPrint() {
  1366. this.$refs.printTemplateSaleOrderSimpleRef.open(this.selection.map((v) => v.id));
  1367. },
  1368. handleOutboundPrint() {
  1369. this.$refs.printTemplateHt1Ref.open(this.selection.map((v) => v.id), false, 'saleOrder');
  1370. },
  1371. // 打印逻辑同 handlePrint,模板带仓库列
  1372. handlePrintWithWarehouse() {
  1373. this.$refs.printTemplateHtRef.open(this.selection.map((v) => v.id), true);
  1374. }
  1375. }
  1376. };
  1377. </script>
  1378. <style lang="scss" scoped>
  1379. :deep .el-card__body {
  1380. padding: 0;
  1381. }
  1382. :deep(.el-link--inner) {
  1383. margin-left: 0px !important;
  1384. }
  1385. .sys-organization-list {
  1386. height: calc(100vh - 264px);
  1387. box-sizing: border-box;
  1388. border-width: 1px;
  1389. border-style: solid;
  1390. overflow: auto;
  1391. }
  1392. .sys-organization-list :deep(.el-tree-node__content) {
  1393. height: 40px;
  1394. & > .el-tree-node__expand-icon {
  1395. margin-left: 10px;
  1396. }
  1397. }
  1398. .el-dropdown-link {
  1399. cursor: pointer;
  1400. color: var(--color-primary-5);
  1401. }
  1402. .el-icon-arrow-down {
  1403. font-size: 12px;
  1404. }
  1405. :deep(.el-badge__content.is-fixed) {
  1406. top: 4px;
  1407. }
  1408. /* 优化输入框在表格中的样式 */
  1409. :deep(.el-table .el-input__inner) {
  1410. border-radius: 4px;
  1411. height: 28px;
  1412. line-height: 28px;
  1413. }
  1414. :deep(.el-table .el-input) {
  1415. margin: 0;
  1416. }
  1417. </style>