@things-factory/operato-wms 4.2.12 → 4.3.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/constants/index.js +1 -0
- package/client/constants/order.js +14 -0
- package/client/pages/constants/index.js +1 -0
- package/client/pages/constants/setting.js +1 -0
- package/client/pages/constants/tote.js +14 -0
- package/client/pages/inbound/unload-product.js +1 -1
- package/client/pages/inventory/inventory-adjustment-approval.js +24 -9
- package/client/pages/inventory/inventory-adjustment.js +79 -13
- package/client/pages/inventory-check/create-cycle-count.js +0 -2
- package/client/pages/master/product/product-detail-bizplace-setting-popup.js +0 -2
- package/client/pages/master/product/product-details-popup.js +10 -9
- package/client/pages/master/product/product-list.js +11 -10
- package/client/pages/master/tote-list.js +740 -0
- package/client/pages/order/arrival-notice/arrival-notice-detail.js +0 -2
- package/client/pages/order/arrival-notice/receive-arrival-notice.js +0 -2
- package/client/pages/order/draft-release-good/draft-release-good-detail.js +1163 -0
- package/client/pages/order/draft-release-good/draft-release-good-list.js +546 -0
- package/client/pages/order/release-order/b2c/b2c-order-requests.js +21 -30
- package/client/pages/order/release-order/bulk-print-packing-list.js +4 -0
- package/client/pages/order/release-order/receive-release-order-request.js +0 -2
- package/client/pages/order/release-order/release-order-detail.js +44 -26
- package/client/pages/order/return-order/receive-return-order-requests.js +0 -2
- package/client/pages/order/transfer-order/receive-transfer-order-request.js +1 -1
- package/client/pages/order/transport-order/print-delivery-note.js +0 -1
- package/client/pages/order/transport-order/view-delivery-note.js +1 -1
- package/client/pages/order/vas-order/receive-vas-order.js +0 -2
- package/client/pages/outbound/inventory-assign-popup.js +7 -2
- package/client/pages/outbound/inventory-auto-assign-popup.js +2 -1
- package/client/pages/outbound/loading-product.js +35 -3
- package/client/pages/outbound/order-remark-popup.js +112 -0
- package/client/pages/outbound/packing-product.js +38 -5
- package/client/pages/outbound/packing-worksheet-list.js +15 -0
- package/client/pages/outbound/picking-product.js +142 -10
- package/client/pages/outbound/single-outbound-worksheet.js +10 -22
- package/client/pages/outbound/sorting-product.js +72 -12
- package/client/pages/outbound/tote-popup.js +461 -0
- package/client/pages/outbound/worksheet-batch-picking.js +10 -3
- package/client/pages/outbound/worksheet-packing.js +7 -2
- package/client/pages/outbound/worksheet-picking.js +9 -2
- package/client/pages/report/inventory-summary-report.js +8 -0
- package/client/pages/report/outbound-order-details-report.js +18 -0
- package/client/route.js +12 -0
- package/dist-server/entities/index.js +2 -1
- package/dist-server/entities/index.js.map +1 -1
- package/dist-server/entities/warehouse-bizplace-onhand-inventory.js +168 -0
- package/dist-server/entities/warehouse-bizplace-onhand-inventory.js.map +1 -0
- package/dist-server/graphql/resolvers/board-setting/board-settings.js +2 -1
- package/dist-server/graphql/resolvers/board-setting/board-settings.js.map +1 -1
- package/dist-server/graphql/resolvers/index.js +3 -2
- package/dist-server/graphql/resolvers/index.js.map +1 -1
- package/dist-server/graphql/resolvers/reports/outbound-order-details-report.js +3 -1
- package/dist-server/graphql/resolvers/reports/outbound-order-details-report.js.map +1 -1
- package/dist-server/graphql/resolvers/warehouse-inventory-adjustment/index.js +6 -0
- package/dist-server/graphql/resolvers/warehouse-inventory-adjustment/index.js.map +1 -0
- package/dist-server/graphql/resolvers/warehouse-inventory-adjustment/warehouse-intentory-adjustment.js +58 -0
- package/dist-server/graphql/resolvers/warehouse-inventory-adjustment/warehouse-intentory-adjustment.js.map +1 -0
- package/dist-server/graphql/types/index.js +4 -3
- package/dist-server/graphql/types/index.js.map +1 -1
- package/dist-server/graphql/types/reports/outbound-order-details-report.js +2 -0
- package/dist-server/graphql/types/reports/outbound-order-details-report.js.map +1 -1
- package/dist-server/graphql/types/warehouse-inventory-adjustment/index.js +9 -0
- package/dist-server/graphql/types/warehouse-inventory-adjustment/index.js.map +1 -0
- package/dist-server/index.js +1 -0
- package/dist-server/index.js.map +1 -1
- package/dist-server/opa-app-setting-constants.js +2 -1
- package/dist-server/opa-app-setting-constants.js.map +1 -1
- package/helps/release-note.ko.md +10 -8
- package/helps/release-note.md +10 -8
- package/helps/release-note.ms.md +10 -8
- package/helps/release-note.zh.md +10 -8
- package/package.json +41 -41
- package/server/entities/index.ts +2 -2
- package/server/entities/warehouse-bizplace-onhand-inventory.ts +141 -0
- package/server/graphql/resolvers/board-setting/board-settings.ts +4 -2
- package/server/graphql/resolvers/index.ts +3 -2
- package/server/graphql/resolvers/reports/outbound-order-details-report.ts +6 -2
- package/server/graphql/resolvers/warehouse-inventory-adjustment/index.ts +5 -0
- package/server/graphql/resolvers/warehouse-inventory-adjustment/warehouse-intentory-adjustment.ts +68 -0
- package/server/graphql/types/index.ts +4 -4
- package/server/graphql/types/reports/outbound-order-details-report.ts +2 -0
- package/server/graphql/types/warehouse-inventory-adjustment/index.ts +5 -0
- package/server/index.ts +2 -1
- package/server/opa-app-setting-constants.ts +1 -0
- package/things-factory.config.js +13 -0
- package/translations/en.json +45 -6
- package/translations/ko.json +34 -1
- package/translations/ms.json +34 -1
- package/translations/zh.json +34 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './order'
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export const DRAFT_RELEASE_ORDER_STATUS = {
|
|
2
|
+
DRAFT: 'DRAFT',
|
|
3
|
+
INSUFFICIENT: 'INSUFFICIENT',
|
|
4
|
+
SUBMITTED: 'SUBMITTED',
|
|
5
|
+
CANCELLED: 'CANCELLED'
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* To identify Product Type Single or Bundle
|
|
10
|
+
*/
|
|
11
|
+
export const PRODUCT_GROUP_TYPES = {
|
|
12
|
+
SINGLE: 'SINGLE',
|
|
13
|
+
BUNDLE: 'BUNDLE'
|
|
14
|
+
}
|
|
@@ -6,3 +6,4 @@ export const PRODUCT_LABEL_SETTING_KEY = 'product-label'
|
|
|
6
6
|
export const REUSABLE_PALLET_LABEL_SETTING_KEY = 'reusable-pallet-label'
|
|
7
7
|
export const INTENALIZED_AWB_SETTING_KEY = 'internalized-awb-label'
|
|
8
8
|
export const ROUTE_LABEL_SETTING_KEY = 'route-label'
|
|
9
|
+
export const TOTE_LABEL_SETTING_KEY = 'tote-label'
|
|
@@ -11,7 +11,7 @@ import './serial-number-list-popup'
|
|
|
11
11
|
|
|
12
12
|
import gql from 'graphql-tag'
|
|
13
13
|
import { css, html } from 'lit-element'
|
|
14
|
-
import orderBy from 'lodash/orderBy'
|
|
14
|
+
import orderBy from 'lodash-es/orderBy'
|
|
15
15
|
import { connect } from 'pwa-helpers/connect-mixin.js'
|
|
16
16
|
|
|
17
17
|
import { MultiColumnFormStyles } from '@things-factory/form-ui'
|
|
@@ -8,7 +8,7 @@ import { connect } from 'pwa-helpers/connect-mixin'
|
|
|
8
8
|
|
|
9
9
|
import { getCodeByName } from '@things-factory/code-base'
|
|
10
10
|
import { i18next, localize } from '@things-factory/i18n-base'
|
|
11
|
-
import { client, PageView, store } from '@things-factory/shell'
|
|
11
|
+
import { client, PageView, store,gqlContext } from '@things-factory/shell'
|
|
12
12
|
import { CommonButtonStyles, ScrollbarStyles } from '@things-factory/styles'
|
|
13
13
|
import { isMobileDevice } from '@things-factory/utils'
|
|
14
14
|
import { openPopup } from '@things-factory/layout-base'
|
|
@@ -141,7 +141,9 @@ class InventoryAdjustmentApproval extends connect(store)(localize(i18next)(PageV
|
|
|
141
141
|
{ column: 'expirationDate', name: 'Exp. Date' },
|
|
142
142
|
{ column: 'manufactureDate', name: 'Mfg. Date' },
|
|
143
143
|
{ column: 'unitCost', name: 'Unit Cost' },
|
|
144
|
-
{ column: 'inventoryItemChange', name: 'Inventory Item Changes' }
|
|
144
|
+
{ column: 'inventoryItemChange', name: 'Inventory Item Changes' },
|
|
145
|
+
{ column: 'status', name: 'Status' },
|
|
146
|
+
|
|
145
147
|
]
|
|
146
148
|
|
|
147
149
|
this.config = {
|
|
@@ -194,7 +196,17 @@ class InventoryAdjustmentApproval extends connect(store)(localize(i18next)(PageV
|
|
|
194
196
|
} else {
|
|
195
197
|
this._compareColumn.map(item => {
|
|
196
198
|
let currentVal = compareData[item.column]?.name || compareData[item.column] || '[N/A]'
|
|
197
|
-
let updatedVal
|
|
199
|
+
let updatedVal
|
|
200
|
+
|
|
201
|
+
if (item.column == 'status' && record.transactionType == 'MISSING') {
|
|
202
|
+
updatedVal = record.transactionType || '[N/A]'
|
|
203
|
+
}else if(item.column == 'status'){
|
|
204
|
+
updatedVal = '[N/A]'
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
if (item.column !== 'status') {
|
|
208
|
+
updatedVal = record[item.column]?.name || record[item.column] || '[N/A]'
|
|
209
|
+
}
|
|
198
210
|
|
|
199
211
|
recordDiff.push({
|
|
200
212
|
column: item.name,
|
|
@@ -404,6 +416,7 @@ class InventoryAdjustmentApproval extends connect(store)(localize(i18next)(PageV
|
|
|
404
416
|
batchIdRef
|
|
405
417
|
packingType
|
|
406
418
|
packingSize
|
|
419
|
+
status
|
|
407
420
|
bizplace {
|
|
408
421
|
id
|
|
409
422
|
name
|
|
@@ -432,6 +445,7 @@ class InventoryAdjustmentApproval extends connect(store)(localize(i18next)(PageV
|
|
|
432
445
|
packingType
|
|
433
446
|
packingSize
|
|
434
447
|
batchIdRef
|
|
448
|
+
status
|
|
435
449
|
bizplace {
|
|
436
450
|
id
|
|
437
451
|
name
|
|
@@ -548,8 +562,8 @@ class InventoryAdjustmentApproval extends connect(store)(localize(i18next)(PageV
|
|
|
548
562
|
if (patches && patches.length) {
|
|
549
563
|
const response = await client.mutate({
|
|
550
564
|
mutation: gql`
|
|
551
|
-
mutation
|
|
552
|
-
|
|
565
|
+
mutation warehouseInventoryAdjustment($patches: [InventoryChangePatch!]!) {
|
|
566
|
+
warehouseInventoryAdjustment(patches: $patches) {
|
|
553
567
|
items {
|
|
554
568
|
id
|
|
555
569
|
}
|
|
@@ -557,13 +571,14 @@ class InventoryAdjustmentApproval extends connect(store)(localize(i18next)(PageV
|
|
|
557
571
|
}
|
|
558
572
|
}
|
|
559
573
|
`,
|
|
560
|
-
variables: { patches }
|
|
574
|
+
variables: { patches },
|
|
575
|
+
context: gqlContext()
|
|
561
576
|
})
|
|
562
577
|
if (!response.errors) {
|
|
563
|
-
this._lockedPallet = response.data.
|
|
578
|
+
this._lockedPallet = response.data.warehouseInventoryAdjustment.items
|
|
564
579
|
this._showToast({
|
|
565
580
|
message:
|
|
566
|
-
response.data.
|
|
581
|
+
response.data.warehouseInventoryAdjustment.total > 0
|
|
567
582
|
? 'Highlighted pallet could not be approved due to ongoing process.'
|
|
568
583
|
: i18next.t('text.data_approved'),
|
|
569
584
|
option: 7000
|
|
@@ -677,4 +692,4 @@ class InventoryAdjustmentApproval extends connect(store)(localize(i18next)(PageV
|
|
|
677
692
|
}
|
|
678
693
|
}
|
|
679
694
|
|
|
680
|
-
window.customElements.define('inventory-adjustment-approval', InventoryAdjustmentApproval)
|
|
695
|
+
window.customElements.define('inventory-adjustment-approval', InventoryAdjustmentApproval)
|
|
@@ -13,7 +13,7 @@ import { DirectPrinter } from '@things-factory/barcode-base'
|
|
|
13
13
|
import { getCodeByName } from '@things-factory/code-base'
|
|
14
14
|
import { i18next, localize } from '@things-factory/i18n-base'
|
|
15
15
|
import { openPopup } from '@things-factory/layout-base'
|
|
16
|
-
import { client, PageView, store } from '@things-factory/shell'
|
|
16
|
+
import { client, CustomAlert, PageView, store } from '@things-factory/shell'
|
|
17
17
|
import { CommonButtonStyles, ScrollbarStyles } from '@things-factory/styles'
|
|
18
18
|
import { isMobileDevice } from '@things-factory/utils'
|
|
19
19
|
|
|
@@ -75,6 +75,11 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
|
|
|
75
75
|
action: this.printCartonLabel.bind(this),
|
|
76
76
|
...CommonButtonStyles.label
|
|
77
77
|
},
|
|
78
|
+
{
|
|
79
|
+
title: i18next.t('button.missing_stock'),
|
|
80
|
+
action: this.missingStock.bind(this),
|
|
81
|
+
...CommonButtonStyles.save
|
|
82
|
+
},
|
|
78
83
|
{
|
|
79
84
|
title: i18next.t('button.save'),
|
|
80
85
|
action: this.saveInventories.bind(this),
|
|
@@ -723,11 +728,15 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
|
|
|
723
728
|
|
|
724
729
|
switch (e.detail.column.name) {
|
|
725
730
|
case 'uomValue':
|
|
726
|
-
if (e.detail.after < 0
|
|
731
|
+
if (e.detail.after < 0 || e.detail.after.toString() == NaN.toString()) {
|
|
732
|
+
item._data.records[e.detail.row].uomValue = 0
|
|
733
|
+
this._showToast({ level: 'error', message: i18next.t('text.invalid_uom_value') })
|
|
734
|
+
}
|
|
727
735
|
break
|
|
728
736
|
case 'qty':
|
|
729
|
-
if (e.detail.after < 0 || !Number.isInteger(e.detail.after))
|
|
730
|
-
|
|
737
|
+
if (e.detail.after < 0 || !Number.isInteger(e.detail.after)) {
|
|
738
|
+
this._showToast({ level: 'error', message: i18next.t('text.invalid_qty') })
|
|
739
|
+
}
|
|
731
740
|
break
|
|
732
741
|
case 'unitCost':
|
|
733
742
|
if (e.detail.after < 0) item._data.records[e.detail.row].unitCost = e.detail.before
|
|
@@ -761,6 +770,46 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
|
|
|
761
770
|
}
|
|
762
771
|
}
|
|
763
772
|
|
|
773
|
+
async missingStock() {
|
|
774
|
+
const selectOrderInventory = this.dataGrist.selected
|
|
775
|
+
|
|
776
|
+
const patchesArr = [...selectOrderInventory]
|
|
777
|
+
|
|
778
|
+
const patches = patchesArr.map(p => {
|
|
779
|
+
return {
|
|
780
|
+
palletId: p.palletId,
|
|
781
|
+
transactionType: 'MISSING'
|
|
782
|
+
}
|
|
783
|
+
})
|
|
784
|
+
|
|
785
|
+
const result = await CustomAlert({
|
|
786
|
+
title: i18next.t('title.are_you_sure'),
|
|
787
|
+
text: i18next.t('text.do_you_want_to_mark_it_as_missing'),
|
|
788
|
+
confirmButton: { text: i18next.t('button.confirm') },
|
|
789
|
+
cancelButton: { text: i18next.t('button.cancel') }
|
|
790
|
+
})
|
|
791
|
+
|
|
792
|
+
if (result.isConfirmed) {
|
|
793
|
+
try {
|
|
794
|
+
const response = await client.mutate({
|
|
795
|
+
mutation: gql`
|
|
796
|
+
mutation submitInventoryChanges($patches: [InventoryPatch!]!) {
|
|
797
|
+
submitInventoryChanges(patches: $patches)
|
|
798
|
+
}
|
|
799
|
+
`,
|
|
800
|
+
variables: { patches }
|
|
801
|
+
})
|
|
802
|
+
|
|
803
|
+
if (!response.error) {
|
|
804
|
+
this._showToast({ message: i18next.t('text.data_inventory_adjustment_has_been_submitted_for_approval') })
|
|
805
|
+
this.updateContext()
|
|
806
|
+
}
|
|
807
|
+
} catch (error) {
|
|
808
|
+
throw new Error(error)
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
|
|
764
813
|
async saveInventories() {
|
|
765
814
|
try {
|
|
766
815
|
var patches = this.dataGrist.exportPatchList({ flagName: 'cuFlag' })
|
|
@@ -793,18 +842,34 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
|
|
|
793
842
|
})
|
|
794
843
|
|
|
795
844
|
if (patches && patches.length) {
|
|
796
|
-
const
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
845
|
+
const validateInventoryChanges = await client.query({
|
|
846
|
+
query: gql`
|
|
847
|
+
query validateOrderInventory($patches: [InventoryPatch!]!) {
|
|
848
|
+
validateOrderInventory(patches: $patches)
|
|
800
849
|
}
|
|
801
850
|
`,
|
|
802
851
|
variables: { patches }
|
|
803
852
|
})
|
|
804
853
|
|
|
805
|
-
if (
|
|
806
|
-
|
|
807
|
-
|
|
854
|
+
if (validateInventoryChanges.data.validateOrderInventory) {
|
|
855
|
+
const response = await client.mutate({
|
|
856
|
+
mutation: gql`
|
|
857
|
+
mutation submitInventoryChanges($patches: [InventoryPatch!]!) {
|
|
858
|
+
submitInventoryChanges(patches: $patches)
|
|
859
|
+
}
|
|
860
|
+
`,
|
|
861
|
+
variables: { patches }
|
|
862
|
+
})
|
|
863
|
+
|
|
864
|
+
if (!response.errors) {
|
|
865
|
+
this.dataGrist.fetch()
|
|
866
|
+
this._showToast({ message: i18next.t('text.data_inventory_adjustment_has_been_submitted_for_approval') })
|
|
867
|
+
}
|
|
868
|
+
} else {
|
|
869
|
+
this._showToast({
|
|
870
|
+
type: 'error',
|
|
871
|
+
message: `${i18next.t('text.complete_the_picking_process_before_adjust_the_batch_number')}`
|
|
872
|
+
})
|
|
808
873
|
}
|
|
809
874
|
}
|
|
810
875
|
} catch (e) {
|
|
@@ -893,7 +958,7 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
|
|
|
893
958
|
if (!response.errors) {
|
|
894
959
|
history.back()
|
|
895
960
|
this.dataGrist.fetch()
|
|
896
|
-
this._showToast({ message: i18next.t('text.
|
|
961
|
+
this._showToast({ message: i18next.t('text.data_inventory_adjustment_has_been_submitted_for_approval') })
|
|
897
962
|
}
|
|
898
963
|
} catch (e) {
|
|
899
964
|
this._showToast(e)
|
|
@@ -1327,10 +1392,11 @@ class InventoryAdjustment extends connect(store)(localize(i18next)(PageView)) {
|
|
|
1327
1392
|
}
|
|
1328
1393
|
}
|
|
1329
1394
|
|
|
1330
|
-
_showToast({ type, message }) {
|
|
1395
|
+
_showToast({ level, type, message }) {
|
|
1331
1396
|
document.dispatchEvent(
|
|
1332
1397
|
new CustomEvent('notify', {
|
|
1333
1398
|
detail: {
|
|
1399
|
+
level,
|
|
1334
1400
|
type,
|
|
1335
1401
|
message
|
|
1336
1402
|
}
|
|
@@ -16,8 +16,6 @@ import { isMobileDevice } from '@things-factory/utils'
|
|
|
16
16
|
import { fetchLocationSortingRule } from '../../fetch-location-sorting-rule'
|
|
17
17
|
import { LOCATION_SORTING_RULE } from '../constants'
|
|
18
18
|
|
|
19
|
-
const _ = require('lodash')
|
|
20
|
-
|
|
21
19
|
class CreateCycleCount extends localize(i18next)(PageView) {
|
|
22
20
|
static get properties() {
|
|
23
21
|
return {
|
|
@@ -9,8 +9,6 @@ import { client, CustomAlert, gqlContext } from '@things-factory/shell'
|
|
|
9
9
|
import { ScrollbarStyles } from '@things-factory/styles'
|
|
10
10
|
import { flattenObject, isMobileDevice } from '@things-factory/utils'
|
|
11
11
|
|
|
12
|
-
const _ = require('lodash')
|
|
13
|
-
|
|
14
12
|
export class ProductDetailBizplaceSettingPopup extends localize(i18next)(LitElement) {
|
|
15
13
|
static get styles() {
|
|
16
14
|
return [
|
|
@@ -3,6 +3,9 @@ import '@things-factory/grist-ui'
|
|
|
3
3
|
|
|
4
4
|
import gql from 'graphql-tag'
|
|
5
5
|
import { css, html, LitElement } from 'lit-element'
|
|
6
|
+
import isEmpty from 'lodash-es/isEmpty'
|
|
7
|
+
import isNaN from 'lodash-es/isNaN'
|
|
8
|
+
import isNumber from 'lodash-es/isNumber'
|
|
6
9
|
|
|
7
10
|
import { getCodeByName } from '@things-factory/code-base'
|
|
8
11
|
import { i18next, localize } from '@things-factory/i18n-base'
|
|
@@ -10,8 +13,6 @@ import { client, CustomAlert, gqlContext } from '@things-factory/shell'
|
|
|
10
13
|
import { ScrollbarStyles } from '@things-factory/styles'
|
|
11
14
|
import { isMobileDevice } from '@things-factory/utils'
|
|
12
15
|
|
|
13
|
-
const _ = require('lodash')
|
|
14
|
-
|
|
15
16
|
export class ProductDetailsPopup extends localize(i18next)(LitElement) {
|
|
16
17
|
static get styles() {
|
|
17
18
|
return [
|
|
@@ -555,20 +556,20 @@ export class ProductDetailsPopup extends localize(i18next)(LitElement) {
|
|
|
555
556
|
let data = this.dataGrist._data.records.map(itm => {
|
|
556
557
|
itm.error = false
|
|
557
558
|
|
|
558
|
-
if (
|
|
559
|
+
if (isEmpty(itm.gtin) || '') {
|
|
559
560
|
itm.error = true
|
|
560
561
|
if (!errors.find(err => err.type == 'gtin')) errors.push({ type: 'gtin', value: 'GTIN is required' })
|
|
561
562
|
}
|
|
562
|
-
if (
|
|
563
|
+
if (isEmpty(itm.packingType) || '') {
|
|
563
564
|
itm.error = true
|
|
564
565
|
if (!errors.find(err => err.type == 'packingType'))
|
|
565
566
|
errors.push({ type: 'packingType', value: 'Packing type is required' })
|
|
566
567
|
}
|
|
567
|
-
if (
|
|
568
|
+
if (isEmpty(itm.uom) || '') {
|
|
568
569
|
itm.error = true
|
|
569
570
|
if (!errors.find(err => err.type == 'uom')) errors.push({ type: 'uom', value: 'UOM is required' })
|
|
570
571
|
}
|
|
571
|
-
if (!
|
|
572
|
+
if (!isNumber(itm.uomValue) || isNaN(itm.uomValue) || '') {
|
|
572
573
|
itm.error = true
|
|
573
574
|
if (!errors.find(err => err.type == 'uomValue'))
|
|
574
575
|
errors.push({ type: 'uomValue', value: 'UOM Value is required' })
|
|
@@ -626,7 +627,7 @@ export class ProductDetailsPopup extends localize(i18next)(LitElement) {
|
|
|
626
627
|
...this.dataGrist._data,
|
|
627
628
|
records: this._updateRowOption(
|
|
628
629
|
this.dataGrist._data.records.map((record, idx) => {
|
|
629
|
-
if (!
|
|
630
|
+
if (!isEmpty(record.childProductDetail) && record.childProductDetail == before) {
|
|
630
631
|
record.childProductDetail = after
|
|
631
632
|
}
|
|
632
633
|
return record
|
|
@@ -636,7 +637,7 @@ export class ProductDetailsPopup extends localize(i18next)(LitElement) {
|
|
|
636
637
|
|
|
637
638
|
break
|
|
638
639
|
case 'uomValue':
|
|
639
|
-
if (
|
|
640
|
+
if (isNaN(after)) {
|
|
640
641
|
updatedRecords.records[row].uomValue = 1
|
|
641
642
|
}
|
|
642
643
|
break
|
|
@@ -691,7 +692,7 @@ export class ProductDetailsPopup extends localize(i18next)(LitElement) {
|
|
|
691
692
|
value: ''
|
|
692
693
|
},
|
|
693
694
|
...data
|
|
694
|
-
.filter(child => child.gtin != itm.gtin && !
|
|
695
|
+
.filter(child => child.gtin != itm.gtin && !isEmpty(child.gtin))
|
|
695
696
|
.map(x => {
|
|
696
697
|
const rowOption = {
|
|
697
698
|
display: x.gtin,
|
|
@@ -5,6 +5,9 @@ import './product-detail-bizplace-setting-popup'
|
|
|
5
5
|
|
|
6
6
|
import gql from 'graphql-tag'
|
|
7
7
|
import { css, html } from 'lit-element'
|
|
8
|
+
import isEmpty from 'lodash-es/isEmpty'
|
|
9
|
+
import isNaN from 'lodash-es/isNaN'
|
|
10
|
+
import isNumber from 'lodash-es/isNumber'
|
|
8
11
|
|
|
9
12
|
import { getCodeByName } from '@things-factory/code-base'
|
|
10
13
|
import { i18next, localize } from '@things-factory/i18n-base'
|
|
@@ -14,8 +17,6 @@ import { client, CustomAlert, gqlContext, PageView } from '@things-factory/shell
|
|
|
14
17
|
import { CommonButtonStyles, ScrollbarStyles } from '@things-factory/styles'
|
|
15
18
|
import { isMobileDevice } from '@things-factory/utils'
|
|
16
19
|
|
|
17
|
-
const _ = require('lodash')
|
|
18
|
-
|
|
19
20
|
class ProductList extends localize(i18next)(PageView) {
|
|
20
21
|
static get properties() {
|
|
21
22
|
return {
|
|
@@ -652,7 +653,7 @@ class ProductList extends localize(i18next)(PageView) {
|
|
|
652
653
|
|
|
653
654
|
const response = await client.query({
|
|
654
655
|
query: gql`
|
|
655
|
-
query productsByBizplace($filters: [Filter], $pagination: Pagination, $sortings: [Sorting]) {
|
|
656
|
+
query productsByBizplace($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
|
|
656
657
|
productsByBizplace(filters: $filters, pagination: $pagination, sortings: $sortings) {
|
|
657
658
|
items {
|
|
658
659
|
sku
|
|
@@ -821,7 +822,7 @@ class ProductList extends localize(i18next)(PageView) {
|
|
|
821
822
|
|
|
822
823
|
async _saveProducts(patches) {
|
|
823
824
|
try {
|
|
824
|
-
if (
|
|
825
|
+
if (isEmpty(this._bizplaceInput.value) || this._bizplaceInput?.value == undefined) {
|
|
825
826
|
return this.showToast(i18next.t('text.no_company_selected'))
|
|
826
827
|
}
|
|
827
828
|
|
|
@@ -944,23 +945,23 @@ class ProductList extends localize(i18next)(PageView) {
|
|
|
944
945
|
_validate(data) {
|
|
945
946
|
let errors = []
|
|
946
947
|
data = data.map(itm => {
|
|
947
|
-
if (
|
|
948
|
+
if (isEmpty(itm.sku) || '') {
|
|
948
949
|
if (!errors.find(err => err.type == 'sku')) errors.push({ type: 'sku', value: 'Product SKU is required' })
|
|
949
950
|
}
|
|
950
|
-
if (
|
|
951
|
+
if (isEmpty(itm.name) || '') {
|
|
951
952
|
if (!errors.find(err => err.type == 'name')) errors.push({ type: 'name', value: 'Product name is required' })
|
|
952
953
|
}
|
|
953
|
-
if (
|
|
954
|
+
if (isEmpty(itm.type) || '') {
|
|
954
955
|
if (!errors.find(err => err.type == 'type')) errors.push({ type: 'name', value: 'Product type is required' })
|
|
955
956
|
}
|
|
956
|
-
if (
|
|
957
|
+
if (isEmpty(itm.packingType) || '') {
|
|
957
958
|
if (!errors.find(err => err.type == 'packingType'))
|
|
958
959
|
errors.push({ type: 'packingType', value: 'Packing type is required' })
|
|
959
960
|
}
|
|
960
|
-
if (
|
|
961
|
+
if (isEmpty(itm.uom) || '') {
|
|
961
962
|
if (!errors.find(err => err.type == 'uom')) errors.push({ type: 'uom', value: 'UOM is required' })
|
|
962
963
|
}
|
|
963
|
-
if (!
|
|
964
|
+
if (!isNumber(itm.uomValue) || isNaN(itm.uomValue) || '' || itm?.uomValue <= 0) {
|
|
964
965
|
if (!errors.find(err => err.type == 'uomValue'))
|
|
965
966
|
errors.push({ type: 'uomValue', value: 'UOM Value is required' })
|
|
966
967
|
}
|