@things-factory/operato-wms 4.3.767 → 4.3.770

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/bulk-operation/validate-gan-popup.js +2 -2
  2. package/client/pages/components/list-view/product-list-view.js +28 -3
  3. package/client/pages/components/mobile-condition-of-goods-listing.js +342 -0
  4. package/client/pages/components/unloading-worksheet-information-popup.js +299 -0
  5. package/client/pages/constants/order.js +7 -0
  6. package/client/pages/inbound/condition-of-goods-popup.js +646 -0
  7. package/client/pages/inbound/putaway/putaway-product.js +35 -6
  8. package/client/pages/inbound/unload-product-landing-page.js +282 -0
  9. package/client/pages/inbound/unload-product.js +707 -175
  10. package/client/pages/inbound/unloaded-inventories-popup.js +3 -0
  11. package/client/pages/inventory/inventory-adjustment-approval.js +28 -1
  12. package/client/pages/inventory/inventory-adjustment.js +77 -44
  13. package/client/pages/inventory/inventory-by-product-detail.js +15 -0
  14. package/client/pages/inventory/inventory-history.js +18 -0
  15. package/client/pages/inventory/onhand-inventory.js +14 -0
  16. package/client/pages/order/arrival-notice/create-arrival-notice.js +209 -206
  17. package/client/pages/order/arrival-notice/duplicate-arrival-notice.js +132 -129
  18. package/client/pages/order/arrival-notice/edit-product-popup.js +97 -92
  19. package/client/pages/order/release-order/b2b/b2b-order-list.js +99 -0
  20. package/client/pages/order/release-order/packing-label-history-popup.js +378 -0
  21. package/client/pages/order/release-order/preview-print-packing-list.js +533 -0
  22. package/client/pages/order/release-order/print-quantity-popup.js +118 -0
  23. package/client/pages/outbound/loading-v2/loading-execution-base.js +29 -0
  24. package/client/pages/outbound/loading-v2/loading-execution.js +579 -2
  25. package/client/pages/outbound/loading-v2/loading-package-info-popup.js +182 -0
  26. package/client/pages/outbound/loading-v2/loading.js +18 -0
  27. package/client/pages/report/inbound-order-details-report.js +26 -1
  28. package/client/route.js +17 -0
  29. package/dist-server/graphql/resolvers/outbound/find-loadable-release-good-by-bin.js +9 -1
  30. package/dist-server/graphql/resolvers/outbound/find-loadable-release-good-by-bin.js.map +1 -1
  31. package/dist-server/graphql/resolvers/outbound/loading-worksheet-v2.js +11 -5
  32. package/dist-server/graphql/resolvers/outbound/loading-worksheet-v2.js.map +1 -1
  33. package/dist-server/graphql/resolvers/reports/inbound-order-details-report.js +2 -1
  34. package/dist-server/graphql/resolvers/reports/inbound-order-details-report.js.map +1 -1
  35. package/dist-server/graphql/types/reports/inbound-order-details-report.js +1 -0
  36. package/dist-server/graphql/types/reports/inbound-order-details-report.js.map +1 -1
  37. package/package.json +15 -15
  38. package/server/graphql/resolvers/outbound/find-loadable-release-good-by-bin.ts +9 -1
  39. package/server/graphql/resolvers/outbound/loading-worksheet-v2.ts +13 -1
  40. package/server/graphql/resolvers/reports/inbound-order-details-report.ts +2 -1
  41. package/server/graphql/types/reports/inbound-order-details-report.ts +1 -0
  42. package/things-factory.config.js +8 -0
  43. package/translations/en.json +45 -1
  44. package/translations/ko.json +40 -0
  45. package/translations/ms.json +40 -0
  46. package/translations/zh.json +40 -0
@@ -19,7 +19,7 @@ import { CommonButtonStyles } from '@things-factory/styles'
19
19
  import { isMobileDevice, sleep } from '@things-factory/utils'
20
20
 
21
21
  import { fetchSettingRule } from '../../../fetch-setting-value'
22
- import { ARRIVAL_NOTICE, CUSTOMER_RETURN, REPLENISHMENT, WAREHOUSE_RETURN, WORKSHEET_STATUS } from '../../constants'
22
+ import { ARRIVAL_NOTICE, CUSTOMER_RETURN, REPLENISHMENT, WAREHOUSE_RETURN, WORKSHEET_STATUS, CONDITION_OF_GOODS } from '../../constants'
23
23
 
24
24
  const OPERATION_TYPE = {
25
25
  PUTAWAY: 'putaway',
@@ -199,6 +199,13 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
199
199
  header: i18next.t('field.qty'),
200
200
  width: 80
201
201
  },
