@things-factory/operato-wms 3.6.35 → 3.6.37
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/constants/setting.js +3 -2
- package/client/pages/vas/print-product-label.js +530 -0
- package/client/route.js +5 -1
- package/dist-server/graphql/resolvers/board-setting/board-settings.js +9 -2
- package/dist-server/graphql/resolvers/board-setting/board-settings.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/package.json +65 -65
- package/server/graphql/resolvers/board-setting/board-settings.ts +14 -4
- package/server/opa-app-setting-constants.ts +1 -0
- package/things-factory.config.js +4 -0
- package/translations/en.json +14 -2
- package/translations/ko.json +124 -113
- package/translations/ms.json +235 -224
- package/translations/zh.json +325 -317
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
export const CARTON_LABEL_SETTING_KEY = 'carton-label'
|
|
2
|
+
export const HOME_DASHBOARD_SETTING_KEY = 'dashboard'
|
|
1
3
|
export const LOCATION_LABEL_SETTING_KEY = 'location-label'
|
|
2
4
|
export const PALLET_LABEL_SETTING_KEY = 'pallet-label'
|
|
3
|
-
export const
|
|
5
|
+
export const PRODUCT_LABEL_SETTING_KEY = 'product-label'
|
|
4
6
|
export const REUSABLE_PALLET_LABEL_SETTING_KEY = 'reusable-pallet-label'
|
|
5
|
-
export const HOME_DASHBOARD_SETTING_KEY = 'dashboard'
|
|
@@ -0,0 +1,530 @@
|
|
|
1
|
+
import '@things-factory/form-ui'
|
|
2
|
+
import '@things-factory/grist-ui'
|
|
3
|
+
import '@things-factory/import-ui'
|
|
4
|
+
import '@things-factory/barcode-ui'
|
|
5
|
+
|
|
6
|
+
import gql from 'graphql-tag'
|
|
7
|
+
import { css, html } from 'lit-element'
|
|
8
|
+
import { connect } from 'pwa-helpers/connect-mixin'
|
|
9
|
+
|
|
10
|
+
import { DirectPrinter } from '@things-factory/barcode-base'
|
|
11
|
+
import { MultiColumnFormStyles } from '@things-factory/form-ui'
|
|
12
|
+
import { i18next, localize } from '@things-factory/i18n-base'
|
|
13
|
+
import { client, CustomAlert, PageView, store } from '@things-factory/shell'
|
|
14
|
+
import { CommonButtonStyles, ScrollbarStyles } from '@things-factory/styles'
|
|
15
|
+
import { gqlBuilder, isMobileDevice } from '@things-factory/utils'
|
|
16
|
+
|
|
17
|
+
import { PRODUCT_LABEL_SETTING_KEY } from '../constants'
|
|
18
|
+
|
|
19
|
+
class PrintProductLabel extends connect(store)(localize(i18next)(PageView)) {
|
|
20
|
+
static get styles() {
|
|
21
|
+
return [
|
|
22
|
+
MultiColumnFormStyles,
|
|
23
|
+
ScrollbarStyles,
|
|
24
|
+
css`
|
|
25
|
+
:host {
|
|
26
|
+
display: flex;
|
|
27
|
+
flex-direction: column;
|
|
28
|
+
overflow: hidden;
|
|
29
|
+
}
|
|
30
|
+
search-form {
|
|
31
|
+
overflow: visible;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
data-grist {
|
|
35
|
+
overflow-y: auto;
|
|
36
|
+
flex: 1;
|
|
37
|
+
}
|
|
38
|
+
`
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
static get properties() {
|
|
43
|
+
return {
|
|
44
|
+
config: Object,
|
|
45
|
+
_selectedRecords: Array,
|
|
46
|
+
_searchingType: String
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
render() {
|
|
51
|
+
const SEARCH_TYPES = [
|
|
52
|
+
{ name: 'gan', value: 'GAN' },
|
|
53
|
+
{ name: 'ro', value: 'RO' },
|
|
54
|
+
{ name: 'inventory', value: 'INVENTORY' }
|
|
55
|
+
]
|
|
56
|
+
|
|
57
|
+
return html`
|
|
58
|
+
<form class="multi-column-form" id="info-form">
|
|
59
|
+
<fieldset>
|
|
60
|
+
<legend>${i18next.t('title.search_area')}</legend>
|
|
61
|
+
<label>${i18next.t('label.search_type')}</label>
|
|
62
|
+
<select name="orderType" @change="${e => (this._searchingType = e.currentTarget.value)}">
|
|
63
|
+
${Object.keys(SEARCH_TYPES).map(
|
|
64
|
+
key => html`
|
|
65
|
+
<option value="${SEARCH_TYPES[key].value}">${i18next.t(`label.${SEARCH_TYPES[key].name}`)}</option>
|
|
66
|
+
`
|
|
67
|
+
)}
|
|
68
|
+
</select>
|
|
69
|
+
|
|
70
|
+
${this._searchingType === SEARCH_TYPES.find(type => type.name === 'inventory').value
|
|
71
|
+
? html`
|
|
72
|
+
<label>${i18next.t('label.product_info')}</label>
|
|
73
|
+
<input name="productInfo" value="" type="text" @keypress="${this.orderNoKeypressHandler.bind(this)}" />
|
|
74
|
+
`
|
|
75
|
+
: html`
|
|
76
|
+
<label>${i18next.t('label.order_no')}</label>
|
|
77
|
+
<barcode-scanable-input
|
|
78
|
+
name="orderNo"
|
|
79
|
+
custom-input
|
|
80
|
+
@keypress="${this.orderNoKeypressHandler.bind(this)}"
|
|
81
|
+
></barcode-scanable-input>
|
|
82
|
+
`}
|
|
83
|
+
</fieldset>
|
|
84
|
+
</form>
|
|
85
|
+
|
|
86
|
+
<data-grist
|
|
87
|
+
.mode=${isMobileDevice() ? 'LIST' : 'GRID'}
|
|
88
|
+
.config=${this.config}
|
|
89
|
+
.fetchHandler="${this.fetchHandler.bind(this)}"
|
|
90
|
+
@select-record-change=${e => (this._selectedRecords = e.detail.selectedRecords)}
|
|
91
|
+
}
|
|
92
|
+
></data-grist>
|
|
93
|
+
`
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
constructor() {
|
|
97
|
+
super()
|
|
98
|
+
this._searchingType = 'GAN'
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
get context() {
|
|
102
|
+
return {
|
|
103
|
+
title: i18next.t('title.print_product_label'),
|
|
104
|
+
actions: [
|
|
105
|
+
{
|
|
106
|
+
title: i18next.t('button.print_label'),
|
|
107
|
+
action: this._printProductLabels.bind(this),
|
|
108
|
+
...CommonButtonStyles.label
|
|
109
|
+
}
|
|
110
|
+
]
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
get dataGrist() {
|
|
115
|
+
return this.shadowRoot.querySelector('data-grist')
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
get orderNoInput() {
|
|
119
|
+
return this.shadowRoot.querySelector('barcode-scanable-input[name=orderNo]').shadowRoot.querySelector('input')
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
get productInfoInput() {
|
|
123
|
+
return this.shadowRoot.querySelector('input[name=productInfo]')
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
get searchInfo() {
|
|
127
|
+
if (this._searchingType == 'INVENTORY') return this.shadowRoot.querySelector('input[name=productInfo]')
|
|
128
|
+
else return this.shadowRoot.querySelector('barcode-scanable-input[name=orderNo]').shadowRoot.querySelector('input')
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
get targetData() {
|
|
132
|
+
return this.dataGrist.selected.map(record => {
|
|
133
|
+
if (!record.printQty || record.printQty == '' || Number(record.printQty) < 1) {
|
|
134
|
+
return {
|
|
135
|
+
...record,
|
|
136
|
+
printQty: 1
|
|
137
|
+
}
|
|
138
|
+
} else {
|
|
139
|
+
return record
|
|
140
|
+
}
|
|
141
|
+
})
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
pageInitialized() {
|
|
145
|
+
this.config = {
|
|
146
|
+
pagination: { infinite: true },
|
|
147
|
+
rows: { selectable: { multiple: true } },
|
|
148
|
+
list: {
|
|
149
|
+
fields: [
|
|
150
|
+
'palletId',
|
|
151
|
+
'batchId',
|
|
152
|
+
'sku',
|
|
153
|
+
'productInfo',
|
|
154
|
+
'auxUnit1',
|
|
155
|
+
'auxValue1',
|
|
156
|
+
'auxUnit2',
|
|
157
|
+
'auxValue2',
|
|
158
|
+
'expirationDate',
|
|
159
|
+
'printQty'
|
|
160
|
+
]
|
|
161
|
+
},
|
|
162
|
+
columns: [
|
|
163
|
+
{ type: 'gutter', gutterName: 'sequence' },
|
|
164
|
+
{ type: 'gutter', gutterName: 'row-selector', multiple: true },
|
|
165
|
+
{
|
|
166
|
+
type: 'string',
|
|
167
|
+
name: 'palletId',
|
|
168
|
+
header: i18next.t('field.lot_id'),
|
|
169
|
+
sortable: true,
|
|
170
|
+
width: 150
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
type: 'string',
|
|
174
|
+
name: 'batchId',
|
|
175
|
+
header: i18next.t('field.batch_id'),
|
|
176
|
+
sortable: true,
|
|
177
|
+
width: 150
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
type: 'string',
|
|
181
|
+
name: 'sku',
|
|
182
|
+
header: i18next.t('field.sku'),
|
|
183
|
+
sortable: true,
|
|
184
|
+
width: 150
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
type: 'string',
|
|
188
|
+
name: 'productInfo',
|
|
189
|
+
header: i18next.t('field.product_info'),
|
|
190
|
+
sortable: true,
|
|
191
|
+
width: 200
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
type: 'string',
|
|
195
|
+
name: 'type',
|
|
196
|
+
header: i18next.t('field.product_type'),
|
|
197
|
+
sortable: true,
|
|
198
|
+
width: 120
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
type: 'string',
|
|
202
|
+
name: 'auxUnit1',
|
|
203
|
+
header: i18next.t('field.aux_unit'),
|
|
204
|
+
sortable: true,
|
|
205
|
+
width: 80
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
type: 'string',
|
|
209
|
+
name: 'auxValue1',
|
|
210
|
+
header: i18next.t('field.aux_value'),
|
|
211
|
+
sortable: true,
|
|
212
|
+
width: 80
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
type: 'string',
|
|
216
|
+
name: 'auxUnit2',
|
|
217
|
+
header: i18next.t('field.aux_unit_2'),
|
|
218
|
+
sortable: true,
|
|
219
|
+
width: 100
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
type: 'string',
|
|
223
|
+
name: 'auxValue2',
|
|
224
|
+
header: i18next.t('field.aux_value_2'),
|
|
225
|
+
sortable: true,
|
|
226
|
+
width: 100
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
type: 'string',
|
|
230
|
+
name: 'expirationDate',
|
|
231
|
+
header: i18next.t('field.exp_date'),
|
|
232
|
+
sortable: true,
|
|
233
|
+
width: 100
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
type: 'number',
|
|
237
|
+
name: 'printQty',
|
|
238
|
+
header: i18next.t('field.print_qty'),
|
|
239
|
+
record: { editable: true },
|
|
240
|
+
width: 80
|
|
241
|
+
}
|
|
242
|
+
]
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
async fetchHandler({ page, limit, sorters = [] }) {
|
|
247
|
+
const fetcherDetail = { page, limit, sorters }
|
|
248
|
+
const searchInfo = this.searchInfo.value
|
|
249
|
+
const searchType = this._searchingType
|
|
250
|
+
|
|
251
|
+
if (searchInfo == '') return
|
|
252
|
+
|
|
253
|
+
switch (searchType) {
|
|
254
|
+
case 'GAN':
|
|
255
|
+
return await this._fetchOrderInventories([
|
|
256
|
+
{
|
|
257
|
+
name: 'arrivalNoticeNo',
|
|
258
|
+
operator: 'eq',
|
|
259
|
+
value: searchInfo
|
|
260
|
+
}
|
|
261
|
+
])
|
|
262
|
+
|
|
263
|
+
case 'RO':
|
|
264
|
+
return await this._fetchOrderInventories([
|
|
265
|
+
{
|
|
266
|
+
name: 'releaseGoodNo',
|
|
267
|
+
operator: 'eq',
|
|
268
|
+
value: searchInfo
|
|
269
|
+
}
|
|
270
|
+
])
|
|
271
|
+
|
|
272
|
+
case 'INVENTORY':
|
|
273
|
+
const filters = [
|
|
274
|
+
{ name: 'product_info', operator: 'eq', value: searchInfo },
|
|
275
|
+
{ name: 'status', operator: 'notin', value: ['INTRANSIT', 'TERMINATED', 'DELETED'] }
|
|
276
|
+
]
|
|
277
|
+
return await this._fetchInventories(fetcherDetail, filters)
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
async _fetchOrderInventories(filters) {
|
|
282
|
+
try {
|
|
283
|
+
const response = await client.query({
|
|
284
|
+
query: gql`
|
|
285
|
+
query {
|
|
286
|
+
orderInventories(${gqlBuilder.buildArgs({
|
|
287
|
+
filters
|
|
288
|
+
})}) {
|
|
289
|
+
items {
|
|
290
|
+
inventory {
|
|
291
|
+
batchId
|
|
292
|
+
palletId
|
|
293
|
+
expirationDate
|
|
294
|
+
product {
|
|
295
|
+
name
|
|
296
|
+
sku
|
|
297
|
+
description
|
|
298
|
+
type
|
|
299
|
+
auxUnit1
|
|
300
|
+
auxValue1
|
|
301
|
+
auxUnit2
|
|
302
|
+
auxValue2
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
total
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
`
|
|
310
|
+
})
|
|
311
|
+
|
|
312
|
+
if (!response.errors) {
|
|
313
|
+
const orderInventories = response.data.orderInventories
|
|
314
|
+
|
|
315
|
+
return {
|
|
316
|
+
total: orderInventories.total,
|
|
317
|
+
records: orderInventories.items.map(item => {
|
|
318
|
+
const inventory = item.inventory
|
|
319
|
+
|
|
320
|
+
return {
|
|
321
|
+
batchId: inventory.batchId,
|
|
322
|
+
palletId: inventory.palletId,
|
|
323
|
+
expirationDate: inventory.expirationDate || '',
|
|
324
|
+
productName: inventory.product.name,
|
|
325
|
+
sku: inventory.product.sku,
|
|
326
|
+
description: inventory.product.description,
|
|
327
|
+
type: inventory.product.type,
|
|
328
|
+
auxUnit1: inventory.product.auxUnit1 || '',
|
|
329
|
+
auxValue1: inventory.product.auxValue1 || '',
|
|
330
|
+
auxUnit2: inventory.product.auxUnit2 || '',
|
|
331
|
+
auxValue2: inventory.product.auxValue2 || '',
|
|
332
|
+
productInfo: inventory.product.description
|
|
333
|
+
? `${inventory.product.name} (${inventory.product.description})`
|
|
334
|
+
: `${inventory.product.name}`
|
|
335
|
+
}
|
|
336
|
+
})
|
|
337
|
+
}
|
|
338
|
+
} else
|
|
339
|
+
return {
|
|
340
|
+
records: [],
|
|
341
|
+
total: 0
|
|
342
|
+
}
|
|
343
|
+
} catch (e) {
|
|
344
|
+
this._showToast(e)
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
async _fetchInventories(fetcherDetail, filters) {
|
|
349
|
+
const response = await client.query({
|
|
350
|
+
query: gql`
|
|
351
|
+
query inventories($filters: [Filter], $pagination: Pagination, $sortings: [Sorting]) {
|
|
352
|
+
inventories(filters: $filters, pagination: $pagination, sortings: $sortings) {
|
|
353
|
+
items {
|
|
354
|
+
palletId
|
|
355
|
+
batchId
|
|
356
|
+
product {
|
|
357
|
+
name
|
|
358
|
+
sku
|
|
359
|
+
description
|
|
360
|
+
type
|
|
361
|
+
auxUnit1
|
|
362
|
+
auxValue1
|
|
363
|
+
auxUnit2
|
|
364
|
+
auxValue2
|
|
365
|
+
}
|
|
366
|
+
expirationDate
|
|
367
|
+
}
|
|
368
|
+
total
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
`,
|
|
372
|
+
variables: {
|
|
373
|
+
filters,
|
|
374
|
+
pagination: { page: 1, limit: 99999 },
|
|
375
|
+
sortings: fetcherDetail.sorters
|
|
376
|
+
}
|
|
377
|
+
})
|
|
378
|
+
|
|
379
|
+
if (!response.errors) {
|
|
380
|
+
const inventories = response.data.inventories
|
|
381
|
+
|
|
382
|
+
return {
|
|
383
|
+
total: inventories.total,
|
|
384
|
+
records: inventories.items.map(item => {
|
|
385
|
+
return {
|
|
386
|
+
batchId: item.batchId,
|
|
387
|
+
palletId: item.palletId,
|
|
388
|
+
expirationDate: item.expirationDate || '',
|
|
389
|
+
productName: item.product.name,
|
|
390
|
+
sku: item.product.sku,
|
|
391
|
+
description: item.product.description,
|
|
392
|
+
type: item.product.type,
|
|
393
|
+
auxUnit1: item.product.auxUnit1 || '',
|
|
394
|
+
auxValue1: item.product.auxValue1 || '',
|
|
395
|
+
auxUnit2: item.product.auxUnit2 || '',
|
|
396
|
+
auxValue2: item.product.auxValue2 || '',
|
|
397
|
+
productInfo: item.product.description
|
|
398
|
+
? `${item.product.name} (${item.product.description})`
|
|
399
|
+
: `${item.product.name}`
|
|
400
|
+
}
|
|
401
|
+
})
|
|
402
|
+
}
|
|
403
|
+
} else
|
|
404
|
+
return {
|
|
405
|
+
records: [],
|
|
406
|
+
total: 0
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
async _printProductLabels() {
|
|
411
|
+
const labelId = this._productLabel && this._productLabel.id
|
|
412
|
+
|
|
413
|
+
if (
|
|
414
|
+
this.dataGrist.selected.some(record => !record.printQty || record.printQty == '' || Number(record.printQty) < 1)
|
|
415
|
+
) {
|
|
416
|
+
const result = await CustomAlert({
|
|
417
|
+
title: i18next.t('title.are_you_sure'),
|
|
418
|
+
text: i18next.t('text.print_1_label_for_item_with_non_specified_print_qty'),
|
|
419
|
+
confirmButton: { text: i18next.t('button.confirm') },
|
|
420
|
+
cancelButton: { text: i18next.t('button.cancel') }
|
|
421
|
+
})
|
|
422
|
+
|
|
423
|
+
if (!result.value) return
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
const records = this.targetData
|
|
427
|
+
|
|
428
|
+
if (!records?.length) {
|
|
429
|
+
this._showToast({ message: `${i18next.t('text.please_select_the_product')}.` })
|
|
430
|
+
return
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
if (!labelId) {
|
|
434
|
+
this._showToast({
|
|
435
|
+
level: 'error',
|
|
436
|
+
message: `${i18next.t('text.no_label_setting_was_found')}. ${i18next.t('text.please_check_your_setting')}`
|
|
437
|
+
})
|
|
438
|
+
} else {
|
|
439
|
+
for (var record of records) {
|
|
440
|
+
let searchParams = new URLSearchParams()
|
|
441
|
+
|
|
442
|
+
searchParams.append('pallet_id', record.palletId)
|
|
443
|
+
searchParams.append('batch_id', record.batchId)
|
|
444
|
+
searchParams.append('aux_unit_1', record.auxUnit1)
|
|
445
|
+
searchParams.append('aux_value_1', record.auxValue1)
|
|
446
|
+
searchParams.append('aux_unit_2', record.auxUnit2)
|
|
447
|
+
searchParams.append('aux_value_2', record.auxValue2)
|
|
448
|
+
searchParams.append('expiration_date', record.expirationDate)
|
|
449
|
+
|
|
450
|
+
let printCounter = 0
|
|
451
|
+
try {
|
|
452
|
+
for (let i = 0; i < record.printQty; i++) {
|
|
453
|
+
const response = await fetch(`label-command/${labelId}?${searchParams.toString()}`, {
|
|
454
|
+
method: 'GET'
|
|
455
|
+
})
|
|
456
|
+
|
|
457
|
+
if (response.status !== 200) {
|
|
458
|
+
throw `Error : Can't get label command from server (response: ${response.status})`
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
var command = await response.text()
|
|
462
|
+
|
|
463
|
+
if (!this.printer) {
|
|
464
|
+
this.printer = new DirectPrinter()
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
await this.printer.print(command)
|
|
468
|
+
printCounter += 1
|
|
469
|
+
}
|
|
470
|
+
} catch (ex) {
|
|
471
|
+
this._showToast({ level: 'error', message: ex })
|
|
472
|
+
|
|
473
|
+
delete this.printer
|
|
474
|
+
break
|
|
475
|
+
} finally {
|
|
476
|
+
// we only need to update when the counter is more than 0
|
|
477
|
+
if (printCounter > 0) await this._updatePrintedLabelSequence(record.type, printCounter)
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
async _updatePrintedLabelSequence(pattern, counter) {
|
|
484
|
+
try {
|
|
485
|
+
const response = await client.mutate({
|
|
486
|
+
mutation: gql`
|
|
487
|
+
mutation upsertSequence($pattern: String!, $counter: Int) {
|
|
488
|
+
upsertSequence(pattern: $pattern, counter: $counter) {
|
|
489
|
+
pattern
|
|
490
|
+
seq
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
`,
|
|
494
|
+
variables: {
|
|
495
|
+
pattern,
|
|
496
|
+
counter
|
|
497
|
+
}
|
|
498
|
+
})
|
|
499
|
+
} catch (e) {
|
|
500
|
+
this._showToast({ message: e })
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
stateChanged(state) {
|
|
505
|
+
const productLabelSetting = state.dashboard[PRODUCT_LABEL_SETTING_KEY]
|
|
506
|
+
this._productLabel = (productLabelSetting && productLabelSetting.board) || {}
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
orderNoKeypressHandler(e) {
|
|
510
|
+
if (e.keyCode === 13) {
|
|
511
|
+
e.preventDefault()
|
|
512
|
+
|
|
513
|
+
this.dataGrist.fetch()
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
_showToast({ level, type, message }) {
|
|
518
|
+
document.dispatchEvent(
|
|
519
|
+
new CustomEvent('notify', {
|
|
520
|
+
detail: {
|
|
521
|
+
type,
|
|
522
|
+
level,
|
|
523
|
+
message
|
|
524
|
+
}
|
|
525
|
+
})
|
|
526
|
+
)
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
window.customElements.define('print-product-label', PrintProductLabel)
|
package/client/route.js
CHANGED
|
@@ -351,6 +351,10 @@ export default function route(page) {
|
|
|
351
351
|
import('./pages/vas/vas-worksheet-list')
|
|
352
352
|
return page
|
|
353
353
|
|
|
354
|
+
case 'print_product_label':
|
|
355
|
+
import('./pages/vas/print-product-label')
|
|
356
|
+
return page
|
|
357
|
+
|
|
354
358
|
case 'inbound_reusable_pallet':
|
|
355
359
|
import('./pages/inbound/inbound-reusable-pallet')
|
|
356
360
|
return page
|
|
@@ -439,7 +443,7 @@ export default function route(page) {
|
|
|
439
443
|
case 'inbound_order_details_report':
|
|
440
444
|
import('./pages/report/inbound-order-details-report')
|
|
441
445
|
return page
|
|
442
|
-
|
|
446
|
+
|
|
443
447
|
case 'outbound_order_details_report':
|
|
444
448
|
import('./pages/report/outbound-order-details-report')
|
|
445
449
|
return page
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.boardSettingsResolver = void 0;
|
|
4
|
+
const typeorm_1 = require("typeorm");
|
|
4
5
|
const auth_base_1 = require("@things-factory/auth-base");
|
|
5
6
|
const board_service_1 = require("@things-factory/board-service");
|
|
6
7
|
const setting_base_1 = require("@things-factory/setting-base");
|
|
7
|
-
const typeorm_1 = require("typeorm");
|
|
8
8
|
const opa_app_setting_constants_1 = require("../../../opa-app-setting-constants");
|
|
9
9
|
exports.boardSettingsResolver = {
|
|
10
10
|
async boardSettings(_, params, context) {
|
|
@@ -24,7 +24,14 @@ exports.boardSettingsResolver = {
|
|
|
24
24
|
const HOME_BOARD = `${opa_app_setting_constants_1.HOME_DASHBOARD_PREFIX}:${userType}`;
|
|
25
25
|
// const HOME_BOARD = `${HOME_DASHBOARD_PREFIX}:${context.state.user.userType}`
|
|
26
26
|
const queryBuilder = (0, typeorm_1.getRepository)(setting_base_1.Setting).createQueryBuilder();
|
|
27
|
-
const names = [
|
|
27
|
+
const names = [
|
|
28
|
+
opa_app_setting_constants_1.LOCATION_LABEL_SETTING_KEY,
|
|
29
|
+
opa_app_setting_constants_1.PRODUCT_LABEL_SETTING_KEY,
|
|
30
|
+
opa_app_setting_constants_1.PALLET_LABEL_SETTING_KEY,
|
|
31
|
+
opa_app_setting_constants_1.REUSABLE_PALLET_LABEL_SETTING_KEY,
|
|
32
|
+
HOME_BOARD,
|
|
33
|
+
opa_app_setting_constants_1.CARTON_LABEL_SETTING_KEY
|
|
34
|
+
];
|
|
28
35
|
var qb = queryBuilder
|
|
29
36
|
// .innerJoin(Board, 'Board', 'Board.id = CAST(Setting.value AS uuid)')
|
|
30
37
|
.innerJoin(board_service_1.Board, 'Board', 'Setting.value = CAST(Board.id AS char(36))')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"board-settings.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/board-setting/board-settings.ts"],"names":[],"mappings":";;;AAAA,yDAAgD;AAChD,iEAAqD;AACrD,+DAAsD;
|
|
1
|
+
{"version":3,"file":"board-settings.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/board-setting/board-settings.ts"],"names":[],"mappings":";;;AAAA,qCAAuC;AAEvC,yDAAgD;AAChD,iEAAqD;AACrD,+DAAsD;AAGtD,kFAO2C;AAE9B,QAAA,qBAAqB,GAAG;IACnC,KAAK,CAAC,aAAa,CAAC,CAAM,EAAE,MAAW,EAAE,OAAY;QACnD,MAAM,EAAE,MAAM,EAAE,GAAuB,OAAO,CAAC,KAAK,CAAA;QAEpD;;6FAEqF;QACrF,MAAM,IAAI,GAAS,MAAM,IAAA,uBAAa,EAAC,gBAAI,CAAC;aACzC,kBAAkB,CAAC,MAAM,CAAC;aAC1B,iBAAiB,CAAC,YAAY,EAAE,OAAO,CAAC;aACxC,iBAAiB,CAAC,cAAc,EAAE,cAAc,CAAC;aACjD,KAAK,CAAC,mBAAmB,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC;aAC7D,QAAQ,CAAC,6BAA6B,EAAE,EAAE,QAAQ,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC;aAChE,MAAM,EAAE,CAAA;QAEX,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,CAAA;QAC3E,oFAAoF;QAEpF,MAAM,UAAU,GAAG,GAAG,iDAAqB,IAAI,QAAQ,EAAE,CAAA;QACzD,+EAA+E;QAE/E,MAAM,YAAY,GAAG,IAAA,uBAAa,EAAC,sBAAO,CAAC,CAAC,kBAAkB,EAAE,CAAA;QAChE,MAAM,KAAK,GAAG;YACZ,sDAA0B;YAC1B,qDAAyB;YACzB,oDAAwB;YACxB,6DAAiC;YACjC,UAAU;YACV,oDAAwB;SACzB,CAAA;QAED,IAAI,EAAE,GAAG,YAAY;YACnB,uEAAuE;aACtE,SAAS,CAAC,qBAAK,EAAE,OAAO,EAAE,4CAA4C,CAAC;YACxE,yDAAyD;aACxD,MAAM,CAAC;YACN,kBAAkB;YAClB,sBAAsB;YACtB,wBAAwB;YACxB,qBAAqB;YACrB,yBAAyB;YACzB,uCAAuC;YACvC,mCAAmC;SACpC,CAAC;aACD,KAAK,CAAC,6BAA6B,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,CAAA;QAE5E,IAAI,KAAK,IAAI,KAAK,CAAC,MAAM;YAAE,EAAE,CAAC,QAAQ,CAAC,6BAA6B,EAAE,EAAE,KAAK,EAAE,CAAC,CAAA;QAEhF,IAAI,gBAAgB,GAAG,MAAM,EAAE,CAAC,UAAU,EAAE,CAAA;QAE5C,OAAO,gBAAgB,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE;YACzC,IAAI,OAAO,GAAQ;gBACjB,KAAK,EAAE,EAAE;aACV,CAAA;YAED,KAAK,IAAI,GAAG,IAAI,YAAY,EAAE;gBAC5B,IAAI,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;oBACzB,IAAI,SAAS,GAAG,GAAG,CAAA;oBACnB,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE,CAAA;oBAC5C,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,YAAY,CAAC,SAAS,CAAC,CAAA;iBAC7C;qBAAM;oBACL,OAAO,CAAC,GAAG,CAAC,GAAG,YAAY,CAAC,GAAG,CAAC,CAAA;iBACjC;aACF;YAED,IAAI,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,iDAAqB,CAAC,IAAI,CAAC,EAAE;gBACpD,OAAO,CAAC,IAAI,GAAG,iDAAqB,CAAA;aACrC;YAED,OAAO,OAAO,CAAA;QAChB,CAAC,CAAC,CAAA;IACJ,CAAC;CACF,CAAA"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HOME_DASHBOARD_PREFIX = exports.REUSABLE_PALLET_LABEL_SETTING_KEY = exports.CARTON_LABEL_SETTING_KEY = exports.PALLET_LABEL_SETTING_KEY = exports.LOCATION_LABEL_SETTING_KEY = void 0;
|
|
3
|
+
exports.PRODUCT_LABEL_SETTING_KEY = exports.HOME_DASHBOARD_PREFIX = exports.REUSABLE_PALLET_LABEL_SETTING_KEY = exports.CARTON_LABEL_SETTING_KEY = exports.PALLET_LABEL_SETTING_KEY = exports.LOCATION_LABEL_SETTING_KEY = void 0;
|
|
4
4
|
exports.LOCATION_LABEL_SETTING_KEY = 'location-label';
|
|
5
5
|
exports.PALLET_LABEL_SETTING_KEY = 'pallet-label';
|
|
6
6
|
exports.CARTON_LABEL_SETTING_KEY = 'carton-label';
|
|
7
7
|
exports.REUSABLE_PALLET_LABEL_SETTING_KEY = 'reusable-pallet-label';
|
|
8
8
|
exports.HOME_DASHBOARD_PREFIX = 'dashboard';
|
|
9
|
+
exports.PRODUCT_LABEL_SETTING_KEY = 'product-label';
|
|
9
10
|
//# sourceMappingURL=opa-app-setting-constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"opa-app-setting-constants.js","sourceRoot":"","sources":["../server/opa-app-setting-constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,0BAA0B,GAAG,gBAAgB,CAAA;AAC7C,QAAA,wBAAwB,GAAG,cAAc,CAAA;AACzC,QAAA,wBAAwB,GAAG,cAAc,CAAA;AACzC,QAAA,iCAAiC,GAAG,uBAAuB,CAAA;AAC3D,QAAA,qBAAqB,GAAG,WAAW,CAAA"}
|
|
1
|
+
{"version":3,"file":"opa-app-setting-constants.js","sourceRoot":"","sources":["../server/opa-app-setting-constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,0BAA0B,GAAG,gBAAgB,CAAA;AAC7C,QAAA,wBAAwB,GAAG,cAAc,CAAA;AACzC,QAAA,wBAAwB,GAAG,cAAc,CAAA;AACzC,QAAA,iCAAiC,GAAG,uBAAuB,CAAA;AAC3D,QAAA,qBAAqB,GAAG,WAAW,CAAA;AACnC,QAAA,yBAAyB,GAAG,eAAe,CAAA"}
|