@things-factory/operato-wms 5.0.0-alpha.5 → 5.0.0-alpha.52
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/.eslintrc.json +11 -0
- package/client/constants/index.js +1 -0
- package/client/constants/order.js +14 -0
- package/client/pages/constants/index.js +2 -0
- package/client/pages/constants/inventory-item-change.js +10 -0
- package/client/pages/constants/order.js +5 -0
- package/client/pages/constants/picking-strategy.js +4 -0
- package/client/pages/constants/setting.js +2 -0
- package/client/pages/constants/tote.js +14 -0
- package/client/pages/inbound/pallet-label-popup.js +6 -0
- package/client/pages/inbound/putaway-product.js +3 -1
- package/client/pages/inbound/serial-number-list-popup.js +341 -0
- package/client/pages/inbound/unload-product.js +237 -48
- package/client/pages/inbound/unloaded-inventories-popup.js +7 -0
- package/client/pages/inventory/inventory-adjustment-approval.js +57 -11
- package/client/pages/inventory/inventory-adjustment.js +264 -20
- package/client/pages/inventory/inventory-by-product-detail.js +1 -1
- package/client/pages/inventory/non-loaded-inventory.js +365 -0
- package/client/pages/inventory/onhand-inventory.js +27 -0
- package/client/pages/inventory/serial-number-list-popup.js +468 -0
- package/client/pages/inventory-check/create-cycle-count.js +1 -0
- package/client/pages/inventory-check/inspecting-product.js +13 -7
- package/client/pages/manifest/create-loading-manifest.js +1 -0
- package/client/pages/master/pallet-list.js +24 -0
- package/client/pages/master/product/product-list.js +1 -1
- 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/edit-product-popup.js +13 -0
- 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/goods-received-note/customer-received-note.js +3 -0
- package/client/pages/order/goods-received-note/received-note-detail.js +3 -0
- package/client/pages/order/release-order/b2b/b2b-order-list.js +65 -19
- package/client/pages/order/release-order/b2c/b2c-order-requests.js +100 -33
- package/client/pages/order/release-order/batch-picking-popup.js +8 -0
- package/client/pages/order/release-order/bulk-print-packing-list.js +4 -0
- package/client/pages/order/release-order/create-release-order.js +1 -0
- package/client/pages/order/release-order/receive-release-order-request.js +0 -2
- package/client/pages/order/release-order/release-extra-product-popup.js +15 -10
- package/client/pages/order/release-order/release-order-detail.js +55 -27
- 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/create-vas-order.js +1 -0
- package/client/pages/order/vas-order/receive-vas-order.js +0 -2
- package/client/pages/outbound/inventory-assign-popup.js +10 -26
- package/client/pages/outbound/inventory-auto-assign-popup.js +26 -50
- package/client/pages/outbound/loading-product.js +52 -14
- package/client/pages/outbound/merged-outbound-worksheet.js +155 -4
- package/client/pages/outbound/order-remark-popup.js +112 -0
- package/client/pages/outbound/packing-product.js +233 -89
- package/client/pages/outbound/packing-worksheet-list.js +15 -0
- package/client/pages/outbound/picking-product.js +282 -66
- package/client/pages/outbound/picking-replacement-popup.js +5 -0
- package/client/pages/outbound/return-pallet-check-popup.js +7 -1
- package/client/pages/outbound/route-label-popup.js +464 -0
- package/client/pages/outbound/select-operator-popup.js +86 -14
- package/client/pages/outbound/serial-number-popup.js +188 -73
- package/client/pages/outbound/single-outbound-worksheet.js +149 -4
- package/client/pages/outbound/sorting-product.js +198 -44
- package/client/pages/outbound/tote-popup.js +461 -0
- package/client/pages/outbound/worksheet-batch-picking.js +23 -20
- package/client/pages/outbound/worksheet-packing.js +7 -2
- package/client/pages/outbound/worksheet-picking.js +14 -11
- package/client/pages/report/costing-report.js +453 -0
- package/client/pages/report/custom-elccl/elccl-inventory-summary-report.js +2 -2
- package/client/pages/report/inbound-order-details-report.js +14 -0
- package/client/pages/report/inbound-serial-number-report.js +452 -0
- package/client/pages/report/inventory-summary-report.js +11 -2
- package/client/pages/report/outbound-order-details-report.js +94 -9
- package/client/pages/report/outbound-serial-number-report.js +467 -0
- package/client/pages/report/volume-summary-report.js +606 -0
- package/client/pages/vas/abstract-execute-vas.js +12 -7
- package/client/pages/vas/print-product-label.js +15 -6
- package/client/pages/vas/reverse-kitting/execute-reverse-kitting.js +3 -1
- package/client/pages/vas/reverse-kitting/popup-reverse-kitting-template.js +3 -1
- package/client/route.js +31 -0
- package/cypress/fixtures/globals.json +3 -0
- package/cypress/fixtures/master-data/location.json +31 -0
- package/cypress/fixtures/master-data/pallet.json +129 -0
- package/cypress/fixtures/master-data/palletImport.xlsx +0 -0
- package/cypress/fixtures/master-data/transport-driver.json +22 -0
- package/cypress/fixtures/master-data/transport-vehicle.json +24 -0
- package/cypress/fixtures/master-data/transportDriverDeletedImport.xlsx +0 -0
- package/cypress/fixtures/master-data/transportDriverImport.xlsx +0 -0
- package/cypress/fixtures/master-data/transportVehicleDeletedImport.xlsx +0 -0
- package/cypress/fixtures/master-data/transportVehicleImport.xlsx +0 -0
- package/cypress/fixtures/master-data/transportVehicleNameSizeImport.xlsx +0 -0
- package/cypress/fixtures/master-data/transportVehicleNameStatusImport.xlsx +0 -0
- package/cypress/fixtures/master-data/warehouse.json +20 -0
- package/cypress/fixtures/master-data/warehouseImport.xlsx +0 -0
- package/cypress/integration/master-data/location.spec.js +31 -0
- package/cypress/integration/master-data/pallet.spec.js +176 -0
- package/cypress/integration/master-data/transport-driver.spec.js +131 -0
- package/cypress/integration/master-data/transport-vehicle.spec.js +165 -0
- package/cypress/integration/master-data/warehouse.spec.js +135 -0
- package/cypress/plugins/index.js +22 -0
- package/cypress/support/commands.js +425 -0
- package/cypress/support/index.js +31 -0
- package/cypress.json +9 -0
- package/dist-server/graphql/resolvers/board-setting/board-settings.js +3 -1
- package/dist-server/graphql/resolvers/board-setting/board-settings.js.map +1 -1
- package/dist-server/graphql/resolvers/dashboard/index.js +3 -1
- package/dist-server/graphql/resolvers/dashboard/index.js.map +1 -1
- package/dist-server/graphql/resolvers/dashboard/inventory-expiry-monitor.js +50 -0
- package/dist-server/graphql/resolvers/dashboard/inventory-expiry-monitor.js.map +1 -0
- package/dist-server/graphql/resolvers/dashboard/outbound-order-by-status.js +86 -0
- package/dist-server/graphql/resolvers/dashboard/outbound-order-by-status.js.map +1 -0
- package/dist-server/graphql/resolvers/extra/add-release-good-products.js +9 -10
- package/dist-server/graphql/resolvers/extra/add-release-good-products.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/costing-report.js +172 -0
- package/dist-server/graphql/resolvers/reports/costing-report.js.map +1 -0
- package/dist-server/graphql/resolvers/reports/inbound-order-details-report.js +2 -0
- package/dist-server/graphql/resolvers/reports/inbound-order-details-report.js.map +1 -1
- package/dist-server/graphql/resolvers/reports/inbound-serial-number-report.js +111 -0
- package/dist-server/graphql/resolvers/reports/inbound-serial-number-report.js.map +1 -0
- package/dist-server/graphql/resolvers/reports/index.js +4 -1
- package/dist-server/graphql/resolvers/reports/index.js.map +1 -1
- package/dist-server/graphql/resolvers/reports/outbound-order-details-report.js +63 -49
- package/dist-server/graphql/resolvers/reports/outbound-order-details-report.js.map +1 -1
- package/dist-server/graphql/resolvers/reports/outbound-serial-number-report.js +118 -0
- package/dist-server/graphql/resolvers/reports/outbound-serial-number-report.js.map +1 -0
- 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 +65 -0
- package/dist-server/graphql/resolvers/warehouse-inventory-adjustment/warehouse-intentory-adjustment.js.map +1 -0
- package/dist-server/graphql/types/dashboard/index.js +5 -1
- package/dist-server/graphql/types/dashboard/index.js.map +1 -1
- package/dist-server/graphql/types/dashboard/inventory-expiry-counter.js +15 -0
- package/dist-server/graphql/types/dashboard/inventory-expiry-counter.js.map +1 -0
- package/dist-server/graphql/types/dashboard/inventory-expiry-status.js +14 -0
- package/dist-server/graphql/types/dashboard/inventory-expiry-status.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/costing-report-list.js +14 -0
- package/dist-server/graphql/types/reports/costing-report-list.js.map +1 -0
- package/dist-server/graphql/types/reports/costing-report.js +19 -0
- package/dist-server/graphql/types/reports/costing-report.js.map +1 -0
- package/dist-server/graphql/types/reports/inbound-order-details-report.js +1 -0
- package/dist-server/graphql/types/reports/inbound-order-details-report.js.map +1 -1
- package/dist-server/graphql/types/reports/inbound-serial-number-report-list.js +14 -0
- package/dist-server/graphql/types/reports/inbound-serial-number-report-list.js.map +1 -0
- package/dist-server/graphql/types/reports/inbound-serial-number-report.js +23 -0
- package/dist-server/graphql/types/reports/inbound-serial-number-report.js.map +1 -0
- package/dist-server/graphql/types/reports/index.js +16 -1
- package/dist-server/graphql/types/reports/index.js.map +1 -1
- package/dist-server/graphql/types/reports/outbound-order-details-report.js +6 -0
- package/dist-server/graphql/types/reports/outbound-order-details-report.js.map +1 -1
- package/dist-server/graphql/types/reports/outbound-serial-number-report-list.js +14 -0
- package/dist-server/graphql/types/reports/outbound-serial-number-report-list.js.map +1 -0
- package/dist-server/graphql/types/reports/outbound-serial-number-report.js +25 -0
- package/dist-server/graphql/types/reports/outbound-serial-number-report.js.map +1 -0
- 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/migrations/1568858861188-SeedSetting.js +2 -1
- package/dist-server/migrations/1568858861188-SeedSetting.js.map +1 -1
- package/dist-server/opa-app-setting-constants.js +3 -1
- package/dist-server/opa-app-setting-constants.js.map +1 -1
- package/helps/release-note.ko.md +37 -2
- package/helps/release-note.md +19 -48
- package/helps/release-note.ms.md +36 -1
- package/helps/release-note.zh.md +36 -1
- package/package.json +76 -67
- package/server/graphql/resolvers/board-setting/board-settings.ts +6 -2
- package/server/graphql/resolvers/dashboard/index.ts +5 -1
- package/server/graphql/resolvers/dashboard/inventory-expiry-monitor.ts +48 -0
- package/server/graphql/resolvers/dashboard/outbound-order-by-status.ts +93 -0
- package/server/graphql/resolvers/extra/add-release-good-products.ts +29 -15
- package/server/graphql/resolvers/index.ts +3 -2
- package/server/graphql/resolvers/reports/costing-report.ts +196 -0
- package/server/graphql/resolvers/reports/inbound-order-details-report.ts +2 -0
- package/server/graphql/resolvers/reports/inbound-serial-number-report.ts +128 -0
- package/server/graphql/resolvers/reports/index.ts +7 -0
- package/server/graphql/resolvers/reports/outbound-order-details-report.ts +66 -49
- package/server/graphql/resolvers/reports/outbound-serial-number-report.ts +135 -0
- package/server/graphql/resolvers/warehouse-inventory-adjustment/index.ts +5 -0
- package/server/graphql/resolvers/warehouse-inventory-adjustment/warehouse-intentory-adjustment.ts +79 -0
- package/server/graphql/types/dashboard/index.ts +5 -1
- package/server/graphql/types/dashboard/inventory-expiry-counter.ts +9 -0
- package/server/graphql/types/dashboard/inventory-expiry-status.ts +8 -0
- package/server/graphql/types/index.ts +4 -4
- package/server/graphql/types/reports/costing-report-list.ts +8 -0
- package/server/graphql/types/reports/costing-report.ts +13 -0
- package/server/graphql/types/reports/inbound-order-details-report.ts +1 -0
- package/server/graphql/types/reports/inbound-serial-number-report-list.ts +8 -0
- package/server/graphql/types/reports/inbound-serial-number-report.ts +17 -0
- package/server/graphql/types/reports/index.ts +18 -1
- package/server/graphql/types/reports/outbound-order-details-report.ts +6 -0
- package/server/graphql/types/reports/outbound-serial-number-report-list.ts +8 -0
- package/server/graphql/types/reports/outbound-serial-number-report.ts +19 -0
- package/server/graphql/types/warehouse-inventory-adjustment/index.ts +5 -0
- package/server/index.ts +1 -1
- package/server/migrations/1568858861188-SeedSetting.ts +5 -2
- package/server/opa-app-setting-constants.ts +3 -1
- package/things-factory.config.js +33 -0
- package/translations/en.json +105 -9
- package/translations/ko.json +199 -127
- package/translations/ms.json +81 -3
- package/translations/zh.json +85 -7
- package/dist-server/entities/index.js +0 -5
- package/dist-server/entities/index.js.map +0 -1
- package/server/entities/index.ts +0 -3
package/.eslintrc.json
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"plugins": ["cypress"],
|
|
3
|
+
"rules": {
|
|
4
|
+
"cypress/no-assigning-return-values": "error",
|
|
5
|
+
"cypress/no-unnecessary-waiting": "error",
|
|
6
|
+
"cypress/assertion-before-screenshot": "warn",
|
|
7
|
+
"cypress/no-force": "warn",
|
|
8
|
+
"cypress/no-async-tests": "error",
|
|
9
|
+
"cypress/no-pause": "error"
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -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
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './cargo'
|
|
2
2
|
export * from './claim'
|
|
3
3
|
export * from './inventory'
|
|
4
|
+
export * from './inventory-item-change'
|
|
4
5
|
export * from './location'
|
|
5
6
|
export * from './location-sorting-rule'
|
|
6
7
|
export * from './marketplace'
|
|
@@ -15,3 +16,4 @@ export * from './worksheet'
|
|
|
15
16
|
export * from './pallet'
|
|
16
17
|
export * from './platform'
|
|
17
18
|
export * from './group-type'
|
|
19
|
+
export * from './tote'
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export const INVENTORY_ITEM_CHANGE_TYPE = {
|
|
2
|
+
NEW: { name: 'new', value: 'NEW' },
|
|
3
|
+
MODIFIED: { name: 'modified', value: 'MODIFIED' },
|
|
4
|
+
REMOVED: { name: 'removed', value: 'REMOVED' }
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export const INVENTORY_ITEM_CHANGE_TRANSACTION_TYPE = {
|
|
8
|
+
ORIGINAL: { name: 'original', value: 'ORIGINAL' },
|
|
9
|
+
CHANGES: { name: 'changes', value: 'CHANGES' }
|
|
10
|
+
}
|
|
@@ -24,6 +24,11 @@ export const ORDER_TYPES = {
|
|
|
24
24
|
REVERSE_KITTING_ORDER
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
export const ORDER_SOURCES = {
|
|
28
|
+
PICKING: { name: 'picking', value: 'picking' },
|
|
29
|
+
PACKING: { name: 'packing', value: 'packing' }
|
|
30
|
+
}
|
|
31
|
+
|
|
27
32
|
export const RO_TYPES = {
|
|
28
33
|
B2B: { name: 'B2B', value: 'b2b' },
|
|
29
34
|
B2C: { name: 'B2C', value: 'b2c' }
|
|
@@ -5,3 +5,5 @@ export const PALLET_LABEL_SETTING_KEY = 'pallet-label'
|
|
|
5
5
|
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
|
+
export const ROUTE_LABEL_SETTING_KEY = 'route-label'
|
|
9
|
+
export const TOTE_LABEL_SETTING_KEY = 'tote-label'
|
|
@@ -154,6 +154,9 @@ class PalletLabelPopup extends connect(store)(localize(i18next)(LitElement)) {
|
|
|
154
154
|
packingType
|
|
155
155
|
palletId
|
|
156
156
|
remark
|
|
157
|
+
orderProductRemark
|
|
158
|
+
purchaseOrderNo
|
|
159
|
+
arrivalNoticeRefNo
|
|
157
160
|
}
|
|
158
161
|
}
|
|
159
162
|
`,
|
|
@@ -188,6 +191,9 @@ class PalletLabelPopup extends connect(store)(localize(i18next)(LitElement)) {
|
|
|
188
191
|
searchParams.append('remark', results[i].remark)
|
|
189
192
|
searchParams.append('batchRef', results[i].batchIdRef)
|
|
190
193
|
searchParams.append('expirationDate', '')
|
|
194
|
+
searchParams.append('orderProductRemark', results[i].orderProductRemark)
|
|
195
|
+
searchParams.append('purchaseOrderNo', results[i].purchaseOrderNo)
|
|
196
|
+
searchParams.append('refNo', results[i].arrivalNoticeRefNo)
|
|
191
197
|
try {
|
|
192
198
|
const response = await fetch(`label-command/${labelId}?${searchParams.toString()}`, {
|
|
193
199
|
method: 'GET'
|
|
@@ -9,6 +9,7 @@ import gql from 'graphql-tag'
|
|
|
9
9
|
import { css, html } from 'lit-element'
|
|
10
10
|
import { connect } from 'pwa-helpers/connect-mixin.js'
|
|
11
11
|
|
|
12
|
+
import { sleep } from '@operato/utils'
|
|
12
13
|
import { MultiColumnFormStyles } from '@things-factory/form-ui'
|
|
13
14
|
import { i18next, localize } from '@things-factory/i18n-base'
|
|
14
15
|
import { openPopup } from '@things-factory/layout-base'
|
|
@@ -1251,7 +1252,8 @@ class PutawayProduct extends connect(store)(localize(i18next)(PageView)) {
|
|
|
1251
1252
|
)
|
|
1252
1253
|
}
|
|
1253
1254
|
|
|
1254
|
-
_openUndoPopup() {
|
|
1255
|
+
async _openUndoPopup() {
|
|
1256
|
+
await sleep(1010)
|
|
1255
1257
|
openPopup(
|
|
1256
1258
|
html`
|
|
1257
1259
|
<undo-putaway-popup
|
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
import '@things-factory/grist-ui'
|
|
2
|
+
import '@things-factory/barcode-ui'
|
|
3
|
+
|
|
4
|
+
import gql from 'graphql-tag'
|
|
5
|
+
import { css, html, LitElement } from 'lit-element'
|
|
6
|
+
|
|
7
|
+
import { MultiColumnFormStyles, SingleColumnFormStyles } from '@things-factory/form-ui'
|
|
8
|
+
import { i18next, localize } from '@things-factory/i18n-base'
|
|
9
|
+
import { client } from '@things-factory/shell'
|
|
10
|
+
import { ScrollbarStyles } from '@things-factory/styles'
|
|
11
|
+
import { isMobileDevice } from '@things-factory/utils'
|
|
12
|
+
|
|
13
|
+
class SerialNumberListPopup extends localize(i18next)(LitElement) {
|
|
14
|
+
static get properties() {
|
|
15
|
+
return {
|
|
16
|
+
serialNumberConfig: Object,
|
|
17
|
+
serialNumberGrist: Object,
|
|
18
|
+
data: Object,
|
|
19
|
+
orderType: String,
|
|
20
|
+
orderId: String,
|
|
21
|
+
_inventoryInfo: String,
|
|
22
|
+
_currentSerialNumber: String,
|
|
23
|
+
_selectedInventoryItemId: Object
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
static get styles() {
|
|
28
|
+
return [
|
|
29
|
+
MultiColumnFormStyles,
|
|
30
|
+
SingleColumnFormStyles,
|
|
31
|
+
ScrollbarStyles,
|
|
32
|
+
css`
|
|
33
|
+
:host {
|
|
34
|
+
display: flex;
|
|
35
|
+
flex-direction: column;
|
|
36
|
+
overflow: hidden;
|
|
37
|
+
background-color: white;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.grist {
|
|
41
|
+
display: flex;
|
|
42
|
+
flex-direction: column;
|
|
43
|
+
flex: 1;
|
|
44
|
+
overflow-y: auto;
|
|
45
|
+
}
|
|
46
|
+
.grist-container {
|
|
47
|
+
overflow-y: hidden;
|
|
48
|
+
display: flex;
|
|
49
|
+
flex: 1;
|
|
50
|
+
padding: 10px;
|
|
51
|
+
}
|
|
52
|
+
data-grist {
|
|
53
|
+
overflow-y: hidden;
|
|
54
|
+
flex: 1;
|
|
55
|
+
}
|
|
56
|
+
h2 {
|
|
57
|
+
padding: var(--subtitle-padding);
|
|
58
|
+
font: var(--subtitle-font);
|
|
59
|
+
color: var(--subtitle-text-color);
|
|
60
|
+
border-bottom: var(--subtitle-border-bottom);
|
|
61
|
+
}
|
|
62
|
+
.grist h2 {
|
|
63
|
+
font: var(--grist-title-font);
|
|
64
|
+
}
|
|
65
|
+
.button-container {
|
|
66
|
+
padding: var(--button-container-padding);
|
|
67
|
+
margin: var(--button-container-margin);
|
|
68
|
+
text-align: var(--button-container-align);
|
|
69
|
+
background-color: var(--button-container-background);
|
|
70
|
+
height: var(--button-container-height);
|
|
71
|
+
}
|
|
72
|
+
`
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
render() {
|
|
77
|
+
return html`
|
|
78
|
+
<form class="multi-column-form">
|
|
79
|
+
<fieldset>
|
|
80
|
+
<legend>${this.data.product.sku}</legend>
|
|
81
|
+
</fieldset>
|
|
82
|
+
</form>
|
|
83
|
+
|
|
84
|
+
<form id="inventory-info-form" class="single-column-form">
|
|
85
|
+
<fieldset>
|
|
86
|
+
<label
|
|
87
|
+
>${i18next.t('field.lot_id')} / ${i18next.t('field.carton_id')} / ${i18next.t('field.serial_number')}</label
|
|
88
|
+
>
|
|
89
|
+
<barcode-scanable-input
|
|
90
|
+
name="inventoryInfo"
|
|
91
|
+
custom-input
|
|
92
|
+
@keypress="${e => {
|
|
93
|
+
if (e.keyCode === 13) {
|
|
94
|
+
e.preventDefault()
|
|
95
|
+
this._inventoryInfo = this.inventoryInfoInput.value
|
|
96
|
+
this.serialNumberGrist.fetch()
|
|
97
|
+
}
|
|
98
|
+
}}"
|
|
99
|
+
></barcode-scanable-input>
|
|
100
|
+
</fieldset>
|
|
101
|
+
</form>
|
|
102
|
+
|
|
103
|
+
<div class="grist-container">
|
|
104
|
+
<div class="grist">
|
|
105
|
+
<data-grist
|
|
106
|
+
id="serialNumberGrist"
|
|
107
|
+
.mode=${isMobileDevice() ? 'LIST' : 'GRID'}
|
|
108
|
+
.config=${this.serialNumberConfig}
|
|
109
|
+
.fetchHandler=${this.fetchInventoryItems.bind(this)}
|
|
110
|
+
></data-grist>
|
|
111
|
+
</div>
|
|
112
|
+
</div>
|
|
113
|
+
|
|
114
|
+
<form id="input-form" class="single-column-form">
|
|
115
|
+
<input
|
|
116
|
+
name="selectedSerialNumber"
|
|
117
|
+
placeholder="-- Selected Serial Number --"
|
|
118
|
+
disabled
|
|
119
|
+
readonly
|
|
120
|
+
class="mobile-full-width"
|
|
121
|
+
value="${this._currentSerialNumber}"
|
|
122
|
+
/>
|
|
123
|
+
<barcode-scanable-input name="serialNumber" class="mobile-full-width" custom-input></barcode-scanable-input>
|
|
124
|
+
|
|
125
|
+
<mwc-button
|
|
126
|
+
name="updateSerialNumber"
|
|
127
|
+
class="mobile-full-width"
|
|
128
|
+
@click=${async () => {
|
|
129
|
+
await this.updateInventoryItemSerialNumber()
|
|
130
|
+
}}
|
|
131
|
+
raised
|
|
132
|
+
label="${i18next.t('button.update')}"
|
|
133
|
+
></mwc-button>
|
|
134
|
+
</form>
|
|
135
|
+
|
|
136
|
+
<div class="button-container">
|
|
137
|
+
<mwc-button
|
|
138
|
+
danger
|
|
139
|
+
@click=${() => {
|
|
140
|
+
this.dispatchEvent(new CustomEvent('close-serial-number-list', {}))
|
|
141
|
+
history.back()
|
|
142
|
+
}}
|
|
143
|
+
raised
|
|
144
|
+
label="${i18next.t('button.back')}"
|
|
145
|
+
></mwc-button>
|
|
146
|
+
</div>
|
|
147
|
+
`
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
get serialNumberGrist() {
|
|
151
|
+
return this.shadowRoot.querySelector('data-grist#serialNumberGrist')
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
get inventoryInfoInput() {
|
|
155
|
+
return this.shadowRoot.querySelector('barcode-scanable-input[name=inventoryInfo]').shadowRoot.querySelector('input')
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
get selectedSerialInput() {
|
|
159
|
+
return this.shadowRoot.querySelector('input[name=selectedSerialNumber]')
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
get serialInput() {
|
|
163
|
+
return this.shadowRoot.querySelector('barcode-scanable-input[name=serialNumber]').shadowRoot.querySelector('input')
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
firstUpdated() {
|
|
167
|
+
this.serialNumberConfig = {
|
|
168
|
+
pagination: { pages: [10, 20, 50, 100] },
|
|
169
|
+
rows: {
|
|
170
|
+
appendable: false,
|
|
171
|
+
handlers: {
|
|
172
|
+
click: async (columns, data, column, record, rowIndex) => {
|
|
173
|
+
try {
|
|
174
|
+
this.serialNumberGrist.showSpinner()
|
|
175
|
+
this._currentSerialNumber = record.serialNumber
|
|
176
|
+
this._selectedInventoryItemId = record.id
|
|
177
|
+
} catch (ex) {
|
|
178
|
+
console.log(ex)
|
|
179
|
+
} finally {
|
|
180
|
+
this.serialNumberGrist.hideSpinner()
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
columns: [
|
|
186
|
+
{ type: 'gutter', gutterName: 'sequence' },
|
|
187
|
+
{ type: 'object', name: 'inventory', hidden: true },
|
|
188
|
+
{
|
|
189
|
+
type: 'gutter',
|
|
190
|
+
gutterName: 'button',
|
|
191
|
+
icon: 'close',
|
|
192
|
+
handlers: {
|
|
193
|
+
click: (columns, data, column, record, rowIndex) => {
|
|
194
|
+
this.undoSerialNumberUnload(record.id)
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
type: 'string',
|
|
200
|
+
name: 'serialNumber',
|
|
201
|
+
header: i18next.t('field.serial_number'),
|
|
202
|
+
width: 150
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
type: 'string',
|
|
206
|
+
name: 'palletId',
|
|
207
|
+
header: i18next.t('field.lot_id'),
|
|
208
|
+
width: 180
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
type: 'string',
|
|
212
|
+
name: 'cartonId',
|
|
213
|
+
header: i18next.t('field.carton_id'),
|
|
214
|
+
width: 180
|
|
215
|
+
}
|
|
216
|
+
]
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
async fetchInventoryItems({ page, limit, sorters = [{ name: 'serialNumber' }] }) {
|
|
221
|
+
let filters = [
|
|
222
|
+
{ name: 'orderType', operator: 'eq', value: this.orderType },
|
|
223
|
+
{ name: 'orderId', operator: 'eq', value: this.orderId },
|
|
224
|
+
{ name: 'productId', operator: 'eq', value: this.data.product.id }
|
|
225
|
+
]
|
|
226
|
+
|
|
227
|
+
if (this._inventoryInfo) filters.push({ name: 'inventory_info', operator: 'i_like', value: this._inventoryInfo })
|
|
228
|
+
|
|
229
|
+
const pagination = { page, limit }
|
|
230
|
+
const sortings = sorters
|
|
231
|
+
|
|
232
|
+
const response = await client.query({
|
|
233
|
+
query: gql`
|
|
234
|
+
query inventoryItemsByInventory($filters: [Filter!]!, $pagination: Pagination, $sortings: [Sorting!]!) {
|
|
235
|
+
inventoryItemsByInventory(filters: $filters, pagination: $pagination, sortings: $sortings) {
|
|
236
|
+
items {
|
|
237
|
+
id
|
|
238
|
+
name
|
|
239
|
+
status
|
|
240
|
+
serialNumber
|
|
241
|
+
inventory {
|
|
242
|
+
id
|
|
243
|
+
name
|
|
244
|
+
palletId
|
|
245
|
+
cartonId
|
|
246
|
+
}
|
|
247
|
+
product {
|
|
248
|
+
id
|
|
249
|
+
name
|
|
250
|
+
sku
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
total
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
`,
|
|
257
|
+
variables: { filters, pagination, sortings }
|
|
258
|
+
})
|
|
259
|
+
|
|
260
|
+
if (!response.errors) {
|
|
261
|
+
return {
|
|
262
|
+
total: response.data.inventoryItemsByInventory.total || 0,
|
|
263
|
+
records:
|
|
264
|
+
response.data.inventoryItemsByInventory.items.map(item => {
|
|
265
|
+
return {
|
|
266
|
+
...item,
|
|
267
|
+
palletId: item.inventory.palletId,
|
|
268
|
+
cartonId: item.inventory.cartonId
|
|
269
|
+
}
|
|
270
|
+
}) || []
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
async undoSerialNumberUnload(id) {
|
|
276
|
+
try {
|
|
277
|
+
const response = await client.mutate({
|
|
278
|
+
mutation: gql`
|
|
279
|
+
mutation undoSerialNumberUnload($worksheetDetailName: String!, $inventoryItemId: String!) {
|
|
280
|
+
undoSerialNumberUnload(worksheetDetailName: $worksheetDetailName, inventoryItemId: $inventoryItemId)
|
|
281
|
+
}
|
|
282
|
+
`,
|
|
283
|
+
variables: {
|
|
284
|
+
worksheetDetailName: this.data.name,
|
|
285
|
+
inventoryItemId: id
|
|
286
|
+
}
|
|
287
|
+
})
|
|
288
|
+
|
|
289
|
+
if (!response.errors) {
|
|
290
|
+
this.serialNumberGrist.fetch()
|
|
291
|
+
}
|
|
292
|
+
} catch (e) {
|
|
293
|
+
this._showToast(e)
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
async updateInventoryItemSerialNumber() {
|
|
298
|
+
try {
|
|
299
|
+
this.validate()
|
|
300
|
+
|
|
301
|
+
const response = await client.mutate({
|
|
302
|
+
mutation: gql`
|
|
303
|
+
mutation updateInventoryItemSerialNumber($id: String!, $serialNumber: String!) {
|
|
304
|
+
updateInventoryItemSerialNumber(id: $id, serialNumber: $serialNumber)
|
|
305
|
+
}
|
|
306
|
+
`,
|
|
307
|
+
variables: {
|
|
308
|
+
id: this._selectedInventoryItemId,
|
|
309
|
+
serialNumber: this.serialInput.value
|
|
310
|
+
}
|
|
311
|
+
})
|
|
312
|
+
|
|
313
|
+
if (!response.errors) {
|
|
314
|
+
this.serialInput.value = ''
|
|
315
|
+
this.serialNumberGrist.fetch()
|
|
316
|
+
}
|
|
317
|
+
} catch (e) {
|
|
318
|
+
this._showToast(e)
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
validate() {
|
|
323
|
+
// validate for previous picking execution (multiple picking scanning)
|
|
324
|
+
if (this.selectedSerialInput.value == '') throw new Error(i18next.t('text.no_serial_number_selected'))
|
|
325
|
+
|
|
326
|
+
if (this.serialInput.value == '') throw new Error(i18next.t('text.please_key_in_new_serial_number'))
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
_showToast({ type, message }) {
|
|
330
|
+
document.dispatchEvent(
|
|
331
|
+
new CustomEvent('notify', {
|
|
332
|
+
detail: {
|
|
333
|
+
type,
|
|
334
|
+
message
|
|
335
|
+
}
|
|
336
|
+
})
|
|
337
|
+
)
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
window.customElements.define('serial-number-list-popup', SerialNumberListPopup)
|