@things-factory/operato-wms 5.0.0-alpha.26 → 5.0.0-alpha.27

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 (92) hide show
  1. package/.eslintrc.json +11 -0
  2. package/client/pages/constants/index.js +1 -0
  3. package/client/pages/constants/inventory-item-change.js +10 -0
  4. package/client/pages/constants/order.js +5 -0
  5. package/client/pages/constants/picking-strategy.js +4 -0
  6. package/client/pages/constants/setting.js +1 -0
  7. package/client/pages/inbound/serial-number-list-popup.js +0 -1
  8. package/client/pages/inventory/inventory-adjustment-approval.js +34 -3
  9. package/client/pages/inventory/inventory-adjustment.js +144 -5
  10. package/client/pages/inventory/non-loaded-inventory.js +83 -15
  11. package/client/pages/inventory/serial-number-list-popup.js +468 -0
  12. package/client/pages/master/pallet-list.js +24 -0
  13. package/client/pages/order/arrival-notice/edit-product-popup.js +13 -0
  14. package/client/pages/order/release-order/b2b/b2b-order-list.js +24 -1
  15. package/client/pages/order/release-order/b2c/b2c-order-requests.js +67 -13
  16. package/client/pages/order/release-order/batch-picking-popup.js +8 -0
  17. package/client/pages/outbound/inventory-assign-popup.js +3 -24
  18. package/client/pages/outbound/inventory-auto-assign-popup.js +25 -50
  19. package/client/pages/outbound/loading-product.js +3 -3
  20. package/client/pages/outbound/merged-outbound-worksheet.js +148 -3
  21. package/client/pages/outbound/packing-product.js +109 -9
  22. package/client/pages/outbound/picking-product.js +73 -22
  23. package/client/pages/outbound/picking-replacement-popup.js +5 -0
  24. package/client/pages/outbound/return-pallet-check-popup.js +7 -1
  25. package/client/pages/outbound/route-label-popup.js +464 -0
  26. package/client/pages/outbound/select-operator-popup.js +3 -3
  27. package/client/pages/outbound/serial-number-popup.js +55 -26
  28. package/client/pages/outbound/single-outbound-worksheet.js +154 -5
  29. package/client/pages/outbound/sorting-product.js +125 -34
  30. package/client/pages/outbound/worksheet-batch-picking.js +13 -17
  31. package/client/pages/outbound/worksheet-picking.js +4 -8
  32. package/config.development.js +73 -0
  33. package/config.production.js +113 -0
  34. package/cypress/fixtures/globals.json +3 -0
  35. package/cypress/fixtures/master-data/location.json +31 -0
  36. package/cypress/fixtures/master-data/pallet.json +129 -0
  37. package/cypress/fixtures/master-data/palletImport.xlsx +0 -0
  38. package/cypress/fixtures/master-data/transport-driver.json +22 -0
  39. package/cypress/fixtures/master-data/transport-vehicle.json +24 -0
  40. package/cypress/fixtures/master-data/transportDriverDeletedImport.xlsx +0 -0
  41. package/cypress/fixtures/master-data/transportDriverImport.xlsx +0 -0
  42. package/cypress/fixtures/master-data/transportVehicleDeletedImport.xlsx +0 -0
  43. package/cypress/fixtures/master-data/transportVehicleImport.xlsx +0 -0
  44. package/cypress/fixtures/master-data/transportVehicleNameSizeImport.xlsx +0 -0
  45. package/cypress/fixtures/master-data/transportVehicleNameStatusImport.xlsx +0 -0
  46. package/cypress/fixtures/master-data/warehouse.json +20 -0
  47. package/cypress/fixtures/master-data/warehouseImport.xlsx +0 -0
  48. package/cypress/integration/master-data/location.spec.js +31 -0
  49. package/cypress/integration/master-data/pallet.spec.js +176 -0
  50. package/cypress/integration/master-data/transport-driver.spec.js +131 -0
  51. package/cypress/integration/master-data/transport-vehicle.spec.js +165 -0
  52. package/cypress/integration/master-data/warehouse.spec.js +135 -0
  53. package/cypress/plugins/index.js +22 -0
  54. package/cypress/support/commands.js +425 -0
  55. package/cypress/support/index.js +31 -0
  56. package/cypress.json +9 -0
  57. package/dist-server/graphql/resolvers/board-setting/board-settings.js +2 -1
  58. package/dist-server/graphql/resolvers/board-setting/board-settings.js.map +1 -1
  59. package/dist-server/graphql/resolvers/dashboard/index.js +3 -1
  60. package/dist-server/graphql/resolvers/dashboard/index.js.map +1 -1
  61. package/dist-server/graphql/resolvers/dashboard/inventory-expiry-monitor.js +51 -0
  62. package/dist-server/graphql/resolvers/dashboard/inventory-expiry-monitor.js.map +1 -0
  63. package/dist-server/graphql/resolvers/dashboard/outbound-order-by-status.js +55 -0
  64. package/dist-server/graphql/resolvers/dashboard/outbound-order-by-status.js.map +1 -0
  65. package/dist-server/graphql/resolvers/extra/add-release-good-products.js +5 -1
  66. package/dist-server/graphql/resolvers/extra/add-release-good-products.js.map +1 -1
  67. package/dist-server/graphql/types/dashboard/index.js +5 -1
  68. package/dist-server/graphql/types/dashboard/index.js.map +1 -1
  69. package/dist-server/graphql/types/dashboard/inventory-expiry-counter.js +16 -0
  70. package/dist-server/graphql/types/dashboard/inventory-expiry-counter.js.map +1 -0
  71. package/dist-server/graphql/types/dashboard/inventory-expiry-status.js +14 -0
  72. package/dist-server/graphql/types/dashboard/inventory-expiry-status.js.map +1 -0
  73. package/dist-server/opa-app-setting-constants.js +2 -1
  74. package/dist-server/opa-app-setting-constants.js.map +1 -1
  75. package/helps/release-note.ko.md +35 -2
  76. package/helps/release-note.md +12 -43
  77. package/helps/release-note.ms.md +34 -1
  78. package/helps/release-note.zh.md +34 -1
  79. package/package.json +77 -67
  80. package/server/graphql/resolvers/board-setting/board-settings.ts +4 -2
  81. package/server/graphql/resolvers/dashboard/index.ts +5 -1
  82. package/server/graphql/resolvers/dashboard/inventory-expiry-monitor.ts +49 -0
  83. package/server/graphql/resolvers/dashboard/outbound-order-by-status.ts +62 -0
  84. package/server/graphql/resolvers/extra/add-release-good-products.ts +7 -2
  85. package/server/graphql/types/dashboard/index.ts +5 -1
  86. package/server/graphql/types/dashboard/inventory-expiry-counter.ts +10 -0
  87. package/server/graphql/types/dashboard/inventory-expiry-status.ts +8 -0
  88. package/server/opa-app-setting-constants.ts +2 -1
  89. package/translations/en.json +16 -4
  90. package/translations/ko.json +13 -2
  91. package/translations/ms.json +12 -2
  92. package/translations/zh.json +12 -2
