@things-factory/operato-wms 3.7.15 → 3.8.3

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 (88) hide show
  1. package/client/pages/adjustment/transfer-inventory.js +390 -158
  2. package/client/pages/bulk-operation/bulk-operation.js +316 -0
  3. package/client/pages/bulk-operation/validate-ro-popup.js +445 -0
  4. package/client/pages/components/select-product-popup.js +1 -1
  5. package/client/pages/constants/inventory.js +1 -0
  6. package/client/pages/constants/location.js +33 -6
  7. package/client/pages/constants/worksheet.js +2 -2
  8. package/client/pages/inbound/inbound-worksheet.js +81 -15
  9. package/client/pages/inbound/putaway-product.js +61 -9
  10. package/client/pages/inbound/putaway-worksheet-generate-popup.js +29 -5
  11. package/client/pages/inbound/unload-product.js +80 -19
  12. package/client/pages/inbound/worksheet-putaway-return.js +14 -5
  13. package/client/pages/inbound/worksheet-putaway.js +13 -8
  14. package/client/pages/inbound/worksheet-unloading-return.js +14 -5
  15. package/client/pages/inventory/inventory-adjustment-approval.js +15 -23
  16. package/client/pages/inventory/inventory-adjustment.js +84 -80
  17. package/client/pages/inventory/inventory-by-product-detail.js +1 -1
  18. package/client/pages/inventory/inventory-by-product.js +1 -1
  19. package/client/pages/inventory/inventory-history-by-pallet.js +1 -1
  20. package/client/pages/inventory/inventory-history.js +2 -2
  21. package/client/pages/inventory/onhand-inventory.js +1 -2
  22. package/client/pages/inventory-check/create-cycle-count.js +1 -6
  23. package/client/pages/master/location-list.js +58 -17
  24. package/client/pages/order/arrival-notice/arrival-notice-detail.js +15 -8
  25. package/client/pages/order/arrival-notice/arrival-notice-list.js +87 -6
  26. package/client/pages/order/arrival-notice/arrival-notice-requests.js +83 -6
  27. package/client/pages/order/arrival-notice/create-arrival-notice.js +23 -2
  28. package/client/pages/order/arrival-notice/duplicate-arrival-notice.js +290 -25
  29. package/client/pages/order/arrival-notice/edit-product-popup.js +36 -5
  30. package/client/pages/order/release-order/b2c/b2c-order-requests.js +60 -0
  31. package/client/pages/order/release-order/batch-picking-popup.js +18 -1
  32. package/client/pages/order/release-order/create-release-order.js +2 -2
  33. package/client/pages/order/release-order/release-extra-product-popup.js +12 -4
  34. package/client/pages/order/release-order/release-order-detail.js +1 -1
  35. package/client/pages/order/return-order/create-return-order.js +1 -1
  36. package/client/pages/order/return-order/return-order-detail.js +6 -5
  37. package/client/pages/order/transport-order/delivery-order-list.js +4 -1
  38. package/client/pages/outbound/inventory-assign-popup.js +1 -1
  39. package/client/pages/outbound/merged-outbound-worksheet.js +9 -5
  40. package/client/pages/outbound/picking-product.js +223 -184
  41. package/client/pages/outbound/picking-replacement-popup.js +2 -2
  42. package/client/pages/outbound/single-outbound-worksheet.js +47 -1
  43. package/client/pages/outbound/worksheet-loading.js +14 -5
  44. package/client/pages/outbound/worksheet-picking.js +10 -5
  45. package/client/pages/report/custom-elccl/elccl-inventory-report.js +31 -30
  46. package/client/pages/report/custom-elccl/elccl-inventory-summary-report.js +23 -26
  47. package/client/pages/report/inventory-pallet-storage-report.js +11 -10
  48. package/client/pages/report/inventory-report.js +41 -43
  49. package/client/pages/report/inventory-summary-report.js +25 -28
  50. package/client/pages/vas/print-product-label.js +3 -1
  51. package/client/route.js +5 -0
  52. package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-report.js +1 -1
  53. package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-report.js.map +1 -1
  54. package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-summary-report.js +1 -1
  55. package/dist-server/graphql/resolvers/index.js +3 -1
  56. package/dist-server/graphql/resolvers/index.js.map +1 -1
  57. package/dist-server/graphql/resolvers/reports/product-label-report.js +1 -0
  58. package/dist-server/graphql/resolvers/reports/product-label-report.js.map +1 -1
  59. package/dist-server/graphql/resolvers/shipping-provider/index.js +6 -0
  60. package/dist-server/graphql/resolvers/shipping-provider/index.js.map +1 -0
  61. package/dist-server/graphql/resolvers/shipping-provider/shipping-providers.js +20 -0
  62. package/dist-server/graphql/resolvers/shipping-provider/shipping-providers.js.map +1 -0
  63. package/dist-server/graphql/types/custom/elccl/elccl-inventory-report.js +1 -1
  64. package/dist-server/graphql/types/index.js +5 -2
  65. package/dist-server/graphql/types/index.js.map +1 -1
  66. package/dist-server/graphql/types/shipping-provider/index.js +10 -0
  67. package/dist-server/graphql/types/shipping-provider/index.js.map +1 -0
  68. package/dist-server/graphql/types/shipping-provider/shipping-provider-list.js +13 -0
  69. package/dist-server/graphql/types/shipping-provider/shipping-provider-list.js.map +1 -0
  70. package/dist-server/graphql/types/shipping-provider/shipping-provider.js +13 -0
  71. package/dist-server/graphql/types/shipping-provider/shipping-provider.js.map +1 -0
  72. package/package.json +37 -37
  73. package/server/graphql/resolvers/custom/elccl/elccl-inventory-history-report.ts +4 -2
  74. package/server/graphql/resolvers/custom/elccl/elccl-inventory-history-summary-report.ts +1 -1
  75. package/server/graphql/resolvers/index.ts +3 -1
  76. package/server/graphql/resolvers/reports/product-label-report.ts +1 -0
  77. package/server/graphql/resolvers/shipping-provider/index.ts +5 -0
  78. package/server/graphql/resolvers/shipping-provider/shipping-providers.ts +20 -0
  79. package/server/graphql/types/custom/elccl/elccl-inventory-report.ts +1 -1
  80. package/server/graphql/types/index.ts +5 -2
  81. package/server/graphql/types/shipping-provider/index.ts +8 -0
  82. package/server/graphql/types/shipping-provider/shipping-provider-list.ts +7 -0
  83. package/server/graphql/types/shipping-provider/shipping-provider.ts +7 -0
  84. package/things-factory.config.js +6 -0
  85. package/translations/en.json +28 -0
  86. package/translations/ko.json +85 -36
  87. package/translations/ms.json +86 -37
  88. package/translations/zh.json +99 -51
