@things-factory/operato-wms 4.3.239 → 4.3.241

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/client/pages/components/vas-templates/vas-pallet-add-popup.js +1 -0
  2. package/client/pages/components/vas-templates/vas-relabel.js +1 -0
  3. package/client/pages/components/vas-templates/vas-repack-relabel.js +1 -0
  4. package/client/pages/components/vas-templates/vas-repack.js +1 -0
  5. package/client/pages/components/vas-templates/vas-repalletizing.js +1 -0
  6. package/client/pages/components/vas-templates/vas-template.js +1 -0
  7. package/client/pages/components/vas-templates/vas-unpack.js +1 -0
  8. package/client/pages/constants/vas-target-type.js +1 -0
  9. package/client/pages/constants/worksheet.js +4 -0
  10. package/client/pages/inbound/adjust-pallet-qty.js +1 -1
  11. package/client/pages/inbound/inbound-worksheet.js +1 -0
  12. package/client/pages/inbound/palletizing-pallets-popup.js +1 -1
  13. package/client/pages/inbound/unload-product.js +1 -0
  14. package/client/pages/inbound/vas-selector.js +1 -0
  15. package/client/pages/inbound/worksheet-putaway.js +1 -0
  16. package/client/pages/inbound/worksheet-unloading.js +1 -0
  17. package/client/pages/order/arrival-notice/arrival-notice-detail.js +1 -0
  18. package/client/pages/order/arrival-notice/assign-buffer-location.js +1 -0
  19. package/client/pages/order/arrival-notice/check-arrived-notice.js +1 -0
  20. package/client/pages/order/arrival-notice/create-arrival-notice.js +1 -0
  21. package/client/pages/order/arrival-notice/duplicate-arrival-notice.js +1 -0
  22. package/client/pages/order/arrival-notice/receive-arrival-notice.js +1 -0
  23. package/client/pages/order/arrival-notice/rejected-arrival-notice.js +1 -0
  24. package/client/pages/order/release-order/create-release-order.js +713 -84
  25. package/client/pages/order/release-order/receive-release-order-request.js +1 -0
  26. package/client/pages/order/release-order/rejected-release-order.js +1 -0
  27. package/client/pages/order/release-order/release-order-detail.js +1020 -388
  28. package/client/pages/order/return-order/check-return-order.js +1 -0
  29. package/client/pages/order/return-order/rejected-return-order.js +2 -0
  30. package/client/pages/order/return-order/return-order-assign-buffer-location.js +1 -0
  31. package/client/pages/order/return-order/return-order-detail.js +1 -0
  32. package/client/pages/order/reverse-kitting-order/reverse-kitting-pallet-label-popup.js +1 -0
  33. package/client/pages/order/transfer-order/rejected-transfer-order.js +1 -0
  34. package/client/pages/order/vas-order/create-vas-order.js +1 -0
  35. package/client/pages/order/vas-order/popup/abastract-vas-create-form.js +1 -0
  36. package/client/pages/order/vas-order/popup/select-vas-popup.js +220 -0
  37. package/client/pages/order/vas-order/popup/vas-create-batch-product-type-form.js +1 -0
  38. package/client/pages/order/vas-order/popup/vas-create-batch-type-form.js +1 -0
  39. package/client/pages/order/vas-order/popup/vas-create-etc-type-form.js +1 -0
  40. package/client/pages/order/vas-order/popup/vas-create-popup.js +1 -0
  41. package/client/pages/order/vas-order/popup/vas-create-product-type-form.js +1 -0
  42. package/client/pages/order/vas-order/popup/vas-target-product-popup.js +644 -0
  43. package/client/pages/order/vas-order/receive-vas-order.js +1 -0
  44. package/client/pages/order/vas-order/vas-order-detail.js +1 -0
  45. package/client/pages/order/vas-order/vas-order-list.js +1 -0
  46. package/client/pages/order/vas-order/vas-order-requests.js +1 -0
  47. package/client/pages/outbound/loading-product.js +109 -14
  48. package/client/pages/outbound/picking-product.js +59 -1
  49. package/client/pages/outbound/vas-list-popup.js +367 -0
  50. package/client/pages/outbound/worksheet-loading.js +13 -8
  51. package/client/pages/outbound/worksheet-picking.js +4 -0
  52. package/client/pages/report/vas-report.js +534 -0
  53. package/client/pages/vas/abstract-execute-vas.js +2 -1
  54. package/client/pages/vas/execute-pure-vas.js +1 -0
  55. package/client/pages/vas/execute-ref-vas.js +1 -0
  56. package/client/pages/vas/execute-vas.js +2 -2
  57. package/client/pages/vas/related-vas-list.js +1 -0
  58. package/client/pages/vas/vas-execution-page.js +469 -0
  59. package/client/pages/vas/vas-pallet-label-popup.js +1 -0
  60. package/client/pages/vas/vas-worksheet-list.js +1 -0
  61. package/client/pages/vas/worksheet-ref-vas.js +97 -36
  62. package/client/pages/vas/worksheet-vas.js +1 -0
  63. package/client/route.js +9 -0
  64. package/config.development.js +67 -86
  65. package/dist-server/graphql/resolvers/reports/index.js +2 -1
  66. package/dist-server/graphql/resolvers/reports/index.js.map +1 -1
  67. package/dist-server/graphql/resolvers/reports/vas-report.js +118 -0
  68. package/dist-server/graphql/resolvers/reports/vas-report.js.map +1 -0
  69. package/dist-server/graphql/types/reports/index.js +6 -1
  70. package/dist-server/graphql/types/reports/index.js.map +1 -1
  71. package/dist-server/graphql/types/reports/vas-report-list.js +14 -0
  72. package/dist-server/graphql/types/reports/vas-report-list.js.map +1 -0
  73. package/dist-server/graphql/types/reports/vas-report.js +18 -0
  74. package/dist-server/graphql/types/reports/vas-report.js.map +1 -0
  75. package/package.json +5 -5
  76. package/server/graphql/resolvers/reports/index.ts +3 -1
  77. package/server/graphql/resolvers/reports/vas-report.ts +135 -0
  78. package/server/graphql/types/reports/index.ts +7 -1
  79. package/server/graphql/types/reports/vas-report-list.ts +8 -0
  80. package/server/graphql/types/reports/vas-report.ts +12 -0
  81. package/things-factory.config.js +11 -0
  82. package/translations/en.json +30 -5
  83. package/translations/ko.json +26 -1
  84. package/translations/ms.json +26 -1
  85. package/translations/zh.json +26 -1