202
+ {
203
+ type: 'string',
204
+ name: 'displayConditionOfGoods',
205
+ label: true,
206
+ header: i18next.t('field.type_of_condition'),
207
+ width: 150
208
+ },
202
209
  {
203
210
  type: 'object',
204
211
  name: 'reusablePallet',
@@ -244,7 +251,7 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
244
251
  },
245
252
  pagination: { infinite: true },
246
253
  list: {
247
- fields: ['completed', 'sku', 'product', 'palletId', 'cartonId', 'expirationDate', 'batchId', 'qty', 'location']
254
+ fields: ['completed', 'sku', 'product', 'palletId', 'cartonId', 'expirationDate', 'batchId', 'qty', 'displayConditionOfGoods', 'location']
248
255
  },
249
256
  columns: columns.filter(itm => itm.exclude != true)
250
257
  }
@@ -577,6 +584,20 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
577
584
  setTimeout(() => this.actualQtyInput.focus(), 100)
578
585
  }
579
586
 
587
+ _formatConditionOfGoods(conditionValue) {
588
+ if (!conditionValue) return null
589
+
590
+ const conditionKey = Object.keys(CONDITION_OF_GOODS).find(
591
+ key => CONDITION_OF_GOODS[key].value === conditionValue
592
+ )
593
+
594
+ if (conditionKey) {
595
+ return i18next.t(`label.${CONDITION_OF_GOODS[conditionKey].name}`)
596
+ }
597
+
598
+ return conditionValue
599
+ }
600
+
580
601
  async _fetchProducts(orderNo, preserve = false) {
581
602
  if (!preserve) {
582
603
  this._clearView()
@@ -626,6 +647,7 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
626
647
  id
627
648
  name
628
649
  }
650
+ conditionOfGoods
629
651
  sku
630
652
  completed
631
653
  packingTypeSize
@@ -658,7 +680,8 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
658
680
  reusablePalletName: reusablePalletName,
659
681
  sku: record.product.sku,
660
682
  minInboundShelfLife: record.product.minInboundShelfLife,
661
- expirationDate: record.expirationDate
683
+ expirationDate: record.expirationDate,
684
+ displayConditionOfGoods: this._formatConditionOfGoods(record.conditionOfGoods)
662
685
  }
663
686
  })
664
687
  .sort((a, b) => {
@@ -723,6 +746,7 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
723
746
  id
724
747
  name
725
748
  }
749
+ conditionOfGoods
726
750
  }
727
751
  }
728
752
  }
@@ -745,7 +769,8 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
745
769
  sku: record.product.sku,
746
770
  minInboundShelfLife: record.product.minInboundShelfLife,
747
771
  expirationDate: record.expirationDate,
748
- location: record.status === WORKSHEET_STATUS.DONE.value ? record.location : null
772
+ location: record.status === WORKSHEET_STATUS.DONE.value ? record.location : null,
773
+ displayConditionOfGoods: this._formatConditionOfGoods(record.conditionOfGoods)
749
774
  }
750
775
  })
751
776
  .sort((a, b) => {
@@ -805,6 +830,7 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
805
830
  name
806
831
  description
807
832
  }
833
+ conditionOfGoods
808
834
  }
809
835
  }
810
836
  }
@@ -824,7 +850,8 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
824
850
  ...record,
825
851
  sku: record.product.sku,
826
852
  completed: record.status === WORKSHEET_STATUS.DONE.value,
827
- location: record.status === WORKSHEET_STATUS.DONE.value ? record.location : null
853
+ location: record.status === WORKSHEET_STATUS.DONE.value ? record.location : null,
854
+ displayConditionOfGoods: this._formatConditionOfGoods(record.conditionOfGoods)
828
855
  }
829
856
  })
830
857
  .sort((a, b) => {
@@ -893,6 +920,7 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
893
920
  name
894
921
  description
895
922
  }
923
+ conditionOfGoods
896
924
  }
897
925
  }
898
926
  }
@@ -929,7 +957,8 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
929
957
  minInboundShelfLife: record.product.minInboundShelfLife,
930
958
  expirationDate: record.expirationDate,
931
959
  qty: record.actualPackQty + ' / ' + record.qty,
932
- location: record.status === WORKSHEET_STATUS.DONE.value ? record.location : null
960
+ location: record.status === WORKSHEET_STATUS.DONE.value ? record.location : null,
961
+ displayConditionOfGoods: this._formatConditionOfGoods(record.conditionOfGoods)
933
962
  }
934
963
  })
