@things-factory/operato-wms 4.3.632 → 4.3.634

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 (46) hide show
  1. package/client/pages/inbound/inbound-worksheet.js +5 -0
  2. package/client/pages/inbound/unload-product.js +2 -1
  3. package/client/pages/inventory/inventory-by-product.js +11 -0
  4. package/client/pages/inventory/onhand-inventory.js +51 -32
  5. package/client/pages/order/arrival-notice/arrival-notice-list.js +26 -3
  6. package/client/pages/order/draft-release-good/draft-release-good-list.js +26 -0
  7. package/client/pages/order/release-order/b2b/b2b-order-list.js +29 -1
  8. package/client/pages/order/release-order/b2b/b2b-order-requests.js +26 -0
  9. package/client/pages/order/release-order/b2c/b2c-order-requests.js +27 -0
  10. package/client/pages/outbound/loading-product.js +0 -4
  11. package/client/pages/outbound/loading-v2/loading.js +4 -16
  12. package/client/pages/outbound/loading-v2/release-good-info.js +3 -4
  13. package/client/pages/outbound/merged-outbound-worksheet.js +7 -0
  14. package/client/pages/outbound/picking-v2/picking-execution-base.js +16 -1
  15. package/client/pages/outbound/picking-v2/picking.js +32 -26
  16. package/client/pages/outbound/picking-v2/worksheet-info.js +7 -1
  17. package/client/pages/outbound/single-outbound-worksheet.js +27 -6
  18. package/client/pages/outbound/worksheet-picking.js +3 -4
  19. package/client/pages/outbound/zone-worksheet.js +7 -0
  20. package/client/util/apply-params-to-field.js +40 -0
  21. package/client/util/index.js +1 -0
  22. package/dist-server/graphql/resolvers/outbound/get-loading-task.js +3 -1
  23. package/dist-server/graphql/resolvers/outbound/get-loading-task.js.map +1 -1
  24. package/dist-server/graphql/resolvers/outbound/loading-worksheet-v2.js +7 -5
  25. package/dist-server/graphql/resolvers/outbound/loading-worksheet-v2.js.map +1 -1
  26. package/dist-server/graphql/resolvers/reports/index.js +2 -1
  27. package/dist-server/graphql/resolvers/reports/index.js.map +1 -1
  28. package/dist-server/graphql/resolvers/reports/pg-udf-query.js +68 -0
  29. package/dist-server/graphql/resolvers/reports/pg-udf-query.js.map +1 -0
  30. package/dist-server/graphql/resolvers/zone-worksheet/zone-picking.js +7 -2
  31. package/dist-server/graphql/resolvers/zone-worksheet/zone-picking.js.map +1 -1
  32. package/dist-server/graphql/resolvers/zone-worksheet/zone-worksheet.js.map +1 -1
  33. package/dist-server/graphql/types/reports/index.js +4 -1
  34. package/dist-server/graphql/types/reports/index.js.map +1 -1
  35. package/dist-server/graphql/types/reports/pg-udf-query-list.js +13 -0
  36. package/dist-server/graphql/types/reports/pg-udf-query-list.js.map +1 -0
  37. package/package.json +4 -4
  38. package/server/graphql/resolvers/outbound/get-loading-task.ts +8 -19
  39. package/server/graphql/resolvers/outbound/loading-worksheet-v2.ts +11 -9
  40. package/server/graphql/resolvers/reports/index.ts +3 -1
  41. package/server/graphql/resolvers/reports/pg-udf-query.ts +77 -0
  42. package/server/graphql/resolvers/zone-worksheet/zone-picking.ts +13 -2
  43. package/server/graphql/resolvers/zone-worksheet/zone-worksheet.ts +1 -2
  44. package/server/graphql/types/reports/index.ts +4 -1
  45. package/server/graphql/types/reports/pg-udf-query-list.ts +7 -0
  46. package/config.development.js +0 -105
@@ -12,6 +12,7 @@ import { isMobileDevice } from '@things-factory/utils'
12
12
 
13
13
  import { WORKSHEET_TYPE } from '../constants'
14
14
 
