@things-factory/operato-wms 5.0.0-alpha.2 → 5.0.0-alpha.22

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 (52) hide show
  1. package/client/pages/inbound/serial-number-list-popup.js +342 -0
  2. package/client/pages/inbound/unload-product.js +220 -41
  3. package/client/pages/inbound/unloaded-inventories-popup.js +7 -0
  4. package/client/pages/inventory/non-loaded-inventory.js +297 -0
  5. package/client/pages/order/release-order/b2b/b2b-order-list.js +41 -18
  6. package/client/pages/order/release-order/b2c/b2c-order-requests.js +40 -18
  7. package/client/pages/outbound/packing-product.js +88 -80
  8. package/client/pages/outbound/picking-product.js +61 -36
  9. package/client/pages/outbound/serial-number-popup.js +150 -64
  10. package/client/pages/report/inbound-serial-number-report.js +452 -0
  11. package/client/pages/report/outbound-order-details-report.js +64 -9
  12. package/client/pages/report/outbound-serial-number-report.js +467 -0
  13. package/client/route.js +11 -0
  14. package/dist-server/graphql/resolvers/reports/inbound-serial-number-report.js +111 -0
  15. package/dist-server/graphql/resolvers/reports/inbound-serial-number-report.js.map +1 -0
  16. package/dist-server/graphql/resolvers/reports/index.js +3 -1
  17. package/dist-server/graphql/resolvers/reports/index.js.map +1 -1
  18. package/dist-server/graphql/resolvers/reports/outbound-order-details-report.js +53 -48
  19. package/dist-server/graphql/resolvers/reports/outbound-order-details-report.js.map +1 -1
  20. package/dist-server/graphql/resolvers/reports/outbound-serial-number-report.js +118 -0
  21. package/dist-server/graphql/resolvers/reports/outbound-serial-number-report.js.map +1 -0
  22. package/dist-server/graphql/types/reports/inbound-serial-number-report-list.js +14 -0
  23. package/dist-server/graphql/types/reports/inbound-serial-number-report-list.js.map +1 -0
  24. package/dist-server/graphql/types/reports/inbound-serial-number-report.js +23 -0
  25. package/dist-server/graphql/types/reports/inbound-serial-number-report.js.map +1 -0
  26. package/dist-server/graphql/types/reports/index.js +10 -0
  27. package/dist-server/graphql/types/reports/index.js.map +1 -1
  28. package/dist-server/graphql/types/reports/outbound-order-details-report.js +3 -0
  29. package/dist-server/graphql/types/reports/outbound-order-details-report.js.map +1 -1
  30. package/dist-server/graphql/types/reports/outbound-serial-number-report-list.js +14 -0
  31. package/dist-server/graphql/types/reports/outbound-serial-number-report-list.js.map +1 -0
  32. package/dist-server/graphql/types/reports/outbound-serial-number-report.js +25 -0
  33. package/dist-server/graphql/types/reports/outbound-serial-number-report.js.map +1 -0
  34. package/dist-server/migrations/1568858861188-SeedSetting.js +2 -1
  35. package/dist-server/migrations/1568858861188-SeedSetting.js.map +1 -1
  36. package/package.json +67 -66
  37. package/server/graphql/resolvers/reports/inbound-serial-number-report.ts +128 -0
  38. package/server/graphql/resolvers/reports/index.ts +5 -0
  39. package/server/graphql/resolvers/reports/outbound-order-details-report.ts +54 -48
  40. package/server/graphql/resolvers/reports/outbound-serial-number-report.ts +135 -0
  41. package/server/graphql/types/reports/inbound-serial-number-report-list.ts +8 -0
  42. package/server/graphql/types/reports/inbound-serial-number-report.ts +17 -0
  43. package/server/graphql/types/reports/index.ts +11 -0
  44. package/server/graphql/types/reports/outbound-order-details-report.ts +3 -0
  45. package/server/graphql/types/reports/outbound-serial-number-report-list.ts +8 -0
  46. package/server/graphql/types/reports/outbound-serial-number-report.ts +19 -0
  47. package/server/migrations/1568858861188-SeedSetting.ts +5 -2
  48. package/things-factory.config.js +12 -0
  49. package/translations/en.json +26 -6
  50. package/translations/ko.json +21 -2
  51. package/translations/ms.json +21 -2
  52. package/translations/zh.json +25 -6
