@things-factory/operato-wms 4.3.212 → 4.3.214

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.
@@ -135,7 +135,7 @@ class AdjustPalletQty extends localize(i18next)(LitElement) {
135
135
  }
136
136
  }
137
137
  `,
138
- variables: { name: this.record?.opName, patch: { palletQty: parseInt(this._palletQtyInput.value) } }
138
+ variables: { name: this.record?.name, patch: { palletQty: parseInt(this._palletQtyInput.value) } }
139
139
  })
140
140
 
141
141
  if (!response.errors) {
@@ -119,7 +119,11 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
119
119
  }
120
120
 
121
121
  get cartonInput() {
122
- return this.shadowRoot.querySelector('barcode-scanable-input[name=cartonId]').shadowRoot.querySelector('input')
122
+ return this.shadowRoot.querySelector('barcode-scanable-input[name=cartonId]')
123
+ }
124
+
125
+ get palletInput() {
126
+ return this.shadowRoot.querySelector('barcode-scanable-input[name=palletId]')
123
127
  }
124
128
 
125
129
  get grist() {
@@ -150,10 +154,6 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
150
154
  return this.shadowRoot.querySelector('barcode-scanable-input[name=orderNo]').shadowRoot.querySelector('input')
151
155
  }
152
156
 
153
- get palletInput() {
154
- return this.shadowRoot.querySelector('barcode-scanable-input[name=palletId]').shadowRoot.querySelector('input')
155
- }
156
-
157
157
  get qtyInput() {
158
158
  return this.shadowRoot.querySelector('input[name=transferQty]')
159
159
  }
@@ -162,6 +162,10 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
162
162
  return this.shadowRoot.querySelector('barcode-scanable-input[name=toPalletId]').shadowRoot.querySelector('input')
163
163
  }
164
164
 
165
+ getInput = inputSelector => {
166
+ return inputSelector?.shadowRoot.querySelector('input')
167
+ }
168
+
165
169
  render() {
166
170
  return html`
167
171
  <form id="info-form" class="multi-column-form">
@@ -243,7 +247,6 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
243
247
  ? html` <label>${i18next.t('label.location')}</label>
244
248
  <barcode-scanable-input
245
249
  name="locationCode"
246
- .value=${this._location}
247
250
  custom-input
248
251
  ?scan-only=${this._pageSettings?.cameraScanOnly}
249
252
  @keypress="${async e => {
@@ -276,7 +279,6 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
276
279
  ? html` <label>${i18next.t('label.to_lot_barcode')}</label>
277
280
  <barcode-scanable-input
278
281
  name="toPalletId"
279
- .value=${this._location}
280
282
  custom-input
281
283
  ?scan-only=${this._pageSettings?.cameraScanOnly}
282
284
  @keypress="${async e => {
@@ -545,6 +547,11 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
545
547
  id
546
548
  name
547
549
  }
550
+ sku
551
+ completed
552
+ packingTypeSize
553
+ reusablePalletName
554
+ expirationPeriod
548
555
  }
549
556
  }
550
557
  }
@@ -559,43 +566,8 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
559
566
  this._worksheetInfo = worksheetInfo
560
567
  this._bizplaceName = worksheetInfo.bizplaceName
561
568
 
562
- this.data = {
563
- records: response.data.putawayWorksheet.worksheetDetailInfos
564
- .map(record => {
565
- let reusablePalletName = ''
566
- if (record.reusablePallet) {
567
- reusablePalletName = record.reusablePallet.name
568
- }
569
- return {
570
- ...record,
571
- completed: record.status === WORKSHEET_STATUS.DONE.value,
572
- packingTypeSize: `${record.packingType}(${record.packingSize})`,
573
- reusablePalletName: reusablePalletName,
574
- sku: record.product.sku,
575
- expirationPeriod: record.product.expirationPeriod,
576
- expirationDate: record.expirationDate
577
- }
578
- })
579
- .sort((a, b) => {
580
- if (a.completed !== b.completed) {
581
- if (a.completed) return 1
582
- if (b.completed) return -1
583
- }
584
-
585
- if (a.batchId > b.batchId) return 1
586
- if (b.batchId < b.batchId) return -1
587
-
588
- if (a.palletId > b.palletId) return 1
589
- if (a.palletId < b.palletId) return -1
590
-
591
- return 0
592
- })
593
- }
594
-
595
569
  this._enableCartonLabel = await fetchSettingRule('enable-carton-label', partnerDomainId)
596
- if (this._enableCartonLabel) this._focusOnCartonInput()
597
- else this._focusOnPalletInput()
598
- this._completeHandler()
570
+ this._massageItemList(response.data.putawayWorksheet.worksheetDetailInfos)
599
571
  }