@@ -227,11 +227,12 @@ class ReturnOrderDetail extends connect(store)(localize(i18next)(PageView)) {
227
227
  ]
228
228
  if (this._status === ORDER_STATUS.PENDING.value) {
229
229
  actions.push(
230
- {
231
- title: i18next.t('button.delete'),
232
- action: this._deleteReturnOrder.bind(this),
233
- ...CommonButtonStyles.delete
234
- },
230
+ // Issue with deletion, temporarily disable this feature
231
+ // {
232
+ // title: i18next.t('button.delete'),
233
+ // action: this._deleteReturnOrder.bind(this),
234
+ // ...CommonButtonStyles.delete
235
+ // },
235
236
  {
236
237
  title: i18next.t('button.confirm'),
237
238
  action: this._confirmReturnOrder.bind(this),
@@ -432,7 +432,7 @@ class DeliveryOrderList extends localize(i18next)(PageView) {
432
432
  return {
433
433
  id: item.id,
434
434
  ...this._columns
435
- .filter(column => column.type !== 'gutter' && column.record !== undefined && column.imex !== undefined)
435
+ .filter(column => column.type !== 'gutter' && column.imex !== undefined)
436
436
  .reduce((record, column) => {
437
437
  record[column.imex.key] = column.imex.key
438
438
  .split('.')
@@ -440,6 +440,9 @@ class DeliveryOrderList extends localize(i18next)(PageView) {
440
440
  if (column.type === 'datetime') {
441
441
  record[column.imex.key] = new Date(parseInt(record[column.imex.key])).toLocaleString()
442
442
  }
443
+ if (record[column.imex.key] === 'Invalid Date') {
444
+ record[column.imex.key] = ''
445
+ }
443
446
  return record
444
447
  }, {})
445
448
  }
@@ -264,7 +264,7 @@ class InventoryAssignPopup extends localize(i18next)(LitElement) {
264
264
  $packingSize: Float!
265
265
  $uom: String!
266
266
  $pickingStrategy: String!
267
- $locationSortingRules: [Sorting]
267
+ $locationSortingRules: [Sorting!]!
268
268
  ) {
269
269
  inventoriesByStrategy(
270
270
  worksheetId: $worksheetId
@@ -229,7 +229,7 @@ class MergedOutboundWorksheet extends localize(i18next)(PageView) {
229
229
  type: 'datetime',
230
230
  name: 'createdAt',
231
231
  header: i18next.t('field.created_at'),
232
- imex: { header: i18next.t('field.created_at'), key: 'createdAt', width: 30, type: 'datetime' },
232
+ imex: { header: i18next.t('field.created_at'), key: 'createdAt', width: 30, type: 'string' },
233
233
  sortable: true,
234
234
  width: 160
235
235
  },
@@ -237,7 +237,7 @@ class MergedOutboundWorksheet extends localize(i18next)(PageView) {
237
237
  type: 'datetime',
238
238
  name: 'startedAt',
239
239
  header: i18next.t('field.started_at'),
240
- imex: { header: i18next.t('field.started_at'), key: 'startedAt', width: 30, type: 'datetime' },
240
+ imex: { header: i18next.t('field.started_at'), key: 'startedAt', width: 30, type: 'string' },
241
241
  sortable: true,
242
242
  width: 160
243
243
  },
@@ -245,7 +245,7 @@ class MergedOutboundWorksheet extends localize(i18next)(PageView) {
245
245
  type: 'datetime',
246
246
  name: 'endedAt',
247
247
  header: i18next.t('field.ended_at'),
248
- imex: { header: i18next.t('field.ended_at'), key: 'endedAt', width: 30, type: 'datetime' },
248
+ imex: { header: i18next.t('field.ended_at'), key: 'endedAt', width: 30, type: 'string' },
249
249
  sortable: true,
250
250
  width: 160
251
251
  },
@@ -413,7 +413,7 @@ class MergedOutboundWorksheet extends localize(i18next)(PageView) {
413
413
  }
414
414
 
415
415
  var headerSetting = this.dataGrist._config.columns
416
- .filter(column => column.type !== 'gutter' && column.record !== undefined && column.imex !== undefined)
416
+ .filter(column => column.type !== 'gutter' && column.imex !== undefined)
417
417
  .map(column => {
418
418
  return column.imex
419
419
  })
@@ -422,7 +422,7 @@ class MergedOutboundWorksheet extends localize(i18next)(PageView) {
422
422
  return {
423
423
  id: item.id,
424
424
  ...this._columns
425
- .filter(column => column.type !== 'gutter' && column.record !== undefined && column.imex !== undefined)
425
+ .filter(column => column.type !== 'gutter' && column.imex !== undefined)
426
426
  .reduce((record, column) => {
427
427
  record[column.imex.key] = column.imex.key
428
428
  .split('.')
@@ -430,10 +430,14 @@ class MergedOutboundWorksheet extends localize(i18next)(PageView) {
430
430
  if (column.type === 'datetime') {
431
431
  record[column.imex.key] = new Date(parseInt(record[column.imex.key])).toLocaleString()
432
432
  }
433
+ if (record[column.imex.key] === 'Invalid Date') {
434
+ record[column.imex.key] = ''
435
+ }
433
436
  return record
434
437
  }, {})
435
438
  }
436
439
  })
440
+
437
441
  return { header: headerSetting, data: data }
438
442
  }
439
443
  }
@@ -352,10 +352,18 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
352
352
  if (e.keyCode === 13) {
353
353
  e.preventDefault()
354
354
  this._currentBinLocation = null
355
- if (this.releaseGoodNoInput.value) {
356
- this.releaseGoodNo = this.releaseGoodNoInput.value
357
- await this.fetchAll(this.releaseGoodNo)
358
- this.completeHandler()
355
+ if (this.refPickingType === PICKING_TYPES.PICKING.value) {
356
+ if (this.releaseGoodNoInput.value) {
357
+ this.releaseGoodNo = this.releaseGoodNoInput.value
358
+ await this.fetchAll(this.releaseGoodNo)
359
+ this.completeHandler()
360
+ }
361
+ } else {
362
+ if (this.taskNoInput.value) {
363
+ this.taskNo = this.taskNoInput.value
364
+ await this.fetchAll(this.taskNo)
365
+ this.completeHandler()
366
+ }
359
367
  }
360
368
  }
361
369
  }}"
@@ -571,7 +579,10 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
571
579
  if (this.serialInput) this.serialInput.value = ''
572
580
 
573
581
  this._selectedOrderInventory = record
574
- await this.fetchInventories(this.releaseGoodNo)
582
+
583
+ await this.fetchInventories(
584
+ this.refPickingType === PICKING_TYPES.PICKING.value ? this.releaseGoodNo : this.taskNo
585
+ )
575
586
  let updatedRecords = this._selectedOrderInventory
576
587
  if (updatedRecords.releaseQty === updatedRecords.pickedQty) {
577
588
  updatedRecords.status = 'DONE'
@@ -846,12 +857,14 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
846
857
  if (record.pickedQty == record.releaseQty) {
847
858
  if (this._isCartonLabel) {
848
859
  this.cartonInput.value = ''
849
- this._focusOnCartonNoInput()
860
+ this.productBarcodeInput.value = ''
861
+ // this._focusOnCartonNoInput()
850
862
  }
851
863
  this.inputForm.reset()
852
864
  } else {
853
- this._focusOnProductBarcodeInput()
865
+ // this._focusOnProductBarcodeInput()
854
866
  this.fillUpForm(this.inputForm, record)
867
+ this.focusOnInput()
855
868
  }
856
869
  }
857
870
  }
@@ -896,7 +909,7 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
896
909
  async fetchPalletsHandler(releaseGoodNo) {
897
910
  const response = await client.query({
898
911
  query: gql`
899
- query pallets($filters: [Filter], $pagination: Pagination) {
912
+ query pallets($filters: [Filter!]!, $pagination: Pagination) {
900
913
  pallets(filters: $filters, pagination: $pagination) {
901
914
  items {
902
915
  id
@@ -1008,9 +1021,10 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1008
1021
  this.isReplacement = false
1009
1022
  } catch (e) {
1010
1023
  this._showToast(e)
1011
- } finally {
1012
- this._isExecuting = false
1013
1024
  }
1025
+ // finally {
1026
+ // this._isExecuting = false
1027
+ // }
1014
1028
  }
1015
1029
  }
1016
1030
 
@@ -1047,21 +1061,7 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1047
1061
  openSerialNumberPopup() {
1048
1062
  openPopup(
1049
1063
  html`
1050
- <serial-number-popup
1051
- .orderInventory="${this?._selectedOrderInventory?.relatedOrderInv}"
1052
- @completed="${() => {
1053
- // if (this.refPickingType === PICKING_TYPES.PICKING.value) {
1054
- // this.fetchInventories(this.releaseGoodNoInput.value)
1055
- // this.fetchPalletsHandler(this.releaseGoodNoInput.value)
1056
- // } else {
1057
- // this.fetchInventories(this.taskNoInput.value)
1058
- // this.fetchPalletsHandler(this.taskNoInput.value)
1059
- // }
1060
- // // this._selectedTaskStatus = null
1061
- // this._selectedOrderInventory = null
1062
- // this._isReplacement = false
1063
- }}"
1064
- ></serial-number-popup>
1064
+ <serial-number-popup .orderInventory="${this?._selectedOrderInventory?.relatedOrderInv}"></serial-number-popup>
1065
1065
  `,
1066
1066
  {
1067
1067
  backdrop: true,
@@ -1098,180 +1098,214 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1098
1098
  }
1099
1099
 
1100
1100
  async pickCommonPicking() {
1101
- const locationName =
1102
- this.isWholePicking || !this.locationInput ? this._selectedOrderInventory.location.name : this.locationInput.value
1103
- // 1. Check whether location is changed
1104
- if (this._selectedOrderInventory.location.name !== locationName) {
1105
- this.locationNameSplit = this.locationInput.value.split('-')
1106
- const zonePortions = this.locationNameSplit[0].match(/[a-zA-Z0-9]+/g)
1107
- const rowPortions = this.locationNameSplit[1].match(/[a-zA-Z0-9]+/g)
1108
- const columnPortions = this.locationNameSplit[2].match(/[a-zA-Z0-9]+/g)
1109
-
1110
- if (this.locationNameSplit.length === 3) {
1111
- this._incompleteLocationName = true
1112
- this.locations = await this.fetchLocations(zonePortions[0], rowPortions[0], columnPortions[0])
1113
- this._focusOnNewLocationInput()
1114
- throw new Error(i18next.t('text.please_select_the_location_again'))
1115
- } else if (this.locationNameSplit.length === 4) {
1116
- let relocateConfirmation = await CustomAlert({
1117
- title: i18next.t('title.relocate'),
1118
- text: i18next.t('text.are_you_sure'),
1119
- confirmButton: { text: i18next.t('button.relocate') },
1120
- cancelButton: { text: i18next.t('button.cancel') }
1121
- })
1101
+ if (this._isExecuting === false) {
1102
+ this._isExecuting = true
1122
1103
 
1123
- if (!relocateConfirmation.isConfirmed) {
1124
- this._incompleteLocationName = false
1125
- this.locationNameSplit = []
1126
- return false
1127
- }
1128
- }
1129
- }
1104
+ try {
1105
+ const locationName =
1106
+ this.isWholePicking || !this.locationInput
1107
+ ? this._selectedOrderInventory.location.name
1108
+ : this.locationInput.value
1109
+ // 1. Check whether location is changed
1110
+ if (this._selectedOrderInventory.location.name !== locationName) {
1111
+ this.locationNameSplit = this.locationInput.value.split('-')
1112
+ const zonePortions = this.locationNameSplit[0].match(/[a-zA-Z0-9]+/g)
1113
+ const rowPortions = this.locationNameSplit[1].match(/[a-zA-Z0-9]+/g)
1114
+ const columnPortions = this.locationNameSplit[2].match(/[a-zA-Z0-9]+/g)
1115
+
1116
+ if (this.locationNameSplit.length === 3) {
1117
+ this._incompleteLocationName = true
1118
+ this.locations = await this.fetchLocations(zonePortions[0], rowPortions[0], columnPortions[0])
1119
+ this._focusOnNewLocationInput()
1120
+ throw new Error(i18next.t('text.please_select_the_location_again'))
1121
+ } else if (this.locationNameSplit.length === 4) {
1122
+ let relocateConfirmation = await CustomAlert({
1123
+ title: i18next.t('title.relocate'),
1124
+ text: i18next.t('text.are_you_sure'),
1125
+ confirmButton: { text: i18next.t('button.relocate') },
1126
+ cancelButton: { text: i18next.t('button.cancel') }
1127
+ })
1130
1128
 
1131
- switch (this.refPickingType) {
1132
- case PICKING_TYPES.PICKING.value:
1133
- return await client.mutate({
1134
- mutation: gql`
1135
- mutation picking(
1136
- $worksheetDetailName: String!
1137
- $worksheetType: String!
1138
- $palletId: String
1139
- $locationName: String!
1140
- $releaseQty: Int!
1141
- $binLocation: String
1142
- $serialNumber: String
1143
- ) {
1144
- picking(
1145
- worksheetDetailName: $worksheetDetailName
1146
- worksheetType: $worksheetType
1147
- palletId: $palletId
1148
- locationName: $locationName
1149
- releaseQty: $releaseQty
1150
- binLocation: $binLocation
1151
- serialNumber: $serialNumber
1152
- )
1129
+ if (!relocateConfirmation.isConfirmed) {
1130
+ this._incompleteLocationName = false
1131
+ this.locationNameSplit = []
1132
+ return false
1153
1133
  }
1154
- `,
1155
- variables: {
1156
- worksheetDetailName: this._selectedOrderInventory.name,
1157
- worksheetType: this.refPickingType,
1158
- palletId: this.palletInput.value.trim(),
1159
- locationName,
1160
- releaseQty: this._isRequireSerialNumberScanning ? 1 : parseInt(this.releaseQtyInput.value),
1161
- binLocation: this._hasBinPicking ? this.binLocationInput.value : null,
1162
- serialNumber: this._isRequireSerialNumberScanning ? this.serialInput.value : null
1163
1134
  }
1164
- })
1135
+ }
1165
1136
 
1166
- case PICKING_TYPES.BATCH_PICKING.value:
1167
- return await client.mutate({
1168
- mutation: gql`
1169
- mutation batchPicking(
1170
- $taskNo: String!
1171
- $worksheetType: String!
1172
- $palletId: String!
1173
- $locationName: String
1174
- $binLocationName: String
1175
- $releaseQty: Int!
1176
- ) {
1177
- batchPicking(
1178
- taskNo: $taskNo
1179
- worksheetType: $worksheetType
1180
- palletId: $palletId
1181
- locationName: $locationName
1182
- binLocationName: $binLocationName
1183
- releaseQty: $releaseQty
1184
- )
1185
- }
1186
- `,
1187
- variables: {
1188
- taskNo: this.taskNo,
1189
- worksheetType: this.refPickingType,
1190
- palletId: this.palletInput.value.trim(),
1191
- locationName,
1192
- binLocationName: this._hasBinPicking ? this.binLocationInput.value : null,
1193
- releaseQty: parseInt(this.releaseQtyInput.value)
1194
- }
1195
- })
1137
+ switch (this.refPickingType) {
1138
+ case PICKING_TYPES.PICKING.value:
1139
+ return (
1140
+ await client.mutate({
1141
+ mutation: gql`
1142
+ mutation picking(
1143
+ $worksheetDetailName: String!
1144
+ $worksheetType: String!
1145
+ $palletId: String
1146
+ $locationName: String!
1147
+ $releaseQty: Int!
1148
+ $binLocation: String
1149
+ $serialNumber: String
1150
+ ) {
1151
+ picking(
1152
+ worksheetDetailName: $worksheetDetailName
1153
+ worksheetType: $worksheetType
1154
+ palletId: $palletId
1155
+ locationName: $locationName
1156
+ releaseQty: $releaseQty
1157
+ binLocation: $binLocation
1158
+ serialNumber: $serialNumber
1159
+ )
1160
+ }
1161
+ `,
1162
+ variables: {
1163
+ worksheetDetailName: this._selectedOrderInventory.name,
1164
+ worksheetType: this.refPickingType,
1165
+ palletId: this.palletInput.value.trim(),
1166
+ locationName,
1167
+ releaseQty: this._isRequireSerialNumberScanning ? 1 : parseInt(this.releaseQtyInput.value),
1168
+ binLocation: this._hasBinPicking ? this.binLocationInput.value : null,
1169
+ serialNumber: this._isRequireSerialNumberScanning ? this.serialInput.value : null
1170
+ }
1171
+ }),
1172
+ (this._isExecuting = false)
1173
+ )
1174
+
1175
+ case PICKING_TYPES.BATCH_PICKING.value:
1176
+ return (
1177
+ await client.mutate({
1178
+ mutation: gql`
1179
+ mutation batchPicking(
1180
+ $taskNo: String!
1181
+ $worksheetType: String!
1182
+ $palletId: String!
1183
+ $locationName: String
1184
+ $binLocationName: String
1185
+ $releaseQty: Int!
1186
+ ) {
1187
+ batchPicking(
1188
+ taskNo: $taskNo
1189
+ worksheetType: $worksheetType
1190
+ palletId: $palletId
1191
+ locationName: $locationName
1192
+ binLocationName: $binLocationName
1193
+ releaseQty: $releaseQty
1194
+ )
1195
+ }
1196
+ `,
1197
+ variables: {
1198
+ taskNo: this.taskNo,
1199
+ worksheetType: this.refPickingType,
1200
+ palletId: this.palletInput.value.trim(),
1201
+ locationName,
1202
+ binLocationName: this._hasBinPicking ? this.binLocationInput.value : null,
1203
+ releaseQty: parseInt(this.releaseQtyInput.value)
1204
+ }
1205
+ }),
1206
+ (this._isExecuting = false)
1207
+ )
1208
+ }
1209
+ } catch (e) {
1210
+ this._showToast(e)
1211
+ }
1212
+ } else {
1213
+ throw new Error(i18next.t('text.previous_picking_is_still_executing_please_wait'))
1196
1214
  }
1197
1215
  }
1198
1216
 
1199
1217
  async productBarcodePicking() {
1200
- switch (this.refPickingType) {
1201
- case PICKING_TYPES.PICKING.value:
1202
- return await client.mutate({
1203
- mutation: gql`
1204
- mutation scanProductPicking(
1205
- $worksheetDetailName: String!
1206
- $worksheetType: String!
1207
- $productBarcode: String!
1208
- $cartonId: String!
1209
- $binLocation: String
1210
- $serialNumber: String
1211
- ) {
1212
- scanProductPicking(
1213
- worksheetDetailName: $worksheetDetailName
1214
- worksheetType: $worksheetType
1215
- productBarcode: $productBarcode
1216
- cartonId: $cartonId
1217
- binLocation: $binLocation
1218
- serialNumber: $serialNumber
1219
- )
1220
- }
1221
- `,
1222
- variables: {
1223
- worksheetDetailName: this._selectedOrderInventory.name,
1224
- worksheetType: this.refPickingType,
1225
- productBarcode: this.productBarcodeInput.value.trim(),
1226
- cartonId: this.cartonInput.value.trim(),
1227
- serialNumber: this._isRequireSerialNumberScanning ? this.serialInput.value : null,
1228
- binLocation: this._hasBinPicking ? this.binLocationInput.value : null
1229
- }
1230
- })
1218
+ if (this._isExecuting === false) {
1219
+ this._isExecuting = true
1231
1220
 
1232
- case PICKING_TYPES.BATCH_PICKING.value:
1233
- return await client.mutate({
1234
- mutation: gql`
1235
- mutation scanProductBatchPicking(
1236
- $taskNo: String!
1237
- $worksheetType: String!
1238
- $cartonId: String!
1239
- $inventory: InventoryPatch!
1240
- $productBarcode: String!
1241
- $binLocationName: String
1242
- ) {
1243
- scanProductBatchPicking(
1244
- taskNo: $taskNo
1245
- worksheetType: $worksheetType
1246
- cartonId: $cartonId
1247
- inventory: $inventory
1248
- productBarcode: $productBarcode
1249
- binLocationName: $binLocationName
1250
- )
1251
- }
1252
- `,
1253
- variables: {
1254
- taskNo: this.taskNo,
1255
- worksheetType: this.refPickingType,
1256
- cartonId: this.cartonInput.value.trim(),
1257
- productBarcode: this.productBarcodeInput.value.trim(),
1258
- inventory: {
1259
- batchId: this._selectedOrderInventory.batchId,
1260
- packingType: this._selectedOrderInventory.packingType,
1261
- packingSize: this._selectedOrderInventory.packingSize,
1262
- product: { id: this._selectedOrderInventory.product.id }
1263
- },
1264
- binLocationName: this._hasBinPicking ? this.binLocationInput.value : null
1265
- }
1266
- })
1221
+ try {
1222
+ switch (this.refPickingType) {
1223
+ case PICKING_TYPES.PICKING.value:
1224
+ return (
1225
+ await client.mutate({
1226
+ mutation: gql`
1227
+ mutation scanProductPicking(
1228
+ $worksheetDetailName: String!
1229
+ $worksheetType: String!
1230
+ $productBarcode: String!
1231
+ $cartonId: String!
1232
+ $binLocation: String
1233
+ $serialNumber: String
1234
+ ) {
1235
+ scanProductPicking(
1236
+ worksheetDetailName: $worksheetDetailName
1237
+ worksheetType: $worksheetType
1238
+ productBarcode: $productBarcode
1239
+ cartonId: $cartonId
1240
+ binLocation: $binLocation
1241
+ serialNumber: $serialNumber
1242
+ )
1243
+ }
1244
+ `,
1245
+ variables: {
1246
+ worksheetDetailName: this._selectedOrderInventory.name,
1247
+ worksheetType: this.refPickingType,
1248
+ productBarcode: this.productBarcodeInput.value.trim(),
1249
+ cartonId: this.cartonInput.value.trim(),
1250
+ serialNumber: this._isRequireSerialNumberScanning ? this.serialInput.value : null,
1251
+ binLocation: this._hasBinPicking ? this.binLocationInput.value : null
1252
+ }
1253
+ }),
1254
+ (this._isExecuting = false)
1255
+ )
1256
+
1257
+ case PICKING_TYPES.BATCH_PICKING.value:
1258
+ return (
1259
+ await client.mutate({
1260
+ mutation: gql`
1261
+ mutation scanProductBatchPicking(
1262
+ $taskNo: String!
1263
+ $worksheetType: String!
1264
+ $cartonId: String!
1265
+ $inventory: InventoryPatch!
1266
+ $productBarcode: String!
1267
+ $binLocationName: String
1268
+ ) {
1269
+ scanProductBatchPicking(
1270
+ taskNo: $taskNo
1271
+ worksheetType: $worksheetType
1272
+ cartonId: $cartonId
1273
+ inventory: $inventory
1274
+ productBarcode: $productBarcode
1275
+ binLocationName: $binLocationName
1276
+ )
1277
+ }
1278
+ `,
1279
+ variables: {
1280
+ taskNo: this.taskNo,
1281
+ worksheetType: this.refPickingType,
1282
+ cartonId: this.cartonInput.value.trim(),
1283
+ productBarcode: this.productBarcodeInput.value.trim(),
1284
+ inventory: {
1285
+ batchId: this._selectedOrderInventory.batchId,
1286
+ packingType: this._selectedOrderInventory.packingType,
1287
+ packingSize: this._selectedOrderInventory.packingSize,
1288
+ product: { id: this._selectedOrderInventory.product.id }
1289
+ },
1290
+ binLocationName: this._hasBinPicking ? this.binLocationInput.value : null
1291
+ }
1292
+ }),
1293
+ (this._isExecuting = false)
1294
+ )
1295
+ }
1296
+ } catch (e) {
1297
+ this._showToast(e)
1298
+ }
1299
+ } else {
1300
+ throw new Error(i18next.t('text.previous_picking_is_still_executing_please_wait'))
1267
1301
  }
1268
1302
  }
1269
1303
 
1270
1304
  async validatePicking() {
1271
1305
  // validate for previous picking execution (multiple picking scanning)
1272
- if (this._isExecuting) throw new Error(i18next.t('text.previous_picking_is_still_executing_please_wait'))
1306
+ // if (this._isExecuting) throw new Error(i18next.t('text.previous_picking_is_still_executing_please_wait'))
1273
1307
 
1274
- this._isExecuting = true
1308
+ // this._isExecuting = true
1275
1309
 
1276
1310
  // validate for order selection
1277
1311
  if (!this._selectedOrderInventory) throw new Error(i18next.t('text.target_is_not_selected'))
@@ -1309,7 +1343,12 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1309
1343
  if (!this.releaseQtyInput.checkValidity()) throw new Error(i18next.t('text.release_qty_invalid'))
1310
1344
 
1311
1345
  // typed qty should be matched with release qty.
1312
- if (parseInt(this.releaseQtyInput.value) !== this._selectedOrderInventory.releaseQty) {
1346
+
1347
+ if (
1348
+ parseInt(this.releaseQtyInput.value) !==
1349
+ this._selectedOrderInventory.releaseQty -
1350
+ (this._selectedOrderInventory.pickedQty ? this._selectedOrderInventory.pickedQty : 0)
1351
+ ) {
1313
1352
  this._focusOnReleaseQtyInput()
1314
1353
  throw new Error(i18next.t('text.wrong_release_qty'))
1315
1354
  }
@@ -233,7 +233,7 @@ class PickingReplacementPopup extends localize(i18next)(LitElement) {
233
233
 
234
234
  const response = await client.query({
235
235
  query: gql`
236
- query inventories($filters: [Filter]) {
236
+ query inventories($filters: [Filter!]) {
237
237
  inventories(filters: $filters) {
238
238
  items {
239
239
  palletId
@@ -362,7 +362,7 @@ class PickingReplacementPopup extends localize(i18next)(LitElement) {
362
362
  mutation replacePickingPallets(
363
363
  $worksheetDetailName: String!
364
364
  $worksheetType: String!
365
- $inventories: [InventoryPatch]!
365
+ $inventories: [InventoryPatch!]!
366
366
  $returnLocation: String
367
367
  ) {
368
368
  replacePickingPallets(