@things-factory/operato-wms 3.7.15 → 3.8.0

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 (83) hide show
  1. package/client/pages/adjustment/transfer-inventory.js +364 -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 +60 -8
  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 +18 -8
  16. package/client/pages/inventory/inventory-adjustment.js +81 -76
  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/b2b/b2b-order-requests.js +7 -7
  31. package/client/pages/order/release-order/b2c/b2c-order-requests.js +65 -5
  32. package/client/pages/order/release-order/release-extra-product-popup.js +12 -4
  33. package/client/pages/order/release-order/release-order-detail.js +1 -1
  34. package/client/pages/order/return-order/create-return-order.js +1 -1
  35. package/client/pages/order/return-order/return-order-detail.js +6 -5
  36. package/client/pages/order/transport-order/delivery-order-list.js +4 -1
  37. package/client/pages/outbound/inventory-assign-popup.js +1 -1
  38. package/client/pages/outbound/merged-outbound-worksheet.js +9 -5
  39. package/client/pages/outbound/picking-product.js +202 -162
  40. package/client/pages/outbound/picking-replacement-popup.js +2 -2
  41. package/client/pages/outbound/single-outbound-worksheet.js +47 -1
  42. package/client/pages/outbound/worksheet-loading.js +14 -5
  43. package/client/pages/outbound/worksheet-picking.js +10 -5
  44. package/client/pages/report/custom-elccl/elccl-inventory-report.js +31 -30
  45. package/client/pages/report/custom-elccl/elccl-inventory-summary-report.js +23 -26
  46. package/client/pages/report/inventory-pallet-storage-report.js +11 -10
  47. package/client/pages/report/inventory-report.js +41 -43
  48. package/client/pages/report/inventory-summary-report.js +25 -28
  49. package/client/route.js +5 -0
  50. package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-report.js +1 -1
  51. package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-report.js.map +1 -1
  52. package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-summary-report.js +1 -1
  53. package/dist-server/graphql/resolvers/index.js +3 -1
  54. package/dist-server/graphql/resolvers/index.js.map +1 -1
  55. package/dist-server/graphql/resolvers/shipping-provider/index.js +6 -0
  56. package/dist-server/graphql/resolvers/shipping-provider/index.js.map +1 -0
  57. package/dist-server/graphql/resolvers/shipping-provider/shipping-providers.js +20 -0
  58. package/dist-server/graphql/resolvers/shipping-provider/shipping-providers.js.map +1 -0
  59. package/dist-server/graphql/types/custom/elccl/elccl-inventory-report.js +1 -1
  60. package/dist-server/graphql/types/index.js +5 -2
  61. package/dist-server/graphql/types/index.js.map +1 -1
  62. package/dist-server/graphql/types/shipping-provider/index.js +10 -0
  63. package/dist-server/graphql/types/shipping-provider/index.js.map +1 -0
  64. package/dist-server/graphql/types/shipping-provider/shipping-provider-list.js +13 -0
  65. package/dist-server/graphql/types/shipping-provider/shipping-provider-list.js.map +1 -0
  66. package/dist-server/graphql/types/shipping-provider/shipping-provider.js +13 -0
  67. package/dist-server/graphql/types/shipping-provider/shipping-provider.js.map +1 -0
  68. package/package.json +37 -37
  69. package/server/graphql/resolvers/custom/elccl/elccl-inventory-history-report.ts +4 -2
  70. package/server/graphql/resolvers/custom/elccl/elccl-inventory-history-summary-report.ts +1 -1
  71. package/server/graphql/resolvers/index.ts +3 -1
  72. package/server/graphql/resolvers/shipping-provider/index.ts +5 -0
  73. package/server/graphql/resolvers/shipping-provider/shipping-providers.ts +20 -0
  74. package/server/graphql/types/custom/elccl/elccl-inventory-report.ts +1 -1
  75. package/server/graphql/types/index.ts +5 -2
  76. package/server/graphql/types/shipping-provider/index.ts +8 -0
  77. package/server/graphql/types/shipping-provider/shipping-provider-list.ts +7 -0
  78. package/server/graphql/types/shipping-provider/shipping-provider.ts +7 -0
  79. package/things-factory.config.js +6 -0
  80. package/translations/en.json +27 -0
  81. package/translations/ko.json +84 -36
  82. package/translations/ms.json +85 -37
  83. package/translations/zh.json +98 -51
