@things-factory/operato-wms 5.0.0-alpha.3 → 5.0.0-alpha.32
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/pages/constants/index.js +1 -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 +1 -0
- package/client/pages/inbound/serial-number-list-popup.js +341 -0
- package/client/pages/inbound/unload-product.js +220 -41
- package/client/pages/inbound/unloaded-inventories-popup.js +7 -0
- package/client/pages/inventory/inventory-adjustment-approval.js +34 -3
- package/client/pages/inventory/inventory-adjustment.js +144 -5
- package/client/pages/inventory/non-loaded-inventory.js +365 -0
- package/client/pages/inventory/serial-number-list-popup.js +468 -0
- package/client/pages/master/pallet-list.js +24 -0
- package/client/pages/order/arrival-notice/edit-product-popup.js +13 -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 +106 -30
- package/client/pages/order/release-order/batch-picking-popup.js +8 -0
- package/client/pages/outbound/inventory-assign-popup.js +3 -24
- package/client/pages/outbound/inventory-auto-assign-popup.js +25 -50
- package/client/pages/outbound/loading-product.js +3 -3
- package/client/pages/outbound/merged-outbound-worksheet.js +148 -3
- package/client/pages/outbound/packing-product.js +194 -86
- package/client/pages/outbound/picking-product.js +133 -57
- 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 +3 -3
- package/client/pages/outbound/serial-number-popup.js +188 -73
- package/client/pages/outbound/single-outbound-worksheet.js +154 -5
- package/client/pages/outbound/sorting-product.js +125 -34
- package/client/pages/outbound/worksheet-batch-picking.js +13 -17
- package/client/pages/outbound/worksheet-picking.js +4 -8
- package/client/pages/report/inbound-serial-number-report.js +452 -0
- package/client/pages/report/outbound-order-details-report.js +64 -9
- package/client/pages/report/outbound-serial-number-report.js +467 -0
- package/client/route.js +11 -0
- package/config.development.js +73 -0
- package/config.production.js +113 -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 +2 -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 +51 -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 +55 -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 +5 -1
- package/dist-server/graphql/resolvers/extra/add-release-good-products.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 +3 -1
- package/dist-server/graphql/resolvers/reports/index.js.map +1 -1
- package/dist-server/graphql/resolvers/reports/outbound-order-details-report.js +53 -48
- 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/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 +16 -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/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 +10 -0
- package/dist-server/graphql/types/reports/index.js.map +1 -1
- package/dist-server/graphql/types/reports/outbound-order-details-report.js +3 -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/migrations/1568858861188-SeedSetting.js +2 -1
- package/dist-server/migrations/1568858861188-SeedSetting.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 +35 -2
- package/helps/release-note.md +12 -43
- package/helps/release-note.ms.md +34 -1
- package/helps/release-note.zh.md +34 -1
- package/package.json +76 -67
- package/server/graphql/resolvers/board-setting/board-settings.ts +4 -2
- package/server/graphql/resolvers/dashboard/index.ts +5 -1
- package/server/graphql/resolvers/dashboard/inventory-expiry-monitor.ts +49 -0
- package/server/graphql/resolvers/dashboard/outbound-order-by-status.ts +62 -0
- package/server/graphql/resolvers/extra/add-release-good-products.ts +7 -2
- package/server/graphql/resolvers/reports/inbound-serial-number-report.ts +128 -0
- package/server/graphql/resolvers/reports/index.ts +5 -0
- package/server/graphql/resolvers/reports/outbound-order-details-report.ts +54 -48
- package/server/graphql/resolvers/reports/outbound-serial-number-report.ts +135 -0
- package/server/graphql/types/dashboard/index.ts +5 -1
- package/server/graphql/types/dashboard/inventory-expiry-counter.ts +10 -0
- package/server/graphql/types/dashboard/inventory-expiry-status.ts +8 -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 +11 -0
- package/server/graphql/types/reports/outbound-order-details-report.ts +3 -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/migrations/1568858861188-SeedSetting.ts +5 -2
- package/server/opa-app-setting-constants.ts +2 -1
- package/things-factory.config.js +12 -0
- package/translations/en.json +39 -7
- package/translations/ko.json +32 -2
- package/translations/ms.json +31 -2
- package/translations/zh.json +35 -6
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,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,4 @@ 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'
|
|
@@ -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)
|