@@ -31,6 +31,7 @@ class LoadingProduct extends connect(store)(localize(i18next)(PageView)) {
31
31
  loadedProductData: Object,
32
32
  _selectedTaskStatus: String,
33
33
  transportVehicles: Array,
34
+ _hasVas: Boolean,
34
35
  _requireDeliveryInformation: Boolean
35
36
  }
36
37
  }
@@ -283,6 +284,7 @@ class LoadingProduct extends connect(store)(localize(i18next)(PageView)) {
283
284
  this._releaseGoodNo = ''
284
285
  this._ownCollection = true
285
286
  this._selectedTaskStatus = null
287
+ this._hasVas = false
286
288
  }
287
289
 
288
290
  updated(changedProps) {
@@ -310,6 +312,7 @@ class LoadingProduct extends connect(store)(localize(i18next)(PageView)) {
310
312
  }
311
313
 
312
314
  async pageInitialized() {
315
+ this._hasVas
313
316
  let enableToteScanning = await fetchSettingRule('enable-tote-scanning')
314
317
  this._requireDeliveryInformation = await fetchSettingRule('enable-loading-delivery-information')
315
318
  let configColumns = [
@@ -338,7 +341,7 @@ class LoadingProduct extends connect(store)(localize(i18next)(PageView)) {
338
341
  })
339
342
 
340
343
  fields = [
341
- 'toteName',
344
+ 'hasVas',
342
345
  'palletId',
343
346
  'productSku',
344
347
  'product',
@@ -347,10 +350,20 @@ class LoadingProduct extends connect(store)(localize(i18next)(PageView)) {
347
350
  'batchId',
348
351
  'batchIdRef',
349
352
  'releaseQty',
353
+ 'pickedQty',
350
354
  'loadedQty'
351
355
  ]
352
356
  }
353
357
 
358
+ if (this._hasVas) {
359
+ configColumns.push({
360
+ type: 'checkbox',
361
+ name: 'hasVas',
362
+ header: i18next.t('label.vas'),
363
+ width: 40
364
+ })
365
+ }
366
+
354
367
  configColumns.push(
355
368
  {
356
369
  type: 'string',
@@ -405,10 +418,21 @@ class LoadingProduct extends connect(store)(localize(i18next)(PageView)) {
405
418
  name: 'uom',
406
419
  header: i18next.t('field.uom'),
407
420
  width: 80
408
- },
409
- {
421
+ }
422
+ )
423
+
424
+ if (this._hasVas) {
425
+ configColumns.push({
410
426
  type: 'integer',
411
427
  name: 'releaseQty',
428
+ header: i18next.t('field.release_qty'),
429
+ width: 100
430
+ })
431
+ }
432
+ configColumns.push(
433
+ {
434
+ type: 'integer',
435
+ name: 'pickedQty',
412
436
  header: i18next.t('field.picked_qty'),
413
437
  width: 100
414
438
  },
@@ -440,7 +464,19 @@ class LoadingProduct extends connect(store)(localize(i18next)(PageView)) {
440
464
  },
441
465
  pagination: { infinite: true },
442
466
  list: {
443
- fields: fields
467
+ fields: [
468
+ 'hasVas',
469
+ 'palletId',
470
+ 'productSku',
471
+ 'product',
472
+ 'packingType',
473
+ 'packingSize',
474
+ 'batchId',
475
+ 'batchIdRef',
476
+ 'releaseQty',
477
+ 'pickedQty',
478
+ 'loadedQty'
479
+ ]
444
480
  },
445
481
  columns: configColumns
446
482
  }
@@ -512,7 +548,7 @@ class LoadingProduct extends connect(store)(localize(i18next)(PageView)) {
512
548
  },
513
549
  {
514
550
  type: 'number',
515
- name: 'releaseQty',
551
+ name: 'pickedQty',
516
552
  header: i18next.t('field.qty'),
517
553
  width: 80
518
554
  },
@@ -566,13 +602,36 @@ class LoadingProduct extends connect(store)(localize(i18next)(PageView)) {
566
602
  packingSize
567
603
  status
568
604
  product {
605
+ id
569
606
  sku
570
607
  name
571
608
  description
572
609
  }
573
610
  qty
611
+ pickedQty
574
612
  releaseQty
575
613
  releaseUomValue
614
+ targetVas {
615
+ qty
616
+ outputQty
617
+ product {
618
+ id
619
+ }
620
+ newProduct {
621
+ id
622
+ sku
623
+ description
624
+ packingType
625
+ name
626
+ uom
627
+ }
628
+ newProductDetail {
629
+ id
630
+ name
631
+ description
632
+ packingSize
633
+ }
634
+ }
576
635
  inventory {
577
636
  uom
578
637
  }
@@ -587,16 +646,31 @@ class LoadingProduct extends connect(store)(localize(i18next)(PageView)) {
587
646
  this._releaseGoodNo = response.data.loadingWorksheet.worksheetInfo.releaseGood.name
588
647
  this._fillUpForm(this.infoForm, response.data.loadingWorksheet.worksheetInfo)
589
648
  this._ownCollection = response.data.loadingWorksheet.worksheetInfo.ownCollection
649
+ // const hasVas = response.data.loadingWorksheet.worksheetDetailInfos.filter(wd => {
650
+ // return wd.targetVas ? wd.targetVas : undefined
651
+ // })
652
+ // debugger
653
+
590
654
  this.pickedProductData = {
591
655
  records: response.data.loadingWorksheet.worksheetDetailInfos.map(record => {
592
656
  return {
593
657
  ...record,
658
+ // product: record.product,
594
659
  productSku: record.product.sku,
595
660
  loadedQty: record.releaseQty,
661
+ hasVas: record.targetVas || (record.releaseQty && record.pickedQty == 0) ? true : false,
596
662
  ...record.inventory
597
663
  }
598
664
  })
599
665
  }
666
+
667
+ this._hasVas = this.pickedProductData.records.find(data => data.hasVas == true) ? true : false
668
+
669
+ this.pickedProductData = { records: this.sortByNameField(this.pickedProductData) }
670
+
671
+ // causes grist unable to display data
672
+ // this.pageInitialized()
673
+ // causes grist unable to display data
600
674
  } else {
601
675
  throw new Error(response.errors[0])
602
676
  }
@@ -651,7 +725,11 @@ class LoadingProduct extends connect(store)(localize(i18next)(PageView)) {
651
725
  loadedWorksheetDetails = loadedWorksheetDetails.concat(toteRecords)
652
726
  } else {
653
727
  loadedWorksheetDetails = this.pickedProductGrist.selected.map(record => {
654
- return { name: record.name, loadedQty: record.loadedQty, toteName: record.toteName }
728
+ return {
729
+ name: record.name,
730
+ loadedQty: record.loadedQty,
731
+ toteName: record.toteName
732
+ }
655
733
  })
656
734
  }
657
735
 
@@ -706,13 +784,14 @@ class LoadingProduct extends connect(store)(localize(i18next)(PageView)) {
706
784
 
707
785
  const response = await client.mutate({
708
786
  mutation: gql`
709
- mutation undoLoading($deliveryOrder: ObjectRef!, $palletIds: [String]!) {
710
- undoLoading(deliveryOrder: $deliveryOrder, palletIds: $palletIds)
787
+ mutation undoLoading($deliveryOrder: ObjectRef!, $palletIds: [String]!, $productIds: [String]!) {
788
+ undoLoading(deliveryOrder: $deliveryOrder, palletIds: $palletIds, productIds: $productIds)
711
789
  }
712
790
  `,
713
791
  variables: {
714
792
  deliveryOrder: { id: this._selectedDeliveryOrder.id },
715
- palletIds: this.loadedProductData.records.map(item => item.palletId)
793
+ palletIds: this.loadedProductData.records.map(item => item.palletId),
794
+ productIds: this.loadedProductData.records.map(item => item.product.id)
716
795
  }
717
796
  })
718
797
 
@@ -804,16 +883,18 @@ class LoadingProduct extends connect(store)(localize(i18next)(PageView)) {
804
883
  orderInventories(filters: $filters) {
805
884
  items {
806
885
  releaseQty
886
+ type
887
+ pickedQty
807
888
  releaseUomValue
889
+ product {
890
+ name
891
+ description
892
+ }
808
893
  inventory {
809
894
  palletId
810
895
  batchId
811
896
  batchIdRef
812
897
  uom
813
- product {
814
- name
815
- description
816
- }
817
898
  }
818
899
  }
819
900
  }
@@ -835,7 +916,15 @@ class LoadingProduct extends connect(store)(localize(i18next)(PageView)) {
835
916
  records: response.data.orderInventories.items.map(orderInventory => {
836
917
  return {
837
918
  ...orderInventory.inventory,
838
- ...orderInventory
919
+ ...orderInventory,
920
+ pickedQty:
921
+ orderInventory.type === 'VAS_ORDER' || orderInventory.releaseQty != orderInventory.pickedQty
922
+ ? orderInventory.releaseQty
923
+ : orderInventory.pickedQty,
924
+ product: {
925
+ name: orderInventory.product.name,
926
+ description: orderInventory.product.inventory
927
+ }
839
928
  }
840
929
  })
841
930
  }
@@ -973,6 +1062,12 @@ class LoadingProduct extends connect(store)(localize(i18next)(PageView)) {
973
1062
  this.updateContext()
974
1063
  }
975
1064
 
1065
+ sortByNameField(items) {
1066
+ const nameField = 'batchId'
1067
+
1068
+ return items?.records?.sort((a, b) => (a[nameField] > b[nameField] ? 1 : a[nameField] < b[nameField] ? -1 : 0))
1069
+ }
1070
+
976
1071
  _showToast({ type, message }) {
977
1072
  document.dispatchEvent(
978
1073
  new CustomEvent('notify', {
@@ -6,6 +6,7 @@ import './show-my-worksheet-list-popup'
6
6
  import '../components/worksheet-information-popup'
7
7
  import './serial-number-popup'
8
8
  import './tote-popup'
9
+ import './vas-list-popup'
9
10
 
10
11
  import gql from 'graphql-tag'
11
12
  import { css, html } from 'lit-element'
@@ -66,7 +67,8 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
66
67
  worksheetNo: String,
67
68
  toteNo: String,
68
69
  _pageSettings: Object,
69
- _isReplenishment: Boolean
70
+ _isReplenishment: Boolean,
71
+ _hasVas: Boolean
70
72
  }
71
73
  }
72
74
 
@@ -128,6 +130,14 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
128
130
  ...CommonButtonStyles.inspect
129
131
  })
130
132
 
133
+ if (this._hasVas) {
134
+ actions.push({
135
+ title: i18next.t('button.vas_list'),
136
+ action: this.openVasListPopup.bind(this),
137
+ ...CommonButtonStyles.reorder
138
+ })
139
+ }
140
+
131
141
  if (this._selectedOrderInventory && this._isRequireSerialNumberScanningOutbound) {
132
142
  actions.push({
133
143
  title: i18next.t('button.serial_number'),
@@ -311,6 +321,7 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
311
321
  this.scannable = false
312
322
  this._isLastUnit = false
313
323
  this._isReplenishment = false
324
+ this._hasVas = false
314
325
  }
315
326
 
316
327
  render() {
@@ -1819,6 +1830,52 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1819
1830
  }
1820
1831
  }
1821
1832
 
1833
+ async fetchOrderVas(orderId) {
1834
+ if (!orderId) return
1835
+
1836
+ let filters = [{ name: 'releaseGood', operator: 'eq', value: orderId }]
1837
+
1838
+ const response = await client.query({
1839
+ query: gql`
1840
+ query orderVass($filters: [Filter!]) {
1841
+ orderVass(filters: $filters) {
1842
+ items {
1843
+ id
1844
+ }
1845
+ total
1846
+ }
1847
+ }
1848
+ `,
1849
+ variables: { filters }
1850
+ })
1851
+
1852
+ if (!response.errors) {
1853
+ const total = response.data.orderVass.total
1854
+ if (total > 0) {
1855
+ this._hasVas = true
1856
+ } else {
1857
+ this._hasVas = false
1858
+ }
1859
+ } else {
1860
+ this._hasVas = false
1861
+ }
1862
+ this.updateContext()
1863
+ }
1864
+
1865
+ async openVasListPopup() {
1866
+ await sleep(1010)
1867
+ openPopup(
1868
+ html` <vas-list-popup .orderId="${this.pickingOrderId}" .orderType="${'RELEASE_GOODS'}"></vas-list-popup> `,
1869
+ {
1870
+ closable: false,
1871
+ backdrop: false,
1872
+ escapable: false,
1873
+ size: 'large',
1874
+ title: i18next.t('title.vas')
1875
+ }
1876
+ )
1877
+ }
1878
+
1822
1879
  async completeHandler() {
1823
1880
  if (!this.data?.records?.length || this.data.records.some(record => !record.completed)) return
1824
1881
 
@@ -2071,6 +2128,7 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
2071
2128
  async fetchAll(orderNo) {
2072
2129
  await this.fetchInventories(orderNo)
2073
2130
  await this.fetchPalletsHandler(orderNo)
2131
+ await this.fetchOrderVas(this.pickingOrderId)
2074
2132
  let [enableProductScanning, enableToteScanning, enableInputQty] = await Promise.all([
2075
2133
  fetchSettingRule('enable-product-scanning', this._worksheetInfo.partnerDomainId),
2076
2134
  fetchSettingRule('enable-tote-scanning', this._worksheetInfo.partnerDomainId),