warehousing-processing.js 33 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072
  1. /*******************************************************************************
  2. * Copyright(c) 2021 dongke All rights reserved. / Confidential
  3. * 类的信息:
  4. * 1.程序名称:
  5. * 2.功能描述:出库办理
  6. * 编辑履历:
  7. * 作者 日期 版本 修改内容
  8. * 王英杰 2023年8月17日 1.00 一览
  9. *******************************************************************************/
  10. const app = getApp()
  11. const Constants = require('@/utils/Constants.js');
  12. const api = require('@/utils/api.js');
  13. const util = require('@/utils/util.js')
  14. const common = require('@/utils/common.js')
  15. Page({
  16. /**
  17. * 页面的初始数据
  18. */
  19. data: {
  20. active: 0,
  21. createTimeType: {
  22. text: '近30天',
  23. value: 5
  24. },
  25. //筛选字段
  26. searchForm: {
  27. checked: false,
  28. entryKinds: [],
  29. entryReasons: [],
  30. customerName: '',
  31. customerPhone: '',
  32. addressFullReturn: '',
  33. supplierName: '',
  34. warehousingTime: '',
  35. warehousingTimeList: [],
  36. deliveryTime: '',
  37. deliveryTimeList: [],
  38. },
  39. outStatus: 0,
  40. list: [],
  41. totallength: 0, //合计
  42. selectlength: 0,
  43. selectTotallength: 0,
  44. pageInfo: {
  45. pageSize: 10,
  46. currentPage: 1
  47. },
  48. searchText: '',
  49. form: {
  50. deliveryTime: ''
  51. },
  52. },
  53. /**查找冲正数据监听切换事件 */
  54. onCheckboxChange(event) {
  55. let searchForm = this.data.searchForm
  56. searchForm.checked = event.detail
  57. this.setData({
  58. searchForm: searchForm
  59. })
  60. },
  61. /**
  62. * @desc : 单据状态点击事件
  63. * @author : 王英杰
  64. * @date : 2023年10月12日
  65. */
  66. dropdowncommit(e) {
  67. this.selectComponent("#statusItem").toggle(false) //取消选中样式
  68. console.log("dropdowncommit", e)
  69. let dataList = e.detail.dataList
  70. let type = e.currentTarget.dataset.type
  71. this.setData({
  72. objectType: e.detail.values
  73. })
  74. this.doSearch()
  75. },
  76. /**
  77. * @desc : 页面上拉触底事件的处理函数
  78. * @author : 于继渤
  79. * @date : 2022/5/24 08:49
  80. */
  81. onReachBottom: function () {
  82. if (this.data.loading || this.data.noMore) {
  83. return;
  84. }
  85. this.setData({
  86. pageInfo: {
  87. pageSize: this.data.pageInfo.pageSize,
  88. currentPage: this.data.pageInfo.currentPage + 1
  89. }
  90. })
  91. this.getData('more')
  92. },
  93. /**跳转入库撤回 */
  94. toOutboundWithdrawal(e) {
  95. wx.navigateTo({
  96. url: '/package6/pages/received-order/received-order?item=' + encodeURIComponent(JSON.stringify(e.currentTarget.dataset.item)) + '&sourcePage=outbound-processing',
  97. })
  98. },
  99. // 明细数据
  100. toDetail(e) {
  101. //待出库
  102. if (this.data.active == 0) {
  103. this.toOutboundProcessing(e)
  104. } else {
  105. this.toRevokel(e)
  106. }
  107. },
  108. /**
  109. * @desc : 跳转扫码入库
  110. * @author : 王英杰
  111. * @date : 2023年9月5日
  112. */
  113. toScanProcessing(e) {
  114. this.setData({
  115. showShare: false
  116. })
  117. let item = e.currentTarget.dataset.item
  118. if (item.entryKindName == "其他入库") {
  119. wx.navigateTo({
  120. url: '/package7/pages/scan-show-other-warehousing/scan-show-other-warehousing?item=' + encodeURIComponent(JSON.stringify(e.currentTarget.dataset.item)) + '&sourcePage=scan-Warehousing-processing',
  121. })
  122. } else if (item.entryKindName == "采购入库") {
  123. wx.navigateTo({
  124. url: 'add/add?item=' + encodeURIComponent(JSON.stringify(e.currentTarget.dataset.item)),
  125. })
  126. } else if (item.entryKindName == "销售回库") {
  127. wx.navigateTo({
  128. url: '/package7/pages/sales-return-reversal/sales-return-reversal?item=' + encodeURIComponent(JSON.stringify(e.currentTarget.dataset.item)) + '&sourcePage=sales-return-reversal-add'+ '&scanflag=true',
  129. })
  130. }
  131. },
  132. /**
  133. * @desc : 跳转入库办理
  134. * @author : 王英杰
  135. * @date : 2023年9月5日
  136. */
  137. toOutboundProcessing(e) {
  138. this.setData({
  139. showShare: false
  140. })
  141. let item = e.currentTarget.dataset.item
  142. if (item.entryKindName == "其他入库") {
  143. wx.navigateTo({
  144. url: '/package7/pages/scan-show-other-warehousing/scan-show-other-warehousing?item=' + encodeURIComponent(JSON.stringify(e.currentTarget.dataset.item)) + '&sourcePage=Warehousing-processing',
  145. })
  146. } else if (item.entryKindName == "采购入库") {
  147. wx.navigateTo({
  148. url: 'add/add?item=' + encodeURIComponent(JSON.stringify(e.currentTarget.dataset.item)) + '&sourcePage=scan-show-purchase',
  149. })
  150. } else if (item.entryKindName == "销售回库") {
  151. wx.navigateTo({
  152. url: '/package7/pages/sales-return-reversal/sales-return-reversal?item=' + encodeURIComponent(JSON.stringify(e.currentTarget.dataset.item)) + '&sourcePage=sales-return-reversal-add',
  153. })
  154. }
  155. },
  156. //入库撤回
  157. toRevokel(e) {
  158. this.setData({
  159. showShare: false
  160. })
  161. let item = e.currentTarget.dataset.item
  162. if (item.entryKindName == "其他入库") {
  163. wx.navigateTo({
  164. url: '/package7/pages/receipt-rollback/receipt-rollback?item=' + encodeURIComponent(JSON.stringify(e.currentTarget.dataset.item)) + '&sourcePage=outbound-withdrawal',
  165. })
  166. } else if (item.entryKindName == "采购入库") {
  167. wx.navigateTo({
  168. url: 'add/add?item=' + encodeURIComponent(JSON.stringify(e.currentTarget.dataset.item)) + '&sourcePage=scan-show-purchase',
  169. })
  170. } else if (item.entryKindName == "销售回库") {
  171. wx.navigateTo({
  172. url: '/package7/pages/sales-return-details/sales-return-details?item=' + encodeURIComponent(JSON.stringify(e.currentTarget.dataset.item)) + '&sourcePage=sales-return-details',
  173. })
  174. }
  175. },
  176. /**
  177. * @desc : 列表右上角三个点触发事件
  178. * @author : 王英杰
  179. * @date : 2023年8月21日
  180. */
  181. onclik(e) {
  182. this.setData({
  183. bottomItem: e.currentTarget.dataset.item,
  184. showShare: true
  185. })
  186. },
  187. /** 复制事件 */
  188. toCopy(e) {
  189. let copyValue = e.currentTarget.dataset.text
  190. if (!copyValue) return;
  191. wx.setClipboardData({
  192. data: copyValue,
  193. success: res => {
  194. wx.showToast({
  195. title: "出库单号" +
  196. '已复制',
  197. duration: 1000,
  198. })
  199. }
  200. })
  201. },
  202. /**
  203. * @desc : 列表右上角三个点关闭触发事件
  204. * @author : wangyingjie
  205. * @date : 2023年8月21日
  206. */
  207. onCloseShare() {
  208. this.setData({
  209. showShare: false
  210. })
  211. },
  212. /**
  213. * 生命周期函数--监听页面加载
  214. */
  215. onLoad(options) {
  216. //订单新建
  217. // let ORDER_OUTBOUND = common.hasButtonRight(Constants.ORDER_OUTBOUND)
  218. this.setData({
  219. ORDER_OUTBOUND: true,
  220. })
  221. },
  222. onShow(options) {
  223. this.selectComponent("#pick").toggle(false) //取消选中样式
  224. this.doSearch();
  225. },
  226. /**
  227. * @desc : 小程序出库办理查询
  228. * @author : 王英杰
  229. * @date : 2023年8月21日
  230. */
  231. doSearch() {
  232. let pageInfo = this.data.pageInfo;
  233. pageInfo.pageSize = 10;
  234. pageInfo.currentPage = 1;
  235. this.setData({
  236. show: false,
  237. noMore: false,
  238. pageInfo: pageInfo,
  239. totallength: 0, //合计
  240. selectlength: 0, //单数
  241. list: [],
  242. })
  243. this.getData()
  244. },
  245. /**
  246. * @desc : 小程序出库办理分页查询
  247. * @author : 王英杰
  248. * @date : 2023年8月21日
  249. */
  250. getData(e) {
  251. //日期相关
  252. var createtime = this.selectComponent('#createtime');
  253. this.setData({
  254. createTimeSearch: [createtime.data.dataDefaultSearch[0].replaceAll('/', '-'), createtime.data.dataDefaultSearch[1].replaceAll('/', '-')]
  255. })
  256. let searchForm = this.data.searchForm
  257. let pageInfo = this.data.pageInfo
  258. let param = {
  259. pageSize: pageInfo.pageSize,
  260. currentPage: pageInfo.currentPage
  261. }
  262. param.screenCondition = this.data.searchText ? this.data.searchText : '' //查询框
  263. param.opCreateTimeStart = this.data.createTimeSearch[0] ? this.data.createTimeSearch[0] + ' 00:00:00' : '' // 开始时间
  264. param.opCreateTimeEnd = this.data.createTimeSearch[1] ? this.data.createTimeSearch[1] + ' 23:59:59' : '' //结束时间
  265. //判断是否选择入库选中的时间
  266. if (searchForm.deliveryTimeList.length > 0) {
  267. param.deliveryTimeStart = searchForm.deliveryTimeList[0] ? searchForm.deliveryTimeList[0] : ''
  268. param.deliveryTimeEnd = searchForm.deliveryTimeList[1] ? searchForm.deliveryTimeList[1] : ''
  269. }
  270. if (searchForm.warehousingTimeList.length > 0) {
  271. param.entryDateStart = searchForm.warehousingTimeList[0] ? searchForm.warehousingTimeList[0] : ''
  272. param.entryDateEnd = searchForm.warehousingTimeList[1] ? searchForm.warehousingTimeList[1] : ''
  273. }
  274. if (this.data.active == 0) { //待出库
  275. if (searchForm.checked) { //筛选--选择查看冲正数据
  276. param.entryStatuses = [-1]
  277. } else {
  278. param.entryStatuses = [2, 4]
  279. }
  280. } else { //已出库
  281. if (searchForm.checked) { //筛选--选择查看冲正数据
  282. param.entryStatuses = [-2]
  283. } else {
  284. param.entryStatuses = [3]
  285. }
  286. }
  287. param.entryKinds = searchForm.entryKinds
  288. param.entryReasons = searchForm.entryReasons
  289. param.customerNameEntry = searchForm.customerName
  290. param.customerPhoneEntry = searchForm.customerPhone
  291. param.addressFullEntry = searchForm.addressFullReturn
  292. param.supplierName = searchForm.supplierName
  293. let tList =
  294. [
  295. {
  296. "entryId": 523,
  297. "customerId": 1022,
  298. "customerName": "怀化辰溪恒洁卫浴",
  299. "customerPhone": "15096295820",
  300. "contactName": "营养快线",
  301. "contactPhones": "17642008208",
  302. "salesChannel": null,
  303. "orgId": 30883,
  304. "entryNo": "WE-0726-726-202310270KDB",
  305. "supplierId": 114,
  306. "orderId": 8680,
  307. "orderNo": "PA-0726-726-202310270KD9",
  308. "entryStatus": 2,
  309. "sumEntryGoingQuantity": 300,
  310. "sumEntryGoingAmount": 500000,
  311. "sumEntryQuantity": 0,
  312. "sumEntryAmount": 0,
  313. "remarks": "AAAA",
  314. "flgValid": true,
  315. "cpId": 20834,
  316. "opCreateTime": "2023-10-27 15:22:15",
  317. "opCreateUserId": 254,
  318. "opUpdateTime": "2023-11-14 16:42:55",
  319. "opUpdateUserId": 74,
  320. "sale1Id": 20834,
  321. "sale2Id": 29039,
  322. "ascpId": 29039,
  323. "entryKind": "入库类型-采购",
  324. "entryReason": null,
  325. "sale1OutId": 1263,
  326. "staffId": 634,
  327. "rejectId": null,
  328. "rejectNo": null,
  329. "orgName": "辰溪县金海店",
  330. "entryReasonName": null,
  331. "responsibleName": null,
  332. "entryDate": null,
  333. "sale1OutDate": "2023-10-27",
  334. "entryWhId": 585,
  335. "addressArea": null,
  336. "addressName": null,
  337. "addressGcj02": null,
  338. "addressFull": "辽宁省沈阳市浑南区辽宁心选网络科技有限公司1111B🙄",
  339. "sale2IvtType": null,
  340. "whName": "1",
  341. "makingUser": 74,
  342. "salesChannelCode": null,
  343. "doneUser": 74,
  344. "doneTime": "2023-11-14 16:41:19",
  345. "orderEntryItemList": null,
  346. "entryStatusName": "入库中",
  347. "entryObjectName": "怀化辰溪恒洁卫浴",
  348. "erpOutNo": "CSSAYYY23102700002",
  349. "categoryQuantity": null,
  350. "staffName": "姜宁",
  351. "sale1ErpOutDoneNo": "CSIDYYY23102700002",
  352. "flgAllowTodone": null,
  353. "flgAllowReverse": true,
  354. "entryObjectId": 1022,
  355. "entryObjectType": 1,
  356. "sale2Name": null,
  357. "procureOrderNo": null,
  358. "invoiceDate": null,
  359. "entryKindName": "采购入库",
  360. "supplierName": "怀化辰溪恒洁卫浴-供应商",
  361. "statusName": null,
  362. "inOutStatus": null,
  363. "inOutDate": null,
  364. "sumQuantity": null,
  365. "sumAmount": null,
  366. "consignee": null,
  367. "consigneePhone": null,
  368. "takeOverAddress": null,
  369. "makingUserName": "常皓宁",
  370. "doneUserName": null,
  371. "makingTime": "2023/11/14 16:41:19",
  372. "totalRemarks": null,
  373. "entryStatusString": null,
  374. "nonStandardCode": null,
  375. "annexPaths": [
  376. {
  377. "url": "https://hgscrm-dev.oss-cn-shenzhen.aliyuncs.com/test/t_order_entry/annex_paths/2023-11-02/6042cfcb-323e-4d35-8ca7-2cc0634f115a.jpg"
  378. },
  379. {
  380. "url": "https://hgscrm-dev.oss-cn-shenzhen.aliyuncs.com/test/t_order_entry/annex_paths/2023-11-02/a363d70b-ef4d-4fef-a69d-5f2d2b3c831d.png"
  381. },
  382. {
  383. "url": "https://hgscrm-dev.oss-cn-shenzhen.aliyuncs.com/test/t_order_entry/annex_paths/2023-11-02/e4e40703-68a3-414a-926f-dd52475955b6.jpg"
  384. }
  385. ],
  386. "supplierContactName": null,
  387. "supplierContactPhone": null,
  388. "supplierAddressFull": null,
  389. "outNo": null,
  390. "outId": null,
  391. "outTime": null,
  392. "receiverName": null,
  393. "receiverPhone": null,
  394. "receiverAddress": null,
  395. "editTime": null,
  396. "saveAscpId": null,
  397. "addressNo": null,
  398. "contractNo": null,
  399. "customerFrom": null,
  400. "toiletCount": null,
  401. "toiletCountName": null,
  402. "houseType": null,
  403. "houseTypeName": null,
  404. "fitupType": null,
  405. "fitupTypeName": null,
  406. "fitupStyle": null,
  407. "fitupStyleName": null,
  408. "ageComposition": null,
  409. "ageCompositionName": null,
  410. "decisionMaker": null,
  411. "decisionMakerName": null,
  412. "deliveryTypeName": null,
  413. "fromName": null,
  414. "sumRejectQuantity": -2,
  415. "sumRejectAmount": -5000,
  416. "docCode": null,
  417. "sale2OpeMode": null,
  418. "sentryId": null
  419. },
  420. {
  421. "entryId": 486,
  422. "customerId": null,
  423. "customerName": '王软',
  424. "customerPhone": '13900138000',
  425. "contactName": null,
  426. "contactPhones": null,
  427. "salesChannel": null,
  428. "orgId": 30883,
  429. "entryNo": "WE-0726-555-202310260K7I",
  430. "supplierId": null,
  431. "orderId": null,
  432. "orderNo": null,
  433. "entryStatus": 2,
  434. "sumEntryGoingQuantity": 1,
  435. "sumEntryGoingAmount": 0,
  436. "sumEntryQuantity": 0,
  437. "sumEntryAmount": 0,
  438. "remarks": null,
  439. "flgValid": true,
  440. "cpId": 20834,
  441. "opCreateTime": "2023-10-26 15:20:31",
  442. "opCreateUserId": 937,
  443. "opUpdateTime": "2023-10-26 15:20:31",
  444. "opUpdateUserId": 937,
  445. "sale1Id": 20834,
  446. "sale2Id": 29039,
  447. "ascpId": 29039,
  448. "entryKind": "入库类型-其他",
  449. "entryReason": 193,
  450. "sale1OutId": null,
  451. "staffId": 937,
  452. "rejectId": null,
  453. "rejectNo": null,
  454. "orgName": "辰溪县金海店",
  455. "entryReasonName": "库存盘盈",
  456. "responsibleName": null,
  457. "entryDate": "2023-10-26",
  458. "sale1OutDate": null,
  459. "entryWhId": null,
  460. "addressArea": null,
  461. "addressName": null,
  462. "addressGcj02": null,
  463. "addressFull": '沈阳市国际软件园F9-102',
  464. "sale2IvtType": null,
  465. "whName": null,
  466. "makingUser": 937,
  467. "salesChannelCode": null,
  468. "doneUser": 937,
  469. "doneTime": "2023-10-26 15:20:31",
  470. "orderEntryItemList": null,
  471. "entryStatusName": "入库中",
  472. "entryObjectName": null,
  473. "erpOutNo": null,
  474. "categoryQuantity": 1,
  475. "staffName": "张德亮",
  476. "sale1ErpOutDoneNo": null,
  477. "flgAllowTodone": null,
  478. "flgAllowReverse": null,
  479. "entryObjectId": null,
  480. "entryObjectType": null,
  481. "sale2Name": null,
  482. "procureOrderNo": null,
  483. "invoiceDate": null,
  484. "entryKindName": "退货回库",
  485. "supplierName": null,
  486. "statusName": null,
  487. "inOutStatus": null,
  488. "inOutDate": null,
  489. "sumQuantity": null,
  490. "sumAmount": null,
  491. "consignee": null,
  492. "consigneePhone": null,
  493. "takeOverAddress": null,
  494. "makingUserName": "张德亮",
  495. "doneUserName": null,
  496. "makingTime": "2023/10/26 15:20:31",
  497. "totalRemarks": null,
  498. "entryStatusString": null,
  499. "nonStandardCode": null,
  500. "annexPaths": [],
  501. "supplierContactName": null,
  502. "supplierContactPhone": null,
  503. "supplierAddressFull": null,
  504. "outNo": null,
  505. "outId": null,
  506. "outTime": null,
  507. "receiverName": null,
  508. "receiverPhone": null,
  509. "receiverAddress": null,
  510. "editTime": null,
  511. "saveAscpId": null,
  512. "addressNo": null,
  513. "contractNo": null,
  514. "customerFrom": null,
  515. "toiletCount": null,
  516. "toiletCountName": null,
  517. "houseType": null,
  518. "houseTypeName": null,
  519. "fitupType": null,
  520. "fitupTypeName": null,
  521. "fitupStyle": null,
  522. "fitupStyleName": null,
  523. "ageComposition": null,
  524. "ageCompositionName": null,
  525. "decisionMaker": null,
  526. "decisionMakerName": null,
  527. "deliveryTypeName": null,
  528. "fromName": null,
  529. "sumRejectQuantity": 0,
  530. "sumRejectAmount": 0,
  531. "docCode": null,
  532. "sale2OpeMode": null,
  533. "sentryId": null
  534. },
  535. {
  536. "entryId": 418,
  537. "customerId": null,
  538. "customerName": null,
  539. "customerPhone": null,
  540. "contactName": null,
  541. "contactPhones": null,
  542. "salesChannel": null,
  543. "orgId": 30883,
  544. "entryNo": "WE-0726-555-202310180JT6",
  545. "supplierId": null,
  546. "orderId": null,
  547. "orderNo": null,
  548. "entryStatus": 2,
  549. "sumEntryGoingQuantity": 1,
  550. "sumEntryGoingAmount": 0,
  551. "sumEntryQuantity": 0,
  552. "sumEntryAmount": 0,
  553. "remarks": null,
  554. "flgValid": true,
  555. "cpId": 20834,
  556. "opCreateTime": "2023-10-18 10:58:31",
  557. "opCreateUserId": 643,
  558. "opUpdateTime": "2023-10-18 10:58:31",
  559. "opUpdateUserId": 643,
  560. "sale1Id": 20834,
  561. "sale2Id": 29039,
  562. "ascpId": 29039,
  563. "entryKind": "入库类型-其他",
  564. "entryReason": 192,
  565. "sale1OutId": null,
  566. "staffId": 643,
  567. "rejectId": null,
  568. "rejectNo": null,
  569. "orgName": "辰溪县金海店",
  570. "entryReasonName": "其他采购",
  571. "responsibleName": null,
  572. "entryDate": "2023-10-18",
  573. "sale1OutDate": null,
  574. "entryWhId": null,
  575. "addressArea": null,
  576. "addressName": null,
  577. "addressGcj02": null,
  578. "addressFull": null,
  579. "sale2IvtType": null,
  580. "whName": null,
  581. "makingUser": 643,
  582. "salesChannelCode": null,
  583. "doneUser": 643,
  584. "doneTime": "2023-10-18 10:58:30",
  585. "orderEntryItemList": null,
  586. "entryStatusName": "入库中",
  587. "entryObjectName": null,
  588. "erpOutNo": null,
  589. "categoryQuantity": 1,
  590. "staffName": "王英杰",
  591. "sale1ErpOutDoneNo": null,
  592. "flgAllowTodone": null,
  593. "flgAllowReverse": null,
  594. "entryObjectId": null,
  595. "entryObjectType": null,
  596. "sale2Name": null,
  597. "procureOrderNo": null,
  598. "invoiceDate": null,
  599. "entryKindName": "其他入库",
  600. "supplierName": null,
  601. "statusName": null,
  602. "inOutStatus": null,
  603. "inOutDate": null,
  604. "sumQuantity": null,
  605. "sumAmount": null,
  606. "consignee": null,
  607. "consigneePhone": null,
  608. "takeOverAddress": null,
  609. "makingUserName": "王英杰",
  610. "doneUserName": null,
  611. "makingTime": "2023/10/18 10:58:30",
  612. "totalRemarks": null,
  613. "entryStatusString": null,
  614. "nonStandardCode": null,
  615. "annexPaths": [],
  616. "supplierContactName": null,
  617. "supplierContactPhone": null,
  618. "supplierAddressFull": null,
  619. "outNo": null,
  620. "outId": null,
  621. "outTime": null,
  622. "receiverName": null,
  623. "receiverPhone": null,
  624. "receiverAddress": null,
  625. "editTime": null,
  626. "saveAscpId": null,
  627. "addressNo": null,
  628. "contractNo": null,
  629. "customerFrom": null,
  630. "toiletCount": null,
  631. "toiletCountName": null,
  632. "houseType": null,
  633. "houseTypeName": null,
  634. "fitupType": null,
  635. "fitupTypeName": null,
  636. "fitupStyle": null,
  637. "fitupStyleName": null,
  638. "ageComposition": null,
  639. "ageCompositionName": null,
  640. "decisionMaker": null,
  641. "decisionMakerName": null,
  642. "deliveryTypeName": null,
  643. "fromName": null,
  644. "sumRejectQuantity": 0,
  645. "sumRejectAmount": 0,
  646. "docCode": null,
  647. "sale2OpeMode": null,
  648. "sentryId": null
  649. },
  650. {
  651. "entryId": 416,
  652. "customerId": null,
  653. "customerName": null,
  654. "customerPhone": null,
  655. "contactName": null,
  656. "contactPhones": null,
  657. "salesChannel": null,
  658. "orgId": 30883,
  659. "entryNo": "WE-0726-555-202310170JSR",
  660. "supplierId": null,
  661. "orderId": null,
  662. "orderNo": null,
  663. "entryStatus": 2,
  664. "sumEntryGoingQuantity": 1,
  665. "sumEntryGoingAmount": 0,
  666. "sumEntryQuantity": 0,
  667. "sumEntryAmount": 0,
  668. "remarks": null,
  669. "flgValid": true,
  670. "cpId": 20834,
  671. "opCreateTime": "2023-10-17 17:21:13",
  672. "opCreateUserId": 643,
  673. "opUpdateTime": "2023-10-17 17:21:13",
  674. "opUpdateUserId": 643,
  675. "sale1Id": 20834,
  676. "sale2Id": 29039,
  677. "ascpId": 29039,
  678. "entryKind": "入库类型-其他",
  679. "entryReason": 193,
  680. "sale1OutId": null,
  681. "staffId": 643,
  682. "rejectId": null,
  683. "rejectNo": null,
  684. "orgName": "辰溪县金海店",
  685. "entryReasonName": "库存盘盈",
  686. "responsibleName": null,
  687. "entryDate": "2023-10-17",
  688. "sale1OutDate": null,
  689. "entryWhId": null,
  690. "addressArea": null,
  691. "addressName": null,
  692. "addressGcj02": null,
  693. "addressFull": null,
  694. "sale2IvtType": null,
  695. "whName": null,
  696. "makingUser": 643,
  697. "salesChannelCode": null,
  698. "doneUser": 643,
  699. "doneTime": "2023-10-17 17:21:12",
  700. "orderEntryItemList": null,
  701. "entryStatusName": "入库中",
  702. "entryObjectName": null,
  703. "erpOutNo": null,
  704. "categoryQuantity": 1,
  705. "staffName": "王英杰",
  706. "sale1ErpOutDoneNo": null,
  707. "flgAllowTodone": null,
  708. "flgAllowReverse": null,
  709. "entryObjectId": null,
  710. "entryObjectType": null,
  711. "sale2Name": null,
  712. "procureOrderNo": null,
  713. "invoiceDate": null,
  714. "entryKindName": "其他入库",
  715. "supplierName": null,
  716. "statusName": null,
  717. "inOutStatus": null,
  718. "inOutDate": null,
  719. "sumQuantity": null,
  720. "sumAmount": null,
  721. "consignee": null,
  722. "consigneePhone": null,
  723. "takeOverAddress": null,
  724. "makingUserName": "王英杰",
  725. "doneUserName": null,
  726. "makingTime": "2023/10/17 17:21:12",
  727. "totalRemarks": null,
  728. "entryStatusString": null,
  729. "nonStandardCode": null,
  730. "annexPaths": [],
  731. "supplierContactName": null,
  732. "supplierContactPhone": null,
  733. "supplierAddressFull": null,
  734. "outNo": null,
  735. "outId": null,
  736. "outTime": null,
  737. "receiverName": null,
  738. "receiverPhone": null,
  739. "receiverAddress": null,
  740. "editTime": null,
  741. "saveAscpId": null,
  742. "addressNo": null,
  743. "contractNo": null,
  744. "customerFrom": null,
  745. "toiletCount": null,
  746. "toiletCountName": null,
  747. "houseType": null,
  748. "houseTypeName": null,
  749. "fitupType": null,
  750. "fitupTypeName": null,
  751. "fitupStyle": null,
  752. "fitupStyleName": null,
  753. "ageComposition": null,
  754. "ageCompositionName": null,
  755. "decisionMaker": null,
  756. "decisionMakerName": null,
  757. "deliveryTypeName": null,
  758. "fromName": null,
  759. "sumRejectQuantity": 0,
  760. "sumRejectAmount": 0,
  761. "docCode": null,
  762. "sale2OpeMode": null,
  763. "sentryId": null
  764. },
  765. ]
  766. this.setData({
  767. totallength: 10, //合计
  768. selectTotallength: 10, //数量
  769. list: tList
  770. })
  771. this.setData({
  772. selectlength: this.data.list.length, //单数
  773. })
  774. // api.request(Constants.OTHER_IN + 'list_by', 'POST', param).then(res => {
  775. // this.setData({
  776. // loading: false
  777. // })
  778. // if (res.data.code === 200) {
  779. // let tList = this.data.list;
  780. // let list = res.data.data.list; //后台返回数据
  781. // if (!list || list.length == 0) {
  782. // // 如果不是翻页,需要清空
  783. // if (e != 'more') {
  784. // this.setData({
  785. // list: [],
  786. // noMore: false
  787. // })
  788. // } else {
  789. // this.setData({
  790. // noMore: true
  791. // })
  792. // }
  793. // return
  794. // }
  795. // if (list.length < this.data.pageInfo.pageSize) {
  796. // this.setData({
  797. // noMore: false
  798. // })
  799. // }
  800. // tList = tList.concat(list)
  801. // let sumAmountTotal = 0
  802. // let sumQuantityTotal = 0
  803. // tList.forEach(res => {
  804. // let num1 = util.numAdd(Number(res.sumEntryAmount), Number(sumAmountTotal))
  805. // let num2 = util.numAdd(Number(res.sumEntryGoingQuantity), Number(sumQuantityTotal))
  806. // sumAmountTotal = num1
  807. // sumQuantityTotal = num2
  808. // })
  809. // if (tList.length > 0) {
  810. // tList.forEach(item => {
  811. // if (item.addressFull == 'undefined') {
  812. // item.addressFull = null
  813. // }
  814. // if (item.makingTime) {
  815. // item.makingTime = (item.makingTime).replace(/\-/g, "/")
  816. // }
  817. // });
  818. // }
  819. // this.setData({
  820. // totallength: sumQuantityTotal, //合计
  821. // selectTotallength: sumQuantityTotal, //数量
  822. // list: tList
  823. // })
  824. // this.setData({
  825. // selectlength: this.data.list.length, //单数
  826. // })
  827. // }
  828. // })
  829. },
  830. changField(e) {
  831. let searchForm = this.data.searchForm
  832. searchForm[e.currentTarget.dataset.key] = e.detail
  833. this.setData({
  834. searchForm: searchForm
  835. })
  836. },
  837. /**
  838. * @desc : 日期组件后的回调
  839. * @author : wyj
  840. * @date : 2023年8月17日
  841. */
  842. dateCommit(e) {
  843. let dateType = e.detail.dateType
  844. if (dateType === 'createtime') {
  845. let data = e.detail.date
  846. this.setData({
  847. createTimeSearch: data,
  848. createTimeType: e.detail.dateDefault
  849. })
  850. this.selectComponent('#create-time-type').toggle();
  851. }
  852. this.doSearch()
  853. },
  854. /**
  855. * @desc : 筛选抽屉打开
  856. * @author : 王英杰
  857. * @date : 2023年8月17日
  858. */
  859. openSearchPop() {
  860. this.setData({
  861. show: true
  862. })
  863. },
  864. /**
  865. * @desc : 抽屉离焦关闭
  866. * @author : 王英杰
  867. * @date : 2023年8月17日
  868. */
  869. onClose() {
  870. this.setData({
  871. show: false
  872. })
  873. this.selectComponent("#pick").toggle(false) //取消选中样式
  874. },
  875. /**
  876. * @desc : 抽屉确定
  877. * @author : 王英杰
  878. * @date : 2023年8月17日
  879. */
  880. doSearchData(e) {
  881. this.selectComponent("#pick").toggle(false) //取消选中样式
  882. this.setData({
  883. show: false,
  884. searchFormNumber: e.detail.searchFormNumber
  885. })
  886. // 查询数据
  887. this.doSearch()
  888. },
  889. /**
  890. * @desc : 筛选抽屉关闭
  891. * @author : 于继渤
  892. * @date : 2022/5/27 12:16
  893. */
  894. closeSearchPop() {
  895. this.selectComponent("#pick").toggle(false) //取消选中样式
  896. this.setData({
  897. show: false
  898. })
  899. },
  900. /**
  901. * @desc : 筛选重置事件
  902. * @author : 王英杰
  903. * @date : 2023年8月17日
  904. */
  905. clearSearchForm() {
  906. let searchForm = {
  907. checked: false,
  908. entryKinds: [],
  909. entryReasons: [],
  910. customerName: '',
  911. customerPhone: '',
  912. addressFullReturn: '',
  913. supplierName: '',
  914. warehousingTime: '',
  915. warehousingTimeList: [],
  916. deliveryTime: '',
  917. deliveryTimeList: [],
  918. }
  919. this.selectComponent("#receiptType").clearForm()
  920. this.selectComponent("#receiptReason").clearForm()
  921. this.setData({
  922. searchForm: searchForm
  923. })
  924. },
  925. /**
  926. * @desc : 筛选数据源组件点击事件
  927. * @author : 于继渤
  928. * @date : 2022/5/31 08:59
  929. */
  930. onClickTag(e) {
  931. console.log("onClickTag", e)
  932. let key = e.detail.key
  933. let dataList = e.detail.dataList
  934. let searchForm = this.data.searchForm
  935. if (key === 'receiptType') { //入库类型
  936. searchForm.entryKinds = dataList
  937. }
  938. if (key === 'receiptReason') { //入库原因
  939. searchForm.entryReasons = dataList
  940. }
  941. this.setData({
  942. searchForm
  943. })
  944. },
  945. /**
  946. * @desc : 筛选时间打开事件
  947. * @author :王英杰
  948. * @date : 2023年8月21日
  949. */
  950. onClickTime(e) {
  951. let key = e.currentTarget.dataset.key
  952. if (key === 'deliveryTime') {
  953. this.setData({
  954. deliveryTimeDefaultSearch: new Date().getTime() + 100,
  955. deliveryFlag: true
  956. })
  957. }
  958. //入库日期
  959. if (key === 'warehousingTime') {
  960. this.setData({
  961. warehousingTimeDefaultSearch: new Date().getTime() + 100,
  962. warehousingFlag: true
  963. })
  964. }
  965. },
  966. /**
  967. * 时间
  968. * @param {} e
  969. */
  970. onConfirmChooseDate(e) {
  971. let searchForm = this.data.searchForm
  972. let deliveryTime = searchForm.deliveryTime
  973. deliveryTime = e.detail.date[0] + '-' + e.detail.date[1]
  974. searchForm.deliveryTime = deliveryTime
  975. searchForm.deliveryTimeList = e.detail.date;
  976. this.setData({
  977. searchForm: searchForm,
  978. })
  979. },
  980. /**
  981. * 时间
  982. * @param {} e
  983. */
  984. onConfirmChooseWarehousingDate(e) {
  985. let searchForm = this.data.searchForm
  986. let warehousingTime = searchForm.warehousingTime
  987. warehousingTime = e.detail.date[0] + '-' + e.detail.date[1]
  988. searchForm.warehousingTime = warehousingTime
  989. searchForm.warehousingTimeList = e.detail.date;
  990. this.setData({
  991. searchForm: searchForm,
  992. })
  993. },
  994. onChangeTabs(e) {
  995. let title = e.detail.title
  996. console.log("qeaqwewa", e)
  997. this.setData({
  998. active: e.detail.name
  999. })
  1000. this.doSearch()
  1001. },
  1002. /** 跳转其他入库 */
  1003. submit() {
  1004. wx.navigateTo({
  1005. url: 'choose-sku-product/choose-sku-product?sourcePage=' + 'warehousingProcessing' + '&title=其他出库',
  1006. })
  1007. // wx.navigateTo({
  1008. // url: './detail/detail?item=' + encodeURIComponent(JSON.stringify(e.currentTarget.dataset.item)),
  1009. // })
  1010. },
  1011. //冲正重开
  1012. toReverse(e) {
  1013. if (this.data.loading) {
  1014. return
  1015. }
  1016. let item = e.currentTarget.dataset.item
  1017. if (item.entryKindName == "其他入库") {
  1018. this.otherOutboundReversal(item)
  1019. }
  1020. },
  1021. //其他出库冲正
  1022. otherOutboundReversal(item) {
  1023. let param = {
  1024. sale1Id: app.globalData.user.sale1Id,
  1025. sale2Id: app.globalData.user.sale2Id,
  1026. cpId: app.globalData.user.cpId,
  1027. ascpId: app.globalData.user.ascpId,
  1028. entryId: item.entryId
  1029. }
  1030. this.setData({
  1031. loading: true
  1032. })
  1033. api.request(Constants.OTHER_IN + 'order_entry_other_reverse', 'POST', param).then(res => {
  1034. this.setData({
  1035. loading: false
  1036. })
  1037. if (res.data.code === 200) {
  1038. this.doSearch()
  1039. this.setData({
  1040. showShare: false
  1041. })
  1042. }
  1043. })
  1044. },
  1045. })