@things-factory/operato-wms 4.1.38 → 4.2.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 (70) 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/serial-number-list-popup.js +468 -0
  11. package/client/pages/master/pallet-list.js +24 -0
  12. package/client/pages/order/arrival-notice/edit-product-popup.js +13 -0
  13. package/client/pages/order/release-order/b2b/b2b-order-list.js +24 -1
  14. package/client/pages/order/release-order/batch-picking-popup.js +8 -0
  15. package/client/pages/outbound/inventory-assign-popup.js +3 -24
  16. package/client/pages/outbound/inventory-auto-assign-popup.js +25 -50
  17. package/client/pages/outbound/loading-product.js +3 -3
  18. package/client/pages/outbound/merged-outbound-worksheet.js +148 -3
  19. package/client/pages/outbound/packing-product.js +109 -9
  20. package/client/pages/outbound/picking-product.js +21 -8
  21. package/client/pages/outbound/picking-replacement-popup.js +5 -0
  22. package/client/pages/outbound/return-pallet-check-popup.js +7 -1
  23. package/client/pages/outbound/route-label-popup.js +464 -0
  24. package/client/pages/outbound/select-operator-popup.js +3 -3
  25. package/client/pages/outbound/serial-number-popup.js +55 -26
  26. package/client/pages/outbound/single-outbound-worksheet.js +154 -5
  27. package/client/pages/outbound/sorting-product.js +125 -34
  28. package/client/pages/outbound/worksheet-batch-picking.js +13 -17
  29. package/client/pages/outbound/worksheet-picking.js +4 -8
  30. package/cypress/fixtures/globals.json +3 -0
  31. package/cypress/fixtures/master-data/location.json +31 -0
  32. package/cypress/fixtures/master-data/pallet.json +129 -0
  33. package/cypress/fixtures/master-data/palletImport.xlsx +0 -0
  34. package/cypress/fixtures/master-data/transport-driver.json +22 -0
  35. package/cypress/fixtures/master-data/transport-vehicle.json +24 -0
  36. package/cypress/fixtures/master-data/transportDriverDeletedImport.xlsx +0 -0
  37. package/cypress/fixtures/master-data/transportDriverImport.xlsx +0 -0
  38. package/cypress/fixtures/master-data/transportVehicleDeletedImport.xlsx +0 -0
  39. package/cypress/fixtures/master-data/transportVehicleImport.xlsx +0 -0
  40. package/cypress/fixtures/master-data/transportVehicleNameSizeImport.xlsx +0 -0
  41. package/cypress/fixtures/master-data/transportVehicleNameStatusImport.xlsx +0 -0
  42. package/cypress/fixtures/master-data/warehouse.json +20 -0
  43. package/cypress/fixtures/master-data/warehouseImport.xlsx +0 -0
  44. package/cypress/integration/master-data/location.spec.js +31 -0
  45. package/cypress/integration/master-data/pallet.spec.js +176 -0
  46. package/cypress/integration/master-data/transport-driver.spec.js +131 -0
  47. package/cypress/integration/master-data/transport-vehicle.spec.js +165 -0
  48. package/cypress/integration/master-data/warehouse.spec.js +135 -0
  49. package/cypress/plugins/index.js +22 -0
  50. package/cypress/support/commands.js +425 -0
  51. package/cypress/support/index.js +31 -0
  52. package/cypress.json +9 -0
  53. package/dist-server/graphql/resolvers/board-setting/board-settings.js +2 -1
  54. package/dist-server/graphql/resolvers/board-setting/board-settings.js.map +1 -1
  55. package/dist-server/graphql/resolvers/dashboard/outbound-order-by-status.js +7 -10
  56. package/dist-server/graphql/resolvers/dashboard/outbound-order-by-status.js.map +1 -1
  57. package/dist-server/opa-app-setting-constants.js +2 -1
  58. package/dist-server/opa-app-setting-constants.js.map +1 -1
  59. package/helps/release-note.ko.md +0 -2
  60. package/helps/release-note.md +0 -2
  61. package/helps/release-note.ms.md +0 -2
  62. package/helps/release-note.zh.md +0 -2
  63. package/package.json +61 -51
  64. package/server/graphql/resolvers/board-setting/board-settings.ts +4 -2
  65. package/server/graphql/resolvers/dashboard/outbound-order-by-status.ts +7 -10
  66. package/server/opa-app-setting-constants.ts +2 -1
  67. package/translations/en.json +15 -4
  68. package/translations/ko.json +12 -2
  69. package/translations/ms.json +11 -2
  70. package/translations/zh.json +11 -2
