@things-factory/operato-wms 3.7.6 → 3.7.10
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/components/select-product-popup.js +5 -1
- package/client/pages/constants/order.js +10 -0
- package/client/pages/inventory-check/inspecting-product.js +9 -8
- package/client/pages/manifest/create-loading-manifest.js +314 -0
- package/client/pages/manifest/dispatcher-verification-popup.js +86 -0
- package/client/pages/manifest/loading-manifest-detail.js +345 -0
- package/client/pages/manifest/loading-manifest-list.js +305 -0
- package/client/pages/order/goods-received-note/received-note-list.js +138 -6
- package/client/pages/order/release-order/b2b/b2b-order-list.js +1 -1
- package/client/pages/order/release-order/b2b/b2b-order-requests.js +1 -1
- package/client/pages/order/release-order/b2c/b2c-order-requests.js +111 -14
- package/client/pages/order/reverse-kitting-order/reverse-kitting-order-detail.js +115 -50
- package/client/pages/order/reverse-kitting-order/reverse-kitting-order-list.js +1 -6
- package/client/pages/order/reverse-kitting-order/reverse-kitting-pallet-label-popup.js +239 -0
- package/client/pages/order/transport-order/delivery-order-list.js +47 -3
- package/client/pages/outbound/picking-product.js +200 -66
- package/client/pages/outbound/serial-number-popup.js +280 -0
- package/client/pages/vas/reverse-kitting/execute-reverse-kitting.js +32 -12
- package/client/pages/vas/reverse-kitting/popup-combination-sets.js +106 -10
- package/client/pages/vas/reverse-kitting/popup-reverse-kitting-template.js +130 -19
- package/client/route.js +12 -0
- package/package.json +10 -10
- package/things-factory.config.js +12 -0
- package/translations/en.json +42 -6
- package/translations/ko.json +35 -1
- package/translations/ms.json +36 -1
- package/translations/zh.json +35 -1
|
@@ -71,6 +71,7 @@ class ReceivedNoteList extends localize(i18next)(PageView) {
|
|
|
71
71
|
|
|
72
72
|
async pageInitialized() {
|
|
73
73
|
const _grnStatus = await getCodeByName('GRN_STATUS')
|
|
74
|
+
const _ganStatus = await getCodeByName('GAN_REQUESTS_STATUS')
|
|
74
75
|
const _partners = await this._fetchPartners()
|
|
75
76
|
|
|
76
77
|
this._searchFields = [
|
|
@@ -98,20 +99,32 @@ class ReceivedNoteList extends localize(i18next)(PageView) {
|
|
|
98
99
|
props: { searchOper: 'eq' }
|
|
99
100
|
},
|
|
100
101
|
{
|
|
101
|
-
name: '
|
|
102
|
+
name: 'arrivalNoticeNo',
|
|
103
|
+
label: i18next.t('field.gan'),
|
|
104
|
+
type: 'text',
|
|
105
|
+
props: { searchOper: 'i_like' }
|
|
106
|
+
},
|
|
107
|
+
{
|
|
102
108
|
label: i18next.t('field.ref_no'),
|
|
109
|
+
name: 'refNo',
|
|
103
110
|
type: 'text',
|
|
104
111
|
props: { searchOper: 'i_like' }
|
|
105
112
|
},
|
|
106
113
|
{
|
|
107
|
-
|
|
108
|
-
|
|
114
|
+
label: i18next.t('field.ref_no_2'),
|
|
115
|
+
name: 'refNo2',
|
|
116
|
+
type: 'text',
|
|
117
|
+
props: { searchOper: 'i_like' }
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
label: i18next.t('field.ref_no_3'),
|
|
121
|
+
name: 'refNo3',
|
|
109
122
|
type: 'text',
|
|
110
123
|
props: { searchOper: 'i_like' }
|
|
111
124
|
},
|
|
112
125
|
{
|
|
113
|
-
label: i18next.t('field.
|
|
114
|
-
name: '
|
|
126
|
+
label: i18next.t('field.grn_status'),
|
|
127
|
+
name: 'grnStatus',
|
|
115
128
|
type: 'select',
|
|
116
129
|
options: [
|
|
117
130
|
{ value: '' },
|
|
@@ -120,6 +133,46 @@ class ReceivedNoteList extends localize(i18next)(PageView) {
|
|
|
120
133
|
})
|
|
121
134
|
],
|
|
122
135
|
props: { searchOper: 'eq' }
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
label: i18next.t('field.from'),
|
|
139
|
+
name: 'fromDate',
|
|
140
|
+
type: 'date',
|
|
141
|
+
props: {
|
|
142
|
+
searchOper: 'eq'
|
|
143
|
+
},
|
|
144
|
+
value: (() => {
|
|
145
|
+
let date = new Date()
|
|
146
|
+
date.setMonth(date.getMonth() - 6)
|
|
147
|
+
return date.toISOString().split('T')[0]
|
|
148
|
+
})(),
|
|
149
|
+
handlers: { change: this._modifyDateRange.bind(this) }
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
label: i18next.t('field.to'),
|
|
153
|
+
name: 'toDate',
|
|
154
|
+
type: 'date',
|
|
155
|
+
props: {
|
|
156
|
+
searchOper: 'eq',
|
|
157
|
+
min: (() => {
|
|
158
|
+
let date = new Date()
|
|
159
|
+
date.setMonth(date.getMonth() - 6)
|
|
160
|
+
return date.toISOString().split('T')[0]
|
|
161
|
+
})()
|
|
162
|
+
},
|
|
163
|
+
value: new Date().toISOString().split('T')[0]
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
label: i18next.t('field.gan_status'),
|
|
167
|
+
name: 'ganStatus',
|
|
168
|
+
type: 'select',
|
|
169
|
+
options: [
|
|
170
|
+
{ value: '' },
|
|
171
|
+
..._ganStatus.map(status => {
|
|
172
|
+
return { name: i18next.t(`label.${status.description}`), value: status.name }
|
|
173
|
+
})
|
|
174
|
+
],
|
|
175
|
+
props: { searchOper: 'eq' }
|
|
123
176
|
}
|
|
124
177
|
]
|
|
125
178
|
|
|
@@ -144,6 +197,7 @@ class ReceivedNoteList extends localize(i18next)(PageView) {
|
|
|
144
197
|
type: 'string',
|
|
145
198
|
name: 'name',
|
|
146
199
|
header: i18next.t('field.grn'),
|
|
200
|
+
imex: { header: i18next.t('field.grn'), key: 'name', width: 25, type: 'string' },
|
|
147
201
|
sortable: true,
|
|
148
202
|
width: 180,
|
|
149
203
|
handlers: {
|
|
@@ -158,6 +212,7 @@ class ReceivedNoteList extends localize(i18next)(PageView) {
|
|
|
158
212
|
type: 'object',
|
|
159
213
|
name: 'bizplace',
|
|
160
214
|
header: i18next.t('field.company'),
|
|
215
|
+
imex: { header: i18next.t('field.company'), key: 'bizplace.name', width: 25, type: 'string' },
|
|
161
216
|
sortable: true,
|
|
162
217
|
width: 230
|
|
163
218
|
},
|
|
@@ -165,13 +220,31 @@ class ReceivedNoteList extends localize(i18next)(PageView) {
|
|
|
165
220
|
type: 'string',
|
|
166
221
|
name: 'refNo',
|
|
167
222
|
header: i18next.t('field.ref_no'),
|
|
223
|
+
imex: { header: i18next.t('field.ref_no'), key: 'refNo', width: 25, type: 'string' },
|
|
168
224
|
sortable: true,
|
|
169
225
|
width: 160
|
|
170
226
|
},
|
|
227
|
+
{
|
|
228
|
+
type: 'string',
|
|
229
|
+
name: 'refNo2',
|
|
230
|
+
header: i18next.t('field.ref_no_2'),
|
|
231
|
+
imex: { header: i18next.t('field.ref_no_2'), key: 'refNo2', width: 25, type: 'string' },
|
|
232
|
+
sortable: true,
|
|
233
|
+
width: 150
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
type: 'string',
|
|
237
|
+
name: 'refNo3',
|
|
238
|
+
header: i18next.t('field.ref_no_3'),
|
|
239
|
+
imex: { header: i18next.t('field.ref_no_3'), key: 'refNo3', width: 25, type: 'string' },
|
|
240
|
+
sortable: true,
|
|
241
|
+
width: 150
|
|
242
|
+
},
|
|
171
243
|
{
|
|
172
244
|
type: 'object',
|
|
173
245
|
name: 'arrivalNotice',
|
|
174
246
|
header: i18next.t('field.gan'),
|
|
247
|
+
imex: { header: i18next.t('field.arrivalNotice'), key: 'arrivalNotice.name', width: 25, type: 'string' },
|
|
175
248
|
sortable: true,
|
|
176
249
|
width: 180
|
|
177
250
|
},
|
|
@@ -179,6 +252,7 @@ class ReceivedNoteList extends localize(i18next)(PageView) {
|
|
|
179
252
|
type: 'string',
|
|
180
253
|
name: 'ganStatus',
|
|
181
254
|
header: i18next.t('field.gan_status'),
|
|
255
|
+
imex: { header: i18next.t('field.gan_status'), key: 'ganStatus', width: 25, type: 'string' },
|
|
182
256
|
sortable: true,
|
|
183
257
|
width: 180
|
|
184
258
|
},
|
|
@@ -186,6 +260,7 @@ class ReceivedNoteList extends localize(i18next)(PageView) {
|
|
|
186
260
|
type: 'string',
|
|
187
261
|
name: 'status',
|
|
188
262
|
header: i18next.t('field.grn_status'),
|
|
263
|
+
imex: { header: i18next.t('field.grn_status'), key: 'status', width: 25, type: 'string' },
|
|
189
264
|
sortable: true,
|
|
190
265
|
width: 180
|
|
191
266
|
},
|
|
@@ -193,6 +268,7 @@ class ReceivedNoteList extends localize(i18next)(PageView) {
|
|
|
193
268
|
type: 'datetime',
|
|
194
269
|
name: 'updatedAt',
|
|
195
270
|
header: i18next.t('field.updated_at'),
|
|
271
|
+
imex: { header: i18next.t('field.updated_at'), key: 'updatedAt', width: 25, type: 'datetime' },
|
|
196
272
|
sortable: true,
|
|
197
273
|
width: 160
|
|
198
274
|
},
|
|
@@ -200,6 +276,7 @@ class ReceivedNoteList extends localize(i18next)(PageView) {
|
|
|
200
276
|
type: 'object',
|
|
201
277
|
name: 'updater',
|
|
202
278
|
header: i18next.t('field.updater'),
|
|
279
|
+
imex: { header: i18next.t('field.updater'), key: 'updater.name', width: 25, type: 'string' },
|
|
203
280
|
sortable: true,
|
|
204
281
|
width: 160
|
|
205
282
|
}
|
|
@@ -215,6 +292,28 @@ class ReceivedNoteList extends localize(i18next)(PageView) {
|
|
|
215
292
|
return this.shadowRoot.querySelector('data-grist')
|
|
216
293
|
}
|
|
217
294
|
|
|
295
|
+
get _fromDateInput() {
|
|
296
|
+
return this.searchForm.shadowRoot.querySelector('input[name=fromDate]')
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
get _toDateInput() {
|
|
300
|
+
return this.searchForm.shadowRoot.querySelector('input[name=toDate]')
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
_modifyDateRange(e) {
|
|
304
|
+
const fromDate = e.currentTarget.value
|
|
305
|
+
|
|
306
|
+
if (this._toDateInput.value < fromDate) this._toDateInput.value = fromDate
|
|
307
|
+
|
|
308
|
+
let min = new Date(fromDate)
|
|
309
|
+
let today = new Date()
|
|
310
|
+
today.setHours(0, 0, 0, 0)
|
|
311
|
+
|
|
312
|
+
min = min.toISOString().split('T')[0]
|
|
313
|
+
|
|
314
|
+
this._toDateInput.min = min
|
|
315
|
+
}
|
|
316
|
+
|
|
218
317
|
async fetchHandler({ page, limit, sorters = [{ name: 'createdAt', desc: true }] }) {
|
|
219
318
|
const response = await client.query({
|
|
220
319
|
query: gql`
|
|
@@ -233,6 +332,8 @@ class ReceivedNoteList extends localize(i18next)(PageView) {
|
|
|
233
332
|
description
|
|
234
333
|
status
|
|
235
334
|
refNo
|
|
335
|
+
refNo2
|
|
336
|
+
refNo3
|
|
236
337
|
}
|
|
237
338
|
status
|
|
238
339
|
description
|
|
@@ -269,6 +370,8 @@ class ReceivedNoteList extends localize(i18next)(PageView) {
|
|
|
269
370
|
return {
|
|
270
371
|
...grn,
|
|
271
372
|
refNo: grn.arrivalNotice.refNo || '',
|
|
373
|
+
refNo2: grn.arrivalNotice.refNo2 || '',
|
|
374
|
+
refNo3: grn.arrivalNotice.refNo3 || '',
|
|
272
375
|
ganStatus: grn.arrivalNotice.status
|
|
273
376
|
}
|
|
274
377
|
}) || []
|
|
@@ -321,7 +424,36 @@ class ReceivedNoteList extends localize(i18next)(PageView) {
|
|
|
321
424
|
}
|
|
322
425
|
|
|
323
426
|
_exportableData() {
|
|
324
|
-
|
|
427
|
+
let records = []
|
|
428
|
+
if (this.dataGrist.selected && this.dataGrist.selected.length > 0) {
|
|
429
|
+
records = this.dataGrist.selected
|
|
430
|
+
} else {
|
|
431
|
+
records = this.dataGrist.data.records
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
var headerSetting = this.dataGrist._config.columns
|
|
435
|
+
.filter(column => column.type !== 'gutter' && column.record !== undefined && column.imex !== undefined)
|
|
436
|
+
.map(column => {
|
|
437
|
+
return column.imex
|
|
438
|
+
})
|
|
439
|
+
|
|
440
|
+
var data = records.map(item => {
|
|
441
|
+
return {
|
|
442
|
+
id: item.id,
|
|
443
|
+
...this._columns
|
|
444
|
+
.filter(column => column.type !== 'gutter' && column.record !== undefined && column.imex !== undefined)
|
|
445
|
+
.reduce((record, column) => {
|
|
446
|
+
record[column.imex.key] = column.imex.key
|
|
447
|
+
.split('.')
|
|
448
|
+
.reduce((obj, key) => (obj && obj[key] !== 'undefined' ? obj[key] : undefined), item)
|
|
449
|
+
if (column.type === 'datetime') {
|
|
450
|
+
record[column.imex.key] = new Date(parseInt(record[column.imex.key])).toLocaleString()
|
|
451
|
+
}
|
|
452
|
+
return record
|
|
453
|
+
}, {})
|
|
454
|
+
}
|
|
455
|
+
})
|
|
456
|
+
return { header: headerSetting, data: data }
|
|
325
457
|
}
|
|
326
458
|
}
|
|
327
459
|
|
|
@@ -354,7 +354,7 @@ class B2bOrderList extends localize(i18next)(PageView) {
|
|
|
354
354
|
return this.config.columns
|
|
355
355
|
}
|
|
356
356
|
|
|
357
|
-
async fetchHandler({ page, limit, sorters = [
|
|
357
|
+
async fetchHandler({ page, limit, sorters = [] }) {
|
|
358
358
|
const response = await client.query({
|
|
359
359
|
query: gql`
|
|
360
360
|
query releaseGoodRequests($filters: [Filter], $pagination: Pagination, $sortings: [Sorting]) {
|
|
@@ -349,7 +349,7 @@ class B2bOrderRequests extends localize(i18next)(PageView) {
|
|
|
349
349
|
return this.shadowRoot.querySelector('data-grist')
|
|
350
350
|
}
|
|
351
351
|
|
|
352
|
-
async fetchHandler({ page, limit, sorters = [
|
|
352
|
+
async fetchHandler({ page, limit, sorters = [] }) {
|
|
353
353
|
const response = await client.query({
|
|
354
354
|
query: gql`
|
|
355
355
|
query releaseGoodRequests($filters: [Filter], $pagination: Pagination, $sortings: [Sorting]) {
|
|
@@ -113,18 +113,6 @@ class B2cOrderRequests extends localize(i18next)(PageView) {
|
|
|
113
113
|
],
|
|
114
114
|
props: { searchOper: 'eq' }
|
|
115
115
|
},
|
|
116
|
-
{
|
|
117
|
-
label: i18next.t('field.release_date'),
|
|
118
|
-
name: 'releaseDate',
|
|
119
|
-
type: 'date',
|
|
120
|
-
props: { searchOper: 'i_like' }
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
label: i18next.t('field.ref_no'),
|
|
124
|
-
name: 'refNo',
|
|
125
|
-
type: 'text',
|
|
126
|
-
props: { searchOper: 'i_like' }
|
|
127
|
-
},
|
|
128
116
|
{
|
|
129
117
|
label: i18next.t('field.status'),
|
|
130
118
|
name: 'status',
|
|
@@ -136,6 +124,52 @@ class B2cOrderRequests extends localize(i18next)(PageView) {
|
|
|
136
124
|
})
|
|
137
125
|
],
|
|
138
126
|
props: { searchOper: 'eq' }
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
label: i18next.t('field.ref_no'),
|
|
130
|
+
name: 'refNo',
|
|
131
|
+
type: 'text',
|
|
132
|
+
props: { searchOper: 'i_like' }
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
label: i18next.t('field.ref_no_2'),
|
|
136
|
+
name: 'refNo2',
|
|
137
|
+
type: 'text',
|
|
138
|
+
props: { searchOper: 'i_like' }
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
label: i18next.t('field.ref_no_3'),
|
|
142
|
+
name: 'refNo3',
|
|
143
|
+
type: 'text',
|
|
144
|
+
props: { searchOper: 'i_like' }
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
label: i18next.t('field.from'),
|
|
148
|
+
name: 'fromDate',
|
|
149
|
+
type: 'date',
|
|
150
|
+
props: {
|
|
151
|
+
searchOper: 'eq'
|
|
152
|
+
},
|
|
153
|
+
value: (() => {
|
|
154
|
+
let date = new Date()
|
|
155
|
+
date.setMonth(date.getMonth() - 6)
|
|
156
|
+
return date.toISOString().split('T')[0]
|
|
157
|
+
})(),
|
|
158
|
+
handlers: { change: this._modifyDateRange.bind(this) }
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
label: i18next.t('field.to'),
|
|
162
|
+
name: 'toDate',
|
|
163
|
+
type: 'date',
|
|
164
|
+
props: {
|
|
165
|
+
searchOper: 'eq',
|
|
166
|
+
min: (() => {
|
|
167
|
+
let date = new Date()
|
|
168
|
+
date.setMonth(date.getMonth() - 6)
|
|
169
|
+
return date.toISOString().split('T')[0]
|
|
170
|
+
})()
|
|
171
|
+
},
|
|
172
|
+
value: new Date().toISOString().split('T')[0]
|
|
139
173
|
}
|
|
140
174
|
]
|
|
141
175
|
|
|
@@ -168,6 +202,7 @@ class B2cOrderRequests extends localize(i18next)(PageView) {
|
|
|
168
202
|
type: 'string',
|
|
169
203
|
name: 'name',
|
|
170
204
|
header: i18next.t('field.ro'),
|
|
205
|
+
imex: { header: i18next.t('field.ro'), key: 'name', width: 25, type: 'string' },
|
|
171
206
|
sortable: true,
|
|
172
207
|
width: 150
|
|
173
208
|
},
|
|
@@ -175,6 +210,7 @@ class B2cOrderRequests extends localize(i18next)(PageView) {
|
|
|
175
210
|
type: 'object',
|
|
176
211
|
name: 'bizplace',
|
|
177
212
|
header: i18next.t('field.company'),
|
|
213
|
+
imex: { header: i18next.t('field.company'), key: 'bizplace.name', width: 25, type: 'string' },
|
|
178
214
|
sortable: true,
|
|
179
215
|
width: 200
|
|
180
216
|
},
|
|
@@ -182,6 +218,7 @@ class B2cOrderRequests extends localize(i18next)(PageView) {
|
|
|
182
218
|
type: 'string',
|
|
183
219
|
name: 'refNo',
|
|
184
220
|
header: i18next.t('field.ref_no'),
|
|
221
|
+
imex: { header: i18next.t('field.ref_no'), key: 'refNo', width: 25, type: 'string' },
|
|
185
222
|
sortable: true,
|
|
186
223
|
width: 160
|
|
187
224
|
},
|
|
@@ -189,6 +226,15 @@ class B2cOrderRequests extends localize(i18next)(PageView) {
|
|
|
189
226
|
type: 'string',
|
|
190
227
|
name: 'refNo2',
|
|
191
228
|
header: i18next.t('field.ref_no_2'),
|
|
229
|
+
imex: { header: i18next.t('field.ref_no_2'), key: 'refNo2', width: 25, type: 'string' },
|
|
230
|
+
sortable: true,
|
|
231
|
+
width: 160
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
type: 'string',
|
|
235
|
+
name: 'refNo3',
|
|
236
|
+
header: i18next.t('field.ref_no_3'),
|
|
237
|
+
imex: { header: i18next.t('field.ref_no_3'), key: 'refNo3', width: 25, type: 'string' },
|
|
192
238
|
sortable: true,
|
|
193
239
|
width: 160
|
|
194
240
|
},
|
|
@@ -210,6 +256,7 @@ class B2cOrderRequests extends localize(i18next)(PageView) {
|
|
|
210
256
|
type: 'date',
|
|
211
257
|
name: 'releaseDate',
|
|
212
258
|
header: i18next.t('field.release_date'),
|
|
259
|
+
imex: { header: i18next.t('field.release_date'), key: 'releaseDate', width: 25, type: 'string' },
|
|
213
260
|
sortable: true,
|
|
214
261
|
width: 120
|
|
215
262
|
},
|
|
@@ -223,7 +270,8 @@ class B2cOrderRequests extends localize(i18next)(PageView) {
|
|
|
223
270
|
{
|
|
224
271
|
type: 'string',
|
|
225
272
|
name: 'status',
|
|
226
|
-
header: i18next.t('field.
|
|
273
|
+
header: i18next.t('field.status'),
|
|
274
|
+
imex: { header: i18next.t('field.grn_status'), key: 'status', width: 25, type: 'string' },
|
|
227
275
|
sortable: true,
|
|
228
276
|
width: 120
|
|
229
277
|
},
|
|
@@ -231,6 +279,7 @@ class B2cOrderRequests extends localize(i18next)(PageView) {
|
|
|
231
279
|
type: 'datetime',
|
|
232
280
|
name: 'updatedAt',
|
|
233
281
|
header: i18next.t('field.updated_at'),
|
|
282
|
+
imex: { header: i18next.t('field.updated_at'), key: 'updatedAt', width: 25, type: 'datetime' },
|
|
234
283
|
sortable: true,
|
|
235
284
|
width: 160
|
|
236
285
|
},
|
|
@@ -238,6 +287,7 @@ class B2cOrderRequests extends localize(i18next)(PageView) {
|
|
|
238
287
|
type: 'object',
|
|
239
288
|
name: 'acceptedBy',
|
|
240
289
|
header: i18next.t('field.accepted_by'),
|
|
290
|
+
imex: { header: i18next.t('field.accepted_by'), key: 'acceptedBy.name', width: 25, type: 'string' },
|
|
241
291
|
sortable: true,
|
|
242
292
|
width: 200
|
|
243
293
|
}
|
|
@@ -253,7 +303,7 @@ class B2cOrderRequests extends localize(i18next)(PageView) {
|
|
|
253
303
|
return this.shadowRoot.querySelector('data-grist')
|
|
254
304
|
}
|
|
255
305
|
|
|
256
|
-
async fetchHandler({ page, limit, sorters = [
|
|
306
|
+
async fetchHandler({ page, limit, sorters = [] }) {
|
|
257
307
|
const response = await client.query({
|
|
258
308
|
query: gql`
|
|
259
309
|
query releaseGoodRequests($filters: [Filter], $pagination: Pagination, $sortings: [Sorting]) {
|
|
@@ -451,6 +501,53 @@ class B2cOrderRequests extends localize(i18next)(PageView) {
|
|
|
451
501
|
this._showToast(e)
|
|
452
502
|
}
|
|
453
503
|
}
|
|
504
|
+
|
|
505
|
+
_modifyDateRange(e) {
|
|
506
|
+
const fromDate = e.currentTarget.value
|
|
507
|
+
|
|
508
|
+
if (this._toDateInput.value < fromDate) this._toDateInput.value = fromDate
|
|
509
|
+
|
|
510
|
+
let min = new Date(fromDate)
|
|
511
|
+
let today = new Date()
|
|
512
|
+
today.setHours(0, 0, 0, 0)
|
|
513
|
+
|
|
514
|
+
min = min.toISOString().split('T')[0]
|
|
515
|
+
|
|
516
|
+
this._toDateInput.min = min
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
_exportableData() {
|
|
520
|
+
let records = []
|
|
521
|
+
if (this.dataGrist.selected && this.dataGrist.selected.length > 0) {
|
|
522
|
+
records = this.dataGrist.selected
|
|
523
|
+
} else {
|
|
524
|
+
records = this.dataGrist.data.records
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
var headerSetting = this.dataGrist._config.columns
|
|
528
|
+
.filter(column => column.type !== 'gutter' && column.record !== undefined && column.imex !== undefined)
|
|
529
|
+
.map(column => {
|
|
530
|
+
return column.imex
|
|
531
|
+
})
|
|
532
|
+
|
|
533
|
+
var data = records.map(item => {
|
|
534
|
+
return {
|
|
535
|
+
id: item.id,
|
|
536
|
+
...this._columns
|
|
537
|
+
.filter(column => column.type !== 'gutter' && column.record !== undefined && column.imex !== undefined)
|
|
538
|
+
.reduce((record, column) => {
|
|
539
|
+
record[column.imex.key] = column.imex.key
|
|
540
|
+
.split('.')
|
|
541
|
+
.reduce((obj, key) => (obj && obj[key] !== 'undefined' ? obj[key] : undefined), item)
|
|
542
|
+
if (column.type === 'datetime') {
|
|
543
|
+
record[column.imex.key] = new Date(parseInt(record[column.imex.key])).toLocaleString()
|
|
544
|
+
}
|
|
545
|
+
return record
|
|
546
|
+
}, {})
|
|
547
|
+
}
|
|
548
|
+
})
|
|
549
|
+
return { header: headerSetting, data: data }
|
|
550
|
+
}
|
|
454
551
|
}
|
|
455
552
|
|
|
456
553
|
window.customElements.define('b2c-order-requests', B2cOrderRequests)
|