@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
@@ -1,13 +1,14 @@
1
1
  import '@things-factory/barcode-ui'
2
2
  import '@things-factory/grist-ui'
3
3
  import './logistics-init/logistics-init-popup'
4
+ import '../components/worksheet-information-popup'
4
5
 
5
6
  import gql from 'graphql-tag'
6
7
  import { css, html } from 'lit-element'
7
8
  import { connect } from 'pwa-helpers/connect-mixin.js'
8
9
 
9
10
  import { GhostPrint } from '@operato/ghost-print'
10
- import { MultiColumnFormStyles, SingleColumnFormStyles } from '@things-factory/form-ui'
11
+ import { MultiColumnFormStyles } from '@things-factory/form-ui'
11
12
  import { i18next, localize } from '@things-factory/i18n-base'
12
13
  import { openPopup } from '@things-factory/layout-base'
13
14
  import { client, CustomAlert, PageView, store } from '@things-factory/shell'
@@ -20,110 +21,60 @@ import { PLATFORM, WORKSHEET_STATUS } from '../constants'
20
21
  class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
21
22
  static get properties() {
22
23
  return {
23
- releaseGoodNo: String,
24
- orderInformation: String,
25
- trackingNo: String,
26
- shippingProvider: String,
27
- platform: String,
28
24
  airwayBill: String,
29
- invoice: String,
30
25
  config: Object,
31
26
  data: Object,
27
+ invoice: String,
28
+ orderInformation: String,
29
+ platform: String,
30
+ releaseGoodNo: String,
31
+ shippingProvider: String,
32
+ trackingNo: String,
33
+ _bizplaceName: String,
34
+ _enableProductScanning: Boolean,
32
35
  _productName: String,
36
+ _logisticsInitiated: Boolean,
33
37
  _selectedTaskStatus: String,
34
- _enableProductScanning: Boolean,
35
- _logisticsInitiated: Boolean
38
+ _worksheetInfo: Object
36
39
  }
37
40
  }
38
41
 
39
42
  static get styles() {
40
43
  return [
41
- SingleColumnFormStyles,
42
44
  MultiColumnFormStyles,
43
45
  css`
44
46
  :host {
45
47
  display: flex;
46
48
  flex-direction: column;
47
- }
48
-
49
- .grist {
50
- background-color: var(--main-section-background-color);
51
- display: flex;
52
- flex: 1;
53
- overflow: auto;
54
- }
55
-
56
- .left-column {
57
- flex: 1;
58
49
  overflow: hidden;
59
- display: flex;
60
- flex-direction: column;
61
- }
62
-
63
- .right-column {
64
- flex: 1;
65
- overflow: auto;
66
- display: flex;
67
- flex-direction: column;
68
50
  }
69
-
70
51
  data-grist {
52
+ overflow: auto;
71
53
  flex: 1;
72
54
  }
73
-
74
55
  h2 {
75
56
  padding: var(--subtitle-padding);
76
57
  font: var(--subtitle-font);
77
58
  color: var(--subtitle-text-color);
78
59
  border-bottom: var(--subtitle-border-bottom);
79
60
  }
80
- .grist h2 {
81
- margin: var(--grist-title-margin);
82
- border: var(--grist-title-border);
83
- font: var(--grist-title-font);
84
- color: var(--secondary-color);
85
- }
86
-
87
- .grist h2 mwc-icon {
61
+ legend mwc-icon {
88
62
  vertical-align: middle;
89
63
  margin: var(--grist-title-icon-margin);
90
64
  font-size: var(--grist-title-icon-size);
91
65
  color: var(--grist-title-icon-color);
92
- }
93
-
94
- h2 + data-grist {
95
- padding-top: var(--grist-title-with-grid-padding);
96
- }
97
-
98
- div.reusable_pallet {
99
- grid-column: span 12 / auto;
100
- display: inline-flex;
101
- align-items: center;
102
- font-size: 12px;
103
- background-color: #ccc0;
104
- border: 1px solid #6e7e8e;
105
- color: #394e63;
106
- }
107
-
108
- @media (max-width: 460px) {
109
- :host {
110
- display: block;
111
- }
66
+ cursor: pointer;
112
67
  }
113
68
  `
114
69
  ]
115
70
  }
