@things-factory/operato-wms 4.0.23 → 4.0.27

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 (101) hide show
  1. package/client/bootstrap.js +1 -1
  2. package/client/pages/adjustment/transfer-inventory.js +32 -6
  3. package/client/pages/billing/claim-chit/claim-chit-detail.js +32 -35
  4. package/client/pages/billing/claim-chit/claim-chit-list.js +17 -17
  5. package/client/pages/billing/claim-chit/create-claim-chit.js +39 -30
  6. package/client/pages/billing/transport-summary-report.js +21 -23
  7. package/client/pages/bulk-operation/bulk-operation.js +189 -64
  8. package/client/pages/bulk-operation/validate-gan-popup.js +391 -0
  9. package/client/pages/bulk-operation/validate-ro-popup.js +44 -54
  10. package/client/pages/components/popup-unloading.js +47 -34
  11. package/client/pages/components/select-product-popup.js +74 -27
  12. package/client/pages/components/worksheet-information-popup.js +100 -0
  13. package/client/pages/inbound/expiry-date-popup.js +2 -2
  14. package/client/pages/inbound/inbound-reusable-pallet.js +21 -19
  15. package/client/pages/inbound/palletizing-pallets-popup.js +10 -9
  16. package/client/pages/inbound/putaway-product.js +196 -235
  17. package/client/pages/inbound/putaway-worksheet-generate-popup.js +4 -4
  18. package/client/pages/inbound/undo-unload-popup.js +295 -0
  19. package/client/pages/inbound/unload-product.js +236 -646
  20. package/client/pages/inbound/unloaded-inventories-popup.js +129 -0
  21. package/client/pages/inbound/vas-selector.js +9 -8
  22. package/client/pages/inbound/worksheet-unloading.js +15 -11
  23. package/client/pages/inventory/inventory-adjustment.js +9 -10
  24. package/client/pages/inventory-check/check-inventory-popup.js +20 -18
  25. package/client/pages/inventory-check/cycle-count-recheck-popup.js +25 -15
  26. package/client/pages/inventory-check/inspecting-product.js +2 -2
  27. package/client/pages/inventory-check/inventory-check-list.js +30 -19
  28. package/client/pages/inventory-check/search-popup.js +15 -14
  29. package/client/pages/inventory-check/worksheet-cycle-count.js +17 -15
  30. package/client/pages/master/location-list.js +60 -52
  31. package/client/pages/master/pallet-list.js +34 -30
  32. package/client/pages/master/print-location-label.js +37 -36
  33. package/client/pages/master/product/product-list.js +1 -1
  34. package/client/pages/master/warehouse-list.js +33 -29
  35. package/client/pages/master/worker-list.js +30 -30
  36. package/client/pages/order/arrival-notice/arrival-notice-detail.js +409 -21
  37. package/client/pages/order/arrival-notice/assign-buffer-location.js +1 -1
  38. package/client/pages/order/arrival-notice/create-arrival-notice.js +89 -13
  39. package/client/pages/order/arrival-notice/duplicate-arrival-notice.js +90 -10
  40. package/client/pages/order/arrival-notice/edit-product-popup.js +2 -2
  41. package/client/pages/order/goods-received-note/customer-grn-list.js +9 -8
  42. package/client/pages/order/goods-received-note/customer-received-note.js +8 -7
  43. package/client/pages/order/goods-received-note/received-note-list.js +9 -8
  44. package/client/pages/order/release-order/b2b/b2b-order-list.js +78 -2
  45. package/client/pages/order/release-order/b2b/b2b-order-requests.js +32 -16
  46. package/client/pages/order/release-order/b2c/b2c-order-requests.js +49 -5
  47. package/client/pages/order/release-order/batch-generate-single-picking-worksheet-popup.js +314 -0
  48. package/client/pages/order/release-order/batch-picking-popup.js +19 -2
  49. package/client/pages/order/release-order/create-release-order.js +194 -89
  50. package/client/pages/order/release-order/release-extra-product-popup.js +3 -7
  51. package/client/pages/order/release-order/release-order-detail.js +390 -107
  52. package/client/pages/order/return-order/check-return-order.js +15 -13
  53. package/client/pages/order/return-order/create-return-order.js +3 -3
  54. package/client/pages/order/return-order/receive-return-order-requests.js +25 -22
  55. package/client/pages/order/return-order/rejected-return-order.js +8 -14
  56. package/client/pages/order/return-order/return-order-assign-buffer-location.js +16 -14
  57. package/client/pages/order/return-order/return-order-detail.js +35 -31
  58. package/client/pages/order/return-order/return-order-list.js +9 -8
  59. package/client/pages/order/return-order/return-order-requests.js +20 -18
  60. package/client/pages/order/reverse-kitting-order/reverse-kitting-order-list.js +9 -8
  61. package/client/pages/order/transfer-order/receive-transfer-order-request.js +67 -66
  62. package/client/pages/order/transfer-order/rejected-transfer-order.js +7 -6
  63. package/client/pages/order/transfer-order/transfer-order-detail.js +7 -6
  64. package/client/pages/order/transfer-order/transfer-order-requests.js +20 -18
  65. package/client/pages/order/transport-order/contact-point-selector-popup.js +20 -20
  66. package/client/pages/order/transport-order/create-delivery-order.js +1 -1
  67. package/client/pages/order/transport-order/delivery-note-popup.js +52 -46
  68. package/client/pages/order/transport-order/delivery-order-list.js +1 -1
  69. package/client/pages/order/transport-order/print-delivery-note.js +17 -16
  70. package/client/pages/order/transport-order/upload-delivery-note.js +21 -18
  71. package/client/pages/order/transport-order/view-delivery-note.js +19 -22
  72. package/client/pages/order/vas-order/create-vas-order.js +12 -11
  73. package/client/pages/order/vas-order/receive-vas-order.js +25 -22
  74. package/client/pages/order/vas-order/vas-order-detail.js +26 -23
  75. package/client/pages/order/vas-order/vas-order-list.js +9 -8
  76. package/client/pages/order/vas-order/vas-order-requests.js +11 -12
  77. package/client/pages/outbound/outbound-reusable-pallet.js +25 -33
  78. package/client/pages/outbound/packing-product.js +111 -236
  79. package/client/pages/outbound/picking-product.js +288 -380
  80. package/client/pages/outbound/single-outbound-worksheet.js +9 -8
  81. package/client/pages/outbound/sorting-product.js +66 -63
  82. package/client/pages/outbound/worksheet-loading.js +7 -3
  83. package/client/pages/outbound/worksheet-packing.js +3 -3
  84. package/client/pages/outbound/worksheet-picking.js +22 -18
  85. package/client/pages/report/job-sheet-list.js +9 -8
  86. package/client/pages/vas/print-product-label.js +17 -9
  87. package/client/route.js +16 -32
  88. package/dist-server/graphql/resolvers/reports/product-label-report.js +1 -0
  89. package/dist-server/graphql/resolvers/reports/product-label-report.js.map +1 -1
  90. package/package.json +65 -65
  91. package/server/graphql/resolvers/reports/product-label-report.ts +1 -0
  92. package/things-factory.config.js +0 -16
  93. package/translations/en.json +34 -2
  94. package/translations/ko.json +34 -3
  95. package/translations/ms.json +34 -3
  96. package/translations/zh.json +34 -3
  97. package/client/pages/inbound/location-selector.js +0 -224
  98. package/client/pages/master/picking-bin-list.js +0 -354
  99. package/client/pages/order/retail-replenishment-order/retail-replenishment-order-detail.js +0 -315
  100. package/client/pages/order/retail-replenishment-order/retail-replenishment-order-requests.js +0 -307
  101. package/client/pages/order/vas-order/rejected-vas-order.js +0 -300
