@things-factory/operato-wms 4.0.21 → 4.0.25

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 (44) hide show
  1. package/client/bootstrap.js +13 -6
  2. package/client/pages/adjustment/transfer-inventory.js +32 -6
  3. package/client/pages/bulk-operation/bulk-operation.js +189 -64
  4. package/client/pages/bulk-operation/validate-gan-popup.js +391 -0
  5. package/client/pages/bulk-operation/validate-ro-popup.js +52 -22
  6. package/client/pages/components/popup-unloading.js +47 -34
  7. package/client/pages/components/select-product-popup.js +74 -27
  8. package/client/pages/components/worksheet-information-popup.js +100 -0
  9. package/client/pages/inbound/putaway-product.js +184 -231
  10. package/client/pages/inbound/undo-unload-popup.js +295 -0
  11. package/client/pages/inbound/unload-product.js +229 -567
  12. package/client/pages/inbound/unloaded-inventories-popup.js +129 -0
  13. package/client/pages/inbound/worksheet-unloading.js +15 -11
  14. package/client/pages/inventory/inventory-adjustment.js +9 -10
  15. package/client/pages/master/product/product-list.js +1 -1
  16. package/client/pages/order/arrival-notice/arrival-notice-detail.js +409 -21
  17. package/client/pages/order/arrival-notice/create-arrival-notice.js +89 -13
  18. package/client/pages/order/arrival-notice/duplicate-arrival-notice.js +90 -10
  19. package/client/pages/order/arrival-notice/edit-product-popup.js +2 -2
  20. package/client/pages/order/release-order/b2b/b2b-order-list.js +78 -2
  21. package/client/pages/order/release-order/b2b/b2b-order-requests.js +32 -16
  22. package/client/pages/order/release-order/b2c/b2c-order-requests.js +49 -5
  23. package/client/pages/order/release-order/batch-generate-single-picking-worksheet-popup.js +314 -0
  24. package/client/pages/order/release-order/batch-picking-popup.js +19 -2
  25. package/client/pages/order/release-order/create-release-order.js +194 -89
  26. package/client/pages/order/release-order/release-order-detail.js +390 -107
  27. package/client/pages/order/return-order/create-return-order.js +3 -3
  28. package/client/pages/order/transport-order/create-delivery-order.js +1 -1
  29. package/client/pages/order/transport-order/delivery-order-list.js +1 -1
  30. package/client/pages/outbound/packing-product.js +111 -236
  31. package/client/pages/outbound/picking-product.js +287 -380
  32. package/client/pages/outbound/sorting-product.js +66 -63
  33. package/client/pages/outbound/worksheet-loading.js +7 -3
  34. package/client/pages/outbound/worksheet-packing.js +3 -3
  35. package/client/pages/outbound/worksheet-picking.js +22 -18
  36. package/client/pages/vas/print-product-label.js +17 -9
  37. package/dist-server/graphql/resolvers/reports/product-label-report.js +1 -0
  38. package/dist-server/graphql/resolvers/reports/product-label-report.js.map +1 -1
  39. package/package.json +65 -65
  40. package/server/graphql/resolvers/reports/product-label-report.ts +1 -0
  41. package/translations/en.json +31 -2
  42. package/translations/ko.json +32 -3
  43. package/translations/ms.json +32 -3
  44. package/translations/zh.json +32 -3
