@things-factory/operato-wms 4.0.11 → 4.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client/pages/adjustment/transfer-inventory.js +368 -165
- package/client/pages/bulk-operation/bulk-operation.js +316 -0
- package/client/pages/bulk-operation/validate-ro-popup.js +445 -0
- package/client/pages/components/select-product-popup.js +15 -2
- package/client/pages/constants/inventory.js +1 -0
- package/client/pages/constants/location.js +33 -6
- package/client/pages/constants/order.js +10 -0
- package/client/pages/constants/worksheet.js +2 -2
- package/client/pages/inbound/inbound-worksheet.js +78 -9
- package/client/pages/inbound/putaway-product.js +214 -139
- package/client/pages/inbound/putaway-worksheet-generate-popup.js +24 -2
- package/client/pages/inbound/unload-product.js +153 -61
- package/client/pages/inbound/worksheet-putaway-return.js +22 -5
- package/client/pages/inbound/worksheet-putaway.js +21 -8
- package/client/pages/inbound/worksheet-unloading-return.js +22 -5
- package/client/pages/inbound/worksheet-unloading.js +8 -0
- package/client/pages/inventory/inventory-adjustment-approval.js +11 -19
- package/client/pages/inventory/inventory-adjustment.js +88 -73
- package/client/pages/inventory/inventory-by-product-detail.js +3 -5
- package/client/pages/inventory/inventory-by-product.js +8 -0
- package/client/pages/inventory/inventory-history-by-pallet.js +12 -5
- package/client/pages/inventory/inventory-history.js +10 -0
- package/client/pages/inventory/onhand-inventory.js +11 -2
- package/client/pages/inventory-check/create-cycle-count.js +12 -6
- package/client/pages/inventory-check/cycle-count-report.js +8 -0
- package/client/pages/inventory-check/inspecting-product.js +146 -80
- package/client/pages/inventory-check/worksheet-cycle-count.js +14 -0
- package/client/pages/manifest/create-loading-manifest.js +314 -0
- package/client/pages/manifest/dispatcher-verification-popup.js +86 -0
- package/client/pages/manifest/loading-manifest-detail.js +345 -0
- package/client/pages/manifest/loading-manifest-list.js +305 -0
- package/client/pages/master/location-list.js +58 -17
- package/client/pages/master/product/product-detail-bizplace-setting-popup.js +2 -2
- package/client/pages/master/product/product-details-popup.js +2 -2
- package/client/pages/master/product/product-list.js +5 -5
- package/client/pages/order/arrival-notice/arrival-notice-detail.js +134 -115
- package/client/pages/order/arrival-notice/arrival-notice-list.js +87 -6
- package/client/pages/order/arrival-notice/arrival-notice-requests.js +83 -6
- package/client/pages/order/arrival-notice/assign-buffer-location.js +8 -1
- package/client/pages/order/arrival-notice/check-arrived-notice.js +9 -1
- package/client/pages/order/arrival-notice/create-arrival-notice.js +38 -3
- package/client/pages/order/arrival-notice/duplicate-arrival-notice.js +290 -25
- package/client/pages/order/arrival-notice/edit-product-popup.js +36 -5
- package/client/pages/order/arrival-notice/receive-arrival-notice.js +8 -1
- package/client/pages/order/goods-received-note/received-note-list.js +138 -6
- package/client/pages/order/release-order/b2b/b2b-order-list.js +45 -5
- package/client/pages/order/release-order/b2b/b2b-order-requests.js +52 -12
- package/client/pages/order/release-order/b2c/b2c-order-requests.js +244 -24
- package/client/pages/order/release-order/bulk-print-packing-list.js +23 -0
- package/client/pages/order/release-order/create-release-order.js +55 -8
- package/client/pages/order/release-order/receive-release-order-request.js +35 -24
- package/client/pages/order/release-order/release-extra-product-popup.js +204 -63
- package/client/pages/order/release-order/release-order-detail.js +301 -74
- package/client/pages/order/return-order/check-return-order.js +9 -1
- package/client/pages/order/return-order/create-return-order.js +14 -2
- package/client/pages/order/return-order/receive-return-order-requests.js +9 -1
- package/client/pages/order/return-order/return-order-detail.js +15 -6
- package/client/pages/order/return-order/return-order-inventory-popup.js +7 -0
- package/client/pages/order/reverse-kitting-order/reverse-kitting-order-detail.js +115 -50
- package/client/pages/order/reverse-kitting-order/reverse-kitting-order-list.js +1 -6
- package/client/pages/order/reverse-kitting-order/reverse-kitting-pallet-label-popup.js +239 -0
- package/client/pages/order/transport-order/delivery-order-list.js +102 -59
- package/client/pages/outbound/inventory-assign-popup.js +23 -6
- package/client/pages/outbound/inventory-auto-assign-popup.js +22 -6
- package/client/pages/outbound/loading-product.js +4 -1
- package/client/pages/outbound/merged-outbound-worksheet.js +43 -1
- package/client/pages/outbound/packing-product.js +4 -1
- package/client/pages/outbound/packing-worksheet-list.js +39 -1
- package/client/pages/outbound/picking-product.js +803 -431
- package/client/pages/outbound/picking-replacement-popup.js +1 -1
- package/client/pages/outbound/serial-number-popup.js +280 -0
- package/client/pages/outbound/single-outbound-worksheet.js +47 -1
- package/client/pages/outbound/worksheet-batch-picking.js +22 -8
- package/client/pages/outbound/worksheet-loading.js +22 -5
- package/client/pages/outbound/worksheet-packing.js +8 -0
- package/client/pages/outbound/worksheet-picking.js +62 -8
- package/client/pages/outbound/worksheet-return.js +9 -1
- package/client/pages/outbound/worksheet-sorting.js +9 -1
- package/client/pages/report/custom-elccl/elccl-inventory-report.js +31 -30
- package/client/pages/report/custom-elccl/elccl-inventory-summary-report.js +23 -26
- package/client/pages/report/inventory-pallet-storage-report.js +11 -10
- package/client/pages/report/inventory-report.js +41 -43
- package/client/pages/report/inventory-summary-report.js +25 -28
- package/client/pages/report/product-label-report.js +401 -0
- package/client/pages/support/inventory-comparison.js +296 -0
- package/client/pages/vas/print-product-label.js +298 -132
- package/client/pages/vas/reverse-kitting/execute-reverse-kitting.js +32 -12
- package/client/pages/vas/reverse-kitting/popup-combination-sets.js +106 -10
- package/client/pages/vas/reverse-kitting/popup-reverse-kitting-template.js +130 -19
- package/client/pages/vas/vas-pallet-label-popup.js +5 -8
- package/client/route.js +28 -0
- package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-report.js +1 -1
- package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-report.js.map +1 -1
- package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-summary-report.js +64 -54
- package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-summary-report.js.map +1 -1
- package/dist-server/graphql/resolvers/extra/add-release-good-products.js +34 -9
- package/dist-server/graphql/resolvers/extra/add-release-good-products.js.map +1 -1
- package/dist-server/graphql/resolvers/index.js +5 -1
- package/dist-server/graphql/resolvers/index.js.map +1 -1
- package/dist-server/graphql/resolvers/inventory-comparison/index.js +6 -0
- package/dist-server/graphql/resolvers/inventory-comparison/index.js.map +1 -0
- package/dist-server/graphql/resolvers/inventory-comparison/inventory-comparison-list.js +78 -0
- package/dist-server/graphql/resolvers/inventory-comparison/inventory-comparison-list.js.map +1 -0
- package/dist-server/graphql/resolvers/reports/index.js +2 -1
- package/dist-server/graphql/resolvers/reports/index.js.map +1 -1
- package/dist-server/graphql/resolvers/reports/product-label-report.js +56 -0
- package/dist-server/graphql/resolvers/reports/product-label-report.js.map +1 -0
- package/dist-server/graphql/resolvers/shipping-provider/index.js +6 -0
- package/dist-server/graphql/resolvers/shipping-provider/index.js.map +1 -0
- package/dist-server/graphql/resolvers/shipping-provider/shipping-providers.js +20 -0
- package/dist-server/graphql/resolvers/shipping-provider/shipping-providers.js.map +1 -0
- package/dist-server/graphql/types/custom/elccl/elccl-inventory-report.js +1 -1
- package/dist-server/graphql/types/index.js +8 -2
- package/dist-server/graphql/types/index.js.map +1 -1
- package/dist-server/graphql/types/inventory-comparison/index.js +13 -0
- package/dist-server/graphql/types/inventory-comparison/index.js.map +1 -0
- package/dist-server/graphql/types/inventory-comparison/inventory-comparison-list.js +14 -0
- package/dist-server/graphql/types/inventory-comparison/inventory-comparison-list.js.map +1 -0
- package/dist-server/graphql/types/inventory-comparison/inventory-comparison.js +18 -0
- package/dist-server/graphql/types/inventory-comparison/inventory-comparison.js.map +1 -0
- package/dist-server/graphql/types/reports/index.js +6 -1
- package/dist-server/graphql/types/reports/index.js.map +1 -1
- package/dist-server/graphql/types/reports/product-label-report-list.js +14 -0
- package/dist-server/graphql/types/reports/product-label-report-list.js.map +1 -0
- package/dist-server/graphql/types/reports/product-label-report.js +16 -0
- package/dist-server/graphql/types/reports/product-label-report.js.map +1 -0
- package/dist-server/graphql/types/shipping-provider/index.js +10 -0
- package/dist-server/graphql/types/shipping-provider/index.js.map +1 -0
- package/dist-server/graphql/types/shipping-provider/shipping-provider-list.js +13 -0
- package/dist-server/graphql/types/shipping-provider/shipping-provider-list.js.map +1 -0
- package/dist-server/graphql/types/shipping-provider/shipping-provider.js +13 -0
- package/dist-server/graphql/types/shipping-provider/shipping-provider.js.map +1 -0
- package/package.json +65 -65
- package/server/graphql/resolvers/custom/elccl/elccl-inventory-history-report.ts +4 -2
- package/server/graphql/resolvers/custom/elccl/elccl-inventory-history-summary-report.ts +75 -65
- package/server/graphql/resolvers/extra/add-release-good-products.ts +57 -15
- package/server/graphql/resolvers/index.ts +5 -1
- package/server/graphql/resolvers/inventory-comparison/index.ts +5 -0
- package/server/graphql/resolvers/inventory-comparison/inventory-comparison-list.ts +99 -0
- package/server/graphql/resolvers/reports/index.ts +3 -1
- package/server/graphql/resolvers/reports/product-label-report.ts +56 -0
- package/server/graphql/resolvers/shipping-provider/index.ts +5 -0
- package/server/graphql/resolvers/shipping-provider/shipping-providers.ts +20 -0
- package/server/graphql/types/custom/elccl/elccl-inventory-report.ts +1 -1
- package/server/graphql/types/index.ts +8 -2
- package/server/graphql/types/inventory-comparison/index.ts +11 -0
- package/server/graphql/types/inventory-comparison/inventory-comparison-list.ts +8 -0
- package/server/graphql/types/inventory-comparison/inventory-comparison.ts +12 -0
- package/server/graphql/types/reports/index.ts +6 -1
- package/server/graphql/types/reports/product-label-report-list.ts +8 -0
- package/server/graphql/types/reports/product-label-report.ts +10 -0
- package/server/graphql/types/shipping-provider/index.ts +8 -0
- package/server/graphql/types/shipping-provider/shipping-provider-list.ts +7 -0
- package/server/graphql/types/shipping-provider/shipping-provider.ts +7 -0
- package/things-factory.config.js +30 -0
- package/translations/en.json +91 -11
- package/translations/ko.json +109 -11
- package/translations/ms.json +111 -12
- package/translations/zh.json +123 -26
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import '@things-factory/grist-ui'
|
|
2
2
|
import '@things-factory/biz-ui'
|
|
3
|
+
import '@things-factory/import-ui'
|
|
3
4
|
import '../../components/select-product-popup'
|
|
4
5
|
import '../../order/vas-order/popup/vas-create-popup'
|
|
5
6
|
|
|
@@ -12,7 +13,7 @@ import { i18next, localize } from '@things-factory/i18n-base'
|
|
|
12
13
|
import { openPopup } from '@things-factory/layout-base'
|
|
13
14
|
import { client, CustomAlert, navigate, PageView } from '@things-factory/shell'
|
|
14
15
|
import { CommonButtonStyles } from '@things-factory/styles'
|
|
15
|
-
import {
|
|
16
|
+
import { isMobileDevice } from '@things-factory/utils'
|
|
16
17
|
|
|
17
18
|
import { fetchSettingRule } from '../../../fetch-setting-value'
|
|
18
19
|
import { VAS_BATCH_AND_PRODUCT_TYPE, VAS_BATCH_NO_TYPE, VAS_PRODUCT_TYPE } from '../../constants'
|
|
@@ -353,6 +354,8 @@ class DuplicateArrivalNotice extends localize(i18next)(PageView) {
|
|
|
353
354
|
super()
|
|
354
355
|
this.productData = { records: [] }
|
|
355
356
|
this.vasData = { records: [] }
|
|
357
|
+
this._bizplaceId = ''
|
|
358
|
+
this._bizplaceName = ''
|
|
356
359
|
this.containerSizes = []
|
|
357
360
|
this._importedOrder = false
|
|
358
361
|
this._hasContainer = false
|
|
@@ -365,6 +368,7 @@ class DuplicateArrivalNotice extends localize(i18next)(PageView) {
|
|
|
365
368
|
this._enableTransportationServiceSetting = false
|
|
366
369
|
this._enableTransportForCustomClearanceSetting = false
|
|
367
370
|
this._disableTransport = false
|
|
371
|
+
this._strictProductSelection = false
|
|
368
372
|
}
|
|
369
373
|
|
|
370
374
|
get arrivalNoticeForm() {
|
|
@@ -515,6 +519,7 @@ class DuplicateArrivalNotice extends localize(i18next)(PageView) {
|
|
|
515
519
|
*/
|
|
516
520
|
_configureProductGrist() {
|
|
517
521
|
let editable = this._bizplaceId ? true : false
|
|
522
|
+
let strictEditable = this._bizplaceId ? !this._strictProductSelection : false
|
|
518
523
|
|
|
519
524
|
const crossDockingColumns = [
|
|
520
525
|
{
|
|
@@ -567,6 +572,13 @@ class DuplicateArrivalNotice extends localize(i18next)(PageView) {
|
|
|
567
572
|
},
|
|
568
573
|
width: 350
|
|
569
574
|
},
|
|
575
|
+
{
|
|
576
|
+
type: 'string',
|
|
577
|
+
name: 'productBrand',
|
|
578
|
+
header: i18next.t('field.brand'),
|
|
579
|
+
imex: { header: i18next.t('field.brand'), key: 'productBrand', width: 25, type: 'string' },
|
|
580
|
+
width: 150
|
|
581
|
+
},
|
|
570
582
|
{
|
|
571
583
|
type: 'object',
|
|
572
584
|
name: 'product',
|
|
@@ -576,8 +588,15 @@ class DuplicateArrivalNotice extends localize(i18next)(PageView) {
|
|
|
576
588
|
type: 'select',
|
|
577
589
|
name: 'packingType',
|
|
578
590
|
header: i18next.t('field.packing_type'),
|
|
591
|
+
imex: {
|
|
592
|
+
header: i18next.t('field.packing_type'),
|
|
593
|
+
key: 'packingType',
|
|
594
|
+
width: 20,
|
|
595
|
+
type: 'array',
|
|
596
|
+
arrData: this.packingTypes
|
|
597
|
+
},
|
|
579
598
|
record: {
|
|
580
|
-
editable:
|
|
599
|
+
editable: strictEditable,
|
|
581
600
|
options: [
|
|
582
601
|
{
|
|
583
602
|
display: '',
|
|
@@ -594,8 +613,15 @@ class DuplicateArrivalNotice extends localize(i18next)(PageView) {
|
|
|
594
613
|
type: 'select',
|
|
595
614
|
name: 'uom',
|
|
596
615
|
header: i18next.t('field.uom'),
|
|
616
|
+
imex: {
|
|
617
|
+
header: i18next.t('field.uom'),
|
|
618
|
+
key: 'uom',
|
|
619
|
+
width: 20,
|
|
620
|
+
type: 'array',
|
|
621
|
+
arrData: this.uomValueUnits
|
|
622
|
+
},
|
|
597
623
|
record: {
|
|
598
|
-
editable:
|
|
624
|
+
editable: strictEditable,
|
|
599
625
|
options: [
|
|
600
626
|
{
|
|
601
627
|
display: '',
|
|
@@ -696,6 +722,18 @@ class DuplicateArrivalNotice extends localize(i18next)(PageView) {
|
|
|
696
722
|
...e.detail
|
|
697
723
|
})
|
|
698
724
|
|
|
725
|
+
this.productGrist.dirtyData.records = this.productGrist.dirtyData.records.map(item => {
|
|
726
|
+
return {
|
|
727
|
+
...item,
|
|
728
|
+
totalUomValue:
|
|
729
|
+
item?.packQty > 0
|
|
730
|
+
? item?.totalUomValue
|
|
731
|
+
? item.totalUomValue
|
|
732
|
+
: `${parseFloat(item.packQty * e.detail.uomValue).toFixed(2)} ${e.detail.uom}`
|
|
733
|
+
: null
|
|
734
|
+
}
|
|
735
|
+
})
|
|
736
|
+
|
|
699
737
|
this.productData = {
|
|
700
738
|
...this.productData,
|
|
701
739
|
records: [...this.productGrist.dirtyData.records]
|
|
@@ -743,6 +781,26 @@ class DuplicateArrivalNotice extends localize(i18next)(PageView) {
|
|
|
743
781
|
}
|
|
744
782
|
}
|
|
745
783
|
|
|
784
|
+
if (changedColumn === 'manufactureYear') {
|
|
785
|
+
let manufactureYear = changeRecord.manufactureYear
|
|
786
|
+
const regExp = /^(181[2-9]|18[2-9]\d|19\d\d|2\d{3}|30[0-3]\d|304[0-8])$/
|
|
787
|
+
|
|
788
|
+
if (typeof manufactureYear === undefined || !regExp.test(manufactureYear)) {
|
|
789
|
+
if (manufactureYear === 0) {
|
|
790
|
+
delete event.detail.after[event.detail.column.name]
|
|
791
|
+
} else {
|
|
792
|
+
throw new Error(i18next.t('text.invalid_x', { state: { x: i18next.t('label.manufacture_year') } }))
|
|
793
|
+
}
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
if (changedColumn === 'unitPrice') {
|
|
798
|
+
let unitPrice = changeRecord.unitPrice
|
|
799
|
+
if (typeof unitPrice === undefined || unitPrice < 0) {
|
|
800
|
+
throw new Error(i18next.t('text.x_should_be_positive', { state: { x: i18next.t('label.unit_price') } }))
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
|
|
746
804
|
this._updateVasTargets(true)
|
|
747
805
|
} catch (e) {
|
|
748
806
|
const beforeValue = event.detail.before && event.detail.before[event.detail.column.name]
|
|
@@ -1021,7 +1079,7 @@ class DuplicateArrivalNotice extends localize(i18next)(PageView) {
|
|
|
1021
1079
|
let arrivalNotice = this._getFormInfo()
|
|
1022
1080
|
delete arrivalNotice.warehouseTransport
|
|
1023
1081
|
arrivalNotice.orderProducts = this._getOrderProducts()
|
|
1024
|
-
const
|
|
1082
|
+
const fileUploader = this._document?.files ? this._document.files : undefined
|
|
1025
1083
|
|
|
1026
1084
|
if (arrivalNotice.orderProducts.some(orderProduct => !orderProduct.palletQty)) {
|
|
1027
1085
|
const result = await CustomAlert({
|
|
@@ -1039,30 +1097,25 @@ class DuplicateArrivalNotice extends localize(i18next)(PageView) {
|
|
|
1039
1097
|
delete arrivalNotice.bizplaceId
|
|
1040
1098
|
delete arrivalNotice.bizplaceName
|
|
1041
1099
|
|
|
1042
|
-
const
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
const response = await client.query({
|
|
1051
|
-
query: gql`
|
|
1052
|
-
mutation ($attachments: Upload) {
|
|
1053
|
-
generateArrivalNotice(${gqlBuilder.buildArgs(args)}, file:$attachments) {
|
|
1054
|
-
id
|
|
1055
|
-
name
|
|
1056
|
-
crossDocking
|
|
1057
|
-
}
|
|
1100
|
+
const response = await client.mutate({
|
|
1101
|
+
mutation: gql`
|
|
1102
|
+
mutation generateArrivalNotice($arrivalNotice: NewArrivalNotice!, $files: [Upload!]) {
|
|
1103
|
+
generateArrivalNotice(arrivalNotice: $arrivalNotice, files: $files) {
|
|
1104
|
+
id
|
|
1105
|
+
name
|
|
1106
|
+
crossDocking
|
|
1058
1107
|
}
|
|
1059
|
-
|
|
1108
|
+
}
|
|
1109
|
+
`,
|
|
1060
1110
|
variables: {
|
|
1061
|
-
|
|
1111
|
+
arrivalNotice: {
|
|
1112
|
+
...arrivalNotice,
|
|
1113
|
+
partnerBizplaceId: this._bizplaceId,
|
|
1114
|
+
ownTransport: this._importedOrder ? true : this._ownTransport
|
|
1115
|
+
},
|
|
1116
|
+
files: fileUploader
|
|
1062
1117
|
},
|
|
1063
|
-
context: {
|
|
1064
|
-
hasUpload: true
|
|
1065
|
-
}
|
|
1118
|
+
context: { hasUpload: true }
|
|
1066
1119
|
})
|
|
1067
1120
|
|
|
1068
1121
|
if (!response.errors) {
|
|
@@ -1506,6 +1559,218 @@ class DuplicateArrivalNotice extends localize(i18next)(PageView) {
|
|
|
1506
1559
|
)
|
|
1507
1560
|
}
|
|
1508
1561
|
|
|
1562
|
+
excelColumns() {
|
|
1563
|
+
const productColumns = [
|
|
1564
|
+
{
|
|
1565
|
+
type: 'string',
|
|
1566
|
+
name: 'batchId',
|
|
1567
|
+
header: i18next.t('field.batch_id'),
|
|
1568
|
+
imex: { header: i18next.t('field.batch_id'), key: 'batchId', width: 25, type: 'string' },
|
|
1569
|
+
width: 100
|
|
1570
|
+
},
|
|
1571
|
+
{
|
|
1572
|
+
type: 'string',
|
|
1573
|
+
name: 'productSKU',
|
|
1574
|
+
header: i18next.t('field.sku'),
|
|
1575
|
+
imex: { header: i18next.t('field.sku'), key: 'productSKU', width: 25, type: 'string' },
|
|
1576
|
+
width: 100
|
|
1577
|
+
},
|
|
1578
|
+
{
|
|
1579
|
+
type: 'string',
|
|
1580
|
+
name: 'packingType',
|
|
1581
|
+
header: i18next.t('field.packing_type'),
|
|
1582
|
+
imex: { header: i18next.t('field.packing_type'), key: 'packingType', width: 25, type: 'string' },
|
|
1583
|
+
width: 100
|
|
1584
|
+
},
|
|
1585
|
+
{
|
|
1586
|
+
type: 'integer',
|
|
1587
|
+
name: 'packQty',
|
|
1588
|
+
header: i18next.t('field.pack_qty'),
|
|
1589
|
+
imex: { header: i18next.t('field.pack_qty'), key: 'packQty', width: 25, type: 'float' },
|
|
1590
|
+
width: 100
|
|
1591
|
+
},
|
|
1592
|
+
{
|
|
1593
|
+
type: 'integer',
|
|
1594
|
+
name: 'palletQty',
|
|
1595
|
+
header: i18next.t('field.pallet_qty'),
|
|
1596
|
+
imex: { header: i18next.t('field.pallet_qty'), key: 'palletQty', width: 25, type: 'float' },
|
|
1597
|
+
width: 100
|
|
1598
|
+
},
|
|
1599
|
+
{
|
|
1600
|
+
type: 'integer',
|
|
1601
|
+
name: 'manufactureYear',
|
|
1602
|
+
header: i18next.t('field.manufacture_year'),
|
|
1603
|
+
imex: { header: i18next.t('field.manufacture_year'), key: 'manufactureYear', width: 25, type: 'float' },
|
|
1604
|
+
width: 100
|
|
1605
|
+
},
|
|
1606
|
+
{
|
|
1607
|
+
type: 'string',
|
|
1608
|
+
name: 'batchIdRef',
|
|
1609
|
+
header: i18next.t('field.batch_id_ref'),
|
|
1610
|
+
imex: { header: i18next.t('field.batch_id_ref'), key: 'batchIdRef', width: 25, type: 'string' },
|
|
1611
|
+
width: 100
|
|
1612
|
+
},
|
|
1613
|
+
{
|
|
1614
|
+
type: 'float',
|
|
1615
|
+
name: 'unitPrice',
|
|
1616
|
+
header: i18next.t('field.unit_price'),
|
|
1617
|
+
imex: { header: i18next.t('field.unit_price'), key: 'unitPrice', width: 25, type: 'float' },
|
|
1618
|
+
width: 100
|
|
1619
|
+
},
|
|
1620
|
+
{
|
|
1621
|
+
type: 'string',
|
|
1622
|
+
name: 'remark',
|
|
1623
|
+
header: i18next.t('field.remark'),
|
|
1624
|
+
imex: { header: i18next.t('field.remark'), key: 'remark', width: 25, type: 'string' },
|
|
1625
|
+
width: 100
|
|
1626
|
+
}
|
|
1627
|
+
]
|
|
1628
|
+
|
|
1629
|
+
return productColumns
|
|
1630
|
+
}
|
|
1631
|
+
|
|
1632
|
+
async _exportableData() {
|
|
1633
|
+
try {
|
|
1634
|
+
var headerSetting = [
|
|
1635
|
+
...this.excelColumns()
|
|
1636
|
+
.filter(column => column.type !== 'gutter' && column.imex !== undefined)
|
|
1637
|
+
.map(column => {
|
|
1638
|
+
return column.imex
|
|
1639
|
+
})
|
|
1640
|
+
]
|
|
1641
|
+
|
|
1642
|
+
return { header: headerSetting, data: [] }
|
|
1643
|
+
} catch (e) {
|
|
1644
|
+
this._showToast(e)
|
|
1645
|
+
}
|
|
1646
|
+
}
|
|
1647
|
+
|
|
1648
|
+
async bulkUploadValidateOrderProducts(patches) {
|
|
1649
|
+
const response = await client.query({
|
|
1650
|
+
query: gql`
|
|
1651
|
+
query bulkUploadValidateOrderProducts($orderProducts: [NewOrderProduct], $partnerBizplaceId: String!) {
|
|
1652
|
+
bulkUploadValidateOrderProducts(orderProducts: $orderProducts, partnerBizplaceId: $partnerBizplaceId) {
|
|
1653
|
+
id
|
|
1654
|
+
packingType
|
|
1655
|
+
packingSize
|
|
1656
|
+
uom
|
|
1657
|
+
uomValue
|
|
1658
|
+
totalUomValue
|
|
1659
|
+
packQty
|
|
1660
|
+
palletQty
|
|
1661
|
+
manufactureYear
|
|
1662
|
+
batchId
|
|
1663
|
+
batchIdRef
|
|
1664
|
+
unitPrice
|
|
1665
|
+
remark
|
|
1666
|
+
productSKU
|
|
1667
|
+
productName
|
|
1668
|
+
isError
|
|
1669
|
+
product {
|
|
1670
|
+
id
|
|
1671
|
+
name
|
|
1672
|
+
sku
|
|
1673
|
+
description
|
|
1674
|
+
type
|
|
1675
|
+
primaryUnit
|
|
1676
|
+
primaryValue
|
|
1677
|
+
}
|
|
1678
|
+
}
|
|
1679
|
+
}
|
|
1680
|
+
`,
|
|
1681
|
+
variables: { orderProducts: patches, partnerBizplaceId: this._bizplaceId }
|
|
1682
|
+
})
|
|
1683
|
+
|
|
1684
|
+
if (!response.errors) {
|
|
1685
|
+
const data = response.data.bulkUploadValidateOrderProducts.map(item => {
|
|
1686
|
+
return {
|
|
1687
|
+
...item,
|
|
1688
|
+
productName: item?.productName,
|
|
1689
|
+
unitPrice: parseFloat(item.unitPrice) || '',
|
|
1690
|
+
manufactureYear: parseFloat(item.manufactureYear) || '',
|
|
1691
|
+
packQty: parseFloat(item.packQty) || '',
|
|
1692
|
+
palletQty: parseFloat(item.palletQty) || ''
|
|
1693
|
+
}
|
|
1694
|
+
})
|
|
1695
|
+
this.productData = {
|
|
1696
|
+
...this.productData,
|
|
1697
|
+
records: data.map((dt, idx) => {
|
|
1698
|
+
return {
|
|
1699
|
+
...dt,
|
|
1700
|
+
id: idx,
|
|
1701
|
+
name: idx,
|
|
1702
|
+
__dirty__: '+'
|
|
1703
|
+
}
|
|
1704
|
+
})
|
|
1705
|
+
}
|
|
1706
|
+
|
|
1707
|
+
this.productGrist.fetch()
|
|
1708
|
+
}
|
|
1709
|
+
}
|
|
1710
|
+
|
|
1711
|
+
async importHandler(patches) {
|
|
1712
|
+
patches.map(itm => {
|
|
1713
|
+
itm.unitPrice = parseFloat(itm.unitPrice) || ''
|
|
1714
|
+
itm.manufactureYear = parseFloat(itm.manufactureYear) || ''
|
|
1715
|
+
itm.packQty = parseFloat(itm.packQty) || ''
|
|
1716
|
+
itm.palletQty = parseFloat(itm.palletQty) || ''
|
|
1717
|
+
})
|
|
1718
|
+
|
|
1719
|
+
this.productData = {
|
|
1720
|
+
records: [...patches]
|
|
1721
|
+
}
|
|
1722
|
+
|
|
1723
|
+
const orderProducts = patches.map(patch => {
|
|
1724
|
+
delete patch.cuFlag
|
|
1725
|
+
return {
|
|
1726
|
+
...patch,
|
|
1727
|
+
unitPrice: parseFloat(patch.unitPrice) || 0,
|
|
1728
|
+
manufactureYear: parseFloat(patch.manufactureYear) || 0,
|
|
1729
|
+
packQty: parseFloat(patch.packQty) || 0,
|
|
1730
|
+
palletQty: parseFloat(patch.palletQty) || 0
|
|
1731
|
+
}
|
|
1732
|
+
})
|
|
1733
|
+
await this.bulkUploadValidateOrderProducts(orderProducts)
|
|
1734
|
+
history.back()
|
|
1735
|
+
}
|
|
1736
|
+
|
|
1737
|
+
async _importableData(records) {
|
|
1738
|
+
try {
|
|
1739
|
+
if (this._bizplaceId) {
|
|
1740
|
+
records = records
|
|
1741
|
+
.filter(record => record.productSKU)
|
|
1742
|
+
.map(record => {
|
|
1743
|
+
return {
|
|
1744
|
+
...record
|
|
1745
|
+
}
|
|
1746
|
+
})
|
|
1747
|
+
|
|
1748
|
+
openPopup(
|
|
1749
|
+
html`
|
|
1750
|
+
<import-pop-up
|
|
1751
|
+
.records=${records}
|
|
1752
|
+
.config=${{
|
|
1753
|
+
rows: this.productGristConfig.rows,
|
|
1754
|
+
columns: [...this.excelColumns().filter(column => column.imex !== undefined)]
|
|
1755
|
+
}}
|
|
1756
|
+
.importHandler="${await this.importHandler.bind(this)}"
|
|
1757
|
+
></import-pop-up>
|
|
1758
|
+
`,
|
|
1759
|
+
{
|
|
1760
|
+
backdrop: true,
|
|
1761
|
+
escapable: false,
|
|
1762
|
+
size: 'large',
|
|
1763
|
+
title: i18next.t('title.import')
|
|
1764
|
+
}
|
|
1765
|
+
)
|
|
1766
|
+
} else {
|
|
1767
|
+
throw new Error(i18next.t('text.please_select_a_company'))
|
|
1768
|
+
}
|
|
1769
|
+
} catch (e) {
|
|
1770
|
+
this._showToast(e)
|
|
1771
|
+
}
|
|
1772
|
+
}
|
|
1773
|
+
|
|
1509
1774
|
_showToast({ type, message }) {
|
|
1510
1775
|
document.dispatchEvent(
|
|
1511
1776
|
new CustomEvent('notify', {
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import '@things-factory/grist-ui'
|
|
2
|
+
import '../../components/select-product-popup'
|
|
3
|
+
|
|
4
|
+
import gql from 'graphql-tag'
|
|
5
|
+
import { css, html, LitElement } from 'lit-element'
|
|
6
|
+
|
|
2
7
|
import { i18next, localize } from '@things-factory/i18n-base'
|
|
8
|
+
import { openPopup } from '@things-factory/layout-base'
|
|
3
9
|
import { client, CustomAlert } from '@things-factory/shell'
|
|
4
10
|
import { ScrollbarStyles } from '@things-factory/styles'
|
|
5
11
|
import { isMobileDevice } from '@things-factory/utils'
|
|
6
|
-
|
|
7
|
-
import gql from 'graphql-tag'
|
|
8
|
-
import { css, html, LitElement } from 'lit-element'
|
|
9
|
-
import '../../components/select-product-popup'
|
|
12
|
+
|
|
10
13
|
import { ORDER_PRODUCT_STATUS } from '../../constants'
|
|
11
14
|
|
|
12
15
|
export class EditProductPopup extends localize(i18next)(LitElement) {
|
|
@@ -411,6 +414,33 @@ export class EditProductPopup extends localize(i18next)(LitElement) {
|
|
|
411
414
|
changeRecord[key] = calcedAmount[key]
|
|
412
415
|
}
|
|
413
416
|
}
|
|
417
|
+
|
|
418
|
+
if (changedColumn === 'manufactureYear') {
|
|
419
|
+
let manufactureYear = changeRecord.manufactureYear
|
|
420
|
+
const regExp = /^(181[2-9]|18[2-9]\d|19\d\d|2\d{3}|30[0-3]\d|304[0-8])$/
|
|
421
|
+
|
|
422
|
+
if (typeof manufactureYear === undefined || !regExp.test(manufactureYear)) {
|
|
423
|
+
if (manufactureYear === 0) {
|
|
424
|
+
delete event.detail.after[event.detail.column.name]
|
|
425
|
+
} else {
|
|
426
|
+
throw new Error(i18next.t('text.invalid_x', { state: { x: i18next.t('label.manufacture_year') } }))
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
if (changedColumn === 'unitPrice') {
|
|
432
|
+
let unitPrice = changeRecord.unitPrice
|
|
433
|
+
if (typeof unitPrice === undefined || unitPrice < 0) {
|
|
434
|
+
throw new Error(i18next.t('text.x_should_be_positive', { state: { x: i18next.t('label.unit_price') } }))
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
if (changedColumn === 'palletQty') {
|
|
439
|
+
let palletQty = changeRecord.palletQty
|
|
440
|
+
if (typeof palletQty === undefined || palletQty < 0 || isNaN(palletQty)) {
|
|
441
|
+
throw new Error(i18next.t('text.invalid_x', { state: { x: i18next.t('label.pallet_qty') } }))
|
|
442
|
+
}
|
|
443
|
+
}
|
|
414
444
|
} catch (e) {
|
|
415
445
|
const beforeValue = event.detail.before && event.detail.before[event.detail.column.name]
|
|
416
446
|
if (beforeValue) {
|
|
@@ -635,7 +665,8 @@ export class EditProductPopup extends localize(i18next)(LitElement) {
|
|
|
635
665
|
adjustedBatchIdRef: record?.batchIdRef ? record.batchIdRef : null,
|
|
636
666
|
unitPrice: 0,
|
|
637
667
|
adjustedUnitPrice: record?.unitPrice ? record.unitPrice : null,
|
|
638
|
-
remark: record?.remark ? record.remark : null
|
|
668
|
+
remark: record?.remark ? record.remark : null,
|
|
669
|
+
packingSize: record.packingSize || record.product.packingSize
|
|
639
670
|
}
|
|
640
671
|
})
|
|
641
672
|
}
|
|
@@ -454,6 +454,7 @@ class ReceiveArrivalNotice extends localize(i18next)(PageView) {
|
|
|
454
454
|
name
|
|
455
455
|
description
|
|
456
456
|
sku
|
|
457
|
+
brand
|
|
457
458
|
}
|
|
458
459
|
remark
|
|
459
460
|
unitPrice
|
|
@@ -527,7 +528,7 @@ class ReceiveArrivalNotice extends localize(i18next)(PageView) {
|
|
|
527
528
|
this.setProductGristConfig()
|
|
528
529
|
this.productData = {
|
|
529
530
|
records: orderProducts.map(record => {
|
|
530
|
-
return { ...record, productSku: record.product.sku }
|
|
531
|
+
return { ...record, productSku: record.product.sku, productBrand: record.product.brand }
|
|
531
532
|
})
|
|
532
533
|
}
|
|
533
534
|
this.vasData = {
|
|
@@ -582,6 +583,12 @@ class ReceiveArrivalNotice extends localize(i18next)(PageView) {
|
|
|
582
583
|
record: { options: { queryName: 'products' } },
|
|
583
584
|
width: 350
|
|
584
585
|
},
|
|
586
|
+
{
|
|
587
|
+
type: 'string',
|
|
588
|
+
name: 'productBrand',
|
|
589
|
+
header: i18next.t('field.brand'),
|
|
590
|
+
width: 150
|
|
591
|
+
},
|
|
585
592
|
{
|
|
586
593
|
type: 'string',
|
|
587
594
|
name: 'packingType',
|