@things-factory/operato-wms 4.3.2 → 4.4.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) 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/putaway-product.js +1 -3
  4. package/client/pages/inbound/unload-product.js +11 -21
  5. package/client/pages/inventory/inventory-adjustment-approval.js +9 -24
  6. package/client/pages/inventory/inventory-adjustment.js +13 -79
  7. package/client/pages/master/product/product-list.js +1 -1
  8. package/client/pages/order/arrival-notice/arrival-notice-detail.js +2 -0
  9. package/client/pages/order/arrival-notice/receive-arrival-notice.js +2 -0
  10. package/client/pages/order/goods-received-note/customer-received-note.js +0 -3
  11. package/client/pages/order/goods-received-note/received-note-detail.js +0 -3
  12. package/client/pages/order/release-order/b2c/b2c-order-requests.js +30 -21
  13. package/client/pages/order/release-order/bulk-print-packing-list.js +0 -4
  14. package/client/pages/order/release-order/receive-release-order-request.js +2 -0
  15. package/client/pages/order/release-order/release-order-detail.js +26 -44
  16. package/client/pages/order/return-order/receive-return-order-requests.js +2 -0
  17. package/client/pages/order/transfer-order/receive-transfer-order-request.js +1 -1
  18. package/client/pages/order/transport-order/print-delivery-note.js +1 -0
  19. package/client/pages/order/transport-order/view-delivery-note.js +1 -1
  20. package/client/pages/order/vas-order/receive-vas-order.js +2 -0
  21. package/client/pages/outbound/inventory-assign-popup.js +2 -7
  22. package/client/pages/outbound/inventory-auto-assign-popup.js +1 -2
  23. package/client/pages/outbound/loading-product.js +11 -49
  24. package/client/pages/outbound/packing-product.js +6 -42
  25. package/client/pages/outbound/packing-worksheet-list.js +0 -15
  26. package/client/pages/outbound/picking-product.js +13 -150
  27. package/client/pages/outbound/single-outbound-worksheet.js +22 -10
  28. package/client/pages/outbound/sorting-product.js +15 -78
  29. package/client/pages/outbound/worksheet-batch-picking.js +2 -9
  30. package/client/pages/outbound/worksheet-packing.js +2 -7
  31. package/client/pages/outbound/worksheet-picking.js +2 -9
  32. package/client/pages/report/inventory-summary-report.js +0 -8
  33. package/client/pages/report/outbound-order-details-report.js +0 -18
  34. package/client/pages/vas/abstract-execute-vas.js +7 -12
  35. package/client/pages/vas/print-product-label.js +6 -15
  36. package/client/pages/vas/reverse-kitting/execute-reverse-kitting.js +1 -3
  37. package/client/pages/vas/reverse-kitting/popup-reverse-kitting-template.js +1 -3
  38. package/client/route.js +0 -12
  39. package/dist-server/entities/index.js +1 -2
  40. package/dist-server/entities/index.js.map +1 -1
  41. package/dist-server/graphql/index.js +5 -1
  42. package/dist-server/graphql/index.js.map +1 -1
  43. package/dist-server/graphql/resolvers/board-setting/board-settings.js +1 -2
  44. package/dist-server/graphql/resolvers/board-setting/board-settings.js.map +1 -1
  45. package/dist-server/graphql/resolvers/index.js +7 -4
  46. package/dist-server/graphql/resolvers/index.js.map +1 -1
  47. package/dist-server/graphql/resolvers/reports/outbound-order-details-report.js +1 -3
  48. package/dist-server/graphql/resolvers/reports/outbound-order-details-report.js.map +1 -1
  49. package/dist-server/graphql/types/index.js +8 -5
  50. package/dist-server/graphql/types/index.js.map +1 -1
  51. package/dist-server/graphql/types/reports/outbound-order-details-report.js +0 -2
  52. package/dist-server/graphql/types/reports/outbound-order-details-report.js.map +1 -1
  53. package/dist-server/index.js +5 -2
  54. package/dist-server/index.js.map +1 -1
  55. package/dist-server/opa-app-setting-constants.js +1 -2
  56. package/dist-server/opa-app-setting-constants.js.map +1 -1
  57. package/dist-server/utils/index.js +5 -1
  58. package/dist-server/utils/index.js.map +1 -1
  59. package/helps/release-note.ko.md +9 -11
  60. package/helps/release-note.md +9 -11
  61. package/helps/release-note.ms.md +9 -11
  62. package/helps/release-note.zh.md +9 -11
  63. package/package.json +50 -50
  64. package/server/entities/index.ts +2 -2
  65. package/server/graphql/resolvers/board-setting/board-settings.ts +2 -4
  66. package/server/graphql/resolvers/index.ts +2 -3
  67. package/server/graphql/resolvers/reports/outbound-order-details-report.ts +2 -6
  68. package/server/graphql/types/index.ts +4 -4
  69. package/server/graphql/types/reports/outbound-order-details-report.ts +0 -2
  70. package/server/index.ts +1 -2
  71. package/server/opa-app-setting-constants.ts +0 -1
  72. package/things-factory.config.js +0 -13
  73. package/translations/en.json +8 -48
  74. package/translations/ko.json +1 -35
  75. package/translations/ms.json +1 -35
  76. package/translations/zh.json +1 -35
  77. package/client/constants/index.js +0 -1
  78. package/client/constants/order.js +0 -14
  79. package/client/pages/constants/tote.js +0 -14
  80. package/client/pages/master/tote-list.js +0 -740
  81. package/client/pages/order/draft-release-good/draft-release-good-detail.js +0 -1163
  82. package/client/pages/order/draft-release-good/draft-release-good-list.js +0 -546
  83. package/client/pages/outbound/order-remark-popup.js +0 -112
  84. package/client/pages/outbound/tote-popup.js +0 -461
  85. package/dist-server/entities/warehouse-bizplace-onhand-inventory.js +0 -168
  86. package/dist-server/entities/warehouse-bizplace-onhand-inventory.js.map +0 -1
  87. package/dist-server/graphql/resolvers/warehouse-inventory-adjustment/index.js +0 -6
  88. package/dist-server/graphql/resolvers/warehouse-inventory-adjustment/index.js.map +0 -1
  89. package/dist-server/graphql/resolvers/warehouse-inventory-adjustment/warehouse-intentory-adjustment.js +0 -58
  90. package/dist-server/graphql/resolvers/warehouse-inventory-adjustment/warehouse-intentory-adjustment.js.map +0 -1
  91. package/dist-server/graphql/types/warehouse-inventory-adjustment/index.js +0 -9
  92. package/dist-server/graphql/types/warehouse-inventory-adjustment/index.js.map +0 -1
  93. package/server/entities/warehouse-bizplace-onhand-inventory.ts +0 -141
  94. package/server/graphql/resolvers/warehouse-inventory-adjustment/index.ts +0 -5
  95. package/server/graphql/resolvers/warehouse-inventory-adjustment/warehouse-intentory-adjustment.ts +0 -68
  96. 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) {
@@ -1098,8 +1033,7 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1098
1033
  )