package/.eslintrc.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "plugins": ["cypress"],
3
+ "rules": {
4
+ "cypress/no-assigning-return-values": "error",
5
+ "cypress/no-unnecessary-waiting": "error",
6
+ "cypress/assertion-before-screenshot": "warn",
7
+ "cypress/no-force": "warn",
8
+ "cypress/no-async-tests": "error",
9
+ "cypress/no-pause": "error"
10
+ }
11
+ }
@@ -1,6 +1,7 @@
1
1
  export * from './cargo'
2
2
  export * from './claim'
3
3
  export * from './inventory'
4
+ export * from './inventory-item-change'
4
5
  export * from './location'
5
6
  export * from './location-sorting-rule'
6
7
  export * from './marketplace'
@@ -0,0 +1,10 @@
1
+ export const INVENTORY_ITEM_CHANGE_TYPE = {
2
+ NEW: { name: 'new', value: 'NEW' },
3
+ MODIFIED: { name: 'modified', value: 'MODIFIED' },
4
+ REMOVED: { name: 'removed', value: 'REMOVED' }
5
+ }
6
+
7
+ export const INVENTORY_ITEM_CHANGE_TRANSACTION_TYPE = {
8
+ ORIGINAL: { name: 'original', value: 'ORIGINAL' },
9
+ CHANGES: { name: 'changes', value: 'CHANGES' }
10
+ }
@@ -24,6 +24,11 @@ export const ORDER_TYPES = {
24
24
  REVERSE_KITTING_ORDER
25
25
  }
26
26
 