116
71
 
72
+ get completed() {
73
+ return this.data.records.every(record => record.completed)
74
+ }
75
+
117
76
  get context() {
118
77
  var actions = []
119
- if (this.completed) {
120
- actions.push({
121
- title: i18next.t('button.complete'),
122
- action: this._complete.bind(this),
123
- ...CommonButtonStyles.submit
124
- })
125
- }
126
-
127
78
  if (this.releaseGoodNo && this.platform != 'operato' && this.completed && this.trackingNo) {
128
79
  if (this.platform === PLATFORM.LAZADA.value) {
129
80
  actions.push({
@@ -140,13 +91,7 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
140
91
  })
141
92
  }
142
93
 
143
- if (this.releaseGoodNo && this.platform == 'operato' && !this.airwayBill && this.completed) {
144
- actions.push({
145
- title: i18next.t('button.fetch_airway_bill'),
146
- action: this.fetchSellercraftAirwayBill.bind(this),
147
- ...CommonButtonStyles.label
148
- })
149
- } else if (this.releaseGoodNo && this.platform == 'operato' && this.airwayBill && this.completed) {
94
+ if (this.releaseGoodNo && this.platform == 'operato' && this.airwayBill && this.completed) {
150
95
  actions.push({
151
96
  title: i18next.t('button.print_airway_bill'),
152
97
  action: this.printSellercraftAirwayBill.bind(this),
@@ -183,6 +128,14 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
183
128
  })
184
129
  }
185
130
 
131
+ if (this.completed) {
132
+ actions.push({
133
+ title: i18next.t('button.complete'),
134
+ action: this._complete.bind(this),
135
+ ...CommonButtonStyles.submit
136
+ })
137
+ }
138
+
186
139
  return {
187
140
  title: i18next.t('title.packing'),
188
141
  help: 'operato-wms/outbound/packing-product',
@@ -190,14 +143,8 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
190
143
  }
191
144
  }
192
145
 
193
- get releaseGoodNoInput() {
194
- return this.shadowRoot.querySelector('barcode-scanable-input[name=releaseGoodNo]').shadowRoot.querySelector('input')
195
- }
196
-
197
- get productBarcodeInput() {
198
- return this.shadowRoot
199
- .querySelector('barcode-scanable-input[name=productBarcode]')
200
- .shadowRoot.querySelector('input')
146
+ get grist() {
147
+ return this.shadowRoot.querySelector('data-grist')
201
148
  }
202
149
 
203
150
  get infoForm() {
@@ -208,34 +155,36 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
208
155
  return this.shadowRoot.querySelector('form#input-form')
209
156
  }
210
157
 
211
- get releaseQtyInput() {
212
- return this.shadowRoot.querySelector('input[name=packedQty]')
213
- }
214
-
215
158
  get locationInput() {
216
159
  return this.shadowRoot.querySelector('barcode-scanable-input[name=locationName]').shadowRoot.querySelector('input')
217
160
  }
218
161
 
219
- get grist() {
220
- return this.shadowRoot.querySelector('data-grist')
162
+ get productBarcodeInput() {
163
+ return this.shadowRoot
164
+ .querySelector('barcode-scanable-input[name=productBarcode]')
165
+ .shadowRoot.querySelector('input')
221
166
  }
222
167
 
223
- get scannable() {
224
- return this._selectedTaskStatus && this._selectedTaskStatus === WORKSHEET_STATUS.EXECUTING.value
168
+ get releaseGoodNoInput() {
169
+ return this.shadowRoot.querySelector('barcode-scanable-input[name=releaseGoodNo]').shadowRoot.querySelector('input')
225
170
  }
226
171
 
227
- get completed() {
228
- return this.data.records.every(record => record.completed)
172
+ get releaseQtyInput() {
173
+ return this.shadowRoot.querySelector('input[name=packedQty]')
229
174
  }
230
175
 
231
- _focusOnReleaseGoodInput() {
232
- setTimeout(() => this.releaseGoodNoInput.focus(), 100)
176
+ get scannable() {
177
+ return this._selectedTaskStatus && this._selectedTaskStatus === WORKSHEET_STATUS.EXECUTING.value
233
178
  }
234
179
 
235
180
  _focusOnProductBarcodeInput() {
236
181
  setTimeout(() => this.productBarcodeInput.focus(), 100)
237
182
  }
238
183
 
184
+ _focusOnReleaseGoodInput() {
185
+ setTimeout(() => this.releaseGoodNoInput.focus(), 100)
186
+ }
187
+
239
188
  _focusOnReleaseQtyInput() {
240
189
  setTimeout(() => this.releaseQtyInput.focus(), 100)
241
190
  }
@@ -244,8 +193,6 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
244
193
  return html`
245
194
  <form id="info-form" class="multi-column-form">
246
195
  <fieldset>
247
- <legend>${i18next.t('title.scan_area')}</legend>
248
-
249
196
  <label>${i18next.t('label.release_good_no')}</label>
250
197
  <barcode-scanable-input
251
198
  name="releaseGoodNo"
@@ -255,95 +202,54 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
255
202
  e.preventDefault()
256
203
  if (this.releaseGoodNoInput.value) {
257
204
  this._fetchInventories(this.releaseGoodNoInput.value)
205
+ this.releaseGoodNoInput.value = ''
258
206
  }
259
207
  }
260
208
  }}"
261
209
  ></barcode-scanable-input>
262
210
  </fieldset>
263
-
264
- <fieldset>
265
- <legend>${i18next.t('title.release_order')}: ${this.releaseGoodNo}</legend>
266
- <label>${i18next.t('label.company')}</label>
267
- <input name="bizplaceName" readonly />
268
-
269
- <label>${i18next.t('label.shipping_provider')}</label>
270
- <input name="shippingProvider" readonly />
271
-
272
- <label>${i18next.t('label.tracking_no')}</label>
273
- <input name="trackingNo" readonly />
274
-
275
- <label>${i18next.t('label.status')}</label>
276
- <input name="marketplaceStatus" readonly />
277
-
278
- <label>${i18next.t('label.started_at')}</label>
279
- <input name="startedAt" type="datetime-local" readonly />
280
-
281
- <label>${i18next.t('label.ref_no')}</label>
282
- <input name="refNo" readonly />
283
-
284
- <label>${i18next.t('label.ref_no_2')}</label>
285
- <input name="refNo2" readonly />
286
- </fieldset>
287
211
  </form>
288
212
 
289
- <div class="grist">
290
- <div class="left-column">
291
- <h2><mwc-icon>list_alt</mwc-icon>${i18next.t('title.packing_list')}</h2>
292
- <data-grist
293
- .mode=${isMobileDevice() ? 'LIST' : 'GRID'}
294
- .config=${this.config}
295
- .data=${this.data}
296
- ></data-grist>
297
- </div>
213
+ <form id="input-form" class="multi-column-form" @keypress="${this.packing.bind(this)}">
214
+ ${this.scannable
215
+ ? html`
216
+ <fieldset>
217
+ ${this._enableProductScanning
218
+ ? html` <label>${i18next.t('label.product_barcode')}</label>
219
+ <barcode-scanable-input name="productBarcode" custom-input></barcode-scanable-input>`
220
+ : html`
221
+ <label>${i18next.t('label.packed_qty')}</label>
222
+ <input type="number" min="1" name="packedQty" />
223
+ `}
224
+ </fieldset>
225
+ `
226
+ : ''}
227
+ </form>
298
228
 
299
- <div class="right-column">
300
- <form id="input-form" class="single-column-form" @keypress="${this.packing.bind(this)}">
229
+ <data-grist .mode=${isMobileDevice() ? 'LIST' : 'GRID'} .config=${this.config} .data=${this.data}>
230
+ <div slot="headroom" id="form-section">
231
+ <form id="info-form" class="multi-column-form">
301
232
  <fieldset>
302
- <legend>${i18next.t('label.product')}: ${this._productName}</legend>
303
-
304
- <label>${i18next.t('label.sku')}</label>
305
- <input name="sku" readonly />
306
-
307
- <label>${i18next.t('label.batch_no')}</label>
308
- <input name="batchId" readonly />
309
-
310
- <label>${i18next.t('label.packing_type')}</label>
311
- <input name="packingTypeSize" readonly />
312
-
313
- <label>${i18next.t('label.current_location')}</label>
314
- <input name="binLocation" readonly />
315
-
316
- <label>${i18next.t('label.packing_progress')}</label>
317
- <input name="packingProgress" readonly />
233
+ <legend>
234
+ ${i18next.t('title.order_no')}: ${this.releaseGoodNo}
235
+ ${this.releaseGoodNo
236
+ ? html`(${this._bizplaceName})
237
+ <mwc-icon @click="${this._openWorksheetInformation.bind(this)}">info</mwc-icon>`
238
+ : ''}
239
+ </legend>
318
240
  </fieldset>
319
-
320
- ${this.scannable
321
- ? html`
322
- <fieldset>
323
- <legend>${i18next.t('title.input_section')}</legend>
324
-
325
- ${this._enableProductScanning
326
- ? html` <label>${i18next.t('label.product_barcode')}</label>
327
- <barcode-scanable-input name="productBarcode" custom-input></barcode-scanable-input>`
328
- : html`
329
- <label>${i18next.t('label.packed_qty')}</label>
330
- <input type="number" min="1" name="packedQty" />
331
- `}
332
- </fieldset>
333
- `
334
- : ''}
335
241
  </form>
336
242
  </div>
337
- </div>
243
+ </data-grist>
338
244
  `
339
245
  }
340
246
 
341
247
  constructor() {
342
248
  super()
343
249
  this.data = { records: [] }
344
- this._productName = ''
345
250
  this.releaseGoodNo = ''
346
251
  this._enableProductScanning = false
252
+ this._productName = ''
347
253
  this._selectedOrderInventory = null
348
254
  this._selectedTaskStatus = null
349
255
  }
@@ -354,7 +260,7 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
354
260
  }
355
261
  }
356
262
 
357
- async pageInitialized() {
263
+ pageInitialized() {
358
264
  this.config = {
359
265
  rows: {
360
266
  appendable: false,
@@ -363,11 +269,7 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
363
269
  if (data.records.length && record) {
364
270
  this._selectedOrderInventory = record
365
271
  this._selectedTaskStatus = record.status
366
- this._productName = record.product?.name
367
- ? `${record.product.name} ${record.product?.description ? `(${record.product.description})` : ''}`
368
- : ''
369
272
 
370
- this._fillUpForm(this.inputForm, record)
371
273
  if (this.scannable) {
372
274
  if (this._enableProductScanning) this._focusOnProductBarcodeInput()
373
275
  else this._focusOnReleaseQtyInput()
@@ -377,7 +279,7 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
377
279
  }
378
280
  },
379
281
  pagination: { infinite: true },
380
- list: { fields: ['completed', 'locationName', 'sku', 'product', 'batchId', 'expirationDate', 'releaseQty'] },
282
+ list: { fields: ['completed', 'locationName', 'sku', 'product', 'batchId', 'expirationDate', 'packingProgress'] },
381
283
  columns: [
382
284
  { type: 'gutter', gutterName: 'sequence' },
383
285
  {
@@ -390,36 +292,42 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
390
292
  type: 'string',
391
293
  name: 'locationName',
392
294
  header: i18next.t('field.location'),
295
+ label: true,
393
296
  width: 120
394
297
  },
395
298
  {
396
299
  type: 'string',
397
300
  name: 'sku',
398
301
  header: i18next.t('field.sku'),
302
+ label: true,
399
303
  width: 140
400
304
  },
401
305
  {
402
306
  type: 'object',
403
307
  name: 'product',
404
308
  header: i18next.t('field.product'),
405
- width: 140
309
+ label: true,
310
+ width: 200
406
311
  },
407
312
  {
408
- type: 'integer',
409
- name: 'releaseQty',
313
+ type: 'string',
314
+ name: 'packingProgress',
410
315
  header: i18next.t('field.release_qty'),
316
+ label: true,
411
317
  width: 80
412
318
  },
413
319
  {
414
320
  type: 'string',
415
321
  name: 'batchId',
416
322
  header: i18next.t('field.batch_id'),
323
+ label: true,
417
324
  width: 140
418
325
  },
419
326
  {
420
327
  type: 'date',
421
328
  name: 'expirationDate',
422
329
  header: i18next.t('field.exp_date'),
330
+ label: true,
423
331
  width: 120
424
332
  }
425
333
  ]
@@ -446,6 +354,7 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
446
354
  partnerDomainId
447
355
  refNo
448
356
  refNo2
357
+ refNo3
449
358
  airwayBill
450
359
  invoice
451
360
  startedAt
@@ -514,7 +423,9 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
514
423
  this.shippingProvider = worksheetInfo.shippingProvider
515
424
  this.orderInformation = worksheetInfo.marketplaceOrder
516
425
 
517
- this._fillUpForm(this.infoForm, { ...worksheetInfo })
426
+ this._bizplaceName = worksheetInfo.bizplaceName
427
+ this._worksheetInfo = worksheetInfo
428
+
518
429
  this.data = { records: this.formatWorksheetDetailInfos(worksheetDetailInfos) }
519
430
  if (this._selectedOrderInventory) {
520
431
  const record = this.data.records.find(record => record.name === this._selectedOrderInventory.name)
@@ -522,8 +433,6 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
522
433
  this._selectedOrderInventory = null
523
434
  this._selectedTaskStatus = null
524
435
  this.inputForm.reset()
525
- } else {
526
- this._fillUpForm(this.inputForm, record)
527
436
  }
528
437
  }
529
438
 
@@ -540,7 +449,6 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
540
449
  record.locationName = record?.binLocation?.name
541
450
  record.sku = record?.sku
542
451
  record.product = record?.product
543
- record.packingTypeSize = `${record.packingType}(${record.packingSize})`
544
452
  record.packingProgress = `${record.packedQty} / ${record.releaseQty}`
545
453
 
546
454
  return record
@@ -552,34 +460,11 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
552
460
  this.data = { records: [] }
553
461
  this.infoForm.reset()
554
462
  this.inputForm.reset()
555
- this._productName = ''
556
463
  this.releaseGoodNo = ''
557
464
  this._selectedOrderInventory = null
558
465
  this._selectedTaskStatus = null
559
466
  }
560
467
 
561
- _fillUpForm(form, data) {
562
- form.reset()
563
- for (let key in data) {
564
- Array.from(form.querySelectorAll('input')).forEach(field => {
565
- if (field.name === key && field.type === 'checkbox') {
566
- field.checked = data[key]
567
- } else if (field.name === key && field.type === 'datetime-local') {
568
- const datetime = Number(data[key])
569
- const timezoneOffset = new Date(datetime).getTimezoneOffset() * 60000
570
- field.value = new Date(datetime - timezoneOffset).toISOString().slice(0, -1)
571
- } else if (field.name === key) {
572
- if (data[key] instanceof Object) {
573
- const objectData = data[key]
574
- field.value = `${objectData.name} ${objectData.description ? `(${objectData.description})` : ''}`
575
- } else {
576
- field.value = data[key]
577
- }
578
- }
579
- })
580
- }
581
- }
582
-
583
468
  checkShippingProviderAndDeliveryType() {
584
469
  if (this.orderInformation.otherInfoJSON == null) {
585
470
  return false
@@ -656,30 +541,6 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
656
541
  }
657
542
  }
658
543
 
659
- async fetchSellercraftAirwayBill() {
660
- const response = await client.query({
661
- query: gql`
662
- query fetchSellercraftAirwayBill($releaseOrderNo: String!) {
663
- fetchSellercraftAirwayBill(releaseOrderNo: $releaseOrderNo) {
664
- airwayBill
665
- }
666
- }
667
- `,
668
- variables: { releaseOrderNo }
669
- })
670
-
671
- if (!response.errors) {
672
- this.airwayBill = response.data.fetchAirwayBill.airwayBill
673
-
674
- if (airwayBill) {
675
- this.updateContext()
676
- this._callPrintDialog(this.airwayBill)
677
- } else {
678
- this._showToast({ message: i18next.t('text.pending_airwaybill_from_ecommerce_platform') })
679
- }
680
- }
681
- }
682
-
683
544
  async getOrderDocument(orderNo, docType) {
684
545
  try {
685
546
  const response = await client.query({
@@ -731,6 +592,7 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
731
592
 
732
593
  async packing(e) {
733
594
  if (e.keyCode === 13) {
595
+ e.preventDefault()
734
596
  try {
735
597
  this._validatePacking()
736
598
 
@@ -741,8 +603,10 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
741
603
  if (!response.errors) {
742
604
  if (this._enableProductScanning) {
743
605
  this.productBarcodeInput.value = ''
606
+ this._focusOnProductBarcodeInput()
744
607
  } else {
745
608
  this.releaseQtyInput.value = ''
609
+ this._focusOnReleaseQtyInput()
746
610
  this._selectedTaskStatus = null
747
611
  this._selectedOrderInventory = null
748
612
  }
@@ -756,8 +620,8 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
756
620
  }
757
621
 
758
622
  async productBarcodePacking() {
759
- return await client.query({
760
- query: gql`
623
+ return await client.mutate({
624
+ mutation: gql`
761
625
  mutation scanProductPacking($worksheetDetailName: String!, $productBarcode: String!) {
762
626
  scanProductPacking(worksheetDetailName: $worksheetDetailName, productBarcode: $productBarcode)
763
627
  }
@@ -770,8 +634,8 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
770
634
  }
771
635
 
772
636
  async commonPacking() {
773
- return await client.query({
774
- query: gql`
637
+ return await client.mutate({
638
+ mutation: gql`
775
639
  mutation packing($worksheetDetailName: String!, $releaseQty: Int!) {
776
640
  packing(worksheetDetailName: $worksheetDetailName, releaseQty: $releaseQty)
777
641
  }
@@ -814,7 +678,6 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
814
678
  async _completeHandler() {
815
679
  if (!this.data?.records?.length || this.data.records.some(record => !record.completed)) return
816
680
 
817
- this.updateContext()
818
681
  const result = await CustomAlert({
819
682
  title: i18next.t('title.packing'),
820
683
  text: i18next.t('text.do_you_want_to_complete'),
@@ -822,16 +685,14 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
822
685
  cancelButton: { text: i18next.t('button.cancel') }
823
686
  })
824
687
 
825
- if (!result.value) {
826
- return
827
- }
688
+ if (!result.value) return
828
689
 
829
690
  this._complete()
830
691
  }
831
692
 
832
693
  async _complete() {
833
- const response = await client.query({
834
- query: gql`
694
+ const response = await client.mutate({
695
+ mutation: gql`
835
696
  mutation completePacking($releaseGoodNo: String!) {
836
697
  completePacking(releaseGoodNo: $releaseGoodNo)
837
698
  }
@@ -841,6 +702,7 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
841
702
 
842
703
  if (!response.errors) {
843
704
  this._clearView()
705
+ this.updateContext()
844
706
  await CustomAlert({
845
707
  title: i18next.t('title.packing'),
846
708
  text: i18next.t('text.packing_is_completed'),
@@ -872,6 +734,19 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
872
734
  }
873
735
  }
874
736
 
737
+ _openWorksheetInformation() {
738
+ openPopup(
739
+ html`
740
+ <worksheet-information-popup .worksheetInformation="${this._worksheetInfo}"></worksheet-information-popup>
741
+ `,
742
+ {
743
+ backdrop: true,
744
+ size: 'large',
745
+ title: i18next.t('title.order_information')
746
+ }
747
+ )
748
+ }
749
+
875
750
  async _setOrderToRTS() {
876
751
  let result = await CustomAlert({
877
752
  title: i18next.t('title.are_you_sure'),