15
+ import { applyParamsToFields } from '../../util'
15
16
  class InboundWorksheet extends localize(i18next)(PageView) {
16
17
  static get styles() {
17
18
  return [
@@ -76,6 +77,10 @@ class InboundWorksheet extends localize(i18next)(PageView) {
76
77
 
77
78
  pageUpdated(changes, lifecycle) {
78
79
  if (this.active) {
80
+ let { params } = lifecycle
81
+ if (params && this._searchFields) {
82
+ applyParamsToFields(this._searchFields, params, this.searchForm)
83
+ }
79
84
  this.dataGrist.fetch()
80
85
  }
81
86
  }
@@ -186,7 +186,8 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
186
186
  if (
187
187
  this._unloadedInventories &&
188
188
  this._unloadedInventories.length > 0 &&
189
- this.orderProductData.records.some(task => !task.validity)
189
+ this.orderProductData.records.some(task => !task.validity) &&
190
+ this.orderProductData.records.some(task => task.actualPackQty < task.packQty)
190
191
  ) {
191
192
  actions.push({
192
193
  title: i18next.t('button.partial_unload'),
@@ -12,6 +12,7 @@ import { openPopup } from '@things-factory/layout-base'
12
12
  import { client, PageView } from '@things-factory/shell'
13
13
  import { ScrollbarStyles } from '@things-factory/styles'
14
14
  import { isMobileDevice } from '@things-factory/utils'
15
+ import { applyParamsToFields } from '../../util'
15
16
 
16
17
  class InventoryByProduct extends localize(i18next)(PageView) {
17
18
  static get properties() {
@@ -153,6 +154,16 @@ class InventoryByProduct extends localize(i18next)(PageView) {
153
154
  if (this._availabletockCheckbox && !this._checkedBoxes.length)
154
155
  this._checkedBoxes = [this._availabletockCheckbox, { name: 'temp', checked: false }]
155
156
 
157
+ let { params } = lifecycle
158
+ if (params && this._searchFields) {
159
+ const updatedFields = applyParamsToFields(this._searchFields, params)
160
+ this._searchFields = updatedFields
161
+ const searchForm = this.searchForm
162
+ if (searchForm) {
163
+ searchForm.fields = updatedFields
164
+ }
165
+ }
166
+
156
167
  this.dataGrist.fetch()
157
168
  }
158
169
  }
@@ -2,27 +2,15 @@ import '@things-factory/form-ui'
2
2
  import '@things-factory/grist-ui'
3
3
 
4
4
  import gql from 'graphql-tag'
5
- import {
6
- css,
7
- html
8
- } from 'lit-element'
5
+ import { css, html } from 'lit-element'
9
6
  import { connect } from 'pwa-helpers/connect-mixin'
10
7
 
11
8
  import { getCodeByName } from '@things-factory/code-base'
12
- import {
13
- i18next,
14
- localize
15
- } from '@things-factory/i18n-base'
16
- import {
17
- client,
18
- PageView,
19
- store
20
- } from '@things-factory/shell'
9
+ import { i18next, localize } from '@things-factory/i18n-base'
10
+ import { client, PageView, store } from '@things-factory/shell'
21
11
  import { ScrollbarStyles } from '@things-factory/styles'
22
- import {
23
- flattenObject,
24
- isMobileDevice
25
- } from '@things-factory/utils'
12
+ import { flattenObject, isMobileDevice } from '@things-factory/utils'
13
+ import { applyParamsToFields } from '../../util'
26
14
 
27
15
  class OnhandInventory extends connect(store)(localize(i18next)(PageView)) {
28
16
  static get styles() {
@@ -420,8 +408,47 @@ class OnhandInventory extends connect(store)(localize(i18next)(PageView)) {
420
408
  ]
421
409
  }
422
410
 
423
- async pageUpdated(changes, lifecycle) {
411
+ pageUpdated(changes, lifecycle) {
424
412
  if (this.active) {
413
+ let { params } = lifecycle
414
+ if (params && this._searchFields) {
415
+ if (params.expiration) {
416
+ this._showExpiration = params.expiration
417
+ }
418
+ if (params.expRange) {
419
+ switch (params.expRange) {
420
+ case 'expired':
421
+ params.expFromDate = new Date(new Date().setFullYear(new Date().getFullYear() - 1))
422
+ .toISOString()
423
+ .split('T')[0]
424
+ params.expToDate = new Date().toISOString().split('T')[0]
425
+ break
426
+ case '6m':
427
+ params.expFromDate = new Date().toISOString().split('T')[0]
428
+ params.expToDate = new Date(new Date().setMonth(new Date().getMonth() + 6)).toISOString().split('T')[0]
429
+ break
430
+ case '9m':
431
+ params.expFromDate = new Date().toISOString().split('T')[0]
432
+ params.expToDate = new Date(new Date().setMonth(new Date().getMonth() + 9)).toISOString().split('T')[0]
433
+ break
434
+ default:
435
+ break
436
+ }
437
+ const updatedExpFields = applyParamsToFields(this._expSearchFields, params)
438
+ this._expSearchFields = updatedExpFields
439
+ const expSearchForm = this.searchExpForm
440
+ if (expSearchForm) {
441
+ expSearchForm.fields = updatedExpFields
442
+ }
443
+ }
444
+
445
+ const updatedFields = applyParamsToFields(this._searchFields, params)
446
+ this._searchFields = updatedFields
447
+ const searchForm = this.searchForm
448
+ if (searchForm) {
449
+ searchForm.fields = updatedFields
450
+ }
451
+ }
425
452
  this.dataGrist.fetch()
426
453
  }
427
454
  }
@@ -612,13 +639,9 @@ class OnhandInventory extends connect(store)(localize(i18next)(PageView)) {
612
639
  if (this.dataGrist.selected && this.dataGrist.selected.length > 0) {
613
640
  data = this.dataGrist.selected.map(item => {
614
641
  const formatter = new Intl.DateTimeFormat(navigator.language)
615
- const expirationDate = item.expirationDate
616
- ? formatter.format(new Date(item.expirationDate))
617
- : ''
618
- const manufactureDate = item.manufactureDate
619
- ? formatter.format(new Date(item.manufactureDate))
620
- : ''
621
-
642
+ const expirationDate = item.expirationDate ? formatter.format(new Date(item.expirationDate)) : ''
643
+ const manufactureDate = item.manufactureDate ? formatter.format(new Date(item.manufactureDate)) : ''
644
+
622
645
  return {
623
646
  ...item,
624
647
  expirationDate: expirationDate,
@@ -632,13 +655,9 @@ class OnhandInventory extends connect(store)(localize(i18next)(PageView)) {
632
655
  }
633
656
  data = (await this.fetchHandler({ page: 1, limit: 9999999 })).records.map(item => {
634
657
  const formatter = new Intl.DateTimeFormat(navigator.language)
635
- const expirationDate = item.expirationDate
636
- ? formatter.format(new Date(item.expirationDate))
637
- : ''
638
- const manufactureDate = item.manufactureDate
639
- ? formatter.format(new Date(item.manufactureDate))
640
- : ''
641
-
658
+ const expirationDate = item.expirationDate ? formatter.format(new Date(item.expirationDate)) : ''
659
+ const manufactureDate = item.manufactureDate ? formatter.format(new Date(item.manufactureDate)) : ''
660
+
642
661
  return {
643
662
  ...item,
644
663
  expirationDate: expirationDate,
@@ -9,9 +9,7 @@ import { i18next, localize } from '@things-factory/i18n-base'
9
9
  import { client, navigate, PageView } from '@things-factory/shell'
10
10
  import { ScrollbarStyles } from '@things-factory/styles'
11
11
  import { isMobileDevice } from '@things-factory/utils'
12
-
13
- import { ORDER_STATUS } from '../../constants'
14
-
12
+ import { applyParamsToFields } from '../../../util'
15
13
  class ArrivalNoticeList extends localize(i18next)(PageView) {
16
14
  static get styles() {
17
15
  return [
@@ -76,6 +74,31 @@ class ArrivalNoticeList extends localize(i18next)(PageView) {
76
74
 
77
75
  pageUpdated(changes, lifecycle) {
78
76
  if (this.active) {
77
+ let { params } = lifecycle
78
+ if (params && this._searchFields) {
79
+ if (params.range) {
80
+ params.toDate = new Date().toISOString().split('T')[0]
81
+ switch (params.range) {
82
+ case '1d':
83
+ params.fromDate = new Date(new Date().setDate(new Date().getDate() - 1)).toISOString().split('T')[0]
84
+ break
85
+ case '1w':
86
+ params.fromDate = new Date(new Date().setDate(new Date().getDate() - 7)).toISOString().split('T')[0]
87
+ break
88
+ case '1m':
89
+ params.fromDate = new Date(new Date().setMonth(new Date().getMonth() - 1)).toISOString().split('T')[0]
90
+ break
91
+ default:
92
+ break
93
+ }
94
+ }
95
+ const updatedFields = applyParamsToFields(this._searchFields, params)
96
+ this._searchFields = updatedFields
97
+ const searchForm = this.searchForm
98
+ if (searchForm) {
99
+ searchForm.fields = updatedFields
100
+ }
101
+ }
79
102
  this.dataGrist.fetch()
80
103
  }
81
104
  }
@@ -11,6 +11,7 @@ import { i18next, localize } from '@things-factory/i18n-base'
11
11
  import { client, CustomAlert, navigate, PageView } from '@things-factory/shell'
12
12
  import { CommonButtonStyles, ScrollbarStyles } from '@things-factory/styles'
13
13
  import { isMobileDevice } from '@things-factory/utils'
14
+ import { applyParamsToFields } from '../../../util'
14
15
 
15
16
  import { DRAFT_RELEASE_ORDER_STATUS } from '../../../constants'
16
17
 
@@ -105,6 +106,31 @@ class DraftReleaseGoodList extends localize(i18next)(PageView) {
105
106
 
106
107
  pageUpdated(changes, lifecycle) {
107
108
  if (this.active) {
109
+ let { params } = lifecycle
110
+ if (params && this._searchFields) {
111
+ if (params.range) {
112
+ params.toDate = new Date().toISOString().split('T')[0]
113
+ switch (params.range) {
114
+ case '1d':
115
+ params.fromDate = new Date(new Date().setDate(new Date().getDate() - 1)).toISOString().split('T')[0]
116
+ break
117
+ case '1w':
118
+ params.fromDate = new Date(new Date().setDate(new Date().getDate() - 7)).toISOString().split('T')[0]
119
+ break
120
+ case '1m':
121
+ params.fromDate = new Date(new Date().setMonth(new Date().getMonth() - 1)).toISOString().split('T')[0]
122
+ break
123
+ default:
124
+ break
125
+ }
126
+ }
127
+ const updatedFields = applyParamsToFields(this._searchFields, params)
128
+ this._searchFields = updatedFields
129
+ const searchForm = this.searchForm
130
+ if (searchForm) {
131
+ searchForm.fields = updatedFields
132
+ }
133
+ }
108
134
  this.dataGrist.fetch()
109
135
  }
110
136
  }
@@ -17,6 +17,8 @@ import { isMobileDevice, sleep } from '@things-factory/utils'
17
17
  import { ORDER_STATUS, ORDER_VAS_STATUS } from '../../../constants'
18
18
  import { fetchSettingRule } from '../../../../fetch-setting-value'
19
19
 
20
+ import { applyParamsToFields } from '../../../../util'
21
+
20
22
  class B2bOrderList extends localize(i18next)(PageView) {
21
23
  static get styles() {
22
24
  return [
@@ -105,6 +107,32 @@ class B2bOrderList extends localize(i18next)(PageView) {
105
107
 
106
108
  pageUpdated(changes, lifecycle) {
107
109
  if (this.active) {
110
+ let { params } = lifecycle
111
+ if (params && this._searchFields) {
112
+ if (params.range) {
113
+ params.toDate = new Date().toISOString().split('T')[0]
114
+ switch (params.range) {
115
+ case '1d':
116
+ params.fromDate = new Date(new Date().setDate(new Date().getDate() - 1)).toISOString().split('T')[0]
117
+ break
118
+ case '1w':
119
+ params.fromDate = new Date(new Date().setDate(new Date().getDate() - 7)).toISOString().split('T')[0]
120
+ break
121
+ case '1m':
122
+ params.fromDate = new Date(new Date().setMonth(new Date().getMonth() - 1)).toISOString().split('T')[0]
123
+ break
124
+ default:
125
+ break
126
+ }
127
+ }
128
+ const updatedFields = applyParamsToFields(this._searchFields, params)
129
+ this._searchFields = updatedFields
130
+ const searchForm = this.searchForm
131
+ if (searchForm) {
132
+ searchForm.fields = updatedFields
133
+ }
134
+ }
135
+
108
136
  this.dataGrist.fetch()
109
137
  }
110
138
  }
@@ -659,7 +687,7 @@ class B2bOrderList extends localize(i18next)(PageView) {
659
687
  openPopup(
660
688
  html`
661
689
  <select-operator-popup
662
- .selectSorter = "${true}"
690
+ .selectSorter="${true}"
663
691
  @updateOperator="${async e => {
664
692
  let assignee = e.detail
665
693
 
@@ -13,6 +13,7 @@ import { client, navigate, PageView } from '@things-factory/shell'
13
13
  import { CommonButtonStyles, ScrollbarStyles } from '@things-factory/styles'
14
14
  import { isMobileDevice } from '@things-factory/utils'
15
15
 
16
+ import { applyParamsToFields } from '../../../../util'
16
17
  import { ORDER_STATUS } from '../../../constants'
17
18
 
18
19
  class B2bOrderRequests extends localize(i18next)(PageView) {
@@ -91,6 +92,31 @@ class B2bOrderRequests extends localize(i18next)(PageView) {
91
92
 
92
93
  pageUpdated(changes, lifecycle) {
93
94
  if (this.active) {
95
+ let { params } = lifecycle
96
+ if (params && this._searchFields) {
97
+ if (params.range) {
98
+ params.toDate = new Date().toISOString().split('T')[0]
99
+ switch (params.range) {
100
+ case '1d':
101
+ params.fromDate = new Date(new Date().setDate(new Date().getDate() - 1)).toISOString().split('T')[0]
102
+ break
103
+ case '1w':
104
+ params.fromDate = new Date(new Date().setDate(new Date().getDate() - 7)).toISOString().split('T')[0]
105
+ break
106
+ case '1m':
107
+ params.fromDate = new Date(new Date().setMonth(new Date().getMonth() - 1)).toISOString().split('T')[0]
108
+ break
109
+ default:
110
+ break
111
+ }
112
+ }
113
+ const updatedFields = applyParamsToFields(this._searchFields, params)
114
+ this._searchFields = updatedFields
115
+ const searchForm = this.searchForm
116
+ if (searchForm) {
117
+ searchForm.fields = updatedFields
118
+ }
119
+ }
94
120
  this.dataGrist.fetch()
95
121
  }
96
122
  }
@@ -20,6 +20,8 @@ import { isMobileDevice, sleep } from '@things-factory/utils'
20
20
  import { fetchSettingRule } from '../../../../fetch-setting-value'
21
21
  import { INTENALIZED_AWB_SETTING_KEY, ORDER_STATUS } from '../../../constants'
22
22
 
23
+ import { applyParamsToFields } from '../../../../util'
24
+
23
25
  const HEADER_JSON = {
24
26
  'Content-Type': 'application/json',
25
27
  Accept: 'application/json'
@@ -117,6 +119,31 @@ class B2cOrderRequests extends connect(store)(localize(i18next)(PageView)) {
117
119
 
118
120
  pageUpdated(changes, lifecycle) {
119
121
  if (this.active) {
122
+ let { params } = lifecycle
123
+ if (params && this._searchFields) {
124
+ if (params.range) {
125
+ params.toDate = new Date().toISOString().split('T')[0]
126
+ switch (params.range) {
127
+ case '1d':
128
+ params.fromDate = new Date(new Date().setDate(new Date().getDate() - 1)).toISOString().split('T')[0]
129
+ break
130
+ case '1w':
131
+ params.fromDate = new Date(new Date().setDate(new Date().getDate() - 7)).toISOString().split('T')[0]
132
+ break
133
+ case '1m':
134
+ params.fromDate = new Date(new Date().setMonth(new Date().getMonth() - 1)).toISOString().split('T')[0]
135
+ break
136
+ default:
137
+ break
138
+ }
139
+ }
140
+ const updatedFields = applyParamsToFields(this._searchFields, params)
141
+ this._searchFields = updatedFields
142
+ const searchForm = this.searchForm
143
+ if (searchForm) {
144
+ searchForm.fields = updatedFields
145
+ }
146
+ }
120
147
  this.dataGrist.fetch()
121
148
  }
122
149
  }
@@ -692,10 +692,6 @@ class LoadingProduct extends connect(store)(localize(i18next)(PageView)) {
692
692
  this._releaseGoodNo = response.data.loadingWorksheet.worksheetInfo.releaseGood.name
693
693
  this._fillUpForm(this.infoForm, response.data.loadingWorksheet.worksheetInfo)
694
694
  this._ownCollection = response.data.loadingWorksheet.worksheetInfo.ownCollection
695
- // const hasVas = response.data.loadingWorksheet.worksheetDetailInfos.filter(wd => {
696
- // return wd.targetVas ? wd.targetVas : undefined
697
- // })
698
- // debugger
699
695
 
700
696
  this.pickedProductData = {
701
697
  records: response.data.loadingWorksheet.worksheetDetailInfos.map(record => {
@@ -6,30 +6,16 @@ import '../show-ro-list-popup'
6
6
 
7
7
  import gql from 'graphql-tag'
8
8
  import { css, html, property } from 'lit-element'
9
- // import { customElement } from 'lit/decorators.js'
10
9
  import { connect } from 'pwa-helpers/connect-mixin.js'
11
10
  import { sleep } from '@things-factory/utils'
12
11
  import { MultiColumnFormStyles, SingleColumnFormStyles } from '@things-factory/form-ui'
13
12
  import { i18next, localize } from '@things-factory/i18n-base'
14
13
  import { openPopup } from '@things-factory/layout-base'
15
- import { client, CustomAlert, gqlContext, PageView, store } from '@things-factory/shell'
14
+ import { client, gqlContext, PageView, store } from '@things-factory/shell'
16
15
  import { CommonButtonStyles } from '@things-factory/styles'
17
16
  import { isMobileDevice } from '@things-factory/utils'
18
17
 
19
- import { fetchLocationSortingRule } from '../../../fetch-location-sorting-rule'
20
- import { fetchSettingRule } from '../../../fetch-setting-value'
21
-
22
18
  import { showToast } from '../../../util'
23
- import {
24
- BATCH_PICKING,
25
- LOCATION_SORTING_RULE,
26
- LOCATION_TYPE,
27
- ORDER_INVENTORY_STATUS,
28
- ORDER_SOURCES,
29
- PICKING,
30
- WORKSHEET_STATUS,
31
- ZONE_PICKING
32
- } from '../../constants'
33
19
 
34
20
  class LoadingProductV2 extends connect(store)(localize(i18next)(PageView)) {
35
21
  static get properties() {
@@ -178,6 +164,7 @@ class LoadingProductV2 extends connect(store)(localize(i18next)(PageView)) {
178
164
  refNo
179
165
  refNo2
180
166
  refNo3
167
+ remark
181
168
  }
182
169
  }
183
170
  worksheetDetailInfos {
@@ -274,7 +261,7 @@ class LoadingProductV2 extends connect(store)(localize(i18next)(PageView)) {
274
261
  sortedByUser: ro.sortedBy?.name
275
262
  }
276
263
  })
277
-
264
+
278
265
  await sleep(1010)
279
266
  openPopup(
280
267
  html`
@@ -317,6 +304,7 @@ class LoadingProductV2 extends connect(store)(localize(i18next)(PageView)) {
317
304
  refNo
318
305
  refNo2
319
306
  refNo3
307
+ remark
320
308
  }
321
309
  }
322
310
  worksheetDetailInfos {
@@ -1,10 +1,6 @@
1
1
  import { i18next, localize } from '@things-factory/i18n-base'
2
- import { navigate, client } from '@things-factory/shell'
3
2
  import { css, html, LitElement } from 'lit-element'
4
- import { WORKSHEET_STATUS } from '../../constants'
5
- import { openPopup } from '@things-factory/layout-base'
6
3
  import '@material/mwc-button'
7
- import gql from 'graphql-tag'
8
4
 
9
5
  class ReleaseGoodInfo extends localize(i18next)(LitElement) {
10
6
  static get properties() {
@@ -80,6 +76,9 @@ class ReleaseGoodInfo extends localize(i18next)(LitElement) {
80
76
  <label class="worksheet-info-title">Ref 3</label>
81
77
  <label class="worksheet-info-description">: ${this.data?.releaseGood.refNo3}</label>
82
78
 
79
+ <label class="worksheet-info-title">Remark</label>
80
+ <label class="worksheet-info-description">: ${this.data?.releaseGood.remark}</label>
81
+
83
82
  <label class="worksheet-info-title">Start Time</label>
84
83
  <label class="worksheet-info-description">: ${this.data?.startedAt}</label>
85
84
 
@@ -17,6 +17,8 @@ import { fetchSettingRule } from '../../fetch-setting-value'
17
17
 
18
18
  import { WORKSHEET_TYPE } from '../constants'
19
19
 
20
+ import { applyParamsToFields } from '../../util'
21
+
20
22
  class MergedOutboundWorksheet extends localize(i18next)(PageView) {
21
23
  static get styles() {
22
24
  return [
@@ -103,6 +105,11 @@ class MergedOutboundWorksheet extends localize(i18next)(PageView) {
103
105
  this.assigneeId = lifecycle.params.assigneeId || null
104
106
  this.status = lifecycle.params.status || null
105
107
 
108
+ let { params } = lifecycle
109
+ if (params && this._searchFields) {
110
+ applyParamsToFields(this._searchFields, params, this.searchForm)
111
+ }
112
+
106
113
  this.dataGrist.fetch()
107
114
  }
108
115
  }
@@ -406,6 +406,10 @@ export class PickingExecutionBase extends LitElement {
406
406
  transactionType
407
407
  details
408
408
  }
409
+ releaseGood {
410
+ id
411
+ refNo2
412
+ }
409
413
  completable
410
414
  }
411
415
  }
@@ -469,10 +473,21 @@ async function mapWorksheetData(data) {
469
473
 
470
474
  const completable = data.completable
471
475
 
476
+ // Group unique refNo2 values
477
+ const uniqueRefNo2s = [...new Set(data.releaseGood.map(rg => rg.refNo2).filter(refNo2 => refNo2))] // Filter out null/undefined values
478
+ const groupedRefNo2 = uniqueRefNo2s.join(', ')
479
+
480
+ // Add grouped refNo2 to worksheet info
481
+ const worksheetInfo = {
482
+ ...data.worksheet,
483
+ groupedRefNo2
484
+ }
485
+
472
486
  return {
473
487
  worksheetDetailInfos,
474
488
  issues,
475
- completable
489
+ completable,
490
+ worksheetInfo
476
491
  }
477
492
  }
478
493
 
@@ -17,12 +17,7 @@ import { connect } from 'pwa-helpers/connect-mixin.js'
17
17
  import { fetchLocationSortingRule } from '../../../fetch-location-sorting-rule'
18
18
 
19
19
  import { showToast } from '../../../util'
20
- import {
21
- BATCH_PICKING,
22
- LOCATION_SORTING_RULE,
23
- PICKING,
24
- WORKSHEET_STATUS
25
- } from '../../constants'
20
+ import { BATCH_PICKING, LOCATION_SORTING_RULE, PICKING, WORKSHEET_STATUS } from '../../constants'
26
21
 
27
22
  const PICKING_TYPES = { PICKING, BATCH_PICKING }
28
23
 
@@ -163,8 +158,8 @@ class PickingProductV2 extends connect(store)(localize(i18next)(PageView)) {
163
158
  try {
164
159
  const response = await client.mutate({
165
160
  mutation: gql`
166
- mutation getZonePickingTask {
167
- getZonePickingTask {
161
+ mutation getZonePickingTask {
162
+ getZonePickingTask {
168
163
  worksheet {
169
164
  id
170
165
  name
@@ -217,11 +212,11 @@ class PickingProductV2 extends connect(store)(localize(i18next)(PageView)) {
217
212
  }
218
213
  `
219
214
  })
220
-
215
+
221
216
  if (!response.errors) {
222
217
  let data = response.data.getZonePickingTask
223
- this._data = mapWorksheetData(data)
224
- }
218
+ this._data = mapWorksheetData(data)
219
+ }
225
220
  } catch (e) {
226
221
  showToast('Something went wrong. Please contact support.')
227
222
  }
@@ -285,6 +280,10 @@ async function fetchWorksheet(worksheetNo, locationSortingRules) {
285
280
  transactionType
286
281
  details
287
282
  }
283
+ releaseGood {
284
+ id
285
+ refNo2
286
+ }
288
287
  completable
289
288
  }
290
289
  }
@@ -307,22 +306,29 @@ async function fetchWorksheet(worksheetNo, locationSortingRules) {
307
306
  }
308
307
 
309
308
  function mapWorksheetData(data) {
309
+ // Group unique refNo2 values
310
+ const uniqueRefNo2s = [...new Set(data.releaseGood.map(rg => rg.refNo2).filter(refNo2 => refNo2))] // Filter out null/undefined values
311
+ const groupedRefNo2 = uniqueRefNo2s.join(', ')
312
+
310
313
  const worksheetInfo = {
311
314
  id: data.worksheet.id,
312
315
  name: data.worksheet.name,
313
316
  type: data.worksheet.type,
314
317
  status: data.worksheet.status,
315
318
  bizplaceName: data.worksheet.bizplace.name,
316
- startedAt: data.worksheet.startedAt
317
- ? new Date(parseInt(data.worksheet.startedAt)).toLocaleString('en-CA', {
318
- year: 'numeric',
319
- month: '2-digit',
320
- day: '2-digit',
321
- hour: '2-digit',
322
- minute: '2-digit',
323
- hour12: false
324
- }).replace(',', '')
325
- : null
319
+ startedAt: data.worksheet.startedAt
320
+ ? new Date(parseInt(data.worksheet.startedAt))
321
+ .toLocaleString('en-CA', {
322
+ year: 'numeric',
323
+ month: '2-digit',
324
+ day: '2-digit',
325
+ hour: '2-digit',
326
+ minute: '2-digit',
327
+ hour12: false
328
+ })
329
+ .replace(',', '')
330
+ : null,
331
+ groupedRefNo2
326
332
  }
327
333
 
328
334
  const worksheetDetailInfos = data.groupedOrderInventories.map(orderInv => ({
@@ -338,9 +344,9 @@ function mapWorksheetData(data) {
338
344
  qty: orderInv.pickedQty,
339
345
  releaseQty: orderInv.releaseQty,
340
346
  pickedQty: orderInv.pickedQty,
341
- expirationDate: orderInv.inventory.expirationDate
342
- ? new Date(orderInv.inventory.expirationDate).toISOString().slice(0, 10).replace('-', '/').replace('-', '/')
343
- : null,
347
+ expirationDate: orderInv.inventory.expirationDate
348
+ ? new Date(orderInv.inventory.expirationDate).toISOString().slice(0, 10).replace('-', '/').replace('-', '/')
349
+ : null,
344
350
  status: orderInv.status,
345
351
  packingType: orderInv.packingType,
346
352
  packingSize: orderInv.packingSize,
@@ -370,10 +376,10 @@ function mapWorksheetData(data) {
370
376
  const completable = data.completable
371
377
 
372
378
  return {
373
- worksheetInfo,
374
379
  worksheetDetailInfos,
375
380
  issues,
376
- completable
381
+ completable,
382
+ worksheetInfo
377
383
  }
378
384
  }
379
385
 
@@ -168,7 +168,10 @@ class WorksheetInfo extends localize(i18next)(LitElement) {
168
168
  async openIssueDetailPopup(data) {
169
169
  let popup = await openPopup(
170
170
  html`
171
- <issue-details-popup .data=${data} @submit="${e => this.data.filter(data => data.id == e.detail)}"></issue-details-popup>
171
+ <issue-details-popup
172
+ .data=${data}
173
+ @submit="${e => this.data.filter(data => data.id == e.detail)}"
174
+ ></issue-details-popup>
172
175
  `,
173
176
  {
174
177
  backdrop: true,
@@ -190,6 +193,9 @@ function worksheetInfo(worksheet) {
190
193
  <label class="worksheet-info-title">Company</label>
191
194
  <label class="worksheet-info-description">: ${worksheet.bizplaceName}</label>
192
195
 
196
+ <label class="worksheet-info-title">Ref 2</label>
197
+ <label class="worksheet-info-description">: ${worksheet.groupedRefNo2}</label>
198
+
193
199
  <label class="worksheet-info-title">Start Time</label>
194
200
  <label class="worksheet-info-description">: ${worksheet.startedAt}</label>
195
201