1099
1034
  }
1100
1035
 
1101
- async openSerialNumberPopup() {
1102
- await sleep(1010)
1036
+ openSerialNumberPopup() {
1103
1037
  openPopup(
1104
1038
  html`
1105
1039
  <serial-number-popup
@@ -1123,29 +1057,6 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1123
1057
  )
1124
1058
  }
1125
1059
 
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
-
1149
1060
  _openWorksheetInformation() {
1150
1061
  openPopup(
1151
1062
  html`
@@ -1202,7 +1113,6 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1202
1113
  $releaseQty: Int!
1203
1114
  $binLocation: String
1204
1115
  $serialNumber: String
1205
- $toteNo: String
1206
1116
  ) {
1207
1117
  picking(
1208
1118
  worksheetDetailName: $worksheetDetailName
@@ -1212,7 +1122,6 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1212
1122
  releaseQty: $releaseQty
1213
1123
  binLocation: $binLocation
1214
1124
  serialNumber: $serialNumber
1215
- toteNo: $toteNo
1216
1125
  )
1217
1126
  }
1218
1127
  `,
@@ -1223,8 +1132,7 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1223
1132
  locationName: this._locationName ? this._locationName : this._selectedOrderInventory?.location.name,
1224
1133
  releaseQty: this._isRequireSerialNumberScanningOutbound ? 1 : parseInt(this.releaseQtyInput.value),
1225
1134
  binLocation: this._hasBinPicking ? this.binLocationInput.value : null,
1226
- serialNumber: this._isRequireSerialNumberScanningOutbound ? this.serialInput.value : null,
1227
- toteNo: this._enableToteScanning && this.toteNo !== '' ? this.toteNo : null
1135
+ serialNumber: this._isRequireSerialNumberScanningOutbound ? this.serialInput.value : null
1228
1136
  }
1229
1137
  })
1230
1138
 
@@ -1283,7 +1191,6 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1283
1191
  $cartonId: String!
1284
1192
  $binLocation: String
1285
1193
  $serialNumber: String
1286
- $toteNo: String
1287
1194
  ) {
1288
1195
  scanProductPicking(
1289
1196
  worksheetDetailName: $worksheetDetailName
@@ -1292,7 +1199,6 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1292
1199
  cartonId: $cartonId
1293
1200
  binLocation: $binLocation
1294
1201
  serialNumber: $serialNumber
1295
- toteNo: $toteNo
1296
1202
  )
1297
1203
  }
1298
1204
  `,
@@ -1302,8 +1208,7 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1302
1208
  productBarcode: this.productBarcodeInput.value.trim(),
1303
1209
  cartonId: this.cartonInput.value.trim(),
1304
1210
  serialNumber: this._isRequireSerialNumberScanningOutbound ? this.serialInput.value : null,
1305
- binLocation: this._hasBinPicking ? this.binLocationInput.value : null,
1306
- toteNo: this._enableToteScanning && this.toteNo !== '' ? this.toteNo : null
1211
+ binLocation: this._hasBinPicking ? this.binLocationInput.value : null
1307
1212
  }
1308
1213
  })
1309
1214
 
@@ -1640,47 +1545,7 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1640
1545
  }
1641
1546
  }
1642
1547
 
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)
1548
+ openPalletOutbound() {
1684
1549
  openPopup(
1685
1550
  html`
1686
1551
  <outbound-reusable-pallet
@@ -1785,7 +1650,6 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1785
1650
  this.data = { records: this.formatWorksheetDetailInfos(worksheetDetailInfos) }
1786
1651
 
1787
1652
  this._enableProductScanning = await fetchSettingRule('enable-product-scanning', worksheetInfo.partnerDomainId)
1788
- this._enableToteScanning = await fetchSettingRule('enable-tote-scanning', worksheetInfo.partnerDomainId)
1789
1653
 
1790
1654
  if (this._selectedOrderInventory) {
1791
1655
  const record = this.data.records.find(record => record.name === this._selectedOrderInventory.name)
@@ -1813,8 +1677,7 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
1813
1677
  await this.fetchPalletsHandler(orderNo)
1814
1678
  }
1815
1679
 
1816
- async showWorksheetList() {
1817
- await sleep(1010)
1680
+ showWorksheetList() {
1818
1681
  openPopup(html` <show-my-worksheet-list-popup></show-my-worksheet-list-popup> `, {
1819
1682
  backdrop: true,
1820
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 }) {