27
+ export const ORDER_SOURCES = {
28
+ PICKING: { name: 'picking', value: 'picking' },
29
+ PACKING: { name: 'packing', value: 'packing' }
30
+ }
31
+
27
32
  export const RO_TYPES = {
28
33
  B2B: { name: 'B2B', value: 'b2b' },
29
34
  B2C: { name: 'B2C', value: 'b2c' }
@@ -9,6 +9,10 @@ export const PICKING_STRATEGY = [
9
9
  name: i18next.t('label.fefo'),
10
10
  value: 'FEFO'
11
11
  },
12
+ {
13
+ name: i18next.t('label.fmfo'),
14
+ value: 'FMFO'
15
+ },
12
16
  {
13
17
  name: i18next.t('label.lifo'),
14
18
  value: 'LIFO'
@@ -5,3 +5,4 @@ export const PALLET_LABEL_SETTING_KEY = 'pallet-label'
5
5
  export const PRODUCT_LABEL_SETTING_KEY = 'product-label'
6
6
  export const REUSABLE_PALLET_LABEL_SETTING_KEY = 'reusable-pallet-label'
7
7
  export const INTENALIZED_AWB_SETTING_KEY = 'internalized-awb-label'
8
+ export const ROUTE_LABEL_SETTING_KEY = 'route-label'
@@ -135,7 +135,6 @@ class SerialNumberListPopup extends localize(i18next)(LitElement) {
135
135
 
136
136
  <div class="button-container">
137
137
  <mwc-button
138
- class="mobile-full-width"
139
138
  danger
140
139
  @click=${() => {
141
140
  this.dispatchEvent(new CustomEvent('close-serial-number-list', {}))
@@ -1,5 +1,6 @@
1
1
  import '@things-factory/form-ui'
2
2
  import '@things-factory/grist-ui'
3
+ import '../inventory/serial-number-list-popup'
3
4
 
4
5
  import gql from 'graphql-tag'
5
6
  import { css, html } from 'lit-element'
@@ -10,6 +11,7 @@ import { i18next, localize } from '@things-factory/i18n-base'
10
11
  import { client, PageView, store } from '@things-factory/shell'
11
12
  import { CommonButtonStyles, ScrollbarStyles } from '@things-factory/styles'
12
13
  import { isMobileDevice } from '@things-factory/utils'
14
+ import { openPopup } from '@things-factory/layout-base'
13
15
 
14
16
  class InventoryAdjustmentApproval extends connect(store)(localize(i18next)(PageView)) {
15
17
  static get styles() {
@@ -62,7 +64,8 @@ class InventoryAdjustmentApproval extends connect(store)(localize(i18next)(PageV
62
64
  config: Object,
63
65
  data: Object,
64
66
  _detailData: Object,
65
- _compareColumn: Array
67
+ _compareColumn: Array,
68
+ _selectedInventoryChange: Object
66
69
  }
67
70
  }
68
71
 
@@ -119,6 +122,7 @@ class InventoryAdjustmentApproval extends connect(store)(localize(i18next)(PageV
119
122
  }
120
123
 
121
124
  async pageInitialized() {
125
+ this._selectedInventoryChange = null
122
126
  this._lockedPallet = []
123
127
  const partners = await this._fetchPartners()
124
128
  const _approvalStatus = await getCodeByName('APPROVAL_STATUS')
@@ -136,7 +140,8 @@ class InventoryAdjustmentApproval extends connect(store)(localize(i18next)(PageV
136
140
  { column: 'uomValue', name: 'UomValue' },
137
141
  { column: 'expirationDate', name: 'Exp. Date' },
138
142
  { column: 'manufactureDate', name: 'Mfg. Date' },
139
- { column: 'unitCost', name: 'Unit Cost' }
143
+ { column: 'unitCost', name: 'Unit Cost' },
144
+ { column: 'inventoryItemChange', name: 'Inventory Item Changes' }
140
145
  ]
141
146
 
142
147
  this.config = {
@@ -153,6 +158,7 @@ class InventoryAdjustmentApproval extends connect(store)(localize(i18next)(PageV
153
158
  handlers: {
154
159
  click: (columns, data, column, record, rowIndex) => {
155
160
  if (record) {
161
+ this._selectedInventoryChange = record
156
162
  let recordDiff = []
157
163
  let compareData = []
158
164
 
@@ -272,7 +278,13 @@ class InventoryAdjustmentApproval extends connect(store)(localize(i18next)(PageV
272
278
  pagination: { infinite: true },
273
279
  list: { fields: ['column', 'current', 'update'] },
274
280
  rows: {
275
- appendable: false
281
+ appendable: false,
282
+ handlers: {
283
+ click: (columns, data, column, record, rowIndex) => {
284
+ if (record.column == 'Inventory Item Changes')
285
+ this._openSerialNumberPopup(this._selectedInventoryChange, rowIndex)
286
+ }
287
+ }
276
288
  },
277
289
  columns: [
278
290
  { type: 'gutter', gutterName: 'sequence' },
@@ -629,6 +641,25 @@ class InventoryAdjustmentApproval extends connect(store)(localize(i18next)(PageV
629
641
  }
630
642
  }
631
643
 
644
+ _openSerialNumberPopup(inventory, rowIndex) {
645
+ openPopup(
646
+ html`
647
+ <serial-number-list-popup
648
+ .title="${i18next.t('title.serial_number_list')}"
649
+ .inventory=${inventory}
650
+ .adjustmentType=${'APPROVAL'}
651
+ .enableRemove=${false}
652
+ .enableUpdateBtn=${false}
653
+ ></serial-number-list-popup>
654
+ `,
655
+ {
656
+ backdrop: false,
657
+ size: 'large',
658
+ title: i18next.t('title.serial_number_list')
659
+ }
660
+ )
661
+ }
662
+
632
663
  _showToast({ type, message, option }) {
633
664
  document.dispatchEvent(
634
665
  new CustomEvent('notify', {
@@ -3,6 +3,7 @@ import '@things-factory/grist-ui'
3
3
  import '@things-factory/import-ui'
4
4
  import '../components/popup-note'
5
5
  import './inventory-history-by-pallet'
6
+ import '../inventory/serial-number-list-popup'
6
7
 
7
8
  import gql from 'graphql-tag'
8
9
  import { css, html } from 'lit-element'
@@ -16,7 +17,7 @@ import { client, PageView, store } from '@things-factory/shell'
16
17
  import { CommonButtonStyles, ScrollbarStyles } from '@things-factory/styles'
17
18
  import { isMobileDevice } from '@things-factory/utils'
18
19
 
19
- import { CARTON_LABEL_SETTING_KEY, PALLET_LABEL_SETTING_KEY } from '../constants'
20
+ import { CARTON_LABEL_SETTING_KEY, INVENTORY_ITEM_CHANGE_TYPE, PALLET_LABEL_SETTING_KEY } from '../constants'
20
21
 
21
22
  class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
22
23
  static get styles() {
@@ -46,7 +47,9 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
46
47
  _searchFields: Array,
47
48
  config: Object,
48
49
  _palletLabel: Object,
49
- _cartonLabel: Object
50
+ _cartonLabel: Object,
51
+ _inventory: Object,
52
+ _data: Object
50
53
  }
51
54
  }
52
55
 
@@ -100,6 +103,7 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
100
103
  <data-grist
101
104
  .mode=${isMobileDevice() ? 'LIST' : 'GRID'}
102
105
  .config=${this.config}
106
+ .data=${this._data}
103
107
  .fetchHandler="${this.fetchHandler.bind(this)}"
104
108
  @record-change="${this.customerChange.bind(this)}"
105
109
  @field-change="${this.fieldChange.bind(this)}"
@@ -218,6 +222,7 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
218
222
  icon: 'reorder',
219
223
  handlers: { click: this.showInventoryMovement.bind(this) }
220
224
  },
225
+ { type: 'string', name: 'inventoryItemChanges', hidden: true },
221
226
  {
222
227
  type: 'string',
223
228
  name: 'palletId',
@@ -288,7 +293,17 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
288
293
  { name: 'type', header: i18next.t('field.type'), width: 200 },
289
294
  { name: 'packingType', header: i18next.t('field.packing_type'), width: 200 },
290
295
  { name: 'packingSize', header: i18next.t('field.packing_size'), width: 150 },
291
- { name: 'uom', header: i18next.t('field.uom'), width: 150 }
296
+ { name: 'uom', header: i18next.t('field.uom'), width: 150 },
297
+ {
298
+ name: 'isRequireSerialNumberScanningInbound',
299
+ header: i18next.t('field.require_serial_number_scanning_inbound'),
300
+ width: 150
301
+ },
302
+ {
303
+ name: 'isRequireSerialNumberScanningOutbound',
304
+ header: i18next.t('field.require_serial_number_scanning_outbound'),
305
+ width: 150
306
+ }
292
307
  ]
293
308
  }
294
309
  },
@@ -349,6 +364,26 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
349
364
  },
350
365
  width: 80
351
366
  },
367
+ {
368
+ type: 'string',
369
+ name: 'serialNumbers',
370
+ header: i18next.t('field.serial_number'),
371
+ hidden: true,
372
+ imex: { header: i18next.t('field.serial_number'), key: 'serialNumbers', width: 100, type: 'string' },
373
+ width: 100
374
+ },
375
+ {
376
+ type: 'number',
377
+ name: 'inventoryItemCount',
378
+ header: i18next.t('field.serial_number'),
379
+ sortable: false,
380
+ handlers: {
381
+ click: (columns, data, column, record, rowIndex) => {
382
+ if (record.qty > 0) this._openSerialNumberPopup(record, rowIndex)
383
+ }
384
+ },
385
+ width: 80
386
+ },
352
387
  {
353
388
  type: 'number',
354
389
  name: 'lockedQty',
@@ -501,6 +536,7 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
501
536
  uom
502
537
  uomValue
503
538
  manufactureDate
539
+ serialNumbers
504
540
  bizplace {
505
541
  id
506
542
  name
@@ -516,6 +552,8 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
516
552
  auxValue1
517
553
  description
518
554
  type
555
+ isRequireSerialNumberScanningOutbound
556
+ isRequireSerialNumberScanningInbound
519
557
  }
520
558
  qty
521
559
  remainQty
@@ -539,6 +577,7 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
539
577
  remark
540
578
  expirationDate
541
579
  unitCost
580
+ inventoryItemCount
542
581
  }
543
582
  total
544
583
  }
@@ -561,7 +600,7 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
561
600
  }
562
601
  })
563
602
 
564
- return {
603
+ this._data = {
565
604
  total: response.data.inventories.total || 0,
566
605
  records: response.data.inventories.items || []
567
606
  }
@@ -587,6 +626,7 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
587
626
  expirationDate
588
627
  manufactureDate
589
628
  unitCost
629
+ serialNumbers
590
630
  bizplace {
591
631
  id
592
632
  name
@@ -710,6 +750,16 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
710
750
  default:
711
751
  break
712
752
  }
753
+
754
+ if (item._data.records[e.detail.row]?.inventoryItemChanges) {
755
+ let inventoryItemChanges = item._data.records[e.detail.row]?.inventoryItemChanges
756
+ item._data.records[e.detail.row].inventoryItemChanges = inventoryItemChanges
757
+ item.dirtyData.records[e.detail.row].inventoryItemChanges = inventoryItemChanges
758
+ item.dirtyData.records[e.detail.row].__dirtyfields__ = {
759
+ ...item.dirtyData.records[e.detail.row].__dirtyfields__,
760
+ inventoryItemChanges: { before: '', after: inventoryItemChanges }
761
+ }
762
+ }
713
763
  }
714
764
 
715
765
  async saveInventories() {
@@ -717,6 +767,7 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
717
767
  var patches = this.dataGrist.exportPatchList({ flagName: 'cuFlag' })
718
768
  patches = patches.map(row => {
719
769
  delete row.productUomValue
770
+ delete row.inventoryItemCount
720
771
  if (row.cuFlag == '+') {
721
772
  if (!row.bizplace || !row.location || !row.product || !row.batchId || !row.qty || !row.uomValue) {
722
773
  throw new Error(i18next.t('text.empty_value_in_list'))
@@ -734,6 +785,11 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
734
785
  if (row.uomValue) {
735
786
  row.uomValue = parseFloat(row.uomValue)
736
787
  }
788
+ if (row?.inventoryItemChanges) {
789
+ row.inventoryItemChangesJson = row.inventoryItemChanges
790
+
791
+ delete row.inventoryItemChanges
792
+ }
737
793
  return row
738
794
  })
739
795
 
@@ -819,6 +875,11 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
819
875
  let mdt = new Date(itm.manufactureDate)
820
876
  itm.manufactureDate = `${mdt.getFullYear()}-${mdt.getMonth() + 1}-${mdt.getDate()}`
821
877
  }
878
+
879
+ if (itm.serialNumbers) {
880
+ let serialNumbers = itm.serialNumbers
881
+ itm.serialNumbers = serialNumbers.replace(' ', '')
882
+ }
822
883
  })
823
884
 
824
885
  const response = await client.mutate({
@@ -841,6 +902,16 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
841
902
  }
842
903
 
843
904
  importableData(records) {
905
+ let columns = this.config.columns
906
+ .filter(column => column.imex !== undefined)
907
+ .map(column => {
908
+ if (column.name == 'serialNumbers') {
909
+ delete column.hidden
910
+ }
911
+
912
+ return { ...column }
913
+ })
914
+
844
915
  setTimeout(() => {
845
916
  openPopup(
846
917
  html`
@@ -848,7 +919,7 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
848
919
  .records=${records}
849
920
  .config=${{
850
921
  rows: this.config.rows,
851
- columns: [...this.config.columns.filter(column => column.imex !== undefined)]
922
+ columns: columns
852
923
  }}
853
924
  .importHandler="${this.importHandler.bind(this)}"
854
925
  @field-change="${this.fieldChange.bind(this)}"
@@ -1058,6 +1129,74 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
1058
1129
  )
1059
1130
  }
1060
1131
 
1132
+ _openSerialNumberPopup(inventory, rowIndex) {
1133
+ const removable =
1134
+ inventory?.product?.isRequireSerialNumberScanningOutbound &&
1135
+ inventory?.product?.isRequireSerialNumberScanningInbound
1136
+ ? true
1137
+ : false
1138
+
1139
+ const updatable =
1140
+ inventory?.product?.isRequireSerialNumberScanningOutbound &&
1141
+ inventory?.product?.isRequireSerialNumberScanningInbound
1142
+ ? true
1143
+ : false
1144
+ openPopup(
1145
+ html`
1146
+ <serial-number-list-popup
1147
+ .title="${i18next.t('title.serial_number_list')}"
1148
+ .inventory=${inventory}
1149
+ .adjustmentType=${'ADJUSTMENT'}
1150
+ .enableRemove=${removable}
1151
+ .enableUpdateBtn=${updatable}
1152
+ @confirm-serial-number-list="${e => {
1153
+ let totalSerialNumber = 0
1154
+ let newRecords = []
1155
+ for (let i = 0; i < e.detail.inventoryItemChanges.length; i++) {
1156
+ let inventoryItemChange = e.detail.inventoryItemChanges[i]
1157
+ newRecords.push(inventoryItemChange)
1158
+
1159
+ if (inventoryItemChange.type == INVENTORY_ITEM_CHANGE_TYPE.NEW.value) totalSerialNumber++
1160
+
1161
+ if (inventoryItemChange.type == INVENTORY_ITEM_CHANGE_TYPE.REMOVED.value) totalSerialNumber--
1162
+ }
1163
+
1164
+ let inventoryItemChangesJson = JSON.stringify(newRecords)
1165
+ let currentInventoryItemCount = this._data.records[rowIndex]?.inventoryItemCount || 0
1166
+
1167
+ this.dataGrist.dirtyData.records[rowIndex].inventoryItemChanges = inventoryItemChangesJson
1168
+ this.dataGrist.dirtyData.records[rowIndex].inventoryItemCount =
1169
+ currentInventoryItemCount + totalSerialNumber
1170
+ if (!this.dataGrist?.dirtyData?.records[rowIndex]?.__dirtyfields__) {
1171
+ this.dataGrist.dirtyData.records[rowIndex].__dirtyfields__ = {
1172
+ inventoryItemChanges: { before: '', after: inventoryItemChangesJson }
1173
+ }
1174
+ } else {
1175
+ this.dataGrist.dirtyData.records[rowIndex].__dirtyfields__ = {
1176
+ ...this.dataGrist.dirtyData.records[rowIndex].__dirtyfields__,
1177
+ inventoryItemChanges: {
1178
+ before: '',
1179
+ after: inventoryItemChangesJson
1180
+ }
1181
+ }
1182
+ }
1183
+ this.dataGrist.dirtyData.records[rowIndex].__dirty__ = 'M'
1184
+
1185
+ if (this._data.records[rowIndex]) {
1186
+ this._data.records[rowIndex].inventoryItemChanges = inventoryItemChangesJson
1187
+ this._data.records[rowIndex].inventoryItemCount = currentInventoryItemCount + totalSerialNumber
1188
+ }
1189
+ }}"
1190
+ ></serial-number-list-popup>
1191
+ `,
1192
+ {
1193
+ backdrop: false,
1194
+ size: 'large',
1195
+ title: i18next.t('title.serial_number_list')
1196
+ }
1197
+ )
1198
+ }
1199
+
1061
1200
  async printLotLabel() {
1062
1201
  const records = this.dataGrist.selected
1063
1202
  var labelId = this._palletLabel && this._palletLabel.id
@@ -65,7 +65,11 @@ class NonLoadedInventory extends connect(store)(localize(i18next)(PageView)) {
65
65
 
66
66
  get context() {
67
67
  return {
68
- title: i18next.t('title.non_loaded_inventory')
68
+ title: i18next.t('title.non_loaded_inventory'),
69
+ exportable: {
70
+ name: i18next.t('title.non_loaded_inventory'),
71
+ data: this._exportableData.bind(this)
72
+ }
69
73
  }
70
74
  }
71
75
 
@@ -73,24 +77,22 @@ class NonLoadedInventory extends connect(store)(localize(i18next)(PageView)) {
73
77
  this.config = {
74
78
  list: {
75
79
  fields: [
76
- 'roNo',
80
+ 'releaseOrderNo',
77
81
  'palletId',
78
82
  'cartonId',
79
83
  'batchId',
80
84
  'productSku',
81
- 'productInformation',
82
- 'product_brand',
85
+ 'productName',
86
+ 'productBrand',
83
87
  'packingType',
84
- 'qty',
85
- 'uomValue',
88
+ 'pickedQty',
89
+ 'pickedUomValue',
86
90
  'uom',
87
91
  'binLocation'
88
92
  ]
89
93
  },
90
- pagination: { pages: [20, 50, 100, 500, 999] },
91
- rows: {
92
- appendable: false
93
- },
94
+ pagination: { pages: [50, 100, 200, 500] },
95
+ rows: { appendable: false },
94
96
  columns: [
95
97
  { type: 'gutter', gutterName: 'sequence' },
96
98
  { type: 'gutter', gutterName: 'row-selector', multiple: true },
@@ -98,20 +100,28 @@ class NonLoadedInventory extends connect(store)(localize(i18next)(PageView)) {
98
100
  type: 'string',
99
101
  name: 'releaseOrderNo',
100
102
  header: i18next.t('field.ro_no'),
101
- sortable: true,
103
+ label: true,
104
+ width: 150
105
+ },
106
+ {
107
+ type: 'string',
108
+ name: 'refNo',
109
+ header: i18next.t('field.ref_no'),
110
+ label: true,
102
111
  width: 150
103
112
  },
104
113
  {
105
114
  type: 'string',
106
115
  name: 'palletId',
107
116
  header: i18next.t('field.lot_id'),
108
- sortable: true,
117
+ label: true,
109
118
  width: 150
110
119
  },
111
120
  {
112
121
  type: 'string',
113
122
  name: 'cartonId',
114
123
  header: i18next.t('field.carton_id'),
124
+ label: true,
115
125
  sortable: true,
116
126
  width: 120
117
127
  },
@@ -119,14 +129,14 @@ class NonLoadedInventory extends connect(store)(localize(i18next)(PageView)) {
119
129
  type: 'string',
120
130
  name: 'batchId',
121
131
  header: i18next.t('field.batch_id'),
122
- imex: { header: i18next.t('field.batch_id'), key: 'batchId', width: 30, type: 'string' },
123
- sortable: true,
132
+ label: true,
124
133
  width: 120
125
134
  },
126
135
  {
127
136
  type: 'string',
128
137
  name: 'productSku',
129
138
  header: i18next.t('field.sku'),
139
+ label: true,
130
140
  sortable: true,
131
141
  width: 150
132
142
  },
@@ -134,6 +144,7 @@ class NonLoadedInventory extends connect(store)(localize(i18next)(PageView)) {
134
144
  type: 'string',
135
145
  name: 'productName',
136
146
  header: i18next.t('field.product'),
147
+ label: true,
137
148
  sortable: true,
138
149
  width: 250
139
150
  },
@@ -141,6 +152,7 @@ class NonLoadedInventory extends connect(store)(localize(i18next)(PageView)) {
141
152
  type: 'string',
142
153
  name: 'productBrand',
143
154
  header: i18next.t('field.brand'),
155
+ label: true,
144
156
  sortable: true,
145
157
  width: 150
146
158
  },
@@ -148,6 +160,7 @@ class NonLoadedInventory extends connect(store)(localize(i18next)(PageView)) {
148
160
  type: 'string',
149
161
  name: 'packingType',
150
162
  header: i18next.t('field.packing_type'),
163
+ label: true,
151
164
  sortable: true,
152
165
  width: 150
153
166
  },
@@ -155,18 +168,21 @@ class NonLoadedInventory extends connect(store)(localize(i18next)(PageView)) {
155
168
  type: 'number',
156
169
  name: 'pickedQty',
157
170
  header: i18next.t('field.qty'),
171
+ label: true,
158
172
  width: 80
159
173
  },
160
174
  {
161
175
  type: 'float',
162
176
  name: 'pickedUomValue',
163
177
  header: i18next.t('field.total_uom_value'),
178
+ label: true,
164
179
  width: 110
165
180
  },
166
181
  {
167
182
  type: 'string',
168
183
  name: 'uom',
169
184
  header: i18next.t('field.uom'),
185
+ label: true,
170
186
  sortable: true,
171
187
  width: 80
172
188
  },
@@ -174,6 +190,7 @@ class NonLoadedInventory extends connect(store)(localize(i18next)(PageView)) {
174
190
  type: 'string',
175
191
  name: 'binLocation',
176
192
  header: i18next.t('field.bin_location'),
193
+ label: true,
177
194
  sortable: true,
178
195
  width: 120
179
196
  }
@@ -211,6 +228,12 @@ class NonLoadedInventory extends connect(store)(localize(i18next)(PageView)) {
211
228
  type: 'text',
212
229
  props: { searchOper: 'i_like' }
213
230
  },
231
+ {
232
+ label: i18next.t('field.ref_no'),
233
+ name: 'refNo',
234
+ type: 'text',
235
+ props: { searchOper: 'i_like' }
236
+ },
214
237
  {
215
238
  label: i18next.t('field.bin_location'),
216
239
  name: 'binLocation',
@@ -243,6 +266,7 @@ class NonLoadedInventory extends connect(store)(localize(i18next)(PageView)) {
243
266
  items {
244
267
  releaseGood {
245
268
  name
269
+ refNo
246
270
  }
247
271
  inventory {
248
272
  palletId
@@ -287,11 +311,55 @@ class NonLoadedInventory extends connect(store)(localize(i18next)(PageView)) {
287
311
  binLocation: item.binLocation.name,
288
312
  palletId: item.inventory.palletId,
289
313
  cartonId: item.inventory.cartonId,
290
- releaseOrderNo: item.releaseGood.name
314
+ releaseOrderNo: item.releaseGood.name,
315
+ refNo: item.releaseGood.refNo
291
316
  }
292
317
  }) || []
293
318
  }
294
319
  }
320
+
321
+ async _exportableData() {
322
+ try {
323
+ let data = []
324
+
325
+ var headerSetting = [
326
+ { header: i18next.t('field.ro_no'), key: 'releaseOrderNo', width: 50, type: 'string' },
327
+ { header: i18next.t('field.ref_no'), key: 'refNo', width: 50, type: 'string' },
328
+ { header: i18next.t('field.lot_id'), key: 'palletId', width: 50, type: 'string' },
329
+ { header: i18next.t('field.carton_id'), key: 'cartonId', width: 50, type: 'string' },
330
+ { header: i18next.t('field.batch_id'), key: 'batchId', width: 25, type: 'string' },
331
+ { header: i18next.t('field.sku'), key: 'productSku', width: 25, type: 'string' },
332
+ { header: i18next.t('field.product'), key: 'productName', width: 25, type: 'string' },
333
+ { header: i18next.t('field.brand'), key: 'productBrand', width: 25, type: 'string' },
334
+ { header: i18next.t('field.packing_type'), key: 'packingType', width: 25, type: 'string' },
335
+ { header: i18next.t('field.qty'), key: 'pickedQty', width: 25, type: 'string' },
336
+ { header: i18next.t('field.total_uom_value'), key: 'pickedUomValue', width: 25, type: 'float' },
337
+ { header: i18next.t('field.uom'), key: 'uom', width: 25, type: 'string' },
338
+ { header: i18next.t('field.bin_location'), key: 'binLocation', width: 25, type: 'string' }
339
+ ]
340
+
341
+ if (this.dataGrist.selected && this.dataGrist.selected.length > 0) {
342
+ data = this.dataGrist.selected
343
+ } else {
344
+ data = (await this.fetchHandler({ page: 1, limit: 9999999 })).records
345
+ }
346
+
347
+ return { header: headerSetting, data }
348
+ } catch (e) {
349
+ this._showToast(e)
350
+ }
351
+ }
352
+
353
+ _showToast({ type, message }) {
354
+ document.dispatchEvent(
355
+ new CustomEvent('notify', {
356
+ detail: {
357
+ type,
358
+ message
359
+ }
360
+ })
361
+ )
362
+ }
295
363
  }
296
364
 
297
365
  window.customElements.define('non-loaded-inventory', NonLoadedInventory)