600
572
  } else if (this.refOrderType === AVAIL_ORDER_TYPES.CUSTOMER_RETURN.value) {
601
573
  const response = await client.query({
@@ -865,21 +837,22 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
865
837
  this.updateContext()
866
838
  }
867
839
 
868
- _transactionHandler(e) {
840
+ async _transactionHandler(e) {
869
841
  if (e.keyCode === 13) {
870
842
  if (this.refOrderType === AVAIL_ORDER_TYPES.ARRIVAL_NOTICE.value) {
871
843
  if (this._operationType === OPERATION_TYPE.PUTAWAY) {
872
- this._arrivalNoticePutaway()
844
+ this.data = { records: [] }
845
+ await this._arrivalNoticePutaway()
873
846
  } else if (this._operationType === OPERATION_TYPE.TRANSFER) {
874
- this._transfer()
847
+ await this._transfer()
875
848
  }
876
849
  } else if (this._operationType === OPERATION_TYPE.PUTAWAY) {
877
850
  if (this.refOrderType === AVAIL_ORDER_TYPES.CUSTOMER_RETURN.value) {
878
- this._customerReturnPutaway()
851
+ await this._customerReturnPutaway()
879
852
  } else if (this.refOrderType === AVAIL_ORDER_TYPES.WAREHOUSE_RETURN.value) {
880
- this._warehouseReturnPutaway()
853
+ await this._warehouseReturnPutaway()
881
854
  } else if (this.refOrderType === AVAIL_ORDER_TYPES.REPLENISHMENT.value) {
882
- this._replenishmentPutaway()
855
+ await this._replenishmentPutaway()
883
856
  }
884
857
  }
885
858
  }
@@ -888,64 +861,77 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
888
861
  async _arrivalNoticePutaway() {
889
862
  if (this._scanning === false) {
890
863
  this._scanning = true
864
+ this.grist.showSpinner()
891
865
  try {
892
- const locationDetails = await this._fetchLocation(
893
- this.locationInput ? this.locationInput.value.trim() : this._selectedLocation.trim()
894
- )
895
-
896
- let worksheetDetailNames = await this._getWorksheetDetailNames(locationDetails)
897
-
898
- if (!worksheetDetailNames) {
899
- return (this._scanning = false)
900
- }
901
-
902
866
  const response = await client.mutate({
903
867
  mutation: gql`
904
868
  mutation putaway(
869
+ $arrivalNoticeNo: String!
905
870
  $worksheetDetailName: [String]!
906
871
  $palletId: String
907
872
  $cartonId: String
908
873
  $toLocation: String!
909
874
  ) {
910
875
  putaway(
876
+ arrivalNoticeNo: $arrivalNoticeNo
911
877
  worksheetDetailName: $worksheetDetailName
912
878
  palletId: $palletId
913
879
  cartonId: $cartonId
914
880
  toLocation: $toLocation
915
- )
881
+ ) {
882
+ worksheetDetailInfos {
883
+ name
884
+ palletId
885
+ cartonId
886
+ batchId
887
+ expirationDate
888
+ batchIdRef
889
+ product {
890
+ sku
891
+ name
892
+ description
893
+ expirationPeriod
894
+ }
895
+ qty
896
+ status
897
+ description
898
+ targetName
899
+ packingType
900
+ packingSize
901
+ location {
902
+ name
903
+ description
904
+ }
905
+ reusablePallet {
906
+ id
907
+ name
908
+ }
909
+ completed
910
+ packingTypeSize
911
+ reusablePalletName
912
+ sku
913
+ expirationPeriod
914
+ }
915
+ }
916
916
  }
917
917
  `,
918
918
  variables: {
919
- worksheetDetailName: worksheetDetailNames,
920
- palletId: this._enableCartonLabel ? null : this.palletInput.value,
921
- cartonId: this._enableCartonLabel ? this.cartonInput.value : null,
919
+ arrivalNoticeNo: this._orderNo,
920
+ worksheetDetailName: this._records.map(x => x.name),
921
+ palletId: this._enableCartonLabel ? null : this.getInput(this.palletInput).value,
922
+ cartonId: this._enableCartonLabel ? this.getInput(this.cartonInput).value : null,
922
923
  toLocation: this.locationInput ? this.locationInput.value : this._selectedLocation
923
924
  }
924
925
  })
925
926
 
926
927
  if (!response.errors) {
927
- this._fetchProducts(this._orderNo)
928
- if (this._enableCartonLabel) {
929
- this.cartonInput.value = ''
930
- this._focusOnCartonInput()
931
- } else {
932
- this.palletInput.value = ''
933
- this._focusOnPalletInput()
934
- }
935
- this.incompleteLocationName = false
936
- this._selectedTaskStatus = null
937
- this._selectedOrderProduct = null
938
- this.recommendLocationName = null
939
- if (this.locationInput) {
940
- this.locationInput.value = ''
941
- } else {
942
- this._selectedLocation = ''
943
- }
928
+ this._massageItemList(response.data.putaway.worksheetDetailInfos)
944
929
  }
945
930
  } catch (e) {
946
931
  this._showToast(e)
947
932
  }
948
933
 
934
+ this.grist.hideSpinner()
949
935
  this._scanning = false
950
936
  } else {
951
937
  this._showToast({ message: i18next.t('text.previous_scan_is_executing') })
@@ -984,8 +970,8 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
984
970
  `,
985
971
  variables: {
986
972
  worksheetDetailName: worksheetDetailNames,
987
- palletId: this._enableCartonLabel ? null : this.palletInput.value,
988
- cartonId: this._enableCartonLabel ? this.cartonInput.value : null,
973
+ palletId: this._enableCartonLabel ? null : this.getInput(this.palletInput).value,
974
+ cartonId: this._enableCartonLabel ? this.getInput(this.cartonInput).value : null,
989
975
  toLocation: this.locationInput ? this.locationInput.value : this._selectedLocation
990
976
  }
991
977
  })
@@ -993,10 +979,10 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
993
979
  if (!response.errors) {
994
980
  this._fetchProducts(this._orderNo)
995
981
  if (this._enableCartonLabel) {
996
- this.cartonInput.value = ''
982
+ this.getInput(this.cartonInput).value = ''
997
983
  this._focusOnCartonInput()
998
984
  } else {
999
- this.palletInput.value = ''
985
+ this.getInput(this.palletInput).value = ''
1000
986
  this._focusOnPalletInput()
1001
987
  }
1002
988
  this.incompleteLocationName = false
@@ -1056,8 +1042,8 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
1056
1042
  `,
1057
1043
  variables: {
1058
1044
  worksheetDetailName: worksheetDetailNames,
1059
- palletId: this._enableCartonLabel ? null : this.palletInput.value,
1060
- cartonId: this._enableCartonLabel ? this.cartonInput.value : null,
1045
+ palletId: this._enableCartonLabel ? null : this.getInput(this.palletInput).value,
1046
+ cartonId: this._enableCartonLabel ? this.getInput(this.cartonInput).value : null,
1061
1047
  toLocation: this.locationInput ? this.locationInput.value : this._selectedLocation
1062
1048
  }
1063
1049
  })
@@ -1065,10 +1051,10 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
1065
1051
  if (!response.errors) {
1066
1052
  this._fetchProducts(this._orderNo)
1067
1053
  if (this._enableCartonLabel) {
1068
- this.cartonInput.value = ''
1054
+ this.getInput(this.cartonInput).value = ''
1069
1055
  this._focusOnCartonInput()
1070
1056
  } else {
1071
- this.palletInput.value = ''
1057
+ this.getInput(this.palletInput).value = ''
1072
1058
  this._focusOnPalletInput()
1073
1059
  }
1074
1060
 
@@ -1113,7 +1099,7 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
1113
1099
  `,
1114
1100
  variables: {
1115
1101
  worksheetDetailName: worksheetDetailNames,
1116
- cartonId: this._enableCartonLabel ? this.cartonInput.value : null,
1102
+ cartonId: this._enableCartonLabel ? this.getInput(this.cartonInput).value : null,
1117
1103
  toLocation: this.locationInput ? this.locationInput.value : this._selectedLocation
1118
1104
  }
1119
1105
  })
@@ -1121,10 +1107,10 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
1121
1107
  if (!response.errors) {
1122
1108
  this._fetchProducts(this._orderNo)
1123
1109
  if (this._enableCartonLabel) {
1124
- this.cartonInput.value = ''
1110
+ this.getInput(this.cartonInput).value = ''
1125
1111
  this._focusOnCartonInput()
1126
1112
  } else {
1127
- this.palletInput.value = ''
1113
+ this.getInput(this.palletInput).value = ''
1128
1114
  this._focusOnPalletInput()
1129
1115
  }
1130
1116
  this.incompleteLocationName = false
@@ -1157,7 +1143,7 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
1157
1143
  }
1158
1144
  `,
1159
1145
  variables: {
1160
- palletId: this.palletInput.value,
1146
+ palletId: this.getInput(this.palletInput).value,
1161
1147
  toPalletId: this.toPalletInput.value,
1162
1148
  qty: parseInt(this.qtyInput.value)
1163
1149
  }
@@ -1169,7 +1155,7 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
1169
1155
  this._selectedTaskStatus = null
1170
1156
  this._selectedOrderProduct = null
1171
1157
  this.recommendLocationName = null
1172
- this.palletInput.value = ''
1158
+ this.getInput(this.palletInput).value = ''
1173
1159
  this.toPalletInput.value = ''
1174
1160
  this.qtyInput.value = ''
1175
1161
  }
@@ -1220,7 +1206,7 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
1220
1206
  await this._validatePutaway()
1221
1207
  if (this._enableCartonLabel) {
1222
1208
  records = this.data.records
1223
- .filter(record => record.cartonId === this.cartonInput.value && record.status !== 'DONE')
1209
+ .filter(record => record.cartonId === this.getInput(this.cartonInput).value && record.status !== 'DONE')
1224
1210
  .map(record => {
1225
1211
  return {
1226
1212
  name: record.name,
@@ -1231,9 +1217,9 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
1231
1217
  })
1232
1218
  }
1233
1219
  if (records.length > 1) {
1234
- this._openPutawaySameCartonPopup(this.cartonInput.value)
1220
+ this._openPutawaySameCartonPopup(this.getInput(this.cartonInput).value)
1235
1221
  } else {
1236
- this._records = records
1222
+ this._records = this.data.records
1237
1223
  this._transactionHandler(e)
1238
1224
  }
1239
1225
  } catch (e) {
@@ -1267,27 +1253,27 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
1267
1253
  async _validatePutaway() {
1268
1254
  if (this._enableCartonLabel) {
1269
1255
  // 2. carton id existing
1270
- if (!this.cartonInput.value) {
1256
+ if (!this.getInput(this.cartonInput).value) {
1271
1257
  this._focusOnCartonInput()
1272
1258
  throw new Error(i18next.t('text.carton_id_is_empty'))
1273
1259
  }
1274
1260
 
1275
- if (!this.data.records.map(record => record.cartonId).includes(this.cartonInput?.value)) {
1276
- this.cartonInput.value = ''
1261
+ if (!this.data.records.map(record => record.cartonId).includes(this.getInput(this.cartonInput).value)) {
1262
+ this.getInput(this.cartonInput).value = ''
1277
1263
  this._focusOnCartonInput()
1278
1264
  throw new Error(i18next.t('text.unable_to_find_matching_x', { state: { x: i18next.t('label.carton') } }))
1279
1265
  }
1280
1266
  } else {
1281
1267
  if (!this._selectedOrderProduct) throw new Error(i18next.t('text.target_is_not_selected'))
1282
1268
  // 2. pallet id existing
1283
- if (!this.palletInput.value) {
1269
+ if (!this.getInput(this.palletInput).value) {
1284
1270
  this._focusOnPalletInput()
1285
1271
  throw new Error(i18next.t('text.lot_id_is_empty'))
1286
1272
  }
1287
1273
 
1288
1274
  // 3. equality of pallet id
1289
- if (this._selectedOrderProduct.reusablePalletName !== this.palletInput.value) {
1290
- if (this._selectedOrderProduct.palletId !== this.palletInput.value) {
1275
+ if (this._selectedOrderProduct.reusablePalletName !== this.getInput(this.palletInput).value) {
1276
+ if (this._selectedOrderProduct.palletId !== this.getInput(this.palletInput).value) {
1291
1277
  setTimeout(() => this.palletInput.select(), 100)
1292
1278
  throw new Error(i18next.t('text.wrong_lot_id'))
1293
1279
  }
@@ -1345,13 +1331,13 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
1345
1331
  if (!this._selectedOrderProduct) throw new Error(i18next.t('text.target_is_not_selected'))
1346
1332
 
1347
1333
  // 2. pallet id existing
1348
- if (!this.palletInput.value) {
1334
+ if (!this.getInput(this.palletInput).value) {
1349
1335
  this._focusOnPalletInput()
1350
1336
  throw new Error(i18next.t('text.lot_id_is_empty'))
1351
1337
  }
1352
1338
 
1353
1339
  // 3. Equality of pallet id
1354
- if (this._selectedOrderProduct.palletId !== this.palletInput.value) {
1340
+ if (this._selectedOrderProduct.palletId !== this.getInput(this.palletInput).value) {
1355
1341
  setTimeout(() => this.palletInput.select(), 100)
1356
1342
  throw new Error(i18next.t('text.wrong_lot_id'))
1357
1343
  }
@@ -1477,10 +1463,10 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
1477
1463
  history.back()
1478
1464
  await this._fetchProducts(this._orderNo)
1479
1465
  if (this._enableCartonLabel) {
1480
- this.cartonInput.value = ''
1466
+ this.getInput(this.cartonInput).value = ''
1481
1467
  this._focusOnCartonInput()
1482
1468
  } else {
1483
- this.palletInput.value = ''
1469
+ this.getInput(this.palletInput).value = ''
1484
1470
  this._focusOnPalletInput()
1485
1471
  }
1486
1472
  this._selectedTaskStatus = null
@@ -1632,6 +1618,31 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
1632
1618
  }
1633
1619
  }
1634
1620
 
1621
+ _massageItemList(worksheetDetailInfos) {
1622
+ if (this._enableCartonLabel) {
1623
+ if (this.cartonInput) this.getInput(this.cartonInput).value = ''
1624
+ this._focusOnCartonInput()
1625
+ } else {
1626
+ if (this.palletInput) this.getInput(this.palletInput).value = ''
1627
+ this._focusOnPalletInput()
1628
+ }
1629
+
1630
+ this.incompleteLocationName = false
1631
+ this._selectedTaskStatus = null
1632
+ this._selectedOrderProduct = null
1633
+ this.recommendLocationName = null
1634
+
1635
+ if (this.locationInput) {
1636
+ this.locationInput.value = ''
1637
+ } else {
1638
+ this._selectedLocation = ''
1639
+ }
1640
+
1641
+ this.data = { records: worksheetDetailInfos }
1642
+
1643
+ this._completeHandler()
1644
+ }
1645
+
1635
1646
  _showToast({ type, message }) {
1636
1647
  document.dispatchEvent(
1637
1648
  new CustomEvent('notify', {
@@ -247,6 +247,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
247
247
  e.preventDefault()
248
248
  if (this.orderNoInput.value) {
249
249
  this._clearView()
250
+ this._scanning = false
250
251
  this._fetchProducts(this.orderNoInput.value)
251
252
  this.orderNoInput.value = ''
252
253
  }
@@ -672,77 +673,82 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
672
673
  }
673
674
  }
674
675
 
675
- async _fetchProducts(orderNo) {
676
+ async _fetchProducts(orderNo, response) {
676
677
  if (this.refOrderType === AVAIL_ORDER_TYPES.ARRIVAL_NOTICE.value) {
677
- const response = await client.query({
678
- query: gql`
679
- query unloadingWorksheet($arrivalNoticeNo: String!) {
680
- unloadingWorksheet(arrivalNoticeNo: $arrivalNoticeNo) {
681
- worksheetInfo {
682
- arrivalNotice {
683
- id
684
- name
685
- }
686
- bizplaceName
687
- partnerDomainId
688
- customerCompanyDomainId
689
- containerNo
690
- refNo
691
- refNo2
692
- refNo3
693
- looseItem
694
- bufferLocation
695
- startedAt
696
- orderVas {
697
- targetVas {
678
+ if (!response) {
679
+ response = await client.query({
680
+ query: gql`
681
+ query unloadingWorksheet($arrivalNoticeNo: String!) {
682
+ unloadingWorksheet(arrivalNoticeNo: $arrivalNoticeNo) {
683
+ worksheetInfo {
684
+ arrivalNotice {
698
685
  id
699
686
  name
700
- vas {
687
+ }
688
+ bizplaceName
689
+ partnerDomainId
690
+ customerCompanyDomainId
691
+ containerNo
692
+ refNo
693
+ refNo2
694
+ refNo3
695
+ looseItem
696
+ bufferLocation
697
+ startedAt
698
+ orderVas {
699
+ targetVas {
701
700
  id
702
701
  name
703
- description
704
- type
702
+ vas {
703
+ id
704
+ name
705
+ description
706
+ type
707
+ }
708
+ qty
709
+ remark
705
710
  }
706
- qty
707
- remark
708
711
  }
709
712
  }
710
- }
711
- worksheetDetailInfos {
712
- id
713
- batchId
714
- batchIdRef
715
- product {
713
+ worksheetDetailInfos {
716
714
  id
717
- sku
715
+ batchId
716
+ batchIdRef
717
+ product {
718
+ id
719
+ sku
720
+ name
721
+ description
722
+ isRequiredCheckExpiry
723
+ isRequireSerialNumberScanningInbound
724
+ expirationPeriod
725
+ }
718
726
  name
727
+ targetName
719
728
  description
720
- isRequiredCheckExpiry
721
- isRequireSerialNumberScanningInbound
722
- expirationPeriod
729
+ packingSize
730
+ packingType
731
+ palletQty
732
+ actualPalletQty
733
+ packQty
734
+ actualPackQty
735
+ issue
736
+ manufactureDate
737
+ remark
723
738
  }
724
- name
725
- targetName
726
- description
727
- packingSize
728
- packingType
729
- palletQty
730
- actualPalletQty
731
- packQty
732
- actualPackQty
733
- issue
734
- manufactureDate
735
- remark
736
739
  }
737
740
  }
738
- }
739
- `,
740
- variables: { arrivalNoticeNo: orderNo }
741
- })
741
+ `,
742
+ variables: { arrivalNoticeNo: orderNo }
743
+ })
744
+ }
742
745
 
743
746
  if (!response.errors) {
747
+ const responseType = response.data?.unloadingWorksheet?.worksheetInfo
748
+ ? response.data.unloadingWorksheet
749
+ : response.data.unload
744
750
  this._worksheetLoaded = true
745
- const worksheetInfo = response.data.unloadingWorksheet.worksheetInfo
751
+ const worksheetInfo = responseType.worksheetInfo
746
752
  const orderVasInfo = worksheetInfo.orderVas
747
753
 
748
754
  this._orderNo = orderNo
@@ -771,7 +777,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
771
777
  : { records: [] }
772
778
 
773
779
  const worksheetDetailInfo = orderBy(
774
- response.data.unloadingWorksheet.worksheetDetailInfos.map(worksheetDetailInfo => {
780
+ responseType.worksheetDetailInfos.map(worksheetDetailInfo => {
775
781
  return {
776
782
  ...worksheetDetailInfo,
777
783
  validity:
@@ -1020,6 +1026,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1020
1026
  let orderProducts = await this._validateUnloading()
1021
1027
 
1022
1028
  if (!orderProducts || !orderProducts.errors) {
1029
+ this.orderProductData = { records: [] }
1023
1030
  if (orderProducts?.length > 1) {
1024
1031
  this.selectOrderProduct(orderProducts)
1025
1032
  } else {
@@ -1168,11 +1175,79 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1168
1175
  try {
1169
1176
  const response = await client.mutate({
1170
1177
  mutation: gql`
1171
- mutation unload($worksheetDetailName: String!, $inventory: InventoryPatch!, $productBarcode: String) {
1172
- unload(worksheetDetailName: $worksheetDetailName, inventory: $inventory, productBarcode: $productBarcode)
1178
+ mutation unload(
1179
+ $worksheetDetailName: String!
1180
+ $inventory: InventoryPatch!
1181
+ $productBarcode: String
1182
+ $orderType: String
1183
+ ) {
1184
+ unload(
1185
+ worksheetDetailName: $worksheetDetailName
1186
+ inventory: $inventory
1187
+ productBarcode: $productBarcode
1188
+ orderType: $orderType
1189
+ ) {
1190
+ worksheetInfo {
1191
+ arrivalNotice {
1192
+ id
1193
+ name
1194
+ }
1195
+ bizplaceName
1196
+ partnerDomainId
1197
+ customerCompanyDomainId
1198
+ containerNo
1199
+ refNo
1200
+ refNo2
1201
+ refNo3
1202
+ looseItem
1203
+ bufferLocation
1204
+ startedAt
1205
+ orderVas {
1206
+ targetVas {
1207
+ id
1208
+ name
1209
+ vas {
1210
+ id
1211
+ name
1212
+ description
1213
+ type
1214
+ }
1215
+ qty
1216
+ remark
1217
+ }
1218
+ }
1219
+ }
1220
+ worksheetDetailInfos {
1221
+ id
1222
+ batchId
1223
+ batchIdRef
1224
+ product {
1225
+ id
1226
+ sku
1227
+ name
1228
+ description
1229
+ isRequiredCheckExpiry
1230
+ isRequireSerialNumberScanningInbound
1231
+ expirationPeriod
1232
+ }
1233
+ name
1234
+ targetName
1235
+ description
1236
+ packingSize
1237
+ packingType
1238
+ palletQty
1239
+ actualPalletQty
1240
+ packQty
1241
+ actualPackQty
1242
+ issue
1243
+ manufactureDate
1244
+ remark
1245
+ }
1246
+ }
1173
1247
  }
1174
1248
  `,
1175
1249
  variables: {
1250
+ orderType: this.refOrderType === AVAIL_ORDER_TYPES.ARRIVAL_NOTICE.value ? 'arrivalNotice' : 'returnOrder',
1176
1251
  worksheetDetailName: this._selectedOrderProduct?.name || '',
1177
1252
  inventory: {
1178
1253
  palletId: this._enableCartonLabel ? null : this.lotInput.value.trim(),
@@ -1185,7 +1260,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1185
1260
  }
1186
1261
  })
1187
1262
  if (!response.errors) {
1188
- await this._fetchProducts(this._orderNo)
1263
+ await this._fetchProducts(this._orderNo, response)
1189
1264
  }
1190
1265
  } catch (e) {
1191
1266
  this._showToast(e)
@@ -363,8 +363,8 @@ class WorksheetPutaway extends localize(i18next)(PageView) {
363
363
  if (!this._worksheetNo) return
364
364
  const response = await client.query({
365
365
  query: gql`
366
- query worksheet($name: String!) {
367
- worksheet(name: $name) {
366
+ query inboundWorksheetDetails($name: String!) {
367
+ inboundWorksheetDetails(name: $name) {
368
368
  status
369
369
  arrivalNotice {
370
370
  name
@@ -398,19 +398,18 @@ class WorksheetPutaway extends localize(i18next)(PageView) {
398
398
  }
399
399
  bizplace {
400
400
  name
401
- description
402
401
  }
403
402
  bufferLocation {
404
403
  name
405
- description
406
404
  warehouse {
407
- id
405
+ name
408
406
  }
409
407
  }
410
408
  worksheetDetails {
411
409
  name
412
410
  description
413
411
  targetInventory {
412
+ id
414
413
  inventory {
415
414
  batchId
416
415
  batchIdRef
@@ -439,7 +438,7 @@ class WorksheetPutaway extends localize(i18next)(PageView) {
439
438
  })
440
439
 
441
440
  if (!response.errors) {
442
- const worksheet = response.data.worksheet
441
+ const worksheet = response.data.inboundWorksheetDetails
443
442
  const worksheetDetails = worksheet.worksheetDetails
444
443
  this._worksheetStatus = worksheet.status
445
444
  this._ganNo = (worksheet.arrivalNotice && worksheet.arrivalNotice.name) || ''
@@ -110,7 +110,7 @@ class WorksheetUnloading extends localize(i18next)(PageView) {
110
110
  }
111
111
 
112
112
  get context() {
113
- var actions = [
113
+ let actions = [
114
114
  {
115
115
  title: i18next.t('button.back'),
116
116
  action: () => navigate('inbound_worksheets'),
@@ -460,8 +460,8 @@ class WorksheetUnloading extends localize(i18next)(PageView) {
460
460
  if (!this._worksheetNo) return
461
461
  const response = await client.query({
462
462
  query: gql`
463
- query worksheet($name: String!) {
464
- worksheet(name: $name) {
463
+ query inboundWorksheetDetails($name: String!) {
464
+ inboundWorksheetDetails(name: $name) {
465
465
  id
466
466
  name
467
467
  status
@@ -473,9 +473,6 @@ class WorksheetUnloading extends localize(i18next)(PageView) {
473
473
  refNo2
474
474
  refNo3
475
475
  crossDocking
476
- releaseGood {
477
- name
478
- }
479
476
  looseItem
480
477
  }
481
478
  orderVass {
@@ -511,13 +508,9 @@ class WorksheetUnloading extends localize(i18next)(PageView) {
511
508
  }
512
509
  }
513
510
  bufferLocation {
514
- id
515
511
  name
516
- description
517
512
  warehouse {
518
- id
519
513
  name
520
- description
521
514
  }
522
515
  }
523
516
  worksheetDetails {
@@ -554,7 +547,7 @@ class WorksheetUnloading extends localize(i18next)(PageView) {
554
547
  })
555
548
 
556
549
  if (!response.errors) {
557
- const worksheet = response.data.worksheet
550
+ const worksheet = response.data.inboundWorksheetDetails
558
551
  const worksheetDetails = worksheet.worksheetDetails
559
552
  const partnerDomainId = worksheet.bizplace.domain.id
560
553
  this._worksheetStatus = worksheet.status
@@ -577,28 +570,16 @@ class WorksheetUnloading extends localize(i18next)(PageView) {
577
570
 
578
571
  this.data = {
579
572
  records: worksheetDetails.map(worksheetDetail => {
573
+ const targetProduct = worksheetDetail.targetProduct
580
574
  return {
575
+ ...worksheetDetail,
581
576
  ...worksheetDetail.targetProduct,
582
- id: worksheetDetail.id,
583
- opName: worksheetDetail.targetProduct.name,
584
- name: worksheetDetail.name,
585
- status: worksheetDetail.status,
586
- description: worksheetDetail.description,
587
- issue: worksheetDetail.issue,
588
- initialBatchId: worksheetDetail.targetProduct.batchId,
589
- productSku: worksheetDetail.targetProduct.product.sku,
590
- productBrand: worksheetDetail.targetProduct.product.brand,
591
- hasBatchChanges:
592
- worksheetDetail.targetProduct &&
593
- worksheetDetail.targetProduct.batchId !== worksheetDetail.targetProduct.initialBatchId
594
- ? false
595
- : true,
577
+ initialBatchId: targetProduct.batchId,
578
+ productSku: targetProduct.product.sku,
579
+ productBrand: targetProduct.product.brand,
580
+ hasBatchChanges: targetProduct && targetProduct.batchId !== targetProduct.initialBatchId ? false : true,
596
581
  isPalletized:
597
- worksheetDetail.targetProduct &&
598
- worksheetDetail.targetProduct.palletQty &&
599
- Number(worksheetDetail.targetProduct.palletQty) > 0
600
- ? true
601
- : false,
582
+ targetProduct && targetProduct.palletQty && Number(targetProduct.palletQty) > 0 ? true : false,
602
583
  isLooseItem: worksheet.arrivalNotice.looseItem ? true : false
603
584
  }
604
585
  })
@@ -349,7 +349,6 @@ class ArrivalNoticeDetail extends localize(i18next)(PageView) {
349
349
  })
350
350
  }
351
351
  }
352
-
353
352
  if (this._status === ORDER_STATUS.REJECTED.value) {
354
353
  titleName = i18next.t('title.rejected_arrival_notice_detail')
355
354
  }
@@ -726,7 +725,6 @@ class ArrivalNoticeDetail extends localize(i18next)(PageView) {
726
725
  this._ganNo = changes.resourceId || this._ganNo || ''
727
726
  this._template = null
728
727
  await this._fetchGAN()
729
- this.updateContext()
730
728
  }
731
729
  }
732
730
 
@@ -884,7 +882,6 @@ class ArrivalNoticeDetail extends localize(i18next)(PageView) {
884
882
  query arrivalNotice($name: String!) {
885
883
  arrivalNotice(name: $name) {
886
884
  id
887
- name
888
885
  bizplace {
889
886
  id
890
887
  name
@@ -1033,9 +1030,10 @@ class ArrivalNoticeDetail extends localize(i18next)(PageView) {
1033
1030
  }
1034
1031
  })
1035
1032
  }
1036
- this._enableCartonLabel = await fetchSettingRule('enable-carton-label', partnerDomainId)
1037
- this._strictProductSelection = await fetchSettingRule('strict-product-selection', partnerDomainId)
1038
- this._ganProcessingSetting = (await fetchSettingRule('gan-order-processing', partnerDomainId)) || '-1'
1033
+
1034
+ this._enableCartonLabel = fetchSettingRule('enable-carton-label', partnerDomainId)
1035
+ this._strictProductSelection = fetchSettingRule('strict-product-selection', partnerDomainId)
1036
+ this._ganProcessingSetting = fetchSettingRule('gan-order-processing', partnerDomainId) || '-1'
1039
1037
  this.updateContext()
1040
1038
  }
1041
1039
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/operato-wms",
3
- "version": "4.3.212",
3
+ "version": "4.3.214",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "client/index.js",
6
6
  "things-factory": true,
@@ -91,7 +91,7 @@
91
91
  "@things-factory/print-ui": "^4.3.179",
92
92
  "@things-factory/product-base": "^4.3.204",
93
93
  "@things-factory/resource-ui": "^4.3.179",
94
- "@things-factory/sales-ui": "^4.3.212",
94
+ "@things-factory/sales-ui": "^4.3.214",
95
95
  "@things-factory/scene-data-transform": "^4.3.159",
96
96
  "@things-factory/scene-excel": "^4.3.159",
97
97
  "@things-factory/scene-firebase": "^4.3.159",
@@ -108,7 +108,7 @@
108
108
  "@things-factory/transport-base": "^4.3.179",
109
109
  "@things-factory/tutorial-ui": "^4.3.179",
110
110
  "@things-factory/warehouse-base": "^4.3.212",
111
- "@things-factory/worksheet-base": "^4.3.212"
111
+ "@things-factory/worksheet-base": "^4.3.214"
112
112
  },
113
113
  "devDependencies": {
114
114
  "@things-factory/builder": "^4.3.179",
@@ -117,5 +117,5 @@
117
117
  "cypress-localstorage-commands": "^1.6.1",
118
118
  "eslint-plugin-cypress": "^2.12.1"
119
119
  },
120
- "gitHead": "16651f95d911fe112b0e4e92dc5c1c1c219a19ee"
120
+ "gitHead": "e645e543ec974ef1c10852a9e123eedb6783cf8a"
121
121
  }