@@ -1,6 +1,5 @@
1
1
  import '@things-factory/barcode-ui'
2
2
  import '@things-factory/grist-ui'
3
- import './logistics-init/logistics-init-popup'
4
3
  import '../components/worksheet-information-popup'
5
4
 
6
5
  import gql from 'graphql-tag'
@@ -35,7 +34,8 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
35
34
  _productName: String,
36
35
  _logisticsInitiated: Boolean,
37
36
  _selectedTaskStatus: String,
38
- _worksheetInfo: Object
37
+ _worksheetInfo: Object,
38
+ _scanning: Boolean
39
39
  }
40
40
  }
41
41
 
@@ -215,19 +215,15 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
215
215
  </form>
216
216
 
217
217
  <form id="input-form" class="multi-column-form" @keypress="${this.packing.bind(this)}">
218
- ${this.scannable
219
- ? html`
220
- <fieldset>
221
- ${this._enableProductScanning
222
- ? html` <label>${i18next.t('label.product_barcode')}</label>
223
- <barcode-scanable-input name="productBarcode" custom-input></barcode-scanable-input>`
224
- : html`
225
- <label>${i18next.t('label.packed_qty')}</label>
226
- <input type="number" min="1" name="packedQty" />
227
- `}
228
- </fieldset>
229
- `
230
- : ''}
218
+ <fieldset>
219
+ ${this._enableProductScanning
220
+ ? html` <label>${i18next.t('label.product_barcode')}</label>
221
+ <barcode-scanable-input name="productBarcode" custom-input></barcode-scanable-input>`
222
+ : html`
223
+ <label>${i18next.t('label.packed_qty')}</label>
224
+ <input type="number" min="1" name="packedQty" />
225
+ `}
226
+ </fieldset>
231
227
  </form>
232
228
 
233
229
  <data-grist .mode=${isMobileDevice() ? 'LIST' : 'GRID'} .config=${this.config} .data=${this.data}>
@@ -256,6 +252,7 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
256
252
  this._productName = ''
257
253
  this._selectedOrderInventory = null
258
254
  this._selectedTaskStatus = null
255
+ this._scanning = false
259
256
  }
260
257
 
261
258
  updated(changedProps) {
@@ -274,10 +271,8 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
274
271
  this._selectedOrderInventory = record
275
272
  this._selectedTaskStatus = record.status
276
273
 
277
- if (this.scannable) {
278
- if (this._enableProductScanning) this._focusOnProductBarcodeInput()
279
- else this._focusOnReleaseQtyInput()
280
- }
274
+ if (this._enableProductScanning) this._focusOnProductBarcodeInput()
275
+ else this._focusOnReleaseQtyInput()
281
276
  }
282
277
  }
283
278
  }
@@ -390,6 +385,13 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
390
385
  product {
391
386
  name
392
387
  description
388
+ gtin
389
+ productDetails {
390
+ id
391
+ packingType
392
+ packingSize
393
+ gtin
394
+ }
393
395
  }
394
396
  qty
395
397
  releaseQty
@@ -423,6 +425,7 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
423
425
  if (!response.data?.packingWorksheet) return
424
426
 
425
427
  const { worksheetInfo, worksheetDetailInfos } = response.data.packingWorksheet
428
+ this.data = { records: this.formatWorksheetDetailInfos(worksheetDetailInfos) }
426
429
 
427
430
  this.trackingNo = worksheetInfo.trackingNo
428
431
  this.airwayBill = worksheetInfo.airwayBill
