@things-factory/operato-wms 4.3.108 → 4.3.110

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 (66) hide show
  1. package/client/pages/bulk-operation/bulk-operation.js +15 -9
  2. package/client/pages/components/select-inventory-popup.js +1 -7
  3. package/client/pages/components/select-product-popup.js +2 -31
  4. package/client/pages/inbound/undo-putaway-popup.js +9 -5
  5. package/client/pages/inbound/undo-unload-popup.js +2 -15
  6. package/client/pages/inbound/unload-product.js +67 -72
  7. package/client/pages/inventory/inventory-adjustment-approval.js +5 -4
  8. package/client/pages/inventory/inventory-adjustment.js +2 -9
  9. package/client/pages/inventory/inventory-by-product-detail.js +13 -13
  10. package/client/pages/inventory-check/check-inventory-popup.js +3 -14
  11. package/client/pages/inventory-check/create-cycle-count.js +3 -2
  12. package/client/pages/inventory-check/inspecting-product.js +7 -25
  13. package/client/pages/inventory-check/inventory-check-list.js +10 -94
  14. package/client/pages/manifest/loading-manifest-detail.js +4 -7
  15. package/client/pages/master/generate-location-list.js +22 -30
  16. package/client/pages/master/location-list.js +71 -134
  17. package/client/pages/master/pallet-list.js +58 -137
  18. package/client/pages/master/product/product-details-popup.js +3 -3
  19. package/client/pages/master/tote-list.js +27 -40
  20. package/client/pages/master/transport-driver.js +41 -50
  21. package/client/pages/master/transport-vehicle.js +41 -45
  22. package/client/pages/master/warehouse-list.js +34 -56
  23. package/client/pages/order/arrival-notice/arrival-notice-detail.js +25 -36
  24. package/client/pages/order/arrival-notice/create-arrival-notice.js +32 -53
  25. package/client/pages/order/arrival-notice/duplicate-arrival-notice.js +0 -2
  26. package/client/pages/order/arrival-notice/edit-product-popup.js +7 -9
  27. package/client/pages/order/draft-release-good/draft-release-good-detail.js +4 -79
  28. package/client/pages/order/release-order/create-release-order.js +5 -22
  29. package/client/pages/order/release-order/release-extra-product-popup.js +1 -4
  30. package/client/pages/order/release-order/release-order-detail.js +0 -24
  31. package/client/pages/order/return-order/create-return-order.js +0 -5
  32. package/client/pages/order/return-order/return-order-inventory-popup.js +0 -1
  33. package/client/pages/order/transport-order/delivery-order-list.js +0 -26
  34. package/client/pages/outbound/inventory-reassign-popup.js +0 -6
  35. package/client/pages/outbound/packing-product.js +5 -5
  36. package/client/pages/outbound/packing-worksheet-list.js +1 -3
  37. package/client/pages/outbound/picking-product.js +7 -18
  38. package/client/pages/outbound/show-my-worksheet-list-popup.js +3 -12
  39. package/client/pages/report/custom-elccl/elccl-daily-collection-report.js +2 -5
  40. package/client/pages/report/custom-elccl/elccl-daily-order-inventory-report.js +2 -2
  41. package/client/pages/report/custom-elccl/elccl-delivery-order-summary.js +8 -48
  42. package/client/pages/report/custom-elccl/elccl-inventory-pallet-detail-report.js +4 -42
  43. package/client/pages/vas/print-product-label.js +11 -13
  44. package/config.development.js +1 -1
  45. package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-report.js +5 -6
  46. package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-report.js.map +1 -1
  47. package/dist-server/graphql/resolvers/other/add-release-good-products.js +11 -7
  48. package/dist-server/graphql/resolvers/other/add-release-good-products.js.map +1 -1
  49. package/dist-server/graphql/resolvers/reports/costing-report.js +24 -18
  50. package/dist-server/graphql/resolvers/reports/costing-report.js.map +1 -1
  51. package/dist-server/graphql/resolvers/reports/inbound-order-details-report.js +6 -6
  52. package/dist-server/graphql/resolvers/reports/outbound-order-details-report.js +6 -5
  53. package/dist-server/graphql/resolvers/reports/outbound-order-details-report.js.map +1 -1
  54. package/dist-server/graphql/resolvers/reports/release-inventory-report.js +3 -3
  55. package/dist-server/graphql/resolvers/reports/release-inventory-report.js.map +1 -1
  56. package/package.json +50 -50
  57. package/server/graphql/resolvers/custom/elccl/elccl-inventory-history-report.ts +5 -6
  58. package/server/graphql/resolvers/other/add-release-good-products.ts +12 -8
  59. package/server/graphql/resolvers/reports/costing-report.ts +24 -18
  60. package/server/graphql/resolvers/reports/inbound-order-details-report.ts +6 -6
  61. package/server/graphql/resolvers/reports/outbound-order-details-report.ts +6 -5
  62. package/server/graphql/resolvers/reports/release-inventory-report.ts +4 -6
  63. package/translations/en.json +13 -43
  64. package/translations/ko.json +11 -33
  65. package/translations/ms.json +11 -33
  66. package/translations/zh.json +4 -26
