@things-factory/operato-wms 4.3.136 → 4.3.138

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 (77) hide show
  1. package/client/pages/adjustment/transfer-inventory.js +14 -6
  2. package/client/pages/bulk-operation/bulk-operation.js +3 -1
  3. package/client/pages/components/select-inventory-popup.js +7 -1
  4. package/client/pages/components/select-product-popup.js +33 -3
  5. package/client/pages/constants/order.js +3 -1
  6. package/client/pages/inbound/external-return-worksheet.js +39 -2
  7. package/client/pages/inbound/undo-putaway-popup.js +5 -9
  8. package/client/pages/inbound/undo-unload-popup.js +42 -35
  9. package/client/pages/inbound/unload-product.js +79 -69
  10. package/client/pages/inventory/inventory-adjustment-approval.js +4 -5
  11. package/client/pages/inventory/inventory-adjustment.js +56 -2
  12. package/client/pages/inventory/inventory-by-product-detail.js +23 -17
  13. package/client/pages/inventory/inventory-by-product.js +7 -0
  14. package/client/pages/inventory/inventory-history-by-pallet.js +14 -5
  15. package/client/pages/inventory/inventory-history.js +10 -0
  16. package/client/pages/inventory-check/check-inventory-popup.js +1 -1
  17. package/client/pages/inventory-check/create-cycle-count.js +2 -3
  18. package/client/pages/inventory-check/inspecting-product.js +7 -3
  19. package/client/pages/manifest/create-loading-manifest.js +8 -1
  20. package/client/pages/manifest/loading-manifest-detail.js +7 -4
  21. package/client/pages/master/generate-location-list.js +30 -22
  22. package/client/pages/master/location-list.js +134 -71
  23. package/client/pages/master/pallet-list.js +137 -58
  24. package/client/pages/master/product/product-details-popup.js +3 -3
  25. package/client/pages/master/tote-list.js +40 -27
  26. package/client/pages/master/transport-driver.js +48 -41
  27. package/client/pages/master/transport-vehicle.js +45 -41
  28. package/client/pages/master/warehouse-list.js +56 -34
  29. package/client/pages/order/arrival-notice/arrival-notice-detail.js +36 -25
  30. package/client/pages/order/arrival-notice/create-arrival-notice.js +78 -95
  31. package/client/pages/order/arrival-notice/duplicate-arrival-notice.js +2 -0
  32. package/client/pages/order/arrival-notice/edit-product-popup.js +10 -8
  33. package/client/pages/order/draft-release-good/draft-release-good-detail.js +88 -4
  34. package/client/pages/order/draft-release-good/draft-release-good-list.js +1 -1
  35. package/client/pages/order/release-order/create-release-order.js +34 -9
  36. package/client/pages/order/release-order/release-extra-product-popup.js +4 -1
  37. package/client/pages/order/release-order/release-order-detail.js +40 -3
  38. package/client/pages/order/return-order/create-return-order.js +5 -0
  39. package/client/pages/order/return-order/return-order-inventory-popup.js +1 -0
  40. package/client/pages/order/return-order/return-order-requests.js +37 -2
  41. package/client/pages/order/transport-order/delivery-note-popup.js +30 -24
  42. package/client/pages/order/transport-order/delivery-order-list.js +27 -1
  43. package/client/pages/outbound/inventory-reassign-popup.js +7 -3
  44. package/client/pages/outbound/packing-product.js +7 -7
  45. package/client/pages/outbound/packing-worksheet-list.js +3 -1
  46. package/client/pages/outbound/picking-product.js +18 -6
  47. package/client/pages/outbound/serial-number-popup.js +1 -1
  48. package/client/pages/outbound/show-my-worksheet-list-popup.js +12 -3
  49. package/client/pages/report/custom-elccl/elccl-daily-collection-report.js +5 -2
  50. package/client/pages/report/custom-elccl/elccl-daily-order-inventory-report.js +2 -2
  51. package/client/pages/report/custom-elccl/elccl-delivery-order-summary.js +34 -8
  52. package/client/pages/report/custom-elccl/elccl-inventory-pallet-detail-report.js +42 -4
  53. package/client/pages/report/custom-elccl/elccl-inventory-summary-report.js +46 -4
  54. package/client/pages/report/volume-summary-report.js +8 -3
  55. package/config.development.js +28 -21
  56. package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-report.js +6 -5
  57. package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-report.js.map +1 -1
  58. package/dist-server/graphql/resolvers/other/add-release-good-products.js +7 -11
  59. package/dist-server/graphql/resolvers/other/add-release-good-products.js.map +1 -1
  60. package/dist-server/graphql/resolvers/reports/costing-report.js +18 -24
  61. package/dist-server/graphql/resolvers/reports/costing-report.js.map +1 -1
  62. package/dist-server/graphql/resolvers/reports/inbound-order-details-report.js +6 -6
  63. package/dist-server/graphql/resolvers/reports/outbound-order-details-report.js +8 -9
  64. package/dist-server/graphql/resolvers/reports/outbound-order-details-report.js.map +1 -1
  65. package/dist-server/graphql/resolvers/reports/release-inventory-report.js +3 -3
  66. package/dist-server/graphql/resolvers/reports/release-inventory-report.js.map +1 -1
  67. package/package.json +24 -24
  68. package/server/graphql/resolvers/custom/elccl/elccl-inventory-history-report.ts +6 -5
  69. package/server/graphql/resolvers/other/add-release-good-products.ts +8 -12
  70. package/server/graphql/resolvers/reports/costing-report.ts +18 -24
  71. package/server/graphql/resolvers/reports/inbound-order-details-report.ts +6 -6
  72. package/server/graphql/resolvers/reports/outbound-order-details-report.ts +8 -9
  73. package/server/graphql/resolvers/reports/release-inventory-report.ts +6 -4
  74. package/translations/en.json +28 -3
  75. package/translations/ko.json +26 -2
  76. package/translations/ms.json +26 -2
  77. 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'
