@things-factory/operato-wms 4.3.137 → 4.3.139
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/adjustment/transfer-inventory.js +14 -6
- package/client/pages/bulk-operation/bulk-operation.js +3 -1
- package/client/pages/components/select-inventory-popup.js +7 -1
- package/client/pages/components/select-product-popup.js +33 -3
- package/client/pages/constants/order.js +3 -1
- package/client/pages/inbound/external-return-worksheet.js +39 -2
- package/client/pages/inbound/undo-putaway-popup.js +5 -9
- package/client/pages/inbound/undo-unload-popup.js +42 -35
- package/client/pages/inbound/unload-product.js +79 -69
- package/client/pages/inventory/inventory-adjustment-approval.js +4 -5
- package/client/pages/inventory/inventory-adjustment.js +56 -2
- package/client/pages/inventory/inventory-by-product-detail.js +23 -17
- package/client/pages/inventory/inventory-by-product.js +7 -0
- package/client/pages/inventory/inventory-history-by-pallet.js +14 -5
- package/client/pages/inventory/inventory-history.js +10 -0
- package/client/pages/inventory-check/check-inventory-popup.js +1 -1
- package/client/pages/inventory-check/create-cycle-count.js +2 -3
- package/client/pages/inventory-check/inspecting-product.js +7 -3
- package/client/pages/manifest/create-loading-manifest.js +8 -1
- 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 +141 -70
- package/client/pages/master/pallet-list.js +137 -58
- package/client/pages/master/product/product-details-popup.js +3 -3
- package/client/pages/master/tote-list.js +40 -27
- package/client/pages/master/transport-driver.js +48 -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 +79 -97
- package/client/pages/order/arrival-notice/duplicate-arrival-notice.js +2 -0
- package/client/pages/order/arrival-notice/edit-product-popup.js +10 -8
- package/client/pages/order/draft-release-good/draft-release-good-detail.js +88 -4
- package/client/pages/order/draft-release-good/draft-release-good-list.js +1 -1
- package/client/pages/order/release-order/create-release-order.js +34 -9
- package/client/pages/order/release-order/release-extra-product-popup.js +4 -1
- package/client/pages/order/release-order/release-order-detail.js +40 -3
- package/client/pages/order/return-order/create-return-order.js +5 -0
- package/client/pages/order/return-order/return-order-inventory-popup.js +1 -0
- package/client/pages/order/return-order/return-order-requests.js +37 -2
- package/client/pages/order/transport-order/delivery-note-popup.js +30 -24
- package/client/pages/order/transport-order/delivery-order-list.js +27 -1
- package/client/pages/outbound/inventory-reassign-popup.js +7 -3
- package/client/pages/outbound/packing-product.js +7 -7
- package/client/pages/outbound/packing-worksheet-list.js +3 -1
- package/client/pages/outbound/picking-product.js +17 -5
- package/client/pages/outbound/serial-number-popup.js +1 -1
- package/client/pages/outbound/show-my-worksheet-list-popup.js +12 -3
- package/client/pages/report/custom-elccl/elccl-daily-collection-report.js +5 -2
- package/client/pages/report/custom-elccl/elccl-daily-order-inventory-report.js +2 -2
- package/client/pages/report/custom-elccl/elccl-delivery-order-summary.js +34 -8
- package/client/pages/report/custom-elccl/elccl-inventory-pallet-detail-report.js +42 -4
- package/client/pages/report/custom-elccl/elccl-inventory-summary-report.js +46 -4
- package/client/pages/report/volume-summary-report.js +8 -3
- package/config.development.js +28 -21
- package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-report.js +6 -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/inbound-serial-number-report.js +1 -1
- package/dist-server/graphql/resolvers/reports/outbound-order-details-report.js +8 -9
- package/dist-server/graphql/resolvers/reports/outbound-order-details-report.js.map +1 -1
- package/dist-server/graphql/resolvers/reports/release-inventory-report.js +3 -3
- package/dist-server/graphql/resolvers/reports/release-inventory-report.js.map +1 -1
- package/package.json +24 -24
- package/server/graphql/resolvers/custom/elccl/elccl-inventory-history-report.ts +6 -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/inbound-serial-number-report.ts +1 -1
- package/server/graphql/resolvers/reports/outbound-order-details-report.ts +8 -9
- package/server/graphql/resolvers/reports/release-inventory-report.ts +6 -4
- package/translations/en.json +28 -3
- package/translations/ko.json +26 -2
- package/translations/ms.json +26 -2
- package/translations/zh.json +26 -2
|
@@ -7,6 +7,7 @@ import './print-location-label'
|
|
|
7
7
|
import gql from 'graphql-tag'
|
|
8
8
|
import { css, html } from 'lit-element'
|
|
9
9
|
import { connect } from 'pwa-helpers/connect-mixin'
|
|
10
|
+
import isEmpty from 'lodash-es/isEmpty'
|
|
10
11
|
|
|
11
12
|
import { DirectPrinter } from '@things-factory/barcode-base'
|
|
12
13
|
import { i18next, localize } from '@things-factory/i18n-base'
|
|
@@ -16,6 +17,7 @@ import { CommonButtonStyles, ScrollbarStyles } from '@things-factory/styles'
|
|
|
16
17
|
import { isMobileDevice } from '@things-factory/utils'
|
|
17
18
|
|
|
18
19
|
import { LOCATION_LABEL_SETTING_KEY, LOCATION_STATUS, LOCATION_TYPE } from '../constants'
|
|
20
|
+
import { showToast } from '../../util'
|
|
19
21
|
|
|
20
22
|
class LocationList extends connect(store)(localize(i18next)(PageView)) {
|
|
21
23
|
static get styles() {
|
|
@@ -151,25 +153,25 @@ class LocationList extends connect(store)(localize(i18next)(PageView)) {
|
|
|
151
153
|
label: i18next.t('field.zone'),
|
|
152
154
|
name: 'zone',
|
|
153
155
|
type: 'text',
|
|
154
|
-
props: { searchOper: '
|
|
156
|
+
props: { searchOper: 'i_like' }
|
|
155
157
|
},
|
|
156
158
|
{
|
|
157
159
|
label: i18next.t('field.row'),
|
|
158
160
|
name: 'row',
|
|
159
161
|
type: 'text',
|
|
160
|
-
props: { searchOper: '
|
|
162
|
+
props: { searchOper: 'i_like' }
|
|
161
163
|
},
|
|
162
164
|
{
|
|
163
165
|
label: i18next.t('field.column'),
|
|
164
166
|
name: 'column',
|
|
165
167
|
type: 'text',
|
|
166
|
-
props: { searchOper: '
|
|
168
|
+
props: { searchOper: 'i_like' }
|
|
167
169
|
},
|
|
168
170
|
{
|
|
169
171
|
label: i18next.t('field.shelf'),
|
|
170
172
|
name: 'shelf',
|
|
171
173
|
type: 'text',
|
|
172
|
-
props: { searchOper: '
|
|
174
|
+
props: { searchOper: 'i_like' }
|
|
173
175
|
},
|
|
174
176
|
{
|
|
175
177
|
label: i18next.t('field.status'),
|
|
@@ -191,8 +193,8 @@ class LocationList extends connect(store)(localize(i18next)(PageView)) {
|
|
|
191
193
|
]
|
|
192
194
|
|
|
193
195
|
this.config = {
|
|
194
|
-
pagination: { pages: [20, 50, 100, 200] },
|
|
195
196
|
rows: { selectable: { multiple: true } },
|
|
197
|
+
pagination: { limit: 50, pages: [50, 100, 200, 500] },
|
|
196
198
|
list: {
|
|
197
199
|
fields: ['name', 'type', 'status']
|
|
198
200
|
},
|
|
@@ -222,7 +224,17 @@ class LocationList extends connect(store)(localize(i18next)(PageView)) {
|
|
|
222
224
|
.sort()
|
|
223
225
|
]
|
|
224
226
|
},
|
|
225
|
-
imex: {
|
|
227
|
+
imex: {
|
|
228
|
+
header: i18next.t('field.type'),
|
|
229
|
+
key: 'type',
|
|
230
|
+
width: 50,
|
|
231
|
+
type: 'array',
|
|
232
|
+
arrData: Object.values(LOCATION_TYPE).map(type => {
|
|
233
|
+
return {
|
|
234
|
+
name: type.name
|
|
235
|
+
}
|
|
236
|
+
})
|
|
237
|
+
},
|
|
226
238
|
sortable: true,
|
|
227
239
|
width: 150
|
|
228
240
|
},
|
|
@@ -276,7 +288,17 @@ class LocationList extends connect(store)(localize(i18next)(PageView)) {
|
|
|
276
288
|
.sort()
|
|
277
289
|
]
|
|
278
290
|
},
|
|
279
|
-
imex: {
|
|
291
|
+
imex: {
|
|
292
|
+
header: i18next.t('field.status'),
|
|
293
|
+
key: 'status',
|
|
294
|
+
width: 50,
|
|
295
|
+
type: 'array',
|
|
296
|
+
arrData: Object.values(LOCATION_STATUS).map(type => {
|
|
297
|
+
return {
|
|
298
|
+
name: type.name
|
|
299
|
+
}
|
|
300
|
+
})
|
|
301
|
+
},
|
|
280
302
|
sortable: true,
|
|
281
303
|
width: 80
|
|
282
304
|
},
|
|
@@ -392,55 +414,50 @@ class LocationList extends connect(store)(localize(i18next)(PageView)) {
|
|
|
392
414
|
}
|
|
393
415
|
|
|
394
416
|
async importHandler(patches) {
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
417
|
+
try {
|
|
418
|
+
let records = this.dataGrist.data.records
|
|
419
|
+
const locationType = Object.keys(LOCATION_TYPE)
|
|
420
|
+
const locationStatus = Object.keys(LOCATION_STATUS)
|
|
421
|
+
|
|
422
|
+
patches = patches.map(itm => {
|
|
423
|
+
// Error if there is an empty value
|
|
424
|
+
if (
|
|
425
|
+
isEmpty(itm.name) ||
|
|
426
|
+
isEmpty(itm.type) ||
|
|
427
|
+
isEmpty(itm.zone) ||
|
|
428
|
+
isEmpty(itm.column) ||
|
|
429
|
+
isEmpty(itm.shelf) ||
|
|
430
|
+
isEmpty(itm.status) ||
|
|
431
|
+
''
|
|
432
|
+
) {
|
|
433
|
+
throw new Error(i18next.t('text.empty_value_in_list'))
|
|
399
434
|
}
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
mutation: gql`
|
|
404
|
-
mutation updateMultipleLocation($patches: [LocationPatch!]!) {
|
|
405
|
-
updateMultipleLocation(patches: $patches) {
|
|
406
|
-
name
|
|
407
|
-
}
|
|
408
|
-
}
|
|
409
|
-
`,
|
|
410
|
-
variables: {
|
|
411
|
-
patches
|
|
435
|
+
// Error if location name is already existed
|
|
436
|
+
if (records.find(exist => exist.name == itm.name)) {
|
|
437
|
+
throw new Error(i18next.t('text.location_name(s)_already_existed'))
|
|
412
438
|
}
|
|
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
|
-
})
|
|
424
|
-
)
|
|
425
|
-
}
|
|
426
|
-
}
|
|
427
|
-
}
|
|
428
439
|
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
440
|
+
// Error if location status does not exist
|
|
441
|
+
let foundLocationType = locationType.find(exist => exist == itm.type)
|
|
442
|
+
if (!foundLocationType) {
|
|
443
|
+
throw new Error(i18next.t('text.location_type_does_not_exist'))
|
|
444
|
+
}
|
|
445
|
+
// Error if location type does not exist
|
|
446
|
+
let foundLocationStatus = locationStatus.find(exist => exist == itm.status)
|
|
447
|
+
if (!foundLocationStatus) {
|
|
448
|
+
throw new Error(i18next.t('text.location_status_does_not_exist'))
|
|
435
449
|
}
|
|
436
|
-
return
|
|
450
|
+
return itm
|
|
437
451
|
})
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
452
|
+
if (patches && patches.length) {
|
|
453
|
+
patches = patches.map(patch => {
|
|
454
|
+
if (this._warehouseId) {
|
|
455
|
+
patch.warehouse = { id: this._warehouseId }
|
|
456
|
+
}
|
|
457
|
+
return patch
|
|
458
|
+
})
|
|
459
|
+
const response = await client.mutate({
|
|
460
|
+
mutation: gql`
|
|
444
461
|
mutation updateMultipleLocation($patches: [LocationPatch!]!) {
|
|
445
462
|
updateMultipleLocation(patches: $patches) {
|
|
446
463
|
name
|
|
@@ -453,27 +470,82 @@ class LocationList extends connect(store)(localize(i18next)(PageView)) {
|
|
|
453
470
|
})
|
|
454
471
|
|
|
455
472
|
if (!response.errors) {
|
|
473
|
+
history.back()
|
|
456
474
|
this._clearTempLocation()
|
|
457
475
|
document.dispatchEvent(
|
|
458
476
|
new CustomEvent('notify', {
|
|
459
477
|
detail: {
|
|
460
|
-
message: i18next.t('text.
|
|
478
|
+
message: i18next.t('text.data_imported_successfully')
|
|
461
479
|
}
|
|
462
480
|
})
|
|
463
481
|
)
|
|
464
482
|
}
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
483
|
+
}
|
|
484
|
+
} catch (e) {
|
|
485
|
+
showToast(e)
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
async _saveLocation() {
|
|
490
|
+
try {
|
|
491
|
+
let patches = this.dataGrist.exportPatchList({ flagName: 'cuFlag' })
|
|
492
|
+
|
|
493
|
+
if (
|
|
494
|
+
patches.some(
|
|
495
|
+
p => (!p.name || !p.type || !p.zone || !p.row || !p.column || !p.shelf || !p.status) && p.cuFlag == '+'
|
|
496
|
+
)
|
|
497
|
+
) {
|
|
498
|
+
throw new Error(i18next.t('text.empty_value_in_list'))
|
|
499
|
+
}
|
|
500
|
+
if (patches && patches.length) {
|
|
501
|
+
patches = patches.map(patch => {
|
|
502
|
+
if (this._warehouseId && !patch.warehouse) {
|
|
503
|
+
patch.warehouse = { id: this._warehouseId }
|
|
504
|
+
}
|
|
505
|
+
return patch
|
|
506
|
+
})
|
|
507
|
+
|
|
508
|
+
try {
|
|
509
|
+
this.dataGrist.showSpinner()
|
|
510
|
+
|
|
511
|
+
const response = await client.query({
|
|
512
|
+
query: gql`
|
|
513
|
+
mutation updateMultipleLocation($patches: [LocationPatch!]!) {
|
|
514
|
+
updateMultipleLocation(patches: $patches) {
|
|
515
|
+
name
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
`,
|
|
519
|
+
variables: {
|
|
520
|
+
patches
|
|
471
521
|
}
|
|
472
522
|
})
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
523
|
+
|
|
524
|
+
if (!response.errors) {
|
|
525
|
+
this._clearTempLocation()
|
|
526
|
+
document.dispatchEvent(
|
|
527
|
+
new CustomEvent('notify', {
|
|
528
|
+
detail: {
|
|
529
|
+
message: i18next.t('text.data_updated_successfully')
|
|
530
|
+
}
|
|
531
|
+
})
|
|
532
|
+
)
|
|
533
|
+
}
|
|
534
|
+
} catch (e) {
|
|
535
|
+
document.dispatchEvent(
|
|
536
|
+
new CustomEvent('notify', {
|
|
537
|
+
detail: {
|
|
538
|
+
level: error,
|
|
539
|
+
message: e
|
|
540
|
+
}
|
|
541
|
+
})
|
|
542
|
+
)
|
|
543
|
+
} finally {
|
|
544
|
+
this.dataGrist.hideSpinner()
|
|
545
|
+
}
|
|
476
546
|
}
|
|
547
|
+
} catch (e) {
|
|
548
|
+
showToast(e)
|
|
477
549
|
}
|
|
478
550
|
}
|
|
479
551
|
|
|
@@ -506,15 +578,12 @@ class LocationList extends connect(store)(localize(i18next)(PageView)) {
|
|
|
506
578
|
ids = []
|
|
507
579
|
this._clearTempLocation()
|
|
508
580
|
}
|
|
509
|
-
} else
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
}
|
|
516
|
-
})
|
|
517
|
-
)
|
|
581
|
+
} else {
|
|
582
|
+
CustomAlert({
|
|
583
|
+
title: i18next.t('text.nothing_selected'),
|
|
584
|
+
text: i18next.t('text.there_is_nothing_to_delete')
|
|
585
|
+
})
|
|
586
|
+
}
|
|
518
587
|
}
|
|
519
588
|
}
|
|
520
589
|
})
|
|
@@ -555,6 +624,7 @@ class LocationList extends connect(store)(localize(i18next)(PageView)) {
|
|
|
555
624
|
text: i18next.t('text.you_wont_be_able_to_revert_this'),
|
|
556
625
|
type: 'warning',
|
|
557
626
|
confirmButton: { text: i18next.t('button.delete_all'), color: '#22a6a7' },
|
|
627
|
+
|
|
558
628
|
cancelButton: { text: i18next.t('button.cancel'), color: '#cfcfcf' },
|
|
559
629
|
callback: async result => {
|
|
560
630
|
if (result.value && name !== '') {
|
|
@@ -567,6 +637,7 @@ class LocationList extends connect(store)(localize(i18next)(PageView)) {
|
|
|
567
637
|
variables: { warehouseId: this._warehouseId }
|
|
568
638
|
})
|
|
569
639
|
if (!response.errors) this._clearTempLocation()
|
|
640
|
+
this.showToast({ message: i18next.t('text.all_locations_are_deleted') })
|
|
570
641
|
}
|
|
571
642
|
}
|
|
572
643
|
})
|
|
@@ -12,6 +12,8 @@ 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'
|
|
16
|
+
import isEmpty from 'lodash-es/isEmpty'
|
|
15
17
|
|
|
16
18
|
class PalletList extends connect(store)(localize(i18next)(PageView)) {
|
|
17
19
|
static get properties() {
|
|
@@ -125,6 +127,7 @@ class PalletList extends connect(store)(localize(i18next)(PageView)) {
|
|
|
125
127
|
fields: ['name', 'owner', 'holder', 'status']
|
|
126
128
|
},
|
|
127
129
|
rows: { selectable: { multiple: true } },
|
|
130
|
+
pagination: { limit: 50, pages: [50, 100, 200, 500] },
|
|
128
131
|
columns: [
|
|
129
132
|
{ type: 'gutter', gutterName: 'dirty' },
|
|
130
133
|
{ type: 'gutter', gutterName: 'sequence' },
|
|
@@ -144,7 +147,7 @@ class PalletList extends connect(store)(localize(i18next)(PageView)) {
|
|
|
144
147
|
type: 'object',
|
|
145
148
|
name: 'owner',
|
|
146
149
|
header: i18next.t('field.owner'),
|
|
147
|
-
imex: { header: i18next.t('field.owner'), key: 'owner.name', width: 50, type: '
|
|
150
|
+
imex: { header: i18next.t('field.owner'), key: 'owner.name', width: 50, type: 'array', arrData: [] },
|
|
148
151
|
record: {
|
|
149
152
|
editable: true,
|
|
150
153
|
options: {
|
|
@@ -158,7 +161,13 @@ class PalletList extends connect(store)(localize(i18next)(PageView)) {
|
|
|
158
161
|
type: 'object',
|
|
159
162
|
name: 'holder',
|
|
160
163
|
header: i18next.t('field.holder'),
|
|
161
|
-
imex: {
|
|
164
|
+
imex: {
|
|
165
|
+
header: i18next.t('field.holder'),
|
|
166
|
+
key: 'holder.name',
|
|
167
|
+
width: 50,
|
|
168
|
+
type: 'array',
|
|
169
|
+
arrData: []
|
|
170
|
+
},
|
|
162
171
|
record: {
|
|
163
172
|
editable: true,
|
|
164
173
|
options: {
|
|
@@ -172,7 +181,17 @@ class PalletList extends connect(store)(localize(i18next)(PageView)) {
|
|
|
172
181
|
type: 'code',
|
|
173
182
|
name: 'status',
|
|
174
183
|
header: i18next.t('field.status'),
|
|
175
|
-
imex: {
|
|
184
|
+
imex: {
|
|
185
|
+
header: i18next.t('field.status'),
|
|
186
|
+
key: 'status',
|
|
187
|
+
width: 50,
|
|
188
|
+
type: 'array',
|
|
189
|
+
arrData: _palletStatus.map(status => {
|
|
190
|
+
return {
|
|
191
|
+
name: status.name
|
|
192
|
+
}
|
|
193
|
+
})
|
|
194
|
+
},
|
|
176
195
|
record: {
|
|
177
196
|
editable: true,
|
|
178
197
|
codeName: 'PALLET_STATUS'
|
|
@@ -272,88 +291,125 @@ class PalletList extends connect(store)(localize(i18next)(PageView)) {
|
|
|
272
291
|
}
|
|
273
292
|
|
|
274
293
|
async importHandler(patches) {
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
294
|
+
try {
|
|
295
|
+
const _palletStatus = await getCodeByName('PALLET_STATUS')
|
|
296
|
+
const getBizplace = await this.fetchBizplaces()
|
|
297
|
+
let records = this.dataGrist.data.records
|
|
298
|
+
patches = patches.map(itm => {
|
|
299
|
+
// Error if there is an empty value
|
|
300
|
+
if (isEmpty(itm.name) || isEmpty(itm.status) || isEmpty(itm.holder.name) || isEmpty(itm.owner.name) || ''){
|
|
301
|
+
throw new Error(i18next.t('text.empty_value_in_list'))
|
|
282
302
|
}
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
303
|
+
// Error if location name is already existed
|
|
304
|
+
if (records.find(exist => exist.name == itm.name)) {
|
|
305
|
+
throw new Error(i18next.t('text.pallet_name(s)_is_already_existed'))
|
|
306
|
+
}
|
|
307
|
+
// Error if pallet status is does not exist
|
|
308
|
+
let foundPalletStatus = _palletStatus.find(exist => exist.name == itm.status)
|
|
309
|
+
if (!foundPalletStatus) {
|
|
310
|
+
throw new Error(i18next.t('text.pallet_status_does_not_exist'))
|
|
311
|
+
}
|
|
312
|
+
// Error if the owner is not belong to the domain or doesn't exist
|
|
313
|
+
let foundOwner = getBizplace.find(exist => exist.name == itm.owner.name)
|
|
314
|
+
if (!foundOwner){
|
|
315
|
+
throw new Error(i18next.t('text.invalid_owner'))
|
|
316
|
+
}
|
|
317
|
+
// Error if the holder is not belong to the domain or doesn't exist
|
|
318
|
+
let foundHolder = getBizplace.find(exist=>exist.name == itm.holder.name)
|
|
319
|
+
if (!foundHolder) {
|
|
320
|
+
throw new Error(i18next.t('text.invalid_holder'))
|
|
321
|
+
}
|
|
322
|
+
return itm
|
|
323
|
+
})
|
|
301
324
|
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
if (patches && patches.length) {
|
|
325
|
+
patches = patches.map(p => {
|
|
326
|
+
return { ...p, cuFlag: '' }
|
|
327
|
+
})
|
|
306
328
|
this.dataGrist.showSpinner()
|
|
307
|
-
const response = await client.
|
|
308
|
-
|
|
329
|
+
const response = await client.query({
|
|
330
|
+
query: gql`
|
|
309
331
|
mutation updateMultiplePallet($patches: [PalletPatch!]!) {
|
|
310
|
-
updateMultiplePallet(patches: $patches)
|
|
311
|
-
name
|
|
312
|
-
}
|
|
332
|
+
updateMultiplePallet(patches: $patches)
|
|
313
333
|
}
|
|
314
334
|
`,
|
|
315
335
|
variables: {
|
|
316
336
|
patches
|
|
317
337
|
}
|
|
318
338
|
})
|
|
319
|
-
|
|
320
339
|
if (!response.errors) {
|
|
340
|
+
history.back()
|
|
321
341
|
this.dataGrist.fetch()
|
|
322
342
|
document.dispatchEvent(
|
|
323
343
|
new CustomEvent('notify', {
|
|
324
344
|
detail: {
|
|
325
|
-
message: i18next.t('text.
|
|
345
|
+
message: i18next.t('text.data_imported_successfully')
|
|
326
346
|
}
|
|
327
347
|
})
|
|
328
348
|
)
|
|
329
349
|
}
|
|
330
350
|
this.dataGrist.hideSpinner()
|
|
351
|
+
} catch (e) {
|
|
352
|
+
showToast(e)
|
|
331
353
|
}
|
|
332
354
|
}
|
|
333
355
|
|
|
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')
|
|
356
|
+
async _savePallet() {
|
|
357
|
+
try {
|
|
358
|
+
let patches = this.dataGrist.exportPatchList({ flagName: 'cuFlag' })
|
|
359
|
+
|
|
360
|
+
if (patches.some(p => (!p.name || !p.owner || !p.holder || !p.status) && p.cuFlag == '+'))
|
|
361
|
+
throw new Error(i18next.t('text.empty_value_in_list'))
|
|
362
|
+
|
|
363
|
+
if (patches && patches.length) {
|
|
364
|
+
this.dataGrist.showSpinner()
|
|
365
|
+
const response = await client.mutate({
|
|
366
|
+
mutation: gql`
|
|
367
|
+
mutation updateMultiplePallet($patches: [PalletPatch!]!) {
|
|
368
|
+
updateMultiplePallet(patches: $patches)
|
|
350
369
|
}
|
|
351
|
-
|
|
352
|
-
|
|
370
|
+
`,
|
|
371
|
+
variables: {
|
|
372
|
+
patches
|
|
373
|
+
}
|
|
374
|
+
})
|
|
375
|
+
|
|
376
|
+
if (!response.errors) {
|
|
377
|
+
this.dataGrist.fetch()
|
|
378
|
+
document.dispatchEvent(
|
|
379
|
+
new CustomEvent('notify', {
|
|
380
|
+
detail: {
|
|
381
|
+
message: i18next.t('text.data_updated_successfully')
|
|
382
|
+
}
|
|
383
|
+
})
|
|
384
|
+
)
|
|
385
|
+
}
|
|
386
|
+
this.dataGrist.hideSpinner()
|
|
353
387
|
}
|
|
388
|
+
} catch (e) {
|
|
389
|
+
showToast(e)
|
|
354
390
|
}
|
|
355
391
|
}
|
|
356
392
|
|
|
393
|
+
async fetchBizplaces(bizplace = []) {
|
|
394
|
+
const response = await client.query({
|
|
395
|
+
query: gql`
|
|
396
|
+
query bizplaces($filters: [Filter!]) {
|
|
397
|
+
bizplaces(filters: $filters) {
|
|
398
|
+
items {
|
|
399
|
+
id
|
|
400
|
+
name
|
|
401
|
+
description
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
`,
|
|
406
|
+
variables: {
|
|
407
|
+
filters: [...bizplace]
|
|
408
|
+
}
|
|
409
|
+
})
|
|
410
|
+
return response.data.bizplaces.items
|
|
411
|
+
}
|
|
412
|
+
|
|
357
413
|
async _deletePallet() {
|
|
358
414
|
CustomAlert({
|
|
359
415
|
title: i18next.t('text.are_you_sure'),
|
|
@@ -385,6 +441,11 @@ class PalletList extends connect(store)(localize(i18next)(PageView)) {
|
|
|
385
441
|
})
|
|
386
442
|
)
|
|
387
443
|
}
|
|
444
|
+
} else {
|
|
445
|
+
CustomAlert({
|
|
446
|
+
title: i18next.t('text.nothing_selected'),
|
|
447
|
+
text: i18next.t('text.there_is_nothing_to_delete')
|
|
448
|
+
})
|
|
388
449
|
}
|
|
389
450
|
this.dataGrist.hideSpinner()
|
|
390
451
|
}
|
|
@@ -396,7 +457,7 @@ class PalletList extends connect(store)(localize(i18next)(PageView)) {
|
|
|
396
457
|
return this.config.columns
|
|
397
458
|
}
|
|
398
459
|
|
|
399
|
-
_exportableData() {
|
|
460
|
+
async _exportableData() {
|
|
400
461
|
let records = []
|
|
401
462
|
if (this.dataGrist.selected && this.dataGrist.selected.length > 0) {
|
|
402
463
|
records = this.dataGrist.selected
|
|
@@ -404,9 +465,27 @@ class PalletList extends connect(store)(localize(i18next)(PageView)) {
|
|
|
404
465
|
records = this.dataGrist.data.records
|
|
405
466
|
}
|
|
406
467
|
|
|
468
|
+
const getBizplace = await this.fetchBizplaces()
|
|
469
|
+
|
|
407
470
|
var headerSetting = this.dataGrist._config.columns
|
|
408
471
|
.filter(column => column.type !== 'gutter' && column.record !== undefined && column.imex !== undefined)
|
|
409
472
|
.map(column => {
|
|
473
|
+
if (column.imex.key == 'holder.name') {
|
|
474
|
+
column.imex.arrData = getBizplace.map(item => {
|
|
475
|
+
return {
|
|
476
|
+
id: item.id,
|
|
477
|
+
name: item.name
|
|
478
|
+
}
|
|
479
|
+
})
|
|
480
|
+
}
|
|
481
|
+
if (column.imex.key == 'owner.name') {
|
|
482
|
+
column.imex.arrData = getBizplace.map(item => {
|
|
483
|
+
return {
|
|
484
|
+
id: item.id,
|
|
485
|
+
name: item.name
|
|
486
|
+
}
|
|
487
|
+
})
|
|
488
|
+
}
|
|
410
489
|
return column.imex
|
|
411
490
|
})
|
|
412
491
|
|
|
@@ -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
|
{
|