index.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860
  1. <template>
  2. <div class="ele-body" style="width: 100%">
  3. <el-card shadow="never" v-loading="loading" style="width: 100%">
  4. <div class="ele-border-lighter form-content" v-loading="loading">
  5. <search-table @search="reload"></search-table>
  6. <div v-table-scroll-sync>
  7. <!-- 数据表格 -->
  8. <ele-pro-table
  9. ref="table"
  10. :columns="columns"
  11. :datasource="datasource"
  12. height="calc(100vh - 410px)"
  13. style="margin-bottom: 10px"
  14. full-height="calc(100vh - 116px)"
  15. tool-class="ele-toolbar-form"
  16. :selection.sync="selection"
  17. :page-size="20"
  18. @columns-change="handleColumnChange"
  19. :cache-key="cacheKeyUrl"
  20. show-summary
  21. :summary-method="getSummaries"
  22. row-key="id"
  23. default-expand-all
  24. :tree-props="{
  25. children: 'children',
  26. hasChildren: 'hasChildren'
  27. }"
  28. >
  29. <!-- 表头工具栏 -->
  30. <template v-slot:toolbar>
  31. <el-button
  32. size="small"
  33. type="primary"
  34. icon="el-icon-plus"
  35. class="ele-btn-icon"
  36. @click="openEdit('add', {})"
  37. v-if="
  38. !saleOrderData.id ||
  39. (saleOrderData.id && saleOrderData.orderStatus == 2)
  40. "
  41. >
  42. 新建
  43. </el-button>
  44. <el-button
  45. size="small"
  46. type="danger"
  47. class="el-icon-delete"
  48. @click="allDelBtn"
  49. :disabled="selection?.length === 0"
  50. >
  51. 批量删除
  52. </el-button>
  53. <el-dropdown trigger="click" :disabled="selection?.length === 0">
  54. <el-button type="primary" class="el-icon-printer" size="small">
  55. 打印<i class="el-icon-arrow-down el-icon--right"></i>
  56. </el-button>
  57. <el-dropdown-menu slot="dropdown">
  58. <el-dropdown-item
  59. @click.native="handlePrint('printTemplateByRef')"
  60. v-if="$hasPermission('eom:print-invoice1')"
  61. >发货单</el-dropdown-item
  62. >
  63. <el-dropdown-item
  64. v-if="$hasPermission('eom:print-invoice2')"
  65. @click.native="handlePrint('printTemplateJsRef')"
  66. >器械出库单</el-dropdown-item
  67. >
  68. <el-dropdown-item
  69. v-if="$hasPermission('eom:print-invoice3')"
  70. @click.native="handlePrint('printTemplateJsYpRef')"
  71. >药品出库单</el-dropdown-item
  72. >
  73. <el-dropdown-item
  74. v-if="$hasPermission('eom:print-invoice4')"
  75. @click.native="handlePrint('printTemplateWlRef')"
  76. >送货单模板</el-dropdown-item
  77. >
  78. <el-dropdown-item
  79. v-if="$hasPermission('eom:print-invoice5')"
  80. @click.native="handlePrint('printTemplateBSRef')"
  81. >送货单模板</el-dropdown-item
  82. >
  83. <el-dropdown-item
  84. v-if="$hasPermission('eom:print-invoice6')"
  85. @click.native="handleSignforPrint('printTemplateHtRef')"
  86. >货物签收单</el-dropdown-item
  87. >
  88. <el-dropdown-item
  89. v-if="$hasPermission('eom:print-invoice7')"
  90. @click.native="handlePrint('printTemplateJrRef')"
  91. >发货单</el-dropdown-item
  92. >
  93. <el-dropdown-item
  94. v-if="$hasPermission('eom:print-invoice8')"
  95. @click.native="handlePrint('printTemplateTrRef')"
  96. >送货单打印</el-dropdown-item
  97. >
  98. <el-dropdown-item
  99. v-if="$hasPermission('eom:print-invoice9')"
  100. @click.native="handleOutPrint('printTemplateHt1Ref')"
  101. >出库单</el-dropdown-item
  102. >
  103. </el-dropdown-menu>
  104. </el-dropdown>
  105. <exportButton
  106. btnName="列表导出"
  107. fileName="销售发货单"
  108. apiUrl="/eom/saleordersendrecord/export"
  109. :params="exportParams"
  110. ></exportButton>
  111. <exportButton
  112. btnName="明细导出"
  113. fileName="明细导出"
  114. apiUrl="/eom/saleordersendrecord/exportDetail"
  115. :params="exportParams"
  116. ></exportButton>
  117. </template>
  118. <!-- 查看详情列 -->
  119. <template v-slot:docNo="{ row }">
  120. <el-tag
  121. v-if="row.parentId && row.parentId != '0'"
  122. type="success"
  123. size="mini"
  124. effect="plain">
  125. </el-tag>
  126. <el-link
  127. type="primary"
  128. :underline="false"
  129. @click="openorderDetail(row, 'docNo')"
  130. >
  131. {{ row.docNo }}
  132. </el-link>
  133. </template>
  134. <template v-slot:orderNo="{ row }">
  135. <el-link
  136. type="primary"
  137. :underline="false"
  138. v-for="(v, j) in row.orderNo.split(',')"
  139. :key="v"
  140. @click="openorderDetail(row, 'orderNo', j)"
  141. >
  142. {{ v }}
  143. <span v-if="j != row.orderNo.split(',').length - 1">,</span>
  144. </el-link>
  145. </template>
  146. <!-- 操作列 -->
  147. <template v-slot:action="{ row }">
  148. <template v-if="row.suspendReviewStatus == 0 || row.suspendReviewStatus == 3 || row.isSuspend != 1">
  149. <el-link
  150. type="primary"
  151. :underline="false"
  152. icon="el-icon-edit"
  153. @click="openEdit('edit', row)"
  154. v-if="
  155. ([0, 3].includes(row.reviewStatus) &&
  156. isNeed_process_is_close) ||
  157. !isNeed_process_is_close
  158. "
  159. >
  160. 修改
  161. </el-link>
  162. <el-link
  163. type="primary"
  164. :underline="false"
  165. icon="el-icon-plus"
  166. @click="sendSubmit(row)"
  167. v-if="
  168. isNeed_process_is_close && [0, 3].includes(row.reviewStatus)
  169. "
  170. >
  171. 提交
  172. </el-link>
  173. <el-popconfirm
  174. class="ele-action"
  175. title="确定要删除此信息吗?"
  176. @confirm="remove([row.id])"
  177. v-if="
  178. (isNeed_process_is_close &&
  179. [0, 3].includes(row.reviewStatus)) ||
  180. !isNeed_process_is_close
  181. "
  182. >
  183. <template v-slot:reference>
  184. <el-link type="danger" :underline="false" icon="el-icon-delete">
  185. 删除
  186. </el-link>
  187. </template>
  188. </el-popconfirm>
  189. </template>
  190. <el-link
  191. type="primary"
  192. :underline="false"
  193. icon="el-icon-plus"
  194. @click="exportFile(row)"
  195. v-if="[2].includes(row.reviewStatus)"
  196. >
  197. 导出
  198. </el-link>
  199. <el-link
  200. type="primary"
  201. :underline="false"
  202. icon="el-icon-edit"
  203. @click="creatInvoiceConfirm(row)"
  204. v-if="row.isSplitFlag == 0 && ([2].includes(row.reviewStatus) && row.isSuspend != 1)"
  205. >
  206. 创建发货确认单
  207. </el-link>
  208. <el-link
  209. type="primary"
  210. :underline="false"
  211. icon="el-icon-edit"
  212. @click="creatReturnGoods('add', row)"
  213. v-if="row.isSplitFlag == 0 && ([2].includes(row.reviewStatus) && row.isSuspend != 1)"
  214. >
  215. 创建退货单
  216. </el-link>
  217. </template>
  218. </ele-pro-table>
  219. </div>
  220. </div>
  221. </el-card>
  222. <order-detail-dialog ref="orderDetailDialogRef"></order-detail-dialog>
  223. <add-invoice-dialog
  224. ref="invoiceDialogRef"
  225. @done="reload"
  226. :contactData="contactData"
  227. :saleOrderData="saleOrderData"
  228. ></add-invoice-dialog>
  229. <detail-dialog ref="DetailDialogRef"></detail-dialog>
  230. <add-return-goods-dialog
  231. ref="addReturnGoodsRef"
  232. @done="reload"
  233. :contactData="contactData"
  234. ></add-return-goods-dialog>
  235. <!-- 多选删除弹窗 -->
  236. <pop-modal
  237. :visible.sync="delVisible"
  238. content="是否确定删除?"
  239. @done="commitBtn"
  240. />
  241. <printTemplateBy
  242. ref="printTemplateByRef"
  243. :groupName="groupName"
  244. ></printTemplateBy>
  245. <printTemplateJs
  246. ref="printTemplateJsRef"
  247. :groupName="groupName"
  248. ></printTemplateJs>
  249. <printTemplateJsYp
  250. ref="printTemplateJsYpRef"
  251. :groupName="groupName"
  252. ></printTemplateJsYp>
  253. <printTemplateWl
  254. ref="printTemplateWlRef"
  255. :groupName="groupName"
  256. ></printTemplateWl>
  257. <printTemplateJr
  258. ref="printTemplateJrRef"
  259. :groupName="groupName"
  260. ></printTemplateJr>
  261. <printTemplateBs
  262. ref="printTemplateBSRef"
  263. :groupName="groupName"
  264. ></printTemplateBs>
  265. <printTemplateHt
  266. ref="printTemplateHtRef"
  267. :groupName="groupName"
  268. ></printTemplateHt>
  269. <printTemplateHt1
  270. ref="printTemplateHt1Ref"
  271. :groupName="groupName"
  272. ></printTemplateHt1>
  273. <printTemplateTr
  274. ref="printTemplateTrRef"
  275. :groupName="groupName"
  276. :companyInfo="companyInfo"
  277. ></printTemplateTr>
  278. <process-submit-dialog
  279. :isNotNeedProcess="false"
  280. :isCloseRefresh="false"
  281. :processSubmitDialogFlag.sync="processSubmitDialogFlag"
  282. :isSpecialeSubmit="isSpecialeSubmit"
  283. v-if="processSubmitDialogFlag"
  284. ref="processSubmitDialogRef"
  285. @reload="reload"
  286. @specialesubmit="specialesubmit"
  287. ></process-submit-dialog>
  288. <addInvoiceConfirm
  289. ref="addInvoiceConfirmRef"
  290. @done="reload"
  291. :contactData="contactData"
  292. :saleOrderData="saleOrderData"
  293. ></addInvoiceConfirm>
  294. </div>
  295. </template>
  296. <script>
  297. import { getSummaries } from '@/utils/util.js';
  298. import searchTable from './components/searchTable.vue';
  299. import addInvoiceDialog from './components/addInvoiceDialog.vue';
  300. import addInvoiceConfirm from '@/views/saleManage/saleOrder/invoiceConfirm/components/addInvoiceDialog.vue';
  301. import detailDialog from './components/detailDialog.vue';
  302. import popModal from '@/components/pop-modal';
  303. import { reviewStatus } from '@/enum/dict';
  304. import orderDetailDialog from '@/views/saleManage/saleOrder/components/detailDialog.vue';
  305. import addReturnGoodsDialog from '@/views/saleManage/saleOrder/returnGoods/components/addReturnGoodsDialog';
  306. import printTemplateBy from '@/views/saleManage/saleOrder/invoice/components/print-template-by.vue';
  307. import printTemplateJs from '@/views/saleManage/saleOrder/invoice/components/print-template-js.vue';
  308. import printTemplateJsYp from '@/views/saleManage/saleOrder/invoice/components/print-template-jsyp.vue';
  309. import printTemplateWl from '@/views/saleManage/saleOrder/invoice/components/print-template-wl.vue';
  310. import printTemplateBs from '@/views/saleManage/saleOrder/invoice/components/print-template-bs.vue';
  311. import printTemplateJr from '@/views/saleManage/saleOrder/invoice/components/print-template-jr.vue';
  312. import printTemplateHt from '@/views/saleManage/saleOrder/invoice/components/print-template-ht.vue';
  313. import printTemplateHt1 from '@/views/saleManage/saleOrder/invoice/components/print-template-ht-1.vue';
  314. import printTemplateTr from '@/views/saleManage/saleOrder/invoice/components/print-template-tr.vue';
  315. import {
  316. deleteSendInformation,
  317. getSendTableList,
  318. submit,
  319. specialSubmit
  320. } from '@/api/saleManage/saleordersendrecord';
  321. import dictMixins from '@/mixins/dictMixins';
  322. import processSubmitDialog from '@/BIZComponents/processSubmitDialog/processSubmitDialog.vue';
  323. import tabMixins from '@/mixins/tableColumnsMixin';
  324. import { enterprisePage } from '@/api/contractManage/contractBook';
  325. import { getSendSaleOrderrecordDetailSplit } from '@/api/saleManage/saleordersendrecord';
  326. import { getWarehouseListByIds } from '@/api/purchasingManage/returnGoods';
  327. import exportButton from '@/components/upload/exportButton.vue';
  328. import { downLoadTemplate } from '@/api/system/file/index.js';
  329. import { parameterGetByCode } from '@/api/main/index.js';
  330. export default {
  331. mixins: [dictMixins, tabMixins],
  332. components: {
  333. processSubmitDialog,
  334. printTemplateBy,
  335. searchTable,
  336. popModal,
  337. addReturnGoodsDialog,
  338. orderDetailDialog,
  339. addInvoiceDialog,
  340. detailDialog,
  341. addInvoiceConfirm,
  342. printTemplateJs,
  343. printTemplateJsYp,
  344. printTemplateWl,
  345. printTemplateBs,
  346. printTemplateJr,
  347. exportButton,
  348. printTemplateHt,
  349. printTemplateTr,
  350. printTemplateHt1
  351. },
  352. //客户管理数据
  353. props: {
  354. contactData: {
  355. type: Object,
  356. default: () => {
  357. return {};
  358. }
  359. },
  360. saleOrderData: {
  361. type: Object,
  362. default: () => {
  363. return {};
  364. }
  365. }
  366. },
  367. data() {
  368. return {
  369. params: {},
  370. activeComp: 'saleorder',
  371. companyInfo: {},
  372. tabOptions: [
  373. { key: 'saleorder', name: '销售订单' },
  374. { key: 'invoice', name: '发货单' },
  375. { key: 'returnorder', name: '退货单' }
  376. ],
  377. groupName: '',
  378. selection: [], //单选中集合
  379. delVisible: false, //批量删除弹框状态
  380. loading: false, // 加载状态
  381. processSubmitDialogFlag: false,
  382. columns: [
  383. {
  384. width: 45,
  385. type: 'selection',
  386. columnKey: 'selection',
  387. align: 'center'
  388. },
  389. {
  390. columnKey: 'index',
  391. label: '序号',
  392. type: 'index',
  393. width: 55,
  394. align: 'center',
  395. showOverflowTooltip: true,
  396. fixed: 'left'
  397. },
  398. {
  399. prop: 'docNo',
  400. label: '发货单编码',
  401. align: 'center',
  402. sortable: true,
  403. slot: 'docNo',
  404. showOverflowTooltip: true,
  405. minWidth: 220
  406. },
  407. {
  408. prop: 'orderNo',
  409. label: '销售订单编码',
  410. align: 'center',
  411. sortable: true,
  412. slot: 'orderNo',
  413. showOverflowTooltip: true,
  414. minWidth: 200
  415. },
  416. {
  417. prop: 'productNames',
  418. label: '产品名称',
  419. align: 'center',
  420. showOverflowTooltip: true,
  421. minWidth: 140
  422. },
  423. {
  424. prop: 'productCodes',
  425. label: '产品编码',
  426. align: 'center',
  427. showOverflowTooltip: true,
  428. minWidth: 160
  429. },
  430. {
  431. minWidth: 160,
  432. prop: 'productionCodes',
  433. label: '生产编号',
  434. align: 'center'
  435. },
  436. {
  437. prop: 'batchNos',
  438. label: '批次号',
  439. align: 'center',
  440. showOverflowTooltip: true,
  441. minWidth: 140
  442. },
  443. {
  444. prop: 'orderTotalCount',
  445. label: '订单数量',
  446. align: 'center',
  447. showOverflowTooltip: true,
  448. minWidth: 140
  449. },
  450. {
  451. prop: 'sendTotalCount',
  452. label: '发货数量',
  453. align: 'center',
  454. showOverflowTooltip: true,
  455. minWidth: 140
  456. },
  457. {
  458. prop: 'sendTotalAmount',
  459. label: '发货金额',
  460. align: 'center',
  461. showOverflowTooltip: true,
  462. minWidth: 140
  463. },
  464. {
  465. prop: 'outboundTotalCount',
  466. label: '出库数量',
  467. align: 'center',
  468. showOverflowTooltip: true,
  469. minWidth: 140
  470. },
  471. {
  472. prop: 'outboundTotalAmount',
  473. label: '出库金额',
  474. align: 'center',
  475. showOverflowTooltip: true,
  476. minWidth: 140
  477. },
  478. {
  479. prop: 'projectName',
  480. label: '项目名称',
  481. align: 'center',
  482. showOverflowTooltip: true,
  483. minWidth: 180
  484. },
  485. {
  486. prop: 'contactName',
  487. label: '客户名称',
  488. align: 'center',
  489. showOverflowTooltip: true,
  490. minWidth: 180
  491. },
  492. {
  493. prop: 'replied',
  494. label: '是否回执',
  495. align: 'center',
  496. showOverflowTooltip: true,
  497. minWidth: 120,
  498. formatter: (_row, _column, cellValue) => {
  499. return _row.replied == 1 ? '是' : '否';
  500. }
  501. },
  502. {
  503. prop: 'reviewStatus',
  504. label: '状态',
  505. align: 'center',
  506. showOverflowTooltip: true,
  507. minWidth: 100,
  508. formatter: (_row, _column, cellValue) => {
  509. return reviewStatus[_row.reviewStatus];
  510. }
  511. },
  512. {
  513. prop: 'reconciliationStatus',
  514. label: '对账状态',
  515. align: 'center',
  516. showOverflowTooltip: true,
  517. minWidth: 120,
  518. formatter: (_row, _column, cellValue) => {
  519. let options = [
  520. { value: 0, label: '未对账' },
  521. { value: 1, label: '部分对账' },
  522. { value: 2, label: '全部对账' }
  523. ];
  524. return options.find(item => item.value == cellValue)?.label || '';
  525. }
  526. },
  527. {
  528. prop: 'salesmanName',
  529. label: '业务员',
  530. align: 'center',
  531. showOverflowTooltip: true,
  532. minWidth: 80
  533. },
  534. {
  535. prop: 'createUserName',
  536. label: '创建人',
  537. align: 'center',
  538. showOverflowTooltip: true,
  539. minWidth: 80
  540. },
  541. {
  542. prop: 'createTime',
  543. label: '创建时间',
  544. align: 'center',
  545. showOverflowTooltip: true,
  546. minWidth: 170
  547. },
  548. {
  549. columnKey: 'action',
  550. label: '操作',
  551. width: 280,
  552. align: 'center',
  553. resizable: false,
  554. slot: 'action',
  555. showOverflowTooltip: true,
  556. fixed: 'right'
  557. }
  558. ],
  559. cacheKeyUrl: 'eos-bfe3d5ea-saleManage-invoice',
  560. isReview: false,
  561. isSpecialeSubmit: false
  562. };
  563. },
  564. computed: {
  565. exportParams() {
  566. return {
  567. ...this.params,
  568. sendRecordIds: this.selection.map(item => item.id)
  569. }
  570. }
  571. },
  572. created() {
  573. //打印是否需要审核//0否 1是
  574. parameterGetByCode({
  575. code: 'eom_invoice_print_need_review'
  576. }).then((res) => {
  577. this.isReview = res.value;
  578. });
  579. enterprisePage({
  580. pageNum: 1,
  581. size: 200
  582. }).then((res) => {
  583. if (res.list?.length > 0) {
  584. this.groupName = res.list[0].name;
  585. this.companyInfo = res.list[0];
  586. }
  587. });
  588. console.log('this.saleOrderData',this.saleOrderData.id)
  589. },
  590. watch: {
  591. saleOrderData: {
  592. handler(newVal, oldVal) {
  593. if (newVal.id) {
  594. this.reload();
  595. }
  596. },
  597. deep: true
  598. }
  599. },
  600. activated() {
  601. // 由 keep-alive 切回时刷新列表,但保留搜索条件与当前页码
  602. if (this.$refs.table) {
  603. this.$refs.table.reload();
  604. }
  605. },
  606. methods: {
  607. getSummaries(param) {
  608. return getSummaries(
  609. param,
  610. ['orderTotalCount', 'sendTotalCount', 'sendTotalAmount', 'outboundTotalCount', 'outboundTotalAmount'],
  611. ' '
  612. );
  613. },
  614. /* 表格数据源 */
  615. datasource({ page, limit, where, order }) {
  616. if (this.saleOrderData.id) {
  617. //订单详情进入
  618. where['orderId'] = this.saleOrderData.id;
  619. }
  620. if (this.contactData.id) {
  621. where['contactId'] = this.contactData.id;
  622. }
  623. this.params = {
  624. pageNum: page,
  625. size: limit,
  626. ...where
  627. };
  628. return getSendTableList({
  629. pageNum: page,
  630. size: limit,
  631. isResponseTree: true,
  632. ...where
  633. });
  634. },
  635. exportFile(row) {
  636. downLoadTemplate(
  637. `/eom/saleordersendrecord/export/${row.id}`,
  638. '货物签收单'
  639. );
  640. },
  641. //创建退货单
  642. creatReturnGoods(type, row) {
  643. this.$refs.addReturnGoodsRef.open(type, {}, row.id);
  644. },
  645. /* 刷新表格 */
  646. reload(where) {
  647. this.$refs.table.reload({ page: 1, where });
  648. this.$emit('getToDoReminder');
  649. },
  650. //新增编辑
  651. openEdit(type, row) {
  652. this.$refs.invoiceDialogRef.open(type, row);
  653. this.$refs.invoiceDialogRef.$refs.form &&
  654. this.$refs.invoiceDialogRef.$refs.form.clearValidate();
  655. },
  656. creatInvoiceConfirm(row) {
  657. this.$refs.addInvoiceConfirmRef.open('add', {}, row);
  658. },
  659. //批量删除
  660. allDelBtn() {
  661. if (this.selection.length === 0) return;
  662. let flag = this.selection.some((item) =>
  663. [1, 2].includes(item.reviewStatus)
  664. );
  665. if (flag)
  666. return this.$message.warning(
  667. '抱歉已审核、审核中的数据不能删除,请检查'
  668. );
  669. this.delVisible = true;
  670. },
  671. handlePrint(ref) {
  672. if (this.selection.length > 1)
  673. return this.$message.warning('请选择一条');
  674. const approveList = ['printTemplateJsRef', 'printTemplateJsYpRef', 'printTemplateWlRef']
  675. let flag = this.selection.some((item) =>
  676. [2].includes(item.reviewStatus)
  677. );
  678. console.log('flag', flag, approveList.includes(ref))
  679. if (!flag && (approveList.includes(ref) || this.isReview == 1))
  680. return this.$message.warning('抱歉需要已审核的发货单才能打印,请检查');
  681. if (ref != 'printTemplateByRef' && ref != 'printTemplateHtRef') {
  682. this.$refs[ref].open(this.selection[0].id);
  683. return;
  684. }
  685. this.$confirm('是否需要打印价格', '提示', {
  686. type: 'warning',
  687. cancelButtonText: '否',
  688. confirmButtonText: '是'
  689. })
  690. .then((res) => {
  691. this.$refs[ref].open(this.selection[0].id, true);
  692. })
  693. .catch((err) => {
  694. this.$refs[ref].open(this.selection[0].id, false);
  695. });
  696. },
  697. handleSignforPrint(ref) {
  698. this.$confirm('是否需要打印价格', '提示', {
  699. type: 'warning',
  700. cancelButtonText: '否',
  701. confirmButtonText: '是'
  702. })
  703. .then((res) => {
  704. this.$refs[ref].open(this.selection.map(item => item.id), true);
  705. })
  706. .catch((err) => {
  707. this.$refs[ref].open(this.selection.map(item => item.id), false);
  708. });
  709. },
  710. handleOutPrint(ref) {
  711. this.$refs[ref].open(this.selection.map(item => item.id), false);
  712. },
  713. //删除接口
  714. remove(delData) {
  715. deleteSendInformation(delData).then((res) => {
  716. this.$message.success('删除成功!');
  717. this.reload();
  718. });
  719. },
  720. //删除弹框确定
  721. commitBtn() {
  722. const dataId = this.selection.map((v) => v.id);
  723. this.remove(dataId);
  724. },
  725. async sendSubmit(res) {
  726. const data = await getSendSaleOrderrecordDetailSplit(res.id);
  727. let storemanIds = '';
  728. let ids = data.productList.map((item) => item.warehouseId);
  729. if (ids?.length) {
  730. let warehouseList = await getWarehouseListByIds(ids || []);
  731. storemanIds = warehouseList.map((item) => item.ownerId);
  732. }
  733. // 当ids数组去重去空后有不同的值时,设置isSpecialeSubmit为true
  734. const filteredIds = ids.filter(id => id !== undefined && id !== null && id !== '');
  735. const uniqueIds = [...new Set(filteredIds)];
  736. this.isSpecialeSubmit = uniqueIds.length > 1;
  737. this.processSubmitDialogFlag = true;
  738. this.$nextTick(() => {
  739. let params = {
  740. businessId: res.id,
  741. businessKey:
  742. res.isSuspend == 1 ? 'sales_suspend_send_approve' :
  743. res.saleTypeName.indexOf('技改') != '-1'
  744. ? 'sele_order_send_correction'
  745. : res.saleTypeName.indexOf('三包') != '-1'
  746. ? 'eom_sh'
  747. : res.saleTypeName.indexOf('补发') != '-1'
  748. ? 'eom_sh'
  749. : res.saleTypeName.indexOf('赠品') != '-1'
  750. ? 'sale_order_send_giftAndOther'
  751. : 'sales_send_approve',
  752. // businessKey:'eom_sh',
  753. formCreateUserId: res.createUserId,
  754. variables: {
  755. businessCode: res.docNo,
  756. businessName: res.contactName,
  757. storemanIds: storemanIds.toString(),
  758. businessType: data.sourceType == 3 ? '退货发货单' : '销售发货单'
  759. }
  760. };
  761. this.$refs.processSubmitDialogRef.init(params);
  762. });
  763. },
  764. async specialesubmit(params) {
  765. console.log('params~~~~~~', params);
  766. await specialSubmit(params.businessId, params);
  767. this.$message('提交审核成功');
  768. this.processSubmitDialogFlag = false;
  769. this.reload();
  770. },
  771. //查看详情
  772. openorderDetail(row, type, index) {
  773. if (type === 'docNo') {
  774. this.$refs.DetailDialogRef.open(row);
  775. }
  776. if (type === 'orderNo') {
  777. let orderId = '';
  778. if (row.orderIds) {
  779. orderId = row.orderIds.split(',')[index];
  780. } else {
  781. orderId = row.orderId;
  782. }
  783. this.$refs.orderDetailDialogRef.open({ id: orderId });
  784. }
  785. }
  786. }
  787. };
  788. </script>
  789. <style lang="scss" scoped>
  790. .ele-body {
  791. padding-top: 0;
  792. padding-bottom: 0;
  793. }
  794. :deep .el-card__body {
  795. padding: 0;
  796. }
  797. :deep(.el-link--inner) {
  798. margin-left: 0px !important;
  799. }
  800. .sys-organization-list {
  801. height: calc(100vh - 264px);
  802. box-sizing: border-box;
  803. border-width: 1px;
  804. border-style: solid;
  805. overflow: auto;
  806. }
  807. .sys-organization-list :deep(.el-tree-node__content) {
  808. height: 40px;
  809. & > .el-tree-node__expand-icon {
  810. margin-left: 10px;
  811. }
  812. }
  813. .switch_left ul .active {
  814. border-top: 4px solid var(--color-primary);
  815. color: var(--color-primary-5);
  816. }
  817. .switch {
  818. padding-bottom: 20px;
  819. }
  820. .el-dropdown-link {
  821. cursor: pointer;
  822. color: var(--color-primary-5);
  823. }
  824. .el-icon-arrow-down {
  825. font-size: 12px;
  826. }
  827. </style>