@@ -435,7 +438,6 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
435
438
  this._bizplaceName = worksheetInfo.bizplaceName
436
439
  this._worksheetInfo = worksheetInfo
437
440
 
438
- this.data = { records: this.formatWorksheetDetailInfos(worksheetDetailInfos) }
439
441
  if (this._selectedOrderInventory) {
440
442
  const record = this.data.records.find(record => record.name === this._selectedOrderInventory.name)
441
443
  if (record.packedQty == record.releaseQty) {
@@ -447,6 +449,11 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
447
449
 
448
450
  this._enableProductScanning = await fetchSettingRule('enable-product-scanning', worksheetInfo.partnerDomainId)
449
451
 
452
+ if (this._enableProductScanning) {
453
+ this._focusOnProductBarcodeInput()
454
+ } else {
455
+ this._focusOnReleaseQtyInput()
456
+ }
450
457
  this.updateContext()
451
458
  }
452
459
  }
@@ -504,9 +511,14 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
504
511
  }
505
512
 
506
513
  printSellercraftAirwayBill() {
507
- let url = new URL(window.location)
514
+ let convertedPdfUrl = ''
515
+ if (this.airwayBill.includes('partner.shopeemobile.com')) {
516
+ convertedPdfUrl = `/pdf/merge?urls=${this.airwayBill}`
517
+ } else {
518
+ let url = new URL(window.location)
519
+ convertedPdfUrl = `${url.origin}/proxy?url=${this.airwayBill}`
520
+ }
508
521
 
509
- var convertedPdfUrl = `${url.origin}/proxy?url=${this.airwayBill}`
510
522
  this._callPrintDialog(convertedPdfUrl)
511
523
  }
512
524
 
@@ -609,7 +621,7 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
609
621
  if (e.keyCode === 13) {
610
622
  e.preventDefault()
611
623
  try {
612
- this._validatePacking()
624
+ await this._validatePacking()
613
625
 
614
626
  let response
615
627
  if (this._enableProductScanning) response = await this.productBarcodePacking()
@@ -618,10 +630,9 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
618
630
  if (!response.errors) {
619
631
  if (this._enableProductScanning) {
620
632
  this.productBarcodeInput.value = ''
621
- this._focusOnProductBarcodeInput()
633
+ this._selectedOrderInventory = null
622
634
  } else {
623
635
  this.releaseQtyInput.value = ''
624
- this._focusOnReleaseQtyInput()
625
636
  this._selectedTaskStatus = null
626
637
  this._selectedOrderInventory = null
627
638
  }
@@ -629,12 +640,25 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
629
640
  this._fetchInventories(this.releaseGoodNo)
630
641
  }
631
642
  } catch (e) {
643
+ if (this._enableProductScanning) {
644
+ this.productBarcodeInput.value = ''
645
+ this._focusOnProductBarcodeInput()
646
+ } else {
647
+ this.releaseQtyInput.value = ''
648
+ this._focusOnReleaseQtyInput()
649
+ this._selectedTaskStatus = null
650
+ }
651
+ this._selectedOrderInventory = null
632
652
  this._showToast(e)
653
+ } finally {
654
+ this._scanning = false
633
655
  }
634
656
  }
635
657
  }
636
658
 
