@things-factory/operato-wms 4.3.103 → 4.3.104

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.
@@ -434,6 +434,7 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
434
434
  platform
435
435
  }
436
436
  worksheetDetailInfos {
437
+ id
437
438
  name
438
439
  palletId
439
440
  cartonId
@@ -769,12 +770,12 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
769
770
  this.serialInput.value = ''
770
771
  }
771
772
 
772
- this.fetchInventories(this.releaseGoodNo)
773
+ // this.fetchInventories(this.releaseGoodNo)
773
774
  }
774
775
  } catch (e) {
775
776
  if (this._isRequireSerialNumberScanningOutbound && this._isBatchPicking) this.serialInput.value = ''
776
777
  else if (this._enableProductScanning && !this._isRequireSerialNumberScanningOutbound) {
777
- this._focusOnProductBarcodeInput()
778
+ this.focusOnProductBarcodeInput()
778
779
  } else {
779
780
  this._focusOnReleaseQtyInput()
780
781
  this._selectedTaskStatus = null
@@ -782,9 +783,11 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
782
783
  this._selectedOrderInventory = null
783
784
  this.showToast(e)
784
785
  } finally {
785
- this._enableProductScanning && !this._isRequireSerialNumberScanningOutbound
786
- ? (this.productBarcodeInput.value = '')
787
- : (this.releaseQtyInput.value = '')
786
+ if (!this._isRequireSerialNumberScanningOutbound) {
787
+ this._enableProductScanning ? (this.productBarcodeInput.value = '') : (this.releaseQtyInput.value = '')
788
+ } else {
789
+ if (this._isBatchPicking) this.serialInput.value = ''
790
+ }
788
791
  this._scanning = false
789
792
  // time execution for product barcode scanning (without scanning machines): 308.0390625 ms
790
793
  console.timeEnd('time execution for product barcode scanning')
@@ -802,17 +805,114 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
802
805
  worksheetDetailName: $worksheetDetailName
803
806
  productBarcode: $productBarcode
804
807
  serialNumber: $serialNumber
805
- )
808
+ ) {
809
+ worksheetDetailInfos {
810
+ id
811
+ name
812
+ palletId
813
+ cartonId
814
+ batchId
815
+ batchIdRef
816
+ sku
817
+ product {
818
+ id
819
+ name
820
+ description
821
+ gtin
822
+ isRequireSerialNumberScanningOutbound
823
+ productDetails {
824
+ id
825
+ packingType
826
+ packingSize
827
+ gtin
828
+ }
829
+ }
830
+ qty
831
+ releaseQty
832
+ packedQty
833
+ status
834
+ targetName
835
+ packingType
836
+ packingSize
837
+ binLocation {
838
+ name
839
+ }
840
+ relatedOrderInv {
841
+ batchId
842
+ batchIdRef
843
+ packingType
844
+ refWorksheetId
845
+ product {
846
+ id
847
+ sku
848
+ name
849
+ description
850
+ isRequireSerialNumberScanningOutbound
851
+ }
852
+ }
853
+ }
854
+ }
806
855
  }