@@ -0,0 +1,295 @@
1
+ import '@things-factory/grist-ui'
2
+
3
+ import gql from 'graphql-tag'
4
+ import { css, html, LitElement } from 'lit-element'
5
+ import { connect } from 'pwa-helpers/connect-mixin'
6
+
7
+ import { SingleColumnFormStyles } from '@things-factory/form-ui'
8
+ import { i18next, localize } from '@things-factory/i18n-base'
9
+ import { client, store } from '@things-factory/shell'
10
+ import { isMobileDevice } from '@things-factory/utils'
11
+
12
+ class UndoUnloadPopup extends connect(store)(localize(i18next)(LitElement)) {
13
+ static get properties() {
14
+ return {
15
+ _autoSelectInventoryIds: Array,
16
+ _selectedInventoryIds: Array,
17
+ config: Object,
18
+ data: Object,
19
+ enableCartonLabel: Boolean,
20
+ enableProductScanning: Boolean,
21
+ orderType: String,
22
+ orderNo: String,
23
+ unloadedInventories: Array
24
+ }
25
+ }
26
+
27
+ constructor() {
28
+ super()
29
+ this._selectedInventoryIds = []
30
+ this._autoSelectInventoryIds = []
31
+ }
32
+
33
+ static get styles() {
34
+ return [
35
+ SingleColumnFormStyles,
36
+ css`
37
+ .button-container {
38
+ padding: var(--button-container-padding);
39
+ margin: var(--button-container-margin);
40
+ text-align: var(--button-container-align);
41
+ background-color: var(--button-container-background);
42
+ height: var(--button-container-height);
43
+ }
44
+ .button-container button {
45
+ background-color: var(--button-container-button-background-color);
46
+ border-radius: var(--button-container-button-border-radius);
47
+ height: var(--button-container-button-height);
48
+ border: var(--button-container-button-border);
49
+ margin: var(--button-container-button-margin);
50
+
51
+ padding: var(--button-padding);
52
+ color: var(--theme-white-color);
53
+ font: var(--button-font);
54
+ text-transform: var(--button-text-transform);
55
+ }
56
+ .button-container button:hover,
57
+ .button-container button:active {
58
+ background-color: var(--button-background-focus-color);
59
+ }
60
+ data-grist {
61
+ overflow-y: hidden;
62
+ flex: 1;
63
+ }
64
+ .grist {
65
+ display: flex;
66
+ flex-direction: column;
67
+ flex: 1;
68
+ overflow-y: auto;
69
+ }
70
+ :host {
71
+ padding: 10px;
72
+ display: flex;
73
+ flex-direction: column;
74
+ overflow: hidden;
75
+ background-color: white;
76
+ }
77
+ `
78
+ ]
79
+ }
80
+
81
+ get cartonInput() {
82
+ return this.shadowRoot.querySelector('barcode-scanable-input[name=cartonId]').shadowRoot.querySelector('input')
83
+ }
84
+
85
+ get dataGrist() {
86
+ return this.shadowRoot.querySelector('data-grist')
87
+ }
88
+
89
+ get inputForm() {
90
+ return this.shadowRoot.querySelector('form#input-form')
91
+ }
92
+
93
+ get lotInput() {
94
+ return this.shadowRoot.querySelector('barcode-scanable-input[name=lotId]').shadowRoot.querySelector('input')
95
+ }
96
+
97
+ render() {
98
+ return html`
99
+ <form id="input-form" class="single-column-form" @keypress="${this._populateTargetedInventory.bind(this)}">
100
+ <fieldset>
101
+ ${this.enableCartonLabel
102
+ ? html`<label>${i18next.t('label.carton_id')}</label>
103
+ <barcode-scanable-input name="cartonId" without-enter custom-input></barcode-scanable-input>`
104
+ : html`<label>${i18next.t('label.lot_id')}</label>
105
+ <barcode-scanable-input name="lotId" without-enter custom-input></barcode-scanable-input>`}
106
+ </fieldset>
107
+ </form>
108
+
109
+ <div class="grist">
110
+ <data-grist
111
+ id="grist"
112
+ .mode=${isMobileDevice() ? 'LIST' : 'GRID'}
113
+ .config=${this.config}
114
+ .data="${this.data}"
115
+ ></data-grist>
116
+ </div>
117
+
118
+ <div class="button-container">
119
+ <mwc-button raised @click="${this._undoUnloading.bind(this)}" label="${i18next.t('button.undo')}"></mwc-button>
120
+ </div>
121
+ `
122
+ }
123
+
124
+ firstUpdated() {
125
+ this.config = {
126
+ pagination: { infinite: true },
127
+ rows: { selectable: { multiple: true }, appendable: false },
128
+ list: { fields: ['palletId', 'cartonId', 'batchId', 'product', 'packingType', 'packingSize', 'qty', 'status'] },
129
+ columns: [
130
+ { type: 'gutter', gutterName: 'sequence' },
131
+ { type: 'gutter', gutterName: 'row-selector', multiple: true },
132
+ { name: 'id', hidden: true },
133
+ {
134
+ type: 'string',
135
+ name: 'palletId',
136
+ label: true,
137
+ header: i18next.t('field.lot_id'),
138
+ width: 150
139
+ },
140
+ {
141
+ type: 'string',
142
+ name: 'cartonId',
143
+ label: true,
144
+ header: i18next.t('field.carton_id'),
145
+ width: 150
146
+ },
147
+ {
148
+ type: 'string',
149
+ name: 'batchId',
150
+ label: true,
151
+ header: i18next.t('field.batch_id'),
152
+ width: 150
153
+ },
154
+ {
155
+ type: 'object',
156
+ name: 'product',
157
+ label: true,
158
+ header: i18next.t('field.product'),
159
+ width: 250
160
+ },
161
+ {
162
+ type: 'string',
163
+ name: 'packingType',
164
+ label: true,
165
+ header: i18next.t('field.packing_type'),
166
+ width: 120
167
+ },
168
+ {
169
+ type: 'integer',
170
+ name: 'packingSize',
171
+ label: true,
172
+ header: i18next.t('field.packing_size'),
173
+ width: 100
174
+ },
175
+ {
176
+ type: 'integer',
177
+ name: 'qty',
178
+ label: true,
179
+ header: i18next.t('field.qty'),
180
+ width: 100
181
+ },
182
+ {
183
+ type: 'string',
184
+ name: 'status',
185
+ label: true,
186
+ header: i18next.t('field.status'),
187
+ width: 120
188
+ }
189
+ ]
190
+ }
191
+
192
+ if (this.enableCartonLabel) {
193
+ this._focusOnCartonInput()
194
+ } else {
195
+ this._focusOnLotInput()
196
+ }
197
+ }
198
+
199
+ async _undoUnloading() {
200
+ try {
201
+ let selectedInventoryIds = []
202
+ if (this._autoSelectInventoryIds?.length) {
203
+ selectedInventoryIds = this._autoSelectInventoryIds
204
+ } else {
205
+ selectedInventoryIds = this.dataGrist.selected.map(inventory => inventory.id)
206
+ }
207
+ if (!selectedInventoryIds?.length) throw new Error(i18next.t('text.select_at_least_one_inventory_to_undo'))
208
+
209
+ this._validateScanInventory()
210
+
211
+ const response = await client.mutate({
212
+ mutation: gql`
213
+ mutation undoUnloading($orderType: String!, $orderNo: String!, $inventoryIds: [String]!) {
214
+ undoUnloading(orderType: $orderType, orderNo: $orderNo, inventoryIds: $inventoryIds)
215
+ }
216
+ `,
217
+ variables: { orderType: this.orderType, orderNo: this.orderNo, inventoryIds: selectedInventoryIds }
218
+ })
219
+
220
+ if (!response.errors) {
221
+ this.dispatchEvent(new CustomEvent('undo-inventory'))
222
+ }
223
+ } catch (e) {
224
+ this._showToast(e)
225
+ }
226
+ }
227
+
228
+ _populateTargetedInventory(e) {
229
+ if (e.keyCode === 13) {
230
+ e.preventDefault()
231
+
232
+ let targetedUndoInventories = []
233
+
234
+ if (this.enableCartonLabel) {
235
+ targetedUndoInventories = this.unloadedInventories.filter(
236
+ inventory => inventory.cartonId === this.cartonInput?.value
237
+ )
238
+ } else {
239
+ targetedUndoInventories = this.unloadedInventories.filter(
240
+ inventory => inventory.palletId === this.lotInput?.value
241
+ )
242
+ }
243
+
244
+ if (!targetedUndoInventories?.length) {
245
+ if (this.enableCartonLabel) {
246
+ this.cartonInput.value = ''
247
+ } else {
248
+ this.lotInput.value = ''
249
+ }
250
+ this._showToast({ message: i18next.t('text.no_matching_unloaded_inventory_found') })
251
+ } else if (targetedUndoInventories?.length == 1) {
252
+ this.data = { records: targetedUndoInventories }
253
+ this._autoSelectInventoryIds = targetedUndoInventories.map(inventory => inventory.id)
254
+ this._undoUnloading()
255
+ } else {
256
+ this.data = { records: targetedUndoInventories }
257
+ }
258
+ }
259
+ }
260
+
261
+ _focusOnLotInput() {
262
+ setTimeout(() => this.lotInput.focus(), 100)
263
+ }
264
+
265
+ _focusOnCartonInput() {
266
+ setTimeout(() => this.cartonInput.focus(), 100)
267
+ }
268
+
269
+ _validateScanInventory() {
270
+ if (this.enableCartonLabel) {
271
+ if (!this.cartonInput?.value) {
272
+ this._focusOnCartonInput()
273
+ throw new Error(i18next.t('text.carton_id_is_empty'))
274
+ }
275
+ } else {
276
+ if (!this.lotInput?.value) {
277
+ this._focusOnLotInput()
278
+ throw new Error(i18next.t('text.lot_id_is_empty'))
279
+ }
280
+ }
281
+ }
282
+
283
+ _showToast({ type, message }) {
284
+ document.dispatchEvent(
285
+ new CustomEvent('notify', {
286
+ detail: {
287
+ type,
288
+ message
289
+ }
290
+ })
291
+ )
292
+ }
293
+ }
294
+
295
+ window.customElements.define('undo-unload-popup', UndoUnloadPopup)