637
659
  async productBarcodePacking() {
660
+ if (this._scanning) return this._showToast({ message: i18next.t('text.previous_scan_is_executing') })
661
+ this._scanning = true
638
662
  return await client.mutate({
639
663
  mutation: gql`
640
664
  mutation scanProductPacking($worksheetDetailName: String!, $productBarcode: String!) {
@@ -649,6 +673,8 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
649
673
  }
650
674
 
651
675
  async commonPacking() {
676
+ if (this._scanning) return this._showToast({ message: i18next.t('text.previous_scan_is_executing') })
677
+ this._scanning = true
652
678
  return await client.mutate({
653
679
  mutation: gql`
654
680
  mutation packing($worksheetDetailName: String!, $releaseQty: Int!) {
@@ -664,45 +690,50 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
664
690
 
665
691
  async _validatePacking() {
666
692
  // validate for order selection
667
- if (!this._selectedOrderInventory) throw new Error(i18next.t('text.target_is_not_selected'))
668
-
669
- if (this._selectedOrderInventory) {
670
- if (this._enableProductScanning) {
671
- if (!this.productBarcodeInput.value) {
672
- this._focusOnProductBarcodeInput()
673
- throw new Error(i18next.t('text.no_product_barcode_detected'))
674
- }
675
- } else {
676
- if (!this.releaseQtyInput.checkValidity()) throw new Error(i18next.t('text.release_qty_invalid'))
693
+ if (this._enableProductScanning) {
694
+ //if no input
695
+ if (!this.productBarcodeInput.value) {
696
+ this._focusOnProductBarcodeInput()
697
+ throw new Error(i18next.t('text.no_product_barcode_detected'))
698
+ }
677
699
 
678
- // Release qty existing
679
- if (!parseInt(this.releaseQtyInput.value)) {
680
- this._focusOnReleaseQtyInput()
681
- throw new Error(i18next.t('text.release_qty_is_empty'))
682
- }
700
+ //find product match with input barcode
701
+ const foundOrderInventory = this.data.records.find(
702
+ itm =>
703
+ itm.product.productDetails.find(
704
+ detail =>
705
+ detail.gtin === this.productBarcodeInput.value.trim() &&
706
+ detail.packingType == itm.packingType &&
707
+ detail.packingSize == itm.packingSize
708
+ ) != undefined
709
+ )
683
710
 
684
- // typed qty should be matched with release qty.
685
- if (parseInt(this.releaseQtyInput.value) !== this._selectedOrderInventory.releaseQty) {
686
- this._focusOnReleaseQtyInput()
687
- throw new Error(i18next.t('text.wrong_release_qty'))
711
+ if (foundOrderInventory) {
712
+ if (foundOrderInventory?.status === WORKSHEET_STATUS.EXECUTING.value) {
713
+ this._selectedOrderInventory = foundOrderInventory
714
+ } else if (foundOrderInventory?.status === WORKSHEET_STATUS.DONE.value) {
715
+ throw new Error(i18next.t('text.scanned_product_status_is_done'))
688
716
  }
717
+ } else {
718
+ throw new Error(i18next.t('text.incorrect_product_barcode'))
689
719
  }
690
- }
691
- }
692
-
693
- async _completeHandler() {
694
- if (!this.data?.records?.length || this.data.records.some(record => !record.completed)) return
720
+ } else {
721
+ if (!this._selectedOrderInventory) throw new Error(i18next.t('text.target_is_not_selected'))
695
722
 
696
- const result = await CustomAlert({
697
- title: i18next.t('title.packing'),
698
- text: i18next.t('text.do_you_want_to_complete'),
699
- confirmButton: { text: i18next.t('button.complete') },
700
- cancelButton: { text: i18next.t('button.cancel') }
701
- })
723
+ if (!this.releaseQtyInput.checkValidity()) throw new Error(i18next.t('text.release_qty_invalid'))
702
724
 
703
- if (!result.value) return
725
+ // Release qty existing
726
+ if (!parseInt(this.releaseQtyInput.value)) {
727
+ this._focusOnReleaseQtyInput()
728
+ throw new Error(i18next.t('text.release_qty_is_empty'))
729
+ }
704
730
 
705
- this._complete()
731
+ // typed qty should be matched with release qty.
732
+ if (parseInt(this.releaseQtyInput.value) !== this._selectedOrderInventory.releaseQty) {
733
+ this._focusOnReleaseQtyInput()
734
+ throw new Error(i18next.t('text.wrong_release_qty'))
735
+ }
736
+ }
706
737
  }
707
738
 
708
739
  async _complete() {
@@ -726,29 +757,6 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
726
757
  }
727
758
  }
728
759
 
729
- _showLogisticsInitPopup() {
730
- if (this.checkShippingProviderAndDeliveryType() == true) {
731
- this.initLogistics()
732
- } else {
733
- openPopup(
734
- html`
735
- <logistics-init-popup
736
- .orderInformation="${this.orderInformation}"
737
- @order-initialised="${() => {
738
- this._logisticsInitiated = true
739
- }}"
740
- ></logistics-init-popup>
741
- `,
742
- {
743
- backdrop: true,
744
- escapable: false,
745
- size: 'medium',
746
- title: i18next.t('title.ready_to_ship')
747
- }
748
- )
749
- }
750
- }
751
-
752
760
  _openWorksheetInformation() {
753
761
  openPopup(
754
762
  html`
@@ -25,15 +25,6 @@ const PICKING_TYPES = { PICKING, BATCH_PICKING }
25
25
  class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
26
26
  static get properties() {
27
27
  return {
28
- config: Object,
29
- data: Object,
30
- isWholePicking: Boolean,
31
- locations: Array,
32
- locationNameSplit: Array,
33
- refPickingType: String,
34
- releaseGoodNo: String,
35
- orderNo: String,
36
- worksheetNo: String,
37
28
  _bizplaceName: String,
38
29
  _crossDocking: Boolean,
39
30
  _currentBinLocation: String,
@@ -43,10 +34,20 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
43
34
  _isCartonLabel: Boolean,
44
35
  _isExecuting: Boolean,
45
36
  _isReplacement: Boolean,
46
- _isRequireSerialNumberScanning: Boolean,
37
+ _isRequireSerialNumberScanningOutbound: Boolean,
38
+ _locationName: String,
47
39
  _reusablePalletList: Object,
48
40
  _worksheetInfo: Object,
49
- _locationName: String
41
+ config: Object,
42
+ data: Object,
43
+ isWholePicking: Boolean,
44
+ locationNameSplit: Array,
45
+ locations: Array,
46
+ orderNo: String,
47
+ refPickingType: String,
48
+ releaseGoodNo: String,
49
+ releaseGoodId: String,
50
+ worksheetNo: String
50
51
  }
51
52
  }
52
53
 
@@ -108,11 +109,11 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
108
109
  ...CommonButtonStyles.inspect
109
110
  })
110
111
 
111
- if (this._selectedOrderInventory && this._isRequireSerialNumberScanning) {
112
+ if (this._selectedOrderInventory && this._isRequireSerialNumberScanningOutbound) {
112
113
  actions.push({
113
114
  title: i18next.t('button.serial_number'),
114
115
  action: this.openSerialNumberPopup.bind(this),
115
- ...CommonButtonStyles.description
116
+ ...CommonButtonStyles.activate
116
117
  })
117
118
  }
118
119
 
@@ -251,6 +252,7 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
251
252
  this.locationNameSplit = []
252
253
  this.refPickingType = PICKING_TYPES.PICKING.value
253
254
  this.releaseGoodNo = ''
255
+ this.releaseGoodId = ''
254
256
  this.taskNo = ''
255
257
 
256
258
  this._incompleteLocationName = false
@@ -258,7 +260,7 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
258
260
  /* A flag to indicate either PICKING process is executing */
259
261
  this._isExecuting = false
260
262
  this._isReplacement = false
261
- this._isRequireSerialNumberScanning = false
263
+ this._isRequireSerialNumberScanningOutbound = false
262
264
  this._crossDocking = false
263
265
  this._enableProductScanning = false
264
266
  this._hasBinPicking = false
@@ -351,7 +353,7 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
351
353
  <barcode-scanable-input name="productBarcode" custom-input></barcode-scanable-input>
352
354
  `
353
355
  : html`
354
- ${this._isRequireSerialNumberScanning
356
+ ${this._isRequireSerialNumberScanningOutbound
355
357
  ? ''
356
358
  : html`
357
359
  <label>${i18next.t('label.picked_qty')}</label>
@@ -362,7 +364,7 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
362
364
  this._crossDocking ||
363
365
  this._isCartonLabel ||
364
366
  this._enableProductScanning ||
365
- this._isRequireSerialNumberScanning
367
+ this._isRequireSerialNumberScanningOutbound
366
368
  ? ''
367
369
  : html`
368
370
  ${this._incompleteLocationName
@@ -388,7 +390,7 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
388
390
  )}
389
391
  </select>
390
392
  `}
391
- ${this._isRequireSerialNumberScanning
393
+ ${this._isRequireSerialNumberScanningOutbound
392
394
  ? html`
393
395
  <label>${i18next.t('label.serial_number')}</label>
394
396
  <barcode-scanable-input name="serialNumber" custom-input></barcode-scanable-input>
@@ -444,6 +446,7 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
444
446
  try {
445
447
  this.grist.showSpinner()
446
448
  if (data.records.length && record) {
449
+ this._isRequireSerialNumberScanningOutbound = record.product.isRequireSerialNumberScanningOutbound
447
450
  this.inputForm.reset()
448
451
  this._isReplacement = false
449
452
 
@@ -591,6 +594,7 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
591
594
  pickingWorksheet(releaseGoodNo: $releaseGoodNo, locationSortingRules: $locationSortingRules) {
592
595
  worksheetInfo {
593
596
  releaseGood {
597
+ id
594
598
  name
595
599
  crossDocking
596
600
  }
@@ -612,10 +616,11 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
612
616
  batchId
613
617
  batchIdRef
614
618
  product {
619
+ id
615
620
  sku
616
621
  name
617
622
  description
618
- isRequireSerialNumberScanning
623
+ isRequireSerialNumberScanningOutbound
619
624
  }
620
625
  qty
621
626
  releaseQty
@@ -644,10 +649,11 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
644
649
  name
645
650
  }
646
651
  product {
652
+ id
647
653
  sku
648
654
  name
649
655
  description
650
- isRequireSerialNumberScanning
656
+ isRequireSerialNumberScanningOutbound
651
657
  }
652
658
  }
653
659
  }
@@ -660,6 +666,7 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
660
666
  if (!response.errors) {
661
667
  if (!this._selectedOrderInventory) this.clearView()
662
668
  this.releaseGoodNo = response.data.pickingWorksheet.worksheetInfo.releaseGood.name
669
+ this.releaseGoodId = response.data.pickingWorksheet.worksheetInfo.releaseGood.id
663
670
  if (!response.data?.pickingWorksheet) return
664
671
 
665
672
  const { worksheetInfo, worksheetDetailInfos } = response.data.pickingWorksheet
@@ -860,8 +867,9 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
860
867
  this.data = { records: [] }
861
868
  this.infoForm.reset()
862
869
  this.inputForm.reset()
863
- this._isRequireSerialNumberScanning = false
870
+ this._isRequireSerialNumberScanningOutbound = false
864
871
  this.releaseGoodNo = null
872
+ this.releaseGoodId = null
865
873
  this.taskNo = null
866
874
  this._crossDocking = false
867
875
  this._selectedOrderInventory = null
@@ -909,7 +917,7 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
909
917
  } else if (this._enableProductScanning || this._isCartonLabel) {
910
918
  response = await this.productBarcodePicking()
911
919
  } else {
912
- if (this._isReplacement) {
920
+ if (this._isReplacement && !this._isCartonLabel) {
913
921
  this.openPalletReplacementPopup()
914
922
  return
915
923
  } else {
@@ -918,12 +926,12 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
918
926
  }
919
927
 
920
928
  if (!response.errors) {
921
- if (this._isRequireSerialNumberScanning) this.serialInput.value = ''
922
- else if (this._enableProductScanning && !this._isRequireSerialNumberScanning)
929
+ if (this._isRequireSerialNumberScanningOutbound) this.serialInput.value = ''
930
+ else if (this._enableProductScanning && !this._isRequireSerialNumberScanningOutbound)
923
931
  this.productBarcodeInput.value = ''
924
932
  else this.releaseQtyInput.value = ''
925
933
 
926
- if (!this._isCartonLabel && !this._isRequireSerialNumberScanning) {
934
+ if (!this._isCartonLabel && !this._isRequireSerialNumberScanningOutbound) {
927
935
  this.palletInput.value = ''
928
936
  // this._selectedTaskStatus = null
929
937
  this._selectedOrderInventory = null
@@ -977,10 +985,20 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
977
985
  openSerialNumberPopup() {
978
986
  openPopup(
979
987
  html`
980
- <serial-number-popup .orderInventory="${this?._selectedOrderInventory?.relatedOrderInv}"></serial-number-popup>
988
+ <serial-number-popup
989
+ .orderInventory="${this?._selectedOrderInventory?.relatedOrderInv}"
990
+ .orderType="${i18next.t('text.outbound')}"
991
+ .orderId="${this.releaseGoodId}"
992
+ .data="${this?._selectedOrderInventory}"
993
+ @close-serial-number-popup="${async e => {
994
+ await this.fetchAll(this.releaseGoodNo)
995
+ }}"
996
+ ></serial-number-popup>
981
997
  `,
982
998
  {
983
- backdrop: true,
999
+ closable: false,
1000
+ backdrop: false,
1001
+ escapable: false,
984
1002
  size: 'large',
985
1003
  title: i18next.t('title.serial_number_list')
986
1004
  }
@@ -1060,9 +1078,9 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1060
1078
  worksheetType: this.refPickingType,
1061
1079
  palletId: this.palletInput.value.trim(),
1062
1080
  locationName: this._locationName ? this._locationName : this._selectedOrderInventory?.location.name,
1063
- releaseQty: this._isRequireSerialNumberScanning ? 1 : parseInt(this.releaseQtyInput.value),
1081
+ releaseQty: this._isRequireSerialNumberScanningOutbound ? 1 : parseInt(this.releaseQtyInput.value),
1064
1082
  binLocation: this._hasBinPicking ? this.binLocationInput.value : null,
1065
- serialNumber: this._isRequireSerialNumberScanning ? this.serialInput.value : null
1083
+ serialNumber: this._isRequireSerialNumberScanningOutbound ? this.serialInput.value : null
1066
1084
  }
1067
1085
  })
1068
1086
 
@@ -1136,7 +1154,7 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1136
1154
  worksheetType: this.refPickingType,
1137
1155
  productBarcode: this.productBarcodeInput.value.trim(),
1138
1156
  cartonId: this.cartonInput.value.trim(),
1139
- serialNumber: this._isRequireSerialNumberScanning ? this.serialInput.value : null,
1157
+ serialNumber: this._isRequireSerialNumberScanningOutbound ? this.serialInput.value : null,
1140
1158
  binLocation: this._hasBinPicking ? this.binLocationInput.value : null
1141
1159
  }
1142
1160
  })
@@ -1194,7 +1212,10 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1194
1212
  this._focusOnLotNoInput()
1195
1213
  throw new Error(i18next.t('text.lot_id_is_empty'))
1196
1214
  } else {
1197
- if (this._selectedOrderInventory.palletId !== this.palletInput.value) {
1215
+ if (
1216
+ this._selectedOrderInventory.palletId !== this.palletInput.value &&
1217
+ !this._isRequireSerialNumberScanningOutbound
1218
+ ) {
1198
1219
  const isInProgressing = await this.checkProgressingPallet(this.palletInput.value)
1199
1220
  if (isInProgressing) throw new Error(i18next.t('text.pallet_is_in_progressing'))
1200
1221
 
@@ -1212,7 +1233,7 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1212
1233
 
1213
1234
  // Release qty existing
1214
1235
  if (!this._isReplacement) {
1215
- if (!this._isRequireSerialNumberScanning) {
1236
+ if (!this._isRequireSerialNumberScanningOutbound) {
1216
1237
  if (!parseInt(this.releaseQtyInput?.value)) {
1217
1238
  this._focusOnReleaseQtyInput()
1218
1239
  throw new Error(i18next.t('text.release_qty_is_empty'))
@@ -1287,6 +1308,8 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1287
1308
 
1288
1309
  if (this._selectedOrderInventory.cartonId) {
1289
1310
  if (this._selectedOrderInventory.cartonId !== this.cartonInput.value) {
1311
+ //carton replacement?
1312
+ throw new Error(i18next.t('text.invalid_carton_id'))
1290
1313
  this._isReplacement = await this.checkCartonIdenticality(
1291
1314
  this._selectedOrderInventory.cartonId,
1292
1315
  this._selectedOrderInventory.palletId,
@@ -1309,7 +1332,7 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1309
1332
  }
1310
1333
  }
1311
1334
 
1312
- if (this._isRequireSerialNumberScanning) {
1335
+ if (this._isRequireSerialNumberScanningOutbound) {
1313
1336
  if (!this.serialInput?.value) {
1314
1337
  this._focusOnSerialInput()
1315
1338
  throw new Error(i18next.t('text.empty_serial_number'))
@@ -1515,6 +1538,7 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1515
1538
  refNo3
1516
1539
  startedAt
1517
1540
  releaseGood {
1541
+ id
1518
1542
  name
1519
1543
  crossDocking
1520
1544
  }
@@ -1569,6 +1593,7 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1569
1593
  this._bizplaceName = worksheetInfo.bizplaceName
1570
1594
  this._crossDocking = worksheetInfo.releaseGood?._crossDocking
1571
1595
  this.releaseGoodNo = worksheetInfo.releaseGood?.name
1596
+ this.releaseGoodId = worksheetInfo.releaseGood?.id
1572
1597
  this._orderNo = this.releaseGoodNo
1573
1598
  this._worksheetInfo = worksheetInfo
1574
1599
  this.data = { records: this.formatWorksheetDetailInfos(worksheetDetailInfos) }
@@ -1629,7 +1654,7 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1629
1654
  return true
1630
1655
  }
1631
1656
  } else {
1632
- if (!this._enableProductScanning && !this._isRequireSerialNumberScanning) this.palletInput.value = ''
1657
+ if (!this._enableProductScanning && !this._isRequireSerialNumberScanningOutbound) this.palletInput.value = ''
1633
1658
 
1634
1659
  if (this.palletInput.value == '') {
1635
1660
  this._focusOnLotNoInput()
@@ -1638,13 +1663,13 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1638
1663
  }
1639
1664
  }
1640
1665
 
1641
- if (this._enableProductScanning && !this._isRequireSerialNumberScanning) {
1666
+ if (this._enableProductScanning && !this._isRequireSerialNumberScanningOutbound) {
1642
1667
  this.productBarcodeInput.value = ''
1643
1668
  this._focusOnProductBarcodeInput()
1644
1669
  return true
1645
1670
  }
1646
1671
 
1647
- if (this._isRequireSerialNumberScanning) {
1672
+ if (this._isRequireSerialNumberScanningOutbound) {
1648
1673
  this.serialInput.value = ''
1649
1674
  this._focusOnSerialInput()
1650
1675
  return true
@@ -1664,7 +1689,7 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1664
1689
  }
1665
1690
 
1666
1691
  this._isCartonLabel = selectedRecords.hasCartonLabel
1667
- this._isRequireSerialNumberScanning = selectedRecords?.product?.isRequireSerialNumberScanning
1692
+ this._isRequireSerialNumberScanningOutbound = selectedRecords?.product?.isRequireSerialNumberScanningOutbound
1668
1693
  }
1669
1694
 
1670
1695
  _showToast({ type, message }) {