@@ -12,8 +12,6 @@ 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'
17
15
 
18
16
  class PalletList extends connect(store)(localize(i18next)(PageView)) {
19
17
  static get properties() {
@@ -127,7 +125,6 @@ class PalletList extends connect(store)(localize(i18next)(PageView)) {
127
125
  fields: ['name', 'owner', 'holder', 'status']
128
126
  },
129
127
  rows: { selectable: { multiple: true } },
130
- pagination: { limit: 50, pages: [50, 100, 200, 500] },
131
128
  columns: [
132
129
  { type: 'gutter', gutterName: 'dirty' },
133
130
  { type: 'gutter', gutterName: 'sequence' },
@@ -147,7 +144,7 @@ class PalletList extends connect(store)(localize(i18next)(PageView)) {
147
144
  type: 'object',
148
145
  name: 'owner',
149
146
  header: i18next.t('field.owner'),
150
- imex: { header: i18next.t('field.owner'), key: 'owner.name', width: 50, type: 'array', arrData: [] },
147
+ imex: { header: i18next.t('field.owner'), key: 'owner.name', width: 50, type: 'string' },
151
148
  record: {
152
149
  editable: true,
153
150
  options: {
@@ -161,13 +158,7 @@ class PalletList extends connect(store)(localize(i18next)(PageView)) {
161
158
  type: 'object',
162
159
  name: 'holder',
163
160
  header: i18next.t('field.holder'),
164
- imex: {
165
- header: i18next.t('field.holder'),
166
- key: 'holder.name',
167
- width: 50,
168
- type: 'array',
169
- arrData: []
170
- },
161
+ imex: { header: i18next.t('field.holder'), key: 'holder.name', width: 50, type: 'string' },
171
162
  record: {
172
163
  editable: true,
173
164
  options: {
@@ -181,17 +172,7 @@ class PalletList extends connect(store)(localize(i18next)(PageView)) {
181
172
  type: 'code',
182
173
  name: 'status',
183
174
  header: i18next.t('field.status'),
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
- },
175
+ imex: { header: i18next.t('field.status'), key: 'status', width: 50, type: 'string' },
195
176
  record: {
196
177
  editable: true,
197
178
  codeName: 'PALLET_STATUS'
@@ -291,125 +272,88 @@ class PalletList extends connect(store)(localize(i18next)(PageView)) {
291
272
  }
292
273
 
293
274
  async importHandler(patches) {
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'))
302
- }
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'))
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
+ }
321
282
  }
322
- return itm
323
- })
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
+ }
324
301
 
325
- patches = patches.map(p => {
326
- return { ...p, cuFlag: '' }
327
- })
302
+ async _savePallet() {
303
+ let patches = this.dataGrist.exportPatchList({ flagName: 'cuFlag' })
304
+ this._validatePallet(patches)
305
+ if (patches && patches.length) {
328
306
  this.dataGrist.showSpinner()
329
- const response = await client.query({
330
- query: gql`
307
+ const response = await client.mutate({
308
+ mutation: gql`
331
309
  mutation updateMultiplePallet($patches: [PalletPatch!]!) {
332
- updateMultiplePallet(patches: $patches)
310
+ updateMultiplePallet(patches: $patches) {
311
+ name
312
+ }
333
313
  }
334
314
  `,
335
315
  variables: {
336
316
  patches
337
317
  }
338
318
  })
319
+
339
320
  if (!response.errors) {
340
- history.back()
341
321
  this.dataGrist.fetch()
342
322
  document.dispatchEvent(
343
323
  new CustomEvent('notify', {
344
324
  detail: {
345
- message: i18next.t('text.data_imported_successfully')
325
+ message: i18next.t('text.data_updated_successfully')
346
326
  }
347
327
  })
348
328
  )
349
329
  }
350
330
  this.dataGrist.hideSpinner()
351
- } catch (e) {
352
- showToast(e)
353
331
  }
354
332
  }
355
333
 
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)
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')
369
341
  }
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()
342
+ })
343
+ )
387
344
  }
388
- } catch (e) {
389
- showToast(e)
390
- }
391
- }
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
345
+ if (!patch.holder) {
346
+ throw document.dispatchEvent(
347
+ new CustomEvent('notify', {
348
+ detail: {
349
+ message: i18next.t('text.holder_field_is_empty')
402
350
  }
403
- }
404
- }
405
- `,
406
- variables: {
407
- filters: [...bizplace]
351
+ })
352
+ )
408
353
  }
409
- })
410
- return response.data.bizplaces.items
354
+ }
411
355
  }
412
-
356
+
413
357
  async _deletePallet() {
414
358
  CustomAlert({
415
359
  title: i18next.t('text.are_you_sure'),
@@ -441,11 +385,6 @@ class PalletList extends connect(store)(localize(i18next)(PageView)) {
441
385
  })
442
386
  )
443
387
  }
444
- } else {
445
- CustomAlert({
446
- title: i18next.t('text.nothing_selected'),
447
- text: i18next.t('text.there_is_nothing_to_delete')
448
- })
449
388
  }
450
389
  this.dataGrist.hideSpinner()
451
390
  }