@@ -3,7 +3,9 @@ import '@things-factory/grist-ui'
3
3
  import '../components/popup-note'
4
4
  import '../components/popup-unloading'
5
5
  import './palletizing-pallets-popup'
6
- import './expiry-date-popup'
6
+ import '../components/worksheet-information-popup'
7
+ import './unloaded-inventories-popup'
8
+ import './undo-unload-popup'
7
9
  import './select-product-batch'
8
10
 
9
11
  import gql from 'graphql-tag'
@@ -11,7 +13,7 @@ import { css, html } from 'lit-element'
11
13
  import orderBy from 'lodash/orderBy'
12
14
  import { connect } from 'pwa-helpers/connect-mixin.js'
13
15
 
14
- import { MultiColumnFormStyles, SingleColumnFormStyles } from '@things-factory/form-ui'
16
+ import { MultiColumnFormStyles } from '@things-factory/form-ui'
15
17
  import { i18next, localize } from '@things-factory/i18n-base'
16
18
  import { openPopup } from '@things-factory/layout-base'
17
19
  import { client, CustomAlert, PageView, store } from '@things-factory/shell'
@@ -19,69 +21,54 @@ import { CommonButtonStyles } from '@things-factory/styles'
19
21
  import { isMobileDevice } from '@things-factory/utils'
20
22
 
21
23
  import { fetchSettingRule } from '../../fetch-setting-value'
22
- import { ARRIVAL_NOTICE, INVENTORY_STATUS, PALLET_STATUS, RETURN_ORDER, VAS_TYPE } from '../constants'
24
+ import { ARRIVAL_NOTICE, PALLET_STATUS, RETURN_ORDER, VAS_TYPE } from '../constants'
23
25
 
24
26
  const AVAIL_ORDER_TYPES = { ARRIVAL_NOTICE, RETURN_ORDER }
25
27
  class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
26
28
  static get properties() {
27
29
  return {
28
- _orderNo: String,
29
- _palletId: String,
30
+ _bizplaceName: String,
30
31
  _cartonId: String,
31
- _productName: String,
32
- _isLooseItem: Boolean,
33
32
  _enableProductScanning: Boolean,
34
- _isQtyChecked: Boolean,
33
+ _expirationPeriod: Number,
35
34
  _enableCartonLabel: Boolean,
36
35
  _enableInputQty: Boolean,
36
+ _isLooseItem: Boolean,
37
+ _isQtyChecked: Boolean,
37
38
  _isRequiredCheckExpiry: Boolean,
38
- _expirationPeriod: Number,
39
- customerCompanyDomainId: String,
40
- orderProductConfig: Object,
41
- orderProductData: Object,
42
- palletProductConfig: Object,
43
- palletProductData: Object,
44
- _selectedOrderProduct: Object,
45
- _selectedInventory: Object,
46
- _unloadedInventories: Array,
47
39
  _isReusablePallet: Boolean,
40
+ _orderNo: String,
41
+ _palletId: String,
48
42
  _reusablePalletId: Array,
49
43
  _reusablePalletIdData: Object,
44
+ _scanning: Boolean,
45
+ _selectedOrderProduct: Object,
46
+ _selectedInventory: Object,
47
+ _unloadedInventories: Array,
48
+ _worksheetInfo: Object,
49
+ customerCompanyDomainId: String,
50
+ orderProductConfig: Object,
51
+ orderProductData: Object,
50
52
  orderVasData: Object,
51
- refOrderType: String,
52
- _scanning: Boolean
53
+ refOrderType: String
53
54
  }
54
55
  }
55
56
 
56
57
  static get styles() {
57
58
  return [
58
59
  MultiColumnFormStyles,
59
- SingleColumnFormStyles,
60
60
  css`
61
- :host {
62
- display: flex;
63
- flex-direction: column;
64
- }
65
- .grist {
66
- background-color: var(--main-section-background-color);
67
- display: flex;
68
- overflow: hidden;
61
+ data-grist {
62
+ overflow: auto;
69
63
  flex: 1;
70
64
  }
71
- .left-column {
72
- overflow: hidden;
73
- display: flex;
74
- flex: 1;
75
- flex-direction: column;
65
+ #form-section {
66
+ background-color: white;
76
67
  }
77
- .right-column {
78
- overflow: auto;
68
+ :host {
79
69
  display: flex;
80
- flex: 1;
81
70
  flex-direction: column;
82
- }
83
- data-grist {
84
- flex: 1;
71
+ overflow: hidden;
85
72
  }
86
73
  h2 {
87
74
  padding: var(--subtitle-padding);
@@ -89,41 +76,46 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
89
76
  color: var(--subtitle-text-color);
90
77
  border-bottom: var(--subtitle-border-bottom);
91
78
  }
92
- .grist h2 {
93
- margin: var(--grist-title-margin);
94
- border: var(--grist-title-border);
95
- font: var(--grist-title-font);
96
- color: var(--secondary-color);
97
- }
98
- .grist h2 mwc-icon {
79
+ legend mwc-icon {
99
80
  vertical-align: middle;
100
81
  margin: var(--grist-title-icon-margin);
101
82
  font-size: var(--grist-title-icon-size);
102
83
  color: var(--grist-title-icon-color);
103
- }
104
- h2 + data-grist {
105
- padding-top: var(--grist-title-with-grid-padding);
106
- }
107
- div.palletizing {
108
- grid-column: span 12 / auto;
109
- display: inline-flex;
110
- align-items: center;
111
- font-size: 12px;
112
- background-color: #ccc0;
113
- border: 1px solid #6e7e8e;
114
- color: #394e63;
115
- }
116
- @media (max-width: 460px) {
117
- :host {
118
- display: block;
119
- }
84
+ cursor: pointer;
120
85
  }
121
86
  `
122
87
  ]
123
88
  }
124
89
 
