@things-factory/operato-wms 4.3.0-alpha.1 → 4.3.2

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 (98) hide show
  1. package/client/constants/index.js +1 -0
  2. package/client/constants/order.js +14 -0
  3. package/client/pages/constants/index.js +1 -0
  4. package/client/pages/constants/setting.js +1 -0
  5. package/client/pages/constants/tote.js +14 -0
  6. package/client/pages/inbound/putaway-product.js +3 -1
  7. package/client/pages/inbound/unload-product.js +21 -11
  8. package/client/pages/inventory/inventory-adjustment-approval.js +24 -9
  9. package/client/pages/inventory/inventory-adjustment.js +79 -13
  10. package/client/pages/master/product/product-list.js +1 -1
  11. package/client/pages/master/tote-list.js +740 -0
  12. package/client/pages/order/arrival-notice/arrival-notice-detail.js +0 -2
  13. package/client/pages/order/arrival-notice/receive-arrival-notice.js +0 -2
  14. package/client/pages/order/draft-release-good/draft-release-good-detail.js +1163 -0
  15. package/client/pages/order/draft-release-good/draft-release-good-list.js +546 -0
  16. package/client/pages/order/goods-received-note/customer-received-note.js +3 -0
  17. package/client/pages/order/goods-received-note/received-note-detail.js +3 -0
  18. package/client/pages/order/release-order/b2c/b2c-order-requests.js +21 -30
  19. package/client/pages/order/release-order/bulk-print-packing-list.js +4 -0
  20. package/client/pages/order/release-order/receive-release-order-request.js +0 -2
  21. package/client/pages/order/release-order/release-order-detail.js +44 -26
  22. package/client/pages/order/return-order/receive-return-order-requests.js +0 -2
  23. package/client/pages/order/transfer-order/receive-transfer-order-request.js +1 -1
  24. package/client/pages/order/transport-order/print-delivery-note.js +0 -1
  25. package/client/pages/order/transport-order/view-delivery-note.js +1 -1
  26. package/client/pages/order/vas-order/receive-vas-order.js +0 -2
  27. package/client/pages/outbound/inventory-assign-popup.js +7 -2
  28. package/client/pages/outbound/inventory-auto-assign-popup.js +2 -1
  29. package/client/pages/outbound/loading-product.js +49 -11
  30. package/client/pages/outbound/order-remark-popup.js +112 -0
  31. package/client/pages/outbound/packing-product.js +42 -6
  32. package/client/pages/outbound/packing-worksheet-list.js +15 -0
  33. package/client/pages/outbound/picking-product.js +150 -13
  34. package/client/pages/outbound/single-outbound-worksheet.js +10 -22
  35. package/client/pages/outbound/sorting-product.js +78 -15
  36. package/client/pages/outbound/tote-popup.js +461 -0
  37. package/client/pages/outbound/worksheet-batch-picking.js +9 -2
  38. package/client/pages/outbound/worksheet-packing.js +7 -2
  39. package/client/pages/outbound/worksheet-picking.js +9 -2
  40. package/client/pages/report/inventory-summary-report.js +8 -0
  41. package/client/pages/report/outbound-order-details-report.js +18 -0
  42. package/client/pages/vas/abstract-execute-vas.js +12 -7
  43. package/client/pages/vas/print-product-label.js +15 -6
  44. package/client/pages/vas/reverse-kitting/execute-reverse-kitting.js +3 -1
  45. package/client/pages/vas/reverse-kitting/popup-reverse-kitting-template.js +3 -1
  46. package/client/route.js +12 -0
  47. package/dist-server/entities/index.js +2 -1
  48. package/dist-server/entities/index.js.map +1 -1
  49. package/dist-server/entities/warehouse-bizplace-onhand-inventory.js +168 -0
  50. package/dist-server/entities/warehouse-bizplace-onhand-inventory.js.map +1 -0
  51. package/dist-server/graphql/index.js +1 -5
  52. package/dist-server/graphql/index.js.map +1 -1
  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/index.js +4 -7
  56. package/dist-server/graphql/resolvers/index.js.map +1 -1
  57. package/dist-server/graphql/resolvers/reports/outbound-order-details-report.js +3 -1
  58. package/dist-server/graphql/resolvers/reports/outbound-order-details-report.js.map +1 -1
  59. package/dist-server/graphql/resolvers/warehouse-inventory-adjustment/index.js +6 -0
  60. package/dist-server/graphql/resolvers/warehouse-inventory-adjustment/index.js.map +1 -0
  61. package/dist-server/graphql/resolvers/warehouse-inventory-adjustment/warehouse-intentory-adjustment.js +58 -0
  62. package/dist-server/graphql/resolvers/warehouse-inventory-adjustment/warehouse-intentory-adjustment.js.map +1 -0
  63. package/dist-server/graphql/types/index.js +5 -8
  64. package/dist-server/graphql/types/index.js.map +1 -1
  65. package/dist-server/graphql/types/reports/outbound-order-details-report.js +2 -0
  66. package/dist-server/graphql/types/reports/outbound-order-details-report.js.map +1 -1
  67. package/dist-server/graphql/types/warehouse-inventory-adjustment/index.js +9 -0
  68. package/dist-server/graphql/types/warehouse-inventory-adjustment/index.js.map +1 -0
  69. package/dist-server/index.js +2 -5
  70. package/dist-server/index.js.map +1 -1
  71. package/dist-server/opa-app-setting-constants.js +2 -1
  72. package/dist-server/opa-app-setting-constants.js.map +1 -1
  73. package/dist-server/utils/index.js +1 -5
  74. package/dist-server/utils/index.js.map +1 -1
  75. package/helps/release-note.ko.md +11 -9
  76. package/helps/release-note.md +11 -9
  77. package/helps/release-note.ms.md +11 -9
  78. package/helps/release-note.zh.md +11 -9
  79. package/package.json +50 -50
  80. package/server/entities/index.ts +2 -2
  81. package/server/entities/warehouse-bizplace-onhand-inventory.ts +141 -0
  82. package/server/graphql/resolvers/board-setting/board-settings.ts +4 -2
  83. package/server/graphql/resolvers/index.ts +3 -2
  84. package/server/graphql/resolvers/reports/outbound-order-details-report.ts +6 -2
  85. package/server/graphql/resolvers/warehouse-inventory-adjustment/index.ts +5 -0
  86. package/server/graphql/resolvers/warehouse-inventory-adjustment/warehouse-intentory-adjustment.ts +68 -0
  87. package/server/graphql/types/index.ts +4 -4
  88. package/server/graphql/types/reports/outbound-order-details-report.ts +2 -0
  89. package/server/graphql/types/warehouse-inventory-adjustment/index.ts +5 -0
  90. package/server/index.ts +2 -1
  91. package/server/opa-app-setting-constants.ts +1 -0
  92. package/things-factory.config.js +13 -0
  93. package/translations/en.json +48 -8
  94. package/translations/ko.json +35 -1
  95. package/translations/ms.json +35 -1
  96. package/translations/zh.json +35 -1
  97. package/config.development.js +0 -73
  98. package/config.production.js +0 -113
