@things-factory/operato-wms 4.3.248 → 4.3.250

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.
@@ -15,7 +15,7 @@ import { openPopup } from '@things-factory/layout-base'
15
15
  import { client, CustomAlert, navigate, PageView } from '@things-factory/shell'
16
16
  import { CommonButtonStyles } from '@things-factory/styles'
17
17
  import { isMobileDevice } from '@things-factory/utils'
18
-
18
+ import { fetchSettingRule } from '../../fetch-setting-value'
19
19
  import {
20
20
  ORDER_INVENTORY_STATUS,
21
21
  VAS_BATCH_AND_PRODUCT_TYPE,
@@ -51,7 +51,9 @@ class WorksheetPicking extends localize(i18next)(PageView) {
51
51
  targetBizplace: Object,
52
52
  worksheetId: String,
53
53
  orderNo: String,
54
- isRecall: Boolean
54
+ isRecall: Boolean,
55
+ isAssignedInventory: Boolean,
56
+ _worksheetPickingAssignment: Boolean
55
57
  }
56
58
  }
57
59
 
@@ -158,21 +160,25 @@ class WorksheetPicking extends localize(i18next)(PageView) {
158
160
  }
159
161
 
160
162
  if (this.activatable) {
161
- actions.push(
162
- {
163
+ if (this.isAssignedInventory) {
164
+ actions.push({
163
165
  title: i18next.t('button.reassign'),
164
166
  action: this._openReassignInventoryPopup.bind(this),
165
167
  ...CommonButtonStyles.assignment
166
- },
167
- {
168
- title: i18next.t('button.activate'),
169
- action: this._activateWorksheet.bind(this),
170
- ...CommonButtonStyles.activate
171
- }
172
- )
168
+ })
169
+ }
170
+ actions.push({
171
+ title: i18next.t('button.activate'),
172
+ action: this._activateWorksheet.bind(this),
173
+ ...CommonButtonStyles.activate
174
+ })
173
175
  }
174
176
 
