index.vue 39 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460
  1. <template>
  2. <div>
  3. <by-bill ref="bill" :propConfig="config" @search="search" @onSmt="onSmt" @onDelete="onDelete" @onRefresh="resert"
  4. @resert="resert" @detail="openEdit" @onSave="onSave" @clickTab="clickTab" @onChangeRow="onChangeRow"
  5. @pagination="pagination" @onReturnSmt="onReturnSmt2" @getSupplierModal="getSupplierModal"
  6. @printBefore="printBefore" @onReturn="onReturn">
  7. </by-bill>
  8. <SettingConfig ref="setForm" type="setCForm" title="出库单" />
  9. </div>
  10. </template>
  11. <script lang="ts">
  12. import { Component, Prop, Vue, Watch } from "vue-property-decorator";
  13. import api from "@/api/order";
  14. import BusinessType from "./components/businessType.vue";
  15. import towInOne from "../warehousing/components/towInOne.vue";
  16. import stockLook from "./components/stockLook.vue";
  17. import SettingConfig from "../saleOrder/components/settingConfig.vue";
  18. import { add } from '@/benyun/utils/accuracy'
  19. @Component({ components: { SettingConfig } })
  20. export default class Outbound extends Vue {
  21. // 左边
  22. tabType : any = 'all';
  23. isAdd : any = false;
  24. baseInfo : any = {};
  25. isSubmit : any = false
  26. isChange : any = false
  27. dataId : any = ''
  28. // 右边
  29. supplierInfo : any = {} // 机构信息
  30. businessType : any = '' // 业务类型
  31. tableData : any = []
  32. timeNum = 0;
  33. timer : any = null
  34. config : any = {
  35. attr: {
  36. activeName: 'all',
  37. calculateH: true
  38. },
  39. // 引单
  40. source: [
  41. {
  42. title: '销售订单',
  43. search: {
  44. attr: {
  45. size: 'mini',
  46. },
  47. columns: [
  48. [
  49. {
  50. span: 6,
  51. label: '单据编号',
  52. prop: 'orderNumber',
  53. component: 'by-input',
  54. compConfig: {
  55. attr: {
  56. placeholder: '请输入单据编号',
  57. clearable: true
  58. }
  59. }
  60. },
  61. ],
  62. ]
  63. },
  64. tool: {
  65. tools: {
  66. search: true,
  67. refresh: true
  68. },
  69. customTools: [
  70. {
  71. name: '引单出库', icon: 'el-icon-bottom', audit: [''], event: {
  72. click: () => {
  73. (this as any).citationOrder()
  74. }
  75. }
  76. },
  77. ]
  78. },
  79. table: {
  80. attr: {
  81. size: 'mini',
  82. seq: true,
  83. align: 'left',
  84. radio: true,
  85. triggerRowCheck: 'row'
  86. },
  87. columns: [
  88. {
  89. width: 144,
  90. title: '单据编号',
  91. field: 'orderNumber',
  92. },
  93. {
  94. width: 120,
  95. title: '收货人',
  96. field: 'consignee',
  97. },
  98. {
  99. width: 144,
  100. title: '财务编号',
  101. field: 'financeOrderId',
  102. },
  103. {
  104. width: 120,
  105. title: '联系方式',
  106. field: 'phone',
  107. },
  108. {
  109. width: 150,
  110. title: '计划交货时间',
  111. field: 'planDeliveryData',
  112. },
  113. {
  114. width: 150,
  115. title: '确定交货时间',
  116. field: 'affirmDeliveryData',
  117. },
  118. {
  119. width: 150,
  120. title: '交货地点',
  121. field: 'address',
  122. }
  123. ]
  124. }
  125. },
  126. ],
  127. // 单据
  128. bill: {
  129. tool: {
  130. tools: {
  131. save: true,
  132. return: true
  133. }
  134. },
  135. log: {
  136. request: {
  137. url: '/supply/supplyOutOrderOperateLog/page',
  138. method: 'GET'
  139. }
  140. },
  141. form: {
  142. attr: {
  143. size: 'medium',
  144. readonly: false,
  145. rules: {
  146. operator: [{
  147. required: true, message: '请输入经办人', trigger: 'blur'
  148. }],
  149. businessType: [{
  150. required: true, message: '请选择业务类型', trigger: 'change'
  151. }],
  152. }
  153. },
  154. columns: [
  155. [
  156. {
  157. span: 8,
  158. label: '单据编号',
  159. prop: 'outOrderNo',
  160. component: 'by-input',
  161. compConfig: {
  162. attr: {
  163. readonly: true
  164. },
  165. }
  166. },
  167. {
  168. span: 8,
  169. label: '经办人',
  170. prop: 'operator',
  171. component: 'by-input',
  172. },
  173. {
  174. span: 8,
  175. label: '收货人',
  176. prop: 'receive',
  177. component: 'by-input',
  178. },
  179. {
  180. span: 8,
  181. label: '收货地址',
  182. prop: 'receiveAddress',
  183. component: 'by-input',
  184. },
  185. {
  186. span: 8,
  187. label: '联系方式',
  188. prop: 'receivePhone',
  189. component: 'by-input',
  190. },
  191. {
  192. span: 8,
  193. label: '财务编号',
  194. prop: 'financeOrderId',
  195. component: 'by-input',
  196. compConfig: {
  197. attr: {
  198. readonly: true,
  199. },
  200. }
  201. },
  202. {
  203. span: 8,
  204. label: '业务类型',
  205. prop: 'businessType',
  206. component: BusinessType,
  207. },
  208. {
  209. span: 8,
  210. label: 'WMS编号',
  211. prop: 'wmsId',
  212. component: 'by-input',
  213. compConfig: {
  214. attr: {
  215. readonly: true,
  216. },
  217. }
  218. },
  219. ],
  220. [
  221. {
  222. span: 28,
  223. label: '备注',
  224. slot: true,
  225. prop: 'remark',
  226. component: 'by-input',
  227. compConfig: {
  228. attr: {
  229. placeholder: '请输入备注',
  230. type: 'textarea'
  231. },
  232. }
  233. },
  234. ]
  235. ]
  236. },
  237. tableConfig: [
  238. {
  239. table: {
  240. attr: {
  241. size: 'mini',
  242. align: 'left',
  243. readonly: true,
  244. },
  245. columns:
  246. [{
  247. width: 200,
  248. title: '物料名称',
  249. field: 'materialName',
  250. fixed: 'left'
  251. },
  252. {
  253. width: 70,
  254. title: '库存查看',
  255. component: stockLook,
  256. },
  257. {
  258. width: 80,
  259. title: '财务编号',
  260. field: 'financeSuborderId',
  261. },
  262. {
  263. width: 200,
  264. title: '仓库,仓位',
  265. field: 'towInOne',
  266. component: towInOne,
  267. compConfig: {
  268. isSelect: true
  269. }
  270. },
  271. {
  272. width: 70,
  273. title: '单位',
  274. field: 'unit',
  275. },
  276. {
  277. width: 70,
  278. title: '单位编码',
  279. field: 'unitCode',
  280. },
  281. {
  282. width: 80,
  283. title: '库存',
  284. field: 'inventory',
  285. },
  286. {
  287. width: 90,
  288. title: '数量',
  289. field: 'number',
  290. component: 'by-input',
  291. compConfig: {
  292. attr: {
  293. size: 'mini',
  294. type: 'number',
  295. defaultValue: 1,
  296. },
  297. }
  298. },
  299. {
  300. width: 80,
  301. title: '应出数量',
  302. field: 'deliveryNumber',
  303. },
  304. {
  305. width: 80,
  306. title: '出库数量',
  307. field: 'outNumber',
  308. },
  309. {
  310. width: 90,
  311. title: '单价',
  312. field: 'unitPrice',
  313. component: 'by-input',
  314. compConfig: {
  315. attr: {
  316. size: 'mini',
  317. type: 'number',
  318. },
  319. }
  320. },
  321. {
  322. width: 80,
  323. title: '优惠金额',
  324. field: 'prePrice',
  325. },
  326. {
  327. width: 90,
  328. title: '合计金额',
  329. field: 'totalPrice',
  330. },
  331. {
  332. width: 70,
  333. title: '操作',
  334. action: true,
  335. plugins: [{
  336. icon: 'el-icon-delete',
  337. name: '删除',
  338. audit: '',
  339. event: {
  340. click: (item : any) => {
  341. (this as any).changeTable(item)
  342. }
  343. }
  344. }]
  345. },
  346. ]
  347. }
  348. }
  349. ]
  350. },
  351. // 已提交
  352. smt: {
  353. search: {
  354. attr: {
  355. size: 'mini',
  356. },
  357. columns: [
  358. [
  359. {
  360. span: 6,
  361. label: '单据编号',
  362. prop: 'outOrderNo',
  363. component: 'by-input',
  364. compConfig: {
  365. attr: {
  366. placeholder: '请输入单据编号',
  367. clearable: true
  368. }
  369. }
  370. },
  371. ],
  372. ]
  373. },
  374. tool: {
  375. tools: {
  376. search: true,
  377. refresh: true
  378. },
  379. customTools: [
  380. {
  381. name: '同步到财务系统', icon: 'el-icon-top', audit: [''], event: {
  382. click: () => {
  383. (this as any).syncSystem()
  384. }
  385. }
  386. },
  387. ]
  388. },
  389. table: {
  390. attr: {
  391. size: 'mini',
  392. seq: true,
  393. align: 'left',
  394. checkbox: true,
  395. triggerRowCheck: 'row'
  396. },
  397. columns: [
  398. {
  399. width: 150,
  400. title: '单据编号',
  401. field: 'outOrderNo',
  402. isDetail: true,
  403. fixed: 'left'
  404. },
  405. {
  406. width: 150,
  407. title: '财务编号',
  408. field: 'financeOrderId',
  409. },
  410. {
  411. width: 150,
  412. title: 'WMS编号',
  413. field: 'wmsId',
  414. },
  415. {
  416. width: 120,
  417. title: '经办人',
  418. field: 'operator',
  419. },
  420. {
  421. width: 120,
  422. title: '收货人',
  423. field: 'receive',
  424. },
  425. {
  426. width: 120,
  427. title: '收货地址',
  428. field: 'receiveAddress',
  429. },
  430. {
  431. width: 120,
  432. title: '联系方式',
  433. field: 'receivePhone',
  434. },
  435. {
  436. width: 120,
  437. title: '业务类型',
  438. field: 'businessType',
  439. },
  440. {
  441. width: 110,
  442. title: '操作',
  443. action: true,
  444. plugins: [{
  445. // icon: 'el-icon-edit',
  446. name: '查看',
  447. audit: '',
  448. event: {
  449. click: (e : any) => {
  450. (this as any).setReadonly(e)
  451. }
  452. }
  453. }, {
  454. name: '反提交',
  455. event: {
  456. click: (item : any) => (this as any).onReturnSmt(item)
  457. }
  458. }]
  459. }
  460. ]
  461. }
  462. },
  463. // 草稿箱
  464. draftsBox: {
  465. search: {
  466. attr: {
  467. size: 'mini',
  468. },
  469. columns: [
  470. [
  471. {
  472. span: 6,
  473. label: '单据编号',
  474. prop: 'outOrderNo',
  475. component: 'by-input',
  476. compConfig: {
  477. attr: {
  478. placeholder: '请输入单据编号',
  479. clearable: true
  480. }
  481. }
  482. },
  483. ],
  484. ]
  485. },
  486. tool: {
  487. tools: {
  488. smt: true,
  489. delete: true,
  490. search: true,
  491. refresh: true
  492. }
  493. },
  494. table: {
  495. attr: {
  496. size: 'mini',
  497. seq: true,
  498. align: 'left',
  499. checkbox: true,
  500. triggerRowCheck: 'row'
  501. },
  502. columns: [
  503. {
  504. width: 150,
  505. title: '单据编号',
  506. field: 'outOrderNo',
  507. isDetail: true,
  508. fixed: 'left'
  509. },
  510. {
  511. width: 150,
  512. title: '财务编号',
  513. field: 'financeOrderId',
  514. },
  515. {
  516. width: 150,
  517. title: 'WMS编号',
  518. field: 'wmsId',
  519. },
  520. {
  521. width: 120,
  522. title: '经办人',
  523. field: 'operator',
  524. },
  525. {
  526. width: 120,
  527. title: '收货人',
  528. field: 'receive',
  529. },
  530. {
  531. width: 120,
  532. title: '收货地址',
  533. field: 'receiveAddress',
  534. },
  535. {
  536. width: 120,
  537. title: '联系方式',
  538. field: 'receivePhone',
  539. },
  540. {
  541. width: 120,
  542. title: '业务类型',
  543. field: 'businessType',
  544. },
  545. {
  546. width: 110,
  547. title: '操作',
  548. action: true,
  549. plugins: [{
  550. icon: 'el-icon-edit',
  551. name: '编辑',
  552. audit: '',
  553. event: {
  554. click: (e : any) => {
  555. (this as any).openEdit(e)
  556. }
  557. }
  558. }, {
  559. name: '删除',
  560. event: {
  561. click: (item : any) => (this as any).doDelete2(item)
  562. }
  563. }]
  564. }
  565. ]
  566. }
  567. },
  568. // 综合
  569. all: {
  570. search: {
  571. attr: {
  572. size: 'mini',
  573. },
  574. columns: [
  575. [
  576. {
  577. span: 6,
  578. label: '单据编号',
  579. prop: 'outOrderNo',
  580. component: 'by-input',
  581. compConfig: {
  582. attr: {
  583. placeholder: '请输入单据编号',
  584. clearable: true
  585. }
  586. }
  587. },
  588. ],
  589. ]
  590. },
  591. tool: {
  592. tools: {
  593. search: true,
  594. refresh: true
  595. },
  596. customTools: [
  597. {
  598. name: '引单出库', icon: 'el-icon-bottom', audit: [''], event: {
  599. click: () => {
  600. (this as any).outbound()
  601. }
  602. }
  603. },
  604. {
  605. name: '删除', icon: 'el-icon-delete', audit: [''], event: {
  606. click: () => {
  607. (this as any).onDelete('all')
  608. }
  609. }
  610. },
  611. {
  612. name: '同步到财务系统', icon: 'el-icon-top', audit: [''], event: {
  613. click: () => {
  614. (this as any).syncSystem()
  615. }
  616. }
  617. },
  618. {
  619. name: '参数配置', icon: 'el-icon-setting', audit: [''], event: {
  620. click: () => {
  621. (this as any).configuration()
  622. }
  623. }
  624. },
  625. ]
  626. },
  627. table: {
  628. attr: {
  629. size: 'mini',
  630. seq: true,
  631. align: 'left',
  632. checkbox: true,
  633. triggerRowCheck: 'row',
  634. maxHeight: "620"
  635. },
  636. columns: [
  637. {
  638. width: 150,
  639. title: '单据编号',
  640. field: 'outOrderNo',
  641. isDetail: true,
  642. fixed: 'left'
  643. },
  644. {
  645. width: 150,
  646. title: '财务编号',
  647. field: 'financeOrderId',
  648. },
  649. {
  650. width: 150,
  651. title: 'WMS编号',
  652. field: 'wmsId',
  653. },
  654. {
  655. width: 120,
  656. title: '经办人',
  657. field: 'operator',
  658. },
  659. {
  660. width: 120,
  661. title: '收货人',
  662. field: 'receive',
  663. },
  664. {
  665. width: 120,
  666. title: '收货地址',
  667. field: 'receiveAddress',
  668. },
  669. {
  670. width: 120,
  671. title: '联系方式',
  672. field: 'receivePhone',
  673. },
  674. {
  675. width: 120,
  676. title: '业务类型',
  677. field: 'businessType',
  678. },
  679. {
  680. width: 120,
  681. title: '操作',
  682. action: true,
  683. plugins: [{
  684. name: '查看',
  685. audit: '',
  686. event: {
  687. click: (e : any) => {
  688. (this as any).openEdit(e)
  689. }
  690. }
  691. }, {
  692. name: '删除',
  693. event: {
  694. click: (item : any) => (this as any).doDelete2(item)
  695. }
  696. }]
  697. }
  698. ]
  699. }
  700. },
  701. // 回收站
  702. recycleBin: {
  703. search: {
  704. attr: {
  705. size: 'mini',
  706. },
  707. columns: [
  708. [
  709. {
  710. span: 6,
  711. label: '单据编号',
  712. prop: 'outOrderNo',
  713. component: 'by-input',
  714. compConfig: {
  715. attr: {
  716. placeholder: '请输入单据编号',
  717. clearable: true
  718. }
  719. }
  720. },
  721. ],
  722. ]
  723. },
  724. tool: {
  725. tools: {
  726. search: true,
  727. refresh: true
  728. }
  729. },
  730. table: {
  731. attr: {
  732. size: 'mini',
  733. align: 'left',
  734. },
  735. columns: [
  736. {
  737. width: 150,
  738. title: '单据编号',
  739. field: 'outOrderNo',
  740. isDetail: true,
  741. fixed: 'left'
  742. },
  743. {
  744. width: 150,
  745. title: '财务编号',
  746. field: 'financeOrderId',
  747. },
  748. {
  749. width: 150,
  750. title: 'WMS编号',
  751. field: 'wmsId',
  752. },
  753. {
  754. width: 120,
  755. title: '经办人',
  756. field: 'operator',
  757. },
  758. {
  759. width: 120,
  760. title: '收货人',
  761. field: 'receive',
  762. },
  763. {
  764. width: 120,
  765. title: '收货地址',
  766. field: 'receiveAddress',
  767. },
  768. {
  769. width: 120,
  770. title: '联系方式',
  771. field: 'receivePhone',
  772. },
  773. {
  774. width: 120,
  775. title: '业务类型',
  776. field: 'businessType',
  777. },
  778. {
  779. width: 110,
  780. title: '操作',
  781. action: true,
  782. plugins: [{
  783. name: '查看',
  784. audit: '',
  785. event: {
  786. click: (e : any) => {
  787. (this as any).openEdit(e)
  788. }
  789. }
  790. }]
  791. }
  792. ]
  793. }
  794. }
  795. }
  796. created() {
  797. this.timer = setInterval(() => {
  798. this.getDataList()
  799. }, 500)
  800. }
  801. //打印前数据修改
  802. printBefore(params : any) {
  803. params.templateId = 12;
  804. let value = (this.$refs.bill as any).getBillFormValue();
  805. if (value) {
  806. let data : any = {};
  807. data.orderNumber = value.orderNumber;
  808. data.operator = value.operator;
  809. data.businessType = value.businessType;
  810. data.financeOrderId = value.financeOrderId;
  811. data.wmsId = value.wmsId;
  812. data.remark = value.remark;
  813. data.receivePhone = value.receivePhone;
  814. data.receiveAddress = value.receiveAddress;
  815. data.outOrderNo = value.outOrderNo;
  816. data.receive = value.receive;
  817. data.suborderList = [];
  818. if (value.suborderList) {
  819. data.totalNumber = 0;//总数量
  820. data.totalDeliveryNumber = 0; //总应出数量
  821. data.totalPri = 0;//总计金额
  822. data.totalOutNumber = 0; //总出库数量
  823. for (const item of value.suborderList) {
  824. let obj : any = {};
  825. obj.materialName = item.materialName;
  826. obj.financeSuborderId = item.financeSuborderId;
  827. obj.storehouseName = item.storehouseName;
  828. obj.storingLocationName = item.storingLocationName;
  829. obj.number = item.number;
  830. obj.deliveryNumber = item.deliveryNumber;
  831. obj.outNumber = item.outNumber;
  832. obj.prePrice = item.prePrice;
  833. obj.unitPrice = item.unitPrice;
  834. obj.totalPrice = item.totalPrice;
  835. data.suborderList.push(obj);
  836. if (Number(item.number)) {
  837. data.totalNumber = add(data.totalNumber, Number(item.number))
  838. }
  839. if (Number(item.deliveryNumber)) {
  840. data.totalDeliveryNumber = add(data.totalDeliveryNumber, Number(item.deliveryNumber))
  841. }
  842. if (Number(item.totalPrice)) {
  843. data.totalPri = add(data.totalPri, Number(item.totalPrice));
  844. }
  845. if (Number(item.outNumber)) {
  846. data.totalOutNumber = add(data.totalOutNumber, Number(item.outNumber));
  847. }
  848. }
  849. }
  850. params.templateData = data;
  851. }
  852. }
  853. // 参数配置
  854. configuration() {
  855. (this as any).$refs.setForm.openSetting();
  856. }
  857. // 引单
  858. citationOrder() {
  859. let parentData : any = (this as any).$refs.bill.getSourceTableSelectData(0);
  860. if (parentData.length <= 0) return this.$message.warning('请选择引单数据');
  861. let loading = this.$loading({ target: '.main-container' });
  862. api.single({ id: parentData[0].id }, 'supplyPurchaseOrder').then((res : any) => {
  863. if (res.code === 200) {
  864. parentData = res.data ? [res.data] : parentData;
  865. parentData = parentData.map((item : any) => {
  866. item.receiveAddress = item.address
  867. item.receive = item.consignee
  868. item.receivePhone = item.phone
  869. const { financeOrderId, ...newData } = item
  870. return newData
  871. })
  872. let billConfig = (this as any).$lodash.cloneDeep(this.config.bill);
  873. parentData[0].suborderList = parentData[0].suborderList.filter((v : any) => (v.number - v.outNumber) > 0);
  874. parentData[0].suborderList.map((v : any) => {
  875. v.deliveryNumber = v.number - v.outNumber;
  876. if (v.deliveryNumber < v.number) v.number = v.deliveryNumber;
  877. });
  878. this.tableData = parentData[0].suborderList;
  879. billConfig.tool.tools = { save: true, smt: true };
  880. // console.log('this.tableData ==> ', this.tableData);
  881. this.isAdd = true;
  882. (this.$refs.bill as any).showTab = 'bill';
  883. loading.close();
  884. setTimeout(() => {
  885. (this.$refs.bill as any).setBillConfig(billConfig);
  886. (this.$refs.bill as any).setBillFormValue(parentData[0]); // 设置单据表单数据
  887. (this.$refs.bill as any).setBillTableValue(parentData[0].suborderList, 0);// 设置第1张单据表格数据
  888. }, 0)
  889. } else loading.close();
  890. }).catch(() => loading.close());
  891. }
  892. // 获取机构数据
  893. getSupplierModal(e : any) {
  894. this.supplierInfo = e;
  895. }
  896. // 监听表格数据变化
  897. onChangeRow(e : any) {
  898. this.isChange = true;
  899. this.isSubmit = false;
  900. e.prePrice = e.prePrice ? e.prePrice : 0;
  901. e.realityPrice = parseFloat((e.number * e.unitPrice).toFixed(2));
  902. e.totalPrice = e.realityPrice - e.prePrice;
  903. }
  904. // 同步出库单到财务系统
  905. syncSystem() {
  906. let selectData = (this as any).$refs.bill.getTableSelectData(this.tabType);
  907. if (selectData.length > 0) {
  908. if (selectData.length > 1) return this.$message.warning('只能同步一条数据');
  909. // if (selectData[0].submitState != 1) return this.$message.warning('只能同步已提交数据');
  910. this.$confirm('确定同步订单吗', '注意', {
  911. confirmButtonText: '确定',
  912. cancelButtonText: '取消',
  913. type: 'warning',
  914. center: true
  915. }).then(() => {
  916. let loading = this.$loading({ target: '.main-container' });
  917. api.addOutStock({ ids: selectData[0].id }).then((res : any) => {
  918. loading.close();
  919. if (res.code === 200) {
  920. this.$message.success('同步订单成功');
  921. this.clickTab(this.tabType);
  922. } else this.$message.error(res.msg)
  923. }).catch(() => loading.close());
  924. }).catch(() => this.$message.info('已取消同步订单'));
  925. } else this.$message.warning('请选择同步数据');
  926. }
  927. // 保存
  928. onSave() {
  929. console.log('保存 ==>', this.tabType);
  930. (this as any).$refs.bill.$refs.billForm.validate().then(() => {
  931. let query = (this.$refs.bill as any).getBillFormValue(); // 获取单据数据
  932. // 子表数据
  933. console.log(query);
  934. query.purchaseOrderId = query.id;
  935. query.suborderList = (this.$refs.bill as any).getBillTableData(0);
  936. if (query.suborderList.length > 0) {
  937. for (let v of query.suborderList) {
  938. if (!v.unitPrice || v.unitPrice <= 0) return this.$message.warning('请输入正确物料单价');
  939. if (v.deliveryNumber < v.number) return this.$message.warning('数量不能大于应出数量');
  940. if (v.number > v.inventory) return this.$message.warning('出库数量不能大于库存数量');
  941. if (v.totalPrice <= 0) return this.$message.warning('合计金额不能为负数');
  942. v.taskOrderId = query.id;
  943. v.purchaseSuborderId = v.id;
  944. }
  945. };
  946. // 表格删除
  947. query.suborderList.map((v : any, i : any) => {
  948. if (v.isDeleted === 1 && !v.id) {
  949. query.suborderList.splice(i, 1)
  950. }
  951. });
  952. query.financeOrderId = ""
  953. console.log('出库参数query ==> ', query);
  954. let loading = this.$loading({ target: '.main-container' });
  955. if (this.isAdd) {
  956. query.suborderList.map((v : any) => {
  957. delete v.id;
  958. });
  959. delete query.id;
  960. api.outbound(query, 'supplyOutOrder').then((res : any) => {
  961. loading.close();
  962. if (res.code === 200) {
  963. this.isAdd = false;
  964. this.isChange = false;
  965. this.isSubmit = true;
  966. this.$message.success('保存成功');
  967. this.dataId = res.data;
  968. } else this.$message.error(res.msg);
  969. }).catch(() => loading.close());
  970. } else {
  971. query.submitState = 0;
  972. api.updateList(query, 'supplyOutOrder').then((res : any) => {
  973. loading.close();
  974. if (res.code === 200) {
  975. this.$message.success('保存成功');
  976. this.isChange = false;
  977. this.isSubmit = true;
  978. } else this.$message.error(res.msg);
  979. }).catch(() => loading.close());
  980. };
  981. })
  982. }
  983. // 切换tab栏
  984. clickTab(e : any) {
  985. // console.log('切换tab ==> ', e);
  986. this.tabType = e;
  987. (this.$refs.bill as any).showTab = e;
  988. // submitState: 提交状态
  989. if (e === 'source') { this.getCitationList({}) }; // 引单出库
  990. if (e === 'all') this.getPageList({}, 'all'); // 草稿箱数据
  991. if (e === 'draftsBox') this.getPageList({ submitState: 0 }, 'draftsBox'); // 草稿箱数据
  992. if (e === 'smt') this.getPageList({ submitState: 1 }, 'smt'); // 已提交数据
  993. if (e === 'recycleBin') this.getSelectDeleteList({}); // 回收站数据
  994. if (e === 'bill') {
  995. let billConfig = (this as any).$lodash.cloneDeep(this.config.bill);
  996. billConfig.tool.tools = {};
  997. billConfig.tool.customTools = [];
  998. (this.$refs.bill as any).setBillConfig(billConfig);
  999. }
  1000. }
  1001. // 出库打开引单
  1002. outbound() {
  1003. this.clickTab('source');
  1004. }
  1005. // 打开编辑
  1006. openEdit(e : any) {
  1007. e = e.row ? e.row : e;
  1008. let loading = this.$loading({ target: '.main-container' });
  1009. api.single({ id: e.id }, 'supplyOutOrder').then((res : any) => {
  1010. if (res.code === 200) {
  1011. let parentData = res.data ? res.data : e;
  1012. this.baseInfo = parentData;
  1013. if (this.tabType === 'all' || this.tabType === 'draftsBox') {
  1014. if (parentData.submitState === 1) {
  1015. loading.close();
  1016. return this.setReadonly(parentData)
  1017. }
  1018. let billConfig = (this as any).$lodash.cloneDeep(this.config.bill);
  1019. if (billConfig.tableConfig[0].table.columns.at(-1).title != '操作') {
  1020. billConfig.tableConfig[0].table.columns.push({
  1021. width: 90,
  1022. title: '操作',
  1023. action: true,
  1024. plugins: [{
  1025. icon: 'el-icon-delete',
  1026. name: '删除',
  1027. audit: '',
  1028. event: {
  1029. click: (item : any) => {
  1030. (this as any).changeTable(item)
  1031. }
  1032. }
  1033. }]
  1034. })
  1035. };
  1036. billConfig.tool.tools = { return: true, save: true, smt: true };
  1037. // 查销售订单数据
  1038. api.single({ id: e.purchaseOrderId }, 'supplyPurchaseOrder').then((val : any) => {
  1039. if (val.code === 200) {
  1040. parentData.suborderList.map((v : any, i : any) => {
  1041. v.outNumber = val.data.suborderList[i].outNumber;
  1042. v.prePrice = val.data.suborderList[i].prePrice;
  1043. // v.realityPrice = val.data.suborderList[i].realityPrice-v.prePrice;
  1044. console.log(v);
  1045. });
  1046. let data : any = parentData.suborderList;
  1047. let array : any = [];
  1048. data.map((v : any) => {
  1049. v.deliveryNumber = v.number - v.outNumber;
  1050. if (v.deliveryNumber < v.number) v.number = v.deliveryNumber;
  1051. v.towInOne = v.storehouseName + ',' + v.storingLocationName; // 仓库仓位
  1052. array.push({
  1053. storidId: v.storingLocationId,
  1054. skuid: v.materialSku,
  1055. })
  1056. });
  1057. // 查库存
  1058. api.getInventoryByStoridsAndSkuids(array).then((res : any) => {
  1059. if (res.code === 200) {
  1060. let newData : any = [];
  1061. res.data.map((v : any, i : any) => {
  1062. newData.push(Object.assign(data[i], v))
  1063. })
  1064. this.tableData = newData;
  1065. (this.$refs.bill as any).setBillConfig(billConfig);
  1066. (this.$refs.bill as any).setBillFormValue(parentData);// 设置单据表单数据
  1067. (this.$refs.bill as any).setBillTableValue(newData, 0);// 设置第1张单据表格数据
  1068. this.isAdd = false;
  1069. this.dataId = '';
  1070. (this.$refs.bill as any).showTab = 'bill';
  1071. loading.close();
  1072. } else loading.close();
  1073. }).catch(() => loading.close());
  1074. } else loading.close();
  1075. }).catch(() => loading.close());
  1076. } else {
  1077. loading.close();
  1078. this.setReadonly(parentData);
  1079. };
  1080. }
  1081. }).catch(() => loading.close());
  1082. }
  1083. // 设置只读
  1084. setReadonly(e : any) {
  1085. let parentData : any = e;
  1086. let loading = this.$loading({ target: '.main-container' });
  1087. let readonly = (this as any).$lodash.cloneDeep(this.config.bill);
  1088. readonly.form.attr.readonly = true; // 设置只读
  1089. readonly.tool.tools = { return: true, };
  1090. if (this.tabType != 'recycleBin') {
  1091. if (parentData.submitState === 1) readonly.tool.tools = { return: true, returnSmt: true, print: true };
  1092. }
  1093. readonly.tableConfig[0].table.columns = readonly.tableConfig[0].table.columns.filter((v : any) => v.title != '操作');
  1094. api.single({ id: e.purchaseOrderId }, 'supplyPurchaseOrder').then((val : any) => {
  1095. if (val.code === 200) {
  1096. parentData.suborderList.map((v : any, i : any) => {
  1097. v.prePrice = val.data.suborderList[i].prePrice;
  1098. });
  1099. let data = parentData.suborderList;
  1100. let array : any = [];
  1101. data.map((v : any) => {
  1102. v.towInOne = v.storehouseName + ',' + v.storingLocationName; // 仓库仓位
  1103. array.push({
  1104. storidId: v.storingLocationId,
  1105. skuid: v.materialSku,
  1106. })
  1107. });
  1108. // 查库存
  1109. api.getInventoryByStoridsAndSkuids(array).then((res : any) => {
  1110. if (res.code === 200) {
  1111. let newData : any = []
  1112. res.data.map((v : any, i : any) => {
  1113. newData.push(Object.assign(data[i], v))
  1114. })
  1115. this.tableData = newData;
  1116. (this.$refs.bill as any).setBillConfig(readonly);
  1117. (this.$refs.bill as any).setBillFormValue(parentData);// 设置单据表单数据
  1118. (this.$refs.bill as any).setBillTableValue(newData, 0);// 设置第1张单据表格数据
  1119. this.isAdd = false;
  1120. loading.close();
  1121. (this.$refs.bill as any).showTab = 'bill';
  1122. } else loading.close();
  1123. }).catch(() => loading.close());
  1124. } else loading.close();
  1125. }).catch(() => loading.close());
  1126. }
  1127. // 工具栏提交
  1128. onSmt(e : any) {
  1129. if (e === 'draftsBox') {
  1130. let selectData = (this.$refs.bill as any).getTableSelectData('draftsBox'); // 获取表格选中数据
  1131. if (selectData.length <= 0) return this.$message.warning('请选择提交数据');
  1132. if (selectData.length > 1) return this.$message.warning('只能提交一条数据');
  1133. this.$confirm('确定提交吗!', '注意', {
  1134. confirmButtonText: '确定',
  1135. cancelButtonText: '取消',
  1136. type: 'warning',
  1137. center: true
  1138. }).then(() => {
  1139. let loading = this.$loading({ target: '.main-container' });
  1140. api.submitTo({ id: selectData[0].id }, 'supplyOutOrder').then((res : any) => {
  1141. loading.close();
  1142. if (res.code === 200) {
  1143. this.$message.success('提交成功');
  1144. this.clickTab('draftsBox');
  1145. } else this.$message.error(res.msg)
  1146. }).catch(() => loading.close());
  1147. }).catch(() => this.$message.info('已取消提交'));
  1148. } else {
  1149. if (this.isAdd) return this.$message.warning('新增数据必须先保存才能提交');
  1150. console.log('isChange ==> ', this.isChange);
  1151. console.log('isSubmit ==> ', this.isSubmit);
  1152. if (this.isSubmit) {
  1153. this.$confirm('确定提交吗!', '注意', {
  1154. confirmButtonText: '确定',
  1155. cancelButtonText: '取消',
  1156. type: 'warning',
  1157. center: true
  1158. }).then(() => {
  1159. let id = this.dataId ? this.dataId : this.baseInfo.id;
  1160. let loading = this.$loading({ target: '.main-container' });
  1161. api.submitTo({ id: id }, 'supplyOutOrder').then((res : any) => {
  1162. loading.close();
  1163. if (res.code === 200) {
  1164. this.$message.success('提交成功');
  1165. this.isSubmit = false;
  1166. this.clickTab(this.tabType);
  1167. } else this.$message.error(res.msg)
  1168. }).catch(() => loading.close());
  1169. }).catch(() => this.$message.info('已取消提交'));
  1170. } else {
  1171. // 表单旧数据
  1172. let oldbillForm : any = (this as any).$lodash.cloneDeep(this.baseInfo);
  1173. if (oldbillForm.suborderList) delete oldbillForm.suborderList;
  1174. oldbillForm = JSON.stringify(oldbillForm);
  1175. // 表单新数据
  1176. let newBillForm : any = (this as any).$refs.bill.getBillFormValue();
  1177. if (newBillForm.suborderList) delete newBillForm.suborderList;
  1178. newBillForm = JSON.stringify(newBillForm);
  1179. // 表格旧数据
  1180. this.baseInfo.suborderList.map((v : any) => {
  1181. if (v._X_ROW_KEY) delete v._X_ROW_KEY;
  1182. });
  1183. let oldData : any = JSON.stringify(this.baseInfo.suborderList);
  1184. // 表格新数据
  1185. let newData : any = JSON.stringify((this as any).$refs.bill.getBillTableData(0));
  1186. // 数据有变进保存
  1187. if (this.isChange || oldbillForm != newBillForm || oldData != newData) {
  1188. return this.$message.warning('数据变更必须先保存再提交');
  1189. } else {
  1190. this.$confirm('确定提交吗!', '注意', {
  1191. confirmButtonText: '确定',
  1192. cancelButtonText: '取消',
  1193. type: 'warning',
  1194. center: true
  1195. }).then(() => {
  1196. let loading = this.$loading({ target: '.main-container' });
  1197. api.submitTo({ id: this.baseInfo.id }, 'supplyOutOrder').then((res : any) => {
  1198. loading.close();
  1199. if (res.code === 200) {
  1200. this.$message.success('提交成功');
  1201. this.dataId = '';
  1202. this.clickTab(this.tabType);
  1203. } else this.$message.error(res.msg)
  1204. }).catch(() => loading.close());
  1205. }).catch(() => this.$message.info('已取消提交'));
  1206. }
  1207. }
  1208. }
  1209. }
  1210. // 操作反提交
  1211. onReturnSmt(e : any) {
  1212. console.log('反提交 ==>', e);
  1213. this.$confirm('确定反提交吗!', '注意', {
  1214. confirmButtonText: '确定',
  1215. cancelButtonText: '取消',
  1216. type: 'warning',
  1217. center: true
  1218. }).then(() => {
  1219. let loading = this.$loading({ target: '.main-container' });
  1220. api.cancelSubmission({ id: e.id }, 'supplyOutOrder').then((res : any) => {
  1221. loading.close();
  1222. if (res.code === 200) {
  1223. this.$message.success('反提交成功');
  1224. this.clickTab(this.tabType);
  1225. } else this.$message.error(res.msg)
  1226. }).catch(() => loading.close());
  1227. }).catch(() => this.$message.info('已取消反提交'));
  1228. }
  1229. // 工具栏反提交
  1230. onReturnSmt2() {
  1231. console.log('工具栏反提交 ==>', this.baseInfo);
  1232. this.$confirm('确定反提交吗!', '注意', {
  1233. confirmButtonText: '确定',
  1234. cancelButtonText: '取消',
  1235. type: 'warning',
  1236. center: true
  1237. }).then(() => {
  1238. let loading = this.$loading({ target: '.main-container' });
  1239. api.cancelSubmission({ id: this.baseInfo.id }, 'supplyOutOrder').then((res : any) => {
  1240. loading.close();
  1241. if (res.code === 200) {
  1242. this.$message.success('反提交成功');
  1243. this.clickTab(this.tabType);
  1244. } else this.$message.error(res.msg)
  1245. }).catch(() => loading.close());
  1246. }).catch(() => this.$message.info('已取消反提交'));
  1247. }
  1248. // 初始化
  1249. getDataList() {
  1250. if (!this.$refs.bill) {
  1251. if (this.timeNum > 5) {
  1252. clearInterval(this.timer)
  1253. }
  1254. this.timeNum++;
  1255. return
  1256. }
  1257. clearInterval(this.timer)
  1258. this.getPageList({}, 'all'); // 综合数据
  1259. }
  1260. // 获取引单分页数据
  1261. getCitationList(query : any) {
  1262. let loading = this.$loading({ target: '.main-container' });
  1263. api.pageList(query, 'supplyPurchaseOrder').then((res : any) => {
  1264. loading.close();
  1265. if (res.code === 200) {
  1266. (this.$refs.bill as any).setSourceTableData(0, res.data.records);
  1267. let page = {
  1268. pageNo: res.data.current, //当前页
  1269. pageSize: res.data.size, //每页条数
  1270. total: res.data.total //总条数
  1271. };
  1272. (this.$refs.bill as any).setSourcePage(0, page);
  1273. } else this.$message.error(res.msg)
  1274. }).catch(() => loading.close());
  1275. }
  1276. // 获取分页数据
  1277. getPageList(query : any, type : any) {
  1278. let data = (this.$refs.bill as any).getTablePage(this.tabType);
  1279. query.pageNo = data.pageNo;
  1280. query.pageSize = 10;
  1281. let loading = this.$loading({ target: '.main-container' });
  1282. api.pageList(query, 'supplyOutOrder').then((res : any) => {
  1283. loading.close();
  1284. if (res.code === 200) {
  1285. (this.$refs.bill as any).setTabTableValue(type, res.data.records);
  1286. let page = {
  1287. pageNo: res.data.current, //当前页
  1288. pageSize: res.data.size, //每页条数
  1289. total: res.data.total //总条数
  1290. };
  1291. (this.$refs.bill as any).setTablePage(type, page);
  1292. } else this.$message.error(res.msg)
  1293. }).catch(() => loading.close());
  1294. }
  1295. // 分页
  1296. pagination(e : any) {
  1297. console.log('分页 ==> ', e);
  1298. if (e.type === 'source_0') {
  1299. let query : any = (this as any).$refs.bill.$refs.source_0[0].getSearchValue();
  1300. query.pageNo = e.page.pageNum;
  1301. query.pageSize = e.page.pageSize;
  1302. this.getCitationList(query);
  1303. } else {
  1304. let query : any = (this as any).$refs.bill.getSearchValue(e.type);
  1305. query.pageNo = e.page.pageNum;
  1306. query.pageSize = e.page.pageSize;
  1307. let loading = this.$loading({ target: '.main-container' });
  1308. if (e.type === 'recycleBin') {
  1309. api.selectDeleteList(query, 'supplyOutOrder').then((res : any) => {
  1310. loading.close();
  1311. if (res.code === 200) {
  1312. (this.$refs.bill as any).setTabTableValue('recycleBin', res.data.records);
  1313. } else this.$message.error(res.msg)
  1314. }).catch(() => loading.close());
  1315. } else {
  1316. api.pageList(query, 'supplyOutOrder').then((res : any) => {
  1317. loading.close();
  1318. if (res.code === 200) {
  1319. (this.$refs.bill as any).setTabTableValue(e.type, res.data.records);
  1320. } else this.$message.error(res.msg)
  1321. }).catch(() => loading.close());
  1322. }
  1323. }
  1324. }
  1325. // 回收站数据
  1326. getSelectDeleteList(query : any) {
  1327. let loading = this.$loading({ target: '.main-container' });
  1328. api.selectDeleteList(query, 'supplyOutOrder').then((res : any) => {
  1329. loading.close();
  1330. if (res.code === 200) {
  1331. (this.$refs.bill as any).setTabTableValue('recycleBin', res.data.records);
  1332. let page = {
  1333. pageNo: res.data.current, //当前页
  1334. pageSize: res.data.size, //每页条数
  1335. total: res.data.total //总条数
  1336. };
  1337. (this.$refs.bill as any).setTablePage('recycleBin', page)
  1338. } else this.$message.error(res.msg)
  1339. }).catch(() => loading.close());
  1340. }
  1341. // 返回
  1342. onReturn() {
  1343. this.clickTab(this.tabType);
  1344. }
  1345. // 搜索
  1346. search(parames : any) {
  1347. console.log('搜索 ==> ', parames);
  1348. let query = parames.value;
  1349. if (parames.type === 'source_0') {
  1350. this.getCitationList(query); // 引单数据
  1351. } else {
  1352. if (parames.type === 'recycleBin') {
  1353. this.getSelectDeleteList(query); // 回收站分页数据
  1354. } else {
  1355. if (parames.type === 'draftsBox') query.submitState = 0;// 草稿箱数据
  1356. if (parames.type === 'smt') query.submitState = 1; // 已提交数据
  1357. this.getPageList(query, parames.type) // 获取分页数据
  1358. }
  1359. }
  1360. }
  1361. // 刷新/重置
  1362. resert(e : any) {
  1363. let data : any = e.type ? e.type : e;
  1364. console.log('刷新/重置 ==> ', data);
  1365. if (data === 'source_0') {
  1366. (this as any).$refs.bill.$refs.source_0[0].clearSearch();
  1367. this.getCitationList({}); // 引单数据
  1368. } else {
  1369. (this as any).$refs.bill.$refs[data].clearSearch();
  1370. if (data === 'all') this.getPageList({}, 'all'); // 综合数据
  1371. if (data === 'draftsBox') this.getPageList({ submitState: 0 }, 'draftsBox'); // 草稿箱数据
  1372. if (data === 'smt') this.getPageList({ submitState: 1 }, 'smt'); // 已提交数据
  1373. if (data === 'recycleBin') this.getSelectDeleteList({}) // 回收站数据
  1374. }
  1375. }
  1376. // 单据表格删除
  1377. changeTable(item : any) {
  1378. this.$confirm('确定删除吗!', '注意', {
  1379. confirmButtonText: '确定',
  1380. cancelButtonText: '取消',
  1381. type: 'warning',
  1382. center: true
  1383. }).then(() => {
  1384. let data = (this.$refs.bill as any).getBillTableData(0);
  1385. let i = -1;
  1386. let j = -1;
  1387. for (const v of data) {
  1388. i++;
  1389. if (v.materialSku == item.materialSku) {
  1390. break
  1391. }
  1392. };
  1393. console.log(this.tableData);
  1394. for (const v of this.tableData) {
  1395. j++;
  1396. if (v.materialSku == item.materialSku && item.isDeleted === 0) {
  1397. break
  1398. }
  1399. };
  1400. this.tableData[j].isDeleted = 1;
  1401. data.splice(i, 1);
  1402. (this.$refs.bill as any).setBillTableValue(data, 0);// 设置第1张单据表格数据
  1403. this.$message.success('删除成功');
  1404. }).catch(() => this.$message.info('已取消删除'));
  1405. }
  1406. // 工具栏删除
  1407. onDelete(e : any) {
  1408. let selectData = (this.$refs.bill as any).getTableSelectData(e)
  1409. let ids = '';
  1410. if (selectData.length > 0) {
  1411. selectData.map((v : any) => {
  1412. ids += v.id + ','
  1413. })
  1414. } else return this.$message({ type: 'warning', message: '请选择删除数据' })
  1415. ids = ids.slice(0, ids.length - 1);
  1416. this.$confirm('确定删除吗,此操作不能撤销!', '注意', {
  1417. confirmButtonText: '确定',
  1418. cancelButtonText: '取消',
  1419. type: 'warning',
  1420. center: true
  1421. }).then(() => {
  1422. let loading = this.$loading({ target: '.main-container' });
  1423. api.deleteList({ ids: ids }, 'supplyOutOrder').then((res : any) => {
  1424. loading.close();
  1425. if (res.code === 200) {
  1426. this.$message.success('删除成功');
  1427. this.clickTab(this.tabType);
  1428. } else this.$message.error(res.msg)
  1429. }).catch(() => loading.close());
  1430. }).catch(() => this.$message.info('已取消删除'));
  1431. }
  1432. // 操作删除
  1433. doDelete2(item : any) {
  1434. this.$confirm('确定删除吗,此操作不能撤销!', '注意', {
  1435. confirmButtonText: '确定',
  1436. cancelButtonText: '取消',
  1437. type: 'warning',
  1438. center: true
  1439. }).then(() => {
  1440. let loading = this.$loading({ target: '.main-container' });
  1441. api.deleteList({ ids: item.id }, 'supplyOutOrder').then((res : any) => {
  1442. loading.close();
  1443. if (res.code === 200) {
  1444. this.$message.success('删除成功');
  1445. this.clickTab(this.tabType);
  1446. } else this.$message.error(res.msg)
  1447. }).catch(() => loading.close());
  1448. }).catch(() => this.$message.info('已取消删除'));
  1449. }
  1450. }
  1451. </script>