@@ -5,6 +5,8 @@ import './picking-replacement-popup'
5
5
  import './show-my-worksheet-list-popup'
6
6
  import '../components/worksheet-information-popup'
7
7
  import './serial-number-popup'
8
+ import './tote-popup'
9
+ import { sleep } from '@operato/utils'
8
10
 
9
11
  import gql from 'graphql-tag'
10
12
  import { css, html } from 'lit-element'
@@ -49,7 +51,8 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
49
51
  refPickingType: String,
50
52
  releaseGoodNo: String,
51
53
  releaseGoodId: String,
52
- worksheetNo: String
54
+ worksheetNo: String,
55
+ toteNo: String
53
56
  }
54
57
  }
55
58
 
@@ -92,12 +95,12 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
92
95
  }
93
96
 
94
97
  get completed() {
95
- return this.data.records.every(record => record.completed)
98
+ return this.data.records.every(record => record?.completed)
96
99
  }
97
100
 
98
101
  get context() {
99
102
  var actions = []
100
- if (this._hasBinPicking && this.refPickingType === PICKING_TYPES.PICKING.value || PICKING_TYPES.BATCH_PICKING.value) {
103
+ if (this._hasBinPicking) {
101
104
  actions.push({
102
105
  title: i18next.t('button.get_task'),
103
106
  action: this.getTask.bind(this),
@@ -119,6 +122,14 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
119
122
  })
120
123
  }
121
124
 
125
+ if (this.refPickingType === PICKING_TYPES.PICKING.value && this.releaseGoodNo && this._enableToteScanning) {
126
+ actions.push({
127
+ title: i18next.t('button.tote'),
128
+ action: this.openTotePopup.bind(this),
129
+ ...CommonButtonStyles.activate
130
+ })
131
+ }
132
+
122
133
  if (this.releaseGoodNo) {
123
134
  actions.push({
124
135
  title: i18next.t('button.plastic_pallet'),
@@ -127,6 +138,19 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
127
138
  })
128
139
  }
129
140
 
141
+ if (
142
+ (this.releaseGoodId || this.taskNo) &&
143
+ this._selectedOrderInventory.status !== 'MISSING' &&
144
+ this._selectedOrderInventory.hasMissingInventoryChanges !== true &&
145
+ this._selectedOrderInventory.status !== 'DONE'
146
+ ) {
147
+ actions.push({
148
+ title: i18next.t('button.missing_stock'),
149
+ action: this.missingStock.bind(this),
150
+ ...CommonButtonStyles.submit
151
+ })
152
+ }
153
+
130
154
  if ((this.releaseGoodNo && this.completed) || (this.taskNo && this.completed)) {
131
155
  actions.push({
132
156
  title: i18next.t('button.complete'),
@@ -250,7 +274,6 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
250
274
  this.releaseGoodNo = ''
251
275
  this.releaseGoodId = ''
252
276
  this.taskNo = ''
253
-
254
277
  this._incompleteLocationName = false
255
278
  this._isCartonLabel = false
256
279
  /* A flag to indicate either PICKING process is executing */
@@ -326,7 +349,7 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
326
349
  ${this.scannable
327
350
  ? html`
328
351
  <fieldset>
329
- ${this._hasBinPicking
352
+ ${this._hasBinPicking && (!this.toteNo || this.tote !== '')
330
353
  ? html`
331
354
  <label>${i18next.t('label.bin_location')}</label>
332
355
  <barcode-scanable-input
@@ -588,6 +611,7 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
588
611
  async fetchInventories(pickingRefNo) {
589
612
  if (!pickingRefNo) return
590
613
 
614
+ const data = this._selectedOrderInventory
591
615
  let response
592
616
  switch (this.refPickingType) {
593
617
  case PICKING_TYPES.PICKING.value:
@@ -613,6 +637,7 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
613
637
  trackingNo
614
638
  }
615
639
  worksheetDetailInfos {
640
+ hasMissingInventoryChanges
616
641
  name
617
642
  palletId
618
643
  cartonId
@@ -684,13 +709,31 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
684
709
 
685
710
  if (
686
711
  this._selectedOrderInventory &&
687
- this._selectedOrderInventory.pickedQty != this._selectedOrderInventory.releaseQty
712
+ this._selectedOrderInventory.pickedQty != this._selectedOrderInventory.releaseQty &&
713
+ !this._selectedOrderInventory.hasMissingInventoryChanges &&
714
+ this._selectedOrderInventory.status !== 'MISSING'
688
715
  ) {
689
716
  this.scannable = true
690
717
  } else {
691
718
  this.scannable = false
692
719
  }
693
720
 
721
+ if (!this._isCartonLabel && data) {
722
+ const findPalletId = worksheetDetailInfos.find(res => res.palletId == data.palletId)
723
+
724
+ if (data && findPalletId.hasMissingInventoryChanges) {
725
+ this.scannable = false
726
+ }
727
+ }
728
+
729
+ if (this._isCartonLabel && data) {
730
+ const findCartonId = worksheetDetailInfos.find(res => res.cartonId == data.cartonId)
731
+
732
+ if (data && findCartonId.hasMissingInventoryChanges) {
733
+ this.scannable = false
734
+ }
735
+ }
736
+
694
737
  if (this._selectedOrderInventory) {
695
738
  const record = this.data.records.find(record => record.name === this._selectedOrderInventory.name)
696
739
  this._selectedOrderInventory = record
@@ -719,6 +762,7 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
719
762
  }
720
763
 
721
764
  this._enableProductScanning = await fetchSettingRule('enable-product-scanning', worksheetInfo.partnerDomainId)
765
+ this._enableToteScanning = await fetchSettingRule('enable-tote-scanning', worksheetInfo.partnerDomainId)
722
766
  }
723
767
  break
724
768
 
@@ -733,6 +777,7 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
733
777
  startedAt
734
778
  }
735
779
  worksheetDetailInfos {
780
+ hasMissingInventoryChanges
736
781
  palletId
737
782
  cartonId
738
783
  batchId
@@ -791,13 +836,31 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
791
836
 
792
837
  if (
793
838
  this._selectedOrderInventory &&
794
- this._selectedOrderInventory.pickedQty != this._selectedOrderInventory.releaseQty
839
+ this._selectedOrderInventory.pickedQty != this._selectedOrderInventory.releaseQty &&
840
+ !this._selectedOrderInventory.hasMissingInventoryChanges &&
841
+ this._selectedOrderInventory.status !== 'MISSING'
795
842
  ) {
796
843
  this.scannable = true
797
844
  } else {
798
845
  this.scannable = false
799
846
  }
800
847
 
848
+ if (!this._isCartonLabel && data) {
849
+ const findPalletId = worksheetDetailInfos.find(res => res.palletId == data.palletId)
850
+
851
+ if (data && findPalletId.hasMissingInventoryChanges) {
852
+ this.scannable = false
853
+ }
854
+ }
855
+
856
+ if (this._isCartonLabel && data) {
857
+ const findCartonId = worksheetDetailInfos.find(res => res.cartonId == data.cartonId)
858
+
859
+ if (data && findCartonId.hasMissingInventoryChanges) {
860
+ this.scannable = false
861
+ }
862
+ }
863
+
801
864
  this._enableProductScanning = await fetchSettingRule('enable-product-scanning', worksheetInfo.partnerDomainId)
802
865
 
803
866
  if (this._selectedOrderInventory) {
@@ -832,7 +895,7 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
832
895
  formatWorksheetDetailInfos(wsdInfos) {
833
896
  return wsdInfos
834
897
  .map(record => {
835
- if (record.pickedQty == record.releaseQty) {
898
+ if (record.pickedQty == record.releaseQty || record.status == 'MISSING') {
836
899
  record.completed = true
837
900
  } else {
838
901
  record.completed = false
@@ -858,6 +921,7 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
858
921
 
859
922
  return record
860
923
  })
924
+ .sort((a, b) => a.hasMissingInventoryChanges - b.hasMissingInventoryChanges)
861
925
  .sort((a, b) => a.completed - b.completed)
862
926
  }
863
927
 
@@ -908,6 +972,7 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
908
972
  this._incompleteLocationName = false
909
973
  this._isExecuting = false
910
974
  this._locationName = null
975
+ this.toteNo = ''
911
976
  }
912
977
 
913
978
  fillUpForm(form, data) {
@@ -1033,7 +1098,8 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1033
1098
  )
1034
1099
  }
1035
1100
 
1036
- openSerialNumberPopup() {
1101
+ async openSerialNumberPopup() {
1102
+ await sleep(1010)
1037
1103
  openPopup(
1038
1104
  html`
1039
1105
  <serial-number-popup
@@ -1057,6 +1123,29 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1057
1123
  )
1058
1124
  }
1059
1125
 
1126
+ async openTotePopup() {
1127
+ await sleep(1010)
1128
+ openPopup(
1129
+ html`
1130
+ <tote-popup
1131
+ .orderNo="${this.releaseGoodNo}"
1132
+ .toteNo="${this.toteNo}"
1133
+ .bizplace="${this._bizplaceName}"
1134
+ @completed="${async e => {
1135
+ this.toteNo = e.detail
1136
+ }}"
1137
+ ></tote-popup>
1138
+ `,
1139
+ {
1140
+ closable: false,
1141
+ backdrop: false,
1142
+ escapable: false,
1143
+ size: 'large',
1144
+ title: i18next.t('title.tote_scanning')
1145
+ }
1146
+ )
1147
+ }
1148
+
1060
1149
  _openWorksheetInformation() {
1061
1150
  openPopup(
1062
1151
  html`
@@ -1113,6 +1202,7 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1113
1202
  $releaseQty: Int!
1114
1203
  $binLocation: String
1115
1204
  $serialNumber: String
1205
+ $toteNo: String
1116
1206
  ) {
1117
1207
  picking(
1118
1208
  worksheetDetailName: $worksheetDetailName
@@ -1122,6 +1212,7 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1122
1212
  releaseQty: $releaseQty
1123
1213
  binLocation: $binLocation
1124
1214
  serialNumber: $serialNumber
1215
+ toteNo: $toteNo
1125
1216
  )
1126
1217
  }
1127
1218
  `,
@@ -1132,7 +1223,8 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1132
1223
  locationName: this._locationName ? this._locationName : this._selectedOrderInventory?.location.name,
1133
1224
  releaseQty: this._isRequireSerialNumberScanningOutbound ? 1 : parseInt(this.releaseQtyInput.value),
1134
1225
  binLocation: this._hasBinPicking ? this.binLocationInput.value : null,
1135
- serialNumber: this._isRequireSerialNumberScanningOutbound ? this.serialInput.value : null
1226
+ serialNumber: this._isRequireSerialNumberScanningOutbound ? this.serialInput.value : null,
1227
+ toteNo: this._enableToteScanning && this.toteNo !== '' ? this.toteNo : null
1136
1228
  }
1137
1229
  })
1138
1230
 
@@ -1191,6 +1283,7 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1191
1283
  $cartonId: String!
1192
1284
  $binLocation: String
1193
1285
  $serialNumber: String
1286
+ $toteNo: String
1194
1287
  ) {
1195
1288
  scanProductPicking(
1196
1289
  worksheetDetailName: $worksheetDetailName
@@ -1199,6 +1292,7 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1199
1292
  cartonId: $cartonId
1200
1293
  binLocation: $binLocation
1201
1294
  serialNumber: $serialNumber
1295
+ toteNo: $toteNo
1202
1296
  )
1203
1297
  }
1204
1298
  `,
@@ -1208,7 +1302,8 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1208
1302
  productBarcode: this.productBarcodeInput.value.trim(),
1209
1303
  cartonId: this.cartonInput.value.trim(),
1210
1304
  serialNumber: this._isRequireSerialNumberScanningOutbound ? this.serialInput.value : null,
1211
- binLocation: this._hasBinPicking ? this.binLocationInput.value : null
1305
+ binLocation: this._hasBinPicking ? this.binLocationInput.value : null,
1306
+ toteNo: this._enableToteScanning && this.toteNo !== '' ? this.toteNo : null
1212
1307
  }
1213
1308
  })
1214
1309
 
@@ -1545,7 +1640,47 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1545
1640
  }
1546
1641
  }
1547
1642
 
1548
- openPalletOutbound() {
1643
+ async missingStock() {
1644
+ const selectOrderInventory = this._selectedOrderInventory
1645
+
1646
+ const patchesArr = [selectOrderInventory]
1647
+
1648
+ const patches = patchesArr.map(p => {
1649
+ return {
1650
+ palletId: p.palletId,
1651
+ transactionType: 'MISSING'
1652
+ }
1653
+ })
1654
+
1655
+ const result = await CustomAlert({
1656
+ title: i18next.t('title.are_you_sure'),
1657
+ text: i18next.t('text.do_you_want_to_mark_it_as_missing'),
1658
+ confirmButton: { text: i18next.t('button.confirm') },
1659
+ cancelButton: { text: i18next.t('button.cancel') }
1660
+ })
1661
+
1662
+ if (result.isConfirmed) {
1663
+ try {
1664
+ const response = await client.mutate({
1665
+ mutation: gql`
1666
+ mutation submitInventoryChanges($patches: [InventoryPatch!]!) {
1667
+ submitInventoryChanges(patches: $patches)
1668
+ }
1669
+ `,
1670
+ variables: { patches }
1671
+ })
1672
+
1673
+ if (!response.error) {
1674
+ await this.fetchInventories(this.releaseGoodNo)
1675
+ }
1676
+ } catch (error) {
1677
+ throw new Error(error)
1678
+ }
1679
+ }
1680
+ }
1681
+
1682
+ async openPalletOutbound() {
1683
+ await sleep(1010)
1549
1684
  openPopup(
1550
1685
  html`
1551
1686
  <outbound-reusable-pallet
@@ -1650,6 +1785,7 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1650
1785
  this.data = { records: this.formatWorksheetDetailInfos(worksheetDetailInfos) }
1651
1786
 
1652
1787
  this._enableProductScanning = await fetchSettingRule('enable-product-scanning', worksheetInfo.partnerDomainId)
1788
+ this._enableToteScanning = await fetchSettingRule('enable-tote-scanning', worksheetInfo.partnerDomainId)
1653
1789
 
1654
1790
  if (this._selectedOrderInventory) {
1655
1791
  const record = this.data.records.find(record => record.name === this._selectedOrderInventory.name)
@@ -1677,7 +1813,8 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1677
1813
  await this.fetchPalletsHandler(orderNo)
1678
1814
  }
1679
1815
 
1680
- showWorksheetList() {
1816
+ async showWorksheetList() {
1817
+ await sleep(1010)
1681
1818
  openPopup(html` <show-my-worksheet-list-popup></show-my-worksheet-list-popup> `, {
1682
1819
  backdrop: true,
1683
1820
  size: 'small',
@@ -66,13 +66,7 @@ class SingleOutboundWorksheet extends localize(i18next)(PageView) {
66
66
  }
67
67
 
68
68
  get context() {
69
- var actions = [
70
- {
71
- title: i18next.t('button.assign_picker'),
72
- action: this._assignPicker.bind(this),
73
- ...CommonButtonStyles.activate
74
- }
75
- ]
69
+ var actions = []
76
70
 
77
71
  if (this._routeLabelSetting) {
78
72
  actions.push({
@@ -82,6 +76,12 @@ class SingleOutboundWorksheet extends localize(i18next)(PageView) {
82
76
  })
83
77
  }
84
78
 
79
+ actions.push({
80
+ title: i18next.t('button.assign_picker'),
81
+ action: this._assignPicker.bind(this),
82
+ ...CommonButtonStyles.activate
83
+ })
84
+
85
85
  return {
86
86
  title: i18next.t('title.outbound_worksheet'),
87
87
  actions,
@@ -192,7 +192,7 @@ class SingleOutboundWorksheet extends localize(i18next)(PageView) {
192
192
  },
193
193
  {
194
194
  label: i18next.t('field.cross_docking'),
195
- name: 'crossDocking',
195
+ name: 'crossDocking',
196
196
  type: 'checkbox',
197
197
  props: { searchOper: 'eq' },
198
198
  attrs: ['indeterminate']
@@ -438,9 +438,8 @@ class SingleOutboundWorksheet extends localize(i18next)(PageView) {
438
438
  if (!response.errors) {
439
439
  let domain = response.data.worksheets.items[0]?.domain
440
440
 
441
- if (domain)
442
- this._routeLabelSetting = await fetchSettingRule('enable-print-route-label', domain.id)
443
-
441
+ if (domain) this._routeLabelSetting = await fetchSettingRule('enable-print-route-label', domain.id)
442
+
444
443
  this.updateContext()
445
444
  return {
446
445
  total: response.data.worksheets.total || 0,
@@ -631,17 +630,6 @@ class SingleOutboundWorksheet extends localize(i18next)(PageView) {
631
630
  return { header: headerSetting, data: data }
632
631
  }
633
632
 
634
- _showToast({ type, message }) {
635
- document.dispatchEvent(
636
- new CustomEvent('notify', {
637
- detail: {
638
- type,
639
- message
640
- }
641
- })
642
- )
643
- }
644
-
645
633
  navigatePickingRelatedPages(record) {
646
634
  if (this.assigneeId) {
647
635
  const searchParams = new URLSearchParams()
@@ -2,6 +2,8 @@ import '@things-factory/barcode-ui'
2
2
  import '@things-factory/grist-ui'
3
3
  import './show-ro-list-popup'
4
4
  import '../components/worksheet-information-popup'
5
+ import './tote-popup'
6
+ import { sleep } from '@operato/utils'
5
7
 
6
8
  import gql from 'graphql-tag'
7
9
  import { css, html } from 'lit-element'
@@ -25,10 +27,13 @@ class SortingProduct extends connect(store)(localize(i18next)(PageView)) {
25
27
  _selectedTaskStatus: String,
26
28
  _worksheetInfo: Object,
27
29
  _selectedReleaseGood: Object,
30
+ _enableToteScanning: Boolean,
31
+ bizplaceName: String,
28
32
  config: Object,
29
33
  data: Object,
30
34
  releaseOrders: Array,
31
- taskNo: String
35
+ taskNo: String,
36
+ toteNo: String
32
37
  }
33
38
  }
34
39
 
@@ -73,19 +78,34 @@ class SortingProduct extends connect(store)(localize(i18next)(PageView)) {
73
78
  var actions = []
74
79
 
75
80
  if (this.taskNo) {
81
+ if (this._enableToteScanning) {
82
+ actions.push({
83
+ title: i18next.t('button.tote'),
84
+ action: this._openTotePopup.bind(this),
85
+ ...CommonButtonStyles.activate
86
+ })
87
+ }
76
88
  actions.push({
77
89
  title: i18next.t('button.release_orders'),
78
90
  action: this._openSelectReleaseOrderPopup.bind(this),
79
91
  ...CommonButtonStyles.inspect
80
92
  })
81
93
 
82
- if (this.completed && this.releaseGoodNoInput?.value) {
94
+ if (this.completed) {
83
95
  actions.push({
84
96
  title: i18next.t('button.order_sorted'),
85
97
  action: this._completeOrderSorting.bind(this),
86
98
  ...CommonButtonStyles.submit
87
99
  })
88
100
  }
101
+
102
+ if (this.releaseOrders?.length == 0) {
103
+ actions.push({
104
+ title: i18next.t('button.complete'),
105
+ action: this._completeSortingWorksheet.bind(this),
106
+ ...CommonButtonStyles.submit
107
+ })
108
+ }
89
109
  }
90
110
 
91
111
  return {
@@ -358,9 +378,9 @@ class SortingProduct extends connect(store)(localize(i18next)(PageView)) {
358
378
  this.releaseOrders = response.data.findReleaseOrdersByTaskNo.releaseGoods
359
379
  this.taskNo = response.data.findReleaseOrdersByTaskNo.taskNo
360
380
  if (this.releaseOrders?.length) {
361
- this._openSelectReleaseOrderPopup()
381
+ await this._openSelectReleaseOrderPopup()
362
382
  } else {
363
- this._completeSortingWorksheet()
383
+ await this._completeSortingWorksheet()
364
384
  }
365
385
  }
366
386
  } catch (e) {
@@ -368,7 +388,8 @@ class SortingProduct extends connect(store)(localize(i18next)(PageView)) {
368
388
  }
369
389
  }
370
390
 
371
- _openSelectReleaseOrderPopup() {
391
+ async _openSelectReleaseOrderPopup() {
392
+ await sleep(1010)
372
393
  openPopup(
373
394
  html`
374
395
  <show-ro-list-popup
@@ -376,6 +397,7 @@ class SortingProduct extends connect(store)(localize(i18next)(PageView)) {
376
397
  @ro-selected=${e => {
377
398
  this._selectedReleaseGood = e.detail.ro
378
399
  this._fetchItemList(this._selectedReleaseGood?.name)
400
+ this.toteNo = ''
379
401
  }}
380
402
  ></show-ro-list-popup>
381
403
  `,
@@ -400,6 +422,29 @@ class SortingProduct extends connect(store)(localize(i18next)(PageView)) {
400
422
  )
401
423
  }
402
424
 
425
+ async _openTotePopup() {
426
+ await sleep(1010)
427
+ openPopup(
428
+ html`
429
+ <tote-popup
430
+ .orderNo="${this._selectedReleaseGood?.name}"
431
+ .toteNo="${this.toteNo}"
432
+ .bizplace="${this.bizplaceName}"
433
+ @completed="${async e => {
434
+ this.toteNo = e.detail
435
+ }}"
436
+ ></tote-popup>
437
+ `,
438
+ {
439
+ closable: false,
440
+ backdrop: false,
441
+ escapable: false,
442
+ size: 'large',
443
+ title: i18next.t('title.tote_scanning')
444
+ }
445
+ )
446
+ }
447
+
403
448
  async _fetchItemList(releaseOrderNo) {
404
449
  const response = await client.query({
405
450
  query: gql`
@@ -445,21 +490,26 @@ class SortingProduct extends connect(store)(localize(i18next)(PageView)) {
445
490
  if (!response.errors) {
446
491
  const { worksheetInfo, worksheetDetailInfos } = response.data.sortingWorksheet
447
492
  this._worksheetInfo = worksheetInfo
493
+ this.bizplaceName = worksheetInfo.bizplaceName
448
494
 
449
495
  this.data = { records: this.formatWorksheetDetailInfos(worksheetDetailInfos) }
450
496
  if (!this._selectedOrderInventory) {
451
497
  this._selectedOrderInventory = worksheetDetailInfos[0]
452
498
  this._isRequireSerialNumberScanningOutbound = worksheetDetailInfos[0].isRequireSerialNumberScanningOutbound
453
499
  }
500
+ this._enableProductScanning = await fetchSettingRule('enable-product-scanning', worksheetInfo.partnerDomainId)
501
+ this._enableToteScanning = await fetchSettingRule('enable-tote-scanning', worksheetInfo.partnerDomainId)
502
+
454
503
  this.updateContext()
455
504
  this._completeHandler()
456
505
 
457
- this._enableProductScanning = await fetchSettingRule('enable-product-scanning', worksheetInfo.partnerDomainId)
458
-
459
- if (this._isRequireSerialNumberScanningOutbound) this._focusOnSerialInput()
460
- else if (this._enableProductScanning && !this._isRequireSerialNumberScanningOutbound)
461
- this._focusOnProductBarcodeInput()
462
- else this._focusOnSortingQtyInput()
506
+ if (this._isRequireSerialNumberScanningOutbound) {
507
+ if (this._enableProductScanning) {
508
+ this._focusOnProductBarcodeInput
509
+ } else {
510
+ this._focusOnSerialInput()
511
+ }
512
+ } else this._focusOnSortingQtyInput()
463
513
  }
464
514
  }
465
515
 
@@ -480,6 +530,12 @@ class SortingProduct extends connect(store)(localize(i18next)(PageView)) {
480
530
  this.serialInput.value = ''
481
531
  }
482
532
 
533
+ if (this._enableProductScanning) {
534
+ this.productBarcodeInput.value = ''
535
+ } else if (!this._enableProductScanning && !this._isRequireSerialNumberScanningOutbound) {
536
+ this.sortingQtyInput.value = ''
537
+ }
538
+
483
539
  if (!response.errors) {
484
540
  this._fetchItemList(this._selectedReleaseGood?.name)
485
541
  }
@@ -497,6 +553,7 @@ class SortingProduct extends connect(store)(localize(i18next)(PageView)) {
497
553
  $productId: String!
498
554
  $sortingQty: Float!
499
555
  $serialNumber: String
556
+ $toteNo: String
500
557
  ) {
501
558
  sortingProduct(
502
559
  taskNo: $taskNo
@@ -504,6 +561,7 @@ class SortingProduct extends connect(store)(localize(i18next)(PageView)) {
504
561
  productId: $productId
505
562
  sortingQty: $sortingQty
506
563
  serialNumber: $serialNumber
564
+ toteNo: $toteNo
507
565
  )
508
566
  }
509
567
  `,
@@ -512,7 +570,8 @@ class SortingProduct extends connect(store)(localize(i18next)(PageView)) {
512
570
  releaseGoodNo: this._selectedReleaseGood?.name,
513
571
  productId: this._selectedOrderInventory?.product.id,
514
572
  sortingQty: this._isRequireSerialNumberScanningOutbound ? 1 : parseFloat(this.sortingQtyInput.value),
515
- serialNumber: this._isRequireSerialNumberScanningOutbound ? this.serialInput.value.trim() : null
573
+ serialNumber: this._isRequireSerialNumberScanningOutbound ? this.serialInput.value.trim() : null,
574
+ toteNo: this._enableToteScanning && this.toteNo !== '' ? this.toteNo : null
516
575
  }
517
576
  })
518
577
  }
@@ -525,12 +584,14 @@ class SortingProduct extends connect(store)(localize(i18next)(PageView)) {
525
584
  $releaseGoodNo: String!
526
585
  $productBarcode: String!
527
586
  $serialNumber: String
587
+ $toteNo: String
528
588
  ) {
529
589
  scanProductSorting(
530
590
  taskNo: $taskNo
531
591
  releaseGoodNo: $releaseGoodNo
532
592
  productBarcode: $productBarcode
533
593
  serialNumber: $serialNumber
594
+ toteNo: $toteNo
534
595
  )
535
596
  }
536
597
  `,
@@ -538,7 +599,8 @@ class SortingProduct extends connect(store)(localize(i18next)(PageView)) {
538
599
  taskNo: this.taskNo,
539
600
  releaseGoodNo: this._selectedReleaseGood?.name,
540
601
  productBarcode: this.productBarcodeInput.value.trim(),
541
- serialNumber: this._isRequireSerialNumberScanningOutbound ? this.serialInput.value.trim() : null
602
+ serialNumber: this._isRequireSerialNumberScanningOutbound ? this.serialInput.value.trim() : null,
603
+ toteNo: this._enableToteScanning && this.toteNo !== '' ? this.toteNo : null
542
604
  }
543
605
  })
544
606
  }
@@ -576,6 +638,7 @@ class SortingProduct extends connect(store)(localize(i18next)(PageView)) {
576
638
  this._showToast({ message: i18next.t('text.current_release_order_sorting_completed') })
577
639
  this._selectedOrderInventory = null
578
640
  await this._fetchReleaseOrderList(this.taskNo)
641
+ this.updateContext()
579
642
  }
580
643
  } catch (e) {
581
644
  this._showToast
@@ -598,8 +661,7 @@ class SortingProduct extends connect(store)(localize(i18next)(PageView)) {
598
661
  await CustomAlert({
599
662
  title: i18next.t('title.sorting'),
600
663
  text: i18next.t('text.sorting_is_completed'),
601
- confirmButton: { text: i18next.t('button.complete') },
602
- cancelButton: { text: i18next.t('button.cancel') }
664
+ confirmButton: { text: i18next.t('button.complete') }
603
665
  })
604
666
  this._clearView()
605
667
  }
@@ -670,6 +732,7 @@ class SortingProduct extends connect(store)(localize(i18next)(PageView)) {
670
732
  this._selectedOrderInventory = null
671
733
  this._selectedTaskStatus = null
672
734
  this.serialInput.value = ''
735
+ this.toteNo = ''
673
736
  }
674
737
 
675
738
  _showToast({ type, message }) {