@things-factory/operato-wms 4.3.19 → 4.4.0-alpha.3

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