@things-factory/operato-wms 4.3.313 → 4.3.315

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.
@@ -863,8 +863,6 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
863
863
  console.time('time execution for product barcode scanning')
864
864
 
865
865
  try {
866
- if (this._scanning) throw new Error(i18next.t('text.previous_scan_is_executing'))
867
- this._scanning = true
868
866
  await this.validatePacking()
869
867
 
870
868
  let response = this._enableProductScanning ? await this.productBarcodePacking() : await this.commonPacking()
@@ -911,7 +909,6 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
911
909
  this._isRequireSerialNumberScanningOutbound =
912
910
  this.data.records[0].product?.isRequireSerialNumberScanningOutbound
913
911
  }
914
- this._scanning = false
915
912
  // time execution for product barcode scanning (without scanning machines): 308.0390625 ms
916
913
  console.timeEnd('time execution for product barcode scanning')
917
914
  }
@@ -919,141 +916,159 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
919
916
  }
920
917
 
921
918
  async productBarcodePacking() {
922
- let response = await client.mutate({
923
- mutation: gql`
924
- mutation scanProductPacking($orderPackageItemId: String!, $productBarcode: String!, $serialNumber: String) {
925
- scanProductPacking(
926
- orderPackageItemId: $orderPackageItemId
927
- productBarcode: $productBarcode
928
- serialNumber: $serialNumber
929
- ) {
930
- worksheetDetailInfos {
931
- id
932
- name
933
- palletId
934
- cartonId
935
- batchId
936
- batchIdRef
937
- sku
938
- product {
919
+ if (this._scanning) throw new Error(i18next.t('text.previous_scan_is_executing'))
920
+ this._scanning = true
921
+
922
+ try {
923
+ let response = await client.mutate({
924
+ mutation: gql`
925
+ mutation scanProductPacking($orderPackageItemId: String!, $productBarcode: String!, $serialNumber: String) {
926
+ scanProductPacking(
927
+ orderPackageItemId: $orderPackageItemId
928
+ productBarcode: $productBarcode
929
+ serialNumber: $serialNumber
930
+ ) {
931
+ worksheetDetailInfos {
939
932
  id
940
933
  name
941
- description
942
- gtin
943
- isRequireSerialNumberScanningOutbound
944
- productDetails {
945
- id
946
- packingType
947
- packingSize
948
- gtin
949
- }
950
- }
951
- qty
952
- releaseQty
953
- packedQty
954
- status
955
- targetName
956
- packingType
957
- packingSize
958
- binLocation {
959
- name
960
- }
961
- relatedOrderInv {
934
+ palletId
935
+ cartonId
962
936
  batchId
963
937
  batchIdRef
964
- packingType
965
- refWorksheetId
938
+ sku
966
939
  product {
967
940
  id
968
- sku
969
941
  name
970
942
  description
943
+ gtin
971
944
  isRequireSerialNumberScanningOutbound
945
+ productDetails {
946
+ id
947
+ packingType
948
+ packingSize
949
+ gtin
950
+ }
951
+ }
952
+ qty
953
+ releaseQty
954
+ packedQty
955
+ status
956
+ targetName
957
+ packingType
958
+ packingSize
959
+ binLocation {
960
+ name
961
+ }
962
+ relatedOrderInv {
963
+ batchId
964
+ batchIdRef
965
+ packingType
966
+ refWorksheetId
967
+ product {
968
+ id
969
+ sku
970
+ name
971
+ description
972
+ isRequireSerialNumberScanningOutbound
973
+ }
972
974
  }
973
975
  }
974
976
  }
975
977
  }
978
+ `,
979
+ variables: {
980
+ orderPackageItemId: this._selectedOrderInventory.id,
981
+ productBarcode: this.productBarcodeInput.value.trim(),
982
+ serialNumber:
983
+ this._isRequireSerialNumberScanningOutbound && this._isBatchPicking ? this.serialInput.value.trim() : null
976
984
  }
977
- `,
978
- variables: {
979
- orderPackageItemId: this._selectedOrderInventory.id,
980
- productBarcode: this.productBarcodeInput.value.trim(),
981
- serialNumber:
982
- this._isRequireSerialNumberScanningOutbound && this._isBatchPicking ? this.serialInput.value.trim() : null
983
- }
984
- })
985
+ })
985
986
 
