@things-factory/operato-wms 4.1.38 → 4.2.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/.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 +0 -1
- package/client/pages/inventory/inventory-adjustment-approval.js +34 -3
- package/client/pages/inventory/inventory-adjustment.js +144 -5
- 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 +24 -1
- 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 +109 -9
- package/client/pages/outbound/picking-product.js +21 -8
- 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 +55 -26
- 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/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/outbound-order-by-status.js +7 -10
- package/dist-server/graphql/resolvers/dashboard/outbound-order-by-status.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 +0 -2
- package/helps/release-note.md +0 -2
- package/helps/release-note.ms.md +0 -2
- package/helps/release-note.zh.md +0 -2
- package/package.json +61 -51
- package/server/graphql/resolvers/board-setting/board-settings.ts +4 -2
- package/server/graphql/resolvers/dashboard/outbound-order-by-status.ts +7 -10
- package/server/opa-app-setting-constants.ts +2 -1
- package/translations/en.json +15 -4
- package/translations/ko.json +12 -2
- package/translations/ms.json +11 -2
- package/translations/zh.json +11 -2
|
@@ -0,0 +1,464 @@
|
|
|
1
|
+
import '@things-factory/barcode-ui'
|
|
2
|
+
import '@things-factory/grist-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 { connect } from 'pwa-helpers/connect-mixin'
|
|
9
|
+
import { i18next, localize } from '@things-factory/i18n-base'
|
|
10
|
+
import { client, store } from '@things-factory/shell'
|
|
11
|
+
import { isMobileDevice } from '@things-factory/utils'
|
|
12
|
+
|
|
13
|
+
import { LOCATION_TYPE } from '../constants'
|
|
14
|
+
|
|
15
|
+
import { DirectPrinter } from '@things-factory/barcode-base'
|
|
16
|
+
import { ROUTE_LABEL_SETTING_KEY } from '../constants'
|
|
17
|
+
class RouteLabelPopup extends connect(store)(localize(i18next)(LitElement)) {
|
|
18
|
+
static get styles() {
|
|
19
|
+
return [
|
|
20
|
+
MultiColumnFormStyles,
|
|
21
|
+
SingleColumnFormStyles,
|
|
22
|
+
css`
|
|
23
|
+
:host {
|
|
24
|
+
padding: 10px;
|
|
25
|
+
display: flex;
|
|
26
|
+
flex-direction: column;
|
|
27
|
+
overflow-x: overlay;
|
|
28
|
+
background-color: var(--main-section-background-color);
|
|
29
|
+
}
|
|
30
|
+
.grist {
|
|
31
|
+
background-color: var(--main-section-background-color);
|
|
32
|
+
display: flex;
|
|
33
|
+
flex-direction: column;
|
|
34
|
+
flex: 1;
|
|
35
|
+
overflow-y: auto;
|
|
36
|
+
}
|
|
37
|
+
data-grist {
|
|
38
|
+
overflow-y: hidden;
|
|
39
|
+
flex: 1;
|
|
40
|
+
}
|
|
41
|
+
.button-container {
|
|
42
|
+
padding: 10px 0 12px 0;
|
|
43
|
+
text-align: center;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@media (max-width: 460px) {
|
|
47
|
+
.single-column-form {
|
|
48
|
+
max-width: 100%;
|
|
49
|
+
}
|
|
50
|
+
.mobile-full-width {
|
|
51
|
+
grid-column: span 12 / auto;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
`
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
static get properties() {
|
|
59
|
+
return {
|
|
60
|
+
config: Object,
|
|
61
|
+
data: Object,
|
|
62
|
+
partnerId: String,
|
|
63
|
+
worksheetType: String,
|
|
64
|
+
_binNumberList: Array,
|
|
65
|
+
_selectedBinNumber: String,
|
|
66
|
+
_selectedPriority: String,
|
|
67
|
+
_searchFields: Array,
|
|
68
|
+
_routeLabel: Object,
|
|
69
|
+
orderInventories: Object
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
get dataGrist() {
|
|
74
|
+
return this.shadowRoot.querySelector('data-grist')
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
get searchForm() {
|
|
78
|
+
return this.shadowRoot.querySelector('search-form')
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
_focusOnSerialInput() {
|
|
82
|
+
if (this.serialInput) {
|
|
83
|
+
setTimeout(() => this.serialInput.focus(), 50)
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
constructor() {
|
|
88
|
+
super()
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
render() {
|
|
92
|
+
return html`
|
|
93
|
+
<form id="search-form" class="multi-column-form">
|
|
94
|
+
<fieldset>
|
|
95
|
+
<select
|
|
96
|
+
name="binNumber"
|
|
97
|
+
@change="${e => {
|
|
98
|
+
this._selectedBinNumber = this._binNumberList.filter(itm => itm.name == e.currentTarget.value)
|
|
99
|
+
if (this._selectedBinNumber) this.dataGrist.fetch()
|
|
100
|
+
}}"
|
|
101
|
+
>
|
|
102
|
+
<option value="">-- ${i18next.t('text.bin_number')} --</option>
|
|
103
|
+
${(this._binNumberList || []).map(list => html` <option value=${list.name}>${list.name}</option> `)}
|
|
104
|
+
</select>
|
|
105
|
+
${this.worksheetType == 'merged'
|
|
106
|
+
? html`
|
|
107
|
+
<select
|
|
108
|
+
name="sortingRule"
|
|
109
|
+
@change="${e => {
|
|
110
|
+
this._selectedPriority = e.currentTarget.value
|
|
111
|
+
if (this._selectedPriority) this.dataGrist.fetch()
|
|
112
|
+
}}"
|
|
113
|
+
>
|
|
114
|
+
<option value="">-- ${i18next.t('text.priority')} --</option>
|
|
115
|
+
<option value="roSku">${'RO, Sku'}</option>
|
|
116
|
+
<option value="roBin">${'RO, Bin'}</option>
|
|
117
|
+
<option value="skuRo">${'Sku, Ro'}</option>
|
|
118
|
+
<option value="skuBin">${'Sku, Bin'}</option>
|
|
119
|
+
<option value="binRo">${'Bin, Ro'}</option>
|
|
120
|
+
<option value="binSku">${'Bin, Sku'}</option>
|
|
121
|
+
</select>
|
|
122
|
+
`
|
|
123
|
+
: ''}
|
|
124
|
+
</fieldset>
|
|
125
|
+
</form>
|
|
126
|
+
|
|
127
|
+
<div class="grist">
|
|
128
|
+
<data-grist
|
|
129
|
+
.mode=${isMobileDevice() ? 'LIST' : 'GRID'}
|
|
130
|
+
.config=${this.config}
|
|
131
|
+
.fetchHandler=${this.worksheetType == 'single'
|
|
132
|
+
? this.fetchOrderInventoriesOfMultipleReleaseOrders.bind(this)
|
|
133
|
+
: this.fetchOrderInventoriesOfMergedReleaseOrders.bind(this)}
|
|
134
|
+
></data-grist>
|
|
135
|
+
</div>
|
|
136
|
+
|
|
137
|
+
<div class="button-container">
|
|
138
|
+
<mwc-button danger raised @click="${this._printRouteLabel.bind(this)}">${i18next.t('button.print')}</mwc-button>
|
|
139
|
+
|
|
140
|
+
<mwc-button
|
|
141
|
+
danger
|
|
142
|
+
@click=${() => {
|
|
143
|
+
history.back()
|
|
144
|
+
}}
|
|
145
|
+
raised
|
|
146
|
+
label="${i18next.t('button.back')}"
|
|
147
|
+
></mwc-button>
|
|
148
|
+
</div>
|
|
149
|
+
`
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
stateChanged(state) {
|
|
153
|
+
let routeLabelSetting = state.dashboard[ROUTE_LABEL_SETTING_KEY]
|
|
154
|
+
this._routeLabel = (routeLabelSetting && routeLabelSetting.board) || {}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
async firstUpdated() {
|
|
158
|
+
await this.fetchLocations()
|
|
159
|
+
this.config = {
|
|
160
|
+
rows: {
|
|
161
|
+
appendable: false,
|
|
162
|
+
classifier: (record, rowIndex) => {
|
|
163
|
+
return {
|
|
164
|
+
emphasized: record.completed == true
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
pagination: { infinite: true },
|
|
169
|
+
list: {
|
|
170
|
+
fields: ['productSku', 'releaseQty', 'roName', 'binNumber']
|
|
171
|
+
},
|
|
172
|
+
columns: [
|
|
173
|
+
{ type: 'gutter', gutterName: 'sequence' },
|
|
174
|
+
{ type: 'gutter', gutterName: 'row-selector', multiple: true },
|
|
175
|
+
{
|
|
176
|
+
type: 'string',
|
|
177
|
+
name: 'productSku',
|
|
178
|
+
header: i18next.t('field.sku'),
|
|
179
|
+
sortable: true,
|
|
180
|
+
width: 150
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
type: 'integer',
|
|
184
|
+
name: 'releaseQty',
|
|
185
|
+
header: i18next.t('field.release_qty'),
|
|
186
|
+
width: 150
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
type: 'string',
|
|
190
|
+
name: 'roName',
|
|
191
|
+
header: i18next.t('field.ro'),
|
|
192
|
+
sortable: true,
|
|
193
|
+
width: 150
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
type: 'string',
|
|
197
|
+
name: 'binNumber',
|
|
198
|
+
header: i18next.t('field.bin_number'),
|
|
199
|
+
sortable: true,
|
|
200
|
+
width: 150
|
|
201
|
+
}
|
|
202
|
+
]
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
async fetchOrderInventoriesOfMultipleReleaseOrders({ sorters = [] }) {
|
|
207
|
+
const filters = []
|
|
208
|
+
if (this._selectedBinNumber && this._selectedBinNumber.length !== 0) {
|
|
209
|
+
filters.push({
|
|
210
|
+
name: 'binNumber',
|
|
211
|
+
operator: 'eq',
|
|
212
|
+
value: this._selectedBinNumber[0].name
|
|
213
|
+
})
|
|
214
|
+
}
|
|
215
|
+
try {
|
|
216
|
+
const response = await client.query({
|
|
217
|
+
query: gql`
|
|
218
|
+
query orderInventoriesOfMultipleReleaseOrders(
|
|
219
|
+
$partnerId: String!
|
|
220
|
+
$filters: [Filter!]
|
|
221
|
+
$sortings: [Sorting!]
|
|
222
|
+
) {
|
|
223
|
+
orderInventoriesOfMultipleReleaseOrders(partnerId: $partnerId, filters: $filters, sortings: $sortings) {
|
|
224
|
+
items {
|
|
225
|
+
id
|
|
226
|
+
name
|
|
227
|
+
releaseQty
|
|
228
|
+
releaseGood {
|
|
229
|
+
id
|
|
230
|
+
name
|
|
231
|
+
routeId
|
|
232
|
+
storeId
|
|
233
|
+
storeName
|
|
234
|
+
stopId
|
|
235
|
+
}
|
|
236
|
+
product {
|
|
237
|
+
id
|
|
238
|
+
sku
|
|
239
|
+
name
|
|
240
|
+
}
|
|
241
|
+
inventory {
|
|
242
|
+
id
|
|
243
|
+
name
|
|
244
|
+
}
|
|
245
|
+
binLocation {
|
|
246
|
+
id
|
|
247
|
+
name
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
total
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
`,
|
|
254
|
+
variables: { partnerId: this.partnerId, filters, sortings: sorters }
|
|
255
|
+
})
|
|
256
|
+
|
|
257
|
+
if (!response.errors) {
|
|
258
|
+
let records = response.data.orderInventoriesOfMultipleReleaseOrders
|
|
259
|
+
|
|
260
|
+
return (this.orderInventories = {
|
|
261
|
+
total: records.total || 0,
|
|
262
|
+
records:
|
|
263
|
+
records.items.map(itm => {
|
|
264
|
+
return {
|
|
265
|
+
...itm,
|
|
266
|
+
productSku: itm.product?.sku,
|
|
267
|
+
productName: itm.product?.name,
|
|
268
|
+
roName: itm.releaseGood?.name,
|
|
269
|
+
binNumber: itm.binLocation?.name
|
|
270
|
+
}
|
|
271
|
+
}) || {}
|
|
272
|
+
})
|
|
273
|
+
}
|
|
274
|
+
} catch (e) {
|
|
275
|
+
this._showToast(e)
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
async fetchOrderInventoriesOfMergedReleaseOrders({ sorters = [] }) {
|
|
280
|
+
const filters = []
|
|
281
|
+
if (this._selectedBinNumber && this._selectedBinNumber.length !== 0) {
|
|
282
|
+
filters.push({
|
|
283
|
+
name: 'binNumber',
|
|
284
|
+
operator: 'eq',
|
|
285
|
+
value: this._selectedBinNumber[0].name
|
|
286
|
+
})
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
if (this._selectedPriority && this._selectedPriority.length !== 0) {
|
|
290
|
+
filters.push({
|
|
291
|
+
name: 'priority',
|
|
292
|
+
operator: 'eq',
|
|
293
|
+
value: this._selectedPriority
|
|
294
|
+
})
|
|
295
|
+
}
|
|
296
|
+
try {
|
|
297
|
+
const response = await client.query({
|
|
298
|
+
query: gql`
|
|
299
|
+
query orderInventoriesOfMergedReleaseOrders($partnerId: String!, $filters: [Filter!], $sortings: [Sorting!]) {
|
|
300
|
+
orderInventoriesOfMergedReleaseOrders(partnerId: $partnerId, filters: $filters, sortings: $sortings) {
|
|
301
|
+
items {
|
|
302
|
+
id
|
|
303
|
+
name
|
|
304
|
+
releaseQty
|
|
305
|
+
releaseGood {
|
|
306
|
+
id
|
|
307
|
+
name
|
|
308
|
+
routeId
|
|
309
|
+
storeId
|
|
310
|
+
storeName
|
|
311
|
+
stopId
|
|
312
|
+
}
|
|
313
|
+
product {
|
|
314
|
+
id
|
|
315
|
+
sku
|
|
316
|
+
name
|
|
317
|
+
}
|
|
318
|
+
inventory {
|
|
319
|
+
id
|
|
320
|
+
name
|
|
321
|
+
}
|
|
322
|
+
binLocation {
|
|
323
|
+
id
|
|
324
|
+
name
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
total
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
`,
|
|
331
|
+
variables: { partnerId: this.partnerId, filters, sortings: sorters }
|
|
332
|
+
})
|
|
333
|
+
|
|
334
|
+
if (!response.errors) {
|
|
335
|
+
let records = response.data.orderInventoriesOfMergedReleaseOrders
|
|
336
|
+
|
|
337
|
+
return (this.orderInventories = {
|
|
338
|
+
total: records.total || 0,
|
|
339
|
+
records:
|
|
340
|
+
records.items.map(itm => {
|
|
341
|
+
return {
|
|
342
|
+
...itm,
|
|
343
|
+
productSku: itm.product?.sku,
|
|
344
|
+
productName: itm.product?.name,
|
|
345
|
+
roName: itm.releaseGood?.name,
|
|
346
|
+
binNumber: itm.binLocation?.name
|
|
347
|
+
}
|
|
348
|
+
}) || {}
|
|
349
|
+
})
|
|
350
|
+
}
|
|
351
|
+
} catch (e) {
|
|
352
|
+
this._showToast(e)
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
async _printRouteLabel() {
|
|
357
|
+
const records = this.dataGrist.selected
|
|
358
|
+
let labelId = this._routeLabel && this._routeLabel.id
|
|
359
|
+
|
|
360
|
+
if (!records || records.length == 0) {
|
|
361
|
+
this._showToast({ message: i18next.t('text.there_is_no_selected_items') })
|
|
362
|
+
}
|
|
363
|
+
if (!labelId) {
|
|
364
|
+
this._showToast({
|
|
365
|
+
type: 'error',
|
|
366
|
+
message: `${i18next.t('text.no_label_setting_was_found')}. ${i18next.t('text.please_check_your_setting')}`
|
|
367
|
+
})
|
|
368
|
+
} else {
|
|
369
|
+
for (var record of records) {
|
|
370
|
+
for (let qty = 1; qty <= record.releaseQty; qty++) {
|
|
371
|
+
var searchParams = new URLSearchParams()
|
|
372
|
+
|
|
373
|
+
/* for pallet record mapping */
|
|
374
|
+
searchParams.append('roName', record.roName)
|
|
375
|
+
searchParams.append('productSku', record.productSku)
|
|
376
|
+
searchParams.append('productName', record.productName)
|
|
377
|
+
searchParams.append('binNumber', record.binNumber)
|
|
378
|
+
searchParams.append('qty', qty)
|
|
379
|
+
searchParams.append('releaseQty', record.releaseQty)
|
|
380
|
+
searchParams.append('stopId', record.releaseGood.stopId)
|
|
381
|
+
searchParams.append('routeId', record.releaseGood.routeId)
|
|
382
|
+
searchParams.append('storeId', record.releaseGood.storeId)
|
|
383
|
+
searchParams.append('storeName', record.releaseGood.storeName)
|
|
384
|
+
searchParams.append('str', `STR: ${record.releaseGood.storeId}`)
|
|
385
|
+
searchParams.append(
|
|
386
|
+
'storeInformation',
|
|
387
|
+
`(Store ID) ${record.releaseGood.storeId}, (Store Name) ${record.releaseGood.storeName}, (Route ID) ${record.releaseGood.routeId}, (Stop ID) ${record.releaseGood.stopId}`
|
|
388
|
+
)
|
|
389
|
+
searchParams.append('counter', `${qty} of ${record.releaseQty}`)
|
|
390
|
+
|
|
391
|
+
try {
|
|
392
|
+
const response = await fetch(`label-command/${labelId}?${searchParams.toString()}`, {
|
|
393
|
+
method: 'GET'
|
|
394
|
+
})
|
|
395
|
+
|
|
396
|
+
if (response.status !== 200) {
|
|
397
|
+
throw `Error : Can't get label command from server (response: ${response.status})`
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
var command = await response.text()
|
|
401
|
+
|
|
402
|
+
if (!this.printer) {
|
|
403
|
+
this.printer = new DirectPrinter()
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
await this.printer.print(command)
|
|
407
|
+
} catch (e) {
|
|
408
|
+
this._showToast(e)
|
|
409
|
+
|
|
410
|
+
delete this.printer
|
|
411
|
+
break
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
async fetchLocations() {
|
|
419
|
+
const response = await client.query({
|
|
420
|
+
query: gql`
|
|
421
|
+
query locations($filters: [Filter!]) {
|
|
422
|
+
locations(filters: $filters) {
|
|
423
|
+
items {
|
|
424
|
+
id
|
|
425
|
+
name
|
|
426
|
+
description
|
|
427
|
+
row
|
|
428
|
+
column
|
|
429
|
+
shelf
|
|
430
|
+
status
|
|
431
|
+
}
|
|
432
|
+
total
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
`,
|
|
436
|
+
variables: {
|
|
437
|
+
filters: [
|
|
438
|
+
{
|
|
439
|
+
name: 'type',
|
|
440
|
+
operator: 'eq',
|
|
441
|
+
value: LOCATION_TYPE.BIN.value
|
|
442
|
+
}
|
|
443
|
+
]
|
|
444
|
+
}
|
|
445
|
+
})
|
|
446
|
+
|
|
447
|
+
if (!response.errors) {
|
|
448
|
+
this._binNumberList = response.data.locations.items
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
_showToast({ type, message }) {
|
|
453
|
+
document.dispatchEvent(
|
|
454
|
+
new CustomEvent('notify', {
|
|
455
|
+
detail: {
|
|
456
|
+
type,
|
|
457
|
+
message
|
|
458
|
+
}
|
|
459
|
+
})
|
|
460
|
+
)
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
window.customElements.define('route-label-popup', RouteLabelPopup)
|
|
@@ -120,8 +120,8 @@ class SelectOperatorPopup extends localize(i18next)(LitElement) {
|
|
|
120
120
|
|
|
121
121
|
const response = await client.query({
|
|
122
122
|
query: gql`
|
|
123
|
-
query($
|
|
124
|
-
pickingAssignmentStatusByUsers(
|
|
123
|
+
query pickingAssignmentStatusByUsers($name: String, $email: String) {
|
|
124
|
+
pickingAssignmentStatusByUsers(name: $name, email: $email) {
|
|
125
125
|
user {
|
|
126
126
|
id
|
|
127
127
|
name
|
|
@@ -136,7 +136,7 @@ class SelectOperatorPopup extends localize(i18next)(LitElement) {
|
|
|
136
136
|
}
|
|
137
137
|
}
|
|
138
138
|
`,
|
|
139
|
-
variables: {
|
|
139
|
+
variables: { name, email }
|
|
140
140
|
})
|
|
141
141
|
|
|
142
142
|
if (!response.errors) {
|
|
@@ -9,6 +9,8 @@ import { i18next, localize } from '@things-factory/i18n-base'
|
|
|
9
9
|
import { client } from '@things-factory/shell'
|
|
10
10
|
import { isMobileDevice } from '@things-factory/utils'
|
|
11
11
|
|
|
12
|
+
import { ORDER_SOURCES } from '../constants'
|
|
13
|
+
|
|
12
14
|
class SerialNumberPopup extends localize(i18next)(LitElement) {
|
|
13
15
|
static get styles() {
|
|
14
16
|
return [
|
|
@@ -59,8 +61,11 @@ class SerialNumberPopup extends localize(i18next)(LitElement) {
|
|
|
59
61
|
data: Object,
|
|
60
62
|
orderId: String,
|
|
61
63
|
orderType: String,
|
|
64
|
+
orderSource: String,
|
|
62
65
|
_inventoryItems: Object,
|
|
63
|
-
_selectedSerialNumber: Object
|
|
66
|
+
_selectedSerialNumber: Object,
|
|
67
|
+
enableRemove: Boolean,
|
|
68
|
+
enableUpdateBtn: Boolean
|
|
64
69
|
}
|
|
65
70
|
}
|
|
66
71
|
|
|
@@ -87,6 +92,8 @@ class SerialNumberPopup extends localize(i18next)(LitElement) {
|
|
|
87
92
|
constructor() {
|
|
88
93
|
super()
|
|
89
94
|
this.clearView()
|
|
95
|
+
this.enableRemove = true
|
|
96
|
+
this.enableUpdateBtn = true
|
|
90
97
|
}
|
|
91
98
|
|
|
92
99
|
render() {
|
|
@@ -102,7 +109,7 @@ class SerialNumberPopup extends localize(i18next)(LitElement) {
|
|
|
102
109
|
<input name="palletId" ${this?.data.palletId} disabled />
|
|
103
110
|
|
|
104
111
|
<label>${i18next.t('label.location')}</label>
|
|
105
|
-
<input name="locationName" ${this?.data.locationName} disabled />
|
|
112
|
+
<input name="locationName" ${this?.data.locationName ? this.data.locationName : ''} disabled />
|
|
106
113
|
</fieldset>
|
|
107
114
|
</form>
|
|
108
115
|
|
|
@@ -124,15 +131,20 @@ class SerialNumberPopup extends localize(i18next)(LitElement) {
|
|
|
124
131
|
value="${this._selectedSerialNumber.serialNumber}"
|
|
125
132
|
/>
|
|
126
133
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
134
|
+
${this.enableUpdateBtn
|
|
135
|
+
? html`<barcode-scanable-input
|
|
136
|
+
name="serialNumber"
|
|
137
|
+
class="mobile-full-width"
|
|
138
|
+
custom-input
|
|
139
|
+
></barcode-scanable-input>
|
|
140
|
+
<mwc-button
|
|
141
|
+
name="setSerialNumber"
|
|
142
|
+
class="mobile-full-width"
|
|
143
|
+
raised
|
|
144
|
+
@click=${this.updateSerialNumber.bind(this)}
|
|
145
|
+
label="${i18next.t('button.update')}"
|
|
146
|
+
></mwc-button>`
|
|
147
|
+
: ''}
|
|
136
148
|
</form>
|
|
137
149
|
|
|
138
150
|
<div class="button-container">
|
|
@@ -189,11 +201,13 @@ class SerialNumberPopup extends localize(i18next)(LitElement) {
|
|
|
189
201
|
icon: 'close',
|
|
190
202
|
handlers: {
|
|
191
203
|
click: (columns, data, column, record, rowIndex) => {
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
204
|
+
if (this.enableRemove) {
|
|
205
|
+
try {
|
|
206
|
+
const newData = data.records.filter((_, idx) => idx !== rowIndex)
|
|
207
|
+
this._inventoryItems = { ...this._inventoryItems, records: newData }
|
|
208
|
+
this.undoSerialNumberPicking(record.id)
|
|
209
|
+
} catch (e) {}
|
|
210
|
+
}
|
|
197
211
|
}
|
|
198
212
|
}
|
|
199
213
|
},
|
|
@@ -304,17 +318,32 @@ class SerialNumberPopup extends localize(i18next)(LitElement) {
|
|
|
304
318
|
|
|
305
319
|
async undoSerialNumberPicking(id) {
|
|
306
320
|
try {
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
321
|
+
let response
|
|
322
|
+
if (this.orderSource == ORDER_SOURCES.PICKING.value) {
|
|
323
|
+
response = await client.mutate({
|
|
324
|
+
mutation: gql`
|
|
325
|
+
mutation undoSerialNumberPicking($worksheetDetailName: String!, $inventoryItemId: String!) {
|
|
326
|
+
undoSerialNumberPicking(worksheetDetailName: $worksheetDetailName, inventoryItemId: $inventoryItemId)
|
|
327
|
+
}
|
|
328
|
+
`,
|
|
329
|
+
variables: {
|
|
330
|
+
worksheetDetailName: this.data.name,
|
|
331
|
+
inventoryItemId: id
|
|
311
332
|
}
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
333
|
+
})
|
|
334
|
+
} else if (this.orderSource == ORDER_SOURCES.PACKING.value) {
|
|
335
|
+
response = await client.mutate({
|
|
336
|
+
mutation: gql`
|
|
337
|
+
mutation undoSerialNumberPacking($worksheetDetailName: String!, $inventoryItemId: String!) {
|
|
338
|
+
undoSerialNumberPacking(worksheetDetailName: $worksheetDetailName, inventoryItemId: $inventoryItemId)
|
|
339
|
+
}
|
|
340
|
+
`,
|
|
341
|
+
variables: {
|
|
342
|
+
worksheetDetailName: this.data.name,
|
|
343
|
+
inventoryItemId: id
|
|
344
|
+
}
|
|
345
|
+
})
|
|
346
|
+
}
|
|
318
347
|
|
|
319
348
|
if (!response.errors) {
|
|
320
349
|
this.dataGrist.fetch()
|