@things-factory/operato-wms 4.1.41 → 4.2.2
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.
- package/.eslintrc.json +11 -0
- package/client/pages/constants/index.js +1 -0
- package/client/pages/constants/inventory-item-change.js +10 -0
- package/client/pages/constants/order.js +5 -0
- package/client/pages/constants/picking-strategy.js +4 -0
- package/client/pages/constants/setting.js +1 -0
- package/client/pages/inbound/serial-number-list-popup.js +0 -1
- package/client/pages/inventory/inventory-adjustment-approval.js +34 -3
- package/client/pages/inventory/inventory-adjustment.js +144 -5
- package/client/pages/inventory/serial-number-list-popup.js +468 -0
- package/client/pages/master/pallet-list.js +24 -0
- package/client/pages/order/arrival-notice/edit-product-popup.js +13 -0
- package/client/pages/order/release-order/b2b/b2b-order-list.js +24 -1
- package/client/pages/order/release-order/batch-picking-popup.js +8 -0
- package/client/pages/order/release-order/release-extra-product-popup.js +15 -10
- package/client/pages/outbound/inventory-assign-popup.js +3 -24
- package/client/pages/outbound/inventory-auto-assign-popup.js +25 -50
- package/client/pages/outbound/loading-product.js +3 -3
- package/client/pages/outbound/merged-outbound-worksheet.js +83 -16
- package/client/pages/outbound/packing-product.js +109 -9
- package/client/pages/outbound/picking-product.js +21 -8
- package/client/pages/outbound/picking-replacement-popup.js +5 -0
- package/client/pages/outbound/return-pallet-check-popup.js +7 -1
- package/client/pages/outbound/route-label-popup.js +464 -0
- package/client/pages/outbound/serial-number-popup.js +55 -26
- package/client/pages/outbound/single-outbound-worksheet.js +83 -14
- package/client/pages/outbound/sorting-product.js +125 -34
- package/client/pages/outbound/worksheet-batch-picking.js +3 -15
- package/client/pages/outbound/worksheet-picking.js +2 -6
- package/cypress/fixtures/globals.json +3 -0
- package/cypress/fixtures/master-data/location.json +31 -0
- package/cypress/fixtures/master-data/pallet.json +129 -0
- package/cypress/fixtures/master-data/palletImport.xlsx +0 -0
- package/cypress/fixtures/master-data/transport-driver.json +22 -0
- package/cypress/fixtures/master-data/transport-vehicle.json +24 -0
- package/cypress/fixtures/master-data/transportDriverDeletedImport.xlsx +0 -0
- package/cypress/fixtures/master-data/transportDriverImport.xlsx +0 -0
- package/cypress/fixtures/master-data/transportVehicleDeletedImport.xlsx +0 -0
- package/cypress/fixtures/master-data/transportVehicleImport.xlsx +0 -0
- package/cypress/fixtures/master-data/transportVehicleNameSizeImport.xlsx +0 -0
- package/cypress/fixtures/master-data/transportVehicleNameStatusImport.xlsx +0 -0
- package/cypress/fixtures/master-data/warehouse.json +20 -0
- package/cypress/fixtures/master-data/warehouseImport.xlsx +0 -0
- package/cypress/integration/master-data/location.spec.js +31 -0
- package/cypress/integration/master-data/pallet.spec.js +176 -0
- package/cypress/integration/master-data/transport-driver.spec.js +131 -0
- package/cypress/integration/master-data/transport-vehicle.spec.js +165 -0
- package/cypress/integration/master-data/warehouse.spec.js +135 -0
- package/cypress/plugins/index.js +22 -0
- package/cypress/support/commands.js +425 -0
- package/cypress/support/index.js +31 -0
- package/cypress.json +9 -0
- package/dist-server/graphql/resolvers/board-setting/board-settings.js +2 -1
- package/dist-server/graphql/resolvers/board-setting/board-settings.js.map +1 -1
- package/dist-server/opa-app-setting-constants.js +2 -1
- package/dist-server/opa-app-setting-constants.js.map +1 -1
- package/package.json +20 -10
- package/server/graphql/resolvers/board-setting/board-settings.ts +4 -2
- package/server/opa-app-setting-constants.ts +2 -1
- package/translations/en.json +15 -5
- package/translations/ko.json +13 -2
- package/translations/ms.json +12 -2
- package/translations/zh.json +12 -2
|
@@ -0,0 +1,468 @@
|
|
|
1
|
+
import '@things-factory/barcode-ui'
|
|
2
|
+
import '@things-factory/grist-ui'
|
|
3
|
+
|
|
4
|
+
import gql from 'graphql-tag'
|
|
5
|
+
import { css, html, LitElement } from 'lit-element'
|
|
6
|
+
|
|
7
|
+
import { MultiColumnFormStyles, SingleColumnFormStyles } from '@things-factory/form-ui'
|
|
8
|
+
import { i18next, localize } from '@things-factory/i18n-base'
|
|
9
|
+
import { client } from '@things-factory/shell'
|
|
10
|
+
import { isMobileDevice } from '@things-factory/utils'
|
|
11
|
+
|
|
12
|
+
import { INVENTORY_ITEM_CHANGE_TRANSACTION_TYPE, INVENTORY_ITEM_CHANGE_TYPE } from '../constants'
|
|
13
|
+
|
|
14
|
+
class SerialNumberListPopup extends localize(i18next)(LitElement) {
|
|
15
|
+
static get styles() {
|
|
16
|
+
return [
|
|
17
|
+
MultiColumnFormStyles,
|
|
18
|
+
SingleColumnFormStyles,
|
|
19
|
+
css`
|
|
20
|
+
:host {
|
|
21
|
+
padding: 10px;
|
|
22
|
+
display: flex;
|
|
23
|
+
flex-direction: column;
|
|
24
|
+
overflow-x: overlay;
|
|
25
|
+
background-color: var(--main-section-background-color);
|
|
26
|
+
}
|
|
27
|
+
.grist {
|
|
28
|
+
background-color: var(--main-section-background-color);
|
|
29
|
+
display: flex;
|
|
30
|
+
flex-direction: column;
|
|
31
|
+
flex: 1;
|
|
32
|
+
overflow-y: auto;
|
|
33
|
+
}
|
|
34
|
+
data-grist {
|
|
35
|
+
overflow-y: hidden;
|
|
36
|
+
flex: 1;
|
|
37
|
+
}
|
|
38
|
+
.button-container {
|
|
39
|
+
padding: 10px 0 12px 0;
|
|
40
|
+
text-align: center;
|
|
41
|
+
display: flex;
|
|
42
|
+
flex-direction: column;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
@media (max-width: 460px) {
|
|
46
|
+
.single-column-form {
|
|
47
|
+
max-width: 100%;
|
|
48
|
+
}
|
|
49
|
+
.mobile-full-width {
|
|
50
|
+
grid-column: span 12 / auto;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
`
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
static get properties() {
|
|
58
|
+
return {
|
|
59
|
+
inventory: Object,
|
|
60
|
+
config: Object,
|
|
61
|
+
data: Array,
|
|
62
|
+
_selectedInventoryItem: Object,
|
|
63
|
+
_currentSerialNumber: String,
|
|
64
|
+
adjustmentType: String,
|
|
65
|
+
enableRemove: Boolean,
|
|
66
|
+
enableUpdateBtn: Boolean
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
get selectedSerialInput() {
|
|
71
|
+
return this.shadowRoot.querySelector('input[name=selectedSerialNumber]')
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
get serialNumberInput() {
|
|
75
|
+
return this.shadowRoot
|
|
76
|
+
?.querySelector('barcode-scanable-input[name=serialNumber]')
|
|
77
|
+
?.shadowRoot?.querySelector('input')
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
get dataGrist() {
|
|
81
|
+
return this.shadowRoot.querySelector('data-grist')
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
constructor() {
|
|
85
|
+
super()
|
|
86
|
+
this.enableRemove = true
|
|
87
|
+
this.enableUpdateBtn = true
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
render() {
|
|
91
|
+
return html`
|
|
92
|
+
<form class="multi-column-form">
|
|
93
|
+
<fieldset>
|
|
94
|
+
<legend>
|
|
95
|
+
${this.adjustmentType == 'APPROVAL'
|
|
96
|
+
? `${
|
|
97
|
+
this.inventory?.cartonId
|
|
98
|
+
? this.inventory.cartonId
|
|
99
|
+
: this.inventory?.palletId
|
|
100
|
+
? this.inventory.palletId
|
|
101
|
+
: ''
|
|
102
|
+
} (${this.inventory.transactionType})`
|
|
103
|
+
: `${this.inventory.product.sku} - ${`${this.inventory.product.name}`} ( ${this.data?.total || 0} / ${
|
|
104
|
+
this.inventory.qty
|
|
105
|
+
} )`}
|
|
106
|
+
</legend>
|
|
107
|
+
</fieldset>
|
|
108
|
+
</form>
|
|
109
|
+
|
|
110
|
+
<div class="grist">
|
|
111
|
+
<data-grist .mode=${isMobileDevice() ? 'LIST' : 'GRID'} .config=${this.config} .data=${this.data}></data-grist>
|
|
112
|
+
</div>
|
|
113
|
+
|
|
114
|
+
<form id="input-form" class="single-column-form">
|
|
115
|
+
<input
|
|
116
|
+
name="selectedSerialNumber"
|
|
117
|
+
placeholder="-- Selected Serial Number --"
|
|
118
|
+
disabled
|
|
119
|
+
readonly
|
|
120
|
+
class="mobile-full-width"
|
|
121
|
+
value="${this._currentSerialNumber}"
|
|
122
|
+
/>
|
|
123
|
+
|
|
124
|
+
${this.enableUpdateBtn
|
|
125
|
+
? html`<barcode-scanable-input
|
|
126
|
+
name="serialNumber"
|
|
127
|
+
class="mobile-full-width"
|
|
128
|
+
custom-input
|
|
129
|
+
></barcode-scanable-input>
|
|
130
|
+
<mwc-button
|
|
131
|
+
name="addSerialNumber"
|
|
132
|
+
class="mobile-full-width"
|
|
133
|
+
raised
|
|
134
|
+
@click=${async e => {
|
|
135
|
+
this.createInventoryItemChange(INVENTORY_ITEM_CHANGE_TYPE.NEW.value)
|
|
136
|
+
}}
|
|
137
|
+
label="${i18next.t('button.add')}"
|
|
138
|
+
></mwc-button>
|
|
139
|
+
|
|
140
|
+
<mwc-button
|
|
141
|
+
name="setSerialNumber"
|
|
142
|
+
class="mobile-full-width"
|
|
143
|
+
raised
|
|
144
|
+
@click=${async e => {
|
|
145
|
+
this.createInventoryItemChange(INVENTORY_ITEM_CHANGE_TYPE.MODIFIED.value)
|
|
146
|
+
}}
|
|
147
|
+
label="${i18next.t('button.update')}"
|
|
148
|
+
></mwc-button>`
|
|
149
|
+
: ''}
|
|
150
|
+
</form>
|
|
151
|
+
|
|
152
|
+
${this.enableUpdateBtn && this.enableRemove
|
|
153
|
+
? html`<div class="button-container">
|
|
154
|
+
<mwc-button
|
|
155
|
+
danger
|
|
156
|
+
@click=${async e => {
|
|
157
|
+
await this._confirmInventoryItemChange(e)
|
|
158
|
+
}}
|
|
159
|
+
raised
|
|
160
|
+
label="${i18next.t('button.confirm')}"
|
|
161
|
+
></mwc-button>
|
|
162
|
+
</div>`
|
|
163
|
+
: ''}
|
|
164
|
+
`
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
async firstUpdated() {
|
|
168
|
+
this.clearView()
|
|
169
|
+
|
|
170
|
+
this.config = {
|
|
171
|
+
pagination: { infinite: true },
|
|
172
|
+
rows: {
|
|
173
|
+
appendable: false,
|
|
174
|
+
handlers: {
|
|
175
|
+
click: async (columns, data, column, record, rowIndex) => {
|
|
176
|
+
try {
|
|
177
|
+
this.dataGrist.showSpinner()
|
|
178
|
+
if (record.type == '') {
|
|
179
|
+
this._selectedInventoryItem = record
|
|
180
|
+
this._currentSerialNumber = record.serialNumber
|
|
181
|
+
}
|
|
182
|
+
} catch (ex) {
|
|
183
|
+
console.log(ex)
|
|
184
|
+
} finally {
|
|
185
|
+
this.dataGrist.hideSpinner()
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
list: {
|
|
191
|
+
fields: ['serialNumber', 'palletId', 'cartonId', 'remark']
|
|
192
|
+
},
|
|
193
|
+
columns: [
|
|
194
|
+
{ type: 'gutter', gutterName: 'sequence' },
|
|
195
|
+
{
|
|
196
|
+
type: 'gutter',
|
|
197
|
+
gutterName: 'button',
|
|
198
|
+
icon: this.enableRemove ? 'close' : '',
|
|
199
|
+
handlers: {
|
|
200
|
+
click: async (columns, data, column, record, rowIndex) => {
|
|
201
|
+
if (this.enableRemove) {
|
|
202
|
+
if (record.transactionType == INVENTORY_ITEM_CHANGE_TRANSACTION_TYPE.CHANGES.value) {
|
|
203
|
+
this.data = {
|
|
204
|
+
...this.data,
|
|
205
|
+
records: data.records.filter((_, idx) => idx !== rowIndex)
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
if (record.type == INVENTORY_ITEM_CHANGE_TYPE.NEW.value) {
|
|
209
|
+
this.data.total -= 1
|
|
210
|
+
} else if (record.type == INVENTORY_ITEM_CHANGE_TYPE.REMOVED.value) {
|
|
211
|
+
this.data.total += 1
|
|
212
|
+
}
|
|
213
|
+
} else {
|
|
214
|
+
this._selectedInventoryItem = record
|
|
215
|
+
this.createInventoryItemChange(INVENTORY_ITEM_CHANGE_TYPE.REMOVED.value)
|
|
216
|
+
|
|
217
|
+
this.data.total -= 1
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
this.clearView()
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
type: 'string',
|
|
227
|
+
name: 'serialNumber',
|
|
228
|
+
header: i18next.t('field.serial_number'),
|
|
229
|
+
label: true,
|
|
230
|
+
width: 140
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
type: 'string',
|
|
234
|
+
name: 'palletId',
|
|
235
|
+
header: i18next.t('field.lot_id'),
|
|
236
|
+
label: true,
|
|
237
|
+
width: 140
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
type: 'string',
|
|
241
|
+
name: 'cartonId',
|
|
242
|
+
header: i18next.t('field.carton_id'),
|
|
243
|
+
label: true,
|
|
244
|
+
width: 140
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
type: 'string',
|
|
248
|
+
name: 'type',
|
|
249
|
+
header: i18next.t('field.remark'),
|
|
250
|
+
label: true,
|
|
251
|
+
width: 400
|
|
252
|
+
}
|
|
253
|
+
]
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
await this.fetchInventoryItems()
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
clearView() {
|
|
260
|
+
this._selectedInventoryItem = null
|
|
261
|
+
if (this.serialNumberInput) this.serialNumberInput.value = ''
|
|
262
|
+
this._currentSerialNumber = ''
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
async fetchInventoryItems() {
|
|
266
|
+
if (this.adjustmentType == 'ADJUSTMENT') {
|
|
267
|
+
let inventoryId = this.inventory.id
|
|
268
|
+
let filters = []
|
|
269
|
+
if (inventoryId) filters.push({ name: 'inventoryId', operator: 'eq', value: this.inventory.id })
|
|
270
|
+
|
|
271
|
+
const sortings = [{ name: 'serialNumber' }]
|
|
272
|
+
|
|
273
|
+
const response = await client.query({
|
|
274
|
+
query: gql`
|
|
275
|
+
query inventoryItemsWithChanges($filters: [Filter!]!, $pagination: Pagination, $sortings: [Sorting!]!) {
|
|
276
|
+
inventoryItemsWithChanges(filters: $filters, pagination: $pagination, sortings: $sortings) {
|
|
277
|
+
items {
|
|
278
|
+
id
|
|
279
|
+
name
|
|
280
|
+
serialNumber
|
|
281
|
+
type
|
|
282
|
+
transactionType
|
|
283
|
+
inventory {
|
|
284
|
+
id
|
|
285
|
+
name
|
|
286
|
+
palletId
|
|
287
|
+
cartonId
|
|
288
|
+
}
|
|
289
|
+
product {
|
|
290
|
+
id
|
|
291
|
+
name
|
|
292
|
+
sku
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
total
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
`,
|
|
299
|
+
variables: { filters, sortings }
|
|
300
|
+
})
|
|
301
|
+
|
|
302
|
+
if (!response.errors) {
|
|
303
|
+
let total = response.data.inventoryItemsWithChanges.total || 0
|
|
304
|
+
let records =
|
|
305
|
+
response.data.inventoryItemsWithChanges.items.map(item => {
|
|
306
|
+
return {
|
|
307
|
+
...item,
|
|
308
|
+
palletId: item.inventory.palletId,
|
|
309
|
+
cartonId: item.inventory.cartonId
|
|
310
|
+
}
|
|
311
|
+
}) || []
|
|
312
|
+
|
|
313
|
+
if (this.inventory?.inventoryItemChanges) {
|
|
314
|
+
let existingInventoryItemChanges = JSON.parse(this.inventory.inventoryItemChanges)
|
|
315
|
+
records.push(...existingInventoryItemChanges)
|
|
316
|
+
|
|
317
|
+
total += existingInventoryItemChanges.length
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
this.data = {
|
|
321
|
+
total,
|
|
322
|
+
records
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
} else if (this.adjustmentType == 'APPROVAL') {
|
|
326
|
+
let inventoryChange = this.inventory
|
|
327
|
+
let filters = []
|
|
328
|
+
if (inventoryChange) {
|
|
329
|
+
filters.push({ name: 'inventoryChange', operator: 'eq', value: inventoryChange.id })
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
const sortings = [{ name: 'serialNumber' }]
|
|
333
|
+
|
|
334
|
+
const response = await client.query({
|
|
335
|
+
query: gql`
|
|
336
|
+
query inventoryItemChanges($filters: [Filter!]!, $pagination: Pagination, $sortings: [Sorting!]!) {
|
|
337
|
+
inventoryItemChanges(filters: $filters, pagination: $pagination, sortings: $sortings) {
|
|
338
|
+
items {
|
|
339
|
+
id
|
|
340
|
+
name
|
|
341
|
+
serialNumber
|
|
342
|
+
type
|
|
343
|
+
status
|
|
344
|
+
}
|
|
345
|
+
total
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
`,
|
|
349
|
+
variables: { filters, sortings }
|
|
350
|
+
})
|
|
351
|
+
|
|
352
|
+
if (!response.errors) {
|
|
353
|
+
let total = response.data.inventoryItemChanges.total || 0
|
|
354
|
+
let records = response.data.inventoryItemChanges.items || []
|
|
355
|
+
|
|
356
|
+
this.data = {
|
|
357
|
+
total,
|
|
358
|
+
records
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
createInventoryItemChange(type) {
|
|
365
|
+
try {
|
|
366
|
+
if (type != INVENTORY_ITEM_CHANGE_TYPE.REMOVED.value) {
|
|
367
|
+
if (this.serialNumberInput.value == '') throw new Error(i18next.t('text.please_key_in_new_serial_number'))
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
let inventoryItemChange = {
|
|
371
|
+
serialNumber:
|
|
372
|
+
type == INVENTORY_ITEM_CHANGE_TYPE.REMOVED.value
|
|
373
|
+
? this._selectedInventoryItem.serialNumber
|
|
374
|
+
: this.serialNumberInput.value,
|
|
375
|
+
type,
|
|
376
|
+
transactionType: INVENTORY_ITEM_CHANGE_TRANSACTION_TYPE.CHANGES.value,
|
|
377
|
+
inventory: {
|
|
378
|
+
id: this.inventory.id,
|
|
379
|
+
name: this.inventory.name
|
|
380
|
+
},
|
|
381
|
+
product: {
|
|
382
|
+
id: this.inventory.product.id,
|
|
383
|
+
name: this.inventory.product.name
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
if (type == INVENTORY_ITEM_CHANGE_TYPE.MODIFIED.value || type == INVENTORY_ITEM_CHANGE_TYPE.REMOVED.value) {
|
|
388
|
+
inventoryItemChange = {
|
|
389
|
+
...inventoryItemChange,
|
|
390
|
+
palletId: this._selectedInventoryItem.palletId,
|
|
391
|
+
cartonId: this._selectedInventoryItem.cartonId,
|
|
392
|
+
inventoryItem: {
|
|
393
|
+
id: this._selectedInventoryItem.id,
|
|
394
|
+
name: this._selectedInventoryItem.name
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
if (type == INVENTORY_ITEM_CHANGE_TYPE.NEW.value) this.data.total += 1
|
|
400
|
+
this.data = {
|
|
401
|
+
...this.data,
|
|
402
|
+
records: [...this.dataGrist.dirtyData.records, inventoryItemChange]
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
this.clearView()
|
|
406
|
+
} catch (e) {
|
|
407
|
+
this._showToast(e)
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
deleteInventoryItemChange(rowIndex) {
|
|
412
|
+
try {
|
|
413
|
+
this.data = {
|
|
414
|
+
...this.data,
|
|
415
|
+
records: data.records.filter((_, idx) => idx !== rowIndex)
|
|
416
|
+
}
|
|
417
|
+
} catch (e) {
|
|
418
|
+
this._showToast(e)
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
async _confirmInventoryItemChange(e) {
|
|
423
|
+
if (e.keyCode === 13 || e.type == 'click') {
|
|
424
|
+
e.preventDefault()
|
|
425
|
+
try {
|
|
426
|
+
this.validateInventoryItemChange()
|
|
427
|
+
|
|
428
|
+
this.dispatchEvent(
|
|
429
|
+
new CustomEvent('confirm-serial-number-list', {
|
|
430
|
+
detail: {
|
|
431
|
+
inventoryItemChanges:
|
|
432
|
+
this.data.records.filter(
|
|
433
|
+
itm => itm.transactionType == INVENTORY_ITEM_CHANGE_TRANSACTION_TYPE.CHANGES.value
|
|
434
|
+
) || []
|
|
435
|
+
}
|
|
436
|
+
})
|
|
437
|
+
)
|
|
438
|
+
history.back()
|
|
439
|
+
} catch (e) {
|
|
440
|
+
this._showToast(e)
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
validate() {
|
|
446
|
+
// validate for previous picking execution (multiple picking scanning)
|
|
447
|
+
if (this.selectedSerialInput.value == '') throw new Error(i18next.t('text.no_serial_number_selected'))
|
|
448
|
+
|
|
449
|
+
if (this.serialNumberInput.value == '') throw new Error(i18next.t('text.please_key_in_new_serial_number'))
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
validateInventoryItemChange() {
|
|
453
|
+
if (this.data?.total != this.inventory.qty) throw new Error(i18next.t('text.serial_number_not_tally_with_qty'))
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
_showToast({ type, message }) {
|
|
457
|
+
document.dispatchEvent(
|
|
458
|
+
new CustomEvent('notify', {
|
|
459
|
+
detail: {
|
|
460
|
+
type,
|
|
461
|
+
message
|
|
462
|
+
}
|
|
463
|
+
})
|
|
464
|
+
)
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
window.customElements.define('serial-number-list-popup', SerialNumberListPopup)
|
|
@@ -301,6 +301,7 @@ class PalletList extends connect(store)(localize(i18next)(PageView)) {
|
|
|
301
301
|
|
|
302
302
|
async _savePallet() {
|
|
303
303
|
let patches = this.dataGrist.exportPatchList({ flagName: 'cuFlag' })
|
|
304
|
+
this._validatePallet(patches)
|
|
304
305
|
if (patches && patches.length) {
|
|
305
306
|
this.dataGrist.showSpinner()
|
|
306
307
|
const response = await client.mutate({
|
|
@@ -330,6 +331,29 @@ class PalletList extends connect(store)(localize(i18next)(PageView)) {
|
|
|
330
331
|
}
|
|
331
332
|
}
|
|
332
333
|
|
|
334
|
+
_validatePallet(patches) {
|
|
335
|
+
for (const patch of patches) {
|
|
336
|
+
if (!patch.owner) {
|
|
337
|
+
throw document.dispatchEvent(
|
|
338
|
+
new CustomEvent('notify', {
|
|
339
|
+
detail: {
|
|
340
|
+
message: i18next.t('text.owner_field_is_empty')
|
|
341
|
+
}
|
|
342
|
+
})
|
|
343
|
+
)
|
|
344
|
+
}
|
|
345
|
+
if (!patch.holder) {
|
|
346
|
+
throw document.dispatchEvent(
|
|
347
|
+
new CustomEvent('notify', {
|
|
348
|
+
detail: {
|
|
349
|
+
message: i18next.t('text.holder_field_is_empty')
|
|
350
|
+
}
|
|
351
|
+
})
|
|
352
|
+
)
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
|
|
333
357
|
async _deletePallet() {
|
|
334
358
|
CustomAlert({
|
|
335
359
|
title: i18next.t('text.are_you_sure'),
|
|
@@ -138,6 +138,7 @@ export class EditProductPopup extends localize(i18next)(LitElement) {
|
|
|
138
138
|
'batchId',
|
|
139
139
|
'productSku',
|
|
140
140
|
'product',
|
|
141
|
+
'brand',
|
|
141
142
|
'packingType',
|
|
142
143
|
'uomValue',
|
|
143
144
|
'uom',
|
|
@@ -177,6 +178,12 @@ export class EditProductPopup extends localize(i18next)(LitElement) {
|
|
|
177
178
|
header: i18next.t('field.product'),
|
|
178
179
|
width: 350
|
|
179
180
|
},
|
|
181
|
+
{
|
|
182
|
+
type: 'object',
|
|
183
|
+
name: 'brand',
|
|
184
|
+
header: i18next.t('field.brand'),
|
|
185
|
+
width: 150
|
|
186
|
+
},
|
|
180
187
|
{
|
|
181
188
|
type: 'code',
|
|
182
189
|
name: 'packingType',
|
|
@@ -312,6 +319,12 @@ export class EditProductPopup extends localize(i18next)(LitElement) {
|
|
|
312
319
|
name: 'product',
|
|
313
320
|
hidden: true
|
|
314
321
|
},
|
|
322
|
+
{
|
|
323
|
+
type: 'object',
|
|
324
|
+
name: 'brand',
|
|
325
|
+
header: i18next.t('field.brand'),
|
|
326
|
+
width: 150
|
|
327
|
+
},
|
|
315
328
|
{
|
|
316
329
|
type: 'code',
|
|
317
330
|
name: 'packingType',
|
|
@@ -44,6 +44,7 @@ class B2bOrderList extends localize(i18next)(PageView) {
|
|
|
44
44
|
data: Object,
|
|
45
45
|
_ownTransport: Boolean,
|
|
46
46
|
_exportOption: Boolean,
|
|
47
|
+
_routeId: Boolean,
|
|
47
48
|
isUserBelongsDomain: Boolean
|
|
48
49
|
}
|
|
49
50
|
}
|
|
@@ -212,6 +213,13 @@ class B2bOrderList extends localize(i18next)(PageView) {
|
|
|
212
213
|
type: 'checkbox',
|
|
213
214
|
props: { searchOper: 'eq' },
|
|
214
215
|
attrs: ['indeterminate']
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
label: i18next.t('field.route_label'),
|
|
219
|
+
name: 'routeId',
|
|
220
|
+
type: 'checkbox',
|
|
221
|
+
props: { searchOper: 'noteq' },
|
|
222
|
+
attrs: ['indeterminate']
|
|
215
223
|
}
|
|
216
224
|
]
|
|
217
225
|
|
|
@@ -321,6 +329,13 @@ class B2bOrderList extends localize(i18next)(PageView) {
|
|
|
321
329
|
imex: { header: i18next.t('field.cross_docking'), key: 'crossDocking', width: 20, type: 'string' },
|
|
322
330
|
width: 60
|
|
323
331
|
},
|
|
332
|
+
{
|
|
333
|
+
type: 'boolean',
|
|
334
|
+
name: 'routeId',
|
|
335
|
+
header: i18next.t('field.route'),
|
|
336
|
+
imex: { header: i18next.t('field.route'), key: 'routeId', width: 20, type: 'string' },
|
|
337
|
+
width: 60
|
|
338
|
+
},
|
|
324
339
|
{
|
|
325
340
|
type: 'object',
|
|
326
341
|
name: 'arrivalNotice',
|
|
@@ -408,6 +423,7 @@ class B2bOrderList extends localize(i18next)(PageView) {
|
|
|
408
423
|
refNo2
|
|
409
424
|
refNo3
|
|
410
425
|
exportOption
|
|
426
|
+
routeId
|
|
411
427
|
releaseDate
|
|
412
428
|
status
|
|
413
429
|
createdAt
|
|
@@ -437,9 +453,16 @@ class B2bOrderList extends localize(i18next)(PageView) {
|
|
|
437
453
|
if (!response.errors) {
|
|
438
454
|
this._ownTransport = response.data.releaseGoodRequests.ownTransport
|
|
439
455
|
this._exportOption = response.data.releaseGoodRequests.exportOption
|
|
456
|
+
this._routeId = response.data.releaseGoodRequests.routeId ? true : false
|
|
440
457
|
return {
|
|
441
458
|
total: response.data.releaseGoodRequests.total || 0,
|
|
442
|
-
records:
|
|
459
|
+
records:
|
|
460
|
+
response.data.releaseGoodRequests.items.map(itm => {
|
|
461
|
+
return {
|
|
462
|
+
...itm,
|
|
463
|
+
routeId: itm.routeId ? true : false
|
|
464
|
+
}
|
|
465
|
+
}) || []
|
|
443
466
|
}
|
|
444
467
|
}
|
|
445
468
|
}
|
|
@@ -306,6 +306,7 @@ class BatchPickingPopup extends localize(i18next)(LitElement) {
|
|
|
306
306
|
refNo
|
|
307
307
|
releaseDate
|
|
308
308
|
type
|
|
309
|
+
routeId
|
|
309
310
|
bizplace {
|
|
310
311
|
id
|
|
311
312
|
name
|
|
@@ -378,6 +379,13 @@ class BatchPickingPopup extends localize(i18next)(LitElement) {
|
|
|
378
379
|
|
|
379
380
|
if (!result.value) return
|
|
380
381
|
|
|
382
|
+
let withRouteLabel = this.releaseOrderGrist.selected.find(itm => itm.routeId)
|
|
383
|
+
let withoutRouteLabel = this.releaseOrderGrist.selected.find(itm => itm.routeId == null)
|
|
384
|
+
|
|
385
|
+
if (withRouteLabel && withoutRouteLabel) {
|
|
386
|
+
throw new Error(`RO without route labelling is included in the batch picking`)
|
|
387
|
+
}
|
|
388
|
+
|
|
381
389
|
let releaseGoodNos = []
|
|
382
390
|
releaseGoodNos = this.releaseOrderGrist.selected.map(record => record.name)
|
|
383
391
|
|
|
@@ -609,7 +609,7 @@ export class ReleaseExtraProductPopup extends localize(i18next)(LitElement) {
|
|
|
609
609
|
|
|
610
610
|
if (afterValue >= 0) {
|
|
611
611
|
if (columnName == 'releaseUomValue' || columnName == 'releaseQty') {
|
|
612
|
-
if (originQty) {
|
|
612
|
+
if (originQty >= 0) {
|
|
613
613
|
if (originQty == 0 || originUom == 0) {
|
|
614
614
|
packageUom = originAddableUom / originAddableQty
|
|
615
615
|
} else {
|
|
@@ -643,6 +643,7 @@ export class ReleaseExtraProductPopup extends localize(i18next)(LitElement) {
|
|
|
643
643
|
|
|
644
644
|
return { releaseQty, roundedUom }
|
|
645
645
|
}
|
|
646
|
+
|
|
646
647
|
_onInventoryFieldChanged(e) {
|
|
647
648
|
let columnName = e.detail.column.name
|
|
648
649
|
let roundedUomValue = e.detail.record.roundedUomValue || 0
|
|
@@ -650,7 +651,7 @@ export class ReleaseExtraProductPopup extends localize(i18next)(LitElement) {
|
|
|
650
651
|
let packageUomValue = 0
|
|
651
652
|
|
|
652
653
|
try {
|
|
653
|
-
if (e.detail.after
|
|
654
|
+
if (Number.isNaN(e.detail.after)) {
|
|
654
655
|
throw new Error(i18next.t('text.invalid_form_value'))
|
|
655
656
|
}
|
|
656
657
|
} catch (e) {
|
|
@@ -707,15 +708,19 @@ export class ReleaseExtraProductPopup extends localize(i18next)(LitElement) {
|
|
|
707
708
|
var totalAvailableQty = 0
|
|
708
709
|
var totalAvailableUomValue = 0
|
|
709
710
|
|
|
710
|
-
if (gristType == 'existing') {
|
|
711
|
-
totalAvailableQty = beforeRecord.addableQty + beforeRecord.releaseQty
|
|
712
|
-
totalAvailableUomValue = beforeRecord.addableUomValue + beforeRecord.releaseUomValue
|
|
713
|
-
} else {
|
|
714
|
-
totalAvailableQty = changeRecord.remainQty
|
|
715
|
-
totalAvailableUomValue = changeRecord.remainUomValue
|
|
716
|
-
}
|
|
717
|
-
|
|
718
711
|
try {
|
|
712
|
+
if (Number.isNaN(changeRecord.releaseQty) || Number.isNaN(changeRecord.releaseUomValue)) {
|
|
713
|
+
throw new Error(i18next.t('text.invalid_form_value'))
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
if (gristType == 'existing') {
|
|
717
|
+
totalAvailableQty = beforeRecord.addableQty + beforeRecord.releaseQty
|
|
718
|
+
totalAvailableUomValue = beforeRecord.addableUomValue + beforeRecord.releaseUomValue
|
|
719
|
+
} else {
|
|
720
|
+
totalAvailableQty = changeRecord.remainQty
|
|
721
|
+
totalAvailableUomValue = changeRecord.remainUomValue
|
|
722
|
+
}
|
|
723
|
+
|
|
719
724
|
if (changedColumn === 'releaseQty') {
|
|
720
725
|
this._validateReleaseQty(changeRecord.releaseQty, changeRecord.remainQty, totalAvailableQty)
|
|
721
726
|
} else if (changedColumn === 'releaseUomValue') {
|