@@ -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
  }
@@ -896,7 +896,7 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
896
896
  async fetchPalletsHandler(releaseGoodNo) {
897
897
  const response = await client.query({
898
898
  query: gql`
899
- query pallets($filters: [Filter], $pagination: Pagination) {
899
+ query pallets($filters: [Filter!]!, $pagination: Pagination) {
900
900
  pallets(filters: $filters, pagination: $pagination) {
901
901
  items {
902
902
  id
@@ -1008,9 +1008,10 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1008
1008
  this.isReplacement = false
1009
1009
  } catch (e) {
1010
1010
  this._showToast(e)
1011
- } finally {
1012
- this._isExecuting = false
1013
1011
  }
1012
+ // finally {
1013
+ // this._isExecuting = false
1014
+ // }
1014
1015
  }
1015
1016
  }
1016
1017
 
@@ -1098,180 +1099,214 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1098
1099
  }
1099
1100
 
1100
1101
  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
- })
1102
+ if (this._isExecuting === false) {
1103
+ this._isExecuting = true
1122
1104
 
1123
- if (!relocateConfirmation.isConfirmed) {
1124
- this._incompleteLocationName = false
1125
- this.locationNameSplit = []
1126
- return false
1127
- }
1128
- }
1129
- }
1105
+ try {
1106
+ const locationName =
1107
+ this.isWholePicking || !this.locationInput
1108
+ ? this._selectedOrderInventory.location.name
1109
+ : this.locationInput.value
1110
+ // 1. Check whether location is changed
1111
+ if (this._selectedOrderInventory.location.name !== locationName) {
1112
+ this.locationNameSplit = this.locationInput.value.split('-')
1113
+ const zonePortions = this.locationNameSplit[0].match(/[a-zA-Z0-9]+/g)
1114
+ const rowPortions = this.locationNameSplit[1].match(/[a-zA-Z0-9]+/g)
1115
+ const columnPortions = this.locationNameSplit[2].match(/[a-zA-Z0-9]+/g)
1116
+
1117
+ if (this.locationNameSplit.length === 3) {
1118
+ this._incompleteLocationName = true
1119
+ this.locations = await this.fetchLocations(zonePortions[0], rowPortions[0], columnPortions[0])
1120
+ this._focusOnNewLocationInput()
1121
+ throw new Error(i18next.t('text.please_select_the_location_again'))
1122
+ } else if (this.locationNameSplit.length === 4) {
1123
+ let relocateConfirmation = await CustomAlert({
1124
+ title: i18next.t('title.relocate'),
1125
+ text: i18next.t('text.are_you_sure'),
1126
+ confirmButton: { text: i18next.t('button.relocate') },
1127
+ cancelButton: { text: i18next.t('button.cancel') }
1128
+ })
1130
1129
 
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
- )
1130
+ if (!relocateConfirmation.isConfirmed) {
1131
+ this._incompleteLocationName = false
1132
+ this.locationNameSplit = []
1133
+ return false
1153
1134
  }
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
1135
  }
1164
- })
1136
+ }
1165
1137
 
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
- })
1138
+ switch (this.refPickingType) {
1139
+ case PICKING_TYPES.PICKING.value:
1140
+ return (
1141
+ await client.mutate({
1142
+ mutation: gql`
1143
+ mutation picking(
1144
+ $worksheetDetailName: String!
1145
+ $worksheetType: String!
1146
+ $palletId: String
1147
+ $locationName: String!
1148
+ $releaseQty: Int!
1149
+ $binLocation: String
1150
+ $serialNumber: String
1151
+ ) {
1152
+ picking(
1153
+ worksheetDetailName: $worksheetDetailName
1154
+ worksheetType: $worksheetType
1155
+ palletId: $palletId
1156
+ locationName: $locationName
1157
+ releaseQty: $releaseQty
1158
+ binLocation: $binLocation
1159
+ serialNumber: $serialNumber
1160
+ )
1161
+ }
1162
+ `,
1163
+ variables: {
1164
+ worksheetDetailName: this._selectedOrderInventory.name,
1165
+ worksheetType: this.refPickingType,
1166
+ palletId: this.palletInput.value.trim(),
1167
+ locationName,
1168
+ releaseQty: this._isRequireSerialNumberScanning ? 1 : parseInt(this.releaseQtyInput.value),
1169
+ binLocation: this._hasBinPicking ? this.binLocationInput.value : null,
1170
+ serialNumber: this._isRequireSerialNumberScanning ? this.serialInput.value : null
1171
+ }
1172
+ }),
1173
+ (this._isExecuting = false)
1174
+ )
1175
+
1176
+ case PICKING_TYPES.BATCH_PICKING.value:
1177
+ return (
1178
+ await client.mutate({
1179
+ mutation: gql`
1180
+ mutation batchPicking(
1181
+ $taskNo: String!
1182
+ $worksheetType: String!
1183
+ $palletId: String!
1184
+ $locationName: String
1185
+ $binLocationName: String
1186
+ $releaseQty: Int!
1187
+ ) {
1188
+ batchPicking(
1189
+ taskNo: $taskNo
1190
+ worksheetType: $worksheetType
1191
+ palletId: $palletId
1192
+ locationName: $locationName
1193
+ binLocationName: $binLocationName
1194
+ releaseQty: $releaseQty
1195
+ )
1196
+ }
1197
+ `,
1198
+ variables: {
1199
+ taskNo: this.taskNo,
1200
+ worksheetType: this.refPickingType,
1201
+ palletId: this.palletInput.value.trim(),
1202
+ locationName,
1203
+ binLocationName: this._hasBinPicking ? this.binLocationInput.value : null,
1204
+ releaseQty: parseInt(this.releaseQtyInput.value)
1205
+ }
1206
+ }),
1207
+ (this._isExecuting = false)
1208
+ )
1209
+ }
1210
+ } catch (e) {
1211
+ this._showToast(e)
1212
+ }
1213
+ } else {
1214
+ throw new Error(i18next.t('text.previous_picking_is_still_executing_please_wait'))
1196
1215
  }
1197
1216
  }
1198
1217
 
1199
1218
  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
- })
1219
+ if (this._isExecuting === false) {
1220
+ this._isExecuting = true
1231
1221
 
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
- })
1222
+ try {
1223
+ switch (this.refPickingType) {
1224
+ case PICKING_TYPES.PICKING.value:
1225
+ return (
1226
+ await client.mutate({
1227
+ mutation: gql`
1228
+ mutation scanProductPicking(
1229
+ $worksheetDetailName: String!
1230
+ $worksheetType: String!
1231
+ $productBarcode: String!
1232
+ $cartonId: String!
1233
+ $binLocation: String
1234
+ $serialNumber: String
1235
+ ) {
1236
+ scanProductPicking(
1237
+ worksheetDetailName: $worksheetDetailName
1238
+ worksheetType: $worksheetType
1239
+ productBarcode: $productBarcode
1240
+ cartonId: $cartonId
1241
+ binLocation: $binLocation
1242
+ serialNumber: $serialNumber
1243
+ )
1244
+ }
1245
+ `,
1246
+ variables: {
1247
+ worksheetDetailName: this._selectedOrderInventory.name,
1248
+ worksheetType: this.refPickingType,
1249
+ productBarcode: this.productBarcodeInput.value.trim(),
1250
+ cartonId: this.cartonInput.value.trim(),
1251
+ serialNumber: this._isRequireSerialNumberScanning ? this.serialInput.value : null,
1252
+ binLocation: this._hasBinPicking ? this.binLocationInput.value : null
1253
+ }
1254
+ }),
1255
+ (this._isExecuting = false)
1256
+ )
1257
+
1258
+ case PICKING_TYPES.BATCH_PICKING.value:
1259
+ return (
1260
+ await client.mutate({
1261
+ mutation: gql`
1262
+ mutation scanProductBatchPicking(
1263
+ $taskNo: String!
1264
+ $worksheetType: String!
1265
+ $cartonId: String!
1266
+ $inventory: InventoryPatch!
1267
+ $productBarcode: String!
1268
+ $binLocationName: String
1269
+ ) {
1270
+ scanProductBatchPicking(
1271
+ taskNo: $taskNo
1272
+ worksheetType: $worksheetType
1273
+ cartonId: $cartonId
1274
+ inventory: $inventory
1275
+ productBarcode: $productBarcode
1276
+ binLocationName: $binLocationName
1277
+ )
1278
+ }
1279
+ `,
1280
+ variables: {
1281
+ taskNo: this.taskNo,
1282
+ worksheetType: this.refPickingType,
1283
+ cartonId: this.cartonInput.value.trim(),
1284
+ productBarcode: this.productBarcodeInput.value.trim(),
1285
+ inventory: {
1286
+ batchId: this._selectedOrderInventory.batchId,
1287
+ packingType: this._selectedOrderInventory.packingType,
1288
+ packingSize: this._selectedOrderInventory.packingSize,
1289
+ product: { id: this._selectedOrderInventory.product.id }
1290
+ },
1291
+ binLocationName: this._hasBinPicking ? this.binLocationInput.value : null
1292
+ }
1293
+ }),
1294
+ (this._isExecuting = false)
1295
+ )
1296
+ }
1297
+ } catch (e) {
1298
+ this._showToast(e)
1299
+ }
1300
+ } else {
1301
+ throw new Error(i18next.t('text.previous_picking_is_still_executing_please_wait'))
1267
1302
  }
1268
1303
  }
1269
1304
 
1270
1305
  async validatePicking() {
1271
1306
  // 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'))
1307
+ // if (this._isExecuting) throw new Error(i18next.t('text.previous_picking_is_still_executing_please_wait'))
1273
1308
 
1274
- this._isExecuting = true
1309
+ // this._isExecuting = true
1275
1310
 
1276
1311
  // validate for order selection
1277
1312
  if (!this._selectedOrderInventory) throw new Error(i18next.t('text.target_is_not_selected'))
@@ -1309,7 +1344,12 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1309
1344
  if (!this.releaseQtyInput.checkValidity()) throw new Error(i18next.t('text.release_qty_invalid'))
1310
1345
 
1311
1346
  // typed qty should be matched with release qty.
1312
- if (parseInt(this.releaseQtyInput.value) !== this._selectedOrderInventory.releaseQty) {
1347
+
1348
+ if (
1349
+ parseInt(this.releaseQtyInput.value) !==
1350
+ this._selectedOrderInventory.releaseQty -
1351
+ (this._selectedOrderInventory.pickedQty ? this._selectedOrderInventory.pickedQty : 0)
1352
+ ) {
1313
1353
  this._focusOnReleaseQtyInput()
1314
1354
  throw new Error(i18next.t('text.wrong_release_qty'))
1315
1355
  }
@@ -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(
@@ -214,6 +214,12 @@ class SingleOutboundWorksheet extends localize(i18next)(PageView) {
214
214
  type: 'object',
215
215
  name: 'releaseGood',
216
216
  header: i18next.t('field.release_good_no'),
217
+ imex: {
218
+ header: i18next.t('field.release_good_no'),
219
+ key: 'releaseGood.name',
220
+ width: 30,
221
+ type: 'string'
222
+ },
217
223
  sortable: true,
218
224
  width: 150
219
225
  },
@@ -221,6 +227,7 @@ class SingleOutboundWorksheet extends localize(i18next)(PageView) {
221
227
  type: 'string',
222
228
  name: 'releaseRefNo',
223
229
  header: i18next.t('field.ref_no'),
230
+ imex: { header: i18next.t('field.ref_no'), key: 'releaseRefNo', width: 30, type: 'array' },
224
231
  sortable: true,
225
232
  width: 180
226
233
  },
@@ -228,24 +235,28 @@ class SingleOutboundWorksheet extends localize(i18next)(PageView) {
228
235
  type: 'boolean',
229
236
  name: 'crossDocking',
230
237
  header: i18next.t('field.cross_docking'),
238
+ imex: { header: i18next.t('field.cross_docking'), key: 'crossDocking', width: 20, type: 'string' },
231
239
  width: 100
232
240
  },
233
241
  {
234
242
  type: 'boolean',
235
243
  name: 'courierOption',
236
244
  header: i18next.t('field.courier'),
245
+ imex: { header: i18next.t('field.courier'), key: 'courierOption', width: 20, type: 'string' },
237
246
  width: 60
238
247
  },
239
248
  {
240
249
  type: 'boolean',
241
250
  name: 'packingOption',
242
251
  header: i18next.t('field.packing'),
252
+ imex: { header: i18next.t('field.packing'), key: 'packingOption', width: 20, type: 'string' },
243
253
  width: 60
244
254
  },
245
255
  {
246
256
  type: 'object',
247
257
  name: 'bizplace',
248
258
  header: i18next.t('field.company'),
259
+ imex: { header: i18next.t('field.company'), key: 'bizplace.name', width: 20, type: 'string' },
249
260
  sortable: true,
250
261
  width: 240
251
262
  },
@@ -253,6 +264,7 @@ class SingleOutboundWorksheet extends localize(i18next)(PageView) {
253
264
  type: 'string',
254
265
  name: 'type',
255
266
  header: i18next.t('field.type'),
267
+ imex: { header: i18next.t('field.type'), key: 'type', width: 20, type: 'string' },
256
268
  sortable: true,
257
269
  width: 100
258
270
  },
@@ -260,6 +272,7 @@ class SingleOutboundWorksheet extends localize(i18next)(PageView) {
260
272
  type: 'string',
261
273
  name: 'status',
262
274
  header: i18next.t('field.status'),
275
+ imex: { header: i18next.t('field.status'), key: 'status', width: 20, type: 'string' },
263
276
  sortable: true,
264
277
  width: 100
265
278
  },
@@ -267,6 +280,7 @@ class SingleOutboundWorksheet extends localize(i18next)(PageView) {
267
280
  type: 'datetime',
268
281
  name: 'createdAt',
269
282
  header: i18next.t('field.created_at'),
283
+ imex: { header: i18next.t('field.created_at'), key: 'createdAt', width: 20, type: 'string' },
270
284
  sortable: true,
271
285
  width: 200
272
286
  },
@@ -274,6 +288,7 @@ class SingleOutboundWorksheet extends localize(i18next)(PageView) {
274
288
  type: 'datetime',
275
289
  name: 'startedAt',
276
290
  header: i18next.t('field.started_at'),
291
+ imex: { header: i18next.t('field.started_at'), key: 'startedAt', width: 30, type: 'string' },
277
292
  sortable: true,
278
293
  width: 160
279
294
  },
@@ -281,6 +296,7 @@ class SingleOutboundWorksheet extends localize(i18next)(PageView) {
281
296
  type: 'datetime',
282
297
  name: 'endedAt',
283
298
  header: i18next.t('field.ended_at'),
299
+ imex: { header: i18next.t('field.ended_at'), key: 'endedAt', width: 30, type: 'string' },
284
300
  sortable: true,
285
301
  width: 160
286
302
  },
@@ -288,6 +304,7 @@ class SingleOutboundWorksheet extends localize(i18next)(PageView) {
288
304
  type: 'object',
289
305
  name: 'updater',
290
306
  header: i18next.t('field.updater'),
307
+ imex: { header: i18next.t('field.updater'), key: 'updater.name', width: 30, type: 'string' },
291
308
  sortable: true,
292
309
  width: 150
293
310
  }
@@ -446,7 +463,36 @@ class SingleOutboundWorksheet extends localize(i18next)(PageView) {
446
463
  }
447
464
 
448
465
  _exportableData() {
449
- return this.dataGrist.exportRecords()
466
+ let records = []
467
+ if (this.dataGrist.selected && this.dataGrist.selected.length > 0) {
468
+ records = this.dataGrist.selected
469
+ } else {
470
+ records = this.dataGrist.data.records
471
+ }
472
+
473
+ var headerSetting = this.dataGrist._config.columns
474
+ .filter(column => column.type !== 'gutter' /* && column.record !== undefined */ && column.imex !== undefined)
475
+ .map(column => {
476
+ return column.imex
477
+ })
478
+
479
+ var data = records.map(item => {
480
+ return {
481
+ id: item.id,
482
+ ...this._columns
483
+ .filter(column => column.type !== 'gutter' /* && column.record !== undefined */ && column.imex !== undefined)
484
+ .reduce((record, column) => {
485
+ record[column.imex.key] = column.imex.key
486
+ .split('.')
487
+ .reduce((obj, key) => (obj && obj[key] !== 'undefined' ? obj[key] : undefined), item)
488
+ if (record[column.imex.key] === 'Invalid Date') {
489
+ record[column.imex.key] = ''
490
+ }
491
+ return record
492
+ }, {})
493
+ }
494
+ })
495
+ return { header: headerSetting, data: data }
450
496
  }
451
497
 
452
498
  navigatePickingRelatedPages(record) {
@@ -21,6 +21,7 @@ class WorksheetLoading extends localize(i18next)(PageView) {
21
21
  return {
22
22
  _worksheetNo: String,
23
23
  _worksheetStatus: String,
24
+ _statusList: Array,
24
25
  vasData: Object,
25
26
  vasGristConfig: Object,
26
27
  _roNo: String,
@@ -133,11 +134,12 @@ class WorksheetLoading extends localize(i18next)(PageView) {
133
134
  <label for="ownCollection">${i18next.t('label.own_collection')}</label>
134
135
 
135
136
  <label>${i18next.t('label.status')}</label>
136
- <select name="status" disabled>
137
- ${Object.keys(WORKSHEET_STATUS).map(
138
- key => html` <option value="${WORKSHEET_STATUS[key].value}">${WORKSHEET_STATUS[key].name}</option> `
139
- )}
140
- </select>
137
+ <input
138
+ name="status"
139
+ value="${this._statusList.find(x => x.value == this._worksheetStatus)?.display || ''}"
140
+ readonly
141
+ disabled
142
+ />
141
143
  </fieldset>
142
144
  </form>
143
145
 
@@ -169,6 +171,13 @@ class WorksheetLoading extends localize(i18next)(PageView) {
169
171
  `
170
172
  }
171
173
 
174
+ constructor() {
175
+ super()
176
+ this._statusList = Object.keys(WORKSHEET_STATUS).map(key => {
177
+ return { value: WORKSHEET_STATUS[key].value, display: WORKSHEET_STATUS[key].name }
178
+ })
179
+ }
180
+
172
181
  async pageUpdated(changes) {
173
182
  if (this.active && (changes.resourceId || this._worksheetNo)) {
174
183
  if (changes.resourceId) {