@things-factory/operato-wms 4.3.105 → 4.3.113-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 +9 -15
- 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 +72 -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/check-inventory-popup.js +14 -3
- package/client/pages/inventory-check/create-cycle-count.js +2 -3
- package/client/pages/inventory-check/inspecting-product.js +25 -7
- 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 +134 -71
- 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 +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 +39 -2
- package/client/pages/order/release-order/create-release-order.js +22 -5
- package/client/pages/order/release-order/release-extra-product-popup.js +4 -1
- package/client/pages/order/release-order/release-order-detail.js +24 -0
- 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/transport-order/delivery-order-list.js +26 -0
- package/client/pages/outbound/inventory-reassign-popup.js +6 -0
- package/client/pages/outbound/packing-product.js +5 -5
- package/client/pages/outbound/packing-worksheet-list.js +3 -1
- package/client/pages/outbound/picking-product.js +18 -7
- 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 +48 -8
- 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/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 +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/server/graphql/resolvers/reports/release-inventory-report.ts +6 -4
- package/translations/en.json +27 -12
- package/translations/ko.json +25 -10
- package/translations/ms.json +25 -10
- package/translations/zh.json +18 -3
|
@@ -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
|
{
|
|
@@ -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: '
|
|
167
|
+
name: 'deleted_at',
|
|
168
168
|
type: 'checkbox',
|
|
169
169
|
props: { searchOper: 'eq' }
|
|
170
170
|
}
|
|
@@ -175,6 +175,7 @@ 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] },
|
|
178
179
|
columns: [
|
|
179
180
|
{ type: 'gutter', gutterName: 'dirty' },
|
|
180
181
|
{ type: 'gutter', gutterName: 'sequence' },
|
|
@@ -316,7 +317,7 @@ class ToteList extends connect(store)(localize(i18next)(PageView)) {
|
|
|
316
317
|
}
|
|
317
318
|
`,
|
|
318
319
|
variables: {
|
|
319
|
-
filters:
|
|
320
|
+
filters: this.searchForm.queryFilters,
|
|
320
321
|
pagination: { page, limit },
|
|
321
322
|
sortings: sorters
|
|
322
323
|
}
|
|
@@ -335,12 +336,17 @@ class ToteList extends connect(store)(localize(i18next)(PageView)) {
|
|
|
335
336
|
}
|
|
336
337
|
|
|
337
338
|
async importHandler(patches) {
|
|
339
|
+
let existedToteStatus = this._toteStatus
|
|
338
340
|
try {
|
|
339
341
|
patches.map(itm => {
|
|
340
342
|
if (itm.cuFlag == '+') {
|
|
341
343
|
if (!itm.bizplace?.id || !itm.status || !itm.name) {
|
|
342
344
|
throw new Error(i18next.t('text.empty_value_in_list'))
|
|
343
345
|
}
|
|
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
|
+
}
|
|
344
350
|
}
|
|
345
351
|
})
|
|
346
352
|
|
|
@@ -375,35 +381,37 @@ class ToteList extends connect(store)(localize(i18next)(PageView)) {
|
|
|
375
381
|
}
|
|
376
382
|
|
|
377
383
|
async _saveTote() {
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
mutation
|
|
385
|
-
updateMultipleTote(patches:
|
|
386
|
-
|
|
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
|
+
}
|
|
387
395
|
}
|
|
396
|
+
`,
|
|
397
|
+
variables: {
|
|
398
|
+
patches
|
|
388
399
|
}
|
|
389
|
-
|
|
390
|
-
variables: {
|
|
391
|
-
patches
|
|
392
|
-
}
|
|
393
|
-
})
|
|
400
|
+
})
|
|
394
401
|
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
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
|
+
)
|
|
411
|
+
}
|
|
412
|
+
this.dataGrist.hideSpinner()
|
|
404
413
|
}
|
|
405
|
-
|
|
406
|
-
}
|
|
414
|
+
} catch (e) {}
|
|
407
415
|
}
|
|
408
416
|
|
|
409
417
|
_validateTote(patches) {
|
|
@@ -473,6 +481,11 @@ class ToteList extends connect(store)(localize(i18next)(PageView)) {
|
|
|
473
481
|
})
|
|
474
482
|
)
|
|
475
483
|
}
|
|
484
|
+
} else {
|
|
485
|
+
CustomAlert({
|
|
486
|
+
title: i18next.t('text.nothing_selected'),
|
|
487
|
+
text: i18next.t('text.there_is_nothing_to_delete')
|
|
488
|
+
})
|
|
476
489
|
}
|
|
477
490
|
this.dataGrist.hideSpinner()
|
|
478
491
|
}
|
|
@@ -10,6 +10,7 @@ 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'
|
|
13
14
|
|
|
14
15
|
class TransportDriver extends localize(i18next)(PageView) {
|
|
15
16
|
static get properties() {
|
|
@@ -98,7 +99,7 @@ class TransportDriver extends localize(i18next)(PageView) {
|
|
|
98
99
|
label: i18next.t('field.driver_code'),
|
|
99
100
|
name: 'driverCode',
|
|
100
101
|
type: 'text',
|
|
101
|
-
props: { searchOper: '
|
|
102
|
+
props: { searchOper: 'i_like' }
|
|
102
103
|
},
|
|
103
104
|
{
|
|
104
105
|
label: i18next.t('field.description'),
|
|
@@ -110,6 +111,7 @@ class TransportDriver extends localize(i18next)(PageView) {
|
|
|
110
111
|
|
|
111
112
|
this.config = {
|
|
112
113
|
rows: { selectable: { multiple: true } },
|
|
114
|
+
pagination: { limit: 50, pages: [50, 100, 200, 500] },
|
|
113
115
|
columns: [
|
|
114
116
|
{ type: 'gutter', gutterName: 'dirty' },
|
|
115
117
|
{ type: 'gutter', gutterName: 'sequence' },
|
|
@@ -228,47 +230,65 @@ class TransportDriver extends localize(i18next)(PageView) {
|
|
|
228
230
|
}
|
|
229
231
|
|
|
230
232
|
async importHandler(patches) {
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
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
|
-
}
|
|
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
|
+
}
|
|
248
237
|
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
if (!patches?.length) {
|
|
252
|
-
CustomAlert({
|
|
253
|
-
title: i18next.t('text.nothing_changed'),
|
|
254
|
-
text: i18next.t('text.there_is_nothing_to_save')
|
|
238
|
+
patches = patches.map(p => {
|
|
239
|
+
return { ...p, cuFlag: '' }
|
|
255
240
|
})
|
|
256
|
-
} else {
|
|
257
241
|
const response = await client.mutate({
|
|
258
242
|
mutation: gql`
|
|
259
243
|
mutation updateMultipleTransportDriver($patches: [TransportDriverPatch!]!) {
|
|
260
|
-
updateMultipleTransportDriver(patches: $patches)
|
|
261
|
-
name
|
|
262
|
-
}
|
|
244
|
+
updateMultipleTransportDriver(patches: $patches)
|
|
263
245
|
}
|
|
264
246
|
`,
|
|
265
247
|
variables: { patches }
|
|
266
248
|
})
|
|
267
249
|
|
|
268
250
|
if (!response.errors) {
|
|
251
|
+
history.back()
|
|
269
252
|
this.dataGrist.fetch()
|
|
270
|
-
|
|
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
|
+
}
|
|
271
289
|
}
|
|
290
|
+
} catch (e) {
|
|
291
|
+
showToast(e)
|
|
272
292
|
}
|
|
273
293
|
}
|
|
274
294
|
|
|
@@ -301,7 +321,7 @@ class TransportDriver extends localize(i18next)(PageView) {
|
|
|
301
321
|
|
|
302
322
|
if (!response.errors) {
|
|
303
323
|
this.dataGrist.fetch()
|
|
304
|
-
|
|
324
|
+
showToast({ message: i18next.t('text.data_deleted_successfully') })
|
|
305
325
|
}
|
|
306
326
|
}
|
|
307
327
|
}
|
|
@@ -340,17 +360,6 @@ class TransportDriver extends localize(i18next)(PageView) {
|
|
|
340
360
|
|
|
341
361
|
return { header: headerSetting, data: data }
|
|
342
362
|
}
|
|
343
|
-
|
|
344
|
-
_showToast({ type, message }) {
|
|
345
|
-
document.dispatchEvent(
|
|
346
|
-
new CustomEvent('notify', {
|
|
347
|
-
detail: {
|
|
348
|
-
type,
|
|
349
|
-
message
|
|
350
|
-
}
|
|
351
|
-
})
|
|
352
|
-
)
|
|
353
|
-
}
|
|
354
363
|
}
|
|
355
364
|
|
|
356
365
|
window.customElements.define('transport-driver', TransportDriver)
|