index.vue 47 KB

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