@things-factory/operato-wms 4.3.104 → 4.3.105-alpha.0
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/client/pages/bulk-operation/bulk-operation.js +8 -10
- package/client/pages/components/select-inventory-popup.js +7 -1
- package/client/pages/components/select-product-popup.js +31 -2
- package/client/pages/inbound/undo-putaway-popup.js +5 -9
- package/client/pages/inbound/undo-unload-popup.js +15 -2
- package/client/pages/inbound/unload-product.js +71 -67
- package/client/pages/inventory/inventory-adjustment-approval.js +4 -5
- package/client/pages/inventory/inventory-adjustment.js +7 -0
- package/client/pages/inventory-check/create-cycle-count.js +2 -3
- package/client/pages/inventory-check/inventory-check-list.js +94 -10
- package/client/pages/manifest/loading-manifest-detail.js +7 -4
- package/client/pages/master/generate-location-list.js +30 -22
- package/client/pages/master/location-list.js +114 -73
- package/client/pages/master/pallet-list.js +88 -58
- package/client/pages/master/product/product-details-popup.js +3 -3
- package/client/pages/master/tote-list.js +35 -27
- package/client/pages/master/transport-driver.js +50 -41
- package/client/pages/master/transport-vehicle.js +45 -41
- package/client/pages/master/warehouse-list.js +56 -34
- package/client/pages/order/arrival-notice/arrival-notice-detail.js +36 -25
- package/client/pages/order/arrival-notice/create-arrival-notice.js +53 -32
- package/client/pages/order/arrival-notice/duplicate-arrival-notice.js +2 -0
- package/client/pages/order/arrival-notice/edit-product-popup.js +9 -7
- package/client/pages/order/draft-release-good/draft-release-good-detail.js +7 -1
- package/client/pages/order/release-order/create-release-order.js +24 -5
- package/client/pages/order/release-order/release-extra-product-popup.js +4 -1
- package/client/pages/order/release-order/release-order-detail.js +4 -0
- package/client/pages/order/return-order/create-return-order.js +1 -0
- package/client/pages/order/return-order/return-order-inventory-popup.js +1 -0
- package/client/pages/outbound/inventory-reassign-popup.js +6 -0
- package/client/pages/outbound/packing-product.js +8 -6
- package/client/pages/outbound/picking-product.js +11 -1
- package/config.development.js +27 -33
- package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-report.js +4 -5
- package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-report.js.map +1 -1
- package/dist-server/graphql/resolvers/other/add-release-good-products.js +7 -11
- package/dist-server/graphql/resolvers/other/add-release-good-products.js.map +1 -1
- package/dist-server/graphql/resolvers/reports/costing-report.js +18 -24
- package/dist-server/graphql/resolvers/reports/costing-report.js.map +1 -1
- package/dist-server/graphql/resolvers/reports/inbound-order-details-report.js +6 -6
- package/dist-server/graphql/resolvers/reports/outbound-order-details-report.js +5 -6
- package/dist-server/graphql/resolvers/reports/outbound-order-details-report.js.map +1 -1
- package/package.json +50 -50
- package/server/graphql/resolvers/custom/elccl/elccl-inventory-history-report.ts +4 -5
- package/server/graphql/resolvers/other/add-release-good-products.ts +8 -12
- package/server/graphql/resolvers/reports/costing-report.ts +18 -24
- package/server/graphql/resolvers/reports/inbound-order-details-report.ts +6 -6
- package/server/graphql/resolvers/reports/outbound-order-details-report.ts +5 -6
- package/translations/en.json +11 -10
- package/translations/ko.json +11 -10
- package/translations/ms.json +11 -10
- package/translations/zh.json +4 -3
|
@@ -503,10 +503,10 @@ class LoadingManifestDetail extends localize(i18next)(PageView) {
|
|
|
503
503
|
}
|
|
504
504
|
|
|
505
505
|
async _validateOrderStatus() {
|
|
506
|
-
let foundCancelOrder = this.shippingData.records.
|
|
507
|
-
itm => itm.orderStatus == ORDER_STATUS.PENDING_CANCEL || itm.orderStatus == ORDER_STATUS.CANCELLED
|
|
506
|
+
let foundCancelOrder = this.shippingData.records.some(
|
|
507
|
+
itm => itm.orderStatus == ORDER_STATUS.PENDING_CANCEL.value || itm.orderStatus == ORDER_STATUS.CANCELLED.value
|
|
508
508
|
)
|
|
509
|
-
if (foundCancelOrder
|
|
509
|
+
if (foundCancelOrder) {
|
|
510
510
|
const answer = await CustomAlert({
|
|
511
511
|
title: i18next.t('title.do_you_wish_to_proceed'),
|
|
512
512
|
text: i18next.t('text.parcels_are_found_with_cancelled_or_pending_cancelled_status'),
|
|
@@ -543,7 +543,10 @@ class LoadingManifestDetail extends localize(i18next)(PageView) {
|
|
|
543
543
|
if (!response.error) {
|
|
544
544
|
let releaseGood = response.data.releaseGood
|
|
545
545
|
|
|
546
|
-
if (
|
|
546
|
+
if (
|
|
547
|
+
releaseGood?.status === ORDER_STATUS.CANCELLED.value ||
|
|
548
|
+
releaseGood?.status === ORDER_STATUS.PENDING_CANCEL.value
|
|
549
|
+
) {
|
|
547
550
|
let answer = await CustomAlert({
|
|
548
551
|
type: 'warning',
|
|
549
552
|
title: i18next.t('title.order(s)_is_at_pending_cancelled_or_cancelled'),
|
|
@@ -6,6 +6,7 @@ import { i18next, localize } from '@things-factory/i18n-base'
|
|
|
6
6
|
import { isMobileDevice } from '@things-factory/utils'
|
|
7
7
|
import { ScrollbarStyles } from '@things-factory/styles'
|
|
8
8
|
import { css, html, LitElement } from 'lit-element'
|
|
9
|
+
import { showToast } from '../../util'
|
|
9
10
|
|
|
10
11
|
export class GenerateLocationList extends localize(i18next)(LitElement) {
|
|
11
12
|
static get properties() {
|
|
@@ -337,39 +338,46 @@ export class GenerateLocationList extends localize(i18next)(LitElement) {
|
|
|
337
338
|
}
|
|
338
339
|
|
|
339
340
|
_validateGenerator() {
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
341
|
+
try {
|
|
342
|
+
if (!this._selectedFormat) {
|
|
343
|
+
throw new Error(i18next.t('text.select_location_format'))
|
|
344
|
+
}
|
|
345
|
+
let dataFromGrist = this.data.records
|
|
346
|
+
let validationError = false
|
|
347
|
+
for (let x = 1; x < dataFromGrist.length; x++) {
|
|
348
|
+
if (dataFromGrist[x].start <= dataFromGrist[x - 1].end) {
|
|
349
|
+
document.dispatchEvent(
|
|
350
|
+
new CustomEvent('notify', {
|
|
351
|
+
detail: {
|
|
352
|
+
level: 'error',
|
|
353
|
+
message: i18next.t('text.already_existed', {
|
|
354
|
+
state: {
|
|
355
|
+
text: dataFromGrist[x].start
|
|
356
|
+
}
|
|
357
|
+
})
|
|
358
|
+
}
|
|
359
|
+
})
|
|
360
|
+
)
|
|
361
|
+
validationError = true
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
if (this._zoneName === '') {
|
|
344
366
|
document.dispatchEvent(
|
|
345
367
|
new CustomEvent('notify', {
|
|
346
368
|
detail: {
|
|
347
369
|
level: 'error',
|
|
348
|
-
message: i18next.t('text.
|
|
349
|
-
state: {
|
|
350
|
-
text: dataFromGrist[x].start
|
|
351
|
-
}
|
|
352
|
-
})
|
|
370
|
+
message: i18next.t('text.missing_zone_name')
|
|
353
371
|
}
|
|
354
372
|
})
|
|
355
373
|
)
|
|
356
374
|
validationError = true
|
|
357
375
|
}
|
|
358
|
-
}
|
|
359
376
|
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
detail: {
|
|
364
|
-
level: 'error',
|
|
365
|
-
message: i18next.t('text.missing_zone_name')
|
|
366
|
-
}
|
|
367
|
-
})
|
|
368
|
-
)
|
|
369
|
-
validationError = true
|
|
377
|
+
if (!validationError) this._generateLocationList()
|
|
378
|
+
} catch (e) {
|
|
379
|
+
showToast(e)
|
|
370
380
|
}
|
|
371
|
-
|
|
372
|
-
if (!validationError) this._generateLocationList()
|
|
373
381
|
}
|
|
374
382
|
|
|
375
383
|
async _generateLocationList() {
|
|
@@ -16,6 +16,7 @@ import { CommonButtonStyles, ScrollbarStyles } from '@things-factory/styles'
|
|
|
16
16
|
import { isMobileDevice } from '@things-factory/utils'
|
|
17
17
|
|
|
18
18
|
import { LOCATION_LABEL_SETTING_KEY, LOCATION_STATUS, LOCATION_TYPE } from '../constants'
|
|
19
|
+
import { showToast } from '../../util'
|
|
19
20
|
|
|
20
21
|
class LocationList extends connect(store)(localize(i18next)(PageView)) {
|
|
21
22
|
static get styles() {
|
|
@@ -151,25 +152,25 @@ class LocationList extends connect(store)(localize(i18next)(PageView)) {
|
|
|
151
152
|
label: i18next.t('field.zone'),
|
|
152
153
|
name: 'zone',
|
|
153
154
|
type: 'text',
|
|
154
|
-
props: { searchOper: '
|
|
155
|
+
props: { searchOper: 'i_like' }
|
|
155
156
|
},
|
|
156
157
|
{
|
|
157
158
|
label: i18next.t('field.row'),
|
|
158
159
|
name: 'row',
|
|
159
160
|
type: 'text',
|
|
160
|
-
props: { searchOper: '
|
|
161
|
+
props: { searchOper: 'i_like' }
|
|
161
162
|
},
|
|
162
163
|
{
|
|
163
164
|
label: i18next.t('field.column'),
|
|
164
165
|
name: 'column',
|
|
165
166
|
type: 'text',
|
|
166
|
-
props: { searchOper: '
|
|
167
|
+
props: { searchOper: 'i_like' }
|
|
167
168
|
},
|
|
168
169
|
{
|
|
169
170
|
label: i18next.t('field.shelf'),
|
|
170
171
|
name: 'shelf',
|
|
171
172
|
type: 'text',
|
|
172
|
-
props: { searchOper: '
|
|
173
|
+
props: { searchOper: 'i_like' }
|
|
173
174
|
},
|
|
174
175
|
{
|
|
175
176
|
label: i18next.t('field.status'),
|
|
@@ -191,8 +192,8 @@ class LocationList extends connect(store)(localize(i18next)(PageView)) {
|
|
|
191
192
|
]
|
|
192
193
|
|
|
193
194
|
this.config = {
|
|
194
|
-
pagination: { pages: [20, 50, 100, 200] },
|
|
195
195
|
rows: { selectable: { multiple: true } },
|
|
196
|
+
pagination: { limit: 50, pages: [50, 100, 200, 500] },
|
|
196
197
|
list: {
|
|
197
198
|
fields: ['name', 'type', 'status']
|
|
198
199
|
},
|
|
@@ -222,7 +223,17 @@ class LocationList extends connect(store)(localize(i18next)(PageView)) {
|
|
|
222
223
|
.sort()
|
|
223
224
|
]
|
|
224
225
|
},
|
|
225
|
-
imex: {
|
|
226
|
+
imex: {
|
|
227
|
+
header: i18next.t('field.type'),
|
|
228
|
+
key: 'type',
|
|
229
|
+
width: 50,
|
|
230
|
+
type: 'array',
|
|
231
|
+
arrData: Object.values(LOCATION_TYPE).map(type => {
|
|
232
|
+
return {
|
|
233
|
+
name: type.name
|
|
234
|
+
}
|
|
235
|
+
})
|
|
236
|
+
},
|
|
226
237
|
sortable: true,
|
|
227
238
|
width: 150
|
|
228
239
|
},
|
|
@@ -276,7 +287,17 @@ class LocationList extends connect(store)(localize(i18next)(PageView)) {
|
|
|
276
287
|
.sort()
|
|
277
288
|
]
|
|
278
289
|
},
|
|
279
|
-
imex: {
|
|
290
|
+
imex: {
|
|
291
|
+
header: i18next.t('field.status'),
|
|
292
|
+
key: 'status',
|
|
293
|
+
width: 50,
|
|
294
|
+
type: 'array',
|
|
295
|
+
arrData: Object.values(LOCATION_STATUS).map(type => {
|
|
296
|
+
return {
|
|
297
|
+
name: type.name
|
|
298
|
+
}
|
|
299
|
+
})
|
|
300
|
+
},
|
|
280
301
|
sortable: true,
|
|
281
302
|
width: 80
|
|
282
303
|
},
|
|
@@ -392,55 +413,23 @@ class LocationList extends connect(store)(localize(i18next)(PageView)) {
|
|
|
392
413
|
}
|
|
393
414
|
|
|
394
415
|
async importHandler(patches) {
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
}
|
|
400
|
-
return patch
|
|
401
|
-
})
|
|
402
|
-
const response = await client.mutate({
|
|
403
|
-
mutation: gql`
|
|
404
|
-
mutation updateMultipleLocation($patches: [LocationPatch!]!) {
|
|
405
|
-
updateMultipleLocation(patches: $patches) {
|
|
406
|
-
name
|
|
407
|
-
}
|
|
408
|
-
}
|
|
409
|
-
`,
|
|
410
|
-
variables: {
|
|
411
|
-
patches
|
|
412
|
-
}
|
|
413
|
-
})
|
|
414
|
-
|
|
415
|
-
if (!response.errors) {
|
|
416
|
-
history.back()
|
|
417
|
-
this._clearTempLocation()
|
|
418
|
-
document.dispatchEvent(
|
|
419
|
-
new CustomEvent('notify', {
|
|
420
|
-
detail: {
|
|
421
|
-
message: i18next.t('text.data_imported_successfully')
|
|
422
|
-
}
|
|
423
|
-
})
|
|
416
|
+
try {
|
|
417
|
+
if (
|
|
418
|
+
patches.some(
|
|
419
|
+
p => (!p.name || !p.type || !p.zone || !p.row || !p.column || !p.shelf || !p.status) && p.cuFlag == '+'
|
|
424
420
|
)
|
|
421
|
+
) {
|
|
422
|
+
throw new Error(i18next.t('text.empty_value_in_list'))
|
|
425
423
|
}
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
}
|
|
436
|
-
return patch
|
|
437
|
-
})
|
|
438
|
-
|
|
439
|
-
try {
|
|
440
|
-
this.dataGrist.showSpinner()
|
|
441
|
-
|
|
442
|
-
const response = await client.query({
|
|
443
|
-
query: gql`
|
|
424
|
+
if (patches && patches.length) {
|
|
425
|
+
patches = patches.map(patch => {
|
|
426
|
+
if (this._warehouseId) {
|
|
427
|
+
patch.warehouse = { id: this._warehouseId }
|
|
428
|
+
}
|
|
429
|
+
return patch
|
|
430
|
+
})
|
|
431
|
+
const response = await client.mutate({
|
|
432
|
+
mutation: gql`
|
|
444
433
|
mutation updateMultipleLocation($patches: [LocationPatch!]!) {
|
|
445
434
|
updateMultipleLocation(patches: $patches) {
|
|
446
435
|
name
|
|
@@ -453,27 +442,82 @@ class LocationList extends connect(store)(localize(i18next)(PageView)) {
|
|
|
453
442
|
})
|
|
454
443
|
|
|
455
444
|
if (!response.errors) {
|
|
445
|
+
history.back()
|
|
456
446
|
this._clearTempLocation()
|
|
457
447
|
document.dispatchEvent(
|
|
458
448
|
new CustomEvent('notify', {
|
|
459
449
|
detail: {
|
|
460
|
-
message: i18next.t('text.
|
|
450
|
+
message: i18next.t('text.data_imported_successfully')
|
|
461
451
|
}
|
|
462
452
|
})
|
|
463
453
|
)
|
|
464
454
|
}
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
455
|
+
}
|
|
456
|
+
} catch (e) {
|
|
457
|
+
showToast(e)
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
async _saveLocation() {
|
|
462
|
+
try {
|
|
463
|
+
let patches = this.dataGrist.exportPatchList({ flagName: 'cuFlag' })
|
|
464
|
+
|
|
465
|
+
if (
|
|
466
|
+
patches.some(
|
|
467
|
+
p => (!p.name || !p.type || !p.zone || !p.row || !p.column || !p.shelf || !p.status) && p.cuFlag == '+'
|
|
468
|
+
)
|
|
469
|
+
) {
|
|
470
|
+
throw new Error(i18next.t('text.empty_value_in_list'))
|
|
471
|
+
}
|
|
472
|
+
if (patches && patches.length) {
|
|
473
|
+
patches = patches.map(patch => {
|
|
474
|
+
if (this._warehouseId && !patch.warehouse) {
|
|
475
|
+
patch.warehouse = { id: this._warehouseId }
|
|
476
|
+
}
|
|
477
|
+
return patch
|
|
478
|
+
})
|
|
479
|
+
|
|
480
|
+
try {
|
|
481
|
+
this.dataGrist.showSpinner()
|
|
482
|
+
|
|
483
|
+
const response = await client.query({
|
|
484
|
+
query: gql`
|
|
485
|
+
mutation updateMultipleLocation($patches: [LocationPatch!]!) {
|
|
486
|
+
updateMultipleLocation(patches: $patches) {
|
|
487
|
+
name
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
`,
|
|
491
|
+
variables: {
|
|
492
|
+
patches
|
|
471
493
|
}
|
|
472
494
|
})
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
495
|
+
|
|
496
|
+
if (!response.errors) {
|
|
497
|
+
this._clearTempLocation()
|
|
498
|
+
document.dispatchEvent(
|
|
499
|
+
new CustomEvent('notify', {
|
|
500
|
+
detail: {
|
|
501
|
+
message: i18next.t('text.data_updated_successfully')
|
|
502
|
+
}
|
|
503
|
+
})
|
|
504
|
+
)
|
|
505
|
+
}
|
|
506
|
+
} catch (e) {
|
|
507
|
+
document.dispatchEvent(
|
|
508
|
+
new CustomEvent('notify', {
|
|
509
|
+
detail: {
|
|
510
|
+
level: error,
|
|
511
|
+
message: e
|
|
512
|
+
}
|
|
513
|
+
})
|
|
514
|
+
)
|
|
515
|
+
} finally {
|
|
516
|
+
this.dataGrist.hideSpinner()
|
|
517
|
+
}
|
|
476
518
|
}
|
|
519
|
+
} catch (e) {
|
|
520
|
+
showToast(e)
|
|
477
521
|
}
|
|
478
522
|
}
|
|
479
523
|
|
|
@@ -506,15 +550,12 @@ class LocationList extends connect(store)(localize(i18next)(PageView)) {
|
|
|
506
550
|
ids = []
|
|
507
551
|
this._clearTempLocation()
|
|
508
552
|
}
|
|
509
|
-
} else
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
}
|
|
516
|
-
})
|
|
517
|
-
)
|
|
553
|
+
} else {
|
|
554
|
+
CustomAlert({
|
|
555
|
+
title: i18next.t('text.nothing_selected'),
|
|
556
|
+
text: i18next.t('text.there_is_nothing_to_delete')
|
|
557
|
+
})
|
|
558
|
+
}
|
|
518
559
|
}
|
|
519
560
|
}
|
|
520
561
|
})
|
|
@@ -12,6 +12,7 @@ import { openPopup } from '@things-factory/layout-base'
|
|
|
12
12
|
import { REUSABLE_PALLET_LABEL_SETTING_KEY } from '../constants'
|
|
13
13
|
import { DirectPrinter } from '@things-factory/barcode-base'
|
|
14
14
|
import gql from 'graphql-tag'
|
|
15
|
+
import { showToast } from '../../util/index'
|
|
15
16
|
|
|
16
17
|
class PalletList extends connect(store)(localize(i18next)(PageView)) {
|
|
17
18
|
static get properties() {
|
|
@@ -125,6 +126,7 @@ class PalletList extends connect(store)(localize(i18next)(PageView)) {
|
|
|
125
126
|
fields: ['name', 'owner', 'holder', 'status']
|
|
126
127
|
},
|
|
127
128
|
rows: { selectable: { multiple: true } },
|
|
129
|
+
pagination: { limit: 50, pages: [50, 100, 200, 500] },
|
|
128
130
|
columns: [
|
|
129
131
|
{ type: 'gutter', gutterName: 'dirty' },
|
|
130
132
|
{ type: 'gutter', gutterName: 'sequence' },
|
|
@@ -144,7 +146,7 @@ class PalletList extends connect(store)(localize(i18next)(PageView)) {
|
|
|
144
146
|
type: 'object',
|
|
145
147
|
name: 'owner',
|
|
146
148
|
header: i18next.t('field.owner'),
|
|
147
|
-
imex: { header: i18next.t('field.owner'), key: 'owner.name', width: 50, type: '
|
|
149
|
+
imex: { header: i18next.t('field.owner'), key: 'owner.name', width: 50, type: 'array', arrData: [] },
|
|
148
150
|
record: {
|
|
149
151
|
editable: true,
|
|
150
152
|
options: {
|
|
@@ -158,7 +160,13 @@ class PalletList extends connect(store)(localize(i18next)(PageView)) {
|
|
|
158
160
|
type: 'object',
|
|
159
161
|
name: 'holder',
|
|
160
162
|
header: i18next.t('field.holder'),
|
|
161
|
-
imex: {
|
|
163
|
+
imex: {
|
|
164
|
+
header: i18next.t('field.holder'),
|
|
165
|
+
key: 'holder.name',
|
|
166
|
+
width: 50,
|
|
167
|
+
type: 'array',
|
|
168
|
+
arrData: []
|
|
169
|
+
},
|
|
162
170
|
record: {
|
|
163
171
|
editable: true,
|
|
164
172
|
options: {
|
|
@@ -172,7 +180,17 @@ class PalletList extends connect(store)(localize(i18next)(PageView)) {
|
|
|
172
180
|
type: 'code',
|
|
173
181
|
name: 'status',
|
|
174
182
|
header: i18next.t('field.status'),
|
|
175
|
-
imex: {
|
|
183
|
+
imex: {
|
|
184
|
+
header: i18next.t('field.status'),
|
|
185
|
+
key: 'status',
|
|
186
|
+
width: 50,
|
|
187
|
+
type: 'array',
|
|
188
|
+
arrData: _palletStatus.map(status => {
|
|
189
|
+
return {
|
|
190
|
+
name: status.name
|
|
191
|
+
}
|
|
192
|
+
})
|
|
193
|
+
},
|
|
176
194
|
record: {
|
|
177
195
|
editable: true,
|
|
178
196
|
codeName: 'PALLET_STATUS'
|
|
@@ -272,85 +290,75 @@ class PalletList extends connect(store)(localize(i18next)(PageView)) {
|
|
|
272
290
|
}
|
|
273
291
|
|
|
274
292
|
async importHandler(patches) {
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
mutation updateMultiplePallet($patches: [PalletPatch!]!) {
|
|
279
|
-
updateMultiplePallet(patches: $patches) {
|
|
280
|
-
name
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
`,
|
|
284
|
-
variables: {
|
|
285
|
-
patches
|
|
286
|
-
}
|
|
287
|
-
})
|
|
288
|
-
if (!response.errors) {
|
|
289
|
-
history.back()
|
|
290
|
-
this.dataGrist.fetch()
|
|
291
|
-
document.dispatchEvent(
|
|
292
|
-
new CustomEvent('notify', {
|
|
293
|
-
detail: {
|
|
294
|
-
message: i18next.t('text.data_imported_successfully')
|
|
295
|
-
}
|
|
296
|
-
})
|
|
297
|
-
)
|
|
298
|
-
}
|
|
299
|
-
this.dataGrist.hideSpinner()
|
|
300
|
-
}
|
|
293
|
+
try {
|
|
294
|
+
if (patches.some(p => (!p.name || !p.owner || !p.holder || !p.status) && p.cuFlag == '+'))
|
|
295
|
+
throw new Error(i18next.t('text.empty_value_in_list'))
|
|
301
296
|
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
if (patches && patches.length) {
|
|
297
|
+
patches = patches.map(p => {
|
|
298
|
+
return { ...p, cuFlag: '' }
|
|
299
|
+
})
|
|
306
300
|
this.dataGrist.showSpinner()
|
|
307
|
-
const response = await client.
|
|
308
|
-
|
|
301
|
+
const response = await client.query({
|
|
302
|
+
query: gql`
|
|
309
303
|
mutation updateMultiplePallet($patches: [PalletPatch!]!) {
|
|
310
|
-
updateMultiplePallet(patches: $patches)
|
|
311
|
-
name
|
|
312
|
-
}
|
|
304
|
+
updateMultiplePallet(patches: $patches)
|
|
313
305
|
}
|
|
314
306
|
`,
|
|
315
307
|
variables: {
|
|
316
308
|
patches
|
|
317
309
|
}
|
|
318
310
|
})
|
|
319
|
-
|
|
320
311
|
if (!response.errors) {
|
|
312
|
+
history.back()
|
|
321
313
|
this.dataGrist.fetch()
|
|
322
314
|
document.dispatchEvent(
|
|
323
315
|
new CustomEvent('notify', {
|
|
324
316
|
detail: {
|
|
325
|
-
message: i18next.t('text.
|
|
317
|
+
message: i18next.t('text.data_imported_successfully')
|
|
326
318
|
}
|
|
327
319
|
})
|
|
328
320
|
)
|
|
329
321
|
}
|
|
330
322
|
this.dataGrist.hideSpinner()
|
|
323
|
+
} catch (e) {
|
|
324
|
+
showToast(e)
|
|
331
325
|
}
|
|
332
326
|
}
|
|
333
327
|
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
new CustomEvent('notify', {
|
|
348
|
-
detail: {
|
|
349
|
-
message: i18next.t('text.holder_field_is_empty')
|
|
328
|
+
async _savePallet() {
|
|
329
|
+
try {
|
|
330
|
+
let patches = this.dataGrist.exportPatchList({ flagName: 'cuFlag' })
|
|
331
|
+
|
|
332
|
+
if (patches.some(p => (!p.name || !p.owner || !p.holder || !p.status) && p.cuFlag == '+'))
|
|
333
|
+
throw new Error(i18next.t('text.empty_value_in_list'))
|
|
334
|
+
|
|
335
|
+
if (patches && patches.length) {
|
|
336
|
+
this.dataGrist.showSpinner()
|
|
337
|
+
const response = await client.mutate({
|
|
338
|
+
mutation: gql`
|
|
339
|
+
mutation updateMultiplePallet($patches: [PalletPatch!]!) {
|
|
340
|
+
updateMultiplePallet(patches: $patches)
|
|
350
341
|
}
|
|
351
|
-
|
|
352
|
-
|
|
342
|
+
`,
|
|
343
|
+
variables: {
|
|
344
|
+
patches
|
|
345
|
+
}
|
|
346
|
+
})
|
|
347
|
+
|
|
348
|
+
if (!response.errors) {
|
|
349
|
+
this.dataGrist.fetch()
|
|
350
|
+
document.dispatchEvent(
|
|
351
|
+
new CustomEvent('notify', {
|
|
352
|
+
detail: {
|
|
353
|
+
message: i18next.t('text.data_updated_successfully')
|
|
354
|
+
}
|
|
355
|
+
})
|
|
356
|
+
)
|
|
357
|
+
}
|
|
358
|
+
this.dataGrist.hideSpinner()
|
|
353
359
|
}
|
|
360
|
+
} catch (e) {
|
|
361
|
+
showToast(e)
|
|
354
362
|
}
|
|
355
363
|
}
|
|
356
364
|
|
|
@@ -385,6 +393,11 @@ class PalletList extends connect(store)(localize(i18next)(PageView)) {
|
|
|
385
393
|
})
|
|
386
394
|
)
|
|
387
395
|
}
|
|
396
|
+
} else {
|
|
397
|
+
CustomAlert({
|
|
398
|
+
title: i18next.t('text.nothing_selected'),
|
|
399
|
+
text: i18next.t('text.there_is_nothing_to_delete')
|
|
400
|
+
})
|
|
388
401
|
}
|
|
389
402
|
this.dataGrist.hideSpinner()
|
|
390
403
|
}
|
|
@@ -410,6 +423,23 @@ class PalletList extends connect(store)(localize(i18next)(PageView)) {
|
|
|
410
423
|
return column.imex
|
|
411
424
|
})
|
|
412
425
|
|
|
426
|
+
let holders = this.dataGrist.data.records.map(r => r.holder)
|
|
427
|
+
let owners = this.dataGrist.data.records.map(r => r.owner)
|
|
428
|
+
|
|
429
|
+
headerSetting = headerSetting.map(column => {
|
|
430
|
+
switch (column.key) {
|
|
431
|
+
case 'holder.name':
|
|
432
|
+
column.arrData = holders
|
|
433
|
+
break
|
|
434
|
+
case 'owner.name':
|
|
435
|
+
column.arrData = owners
|
|
436
|
+
break
|
|
437
|
+
default:
|
|
438
|
+
break
|
|
439
|
+
}
|
|
440
|
+
return column
|
|
441
|
+
})
|
|
442
|
+
|
|
413
443
|
var data = records.map(item => {
|
|
414
444
|
return {
|
|
415
445
|
id: item.id,
|
|
@@ -171,7 +171,7 @@ export class ProductDetailsPopup extends localize(i18next)(LitElement) {
|
|
|
171
171
|
{
|
|
172
172
|
type: 'select',
|
|
173
173
|
name: 'packingType',
|
|
174
|
-
header: i18next.t('field.packing_type')
|
|
174
|
+
header: `*${i18next.t('field.packing_type')}`,
|
|
175
175
|
record: {
|
|
176
176
|
editable: true,
|
|
177
177
|
options: ['', ...Object.keys(packingType).map(key => packingType[key].name)]
|
|
@@ -185,14 +185,14 @@ export class ProductDetailsPopup extends localize(i18next)(LitElement) {
|
|
|
185
185
|
editable: true,
|
|
186
186
|
options: ['', ...Object.keys(uom).map(key => uom[key].name)]
|
|
187
187
|
},
|
|
188
|
-
header:
|
|
188
|
+
header: `*${i18next.t('field.uom')}`,
|
|
189
189
|
width: 80
|
|
190
190
|
},
|
|
191
191
|
{
|
|
192
192
|
type: 'float',
|
|
193
193
|
name: 'uomValue',
|
|
194
194
|
record: { editable: true, options: { min: 0 } },
|
|
195
|
-
header:
|
|
195
|
+
header: `*${i18next.t('field.uom_value')}`,
|
|
196
196
|
width: 100
|
|
197
197
|
},
|
|
198
198
|
{
|