@@ -15,7 +16,9 @@ import { client, CustomAlert, PageView, store } from '@things-factory/shell'
15
16
  import { CommonButtonStyles, ScrollbarStyles } from '@things-factory/styles'
16
17
  import { isMobileDevice } from '@things-factory/utils'
17
18
 
19
+ import { getCodeByName } from '@things-factory/code-base'
18
20
  import { LOCATION_LABEL_SETTING_KEY, LOCATION_STATUS, LOCATION_TYPE } from '../constants'
21
+ import { showToast } from '../../util'
19
22
 
20
23
  class LocationList extends connect(store)(localize(i18next)(PageView)) {
21
24
  static get styles() {
@@ -151,25 +154,25 @@ class LocationList extends connect(store)(localize(i18next)(PageView)) {
151
154
  label: i18next.t('field.zone'),
152
155
  name: 'zone',
153
156
  type: 'text',
154
- props: { searchOper: 'eq' }
157
+ props: { searchOper: 'i_like' }
155
158
  },
156
159
  {
157
160
  label: i18next.t('field.row'),
158
161
  name: 'row',
159
162
  type: 'text',
160
- props: { searchOper: 'eq' }
163
+ props: { searchOper: 'i_like' }
161
164
  },
162
165
  {
163
166
  label: i18next.t('field.column'),
164
167
  name: 'column',
165
168
  type: 'text',
166
- props: { searchOper: 'eq' }
169
+ props: { searchOper: 'i_like' }
167
170
  },
168
171
  {
169
172
  label: i18next.t('field.shelf'),
170
173
  name: 'shelf',
171
174
  type: 'text',
172
- props: { searchOper: 'eq' }
175
+ props: { searchOper: 'i_like' }
173
176
  },
174
177
  {
175
178
  label: i18next.t('field.status'),
@@ -191,8 +194,8 @@ class LocationList extends connect(store)(localize(i18next)(PageView)) {
191
194
  ]
192
195
 
193
196
  this.config = {
194
- pagination: { pages: [20, 50, 100, 200] },
195
197
  rows: { selectable: { multiple: true } },
198
+ pagination: { limit: 50, pages: [50, 100, 200, 500] },
196
199
  list: {
197
200
  fields: ['name', 'type', 'status']
198
201
  },
@@ -222,7 +225,17 @@ class LocationList extends connect(store)(localize(i18next)(PageView)) {
222
225
  .sort()
223
226
  ]
224
227
  },
225
- imex: { header: i18next.t('field.type'), key: 'type', width: 50, type: 'string' },
228
+ imex: {
229
+ header: i18next.t('field.type'),
230
+ key: 'type',
231
+ width: 50,
232
+ type: 'array',
233
+ arrData: Object.values(LOCATION_TYPE).map(type => {
234
+ return {
235
+ name: type.name
236
+ }
237
+ })
238
+ },
226
239
  sortable: true,
227
240
  width: 150
228
241
  },
@@ -276,7 +289,17 @@ class LocationList extends connect(store)(localize(i18next)(PageView)) {
276
289
  .sort()
277
290
  ]
278
291
  },
279
- imex: { header: i18next.t('field.status'), key: 'status', width: 50, type: 'string' },
292
+ imex: {
293
+ header: i18next.t('field.status'),
294
+ key: 'status',
295
+ width: 50,
296
+ type: 'array',
297
+ arrData: Object.values(LOCATION_STATUS).map(type => {
298
+ return {
299
+ name: type.name
300
+ }
301
+ })
302
+ },
280
303
  sortable: true,
281
304
  width: 80
282
305
  },