986
- if (!response.errors) {
987
- const { worksheetDetailInfos } = response.data.scanProductPacking
987
+ if (!response.errors) {
988
+ const { worksheetDetailInfos } = response.data.scanProductPacking
989
+
990
+ let rec = this.data.records.map(data => {
991
+ let info = worksheetDetailInfos.find(wd => wd.id == data.id)
992
+ if (info) {
993
+ return {
994
+ ...data,
995
+ packingProgress: `${info?.packedQty} / ${info.releaseQty}`,
996
+ packedQty: info.packedQty,
997
+ status: info.status,
998
+ completed: info.status === WORKSHEET_STATUS.DONE.value
999
+ }
1000
+ } else {
1001
+ return data
1002
+ }
1003
+ })
1004
+ this.data = { records: rec.sort((a, b) => a.completed - b.completed) }
988
1005
 
989
- let rec = this.data.records.map(data => {
990
- let info = worksheetDetailInfos.find(wd => wd.id == data.id)
991
- if (info) {
992
- return {
993
- ...data,
994
- packingProgress: `${info?.packedQty} / ${info.releaseQty}`,
995
- packedQty: info.packedQty,
996
- status: info.status,
997
- completed: info.status === WORKSHEET_STATUS.DONE.value
1006
+ this.toggleComplete = Boolean(this.releaseGood?.remark)
1007
+ ? this.data.records.every(res => res.status === 'DONE') && worksheetInfo.releaseGood?.checkedRemarkAt !== null
1008
+ : this.data.records.every(res => res.status === 'DONE')
1009
+
1010
+ if (this.toggleComplete) this.fetchInventories(this.releaseGoodNo)
1011
+
1012
+ if (this._selectedOrderInventory) {
1013
+ const record = this.data.records.find(record => record.name === this._selectedOrderInventory.name)
1014
+ if (record?.packedQty == record?.releaseQty) {
1015
+ this._selectedOrderInventory = null
1016
+ this._selectedTaskStatus = null
1017
+ this.inputForm.reset()
998
1018
  }
999
1019
  } else {
1000
- return data
1020
+ this._selectedOrderInventory = this.data.records[0]
1021
+ this._isRequireSerialNumberScanningOutbound =
1022
+ this.data.records[0].product?.isRequireSerialNumberScanningOutbound
1001
1023
  }
1002
- })
1003
- this.data = { records: rec.sort((a, b) => a.completed - b.completed) }
1004
-
1005
- this.toggleComplete = Boolean(this.releaseGood?.remark)
1006
- ? this.data.records.every(res => res.status === 'DONE') && worksheetInfo.releaseGood?.checkedRemarkAt !== null
1007
- : this.data.records.every(res => res.status === 'DONE')
1008
1024
 
1009
- if (this.toggleComplete) this.fetchInventories(this.releaseGoodNo)
1010
-
1011
- if (this._selectedOrderInventory) {
1012
- const record = this.data.records.find(record => record.name === this._selectedOrderInventory.name)
1013
- if (record?.packedQty == record?.releaseQty) {
1014
- this._selectedOrderInventory = null
1015
- this._selectedTaskStatus = null
1016
- this.inputForm.reset()
1025
+ if (this.toggleComplete && this.airwayBill) {
1026
+ this.printBill()
1017
1027
  }
1018
- } else {
1019
- this._selectedOrderInventory = this.data.records[0]
1020
- this._isRequireSerialNumberScanningOutbound =
1021
- this.data.records[0].product?.isRequireSerialNumberScanningOutbound
1022
- }
1023
1028
 
1024
- if (this.toggleComplete && this.airwayBill) {
1025
- this.printBill()
1026
- }
1029
+ if (this._enableProductScanning) {
1030
+ this.focusOnProductBarcodeInput()
1031
+ } else {
1032
+ this.focusOnReleaseQtyInput()
1033
+ }
1027
1034
 
1028
- if (this._enableProductScanning) {
1029
- this.focusOnProductBarcodeInput()
1030
- } else {
1031
- this.focusOnReleaseQtyInput()
1035
+ this.updateContext()
1032
1036
  }
1033
1037
 
1034
- this.updateContext()
1038
+ return response
1039
+ } catch (e) {
1040
+ this.showToast(e)
1041
+ } finally {
1042
+ this._scanning = false
1035
1043
  }
1036
-
1037
- return response
1038
1044
  }
1039
1045
 
1040
1046
  async commonPacking() {
1041
- return await client.mutate({
1042
- mutation: gql`
1043
- mutation packing($orderPackageItemId: String!, $releaseQty: Int!, $serialNumber: String) {
1044
- packing(orderPackageItemId: $orderPackageItemId, releaseQty: $releaseQty, serialNumber: $serialNumber)
1047
+ if (this._scanning) throw new Error(i18next.t('text.previous_scan_is_executing'))
1048
+ this._scanning = true
1049
+
1050
+ try {
1051
+ return await client.mutate({
1052
+ mutation: gql`
1053
+ mutation packing($orderPackageItemId: String!, $releaseQty: Int!, $serialNumber: String) {
1054
+ packing(orderPackageItemId: $orderPackageItemId, releaseQty: $releaseQty, serialNumber: $serialNumber)
1055
+ }
1056
+ `,
1057
+ variables: {
1058
+ orderPackageItemId: this._selectedOrderInventory.id,
1059
+ releaseQty:
1060
+ this._isRequireSerialNumberScanningOutbound && this._isBatchPicking
1061
+ ? 1
1062
+ : parseInt(this.releaseQtyInput.value),
1063
+ serialNumber:
1064
+ this._isRequireSerialNumberScanningOutbound && this._isBatchPicking ? this.serialInput.value.trim() : null
1045
1065
  }
1046
- `,
1047
- variables: {
1048
- orderPackageItemId: this._selectedOrderInventory.id,
1049
- releaseQty:
1050
- this._isRequireSerialNumberScanningOutbound && this._isBatchPicking
1051
- ? 1
1052
- : parseInt(this.releaseQtyInput.value),
1053
- serialNumber:
1054
- this._isRequireSerialNumberScanningOutbound && this._isBatchPicking ? this.serialInput.value.trim() : null
1055
- }
1056
- })
1066
+ })
1067
+ } catch (e) {
1068
+ this.showToast(e)
1069
+ } finally {
1070
+ this._scanning = false
1071
+ }
1057
1072
  }
1058
1073
 
1059
1074
  validatePacking() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/operato-wms",
3
- "version": "4.3.313",
3
+ "version": "4.3.315",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "client/index.js",
6
6
  "things-factory": true,
@@ -108,7 +108,7 @@
108
108
  "@things-factory/transport-base": "^4.3.301",
109
109
  "@things-factory/tutorial-ui": "^4.3.281",
110
110
  "@things-factory/warehouse-base": "^4.3.310",
111
- "@things-factory/worksheet-base": "^4.3.313"
111
+ "@things-factory/worksheet-base": "^4.3.315"
112
112
  },
113
113
  "devDependencies": {
114
114
  "@things-factory/builder": "^4.3.281",
@@ -117,5 +117,5 @@
117
117
  "cypress-localstorage-commands": "^1.6.1",
118
118
  "eslint-plugin-cypress": "^2.12.1"
119
119
  },
120
- "gitHead": "fd59df386439acded1fafc99eeffd0a1c5b2aa49"
120
+ "gitHead": "ea6e50379096ea6ae3f8c76aff50a65b49ea5dd2"
121
121
  }