807
856
  `,
808
857
  variables: {
809
- worksheetDetailName: this._selectedOrderInventory.name,
858
+ worksheetDetailName: this._selectedOrderInventory.id,
810
859
  productBarcode: this.productBarcodeInput.value.trim(),
811
860
  serialNumber:
812
861
  this._isRequireSerialNumberScanningOutbound && this._isBatchPicking ? this.serialInput.value.trim() : null
813
862
  }
814
863
  })
815
864
 
865
+ if (!response.errors) {
866
+ const { worksheetDetailInfos } = response.data.scanProductPacking
867
+
868
+ let rec = this.data.records.map(data => {
869
+ let info = worksheetDetailInfos.find(wd => wd.id == data.id)
870
+ if (info) {
871
+ return {
872
+ ...data,
873
+ packingProgress: `${info?.packedQty} / ${info.releaseQty}`,
874
+ packedQty: info.packedQty,
875
+ status: info.status,
876
+ completed: info.status === WORKSHEET_STATUS.DONE.value
877
+ }
878
+ } else {
879
+ return data
880
+ }
881
+ })
882
+ this.data = { records: rec.sort((a, b) => a.completed - b.completed) }
883
+
884
+ this.toggleComplete = Boolean(this.releaseGood?.remark)
885
+ ? this.data.records.every(res => res.status === 'DONE') && worksheetInfo.releaseGood?.checkedRemarkAt !== null
886
+ : this.data.records.every(res => res.status === 'DONE')
887
+
888
+ if (this.toggleComplete) this.fetchInventories(this.releaseGoodNo)
889
+
890
+ if (this._selectedOrderInventory) {
891
+ const record = this.data.records.find(record => record.name === this._selectedOrderInventory.name)
892
+ if (record?.packedQty == record?.releaseQty) {
893
+ this._selectedOrderInventory = null
894
+ this._selectedTaskStatus = null
895
+ this.inputForm.reset()
896
+ }
897
+ } else {
898
+ this._selectedOrderInventory = this.data.records[0]
899
+ this._isRequireSerialNumberScanningOutbound =
900
+ this.data.records[0].product?.isRequireSerialNumberScanningOutbound
901
+ }
902
+
903
+ if (this.toggleComplete && this.airwayBill) {
904
+ this.printBill()
905
+ }
906
+
907
+ if (this._enableProductScanning) {
908
+ this.focusOnProductBarcodeInput()
909
+ } else {
910
+ this.focusOnReleaseQtyInput()
911
+ }
912
+
913
+ this.updateContext()
914
+ }
915
+
816
916
  return response
817
917
  }
818
918
 
@@ -860,7 +960,7 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
860
960
  throw new Error(i18next.t('text.scanned_product_status_is_done'))
861
961
  }
862
962
  } else {
863
- this._focusOnProductBarcodeInput()
963
+ this.focusOnProductBarcodeInput()
864
964
  throw new Error(i18next.t('text.incorrect_product_barcode'))
865
965
  }
866
966
  } else {
@@ -324,39 +324,41 @@ class PickingProduct extends connect(store)(localize(i18next)(PageView)) {
324
324
  name=${this.refPickingType === PICKING_TYPES.PICKING.value ? 'releaseGoodNo' : 'taskNo'}
325
325
  custom-input
326
326
  @keypress="${async e => {
327
- if (e.keyCode === 13) {
328
- e.preventDefault()
329
- if (this.binLocationInput) this.binLocationInput.value = ''
330
- if (this.productBarcodeInput) this.productBarcodeInput.value = ''
331
- if (this.cartonInput) this.cartonInput.value = ''
332
- if (this.palletInput) this.palletInput.value = ''
333
- if (this.serialInput) this.serialInput.value = ''
334
- this._selectedOrderInventory = null
335
- this._currentBinLocation = null
336
- if (this.refPickingType === PICKING_TYPES.PICKING.value) {
337
- if (this.releaseGoodNoInput.value) {
338
- this.releaseGoodNo = this.releaseGoodNoInput.value
339
- await this.fetchAll(this.releaseGoodNo)
340
- this.completeHandler()
341
- }
342
- } else {
343
- if (this.taskNoInput.value) {
344
- this.taskNo = this.taskNoInput.value
345
- await this.fetchAll(this.taskNo)
346
- this.completeHandler()
327
+ try {
328
+ if (e.keyCode === 13) {
329
+ e.preventDefault()
330
+ if (this.binLocationInput) this.binLocationInput.value = ''
331
+ if (this.productBarcodeInput) this.productBarcodeInput.value = ''
332
+ if (this.cartonInput) this.cartonInput.value = ''
333
+ if (this.palletInput) this.palletInput.value = ''
334
+ if (this.serialInput) this.serialInput.value = ''
335
+ this._selectedOrderInventory = null
336
+ this._currentBinLocation = null
337
+ if (this.refPickingType === PICKING_TYPES.PICKING.value) {
338
+ if (this.releaseGoodNoInput.value) {
339
+ this.releaseGoodNo = this.releaseGoodNoInput.value
340
+ await this.fetchAll(this.releaseGoodNo)
341
+ this.completeHandler()
342
+ }
343
+ } else {
344
+ if (this.taskNoInput.value) {
345
+ this.taskNo = this.taskNoInput.value
346
+ await this.fetchAll(this.taskNo)
347
+ this.completeHandler()
348
+ }
347
349
  }
350
+ let [enableProductScanning, enableToteScanning, enableInputQty] = await Promise.all([
351
+ fetchSettingRule('enable-product-scanning', this._worksheetInfo.partnerDomainId),
352
+ fetchSettingRule('enable-tote-scanning', this._worksheetInfo.partnerDomainId),
353
+ fetchSettingRule('enable-input-qty', this._worksheetInfo.partnerDomainId)
354
+ ])
355
+ this._enableProductScanning = enableProductScanning
356
+ this._enableToteScanning = enableToteScanning
357
+ this._enableInputQty = enableInputQty
358
+
359
+ this.focusOnInput()
348
360
  }
349
- let [enableProductScanning, enableToteScanning, enableInputQty] = await Promise.all([
350
- fetchSettingRule('enable-product-scanning', this._worksheetInfo.partnerDomainId),
351
- fetchSettingRule('enable-tote-scanning', this._worksheetInfo.partnerDomainId),
352
- fetchSettingRule('enable-input-qty', this._worksheetInfo.partnerDomainId)
353
- ])
354
- this._enableProductScanning = enableProductScanning
355
- this._enableToteScanning = enableToteScanning
356
- this._enableInputQty = enableInputQty
357
-
358
- this.focusOnInput()
359
- }
361
+ } catch (e) {}
360
362
  }}"
361
363
  >
362
364
  </barcode-scanable-input>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/operato-wms",
3
- "version": "4.3.103",
3
+ "version": "4.3.104",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "client/index.js",
6
6
  "things-factory": true,
@@ -109,7 +109,7 @@
109
109
  "@things-factory/transport-base": "^4.3.99",
110
110
  "@things-factory/tutorial-ui": "^4.3.99",
111
111
  "@things-factory/warehouse-base": "^4.3.103",
112
- "@things-factory/worksheet-base": "^4.3.103"
112
+ "@things-factory/worksheet-base": "^4.3.104"
113
113
  },
114
114
  "devDependencies": {
115
115
  "@things-factory/builder": "^4.3.99",
@@ -118,5 +118,5 @@
118
118
  "cypress-localstorage-commands": "^1.6.1",
119
119
  "eslint-plugin-cypress": "^2.12.1"
120
120
  },
121
- "gitHead": "f67847c87df7aa8d7857d5198fe47edb2672cb9d"
121
+ "gitHead": "de723f0bdb43ffb3456754911ffd3e4cb59890b2"
122
122
  }