90
+ get actualQtyInput() {
91
+ return this.shadowRoot.querySelector('input[name=qty]')
92
+ }
93
+
94
+ get cartonInput() {
95
+ return this.shadowRoot.querySelector('barcode-scanable-input[name=cartonId]').shadowRoot.querySelector('input')
96
+ }
97
+
98
+ get completable() {
99
+ let completable = false
100
+ const orderProductWithIssues = this.orderProductData.records.filter(orderProduct => !orderProduct.validity)
101
+ if (!orderProductWithIssues?.length) {
102
+ completable = this.orderProductData.records.every(record => record.validity)
103
+ } else {
104
+ completable = orderProductWithIssues.every(record => record.issue)
105
+ }
106
+ return completable
107
+ }
108
+
125
109
  get context() {
126
110
  var actions = []
111
+ if (this._isLooseItem) {
112
+ actions.push({
113
+ title: i18next.t('button.vas'),
114
+ action: this._openVasPopup.bind(this),
115
+ ...CommonButtonStyles.vas
116
+ })
117
+ }
118
+
127
119
  if (this._selectedOrderProduct && !this._selectedOrderProduct.validity) {
128
120
  actions.push({
129
121
  title: i18next.t('button.issue'),
@@ -132,28 +124,18 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
132
124
  })
133
125
  }
134
126
 
135
- if (this._selectedInventory) {
127
+ if (this._unloadedInventories && this._unloadedInventories.length > 0) {
136
128
  actions.push({
137
129
  title: i18next.t('button.undo'),
138
- action: this._undoUnloading.bind(this),
130
+ action: this._openUndoUnloadPopup.bind(this),
139
131
  ...CommonButtonStyles.undo
140
132
  })
141
133
  }
142
134
 
143
- if (this._selectedInventory && !this._selectedInventory?.checked) {
144
- actions.push({
145
- title: i18next.t('button.qty_checked'),
146
- action: this._completeQC.bind(this),
147
- ...CommonButtonStyles.inspect
148
- })
149
- }
150
-
151
135
  if (
152
136
  this._unloadedInventories &&
153
137
  this._unloadedInventories.length > 0 &&
154
- this.orderProductData.records.some(
155
- task => !task.validity && this._unloadedInventories.every(unloadedInventory => unloadedInventory.checked)
156
- )
138
+ this.orderProductData.records.some(task => !task.validity)
157
139
  ) {
158
140
  actions.push({
159
141
  title: i18next.t('button.partial_unload'),
@@ -177,43 +159,28 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
177
159
  }
178
160
  }
179
161
 
180
- get infoForm() {
181
- return this.shadowRoot.querySelector('form#info-form')
162
+ get expDateInput() {
163
+ return this.shadowRoot.querySelector('input[name=expDate]')
182
164
  }
183
165
 
184
166
  get inputForm() {
185
167
  return this.shadowRoot.querySelector('form#input-form')
186
168
  }
187
169
 
188
- get orderProductGrist() {
189
- return this.shadowRoot.querySelector('data-grist#order-product-grist')
170
+ get lotInput() {
171
+ return this.shadowRoot.querySelector('barcode-scanable-input[name=lotId]').shadowRoot.querySelector('input')
190
172
  }
191
173
 
192
- get palletProductGrist() {
193
- return this.shadowRoot.querySelector('data-grist#pallet-product-grist')
174
+ get orderProductGrist() {
175
+ return this.shadowRoot.querySelector('data-grist#order-product-grist')
194
176
  }
195
177
 
196
178
  get orderNoInput() {
197
179
  return this.shadowRoot.querySelector('barcode-scanable-input[name=orderNo]').shadowRoot.querySelector('input')
198
180
  }
199
181
 
200
- get palletInput() {
201
- return this.shadowRoot.querySelector('barcode-scanable-input[name=palletId]').shadowRoot.querySelector('input')
202
- }
203
-
204
- get cartonInput() {
205
- return this.shadowRoot.querySelector('barcode-scanable-input[name=cartonId]').shadowRoot.querySelector('input')
206
- }
207
-
208
- get completable() {
209
- let completable = false
210
- const orderProductWithIssues = this.orderProductData.records.filter(orderProduct => !orderProduct.validity)
211
- if (!orderProductWithIssues?.length) {
212
- completable = this.orderProductData.records.every(record => record.validity)
213
- } else {
214
- completable = orderProductWithIssues.every(record => record.issue)
215
- }
216
- return completable
182
+ get palletProductGrist() {
183
+ return this.shadowRoot.querySelector('data-grist#pallet-product-grist')
217
184
  }
218
185
 
219
186
  get productBarcodeInput() {
@@ -222,19 +189,10 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
222
189
  ?.shadowRoot?.querySelector('input')
223
190
  }
224
191
 
225
- get actualQtyInput() {
226
- return this.shadowRoot.querySelector('input[name=qty]')
227
- }
228
-
229
- get expDateInput() {
230
- return this.shadowRoot.querySelector('input[name=expDate]')
231
- }
232
-
233
192
  render() {
234
193
  return html`
235
194
  <form id="info-form" class="multi-column-form">
236
195
  <fieldset>
237
- <legend>${i18next.t('title.scan_area')}</legend>
238
196
  <label>${i18next.t('label.order_type')}</label>
239
197
  <select name="orderType" @change="${this.orderTypeChangeHandler.bind(this)}">
240
198
  ${Object.keys(AVAIL_ORDER_TYPES).map(key =>
@@ -268,157 +226,90 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
268
226
  }}"
269
227
  ></barcode-scanable-input>
270
228
  </fieldset>
229
+ </form>
271
230
 
231
+ <form id="input-form" class="multi-column-form" @keypress="${this._transactionHandler.bind(this)}">
272
232
  <fieldset>
273
- <legend>
274
- ${`${
275
- this.refOrderType === AVAIL_ORDER_TYPES.RETURN_ORDER.value
276
- ? i18next.t('title.return_order')
277
- : i18next.t('title.arrival_notice')
278
- }: ${this._orderNo}`}
279
- </legend>
280
-
281
- <label>${i18next.t('label.company')}</label>
282
- <input name="bizplaceName" readonly />
283
-
284
- <label ?hidden="${this.refOrderType === AVAIL_ORDER_TYPES.RETURN_ORDER.value}"
285
- >${i18next.t('label.container_no')}</label
286
- >
287
- <input ?hidden="${this.refOrderType === AVAIL_ORDER_TYPES.RETURN_ORDER.value}" name="containerNo" readonly />
288
-
289
- <label>${i18next.t('label.ref_no')}</label>
290
- <input name="refNo" readonly />
291
-
292
- <label>${i18next.t('label.staging_area')}</label>
293
- <input name="bufferLocation" readonly />
294
-
295
- <label>${i18next.t('label.started_at')}</label>
296
- <input name="startedAt" type="datetime-local" readonly />
233
+ ${this._enableCartonLabel
234
+ ? html`<label>${i18next.t('label.carton_id')}</label>
235
+ <barcode-scanable-input
236
+ name="cartonId"
237
+ .value=${this._cartonId}
238
+ without-enter
239
+ custom-input
240
+ ></barcode-scanable-input>`
241
+ : html`<label>${i18next.t('label.lot_id')}</label>
242
+ <barcode-scanable-input
243
+ name="lotId"
244
+ .value=${this._palletId}
245
+ without-enter
246
+ custom-input
247
+ ></barcode-scanable-input>`}
248
+ ${this._enableProductScanning
249
+ ? html`
250
+ <label>${i18next.t('label.product_barcode')}</label>
251
+ <barcode-scanable-input name="productBarcode" without-enter custom-input></barcode-scanable-input>
252
+ `
253
+ : ''}
254
+ ${this._enableInputQty
255
+ ? html`
256
+ <label>${i18next.t('label.actual_qty')}</label>
257
+ <input name="qty" type="number" min="1" />
258
+ `
259
+ : ''}
260
+ ${this._isRequiredCheckExpiry
261
+ ? html`
262
+ <label>${i18next.t('label.expiry_date')}</label>
263
+ <input name="expDate" type="date" />
264
+ `
265
+ : ''}
297
266
  </fieldset>
298
267
  </form>
299
268
 
300
- <div class="grist">
301
- <div class="left-column">
302
- <h2><mwc-icon>list_alt</mwc-icon>${i18next.t('title.unloading')}</h2>
303
- <data-grist
304
- id="order-product-grist"
305
- .mode=${isMobileDevice() ? 'LIST' : 'GRID'}
306
- .config=${this.orderProductConfig}
307
- .data=${this.orderProductData}
308
- ></data-grist>
309
-
310
- <h2><mwc-icon>list_alt</mwc-icon>${i18next.t('title.unloaded')}</h2>
311
- <data-grist
312
- id="pallet-product-grist"
313
- .mode=${isMobileDevice() ? 'LIST' : 'GRID'}
314
- .config=${this.palletProductConfig}
315
- .data=${this.palletProductData}
316
- ></data-grist>
317
- </div>
318
-
319
- <div class="right-column">
320
- <form id="input-form" class="single-column-form" @keypress="${this._transactionHandler.bind(this)}">
269
+ <data-grist
270
+ .mode=${isMobileDevice() ? 'LIST' : 'GRID'}
271
+ .config=${this.orderProductConfig}
272
+ .data=${this.orderProductData}
273
+ >
274
+ <div slot="headroom" id="form-section">
275
+ <form id="info-form" class="multi-column-form">
321
276
  <fieldset>
322
- <legend>${i18next.t('title.product')}: ${this._productName}</legend>
323
-
324
- <label>${i18next.t('label.batch_no')}</label>
325
- <input name="batchId" readonly />
326
-
327
- <label>${i18next.t('label.batch_no_ref')}</label>
328
- <input name="batchIdRef" readonly />
329
-
330
- <label>${i18next.t('label.packing_type')}</label>
331
- <input name="packingTypeSize" readonly />
332
-
333
- <label>${i18next.t('label.total_pallet_qty')}</label>
334
- <input name="palletQty" type="number" readonly />
335
-
336
- <label>${i18next.t('label.total_pack_qty')}</label>
337
- <input name="totalActualQty" readonly />
338
-
339
- <label>${i18next.t('label.actual_qty')}</label>
340
- <input name="actualQty" type="number" readonly />
341
- </fieldset>
342
-
343
- ${this._isLooseItem
344
- ? html`
345
- <fieldset>
346
- <legend>${i18next.t('title.palletizing')}</legend>
347
- <div class="palletizing" @click="${this._openPalletizingPallets.bind(this)}">
348
- <mwc-icon>apps</mwc-icon>Pallets
349
- </div>
350
- </fieldset>
351
- `
352
- : ''}
353
-
354
- <fieldset>
355
- <legend>${i18next.t('title.input_section')}</legend>
356
-
357
- ${this._enableCartonLabel
358
- ? html`<label>${i18next.t('label.carton_id')}</label>
359
- <barcode-scanable-input
360
- name="cartonId"
361
- .value=${this._cartonId}
362
- without-enter
363
- custom-input
364
- ></barcode-scanable-input>`
365
- : html`<label>${i18next.t('label.lot_id')}</label>
366
- <barcode-scanable-input
367
- name="palletId"
368
- .value=${this._palletId}
369
- without-enter
370
- custom-input
371
- ></barcode-scanable-input>`}
372
- ${this._enableProductScanning
373
- ? html`
374
- <label>${i18next.t('label.product_barcode')}</label>
375
- <barcode-scanable-input name="productBarcode" without-enter custom-input></barcode-scanable-input>
376
- `
377
- : ''}
378
- ${this._enableInputQty
379
- ? html`
380
- <label>${i18next.t('label.actual_qty')}</label>
381
- <input name="qty" type="number" min="1" />
382
- `
383
- : ''}
384
- ${this._isRequiredCheckExpiry || this._selectedInventory?.expirationDate
385
- ? html`
386
- <label>${i18next.t('label.expiry_date')}</label>
387
- <input name="expDate" type="date" />
388
- `
389
- : ''}
277
+ <legend>
278
+ ${this._orderNo}
279
+ ${this._orderNo
280
+ ? html`(${this._bizplaceName})
281
+ <mwc-icon @click="${this._openWorksheetInformation.bind(this)}">info</mwc-icon>`
282
+ : ''}
283
+ </legend>
390
284
  </fieldset>
391
285
  </form>
392
286
  </div>
393
- </div>
287
+ </data-grist>
394
288
  `
395
289
  }
396
290
 
397
291
  constructor() {
398
292
  super()
399
- this._isReusablePallet = false
400
- this._isLooseItem = false
401
293
  this._enableCartonLabel = false
402
294
  this._enableInputQty = true
403
- this._isQtyChecked = false
404
295
  this._enableProductScanning = false
405
- this._isRequiredCheckExpiry = false
406
296
  this._expirationPeriod = 0
297
+ this._isLooseItem = false
298
+ this._isQtyChecked = false
299
+ this._isRequiredCheckExpiry = false
300
+ this._isReusablePallet = false
407
301
  this._orderNo = ''
408
- this._productName = ''
409
- this._productSku = ''
302
+ this._scanning = false
410
303
  this.refOrderType = AVAIL_ORDER_TYPES.ARRIVAL_NOTICE.value
411
304
  this.orderProductData = { records: [] }
412
- this.reusablePalletIdData = { records: [] }
413
305
  this.orderVasData = { records: [] }
414
- this._scanning = false
306
+ this.reusablePalletIdData = { records: [] }
415
307
  }
416
308
 
417
309
  updated(changedProps) {
418
310
  if (
419
311
  changedProps.has('_orderNo') ||
420
312
  changedProps.has('_selectedOrderProduct') ||
421
- changedProps.has('_selectedInventory') ||
422
313
  changedProps.has('_unloadedInventories')
423
314
  ) {
424
315
  this.updateContext()
@@ -439,15 +330,9 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
439
330
  click: (columns, data, column, record, rowIndex) => {
440
331
  if (record && record.batchId) {
441
332
  this._selectedOrderProduct = record
442
- this._selectedInventory = null
443
- this._productName = `${record.product.sku + ' - ' + record.product.name} ${
444
- record.product.description ? `(${record.product.description})` : ''
445
- }`
446
333
  this._isRequiredCheckExpiry = record.product?.isRequiredCheckExpiry
447
334
  this._isQtyChecked = false
448
335
 
449
- record.totalActualQty = `${record.actualPackQty || 0} / ${record.packQty}`
450
-
451
336
  this.inputForm.reset()
452
337
  if (this._enableCartonLabel) {
453
338
  if (this._enableProductScanning) {
@@ -457,11 +342,9 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
457
342
  this.cartonInput.value = ''
458
343
  this._focusOnCartonInput()
459
344
  } else {
460
- this.palletInput.value = ''
461
- this._focusOnPalletInput()
345
+ this.lotInput.value = ''
346
+ this._focusOnLotInput()
462
347
  }
463
- this._fillUpForm(this.inputForm, record)
464
- this._fetchInventories()
465
348
  }
466
349
  }
467
350
  }
@@ -479,11 +362,42 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
479
362
  'palletQty',
480
363
  'actualPalletQty',
481
364
  'packQty',
482
- 'actualPackQty'
365
+ 'actualPackQty',
366
+ 'issue'
483
367
  ]
484
368
  },
485
369
  columns: [
486
370
  { type: 'gutter', gutterName: 'sequence' },
371
+ {
372
+ type: 'gutter',
373
+ gutterName: 'button',
374
+ icon: 'reorder',
375
+ handlers: {
376
+ click: (columns, data, column, record, rowIndex) => {
377
+ if (!this._unloadedInventories?.length) return
378
+
379
+ const { sku, batchId, packingType, packingSize } = record
380
+ openPopup(
381
+ html`
382
+ <unloaded-inventories-popup
383
+ .unloadedInventories="${this._unloadedInventories.filter(
384
+ inventory =>
385
+ inventory.batchId == batchId &&
386
+ inventory?.product.sku == sku &&
387
+ inventory.packingType == packingType &&
388
+ inventory.packingSize == packingSize
389
+ )}"
390
+ ></unloaded-inventories-popup>
391
+ `,
392
+ {
393
+ backdrop: true,
394
+ size: 'large',
395
+ title: i18next.t('title.unloaded_inventories')
396
+ }
397
+ )
398
+ }
399
+ }
400
+ },
487
401
  {
488
402
  type: 'boolean',
489
403
  name: 'validity',
@@ -493,190 +407,82 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
493
407
  {
494
408
  type: 'string',
495
409
  name: 'batchId',
410
+ label: true,
496
411
  header: i18next.t('field.batch_id'),
497
412
  width: 150
498
413
  },
499
414
  {
500
415
  type: 'string',
501
416
  name: 'batchIdRef',
417
+ label: true,
502
418
  header: i18next.t('field.batch_no_ref'),
503
419
  width: 150
504
420
  },
505
421
  {
506
- type: 'strinng',
422
+ type: 'string',
507
423
  name: 'sku',
424
+ label: true,
508
425
  header: i18next.t('field.sku'),
509
426
  width: 120
510
427
  },
511
428
  {
512
429
  type: 'object',
513
430
  name: 'product',
431
+ label: true,
514
432
  header: i18next.t('field.product'),
515
433
  width: 200
516
434
  },
517
435
  {
518
- type: 'strinng',
436
+ type: 'string',
519
437
  name: 'packingType',
438
+ label: true,
520
439
  header: i18next.t('field.packing_type'),
521
440
  width: 120
522
441
  },
523
442
  {
524
443
  type: 'number',
525
444
  name: 'packingSize',
445
+ label: true,
526
446
  header: i18next.t('field.packing_size'),
527
447
  width: 120
528
448
  },
529
449
  {
530
450
  type: 'integer',
531
451
  name: 'palletQty',
452
+ label: true,
532
453
  header: i18next.t('field.pallet_qty'),
533
- width: 60
454
+ width: 90
534
455
  },
535
456
  {
536
457
  type: 'integer',
537
458
  name: 'actualPalletQty',
459
+ label: true,
538
460
  header: i18next.t('field.actual_pallet_qty'),
539
- width: 60
461
+ width: 100
540
462
  },
541
463
  {
542
464
  type: 'integer',
543
465
  name: 'packQty',
466
+ label: true,
544
467
  header: i18next.t('field.total_pack_qty'),
545
- width: 60
468
+ width: 90
546
469
  },
547
470
  {
548
471
  type: 'integer',
549
472
  name: 'actualPackQty',
473
+ label: true,
550
474
  header: i18next.t('field.actual_pack_qty'),
551
- width: 60
475
+ width: 100
552
476
  },
553
477
  {
554
478
  type: 'string',
555
479
  name: 'issue',
480
+ label: true,
556
481
  header: i18next.t('field.issue'),
557
482
  width: 100
558
483
  }
559
484
  ]
560
485
  }
561
-
562
- this.palletProductConfig = {
563
- rows: {
564
- appendable: false,
565
- handlers: {
566
- click: (columns, data, column, record, rowIndex) => {
567
- if (record.reusablePallet) {
568
- this._openPopupUnloading(record.reusablePallet.name, this.orderProductData, {
569
- records: this.palletProductData.records.filter(item => record.reusablePallet == item.reusablePallet)
570
- })
571
- } else {
572
- if (record && record.palletId) {
573
- this._selectedInventory = record
574
- this._productName = `${record.product.sku + ' - ' + record.product.name} ${
575
- record.product.description ? `(${record.product.description})` : ''
576
- }`
577
-
578
- if (this._enableCartonLabel) this.cartonInput.value = record.cartonId
579
- else this.palletInput.value = record.palletId
580
-
581
- if (record?.checked) this._isQtyChecked = true
582
- else this._isQtyChecked = false
583
-
584
- record.actualQty = record.qty
585
-
586
- if (record?.product.isRequiredCheckExpiry && !record?.expirationDate) this._openUpdateExpiryDate()
587
- if (!record?.checked && this._enableProductScanning) this._focusOnProductBarcodeInput()
588
- else if (record.checked && this._enableProductScanning) this.productBarcodeInput.readOnly = true
589
-
590
- this._fillUpForm(this.inputForm, record)
591
- }
592
- }
593
- }
594
- }
595
- },
596
- list: {
597
- fields: [
598
- 'checked',
599
- 'sku',
600
- 'product',
601
- 'batchId',
602
- 'palletId',
603
- 'cartonId',
604
- 'qty',
605
- 'expirationDate',
606
- 'reusablePalletName'
607
- ]
608
- },
609
- pagination: { infinite: true },
610
- columns: [
611
- { type: 'gutter', gutterName: 'sequence' },
612
- {
613
- type: 'boolean',
614
- name: 'checked',
615
- header: i18next.t('field.checked'),
616
- width: 40
617
- },
618
- {
619
- type: 'strinng',
620
- name: 'sku',
621
- header: i18next.t('field.sku'),
622
- width: 120
623
- },
624
- {
625
- type: 'object',
626
- name: 'product',
627
- header: i18next.t('field.product'),
628
- width: 240
629
- },
630
- {
631
- type: 'string',
632
- name: 'packingType',
633
- header: i18next.t('field.packing_type'),
634
- width: 120
635
- },
636
- {
637
- type: 'string',
638
- name: 'packingSize',
639
- header: i18next.t('field.packing_size'),
640
- width: 120
641
- },
642
- {
643
- type: 'string',
644
- name: 'batchId',
645
- header: i18next.t('field.batch_id'),
646
- width: 120
647
- },
648
- {
649
- type: 'string',
650
- name: 'palletId',
651
- header: i18next.t('field.lot_id'),
652
- width: 120
653
- },
654
- {
655
- type: 'string',
656
- name: 'cartonId',
657
- header: i18next.t('field.carton_id'),
658
- width: 120
659
- },
660
- {
661
- type: 'integer',
662
- name: 'qty',
663
- header: i18next.t('field.actual_pack_qty'),
664
- width: 80
665
- },
666
- {
667
- type: 'date',
668
- name: 'expirationDate',
669
- header: i18next.t('field.exp_date'),
670
- width: 120
671
- },
672
- {
673
- type: 'string',
674
- name: 'reusablePalletName',
675
- header: i18next.t('field.reusable_pallet'),
676
- width: 120
677
- }
678
- ]
679
- }
680
486
  }
681
487
 
682
488
  async _fetchProducts(orderNo) {
@@ -691,6 +497,8 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
691
497
  customerCompanyDomainId
692
498
  containerNo
693
499
  refNo
500
+ refNo2
501
+ refNo3
694
502
  looseItem
695
503
  bufferLocation
696
504
  startedAt
@@ -743,8 +551,9 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
743
551
  const orderVasInfo = worksheetInfo.orderVas
744
552
 
745
553
  this._orderNo = orderNo
554
+ this._bizplaceName = worksheetInfo.bizplaceName
746
555
  this._isLooseItem = worksheetInfo.looseItem
747
- this._fillUpForm(this.infoForm, worksheetInfo)
556
+ this._worksheetInfo = worksheetInfo
748
557
 
749
558
  this.orderVasData = orderVasInfo
750
559
  ? {
@@ -773,8 +582,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
773
582
  validity:
774
583
  worksheetDetailInfo.actualPackQty === worksheetDetailInfo.packQty &&
775
584
  worksheetDetailInfo.actualPalletQty === worksheetDetailInfo.palletQty,
776
- sku: worksheetDetailInfo.product.sku,
777
- packingTypeSize: `${worksheetDetailInfo.packingType}(${worksheetDetailInfo.packingSize})`
585
+ sku: worksheetDetailInfo.product.sku
778
586
  }
779
587
  }),
780
588
  ['validity'],
@@ -869,13 +677,11 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
869
677
  }
870
678
 
871
679
  async _fetchInventories() {
872
- let worksheetDetailNames = []
873
- if (this._selectedOrderProduct) worksheetDetailNames.push(this._selectedOrderProduct.name)
874
- else worksheetDetailNames = this.orderProductData.records.map(record => record.name)
875
680
  const response = await client.query({
876
681
  query: gql`
877
682
  query unloadedInventories($worksheetDetailNames: [String]!) {
878
683
  unloadedInventories(worksheetDetailNames: $worksheetDetailNames) {
684
+ id
879
685
  batchId
880
686
  packingType
881
687
  bizplace {
@@ -903,28 +709,11 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
903
709
  }
904
710
  }
905
711
  `,
906
- variables: { worksheetDetailNames }
712
+ variables: { worksheetDetailNames: this.orderProductData.records.map(record => record.name) }
907
713
  })
908
714
 
909
715
  if (!response.errors) {
910
- this._unloadedInventories = response.data.unloadedInventories.map(unloadedInventory => {
911
- return {
912
- ...unloadedInventory,
913
- checked: unloadedInventory.status === INVENTORY_STATUS.UNLOADED.value,
914
- expirationDate: unloadedInventory?.expirationDate ? unloadedInventory?.expirationDate : null,
915
- sku: unloadedInventory.product.sku,
916
- packingTypeSize: `${unloadedInventory.packingType}(${unloadedInventory.packingSize})`
917
- }
918
- })
919
-
920
- this.palletProductData = {
921
- records: this._unloadedInventories.map(unloadedInventory => {
922
- return {
923
- ...unloadedInventory,
924
- reusablePalletName: unloadedInventory?.reusablePallet ? unloadedInventory.reusablePallet.name : ''
925
- }
926
- })
927
- }
716
+ this._unloadedInventories = response.data.unloadedInventories
928
717
 
929
718
  this.orderProductData = {
930
719
  records: this.orderProductData.records.map(orderProduct => {
@@ -954,9 +743,9 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
954
743
  this._focusOnCartonInput()
955
744
  }
956
745
  } else {
957
- this.palletInput.value = ''
746
+ this.lotInput.value = ''
958
747
  if (this._enableInputQty) this.actualQtyInput.value = ''
959
- this._focusOnPalletInput()
748
+ this._focusOnLotInput()
960
749
  }
961
750
 
962
751
  if (this._enableProductScanning) {
@@ -969,39 +758,16 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
969
758
 
970
759
  _clearView() {
971
760
  this.orderProductData = { records: [] }
972
- this.palletProductData = { records: [] }
973
- this.infoForm.reset()
974
761
  this.inputForm.reset()
975
- this._productName = ''
976
762
  this._selectedOrderProduct = null
977
763
  this._selectedInventory = null
978
764
  this._unloadedInventories = null
979
765
  this.updateContext()
980
766
  }
981
767
 
982
- _fillUpForm(form, data) {
983
- for (let key in data) {
984
- Array.from(form.querySelectorAll('input')).forEach(field => {
985
- if (field.name === key && field.type === 'checkbox') {
986
- field.checked = data[key]
987
- } else if (field.name === key && field.type === 'datetime-local') {
988
- const datetime = Number(data[key])
989
- const timezoneOffset = new Date(datetime).getTimezoneOffset() * 60000
990
- field.value = new Date(datetime - timezoneOffset).toISOString().slice(0, -1)
991
- } else if (field.name === key) {
992
- if (data[key] instanceof Object) {
993
- const objectData = data[key]
994
- field.value = `${objectData.name} ${objectData.description ? `(${objectData.description})` : ''}`
995
- } else {
996
- field.value = data[key]
997
- }
998
- }
999
- })
1000
- }
1001
- }
1002
-
1003
768
  async _transactionHandler(e) {
1004
769
  if (e.keyCode === 13) {
770
+ e.preventDefault()
1005
771
  try {
1006
772
  if (this._enableCartonLabel) {
1007
773
  await this._validateUnloading()
@@ -1053,7 +819,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1053
819
  worksheetDetailName: this._selectedOrderProduct.name,
1054
820
  productBarcode: this.productBarcodeInput.value.trim(),
1055
821
  inventory: {
1056
- palletId: this._enableCartonLabel ? null : this.palletInput.value.trim(),
822
+ palletId: this._enableCartonLabel ? null : this.lotInput.value.trim(),
1057
823
  cartonId: this._enableCartonLabel ? this.cartonInput.value.trim() : null,
1058
824
  expirationDate: this.expDateInput?.value ? this.expDateInput.value : null
1059
825
  }
@@ -1098,7 +864,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1098
864
  variables: {
1099
865
  worksheetDetailName: this._selectedOrderProduct.name,
1100
866
  inventory: {
1101
- palletId: this._enableCartonLabel ? null : this.palletInput.value.trim(),
867
+ palletId: this._enableCartonLabel ? null : this.lotInput.value.trim(),
1102
868
  cartonId: this._enableCartonLabel ? this.cartonInput.value.trim() : null,
1103
869
  qty: parseInt(this.actualQtyInput.value),
1104
870
  expirationDate: this._isRequiredCheckExpiry ? this.expDateInput.value : null
@@ -1160,7 +926,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1160
926
  const response = await this.fetchProductDetail(this.productBarcodeInput?.value || '', '')
1161
927
 
1162
928
  if (!response.errors) {
1163
- const { product, packingSize, packingType, id } = response.data.productDetail
929
+ const { product, packingSize, packingType } = response.data.productDetail
1164
930
  const foundOrderProducts = this.orderProductData.records.filter(
1165
931
  orderProduct =>
1166
932
  orderProduct.product.id === product.id &&
@@ -1189,20 +955,8 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1189
955
 
1190
956
  if (foundOrderProducts?.length > 1 && !this._selectedOrderProduct) {
1191
957
  this.selectOrderProduct(foundOrderProducts)
1192
- } else if (foundOrderProducts?.length == 1) {
1193
- if (!this._selectedOrderProduct) this._selectedOrderProduct = foundOrderProducts[0]
1194
-
1195
- this._productName = `(${this._selectedOrderProduct.product.sku})${this._selectedOrderProduct.product.name} ${
1196
- this._selectedOrderProduct.product.description ? `(${this._selectedOrderProduct.product.description})` : ''
1197
- }`
1198
- this._fillUpForm(this.inputForm, this._selectedOrderProduct)
1199
- } else if (foundOrderProducts?.length == 0 && foundParentProducts?.length == 1 && !this._selectedOrderProduct) {
1200
- this._selectedOrderProduct = foundParentProducts[0]
1201
-
1202
- this._productName = `(${this._selectedOrderProduct.product.sku})${this._selectedOrderProduct.product.name} ${
1203
- this._selectedOrderProduct.product.description ? `(${this._selectedOrderProduct.product.description})` : ''
1204
- }`
1205
- this._fillUpForm(this.inputForm, this._selectedOrderProduct)
958
+ } else {
959
+ this._selectedOrderProduct = foundOrderProducts[0]
1206
960
  }
1207
961
  }
1208
962
  } catch (e) {
@@ -1235,8 +989,8 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1235
989
 
1236
990
  async _validateUnloading() {
1237
991
  if (!this._enableCartonLabel) {
1238
- if (!this.palletInput.value) {
1239
- this._focusOnPalletInput()
992
+ if (!this.lotInput.value) {
993
+ this._focusOnLotInput()
1240
994
  throw new Error(i18next.t('text.lot_id_is_empty'))
1241
995
  }
1242
996
  } else {
@@ -1298,35 +1052,6 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1298
1052
  }
1299
1053
  }
1300
1054
 
1301
- _openPopupUnloading(reusablePallet, unloadingData, unloadedData) {
1302
- openPopup(
1303
- html`
1304
- <popup-unloading
1305
- .ganNo="${this._orderNo}"
1306
- ._productSku="${this._productSku}"
1307
- ._productName="${this._productName}"
1308
- .reusablePallet="${reusablePallet}"
1309
- .unloadingGristData="${unloadingData}"
1310
- .unloadedGristData="${unloadedData}"
1311
- .enableProductScanning="${this._enableProductScanning}"
1312
- .reusablePalletData="${this.reusablePalletIdData}"
1313
- ._selectedOrderProduct="${this._selectedOrderProduct}"
1314
- @unloading-pallet="${e => {
1315
- this.orderProductData = e.detail
1316
- }}"
1317
- @unloaded-pallet="${e => {
1318
- this.palletProductData = { records: [] }
1319
- }}"
1320
- ></popup-unloading>
1321
- `,
1322
- {
1323
- backdrop: true,
1324
- size: 'large',
1325
- title: i18next.t('title.unloading_with_reusable_pallet')
1326
- }
1327
- )
1328
- }
1329
-
1330
1055
  _openIssueNote() {
1331
1056
  openPopup(
1332
1057
  html`
@@ -1429,87 +1154,11 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1429
1154
  }
1430
1155
 
1431
1156
  _validateCompletePartially() {
1432
- if (!this._selectedOrderProduct) {
1433
- throw new Error(i18next.t('text.target_is_not_selected'))
1434
- }
1435
-
1436
- if (!this._unloadedInventories || this._unloadedInventories.length <= 0) {
1157
+ if (!this._unloadedInventories?.length) {
1437
1158
  throw new Error(i18next.t('text.nothing_unloaded'))
1438
1159
  }
1439
1160
  }
1440
1161
 
1441
- async _undoUnloading() {
1442
- try {
1443
- this._validateSelectedInventory()
1444
- const result = await CustomAlert({
1445
- title: i18next.t('title.are_you_sure'),
1446
- text: i18next.t('text.undo_unloading'),
1447
- confirmButton: { text: i18next.t('button.confirm') },
1448
- cancelButton: { text: i18next.t('button.cancel') }
1449
- })
1450
-
1451
- if (!result.value) {
1452
- return
1453
- }
1454
-
1455
- let response
1456
- if (this._enableProductScanning && !this._selectedInventory.checked) {
1457
- response = await client.mutate({
1458
- mutation: gql`
1459
- mutation undoProductScanUnload($worksheetDetailName: String!, $palletId: String, $cartonId: String) {
1460
- undoProductScanUnload(worksheetDetailName: $worksheetDetailName, palletId: $palletId, cartonId: $cartonId)
1461
- }
1462
- `,
1463
- variables: {
1464
- worksheetDetailName: this._selectedOrderProduct.name,
1465
- palletId: this._enableCartonLabel ? null : this.palletInput.value.trim(),
1466
- cartonId: this._enableCartonLabel ? this.cartonInput.value.trim() : null
1467
- }
1468
- })
1469
- } else {
1470
- response = await client.mutate({
1471
- mutation: gql`
1472
- mutation undoUnloading($worksheetDetailName: String!, $palletId: String!) {
1473
- undoUnloading(worksheetDetailName: $worksheetDetailName, palletId: $palletId)
1474
- }
1475
- `,
1476
- variables: {
1477
- worksheetDetailName: this._selectedOrderProduct.name,
1478
- palletId: this._selectedInventory.palletId
1479
- }
1480
- })
1481
- }
1482
-
1483
- if (!response.errors) {
1484
- if (this._enableCartonLabel) {
1485
- this.cartonInput.value = ''
1486
- this._isQtyChecked = false
1487
- if (this._enableInputQty) this._selectedInventory = null
1488
- if (this.expDateInput?.value) this.expDateInput.value = ''
1489
- } else {
1490
- this._selectedInventory = null
1491
- }
1492
- await this._fetchProducts(this._orderNo)
1493
- }
1494
- } catch (e) {
1495
- this._showToast(e)
1496
- }
1497
- }
1498
-
1499
- _validateSelectedInventory() {
1500
- if (!this._selectedInventory) throw new Error(i18next.t('text.target_does_not_selected'))
1501
- if (!this._selectedOrderProduct) {
1502
- this._selectedOrderProduct = this.orderProductData.records.find(
1503
- record =>
1504
- record.batchId == this._selectedInventory.batchId &&
1505
- record.sku == this._selectedInventory.sku &&
1506
- record.packingType == this._selectedInventory.packingType &&
1507
- record.packingSize == this._selectedInventory.packingSize
1508
- )
1509
- }
1510
- if (!this._selectedOrderProduct) throw new Error(i18next.t('text.select_one_of_unloading_list_first'))
1511
- }
1512
-
1513
1162
  async _completeQC() {
1514
1163
  try {
1515
1164
  this._validateSelectedInventory()
@@ -1522,7 +1171,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1522
1171
  variables: {
1523
1172
  worksheetDetailName: this._selectedOrderProduct.name,
1524
1173
  inventory: {
1525
- palletId: this._enableCartonLabel ? null : this.palletInput.value.trim(),
1174
+ palletId: this._enableCartonLabel ? null : this.lotInput.value.trim(),
1526
1175
  cartonId: this._enableCartonLabel ? this.cartonInput.value.trim() : null,
1527
1176
  expirationDate: this.expDateInput?.value ? this.expDateInput.value : null
1528
1177
  }
@@ -1551,9 +1200,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1551
1200
  cancelButton: { text: i18next.t('button.cancel') }
1552
1201
  })
1553
1202
 
1554
- if (!result.value) {
1555
- return
1556
- }
1203
+ if (!result.value) return
1557
1204
 
1558
1205
  if (this.refOrderType === AVAIL_ORDER_TYPES.ARRIVAL_NOTICE.value) {
1559
1206
  const response = await client.mutate({
@@ -1566,34 +1213,6 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1566
1213
  })
1567
1214
 
1568
1215
  if (!response.errors) {
1569
- // const havingVas = await this.checkHavingVas(this._arrivalNoticeNo)
1570
- // if (havingVas) {
1571
- // const result = await CustomAlert({
1572
- // title: i18next.t('title.completed'),
1573
- // text: i18next.t('text.unloading_completed'),
1574
- // confirmButton: { text: i18next.t('button.move_to_x', { state: { x: i18next.t('title.vas') } }) },
1575
- // cancelButton: { text: i18next.t('button.cancel') }
1576
- // })
1577
-
1578
- // if (!result.value) {
1579
- // this._arrivalNoticeNo = null
1580
- // this._clearView()
1581
- // return
1582
- // }
1583
-
1584
- // let searchParam = new URLSearchParams()
1585
- // searchParam.append('orderNo', this._arrivalNoticeNo)
1586
- // searchParam.append('orderType', ARRIVAL_NOTICE.value)
1587
-
1588
- // navigate(`execute_vas?${searchParam.toString()}`)
1589
- // } else {
1590
- // await CustomAlert({
1591
- // title: i18next.t('title.completed'),
1592
- // text: i18next.t('text.unloading_completed'),
1593
- // confirmButton: { text: i18next.t('button.confirm') }
1594
- // })
1595
- // }
1596
-
1597
1216
  await CustomAlert({
1598
1217
  title: i18next.t('title.completed'),
1599
1218
  text: i18next.t('text.unloading_completed'),
@@ -1614,34 +1233,6 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1614
1233
  })
1615
1234
 
1616
1235
  if (!response.errors) {
1617
- // const havingVas = await this.checkHavingVas(this._arrivalNoticeNo)
1618
- // if (havingVas) {
1619
- // const result = await CustomAlert({
1620
- // title: i18next.t('title.completed'),
1621
- // text: i18next.t('text.unloading_completed'),
1622
- // confirmButton: { text: i18next.t('button.move_to_x', { state: { x: i18next.t('title.vas') } }) },
1623
- // cancelButton: { text: i18next.t('button.cancel') }
1624
- // })
1625
-
1626
- // if (!result.value) {
1627
- // this._arrivalNoticeNo = null
1628
- // this._clearView()
1629
- // return
1630
- // }
1631
-
1632
- // let searchParam = new URLSearchParams()
1633
- // searchParam.append('orderNo', this._arrivalNoticeNo)
1634
- // searchParam.append('orderType', ARRIVAL_NOTICE.value)
1635
-
1636
- // navigate(`execute_vas?${searchParam.toString()}`)
1637
- // } else {
1638
- // await CustomAlert({
1639
- // title: i18next.t('title.completed'),
1640
- // text: i18next.t('text.unloading_completed'),
1641
- // confirmButton: { text: i18next.t('button.confirm') }
1642
- // })
1643
- // }
1644
-
1645
1236
  await CustomAlert({
1646
1237
  title: i18next.t('title.completed'),
1647
1238
  text: i18next.t('text.unloading_completed'),
@@ -1657,29 +1248,10 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1657
1248
  }
1658
1249
  }
1659
1250
 
1660
- // async checkHavingVas(orderNo) {
1661
- // const response = await client.query({
1662
- // query: gql`
1663
- // query {
1664
- // havingVas(${gqlBuilder.buildArgs({
1665
- // orderType: ARRIVAL_NOTICE.value,
1666
- // orderNo
1667
- // })}) {
1668
- // id
1669
- // }
1670
- // }
1671
- // `
1672
- // })
1673
-
1674
- // if (!response.errors) {
1675
- // return Boolean(response.data.havingVas.id)
1676
- // }
1677
- // }
1678
-
1679
1251
  async _checkReusablePallet() {
1680
1252
  try {
1681
1253
  if (!this._selectedOrderProduct) throw new Error(i18next.t('text.target_is_not_selected'))
1682
- if (!this.palletInput.value) return
1254
+ if (!this.lotInput.value) return
1683
1255
 
1684
1256
  const response = await client.query({
1685
1257
  query: gql`
@@ -1690,14 +1262,13 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1690
1262
  }
1691
1263
  }
1692
1264
  `,
1693
- variables: { name: this.palletInput.value, status: PALLET_STATUS.ACTIVE.value }
1265
+ variables: { name: this.lotInput.value, status: PALLET_STATUS.ACTIVE.value }
1694
1266
  })
1695
1267
 
1696
1268
  if (!response.errors) {
1697
1269
  if (response.data.palletByStatus) {
1698
1270
  this.reusablePalletIdData = response.data.palletByStatus
1699
1271
  this._isReusablePallet = true
1700
- this._openPopupUnloading(this.palletInput.value, this.orderProductData, this.palletProductData)
1701
1272
  } else {
1702
1273
  await this._validateUnloading()
1703
1274
  await this._checkedLotScannedProduct()
@@ -1709,6 +1280,43 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1709
1280
  }
1710
1281
  }
1711
1282
 
1283
+ _openUndoUnloadPopup() {
1284
+ openPopup(
1285
+ html`
1286
+ <undo-unload-popup
1287
+ .enableCartonLabel="${this._enableCartonLabel}"
1288
+ .enableProductScanning="${this._enableProductScanning}"
1289
+ .orderType="${this.refOrderType}"
1290
+ .orderNo="${this._orderNo}"
1291
+ .unloadedInventories="${this._unloadedInventories}"
1292
+ @undo-inventory="${async e => {
1293
+ history.back()
1294
+ await this._fetchProducts(this._orderNo)
1295
+ this._showToast({ message: i18next.t('text.inventory_undo_successfully') })
1296
+ }}"
1297
+ ></undo-unload-popup>
1298
+ `,
1299
+ {
1300
+ backdrop: true,
1301
+ size: 'large',
1302
+ title: i18next.t('title.undo_unload')
1303
+ }
1304
+ )
1305
+ }
1306
+
1307
+ _openWorksheetInformation() {
1308
+ openPopup(
1309
+ html`
1310
+ <worksheet-information-popup .worksheetInformation="${this._worksheetInfo}"></worksheet-information-popup>
1311
+ `,
1312
+ {
1313
+ backdrop: true,
1314
+ size: 'large',
1315
+ title: i18next.t('title.order_information')
1316
+ }
1317
+ )
1318
+ }
1319
+
1712
1320
  _validateComplete() {
1713
1321
  if (this.refOrderType === AVAIL_ORDER_TYPES.ARRIVAL_NOTICE.value) {
1714
1322
  if (!this._orderNo) {
@@ -1737,7 +1345,7 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1737
1345
  })
1738
1346
  }
1739
1347
 
1740
- _openPalletizingPallets() {
1348
+ _openVasPopup() {
1741
1349
  openPopup(
1742
1350
  html`
1743
1351
  <palletizing-pallet-popup
@@ -1756,30 +1364,12 @@ class UnloadProduct extends connect(store)(localize(i18next)(PageView)) {
1756
1364
  )
1757
1365
  }
1758
1366
 
1759
- _openUpdateExpiryDate() {
1760
- openPopup(
1761
- html`
1762
- <expiry-date-popup
1763
- .inventory="${this._selectedInventory}"
1764
- @updated-expiry-date="${async e => {
1765
- await this._fetchInventories()
1766
- }}"
1767
- ></expiry-date-popup>
1768
- `,
1769
- {
1770
- backdrop: true,
1771
- size: 'small',
1772
- title: i18next.t('title.expiration_date')
1773
- }
1774
- )
1775
- }
1776
-
1777
1367
  _focusOnOrderNoField() {
1778
1368
  setTimeout(() => this.orderNoInput.focus(), 100)
1779
1369
  }
1780
1370
 
1781
- _focusOnPalletInput() {
1782
- setTimeout(() => this.palletInput.focus(), 100)
1371
+ _focusOnLotInput() {
1372
+ setTimeout(() => this.lotInput.focus(), 100)
1783
1373
  }
1784
1374
 
1785
1375
  _focusOnCartonInput() {