@@ -392,55 +415,41 @@ class LocationList extends connect(store)(localize(i18next)(PageView)) {
392
415
  }
393
416
 
394
417
  async importHandler(patches) {
395
- if (patches && patches.length) {
396
- patches = patches.map(patch => {
397
- if (this._warehouseId) {
398
- patch.warehouse = { id: this._warehouseId }
418
+ try {
419
+ let records = this.dataGrist.data.records
420
+ const locationType = await getCodeByName('LOCATION_TYPE')
421
+ const locationStatus = await getCodeByName('LOCATION_STATUS')
422
+ patches = patches.map(itm => {
423
+ // Error if there is an empty value
424
+ if (isEmpty(itm.name) || isEmpty(itm.type) || isEmpty(itm.zone) || isEmpty(itm.column) || isEmpty(itm.shelf) || isEmpty(itm.status) || '')
425
+ {
426
+ throw new Error(i18next.t('text.empty_value_in_list'))
399
427
  }
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
428
+ // Error if location name is already existed
429
+ if (records.find(exist => exist.name == itm.name)) {
430
+ throw new Error(i18next.t('text.location_name(s)_already_existed'))
412
431
  }
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
-
429
- async _saveLocation() {
430
- let patches = this.dataGrist.exportPatchList({ flagName: 'cuFlag' })
431
- if (patches && patches.length) {
432
- patches = patches.map(patch => {
433
- if (this._warehouseId && !patch.warehouse) {
434
- patch.warehouse = { id: this._warehouseId }
432
+ // Error if location status does not exist
433
+ let foundLocationType = locationType.find(exist => exist.name == itm.type)
434
+ if (!foundLocationType) {
435
+ throw new Error(i18next.t('text.location_type_does_not_exist'))
436
+ }
437
+ // Error if location type does not exist
438
+ let foundLocationStatus = locationStatus.find(exist => exist.name == itm.status)
439
+ if (!foundLocationStatus) {
440
+ throw new Error(i18next.t('text.location_status_does_not_exist'))
435
441
  }
436
- return patch
442
+ return itm
437
443
  })
438
-
439
- try {
440
- this.dataGrist.showSpinner()
441
-
442
- const response = await client.query({
443
- query: gql`
444
+ if (patches && patches.length) {
445
+ patches = patches.map(patch => {
446
+ if (this._warehouseId) {
447
+ patch.warehouse = { id: this._warehouseId }
448
+ }
449
+ return patch
450
+ })
451
+ const response = await client.mutate({
452
+ mutation: gql`
444
453
  mutation updateMultipleLocation($patches: [LocationPatch!]!) {
445
454
  updateMultipleLocation(patches: $patches) {
446
455
  name
@@ -453,27 +462,82 @@ class LocationList extends connect(store)(localize(i18next)(PageView)) {
453
462
  })
454
463
 
455
464
  if (!response.errors) {
465
+ history.back()
456
466
  this._clearTempLocation()
457
467
  document.dispatchEvent(
458
468
  new CustomEvent('notify', {
459
469
  detail: {
460
- message: i18next.t('text.data_updated_successfully')
470
+ message: i18next.t('text.data_imported_successfully')
461
471
  }
462
472
  })
463
473
  )
464
474
  }
465
- } catch (e) {
466
- document.dispatchEvent(
467
- new CustomEvent('notify', {
468
- detail: {
469
- level: error,
470
- message: e
475
+ }
476
+ } catch (e) {
477
+ showToast(e)
478
+ }
479
+ }
480
+
481
+ async _saveLocation() {
482
+ try {
483
+ let patches = this.dataGrist.exportPatchList({ flagName: 'cuFlag' })
484
+
485
+ if (
486
+ patches.some(
487
+ p => (!p.name || !p.type || !p.zone || !p.row || !p.column || !p.shelf || !p.status) && p.cuFlag == '+'
488
+ )
489
+ ) {
490
+ throw new Error(i18next.t('text.empty_value_in_list'))
491
+ }
492
+ if (patches && patches.length) {
493
+ patches = patches.map(patch => {
494
+ if (this._warehouseId && !patch.warehouse) {
495
+ patch.warehouse = { id: this._warehouseId }
496
+ }
497
+ return patch
498
+ })
499
+
500
+ try {
501
+ this.dataGrist.showSpinner()
502
+
503
+ const response = await client.query({
504
+ query: gql`
505
+ mutation updateMultipleLocation($patches: [LocationPatch!]!) {
506
+ updateMultipleLocation(patches: $patches) {
507
+ name
508
+ }
509
+ }
510
+ `,
511
+ variables: {
512
+ patches
471
513
  }
472
514
  })
473
- )
474
- } finally {
475
- this.dataGrist.hideSpinner()
515
+
516
+ if (!response.errors) {
517
+ this._clearTempLocation()
518
+ document.dispatchEvent(
519
+ new CustomEvent('notify', {
520
+ detail: {
521
+ message: i18next.t('text.data_updated_successfully')
522
+ }
523
+ })
524
+ )
525
+ }
526
+ } catch (e) {
527
+ document.dispatchEvent(
528
+ new CustomEvent('notify', {
529
+ detail: {
530
+ level: error,
531
+ message: e
532
+ }
533
+ })
534
+ )
535
+ } finally {
536
+ this.dataGrist.hideSpinner()
537
+ }
476
538
  }
539
+ } catch (e) {
540
+ showToast(e)
477
541
  }
478
542
  }
479
543
 
@@ -506,15 +570,12 @@ class LocationList extends connect(store)(localize(i18next)(PageView)) {
506
570
  ids = []
507
571
  this._clearTempLocation()
508
572
  }
509
- } else
510
- document.dispatchEvent(
511
- new CustomEvent('notify', {
512
- detail: {
513
- level: 'error',
514
- message: `${i18next.t('text.cannot_delete_unsaved_location(s)')}`
515
- }
516
- })
517
- )
573
+ } else {
574
+ CustomAlert({
575
+ title: i18next.t('text.nothing_selected'),
576
+ text: i18next.t('text.there_is_nothing_to_delete')
577
+ })
578
+ }
518
579
  }
519
580
  }
520
581
  })
@@ -555,6 +616,7 @@ class LocationList extends connect(store)(localize(i18next)(PageView)) {
555
616
  text: i18next.t('text.you_wont_be_able_to_revert_this'),
556
617
  type: 'warning',
557
618
  confirmButton: { text: i18next.t('button.delete_all'), color: '#22a6a7' },
619
+
558
620
  cancelButton: { text: i18next.t('button.cancel'), color: '#cfcfcf' },
559
621
  callback: async result => {
560
622
  if (result.value && name !== '') {
@@ -567,6 +629,7 @@ class LocationList extends connect(store)(localize(i18next)(PageView)) {
567
629
  variables: { warehouseId: this._warehouseId }
568
630
  })
569
631
  if (!response.errors) this._clearTempLocation()
632
+ this.showToast({ message: i18next.t('text.all_locations_are_deleted') })
570
633
  }
571
634
  }
572
635
  })
@@ -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: 'string' },
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: { header: i18next.t('field.holder'), key: 'holder.name', width: 50, type: 'string' },
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: { header: i18next.t('field.status'), key: 'status', width: 50, type: 'string' },
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
- this.dataGrist.showSpinner()
276
- const response = await client.query({
277
- query: gql`
278
- mutation updateMultiplePallet($patches: [PalletPatch!]!) {
279
- updateMultiplePallet(patches: $patches) {
280
- name
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
- 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
- }
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
- async _savePallet() {
303
- let patches = this.dataGrist.exportPatchList({ flagName: 'cuFlag' })
304
- this._validatePallet(patches)
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.mutate({
308
- mutation: gql`
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.data_updated_successfully')
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
- _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')
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: `${i18next.t('field.uom')}`,
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: `${i18next.t('field.uom_value')}`,
195
+ header: `*${i18next.t('field.uom_value')}`,
196
196
  width: 100
197
197
  },
198
198
  {