935
964
  .sort((a, b) => {
@@ -0,0 +1,282 @@
1
+ import '@things-factory/barcode-ui'
2
+
3
+ import gql from 'graphql-tag'
4
+ import { css, html } from 'lit-element'
5
+ import { connect } from 'pwa-helpers/connect-mixin.js'
6
+
7
+ import { MultiColumnFormStyles } from '@things-factory/form-ui'
8
+ import { i18next, localize } from '@things-factory/i18n-base'
9
+ import { openOverlay } from '@things-factory/layout-base'
10
+ import { client, PageView, store, navigate } from '@things-factory/shell'
11
+ import { isMobileDevice } from '@things-factory/utils'
12
+
13
+ import { ARRIVAL_NOTICE, RETURN_ORDER } from '../constants'
14
+
15
+ const AVAIL_ORDER_TYPES = { ARRIVAL_NOTICE, RETURN_ORDER }
16
+
17
+ class UnloadProductLandingPage extends connect(store)(localize(i18next)(PageView)) {
18
+ static get properties() {
19
+ return {
20
+ refOrderType: String,
21
+ _validating: Boolean
22
+ }
23
+ }
24
+
25
+ static get styles() {
26
+ return [
27
+ MultiColumnFormStyles,
28
+ css`
29
+ :host {
30
+ display: flex;
31
+ flex-direction: column;
32
+ overflow: hidden;
33
+ }
34
+
35
+ .content-wrapper {
36
+ padding: 0px 16px 0px 16px;
37
+ }
38
+
39
+ h3 {
40
+ color: #017E7F;
41
+ font-weight: bold;
42
+ font-size: 14px;
43
+ margin: 15px 0px 0px 0px;
44
+ padding: 8px 0;
45
+ border-bottom: 1px solid #017E7F;
46
+ }
47
+
48
+ /* Override multi-column-form to stack vertically */
49
+ .multi-column-form {
50
+ display: flex;
51
+ flex-direction: column;
52
+ gap: 20px;
53
+ padding: 0;
54
+ }
55
+
56
+ .multi-column-form fieldset {
57
+ display: flex;
58
+ flex-direction: column;
59
+ align-items: flex-start !important;
60
+ border: none;
61
+ margin: 0;
62
+ padding: 0;
63
+ width: 100%;
64
+ box-sizing: border-box;
65
+ }
66
+
67
+ .multi-column-form label {
68
+ display: block;
69
+ grid-column: unset !important;
70
+ text-align: left !important;
71
+ align-self: flex-start !important;
72
+ margin-bottom: 8px;
73
+ color: #333;
74
+ font-weight: bold;
75
+ font-size: 14px;
76
+ width: 100%;
77
+ }
78
+
79
+ .multi-column-form select {
80
+ grid-column: unset !important;
81
+ width: 100%;
82
+ max-width: 100%;
83
+ min-height: 40px;
84
+ box-sizing: border-box;
85
+ }
86
+
87
+ .multi-column-form [custom-input] {
88
+ grid-column: unset !important;
89
+ width: 100%;
90
+ box-sizing: border-box;
91
+ }
92
+
93
+ .multi-column-form barcode-scanable-input {
94
+ width: 100%;
95
+ max-width: 100%;
96
+ box-sizing: border-box;
97
+ min-width: 0;
98
+ }
99
+ `
100
+ ]
101
+ }
102
+
103
+ get context() {
104
+ return {
105
+ title: i18next.t('title.unloading')
106
+ }
107
+ }
108
+
109
+ get orderNoInput() {
110
+ return this.shadowRoot.querySelector('barcode-scanable-input[name=orderNo]')?.shadowRoot?.querySelector('input')
111
+ }
112
+
113
+ constructor() {
114
+ super()
115
+ this.refOrderType = AVAIL_ORDER_TYPES.ARRIVAL_NOTICE.value
116
+ this._validating = false
117
+ }
118
+
119
+ async pageInitialized() {
120
+ // Only show on mobile
121
+ if (!isMobileDevice()) {
122
+ navigate('unloading')
123
+ return
124
+ }
125
+
126
+ await this.updateComplete
127
+ this._focusOnOrderNoField()
128
+ }
129
+
130
+ pageUpdated(changes, after, before) {
131
+ if (!isMobileDevice() && this.active) {
132
+ navigate('unloading')
133
+ }
134
+ }
135
+
136
+ _focusOnOrderNoField() {
137
+ setTimeout(() => {
138
+ if (this.orderNoInput) {
139
+ this.orderNoInput.focus()
140
+ }
141
+ }, 100)
142
+ }
143
+
144
+ orderTypeChangeHandler(e) {
145
+ this.refOrderType = e.currentTarget.value
146
+ if (this.orderNoInput) {
147
+ this.orderNoInput.value = ''
148
+ }
149
+ this._focusOnOrderNoField()
150
+ }
151
+
152
+ async _validateAndNavigate() {
153
+ if (this._validating) return
154
+
155
+ const orderNo = this.orderNoInput?.value?.trim()
156
+ if (!orderNo) {
157
+ this._showToast({ message: i18next.t('text.please_enter_order_no'), type: 'warning' })
158
+ return
159
+ }
160
+
161
+ this._validating = true
162
+
163
+ try {
164
+ let orderExists = false
165
+
166
+ if (this.refOrderType === AVAIL_ORDER_TYPES.ARRIVAL_NOTICE.value) {
167
+ const response = await client.query({
168
+ query: gql`
169
+ query checkUnloadingWorksheet($arrivalNoticeNo: String!) {
170
+ unloadingWorksheet(arrivalNoticeNo: $arrivalNoticeNo) {
171
+ worksheetInfo {
172
+ arrivalNotice {
173
+ id
174
+ name
175
+ }
176
+ }
177
+ }
178
+ }
179
+ `,
180
+ variables: { arrivalNoticeNo: orderNo }
181
+ })
182
+ orderExists = !response.errors && response.data?.unloadingWorksheet?.worksheetInfo?.arrivalNotice?.id
183
+ } else if (this.refOrderType === AVAIL_ORDER_TYPES.RETURN_ORDER.value) {
184
+ const response = await client.query({
185
+ query: gql`
186
+ query checkUnloadingReturnWorksheet($returnOrderNo: String!) {
187
+ unloadingReturnWorksheet(returnOrderNo: $returnOrderNo) {
188
+ worksheetInfo {
189
+ bizplaceName
190
+ }
191
+ }
192
+ }
193
+ `,
194
+ variables: { returnOrderNo: orderNo }
195
+ })
196
+ orderExists = !response.errors && response.data?.unloadingReturnWorksheet?.worksheetInfo
197
+ }
198
+
199
+ if (!orderExists) {
200
+ this._validating = false
201
+ return
202
+ }
203
+
204
+ // Order exists, navigate to main page with params
205
+ const searchParams = new URLSearchParams()
206
+ searchParams.append('orderType', this.refOrderType)
207
+ searchParams.append('orderNo', orderNo)
208
+
209
+ let url = `unloading?${searchParams.toString()}`
210
+
211
+ navigate(url)
212
+ } catch (e) {
213
+ this._showToast({ message: e.message || i18next.t('text.error_occurred'), type: 'error' })
214
+ } finally {
215
+ this._validating = false
216
+ }
217
+ }
218
+
219
+ _handleOrderNoSubmit(e) {
220
+ if (e.keyCode === 13) {
221
+ e.preventDefault()
222
+ this._validateAndNavigate()
223
+ }
224
+ }
225
+
226
+ _showToast({ type, message }) {
227
+ document.dispatchEvent(
228
+ new CustomEvent('notify', {
229
+ detail: {
230
+ type,
231
+ message
232
+ }
233
+ })
234
+ )
235
+ }
236
+
237
+ render() {
238
+ // IF DESKTOP VIEW, RETURN EMPTY (SAFE GUARD MECHANISM)
239
+ if (!isMobileDevice()) {
240
+ return html``
241
+ }
242
+
243
+ return html`
244
+ <div class="content-wrapper">
245
+ <h3>Scan</h3>
246
+
247
+ <form id="info-form" class="multi-column-form">
248
+ <fieldset>
249
+ <label>${i18next.t('label.order_type')}</label>
250
+ <select name="orderType" @change="${this.orderTypeChangeHandler.bind(this)}" ?disabled="${this._validating}">
251
+ ${Object.keys(AVAIL_ORDER_TYPES).map(key =>
252
+ this.refOrderType === AVAIL_ORDER_TYPES[key].value
253
+ ? html`
254
+ <option value="${AVAIL_ORDER_TYPES[key].value}" selected>
255
+ ${i18next.t(`label.${AVAIL_ORDER_TYPES[key].name}`)}
256
+ </option>
257
+ `
258
+ : html`
259
+ <option value="${AVAIL_ORDER_TYPES[key].value}">
260
+ ${i18next.t(`label.${AVAIL_ORDER_TYPES[key].name}`)}
261
+ </option>
262
+ `
263
+ )}
264
+ </select>
265
+ </fieldset>
266
+
267
+ <fieldset>
268
+ <label>${i18next.t('label.order_no')}</label>
269
+ <barcode-scanable-input
270
+ name="orderNo"
271
+ custom-input
272
+ ?disabled="${this._validating}"
273
+ @keypress="${this._handleOrderNoSubmit.bind(this)}"
274
+ ></barcode-scanable-input>
275
+ </fieldset>
276
+ </form>
277
+ </div>
278
+ `
279
+ }
280
+ }
281
+
282
+ window.customElements.define('unload-product-landing-page', UnloadProductLandingPage)