@things-factory/operato-wms 3.8.10 → 3.8.15
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.
|
@@ -665,6 +665,7 @@ class LocationList extends connect(store)(localize(i18next)(PageView)) {
|
|
|
665
665
|
|
|
666
666
|
/* for location record mapping */
|
|
667
667
|
searchParams.append('location', record.name)
|
|
668
|
+
searchParams.append('originalName', record.originalName)
|
|
668
669
|
searchParams.append('label', record.indicator)
|
|
669
670
|
|
|
670
671
|
try {
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import '@things-factory/form-ui'
|
|
2
|
-
import { MultiColumnFormStyles } from '@things-factory/form-ui'
|
|
3
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 } from '@things-factory/form-ui'
|
|
4
8
|
import { i18next, localize } from '@things-factory/i18n-base'
|
|
5
9
|
import { client } from '@things-factory/shell'
|
|
6
10
|
import { ScrollbarStyles } from '@things-factory/styles'
|
|
7
|
-
import {
|
|
8
|
-
import gql from 'graphql-tag'
|
|
9
|
-
import { css, html, LitElement } from 'lit-element'
|
|
11
|
+
import { isMobileDevice } from '@things-factory/utils'
|
|
10
12
|
|
|
11
13
|
export class PrintLocationLabel extends localize(i18next)(LitElement) {
|
|
12
14
|
static get properties() {
|
|
@@ -91,27 +93,24 @@ export class PrintLocationLabel extends localize(i18next)(LitElement) {
|
|
|
91
93
|
<fieldset>
|
|
92
94
|
<label>${i18next.t('label.label_format')}</label>
|
|
93
95
|
<select
|
|
94
|
-
name="labelFormat"
|
|
96
|
+
name="labelFormat"
|
|
95
97
|
@change="${e => {
|
|
96
|
-
this._fullLocationFormat =
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
if (this._labelIndicator.value != '') {
|
|
101
|
-
this._getPrintPreview(this._labelIndicator.value)
|
|
102
|
-
}
|
|
103
|
-
}}">
|
|
98
|
+
this._fullLocationFormat = e.currentTarget.value === 'full_format' ? true : false
|
|
99
|
+
if (this._labelIndicator.value != '') this.dataGrist.fetch()
|
|
100
|
+
}}"
|
|
101
|
+
>
|
|
104
102
|
<option value="full_format">A-01-01-01 (${i18next.t('text.full_format')})</option>
|
|
105
103
|
<option value="partial_format">A-01-01 (${i18next.t('text.partial_format')})</option>
|
|
106
104
|
</select>
|
|
107
105
|
|
|
108
106
|
<label>${i18next.t('label.label_indicator')}</label>
|
|
109
|
-
<select
|
|
107
|
+
<select
|
|
108
|
+
name="labelIndicator"
|
|
110
109
|
@change="${e => {
|
|
111
110
|
let indicator = e.currentTarget.value
|
|
112
|
-
if (indicator !== '')
|
|
113
|
-
|
|
114
|
-
|
|
111
|
+
if (indicator !== '') this.dataGrist.fetch()
|
|
112
|
+
}}"
|
|
113
|
+
>
|
|
115
114
|
<option value="">-- ${i18next.t('text.please_select_label_indicator')} --</option>
|
|
116
115
|
<option value="zone">${i18next.t('label.zone')}</option>
|
|
117
116
|
<option value="row">${i18next.t('label.row')}</option>
|
|
@@ -151,6 +150,12 @@ export class PrintLocationLabel extends localize(i18next)(LitElement) {
|
|
|
151
150
|
header: i18next.t('field.name'),
|
|
152
151
|
width: 250
|
|
153
152
|
},
|
|
153
|
+
{
|
|
154
|
+
type: 'string',
|
|
155
|
+
name: 'originalName',
|
|
156
|
+
header: i18next.t('field.original_name'),
|
|
157
|
+
width: 250
|
|
158
|
+
},
|
|
154
159
|
{
|
|
155
160
|
type: 'string',
|
|
156
161
|
name: 'indicator',
|
|
@@ -159,11 +164,6 @@ export class PrintLocationLabel extends localize(i18next)(LitElement) {
|
|
|
159
164
|
}
|
|
160
165
|
]
|
|
161
166
|
}
|
|
162
|
-
|
|
163
|
-
if (this.selectedLocations && this.selectedLocations.length > 0) {
|
|
164
|
-
this._records = []
|
|
165
|
-
this._total = 0
|
|
166
|
-
}
|
|
167
167
|
}
|
|
168
168
|
|
|
169
169
|
get _labelIndicator() {
|
|
@@ -174,171 +174,157 @@ export class PrintLocationLabel extends localize(i18next)(LitElement) {
|
|
|
174
174
|
return this.shadowRoot.querySelector('data-grist')
|
|
175
175
|
}
|
|
176
176
|
|
|
177
|
-
async fetchHandler() {
|
|
178
|
-
return
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
}
|
|
182
|
-
}
|
|
177
|
+
async fetchHandler({ page, limit, sorters = [{ name: 'name' }] }) {
|
|
178
|
+
if (this._labelIndicator.value == '') return
|
|
179
|
+
const fetcherDetail = { page, limit, sorters }
|
|
180
|
+
const indicator = this._labelIndicator.value || ''
|
|
183
181
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
182
|
+
let filters = [
|
|
183
|
+
{
|
|
184
|
+
name: 'warehouse_id',
|
|
185
|
+
operator: 'eq',
|
|
186
|
+
value: this.warehouseId
|
|
187
|
+
}
|
|
188
|
+
]
|
|
189
|
+
|
|
190
|
+
let locations = [],
|
|
191
|
+
totalLocations = 0
|
|
187
192
|
|
|
188
|
-
if (this.selectedLocations && this.selectedLocations.length
|
|
189
|
-
|
|
193
|
+
if (this.selectedLocations && this.selectedLocations.length) {
|
|
194
|
+
filters.push({
|
|
195
|
+
name: 'name',
|
|
196
|
+
operator: 'in',
|
|
197
|
+
value: this.selectedLocations.map(location => location.name)
|
|
198
|
+
})
|
|
199
|
+
const { records, total } = await this._fetchLocations(filters, fetcherDetail)
|
|
200
|
+
locations = records
|
|
201
|
+
totalLocations = total
|
|
190
202
|
} else {
|
|
191
|
-
if (this.
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
operator: 'noteq',
|
|
202
|
-
value: 'BUFFER'
|
|
203
|
-
}
|
|
204
|
-
]
|
|
205
|
-
locations = await this._fetchLocations(filters)
|
|
206
|
-
}
|
|
203
|
+
if (this._fullLocationFormat) {
|
|
204
|
+
filters.push({
|
|
205
|
+
name: 'type',
|
|
206
|
+
operator: 'noteq',
|
|
207
|
+
value: 'BUFFER'
|
|
208
|
+
})
|
|
209
|
+
const { records, total } = await this._fetchLocations(filters, fetcherDetail)
|
|
210
|
+
locations = records
|
|
211
|
+
totalLocations = total
|
|
212
|
+
} else {
|
|
207
213
|
// if partial format:
|
|
208
|
-
// prevent from printing same location label. eg: A-01-01-01, A-01-01-02 > will print A-01-01 twice
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
operator: 'eq',
|
|
220
|
-
value: this.warehouseId
|
|
221
|
-
}]
|
|
222
|
-
locations = await this._fetchLocationsByGroup(filters)
|
|
223
|
-
}
|
|
214
|
+
// prevent from printing same location label. eg: A-01-01-01, A-01-01-02 > will print A-01-01 twice{
|
|
215
|
+
if (indicator == 'shelf') {
|
|
216
|
+
this._showToast({
|
|
217
|
+
level: 'error',
|
|
218
|
+
message: i18next.t('text.shelf_is_not_allowed_as_an_indicator_for_partial_format')
|
|
219
|
+
})
|
|
220
|
+
return
|
|
221
|
+
} else {
|
|
222
|
+
const { records, total } = await this._fetchLocationsByGroup(filters, fetcherDetail)
|
|
223
|
+
locations = records
|
|
224
|
+
totalLocations = total
|
|
224
225
|
}
|
|
225
226
|
}
|
|
226
227
|
}
|
|
227
228
|
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
...location,
|
|
232
|
-
indicator: location[indicator]
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
else {
|
|
229
|
+
return {
|
|
230
|
+
total: totalLocations,
|
|
231
|
+
records: locations.map(location => {
|
|
237
232
|
return {
|
|
238
233
|
...location,
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
:
|
|
242
|
-
|
|
234
|
+
indicator: location[indicator],
|
|
235
|
+
originalName: location.name,
|
|
236
|
+
name:
|
|
237
|
+
location.type === 'BUFFER'
|
|
238
|
+
? ''
|
|
239
|
+
: this._fullLocationFormat // check if full location format is true
|
|
240
|
+
? `${location.zone}-${location.row}-${location.column}-${location.shelf}`
|
|
241
|
+
: `${location.zone}-${location.row}-${location.column}`
|
|
243
242
|
}
|
|
244
|
-
}
|
|
245
|
-
})
|
|
246
|
-
|
|
247
|
-
this._records = locations
|
|
248
|
-
this._total = locations.length
|
|
249
|
-
|
|
250
|
-
this._config = {
|
|
251
|
-
...this._config,
|
|
252
|
-
pagination: { pages: [20, 50, 100, 200] }
|
|
243
|
+
})
|
|
253
244
|
}
|
|
254
|
-
|
|
255
|
-
this.dataGrist.fetch()
|
|
256
245
|
}
|
|
257
246
|
|
|
258
|
-
async _fetchLocations(filters) {
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
})}) {
|
|
272
|
-
items {
|
|
273
|
-
name
|
|
274
|
-
zone
|
|
275
|
-
row
|
|
276
|
-
column
|
|
277
|
-
shelf
|
|
278
|
-
}
|
|
279
|
-
total
|
|
247
|
+
async _fetchLocations(filters, fetcherDetail) {
|
|
248
|
+
try {
|
|
249
|
+
const response = await client.query({
|
|
250
|
+
query: gql`
|
|
251
|
+
query locations($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
|
|
252
|
+
locations(filters: $filters, pagination: $pagination, sortings: $sortings) {
|
|
253
|
+
items {
|
|
254
|
+
name
|
|
255
|
+
zone
|
|
256
|
+
row
|
|
257
|
+
column
|
|
258
|
+
shelf
|
|
259
|
+
type
|
|
280
260
|
}
|
|
261
|
+
total
|
|
281
262
|
}
|
|
282
|
-
|
|
283
|
-
|
|
263
|
+
}
|
|
264
|
+
`,
|
|
265
|
+
variables: {
|
|
266
|
+
filters,
|
|
267
|
+
paginations: { page: fetcherDetail.page, limit: fetcherDetail.limit },
|
|
268
|
+
sortings: fetcherDetail.sorters
|
|
269
|
+
}
|
|
270
|
+
})
|
|
284
271
|
|
|
285
|
-
|
|
286
|
-
|
|
272
|
+
if (!response.errors) {
|
|
273
|
+
return {
|
|
274
|
+
records: response.data.locations.items || [],
|
|
275
|
+
total: response.data.locations.total || 0
|
|
287
276
|
}
|
|
288
|
-
} catch (e) {
|
|
289
|
-
this._showToast({
|
|
290
|
-
level: 'error',
|
|
291
|
-
message: e
|
|
292
|
-
})
|
|
293
|
-
} finally {
|
|
294
|
-
this.dataGrist.hideSpinner()
|
|
295
277
|
}
|
|
278
|
+
} catch (e) {
|
|
279
|
+
this._showToast({
|
|
280
|
+
level: 'error',
|
|
281
|
+
message: e
|
|
282
|
+
})
|
|
296
283
|
}
|
|
297
284
|
}
|
|
298
285
|
|
|
299
|
-
async _fetchLocationsByGroup(filters) {
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
sortings: sorters
|
|
312
|
-
})}) {
|
|
313
|
-
items {
|
|
314
|
-
name
|
|
315
|
-
zone
|
|
316
|
-
row
|
|
317
|
-
column
|
|
318
|
-
}
|
|
319
|
-
total
|
|
286
|
+
async _fetchLocationsByGroup(filters, fetcherDetail) {
|
|
287
|
+
try {
|
|
288
|
+
const response = await client.query({
|
|
289
|
+
query: gql`
|
|
290
|
+
query locationsByGroup($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
|
|
291
|
+
locationsByGroup(filters: $filters, pagination: $pagination, sortings: $sortings) {
|
|
292
|
+
items {
|
|
293
|
+
name
|
|
294
|
+
zone
|
|
295
|
+
row
|
|
296
|
+
column
|
|
297
|
+
type
|
|
320
298
|
}
|
|
299
|
+
total
|
|
321
300
|
}
|
|
322
|
-
|
|
323
|
-
|
|
301
|
+
}
|
|
302
|
+
`,
|
|
303
|
+
variables: {
|
|
304
|
+
filters,
|
|
305
|
+
paginations: { page: fetcherDetail.page, limit: fetcherDetail.limit },
|
|
306
|
+
sortings: fetcherDetail.sorters
|
|
307
|
+
}
|
|
308
|
+
})
|
|
324
309
|
|
|
325
|
-
|
|
326
|
-
|
|
310
|
+
if (!response.errors) {
|
|
311
|
+
return {
|
|
312
|
+
records: response.data.locationsByGroup.items || [],
|
|
313
|
+
total: response.data.locationsByGroup.total || 0
|
|
327
314
|
}
|
|
328
|
-
} catch (e) {
|
|
329
|
-
this._showToast({
|
|
330
|
-
level: 'error',
|
|
331
|
-
message: e
|
|
332
|
-
})
|
|
333
|
-
} finally {
|
|
334
|
-
this.dataGrist.hideSpinner()
|
|
335
315
|
}
|
|
316
|
+
} catch (e) {
|
|
317
|
+
this._showToast({
|
|
318
|
+
level: 'error',
|
|
319
|
+
message: e
|
|
320
|
+
})
|
|
336
321
|
}
|
|
337
322
|
}
|
|
338
323
|
|
|
339
324
|
_printLocations() {
|
|
340
|
-
|
|
341
|
-
|
|
325
|
+
const records = this.dataGrist.data && this.dataGrist.data.records
|
|
326
|
+
if (records && records.length) {
|
|
327
|
+
this.dispatchEvent(new CustomEvent(i18next.t('text.printing'), { detail: records }))
|
|
342
328
|
history.back()
|
|
343
329
|
} else {
|
|
344
330
|
this._showToast({
|
|
@@ -652,6 +652,12 @@ class PackingProduct extends connect(store)(localize(i18next)(PageView)) {
|
|
|
652
652
|
var decodedHTML = atob(orderDocInfo[0].file)
|
|
653
653
|
this._callPrintDialog(decodedHTML)
|
|
654
654
|
break
|
|
655
|
+
|
|
656
|
+
default:
|
|
657
|
+
let url = new URL(window.location)
|
|
658
|
+
|
|
659
|
+
convertedPdfUrl = `${url.origin}/proxy?url=${encodeURIComponent(orderDocInfo[0].airwayBill)}`
|
|
660
|
+
this._callPrintDialog(convertedPdfUrl)
|
|
655
661
|
}
|
|
656
662
|
}
|
|
657
663
|
}
|
|
@@ -401,7 +401,7 @@ class PrintProductLabel extends connect(store)(localize(i18next)(PageView)) {
|
|
|
401
401
|
return {
|
|
402
402
|
...record,
|
|
403
403
|
gtin: productDetail.gtin,
|
|
404
|
-
productName:
|
|
404
|
+
productName: product.name
|
|
405
405
|
}
|
|
406
406
|
})
|
|
407
407
|
} else {
|
|
@@ -442,7 +442,7 @@ class PrintProductLabel extends connect(store)(localize(i18next)(PageView)) {
|
|
|
442
442
|
return {
|
|
443
443
|
...record,
|
|
444
444
|
gtin: productDetail.gtin,
|
|
445
|
-
productName:
|
|
445
|
+
productName: product.name
|
|
446
446
|
}
|
|
447
447
|
})
|
|
448
448
|
} else {
|
|
@@ -561,7 +561,7 @@ class PrintProductLabel extends connect(store)(localize(i18next)(PageView)) {
|
|
|
561
561
|
return {
|
|
562
562
|
...record,
|
|
563
563
|
gtin: productDetail.gtin,
|
|
564
|
-
productName:
|
|
564
|
+
productName: product.name
|
|
565
565
|
}
|
|
566
566
|
})
|
|
567
567
|
} else {
|
|
@@ -601,7 +601,7 @@ class PrintProductLabel extends connect(store)(localize(i18next)(PageView)) {
|
|
|
601
601
|
return {
|
|
602
602
|
...record,
|
|
603
603
|
gtin: productDetail.gtin,
|
|
604
|
-
productName:
|
|
604
|
+
productName: product.name
|
|
605
605
|
}
|
|
606
606
|
})
|
|
607
607
|
} else {
|
|
@@ -698,7 +698,7 @@ class PrintProductLabel extends connect(store)(localize(i18next)(PageView)) {
|
|
|
698
698
|
return {
|
|
699
699
|
...record,
|
|
700
700
|
gtin: productDetail.gtin,
|
|
701
|
-
productName:
|
|
701
|
+
productName: product.name
|
|
702
702
|
}
|
|
703
703
|
})
|
|
704
704
|
} else {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/operato-wms",
|
|
3
|
-
"version": "3.8.
|
|
3
|
+
"version": "3.8.15",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "client/index.js",
|
|
6
6
|
"things-factory": true,
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"@things-factory/print-ui": "^3.8.0",
|
|
72
72
|
"@things-factory/product-base": "^3.8.9",
|
|
73
73
|
"@things-factory/resource-ui": "^3.8.0",
|
|
74
|
-
"@things-factory/sales-ui": "^3.8.
|
|
74
|
+
"@things-factory/sales-ui": "^3.8.12",
|
|
75
75
|
"@things-factory/scene-chartjs": "^3.7.5",
|
|
76
76
|
"@things-factory/scene-clock": "^3.7.5",
|
|
77
77
|
"@things-factory/scene-clone": "^3.7.5",
|
|
@@ -102,11 +102,11 @@
|
|
|
102
102
|
"@things-factory/system-ui": "^3.8.0",
|
|
103
103
|
"@things-factory/transport-base": "^3.8.0",
|
|
104
104
|
"@things-factory/tutorial-ui": "^3.8.0",
|
|
105
|
-
"@things-factory/warehouse-base": "^3.8.
|
|
106
|
-
"@things-factory/worksheet-base": "^3.8.
|
|
105
|
+
"@things-factory/warehouse-base": "^3.8.12",
|
|
106
|
+
"@things-factory/worksheet-base": "^3.8.12"
|
|
107
107
|
},
|
|
108
108
|
"devDependencies": {
|
|
109
109
|
"@things-factory/builder": "^3.7.5"
|
|
110
110
|
},
|
|
111
|
-
"gitHead": "
|
|
111
|
+
"gitHead": "19c5659022fadb625ef251b09aea65ab70588ef9"
|
|
112
112
|
}
|