@@ -1,14 +1,19 @@
1
1
  import '@things-factory/form-ui'
2
2
  import '@things-factory/grist-ui'
3
+ import './route-label-popup'
3
4
 
4
5
  import gql from 'graphql-tag'
5
6
  import { css, html } from 'lit-element'
6
7
 
8
+ import './select-operator-popup'
7
9
  import { getCodeByName } from '@things-factory/code-base'
8
10
  import { i18next, localize } from '@things-factory/i18n-base'
9
11
  import { client, navigate, PageView } from '@things-factory/shell'
10
- import { ScrollbarStyles } from '@things-factory/styles'
12
+ import { ScrollbarStyles, CommonButtonStyles } from '@things-factory/styles'
11
13
  import { isMobileDevice } from '@things-factory/utils'
14
+ import { openPopup } from '@things-factory/layout-base'
15
+
16
+ import { fetchSettingRule } from '../../fetch-setting-value'
12
17
 
13
18
  import { WORKSHEET_STATUS, WORKSHEET_TYPE } from '../constants'
14
19
 
@@ -36,10 +41,13 @@ class SingleOutboundWorksheet extends localize(i18next)(PageView) {
36
41
 
37
42
  static get properties() {
38
43
  return {
44
+ _partnersList: Array,
39
45
  _searchFields: Array,
46
+ _routeLabelSetting: Boolean,
47
+ assignee: String,
40
48
  config: Object,
41
49
  data: Object,
42
-
50
+ targetBizplace: Object,
43
51
  assignee: String,
44
52
  status: String
45
53
  }
@@ -58,13 +66,31 @@ class SingleOutboundWorksheet extends localize(i18next)(PageView) {
58
66
  }
59
67
 
60
68
  get context() {
69
+ var actions = []
70
+
71
+ if (this._routeLabelSetting) {
72
+ actions.push({
73
+ title: i18next.t('button.print_route_label'),
74
+ action: this._openPrintLabelPopup.bind(this),
75
+ ...CommonButtonStyles.label
76
+ })
77
+ }
78
+
61
79
  return {
62
80
  title: i18next.t('title.outbound_worksheet'),
81
+ actions: [
82
+ {
83
+ title: i18next.t('button.assign_picker'),
84
+ action: this._assignPicker.bind(this),
85
+ ...CommonButtonStyles.activate
86
+ }
87
+ ],
63
88
  exportable: {
64
89
  name: i18next.t('title.outbound_worksheet'),
65
90
  data: this._exportableData.bind(this)
66
91
  },
67
- help: 'operato-wms/outbound/single-outbound-worksheet'
92
+ help: 'operato-wms/outbound/single-outbound-worksheet',
93
+ actions
68
94
  }
69
95
  }
70
96
 
@@ -186,10 +212,11 @@ class SingleOutboundWorksheet extends localize(i18next)(PageView) {
186
212
  list: {
187
213
  fields: ['releaseGood', 'bizplace', 'type', 'releaseRefNo', 'status', 'startedAt', 'endedAt']
188
214
  },
189
- rows: { appendable: false },
215
+ rows: { selectable: { multiple: true }, appendable: false },
190
216
  pagination: { limit: 100, pages: [20, 50, 100, 200, 500] },
191
217
  columns: [
192
218
  { type: 'gutter', gutterName: 'sequence' },
219
+ { type: 'gutter', gutterName: 'row-selector', multiple: true },
193
220
  {
194
221
  type: 'gutter',
195
222
  gutterName: 'button',
@@ -276,6 +303,14 @@ class SingleOutboundWorksheet extends localize(i18next)(PageView) {
276
303
  sortable: true,
277
304
  width: 100
278
305
  },
306
+ {
307
+ type: 'object',
308
+ name: 'assignee',
309
+ header: i18next.t('field.assigned_picker'),
310
+ imex: { header: i18next.t('field.assigned_picker'), key: 'assignee.name', width: 20, type: 'string' },
311
+ sortable: true,
312
+ width: 100
313
+ },
279
314
  {
280
315
  type: 'datetime',
281
316
  name: 'createdAt',
@@ -351,6 +386,10 @@ class SingleOutboundWorksheet extends localize(i18next)(PageView) {
351
386
  items {
352
387
  id
353
388
  name
389
+ assignee {
390
+ id
391
+ name
392
+ }
354
393
  releaseGood {
355
394
  id
356
395
  name
@@ -375,6 +414,10 @@ class SingleOutboundWorksheet extends localize(i18next)(PageView) {
375
414
  name
376
415
  description
377
416
  }
417
+ domain {
418
+ id
419
+ name
420
+ }
378
421
  }
379
422
  total
380
423
  }
@@ -388,6 +431,9 @@ class SingleOutboundWorksheet extends localize(i18next)(PageView) {
388
431
  })
389
432
 
390
433
  if (!response.errors) {
434
+ let domain = response.data.worksheets.items[0].domain
435
+ this._routeLabelSetting = await fetchSettingRule('enable-print-route-label', domain.id)
436
+ this.updateContext()
391
437
  return {
392
438
  total: response.data.worksheets.total || 0,
393
439
  records:
@@ -418,18 +464,70 @@ class SingleOutboundWorksheet extends localize(i18next)(PageView) {
418
464
  id
419
465
  name
420
466
  description
467
+ domain {
468
+ id
469
+ name
470
+ }
421
471
  }
422
472
  }
423
473
  }
424
474
  `,
425
475
  variables: { filters }
426
476
  })
427
-
477
+ this.targetBizplace = response.data.partnersBizplaces || {}
428
478
  if (!response.errors) {
479
+ this._partnersList = response.data.partnersBizplaces
429
480
  return response.data.partnersBizplaces.items
430
481
  }
431
482
  }
432
483
 
484
+ _assignPicker() {
485
+ try {
486
+ let selectedData = this.dataGrist.selected.filter(item => {
487
+ return item.status == 'DEACTIVATED'
488
+ })
489
+
490
+ if (selectedData.length <= 0) throw new Error('No available worksheet selected')
491
+
492
+ openPopup(
493
+ html`
494
+ <select-operator-popup
495
+ @updateOperator="${async e => {
496
+ let assignee = e.detail
497
+
498
+ const response = await client.mutate({
499
+ mutation: gql`
500
+ mutation assignPickingWorker($worksheetId: [String]!, $userId: String!) {
501
+ assignPickingWorker(worksheetId: $worksheetId, userId: $userId)
502
+ }
503
+ `,
504
+ variables: { worksheetId: selectedData.map(itm => itm.id), userId: assignee.id }
505
+ })
506
+
507
+ if (!response.errors) {
508
+ this.dataGrist.fetch()
509
+ return this._showToast({ message: i18next.t('text.updated_successfully') })
510
+ }
511
+
512
+ if (this.activatable) {
513
+ if (this.orderNo) {
514
+ history.back()
515
+ }
516
+ }
517
+ }}"
518
+ ></select-operator-popup>
519
+ `,
520
+ {
521
+ backdrop: true,
522
+ size: 'medium',
523
+ title: 'select operator'
524
+ }
525
+ )
526
+ } catch (error) {
527
+ return this._showToast(error)
528
+ }
529
+ }
530
+
433
531
  _modifyDateRange(e) {
434
532
  const fromDate = e.currentTarget.value
435
533
 
@@ -463,6 +561,35 @@ class SingleOutboundWorksheet extends localize(i18next)(PageView) {
463
561
  }
464
562
  }
465
563
 
564
+ async _openPrintLabelPopup() {
565
+ try {
566
+ const bizplaceFilters = (await this.searchForm.getQueryFilters()).find(x => x.name === 'bizplaceId')
567
+ if (!bizplaceFilters) {
568
+ throw new Error(`Please select a customer to print route label.`)
569
+ } else {
570
+ let selectedPartnerDomain = this._partnersList.items.find(itm => itm.id == bizplaceFilters.value)
571
+ let partnerRouteLabelSetting = await fetchSettingRule(
572
+ 'enable-print-route-label',
573
+ selectedPartnerDomain.domain.id
574
+ )
575
+ if (partnerRouteLabelSetting == false) throw new Error(`Partner setting not found`)
576
+ }
577
+
578
+ openPopup(
579
+ html`
580
+ <route-label-popup .partnerId="${bizplaceFilters.value}" .worksheetType="${'single'}"></route-label-popup>
581
+ `,
582
+ {
583
+ backdrop: true,
584
+ size: 'large',
585
+ title: i18next.t('title.print_route_label')
586
+ }
587
+ )
588
+ } catch (e) {
589
+ this._showToast(e)
590
+ }
591
+ }
592
+
466
593
  _exportableData() {
467
594
  let records = []
468
595
  if (this.dataGrist.selected && this.dataGrist.selected.length > 0) {
@@ -496,6 +623,17 @@ class SingleOutboundWorksheet extends localize(i18next)(PageView) {
496
623
  return { header: headerSetting, data: data }
497
624
  }
498
625
 
626
+ _showToast({ type, message }) {
627
+ document.dispatchEvent(
628
+ new CustomEvent('notify', {
629
+ detail: {
630
+ type,
631
+ message
632
+ }
633
+ })
634
+ )
635
+ }
636
+
499
637
  navigatePickingRelatedPages(record) {
500
638
  if (this.assigneeId) {
501
639
  const searchParams = new URLSearchParams()
@@ -509,6 +647,17 @@ class SingleOutboundWorksheet extends localize(i18next)(PageView) {
509
647
  navigate(`worksheet_picking/${record.name}`)
510
648
  }
511
649
  }
650
+
651
+ _showToast({ type, message }) {
652
+ document.dispatchEvent(
653
+ new CustomEvent('notify', {
654
+ detail: {
655
+ type,
656
+ message
657
+ }
658
+ })
659
+ )
660
+ }
512
661
  }
513
662
 
514
663
  window.customElements.define('single-outbound-worksheet', SingleOutboundWorksheet)
@@ -20,7 +20,6 @@ import { WORKSHEET_STATUS } from '../constants'
20
20
  class SortingProduct extends connect(store)(localize(i18next)(PageView)) {
21
21
  static get properties() {
22
22
  return {
23
- _bizplaceName: String,
24
23
  _enableProductScanning: Boolean,
25
24
  _selectedOrderInventory: Object,
26
25
  _selectedTaskStatus: String,
@@ -129,6 +128,10 @@ class SortingProduct extends connect(store)(localize(i18next)(PageView)) {
129
128
  return this.shadowRoot.querySelector('barcode-scanable-input[name=taskNo]').shadowRoot.querySelector('input')
130
129
  }
131
130
 
131
+ get serialInput() {
132
+ return this.shadowRoot.querySelector('barcode-scanable-input[name=serialNumber]')?.shadowRoot.querySelector('input')
133
+ }
134
+
132
135
  _focusOnTaskNoInput() {
133
136
  setTimeout(() => this.taskNoInput.focus(), 100)
134
137
  }
@@ -141,6 +144,12 @@ class SortingProduct extends connect(store)(localize(i18next)(PageView)) {
141
144
  setTimeout(() => this.sortingQtyInput.focus(), 100)
142
145
  }
143
146
 
147
+ _focusOnSerialInput() {
148
+ if (this.serialInput) {
149
+ setTimeout(() => this.serialInput.focus(), 50)
150
+ }
151
+ }
152
+
144
153
  render() {
145
154
  return html`
146
155
  <form class="multi-column-form">
@@ -169,9 +178,19 @@ class SortingProduct extends connect(store)(localize(i18next)(PageView)) {
169
178
  <barcode-scanable-input name="productBarcode" custom-input></barcode-scanable-input>
170
179
  `
171
180
  : html`
172
- <label>${i18next.t('label.enter_picked_qty')}</label>
173
- <input type="number" min="1" name="sortingQty" />
181
+ ${this._isRequireSerialNumberScanningOutbound
182
+ ? ''
183
+ : html`
184
+ <label>${i18next.t('label.enter_picked_qty')}</label>
185
+ <input type="number" min="1" name="sortingQty" />
186
+ `}
174
187
  `}
188
+ ${this._isRequireSerialNumberScanningOutbound
189
+ ? html`
190
+ <label>${i18next.t('label.serial_number')}</label>
191
+ <barcode-scanable-input name="serialNumber" custom-input></barcode-scanable-input>
192
+ `
193
+ : ``}
175
194
  </fieldset>
176
195
  </form>
177
196
 
@@ -182,7 +201,7 @@ class SortingProduct extends connect(store)(localize(i18next)(PageView)) {
182
201
  <legend>
183
202
  ${i18next.t('title.order_no')}: ${this.taskNo}
184
203
  ${this.taskNo
185
- ? html`(${this._bizplaceName})
204
+ ? html`(${this._selectedReleaseGood?.name})
186
205
  <mwc-icon @click="${this._openWorksheetInformation.bind(this)}">info</mwc-icon>`
187
206
  : ''}
188
207
  </legend>
@@ -197,6 +216,7 @@ class SortingProduct extends connect(store)(localize(i18next)(PageView)) {
197
216
  super()
198
217
  this.data = { records: [] }
199
218
  this.taskNo = ''
219
+ this._isRequireSerialNumberScanningOutbound = false
200
220
  this._enableProductScanning = false
201
221
  this._selectedOrderInventory = null
202
222
  this._selectedTaskStatus = null
@@ -223,17 +243,30 @@ class SortingProduct extends connect(store)(localize(i18next)(PageView)) {
223
243
  if (data.records.length && record) {
224
244
  this._selectedOrderInventory = record
225
245
  this._selectedTaskStatus = record.status
246
+ this._isRequireSerialNumberScanningOutbound = record.isRequireSerialNumberScanningOutbound
226
247
 
227
248
  if (this.scannable) {
228
249
  if (this._enableProductScanning) this._focusOnProductBarcodeInput()
229
250
  }
251
+
252
+ this.updateContext()
230
253
  }
231
254
  }
232
255
  }
233
256
  },
234
257
  pagination: { infinite: true },
235
258
  list: {
236
- fields: ['completed', 'sku', 'product', 'batchId', 'packingType', 'packingSize', 'expirationDate', 'progress']
259
+ fields: [
260
+ 'completed',
261
+ 'sku',
262
+ 'product',
263
+ 'batchId',
264
+ 'packingType',
265
+ 'packingSize',
266
+ 'expirationDate',
267
+ 'progress',
268
+ 'binRemarks'
269
+ ]
237
270
  },
238
271
  columns: [
239
272
  { type: 'gutter', gutterName: 'sequence' },
@@ -291,6 +324,13 @@ class SortingProduct extends connect(store)(localize(i18next)(PageView)) {
291
324
  header: i18next.t('field.progress'),
292
325
  label: true,
293
326
  width: 120
327
+ },
328
+ {
329
+ type: 'string',
330
+ name: 'binRemarks',
331
+ header: i18next.t('field.bin_location'),
332
+ label: true,
333
+ width: 400
294
334
  }
295
335
  ]
296
336
  }
@@ -302,9 +342,12 @@ class SortingProduct extends connect(store)(localize(i18next)(PageView)) {
302
342
  query: gql`
303
343
  query findReleaseOrdersByTaskNo($taskNo: String!) {
304
344
  findReleaseOrdersByTaskNo(taskNo: $taskNo) {
305
- id
306
- name
307
- status
345
+ releaseGoods {
346
+ id
347
+ name
348
+ status
349
+ }
350
+ taskNo
308
351
  }
309
352
  }
310
353
  `,
@@ -312,8 +355,8 @@ class SortingProduct extends connect(store)(localize(i18next)(PageView)) {
312
355
  })
313
356
 
314
357
  if (!response.errors) {
315
- this.releaseOrders = response.data.findReleaseOrdersByTaskNo
316
- this.taskNo = taskNo
358
+ this.releaseOrders = response.data.findReleaseOrdersByTaskNo.releaseGoods
359
+ this.taskNo = response.data.findReleaseOrdersByTaskNo.taskNo
317
360
  if (this.releaseOrders?.length) {
318
361
  this._openSelectReleaseOrderPopup()
319
362
  } else {
@@ -332,7 +375,7 @@ class SortingProduct extends connect(store)(localize(i18next)(PageView)) {
332
375
  .releaseOrders=${this.releaseOrders}
333
376
  @ro-selected=${e => {
334
377
  this._selectedReleaseGood = e.detail.ro
335
- this._fetchItemList(this._selectedReleaseGood.name)
378
+ this._fetchItemList(this._selectedReleaseGood?.name)
336
379
  }}
337
380
  ></show-ro-list-popup>
338
381
  `,
@@ -376,12 +419,12 @@ class SortingProduct extends connect(store)(localize(i18next)(PageView)) {
376
419
  }
377
420
  }
378
421
  worksheetDetailInfos {
379
- name
380
422
  batchId
381
423
  productId
382
424
  productSku
383
425
  productName
384
426
  productDescription
427
+ isRequireSerialNumberScanningOutbound
385
428
  expirationDate
386
429
  releaseQty
387
430
  sortedQty
@@ -392,6 +435,7 @@ class SortingProduct extends connect(store)(localize(i18next)(PageView)) {
392
435
  id
393
436
  name
394
437
  }
438
+ binRemarks
395
439
  }
396
440
  }
397
441
  }
@@ -403,12 +447,18 @@ class SortingProduct extends connect(store)(localize(i18next)(PageView)) {
403
447
  this._worksheetInfo = worksheetInfo
404
448
 
405
449
  this.data = { records: this.formatWorksheetDetailInfos(worksheetDetailInfos) }
450
+ if (!this._selectedOrderInventory) {
451
+ this._selectedOrderInventory = worksheetDetailInfos[0]
452
+ this._isRequireSerialNumberScanningOutbound = worksheetDetailInfos[0].isRequireSerialNumberScanningOutbound
453
+ }
406
454
  this.updateContext()
407
455
  this._completeHandler()
408
456
 
409
457
  this._enableProductScanning = await fetchSettingRule('enable-product-scanning', worksheetInfo.partnerDomainId)
410
458
 
411
- if (this._enableProductScanning) this._focusOnProductBarcodeInput()
459
+ if (this._isRequireSerialNumberScanningOutbound) this._focusOnSerialInput()
460
+ else if (this._enableProductScanning && !this._isRequireSerialNumberScanningOutbound)
461
+ this._focusOnProductBarcodeInput()
412
462
  else this._focusOnSortingQtyInput()
413
463
  }
414
464
  }
@@ -426,11 +476,12 @@ class SortingProduct extends connect(store)(localize(i18next)(PageView)) {
426
476
  response = await this.commonSorting()
427
477
  }
428
478
 
429
- if (!response.errors) {
430
- if (this._enableProductScanning) this.productBarcodeInput.value = ''
431
- else this.sortingQtyInput.value = ''
479
+ if (this._isRequireSerialNumberScanningOutbound) {
480
+ this.serialInput.value = ''
481
+ }
432
482
 
433
- this._fetchItemList(this._selectedReleaseGood.name)
483
+ if (!response.errors) {
484
+ this._fetchItemList(this._selectedReleaseGood?.name)
434
485
  }
435
486
  } catch (e) {
436
487
  this._showToast(e)
@@ -440,15 +491,28 @@ class SortingProduct extends connect(store)(localize(i18next)(PageView)) {
440
491
  async commonSorting() {
441
492
  return await client.mutate({
442
493
  mutation: gql`
443
- mutation sortingProduct($taskNo: String!, $releaseGoodNo: String!, $productId: String!, $sortingQty: Float!) {
444
- sortingProduct(taskNo: $taskNo, releaseGoodNo: $releaseGoodNo, productId: $productId, sortingQty: $sortingQty)
494
+ mutation sortingProduct(
495
+ $taskNo: String!
496
+ $releaseGoodNo: String!
497
+ $productId: String!
498
+ $sortingQty: Float!
499
+ $serialNumber: String
500
+ ) {
501
+ sortingProduct(
502
+ taskNo: $taskNo
503
+ releaseGoodNo: $releaseGoodNo
504
+ productId: $productId
505
+ sortingQty: $sortingQty
506
+ serialNumber: $serialNumber
507
+ )
445
508
  }
446
509
  `,
447
510
  variables: {
448
511
  taskNo: this.taskNo,
449
- releaseGoodNo: this._selectedReleaseGood.name,
512
+ releaseGoodNo: this._selectedReleaseGood?.name,
450
513
  productId: this._selectedOrderInventory?.product.id,
451
- sortingQty: parseFloat(this.sortingQtyInput.value)
514
+ sortingQty: this._isRequireSerialNumberScanningOutbound ? 1 : parseFloat(this.sortingQtyInput.value),
515
+ serialNumber: this._isRequireSerialNumberScanningOutbound ? this.serialInput.value.trim() : null
452
516
  }
453
517
  })
454
518
  }
@@ -456,14 +520,25 @@ class SortingProduct extends connect(store)(localize(i18next)(PageView)) {
456
520
  async scanProductSorting() {
457
521
  return await client.mutate({
458
522
  mutation: gql`
459
- mutation scanProductSorting($taskNo: String!, $releaseGoodNo: String!, $productBarcode: String!) {
460
- scanProductSorting(taskNo: $taskNo, releaseGoodNo: $releaseGoodNo, productBarcode: $productBarcode)
523
+ mutation scanProductSorting(
524
+ $taskNo: String!
525
+ $releaseGoodNo: String!
526
+ $productBarcode: String!
527
+ $serialNumber: String
528
+ ) {
529
+ scanProductSorting(
530
+ taskNo: $taskNo
531
+ releaseGoodNo: $releaseGoodNo
532
+ productBarcode: $productBarcode
533
+ serialNumber: $serialNumber
534
+ )
461
535
  }
462
536
  `,
463
537
  variables: {
464
538
  taskNo: this.taskNo,
465
- releaseGoodNo: this._selectedReleaseGood.name,
466
- productBarcode: this.productBarcodeInput.value.trim()
539
+ releaseGoodNo: this._selectedReleaseGood?.name,
540
+ productBarcode: this.productBarcodeInput.value.trim(),
541
+ serialNumber: this._isRequireSerialNumberScanningOutbound ? this.serialInput.value.trim() : null
467
542
  }
468
543
  })
469
544
  }
@@ -494,11 +569,12 @@ class SortingProduct extends connect(store)(localize(i18next)(PageView)) {
494
569
  }
495
570
  `,
496
571
  variables: {
497
- releaseGoodNo: this._selectedReleaseGood.name
572
+ releaseGoodNo: this._selectedReleaseGood?.name
498
573
  }
499
574
  })
500
575
  if (!response.errors) {
501
576
  this._showToast({ message: i18next.t('text.current_release_order_sorting_completed') })
577
+ this._selectedOrderInventory = null
502
578
  await this._fetchReleaseOrderList(this.taskNo)
503
579
  }
504
580
  } catch (e) {
@@ -538,20 +614,34 @@ class SortingProduct extends connect(store)(localize(i18next)(PageView)) {
538
614
  this._focusOnProductBarcodeInput()
539
615
  throw new Error(i18next.t('text.product_barcode_is_empty'))
540
616
  }
617
+
618
+ if (this._isRequireSerialNumberScanningOutbound) {
619
+ if (!this.serialInput?.value) {
620
+ this._focusOnSerialInput()
621
+ throw new Error(i18next.t('text.empty_serial_number'))
622
+ }
623
+ }
541
624
  } else {
542
625
  // validate for order selection
543
626
  if (!this._selectedOrderInventory) throw new Error(i18next.t('text.target_is_not_selected'))
544
627
 
545
- if (!this.sortingQtyInput.checkValidity()) throw new Error(i18next.t('text.release_qty_invalid'))
628
+ if (this._isRequireSerialNumberScanningOutbound) {
629
+ if (!this.serialInput?.value) {
630
+ this._focusOnSerialInput()
631
+ throw new Error(i18next.t('text.empty_serial_number'))
632
+ }
633
+ } else {
634
+ if (!this.sortingQtyInput.checkValidity()) throw new Error(i18next.t('text.release_qty_invalid'))
546
635
 
547
- if (!parseInt(this.sortingQtyInput.value)) {
548
- this._focusOnSortingQtyInput()
549
- throw new Error(i18next.t('text.release_qty_is_empty'))
550
- }
636
+ if (!parseInt(this.sortingQtyInput.value)) {
637
+ this._focusOnSortingQtyInput()
638
+ throw new Error(i18next.t('text.release_qty_is_empty'))
639
+ }
551
640
 
552
- if (parseInt(this.sortingQtyInput.value) != this._selectedOrderInventory.releaseQty) {
553
- this._focusOnSortingQtyInput()
554
- throw new Error(i18next.t('text.wrong_sorting_qty'))
641
+ if (parseInt(this.sortingQtyInput.value) != this._selectedOrderInventory.releaseQty) {
642
+ this._focusOnSortingQtyInput()
643
+ throw new Error(i18next.t('text.wrong_sorting_qty'))
644
+ }
555
645
  }
556
646
  }
557
647
  }
@@ -579,6 +669,7 @@ class SortingProduct extends connect(store)(localize(i18next)(PageView)) {
579
669
  else this.sortingQtyInput.value = ''
580
670
  this._selectedOrderInventory = null
581
671
  this._selectedTaskStatus = null
672
+ this.serialInput.value = ''
582
673
  }
583
674
 
584
675
  _showToast({ type, message }) {
@@ -124,6 +124,14 @@ class WorksheetBatchPicking extends localize(i18next)(PageView) {
124
124
  })
125
125
  }
126
126
 
127
+ if (this.activatable || this.assignable) {
128
+ actions.push({
129
+ title: i18next.t('button.select_operator'),
130
+ action: this._selectOperator.bind(this),
131
+ ...CommonButtonStyles.add
132
+ })
133
+ }
134
+
127
135
  if (this.activatable) {
128
136
  actions.push({
129
137
  title: i18next.t('button.activate'),
@@ -489,6 +497,7 @@ class WorksheetBatchPicking extends localize(i18next)(PageView) {
489
497
  name
490
498
  sku
491
499
  description
500
+ pickingStrategy
492
501
  }
493
502
  bizplace {
494
503
  id
@@ -523,6 +532,7 @@ class WorksheetBatchPicking extends localize(i18next)(PageView) {
523
532
  name
524
533
  sku
525
534
  description
535
+ pickingStrategy
526
536
  }
527
537
  bizplace {
528
538
  id
@@ -973,6 +983,7 @@ class WorksheetBatchPicking extends localize(i18next)(PageView) {
973
983
  .productId="${this._selectedProduct.product.id}"
974
984
  .productName="${this._selectedProduct.product.name}"
975
985
  .productSku="${this._selectedProduct.product.sku}"
986
+ .productPickingStrategy="${this._selectedProduct.product.pickingStrategy}"
976
987
  .bizplaceId="${this._selectedProduct.bizplaceId}"
977
988
  .worksheetType="${this._worksheetType}"
978
989
  .packingType="${this._selectedProduct.packingType}"
@@ -984,13 +995,6 @@ class WorksheetBatchPicking extends localize(i18next)(PageView) {
984
995
  this._spinner(true)
985
996
 
986
997
  await this.fetchOrderInventories()
987
- // await this.fetchWorksheetDetails(
988
- // this._worksheetNo,
989
- // this._selectedProduct.batchId,
990
- // this._selectedProduct.product.name,
991
- // this._selectedProduct.product.sku,
992
- // this._selectedProduct.packingType
993
- // )
994
998
 
995
999
  this._selectedProduct.completed = true
996
1000
 
@@ -1025,14 +1029,6 @@ class WorksheetBatchPicking extends localize(i18next)(PageView) {
1025
1029
  this._spinner(true)
1026
1030
 
1027
1031
  await this.fetchOrderInventories()
1028
- // await this.fetchWorksheetDetails(
1029
- // this._worksheetNo,
1030
- // this._selectedProduct?.batchId,
1031
- // this._selectedProduct?.product?.name,
1032
- // this._selectedProduct?.product?.sku,
1033
- // this._selectedProduct?.packingType,
1034
- // this._selectedProduct.packingSize
1035
- // )
1036
1032
 
1037
1033
  this._spinner(false)
1038
1034
 
@@ -1206,11 +1202,11 @@ class WorksheetBatchPicking extends localize(i18next)(PageView) {
1206
1202
  async assignWorker() {
1207
1203
  const response = await client.mutate({
1208
1204
  mutation: gql`
1209
- mutation assignPickingWorker($worksheetId: String!, $userId: String!) {
1205
+ mutation assignBatchPickingWorker($worksheetId: [String]!, $userId: String!) {
1210
1206
  assignPickingWorker(worksheetId: $worksheetId, userId: $userId)
1211
1207
  }
1212
1208
  `,
1213
- variables: { worksheetId: this.worksheetId, userId: this.assignee.id }
1209
+ variables: { worksheetId: [this._worksheetId], userId: this.assignee.id }
1214
1210
  })
1215
1211
 
1216
1212
  if (!response.errors) {