@@ -457,7 +396,7 @@ class PalletList extends connect(store)(localize(i18next)(PageView)) {
457
396
  return this.config.columns
458
397
  }
459
398
 
460
- async _exportableData() {
399
+ _exportableData() {
461
400
  let records = []
462
401
  if (this.dataGrist.selected && this.dataGrist.selected.length > 0) {
463
402
  records = this.dataGrist.selected
@@ -465,27 +404,9 @@ class PalletList extends connect(store)(localize(i18next)(PageView)) {
465
404
  records = this.dataGrist.data.records
466
405
  }
467
406
 
468
- const getBizplace = await this.fetchBizplaces()
469
-
470
407
  var headerSetting = this.dataGrist._config.columns
471
408
  .filter(column => column.type !== 'gutter' && column.record !== undefined && column.imex !== undefined)
472
409
  .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
- }
489
410
  return column.imex
490
411
  })
491
412
 
@@ -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
  {
@@ -164,7 +164,7 @@ class ToteList extends connect(store)(localize(i18next)(PageView)) {
164
164
  },
165
165
  {
166
166
  label: i18next.t('field.deleted'),
167
- name: 'deleted_at',
167
+ name: 'deleted',
168
168
  type: 'checkbox',
169
169
  props: { searchOper: 'eq' }
170
170
  }
@@ -175,7 +175,6 @@ class ToteList extends connect(store)(localize(i18next)(PageView)) {
175
175
  fields: ['toteNo', 'company', 'status']
176
176
  },
177
177
  rows: { selectable: { multiple: true } },
178
- pagination: { limit: 50, pages: [50, 100, 200, 500] },
179
178
  columns: [
180
179
  { type: 'gutter', gutterName: 'dirty' },
181
180
  { type: 'gutter', gutterName: 'sequence' },
@@ -317,7 +316,7 @@ class ToteList extends connect(store)(localize(i18next)(PageView)) {
317
316
  }
318
317
  `,
319
318
  variables: {
320
- filters: this.searchForm.queryFilters,
319
+ filters: [...this.searchForm.queryFilters],
321
320
  pagination: { page, limit },
322
321
  sortings: sorters
323
322
  }
@@ -336,17 +335,12 @@ class ToteList extends connect(store)(localize(i18next)(PageView)) {
336
335
  }
337
336
 
338
337
  async importHandler(patches) {
339
- let existedToteStatus = this._toteStatus
340
338
  try {
341
339
  patches.map(itm => {
342
340
  if (itm.cuFlag == '+') {
343
341
  if (!itm.bizplace?.id || !itm.status || !itm.name) {
344
342
  throw new Error(i18next.t('text.empty_value_in_list'))
345
343
  }
346
- let foundToteStatus = existedToteStatus.find(exist => exist.name == itm.status)
347
- if (!foundToteStatus) {
348
- throw new Error(i18next.t('text.tote_status_does_not_exist'))
349
- }
350
344
  }
351
345
  })
352
346
 
@@ -381,37 +375,35 @@ class ToteList extends connect(store)(localize(i18next)(PageView)) {
381
375
  }
382
376
 
383
377
  async _saveTote() {
384
- try {
385
- let patches = this.dataGrist.exportPatchList({ flagName: 'cuFlag' })
386
- this._validateTote(patches)
387
- if (patches && patches.length) {
388
- this.dataGrist.showSpinner()
389
- const response = await client.mutate({
390
- mutation: gql`
391
- mutation updateMultipleTote($patches: [TotePatch!]!) {
392
- updateMultipleTote(patches: $patches) {
393
- name
394
- }
378
+ let patches = this.dataGrist.exportPatchList({ flagName: 'cuFlag' })
379
+ this._validateTote(patches)
380
+ if (patches && patches.length) {
381
+ this.dataGrist.showSpinner()
382
+ const response = await client.mutate({
383
+ mutation: gql`
384
+ mutation updateMultipleTote($patches: [TotePatch!]!) {
385
+ updateMultipleTote(patches: $patches) {
386
+ name
395
387
  }
396
- `,
397
- variables: {
398
- patches
399
388
  }
400
- })
401
-
402
- if (!response.errors) {
403
- this.dataGrist.fetch()
404
- document.dispatchEvent(
405
- new CustomEvent('notify', {
406
- detail: {
407
- message: i18next.t('text.data_updated_successfully')
408
- }
409
- })
410
- )
389
+ `,
390
+ variables: {
391
+ patches
411
392
  }
412
- this.dataGrist.hideSpinner()
393
+ })
394
+
395
+ if (!response.errors) {
396
+ this.dataGrist.fetch()
397
+ document.dispatchEvent(
398
+ new CustomEvent('notify', {
399
+ detail: {
400
+ message: i18next.t('text.data_updated_successfully')
401
+ }
402
+ })
403
+ )
413
404
  }
414
- } catch (e) {}
405
+ this.dataGrist.hideSpinner()
406
+ }
415
407
  }
416
408
 
417
409
  _validateTote(patches) {
@@ -481,11 +473,6 @@ class ToteList extends connect(store)(localize(i18next)(PageView)) {
481
473
  })
482
474
  )
483
475
  }
484
- } else {
485
- CustomAlert({
486
- title: i18next.t('text.nothing_selected'),
487
- text: i18next.t('text.there_is_nothing_to_delete')
488
- })
489
476
  }
490
477
  this.dataGrist.hideSpinner()
491
478
  }
@@ -10,7 +10,6 @@ import { openPopup } from '@things-factory/layout-base'
10
10
  import { client, CustomAlert, PageView } from '@things-factory/shell'
11
11
  import { CommonButtonStyles, ScrollbarStyles } from '@things-factory/styles'
12
12
  import { isMobileDevice } from '@things-factory/utils'
13
- import { showToast } from '../../util/index'
14
13
 
15
14
  class TransportDriver extends localize(i18next)(PageView) {
16
15
  static get properties() {
@@ -99,7 +98,7 @@ class TransportDriver extends localize(i18next)(PageView) {
99
98
  label: i18next.t('field.driver_code'),
100
99
  name: 'driverCode',
101
100
  type: 'text',
102
- props: { searchOper: 'i_like' }
101
+ props: { searchOper: 'eq' }
103
102
  },
104
103
  {
105
104
  label: i18next.t('field.description'),
@@ -111,7 +110,6 @@ class TransportDriver extends localize(i18next)(PageView) {
111
110
 
112
111
  this.config = {
113
112
  rows: { selectable: { multiple: true } },
114
- pagination: { limit: 50, pages: [50, 100, 200, 500] },
115
113
  columns: [
116
114
  { type: 'gutter', gutterName: 'dirty' },
117
115
  { type: 'gutter', gutterName: 'sequence' },
@@ -230,65 +228,47 @@ class TransportDriver extends localize(i18next)(PageView) {
230
228
  }
231
229
 
232
230
  async importHandler(patches) {
233
- try {
234
- if (patches.some(p => (!p.name || !p.driverCode) && p.cuFlag == '+')) {
235
- throw new Error(i18next.t('text.empty_value_in_list'))
236
- }
231
+ const response = await client.mutate({
232
+ mutation: gql`
233
+ mutation updateMultipleTransportDriver($patches: [TransportDriverPatch!]!) {
234
+ updateMultipleTransportDriver(patches: $patches) {
235
+ name
236
+ }
237
+ }
238
+ `,
239
+ variables: { patches }
240
+ })
241
+
242
+ if (!response.errors) {
243
+ history.back()
244
+ this.dataGrist.fetch()
245
+ this._showToast({ message: i18next.t('text.data_imported_successfully') })
246
+ }
247
+ }
237
248
 
238
- patches = patches.map(p => {
239
- return { ...p, cuFlag: '' }
249
+ async _saveTransportDriver() {
250
+ let patches = this.dataGrist.exportPatchList({ flagName: 'cuFlag' })
251
+ if (!patches?.length) {
252
+ CustomAlert({
253
+ title: i18next.t('text.nothing_changed'),
254
+ text: i18next.t('text.there_is_nothing_to_save')
240
255
  })
256
+ } else {
241
257
  const response = await client.mutate({
242
258
  mutation: gql`
243
259
  mutation updateMultipleTransportDriver($patches: [TransportDriverPatch!]!) {
244
- updateMultipleTransportDriver(patches: $patches)
260
+ updateMultipleTransportDriver(patches: $patches) {
261
+ name
262
+ }
245
263
  }
246
264
  `,
247
265
  variables: { patches }
248
266
  })
249
267
 
250
268
  if (!response.errors) {
251
- history.back()
252
269
  this.dataGrist.fetch()
253
- showToast({ message: i18next.t('text.data_imported_successfully') })
254
- }
255
- } catch (e) {
256
- showToast(e)
257
- }
258
- }
259
-
260
- async _saveTransportDriver() {
261
- try {
262
- let patches = this.dataGrist.exportPatchList({ flagName: 'cuFlag' })
263
-
264
- if (patches.some(p => (!p.name || !p.driverCode) && p.cuFlag == '+')) {
265
- throw new Error(i18next.t('text.empty_value_in_list'))
266
- }
267
-
268
- if (!patches?.length) {
269
- CustomAlert({
270
- title: i18next.t('text.nothing_changed'),
271
- text: i18next.t('text.there_is_nothing_to_save')
272
- })
273
- } else {
274
- const response = await client.mutate({
275
- mutation: gql`
276
- mutation updateMultipleTransportDriver($patches: [TransportDriverPatch!]!) {
277
- updateMultipleTransportDriver(patches: $patches) {
278
- name
279
- }
280
- }
281
- `,
282
- variables: { patches }
283
- })
284
-
285
- if (!response.errors) {
286
- this.dataGrist.fetch()
287
- showToast({ message: i18next.t('text.data_updated_successfully') })
288
- }
270
+ this._showToast({ message: i18next.t('text.data_updated_successfully') })
289
271
  }
290
- } catch (e) {
291
- showToast(e)
292
272
  }
293
273
  }
294
274
 
@@ -321,7 +301,7 @@ class TransportDriver extends localize(i18next)(PageView) {
321
301
 
322
302
  if (!response.errors) {
323
303
  this.dataGrist.fetch()
324
- showToast({ message: i18next.t('text.data_deleted_successfully') })
304
+ this._showToast({ message: i18next.t('text.data_deleted_successfully') })
325
305
  }
326
306
  }
327
307
  }
@@ -360,6 +340,17 @@ class TransportDriver extends localize(i18next)(PageView) {
360
340
 
361
341
  return { header: headerSetting, data: data }
362
342
  }
343
+
344
+ _showToast({ type, message }) {
345
+ document.dispatchEvent(
346
+ new CustomEvent('notify', {
347
+ detail: {
348
+ type,
349
+ message
350
+ }
351
+ })
352
+ )
353
+ }
363
354
  }
364
355
 
365
356
  window.customElements.define('transport-driver', TransportDriver)