175
- if (!this.activatable && this.worksheetDetailData?.records.find(itm => itm.obsolete == true)) {
177
+ if (
178
+ !this.activatable &&
179
+ (this.worksheetDetailData?.records.find(itm => itm.obsolete == true) ||
180
+ (this._worksheetPickingAssignment && this.worksheetDetailData?.records.find(itm => itm?.status == 'EXECUTING')))
181
+ ) {
176
182
  actions.push({
177
183
  title: i18next.t('button.reassign'),
178
184
  action: this._openReassignInventoryPopup.bind(this),
@@ -180,7 +186,7 @@ class WorksheetPicking extends localize(i18next)(PageView) {
180
186
  })
181
187
  }
182
188
 
183
- if (this.assignable) {
189
+ if (this.assignable && !this._worksheetPickingAssignment) {
184
190
  actions.push({
185
191
  title: i18next.t('button.auto_assign'),
186
192
  action: this._showAutoAssignPopup.bind(this),
@@ -286,7 +292,11 @@ class WorksheetPicking extends localize(i18next)(PageView) {
286
292
  </div>
287
293
  `
288
294
  : ''}
289
-
295
+ ${this._worksheetStatus == WORKSHEET_STATUS.DEACTIVATED.value &&
296
+ this._worksheetPickingAssignment &&
297
+ this.worksheetDetailData.records.length == 0
298
+ ? ''
299
+ : html`
290
300
  <div class="grist-column">
291
301
  <h2><mwc-icon>list_alt</mwc-icon>${i18next.t('title.worksheet_detail')}</h2>
292
302
  <data-grist
@@ -297,19 +307,23 @@ class WorksheetPicking extends localize(i18next)(PageView) {
297
307
  ></data-grist>
298
308
 
299
309
  <!-- vas data -->
300
- <!-- ${this.vasData?.records
301
- ? html`
302
- <h2><mwc-icon>list_alt</mwc-icon>${i18next.t('title.vas')}</h2>
303
- <data-grist
304
- id="vas-grist"
305
- .mode=${isMobileDevice() ? 'LIST' : 'GRID'}
306
- .config=${this.vasGristConfig}
307
- .data="${this.vasData}"
308
- ></data-grist>
309
- `
310
- : ''} -->
310
+ <!-- ${
311
+ this.vasData?.records
312
+ ? html`
313
+ <h2><mwc-icon>list_alt</mwc-icon>${i18next.t('title.vas')}</h2>
314
+ <data-grist
315
+ id="vas-grist"
316
+ .mode=${isMobileDevice() ? 'LIST' : 'GRID'}
317
+ .config=${this.vasGristConfig}
318
+ .data="${this.vasData}"
319
+ ></data-grist>
320
+ `
321
+ : ''
322
+ } -->
311
323
  </div>
312
324
  </div>
325
+ `}
326
+ </div>
313
327
  `
314
328
  }
315
329
 
@@ -325,21 +339,6 @@ class WorksheetPicking extends localize(i18next)(PageView) {
325
339
  }
326
340
 
327
341
  async pageUpdated(changes, lifecycle) {
328
- if (this.active && (changes.resourceId || this._worksheetNo)) {
329
- if (changes.resourceId) {
330
- this._worksheetNo = changes.resourceId
331
- this.vasData = {} // reset vas data from the page transition
332
- }
333
- await this.fetchOrderInventories()
334
- this.updateContext()
335
- this._updateGristConfig()
336
- }
337
- if (this.active) {
338
- this.orderNo = lifecycle.params.orderNo || null
339
- }
340
- }
341
-
342
- pageInitialized() {
343
342
  this.productGristConfig = {
344
343
  pagination: { infinite: true },
345
344
  rows: {
@@ -352,7 +351,7 @@ class WorksheetPicking extends localize(i18next)(PageView) {
352
351
  handlers: {
353
352
  click: async (columns, data, column, record, rowIndex) => {
354
353
  if (record.batchId && record.product?.name && record.packingType && record.packingSize != undefined) {
355
- await this.fetchWorksheetDetails(
354
+ await this.fetchWorksheetDetailsByProductGroup(
356
355
  this._worksheetNo,
357
356
  record.batchId,
358
357
  record.product.name,
@@ -394,6 +393,7 @@ class WorksheetPicking extends localize(i18next)(PageView) {
394
393
  handlers: {
395
394
  click: (columns, data, column, record, rowIndex) => {
396
395
  if (record.completed) return
396
+ if (this._worksheetPickingAssignment) return
397
397
  this._selectedProduct = {
398
398
  batchId: record.batchId,
399
399
  product: record.product,
@@ -636,6 +636,23 @@ class WorksheetPicking extends localize(i18next)(PageView) {
636
636
  }
637
637
  ]
638
638
  }
639
+
640
+ if (this.active && (changes.resourceId || this._worksheetNo)) {
641
+ if (changes.resourceId) {
642
+ this._worksheetNo = changes.resourceId
643
+ this.vasData = {} // reset vas data from the page transition
644
+ }
645
+ await this.fetchOrderInventories()
646
+ this.updateContext()
647
+ this._updateGristConfig()
648
+ }
649
+ if (this.active) {
650
+ this.orderNo = lifecycle.params.orderNo || null
651
+ }
652
+ }
653
+
654
+ async pageInitialized() {
655
+ this._worksheetPickingAssignment = await fetchSettingRule('enable-worksheet-picking-activation-assignment')
639
656
  }
640
657
 
641
658
  get form() {
@@ -690,6 +707,7 @@ class WorksheetPicking extends localize(i18next)(PageView) {
690
707
  packingOption
691
708
  releaseDate
692
709
  recall
710
+ assignedInventory
693
711
  arrivalNotice {
694
712
  name
695
713
  }
@@ -698,6 +716,19 @@ class WorksheetPicking extends localize(i18next)(PageView) {
698
716
  containerArrivalDate
699
717
  containerLeavingDate
700
718
  }
719
+ orderProducts {
720
+ id
721
+ product {
722
+ sku
723
+ name
724
+ }
725
+ packingType
726
+ packingSize
727
+ releaseQty
728
+ releaseUomValue
729
+ uom
730
+ batchId
731
+ }
701
732
  }
702
733
  orderInventories {
703
734
  status
@@ -740,7 +771,9 @@ class WorksheetPicking extends localize(i18next)(PageView) {
740
771
  description
741
772
  }
742
773
  worksheetDetails {
774
+ name
743
775
  status
776
+ description
744
777
  targetInventory {
745
778
  batchId
746
779
  batchIdRef
@@ -752,19 +785,63 @@ class WorksheetPicking extends localize(i18next)(PageView) {
752
785
  }
753
786
  packingType
754
787
  packingSize
788
+ pickedQty
755
789
  releaseQty
756
790
  releaseUomValue
757
791
  status
758
792
  inventory {
759
793
  qty
760
794
  lockedQty
795
+ palletId
796
+ cartonId
797
+ batchId
798
+ batchIdRef
799
+ packingType
800
+ obsolete
801
+ warehouse {
802
+ name
803
+ description
804
+ }
805
+ location {
806
+ name
807
+ description
808
+ }
761
809
  product {
810
+ sku
762
811
  name
812
+ brand
763
813
  description
764
814
  }
815
+ zone
816
+ uom
817
+ qty
765
818
  }
766
819
  }
767
820
  }
821
+ orderVass {
822
+ vas {
823
+ name
824
+ operationGuide
825
+ operationGuideType
826
+ }
827
+ set
828
+ targetType
829
+ targetBatchId
830
+ targetProduct {
831
+ id
832
+ name
833
+ description
834
+ }
835
+ packingType
836
+
837
+ qty
838
+ uomValue
839
+ otherTarget
840
+ description
841
+ remark
842
+ status
843
+ operationGuide
844
+ }
768
845
  }
769
846
  }
770
847
  `,
@@ -773,18 +850,22 @@ class WorksheetPicking extends localize(i18next)(PageView) {
773
850
 
774
851
  if (!response.errors) {
775
852
  let worksheet = response.data.worksheet
853
+ const orderVass = worksheet?.orderVass
854
+ const releaseGood = worksheet?.releaseGood
776
855
 
777
856
  this.worksheetDetails = worksheet.worksheetDetails
778
857
  this._worksheetStatus = worksheet.status
779
- this._roId = worksheet?.releaseGood?.id || ''
780
- this._roNo = worksheet?.releaseGood?.name || ''
781
- this.isRecall = worksheet?.releaseGood?.recall
782
858
  this.worksheetType = worksheet?.type
783
- this.crossDocking = worksheet?.releaseGood?.crossDocking
784
- this.courierOption = worksheet.releaseGood.courierOption
785
- this.packingOption = worksheet.releaseGood.packingOption
786
- this.ganNo = worksheet?.releaseGood?.arrivalNotice?.name
787
- this.exportOption = worksheet.releaseGood?.exportOption
859
+
860
+ this._roId = releaseGood?.id || ''
861
+ this._roNo = releaseGood?.name || ''
862
+ this.isRecall = releaseGood?.recall
863
+ this.crossDocking = releaseGood?.crossDocking
864
+ this.courierOption = releaseGood?.courierOption
865
+ this.packingOption = releaseGood?.packingOption
866
+ this.ganNo = releaseGood?.arrivalNotice?.name
867
+ this.exportOption = releaseGood?.exportOption
868
+ this.isAssignedInventory = releaseGood?.assignedInventory
788
869
 
789
870
  if (this.exportOption) {
790
871
  worksheet = {
@@ -812,65 +893,111 @@ class WorksheetPicking extends localize(i18next)(PageView) {
812
893
  containerLeavingDate: worksheet.containerLeavingDate
813
894
  })
814
895
 
815
- if (this._worksheetStatus !== WORKSHEET_STATUS.DEACTIVATED.value) this.fetchWorksheetDetails()
896
+ if (releaseGood.assignedInventory) {
897
+ const { tempOrderInvs, completedOrderInvs } = worksheet.orderInventories.reduce(
898
+ (result, ordInv) => {
899
+ if (ordInv.status === ORDER_INVENTORY_STATUS.PENDING_SPLIT.value) {
900
+ ordInv.productSku = ordInv.product.sku
901
+ ordInv.productBrand = ordInv.product.brand
902
+ result.tempOrderInvs.push(ordInv)
903
+ } else {
904
+ ordInv.productSku = ordInv.product.sku
905
+ ordInv.productBrand = ordInv.product.brand
906
+ ordInv.releaseUomValueWithUom = ordInv.releaseUomValue.toFixed(2) + ' ' + ordInv.inventory.uom
907
+ ordInv.availableQty = ordInv.inventory.qty - ordInv.inventory.lockedQty + ordInv.releaseQty
908
+ result.completedOrderInvs.push(ordInv)
909
+ }
816
910
 
817
- const { tempOrderInvs, completedOrderInvs } = worksheet.orderInventories.reduce(
818
- (result, ordInv) => {
819
- if (ordInv.status === ORDER_INVENTORY_STATUS.PENDING_SPLIT.value) {
820
- ordInv.productSku = ordInv.product.sku
821
- ordInv.productBrand = ordInv.product.brand
822
- result.tempOrderInvs.push(ordInv)
823
- } else {
824
- ordInv.productSku = ordInv.product.sku
825
- ordInv.productBrand = ordInv.product.brand
826
- ordInv.releaseUomValueWithUom = ordInv.releaseUomValue.toFixed(2) + ' ' + ordInv.inventory.uom
827
- ordInv.availableQty = ordInv.inventory.qty - ordInv.inventory.lockedQty + ordInv.releaseQty
828
- result.completedOrderInvs.push(ordInv)
911
+ return result
912
+ },
913
+ {
914
+ tempOrderInvs: [],
915
+ completedOrderInvs: []
829
916
  }
917
+ )
830
918
 
831
- return result
832
- },
833
- {
834
- tempOrderInvs: [],
835
- completedOrderInvs: []
836
- }
837
- )
838
-
839
- this.isPalletPickingOrder = Boolean(!tempOrderInvs || !tempOrderInvs.length)
919
+ this.isPalletPickingOrder = Boolean(!tempOrderInvs || !tempOrderInvs.length)
840
920
 
841
- this.productGristData = {
842
- records: tempOrderInvs.map(ordInv => {
843
- const { compQty, compUomValue } = completedOrderInvs.reduce(
844
- (result, compOrdInv) => {
845
- if (this._checkSameOrderInv(ordInv, compOrdInv)) {
846
- result.compQty += compOrdInv.releaseQty
847
- result.compUomValue += compOrdInv.releaseUomValue
848
- }
921
+ this.productGristData = {
922
+ records: tempOrderInvs.map(ordInv => {
923
+ const { compQty, compUomValue } = completedOrderInvs.reduce(
924
+ (result, compOrdInv) => {
925
+ if (this._checkSameOrderInv(ordInv, compOrdInv)) {
926
+ result.compQty += compOrdInv.releaseQty
927
+ result.compUomValue += compOrdInv.releaseUomValue
928
+ }
849
929
 
850
- // need to round off the completed uomValue to bypass the validation
851
- result.compUomValue = Math.round(result.compUomValue * 100) / 100
930
+ // need to round off the completed uomValue to bypass the validation
931
+ result.compUomValue = Math.round(result.compUomValue * 100) / 100
852
932
 
853
- return result
854
- },
855
- { compQty: 0, compUomValue: 0 }
856
- )
933
+ return result
934
+ },
935
+ { compQty: 0, compUomValue: 0 }
936
+ )
857
937
 
858
- return {
859
- ...ordInv,
860
- bizplaceId: worksheet.bizplace.id,
861
- completed: compQty === ordInv.releaseQty && compUomValue === ordInv.releaseUomValue
862
- }
863
- })
864
- }
938
+ return {
939
+ ...ordInv,
940
+ bizplaceId: worksheet.bizplace.id,
941
+ completed: compQty === ordInv.releaseQty && compUomValue === ordInv.releaseUomValue
942
+ }
943
+ })
944
+ }
865
945
 
866
- if (completedOrderInvs && completedOrderInvs.length) {
867
946
  this.worksheetDetailData = {
868
- records: completedOrderInvs.map(item =>
869
- Object.assign({ description: item.description }, item, item?.inventory, item?.inventory?.location)
870
- )
947
+ records: worksheet.worksheetDetails.map(wsd => {
948
+ let record = {
949
+ name: wsd.name,
950
+ description: wsd.description,
951
+ status: wsd.status,
952
+ productSku: wsd.targetInventory.inventory.product.sku,
953
+ productBrand: wsd.targetInventory.inventory.product.brand,
954
+ releaseQty: wsd.targetInventory.releaseQty,
955
+ releaseUomValue: wsd.targetInventory.releaseUomValue,
956
+ releaseUomValueWithUom:
957
+ wsd.targetInventory.releaseUomValue.toFixed(2) + ' ' + wsd.targetInventory.inventory.uom,
958
+ availableQty:
959
+ orderVass.length == 0
960
+ ? wsd.targetInventory.inventory.qty -
961
+ wsd.targetInventory.inventory.lockedQty +
962
+ wsd.targetInventory.releaseQty
963
+ : wsd.targetInventory.inventory.qty -
964
+ wsd.targetInventory.inventory.lockedQty +
965
+ wsd.targetInventory.pickedQty,
966
+ pickedQty: wsd.targetInventory.pickedQty
967
+ }
968
+
969
+ if (wsd.targetInventory?.inventory) {
970
+ record = Object.assign(record, wsd.targetInventory.inventory)
971
+ } else {
972
+ record = Object.assign(record, wsd.targetInventory)
973
+ }
974
+
975
+ return record
976
+ })
871
977
  }
872
978
  } else {
873
- this.worksheetDetailData = { records: [] }
979
+ this.productGristData = {
980
+ records: releaseGood.orderProducts.map(itm => {
981
+ return {
982
+ ...itm,
983
+ productSku: itm.product.sku
984
+ }
985
+ })
986
+ }
987
+ this.isPalletPickingOrder = false
988
+ }
989
+
990
+ if (orderVass?.length) {
991
+ this.vasData = {
992
+ records: orderVass
993
+ .sort((a, b) => a.set - b.set)
994
+ .map(orderVas => {
995
+ return {
996
+ ...orderVas,
997
+ set: orderVas.set ? `Set ${orderVas.set}` : ''
998
+ }
999
+ })
1000
+ }
874
1001
  }
875
1002
 
876
1003
  this._updateGristConfig()
@@ -900,21 +1027,6 @@ class WorksheetPicking extends localize(i18next)(PageView) {
900
1027
  return a.batchId === b.batchId && a.product?.sku === b.product?.sku && a.packingType === b.packingType
901
1028
  }
902
1029
 
903
- async fetchWorksheetDetails(worksheetNo, batchId, productName, productSku, packingType, packingSize) {
904
- if (worksheetNo && batchId && productName && productSku && packingType) {
905
- await this.fetchWorksheetDetailsByProductGroup(
906
- worksheetNo,
907
- batchId,
908
- productName,
909
- productSku,
910
- packingType,
911
- packingSize
912
- )
913
- } else {
914
- await this.fetchWholeWorksheetDetails()
915
- }
916
- }
917
-
918
1030
  async fetchWorksheetDetailsByProductGroup(worksheetNo, batchId, productName, productSku, packingType, packingSize) {
919
1031
  const response = await client.query({
920
1032
  query: gql`
@@ -998,139 +1110,132 @@ class WorksheetPicking extends localize(i18next)(PageView) {
998
1110
  }
999
1111
  }
1000
1112
 
1001
- async fetchWholeWorksheetDetails() {
1002
- if (!this._worksheetNo) return
1003
- const response = await client.query({
1004
- query: gql`
1005
- query worksheet($name: String!) {
1006
- worksheet(name: $name) {
1007
- worksheetDetails {
1008
- name
1009
- status
1010
- description
1011
- targetInventory {
1012
- batchId
1013
- batchIdRef
1014
- releaseQty
1015
- pickedQty
1016
- releaseUomValue
1017
- product {
1018
- sku
1019
- name
1020
- description
1021
- }
1022
- packingType
1023
-
1024
- inventory {
1025
- qty
1026
- lockedQty
1027
- palletId
1028
- cartonId
1029
- batchId
1030
- batchIdRef
1031
- packingType
1032
- obsolete
1033
- warehouse {
1034
- name
1035
- description
1036
- }
1037
- location {
1038
- name
1039
- description
1040
- }
1041
- product {
1042
- sku
1043
- name
1044
- brand
1045
- description
1046
- }
1047
- zone
1048
- uom
1049
- qty
1050
- }
1051
- }
1052
- }
1053
- orderVass {
1054
- vas {
1055
- name
1056
- operationGuide
1057
- operationGuideType
1058
- }
1059
- set
1060
- targetType
1061
- targetBatchId
1062
- targetProduct {
1063
- id
1064
- name
1065
- description
1066
- }
1067
- packingType
1068
-
1069
- qty
1070
- uomValue
1071
- otherTarget
1072
- description
1073
- remark
1074
- status
1075
- operationGuide
1076
- }
1077
- }
1078
- }
1079
- `,
1080
- variables: { name: this._worksheetNo }
1081
- })
1082
-
1083
- if (!response.errors) {
1084
- const worksheetDetails = response.data.worksheet.worksheetDetails
1085
- const orderVass = response.data.worksheet.orderVass
1086
-
1087
- this.worksheetDetailData = {
1088
- records: worksheetDetails.map(wsd => {
1089
- let record = {
1090
- name: wsd.name,
1091
- description: wsd.description,
1092
- status: wsd.status,
1093
- productSku: wsd.targetInventory.inventory.product.sku,
1094
- productBrand: wsd.targetInventory.inventory.product.brand,
1095
- releaseQty: wsd.targetInventory.releaseQty,
1096
- pickedQty: wsd.targetInventory.pickedQty,
1097
- releaseUomValue: wsd.targetInventory.releaseUomValue,
1098
- releaseUomValueWithUom:
1099
- wsd.targetInventory.releaseUomValue.toFixed(2) + ' ' + wsd.targetInventory.inventory.uom,
1100
- availableQty:
1101
- orderVass.length == 0
1102
- ? wsd.targetInventory.inventory.qty -
1103
- wsd.targetInventory.inventory.lockedQty +
1104
- wsd.targetInventory.releaseQty
1105
- : wsd.targetInventory.inventory.qty -
1106
- wsd.targetInventory.inventory.lockedQty +
1107
- wsd.targetInventory.pickedQty
1108
- }
1109
-
1110
- if (wsd.targetInventory?.inventory) {
1111
- record = Object.assign(record, wsd.targetInventory.inventory)
1112
- } else {
1113
- record = Object.assign(record, wsd.targetInventory)
1114
- }
1115
-
1116
- return record
1117
- })
1118
- }
1119
-
1120
- if (orderVass?.length) {
1121
- this.vasData = {
1122
- records: orderVass
1123
- .sort((a, b) => a.set - b.set)
1124
- .map(orderVas => {
1125
- return {
1126
- ...orderVas,
1127
- set: orderVas.set ? `Set ${orderVas.set}` : ''
1128
- }
1129
- })
1130
- }
1131
- }
1132
- }
1133
- }
1113
+ // async fetchWholeWorksheetDetails() {
1114
+ // if (!this._worksheetNo) return
1115
+ // const response = await client.query({
1116
+ // query: gql`
1117
+ // query worksheet($name: String!) {
1118
+ // worksheet(name: $name) {
1119
+ // worksheetDetails {
1120
+ // name
1121
+ // status
1122
+ // description
1123
+ // targetInventory {
1124
+ // batchId
1125
+ // batchIdRef
1126
+ // releaseQty
1127
+ // releaseUomValue
1128
+ // product {
1129
+ // sku
1130
+ // name
1131
+ // description
1132
+ // }
1133
+ // packingType
1134
+ // inventory {
1135
+ // qty
1136
+ // lockedQty
1137
+ // palletId
1138
+ // cartonId
1139
+ // batchId
1140
+ // batchIdRef
1141
+ // packingType
1142
+ // obsolete
1143
+ // warehouse {
1144
+ // name
1145
+ // description
1146
+ // }
1147
+ // location {
1148
+ // name
1149
+ // description
1150
+ // }
1151
+ // product {
1152
+ // sku
1153
+ // name
1154
+ // brand
1155
+ // description
1156
+ // }
1157
+ // zone
1158
+ // uom
1159
+ // qty
1160
+ // }
1161
+ // }
1162
+ // }
1163
+ // orderVass {
1164
+ // vas {
1165
+ // name
1166
+ // operationGuide
1167
+ // operationGuideType
1168
+ // }
1169
+ // set
1170
+ // targetType
1171
+ // targetBatchId
1172
+ // targetProduct {
1173
+ // id
1174
+ // name
1175
+ // description
1176
+ // }
1177
+ // packingType
1178
+
1179
+ // qty
1180
+ // uomValue
1181
+ // otherTarget
1182
+ // description
1183
+ // remark
1184
+ // status
1185
+ // operationGuide
1186
+ // }
1187
+ // }
1188
+ // }
1189
+ // `,
1190
+ // variables: { name: this._worksheetNo }
1191
+ // })
1192
+
1193
+ // if (!response.errors) {
1194
+ // const worksheetDetails = response.data.worksheet.worksheetDetails
1195
+ // const orderVass = response.data.worksheet.orderVass
1196
+
1197
+ // this.worksheetDetailData = {
1198
+ // records: worksheetDetails.map(wsd => {
1199
+ // let record = {
1200
+ // name: wsd.name,
1201
+ // description: wsd.description,
1202
+ // status: wsd.status,
1203
+ // productSku: wsd.targetInventory.inventory.product.sku,
1204
+ // productBrand: wsd.targetInventory.inventory.product.brand,
1205
+ // releaseQty: wsd.targetInventory.releaseQty,
1206
+ // releaseUomValue: wsd.targetInventory.releaseUomValue,
1207
+ // releaseUomValueWithUom:
1208
+ // wsd.targetInventory.releaseUomValue.toFixed(2) + ' ' + wsd.targetInventory.inventory.uom,
1209
+ // availableQty:
1210
+ // wsd.targetInventory.inventory.qty -
1211
+ // wsd.targetInventory.inventory.lockedQty +
1212
+ // wsd.targetInventory.releaseQty
1213
+ // }
1214
+
1215
+ // if (wsd.targetInventory?.inventory) {
1216
+ // record = Object.assign(record, wsd.targetInventory.inventory)
1217
+ // } else {
1218
+ // record = Object.assign(record, wsd.targetInventory)
1219
+ // }
1220
+
1221
+ // return record
1222
+ // })
1223
+ // }
1224
+
1225
+ // if (orderVass?.length) {
1226
+ // this.vasData = {
1227
+ // records: orderVass
1228
+ // .sort((a, b) => a.set - b.set)
1229
+ // .map(orderVas => {
1230
+ // return {
1231
+ // ...orderVas,
1232
+ // set: orderVas.set ? `Set ${orderVas.set}` : ''
1233
+ // }
1234
+ // })
1235
+ // }
1236
+ // }
1237
+ // }
1238
+ // }
1134
1239
 
1135
1240
  get undoable() {
1136
1241
  return this.productGristData.records.some(record => record.completed) && this._selectedProduct?.completed
@@ -1147,6 +1252,8 @@ class WorksheetPicking extends localize(i18next)(PageView) {
1147
1252
  let foundObsoleteItems = this.worksheetDetailData?.records.find(itm => itm.obsolete == true)
1148
1253
  return this._worksheetStatus === WORKSHEET_STATUS.DEACTIVATED.value && (!foundObsoleteItems || this.isRecall)
1149
1254
  }
1255
+ } else {
1256
+ return this._worksheetStatus === WORKSHEET_STATUS.DEACTIVATED.value && this._worksheetPickingAssignment
1150
1257
  }
1151
1258
  }
1152
1259
 
@@ -1264,7 +1371,7 @@ class WorksheetPicking extends localize(i18next)(PageView) {
1264
1371
  .orderProductId="${this._selectedProduct.orderProductId}"
1265
1372
  @completed="${async () => {
1266
1373
  await this.fetchOrderInventories()
1267
- await this.fetchWorksheetDetails(
1374
+ await this.fetchWorksheetDetailsByProductGroup(
1268
1375
  this._worksheetNo,
1269
1376
  this._selectedProduct.batchId,
1270
1377
  this._selectedProduct.product.name,
@@ -1299,7 +1406,7 @@ class WorksheetPicking extends localize(i18next)(PageView) {
1299
1406
  .data="${this.productGrist.data}"
1300
1407
  @completed="${async () => {
1301
1408
  await this.fetchOrderInventories()
1302
- await this.fetchWorksheetDetails(
1409
+ await this.fetchWorksheetDetailsByProductGroup(
1303
1410
  this._worksheetNo,
1304
1411
  this._selectedProduct?.batchId,
1305
1412
  this._selectedProduct?.product?.name,
@@ -1361,7 +1468,7 @@ class WorksheetPicking extends localize(i18next)(PageView) {
1361
1468
  })
1362
1469
 
1363
1470
  await this.fetchOrderInventories()
1364
- await this.fetchWorksheetDetails(
1471
+ await this.fetchWorksheetDetailsByProductGroup(
1365
1472
  this._worksheetNo,
1366
1473
  this._selectedProduct.batchId,
1367
1474
  this._selectedProduct.product.name,
@@ -1432,9 +1539,9 @@ class WorksheetPicking extends localize(i18next)(PageView) {
1432
1539
  .bizplaceId=${this.targetBizpace?.id}
1433
1540
  .roId=${this._roId}
1434
1541
  .worksheetNo=${this._worksheetNo}
1542
+ .worksheetPickingAssignment=${this._worksheetPickingAssignment}
1435
1543
  @reassignment-completed="${async () => {
1436
1544
  await this.fetchOrderInventories()
1437
- await this.fetchWorksheetDetails(this._worksheetNo)
1438
1545
 
1439
1546
  this.updateContext()
1440
1547
  }}"