@things-factory/operato-wms 4.3.356 → 4.3.358
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-cc-product-popup.js +321 -0
- package/client/pages/constants/order.js +15 -0
- package/client/pages/inventory-check/add-extra-inventory-popup.js +306 -0
- package/client/pages/inventory-check/check-inventory-popup.js +183 -167
- package/client/pages/inventory-check/create-cycle-count.js +292 -141
- package/client/pages/inventory-check/cycle-count-inventory-details-popup.js +282 -0
- package/client/pages/inventory-check/cycle-count-recheck-popup.js +129 -31
- package/client/pages/inventory-check/cycle-count-report.js +425 -306
- package/client/pages/inventory-check/cycle-count-review.js +742 -0
- package/client/pages/inventory-check/cycle-count-worksheet-list.js +476 -0
- package/client/pages/inventory-check/inspecting-product.js +954 -1029
- package/client/pages/inventory-check/inventory-check-detail.js +378 -0
- package/client/pages/inventory-check/inventory-check-list.js +35 -109
- package/client/pages/inventory-check/relocate-inventory-popup.js +222 -0
- package/client/pages/inventory-check/search-popup.js +1 -1
- package/client/pages/inventory-check/select-cc-location-popup.js +230 -0
- package/client/pages/inventory-check/worksheet-cycle-count.js +112 -90
- package/client/pages/outbound/route-label-popup.js +16 -0
- package/client/route.js +8 -0
- package/dist-server/graphql/resolvers/reports/cycle-count-report.js +244 -0
- package/dist-server/graphql/resolvers/reports/cycle-count-report.js.map +1 -0
- package/dist-server/graphql/resolvers/reports/index.js +2 -1
- package/dist-server/graphql/resolvers/reports/index.js.map +1 -1
- package/dist-server/graphql/types/reports/cycle-count-report-list.js +14 -0
- package/dist-server/graphql/types/reports/cycle-count-report-list.js.map +1 -0
- package/dist-server/graphql/types/reports/cycle-count-report.js +25 -0
- package/dist-server/graphql/types/reports/cycle-count-report.js.map +1 -0
- package/dist-server/graphql/types/reports/index.js +5 -0
- package/dist-server/graphql/types/reports/index.js.map +1 -1
- package/package.json +6 -6
- package/server/graphql/resolvers/reports/cycle-count-report.ts +267 -0
- package/server/graphql/resolvers/reports/index.ts +3 -4
- package/server/graphql/types/reports/cycle-count-report-list.ts +8 -0
- package/server/graphql/types/reports/cycle-count-report.ts +19 -0
- package/server/graphql/types/reports/index.ts +7 -8
- package/things-factory.config.js +8 -0
- package/translations/en.json +34 -0
- package/translations/ko.json +34 -0
- package/translations/ms.json +35 -1
- package/translations/zh.json +37 -3
|
@@ -0,0 +1,378 @@
|
|
|
1
|
+
import '@things-factory/barcode-ui'
|
|
2
|
+
import { MultiColumnFormStyles } from '@things-factory/form-ui'
|
|
3
|
+
import '@things-factory/grist-ui'
|
|
4
|
+
import { i18next, localize } from '@things-factory/i18n-base'
|
|
5
|
+
import { client, CustomAlert, navigate, PageView } from '@things-factory/shell'
|
|
6
|
+
import { CommonButtonStyles } from '@things-factory/styles'
|
|
7
|
+
import { isMobileDevice } from '@things-factory/utils'
|
|
8
|
+
import gql from 'graphql-tag'
|
|
9
|
+
import { css, html } from 'lit-element'
|
|
10
|
+
import { WORKSHEET_STATUS } from '../constants'
|
|
11
|
+
|
|
12
|
+
class InventoryCheckDetail extends localize(i18next)(PageView) {
|
|
13
|
+
static get properties() {
|
|
14
|
+
return {
|
|
15
|
+
_worksheetNo: String,
|
|
16
|
+
_worksheetStatus: String,
|
|
17
|
+
_cycleCountNo: String,
|
|
18
|
+
config: Object,
|
|
19
|
+
data: Object
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
static get styles() {
|
|
24
|
+
return [
|
|
25
|
+
MultiColumnFormStyles,
|
|
26
|
+
css`
|
|
27
|
+
:host {
|
|
28
|
+
display: flex;
|
|
29
|
+
flex-direction: column;
|
|
30
|
+
overflow-x: auto;
|
|
31
|
+
}
|
|
32
|
+
.form-container {
|
|
33
|
+
display: flex;
|
|
34
|
+
}
|
|
35
|
+
.form-container > form {
|
|
36
|
+
flex: 1;
|
|
37
|
+
}
|
|
38
|
+
barcode-tag {
|
|
39
|
+
width: 100px;
|
|
40
|
+
height: 100px;
|
|
41
|
+
margin: 10px;
|
|
42
|
+
}
|
|
43
|
+
.grist {
|
|
44
|
+
background-color: var(--main-section-background-color);
|
|
45
|
+
display: flex;
|
|
46
|
+
flex-direction: column;
|
|
47
|
+
flex: 1;
|
|
48
|
+
overflow-y: auto;
|
|
49
|
+
}
|
|
50
|
+
data-grist {
|
|
51
|
+
overflow-y: hidden;
|
|
52
|
+
flex: 1;
|
|
53
|
+
}
|
|
54
|
+
h2 {
|
|
55
|
+
padding: var(--subtitle-padding);
|
|
56
|
+
font: var(--subtitle-font);
|
|
57
|
+
color: var(--subtitle-text-color);
|
|
58
|
+
border-bottom: var(--subtitle-border-bottom);
|
|
59
|
+
}
|
|
60
|
+
.grist h2 {
|
|
61
|
+
margin: var(--grist-title-margin);
|
|
62
|
+
border: var(--grist-title-border);
|
|
63
|
+
font: var(--grist-title-font);
|
|
64
|
+
color: var(--secondary-color);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.grist h2 mwc-icon {
|
|
68
|
+
vertical-align: middle;
|
|
69
|
+
margin: var(--grist-title-icon-margin);
|
|
70
|
+
font-size: var(--grist-title-icon-size);
|
|
71
|
+
color: var(--grist-title-icon-color);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
h2 + data-grist {
|
|
75
|
+
padding-top: var(--grist-title-with-grid-padding);
|
|
76
|
+
}
|
|
77
|
+
`
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
get context() {
|
|
82
|
+
var actions = [
|
|
83
|
+
{
|
|
84
|
+
title: i18next.t('button.back'),
|
|
85
|
+
action: () => history.back(),
|
|
86
|
+
...CommonButtonStyles.back
|
|
87
|
+
}
|
|
88
|
+
]
|
|
89
|
+
|
|
90
|
+
if (this._worksheetStatus === WORKSHEET_STATUS.DEACTIVATED.value) {
|
|
91
|
+
actions.push({
|
|
92
|
+
title: i18next.t('button.activate'),
|
|
93
|
+
action: this._activateWorksheet.bind(this),
|
|
94
|
+
...CommonButtonStyles.activate
|
|
95
|
+
})
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return {
|
|
99
|
+
title: i18next.t('title.inventory_check_detail'),
|
|
100
|
+
actions,
|
|
101
|
+
printable: {
|
|
102
|
+
accept: ['preview'],
|
|
103
|
+
content: this
|
|
104
|
+
},
|
|
105
|
+
help: 'operato-wms/inventory-check/inventory-check-detail'
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
render() {
|
|
110
|
+
return html`
|
|
111
|
+
<div class="form-container">
|
|
112
|
+
<form class="multi-column-form">
|
|
113
|
+
<fieldset>
|
|
114
|
+
<legend>${i18next.t('title.cycle_count')}</legend>
|
|
115
|
+
<label>${i18next.t('label.company')}</label>
|
|
116
|
+
<input name="bizplace" readonly />
|
|
117
|
+
|
|
118
|
+
<label>${i18next.t('label.inventory_check_no')}</label>
|
|
119
|
+
<input name="cycleCountNo" readonly />
|
|
120
|
+
|
|
121
|
+
<label>${i18next.t('label.execute_date')}</label>
|
|
122
|
+
<input type="date" name="executionDate" readonly />
|
|
123
|
+
|
|
124
|
+
<label>${i18next.t('label.status')}</label>
|
|
125
|
+
<select name="status" disabled>
|
|
126
|
+
${Object.keys(WORKSHEET_STATUS).map(
|
|
127
|
+
key => html` <option value="${WORKSHEET_STATUS[key].value}">${WORKSHEET_STATUS[key].name}</option> `
|
|
128
|
+
)}
|
|
129
|
+
</select>
|
|
130
|
+
</fieldset>
|
|
131
|
+
</form>
|
|
132
|
+
|
|
133
|
+
<barcode-tag bcid="qrcode" .value=${this._cycleCountNo}></barcode-tag>
|
|
134
|
+
</div>
|
|
135
|
+
|
|
136
|
+
<div class="grist">
|
|
137
|
+
<h2><mwc-icon>list_alt</mwc-icon>${i18next.t('title.inventory')}</h2>
|
|
138
|
+
|
|
139
|
+
<data-grist
|
|
140
|
+
id="grist"
|
|
141
|
+
.mode=${isMobileDevice() ? 'LIST' : 'GRID'}
|
|
142
|
+
.config=${this.config}
|
|
143
|
+
.fetchHandler="${this.fetchInventoryCheckItems.bind(this)}"
|
|
144
|
+
></data-grist>
|
|
145
|
+
</div>
|
|
146
|
+
`
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
pageUpdated(changes) {
|
|
150
|
+
if (this.active && (changes.resourceId || this._worksheetNo)) {
|
|
151
|
+
if (changes.resourceId) {
|
|
152
|
+
this._worksheetNo = changes.resourceId
|
|
153
|
+
}
|
|
154
|
+
this.grist.fetch()
|
|
155
|
+
this._updateGristConfig()
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
updated(changedProps) {
|
|
160
|
+
if (changedProps.has('_worksheetStatus')) {
|
|
161
|
+
this.updateContext()
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
pageInitialized() {
|
|
166
|
+
this.preConfig = {
|
|
167
|
+
rows: { appendable: false },
|
|
168
|
+
list: {
|
|
169
|
+
fields: ['batchId', 'cartonId', 'palletId', 'product', 'location', 'status']
|
|
170
|
+
},
|
|
171
|
+
// pagination: { infinite: true },
|
|
172
|
+
columns: [
|
|
173
|
+
{ type: 'gutter', gutterName: 'sequence' },
|
|
174
|
+
{
|
|
175
|
+
type: 'string',
|
|
176
|
+
name: 'batchId',
|
|
177
|
+
header: i18next.t('field.batch_id'),
|
|
178
|
+
imex: { header: i18next.t('field.batch_id'), key: 'batchId', width: 100, type: 'string' },
|
|
179
|
+
width: 100
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
type: 'string',
|
|
183
|
+
name: 'cartonId',
|
|
184
|
+
header: i18next.t('field.carton_id'),
|
|
185
|
+
imex: { header: i18next.t('field.carton_id'), key: 'cartonId', width: 150, type: 'string' },
|
|
186
|
+
width: 150
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
type: 'string',
|
|
190
|
+
name: 'palletId',
|
|
191
|
+
header: i18next.t('field.lot_id'),
|
|
192
|
+
imex: { header: i18next.t('field.lot_id'), key: 'palletId', width: 150, type: 'string' },
|
|
193
|
+
width: 150
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
type: 'object',
|
|
197
|
+
name: 'product',
|
|
198
|
+
header: i18next.t('field.product'),
|
|
199
|
+
imex: {
|
|
200
|
+
header: i18next.t('field.product'),
|
|
201
|
+
key: 'product.name',
|
|
202
|
+
width: 50,
|
|
203
|
+
type: 'string'
|
|
204
|
+
},
|
|
205
|
+
width: 350
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
type: 'string',
|
|
209
|
+
name: 'brand',
|
|
210
|
+
header: i18next.t('field.brand'),
|
|
211
|
+
imex: {
|
|
212
|
+
header: i18next.t('field.brand'),
|
|
213
|
+
key: 'brand',
|
|
214
|
+
width: 15,
|
|
215
|
+
type: 'string'
|
|
216
|
+
},
|
|
217
|
+
width: 100
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
type: 'object',
|
|
221
|
+
name: 'location',
|
|
222
|
+
header: i18next.t('field.location'),
|
|
223
|
+
imex: {
|
|
224
|
+
header: i18next.t('field.location'),
|
|
225
|
+
key: 'location.name',
|
|
226
|
+
width: 15,
|
|
227
|
+
type: 'string'
|
|
228
|
+
},
|
|
229
|
+
width: 100
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
type: 'string',
|
|
233
|
+
name: 'packingType',
|
|
234
|
+
header: i18next.t('field.packing_type'),
|
|
235
|
+
imex: { header: i18next.t('field.packing_type'), key: 'packingType', width: 100, type: 'string' },
|
|
236
|
+
width: 100
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
type: 'string',
|
|
240
|
+
name: 'uom',
|
|
241
|
+
header: i18next.t('field.uom'),
|
|
242
|
+
imex: {
|
|
243
|
+
header: i18next.t('field.uom'),
|
|
244
|
+
key: 'uom',
|
|
245
|
+
width: 80,
|
|
246
|
+
type: 'string'
|
|
247
|
+
},
|
|
248
|
+
width: 80
|
|
249
|
+
}
|
|
250
|
+
]
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
get form() {
|
|
255
|
+
return this.shadowRoot.querySelector('form')
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
get grist() {
|
|
259
|
+
return this.shadowRoot.querySelector('data-grist')
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
async fetchInventoryCheckItems() {
|
|
263
|
+
if (!this._cycleCountNo) return
|
|
264
|
+
const response = await client.query({
|
|
265
|
+
query: gql`
|
|
266
|
+
query inventoryCheck($name: String!) {
|
|
267
|
+
inventoryCheck(name: $name) {
|
|
268
|
+
id
|
|
269
|
+
name
|
|
270
|
+
executionDate
|
|
271
|
+
bizplace {
|
|
272
|
+
name
|
|
273
|
+
}
|
|
274
|
+
inventoryCheckItems {
|
|
275
|
+
inventory {
|
|
276
|
+
batchId
|
|
277
|
+
cartonId
|
|
278
|
+
palletId
|
|
279
|
+
packingType
|
|
280
|
+
uom
|
|
281
|
+
}
|
|
282
|
+
product {
|
|
283
|
+
name
|
|
284
|
+
brand
|
|
285
|
+
description
|
|
286
|
+
}
|
|
287
|
+
location {
|
|
288
|
+
name
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
`,
|
|
294
|
+
variables: {
|
|
295
|
+
name: this._cycleCountNo
|
|
296
|
+
}
|
|
297
|
+
})
|
|
298
|
+
|
|
299
|
+
if (!response.errors) {
|
|
300
|
+
const { inventoryCheck } = response.data
|
|
301
|
+
const { inventoryCheckItems } = inventoryCheck
|
|
302
|
+
|
|
303
|
+
this.bizplace = inventoryCheck.bizplace.name
|
|
304
|
+
|
|
305
|
+
this._fillupForm({
|
|
306
|
+
...inventoryCheck
|
|
307
|
+
})
|
|
308
|
+
|
|
309
|
+
const records = inventoryCheckItems.map(inventoryCheckItem => {
|
|
310
|
+
return {
|
|
311
|
+
...inventoryCheckItem.inventory,
|
|
312
|
+
brand: inventoryCheckItem.inventory.product.brand
|
|
313
|
+
}
|
|
314
|
+
})
|
|
315
|
+
|
|
316
|
+
return { records, total }
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
_updateGristConfig() {
|
|
321
|
+
const statusColumnConfig = {
|
|
322
|
+
type: 'string',
|
|
323
|
+
name: 'status',
|
|
324
|
+
header: i18next.t('field.status'),
|
|
325
|
+
width: 100
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
this.preConfig.columns.map(column => {
|
|
329
|
+
if (column.name === 'description') {
|
|
330
|
+
column.record = { ...column.record, editable: this._worksheetStatus === WORKSHEET_STATUS.DEACTIVATED.value }
|
|
331
|
+
}
|
|
332
|
+
})
|
|
333
|
+
|
|
334
|
+
if (
|
|
335
|
+
!this.preConfig.columns.some(e => e.name === 'status') &&
|
|
336
|
+
this._worksheetStatus !== WORKSHEET_STATUS.DEACTIVATED.value
|
|
337
|
+
) {
|
|
338
|
+
this.preConfig.columns = [...this.preConfig.columns, statusColumnConfig]
|
|
339
|
+
} else if (
|
|
340
|
+
this.preConfig.columns.some(e => e.name === 'status') &&
|
|
341
|
+
this._worksheetStatus === WORKSHEET_STATUS.DEACTIVATED.value
|
|
342
|
+
) {
|
|
343
|
+
this.preConfig.columns.splice(this.preConfig.columns.map(e => e.name).indexOf('status'))
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
this.config = { ...this.preConfig }
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
_fillupForm(data) {
|
|
350
|
+
for (let key in data) {
|
|
351
|
+
Array.from(this.form.querySelectorAll('input, select')).forEach(field => {
|
|
352
|
+
if (field.name === key && field.type === 'checkbox') {
|
|
353
|
+
field.checked = data[key]
|
|
354
|
+
} else if (field.name === key) {
|
|
355
|
+
if (data[key] instanceof Object) {
|
|
356
|
+
const objectData = data[key]
|
|
357
|
+
field.value = `${objectData.name} ${objectData.description ? `(${objectData.description})` : ''}`
|
|
358
|
+
} else {
|
|
359
|
+
field.value = data[key]
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
})
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
_showToast({ type, message }) {
|
|
367
|
+
document.dispatchEvent(
|
|
368
|
+
new CustomEvent('notify', {
|
|
369
|
+
detail: {
|
|
370
|
+
type,
|
|
371
|
+
message
|
|
372
|
+
}
|
|
373
|
+
})
|
|
374
|
+
)
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
window.customElements.define('inventory-check-detail', InventoryCheckDetail)
|
|
@@ -7,13 +7,7 @@ import { ScrollbarStyles } from '@things-factory/styles'
|
|
|
7
7
|
import { isMobileDevice } from '@things-factory/utils'
|
|
8
8
|
import gql from 'graphql-tag'
|
|
9
9
|
import { css, html } from 'lit-element'
|
|
10
|
-
import {
|
|
11
|
-
getOrderStatusCandidates,
|
|
12
|
-
getWorksheetStatusCandidates,
|
|
13
|
-
ORDER_STATUS,
|
|
14
|
-
ORDER_TYPES,
|
|
15
|
-
WORKSHEET_TYPE
|
|
16
|
-
} from '../constants'
|
|
10
|
+
import { getOrderStatusCandidates, ORDER_TYPES } from '../constants'
|
|
17
11
|
import './search-popup'
|
|
18
12
|
class InventoryCheckList extends localize(i18next)(PageView) {
|
|
19
13
|
static get styles() {
|
|
@@ -57,9 +51,9 @@ class InventoryCheckList extends localize(i18next)(PageView) {
|
|
|
57
51
|
|
|
58
52
|
get context() {
|
|
59
53
|
return {
|
|
60
|
-
title: i18next.t('title.
|
|
54
|
+
title: i18next.t('title.cycle_count_report_list'),
|
|
61
55
|
exportable: {
|
|
62
|
-
name: i18next.t('title.
|
|
56
|
+
name: i18next.t('title.cycle_count_report_list'),
|
|
63
57
|
data: this._exportableData.bind(this)
|
|
64
58
|
},
|
|
65
59
|
help: 'operato-wms/inventory-check/inventory-check-list'
|
|
@@ -73,7 +67,6 @@ class InventoryCheckList extends localize(i18next)(PageView) {
|
|
|
73
67
|
}
|
|
74
68
|
|
|
75
69
|
async pageInitialized() {
|
|
76
|
-
const _worksheetStatus = getWorksheetStatusCandidates(WORKSHEET_TYPE.CYCLE_COUNT)
|
|
77
70
|
const _orderStatus = getOrderStatusCandidates(ORDER_TYPES.CYCLE_COUNT)
|
|
78
71
|
|
|
79
72
|
this._bizplaces = [...(await this._fetchBizplaceList())]
|
|
@@ -91,19 +84,19 @@ class InventoryCheckList extends localize(i18next)(PageView) {
|
|
|
91
84
|
props: { searchOper: 'eq', readonly: true }
|
|
92
85
|
},
|
|
93
86
|
{
|
|
94
|
-
name: '
|
|
87
|
+
name: 'name',
|
|
95
88
|
label: i18next.t('field.inventory_check_no'),
|
|
96
89
|
type: 'text',
|
|
97
90
|
props: { searchOper: 'i_like' }
|
|
98
91
|
},
|
|
99
92
|
{
|
|
100
|
-
name: '
|
|
93
|
+
name: 'executionDate',
|
|
101
94
|
label: i18next.t('field.execution_date'),
|
|
102
95
|
type: 'date',
|
|
103
96
|
props: { searchOper: 'eq' }
|
|
104
97
|
},
|
|
105
98
|
{
|
|
106
|
-
name: '
|
|
99
|
+
name: 'status',
|
|
107
100
|
label: i18next.t('field.order_status'),
|
|
108
101
|
type: 'select',
|
|
109
102
|
options: [
|
|
@@ -113,28 +106,12 @@ class InventoryCheckList extends localize(i18next)(PageView) {
|
|
|
113
106
|
})
|
|
114
107
|
],
|
|
115
108
|
props: { searchOper: 'eq' }
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
name: 'status',
|
|
119
|
-
label: i18next.t('field.task_status'),
|
|
120
|
-
type: 'select',
|
|
121
|
-
options: [{ value: '' }, ..._worksheetStatus],
|
|
122
|
-
props: { searchOper: 'eq' }
|
|
123
109
|
}
|
|
124
110
|
]
|
|
125
111
|
|
|
126
112
|
this.config = {
|
|
127
113
|
list: {
|
|
128
|
-
fields: [
|
|
129
|
-
'inventoryCheck',
|
|
130
|
-
'type',
|
|
131
|
-
'Customer',
|
|
132
|
-
'executionDate',
|
|
133
|
-
'inventoryCheckStatus',
|
|
134
|
-
'status',
|
|
135
|
-
'startedAt',
|
|
136
|
-
'endedAt'
|
|
137
|
-
]
|
|
114
|
+
fields: ['inventoryCheck', 'type', 'Customer', 'executionDate', 'status', 'createdAt', 'updatedAt']
|
|
138
115
|
},
|
|
139
116
|
rows: { appendable: false },
|
|
140
117
|
columns: [
|
|
@@ -147,28 +124,16 @@ class InventoryCheckList extends localize(i18next)(PageView) {
|
|
|
147
124
|
handlers: {
|
|
148
125
|
click: (columns, data, column, record, rowIndex) => {
|
|
149
126
|
if (!record.id) return
|
|
150
|
-
|
|
151
|
-
const status = record.inventoryCheckStatus
|
|
152
|
-
|
|
153
|
-
// Handle PICKING
|
|
154
|
-
if (
|
|
155
|
-
type === WORKSHEET_TYPE.CYCLE_COUNT.value &&
|
|
156
|
-
status !== ORDER_STATUS.PENDING_REVIEW.value &&
|
|
157
|
-
status !== ORDER_STATUS.DONE.value
|
|
158
|
-
) {
|
|
159
|
-
navigate(`worksheet_cycle_count/${record.name}`)
|
|
160
|
-
} else {
|
|
161
|
-
navigate(`cycle_count_report/${record.name}`)
|
|
162
|
-
}
|
|
127
|
+
navigate(`cycle_count_report/${record.name}`)
|
|
163
128
|
}
|
|
164
129
|
}
|
|
165
130
|
},
|
|
166
131
|
{
|
|
167
|
-
type: '
|
|
168
|
-
name: '
|
|
132
|
+
type: 'string',
|
|
133
|
+
name: 'name',
|
|
169
134
|
header: i18next.t('field.inventory_check_no'),
|
|
170
135
|
sortable: true,
|
|
171
|
-
width:
|
|
136
|
+
width: 170,
|
|
172
137
|
imex: {
|
|
173
138
|
header: i18next.t('field.inventory_check_no'),
|
|
174
139
|
key: 'inventoryCheck.name',
|
|
@@ -205,25 +170,12 @@ class InventoryCheckList extends localize(i18next)(PageView) {
|
|
|
205
170
|
},
|
|
206
171
|
{
|
|
207
172
|
type: 'string',
|
|
208
|
-
name: '
|
|
173
|
+
name: 'status',
|
|
209
174
|
header: i18next.t('field.order_status'),
|
|
210
175
|
sortable: true,
|
|
211
|
-
width:
|
|
176
|
+
width: 150,
|
|
212
177
|
imex: {
|
|
213
178
|
header: i18next.t('field.order_status'),
|
|
214
|
-
key: 'inventoryCheckStatus',
|
|
215
|
-
width: 20,
|
|
216
|
-
type: 'string'
|
|
217
|
-
}
|
|
218
|
-
},
|
|
219
|
-
{
|
|
220
|
-
type: 'string',
|
|
221
|
-
name: 'status',
|
|
222
|
-
header: i18next.t('field.task_status'),
|
|
223
|
-
sortable: true,
|
|
224
|
-
width: 120,
|
|
225
|
-
imex: {
|
|
226
|
-
header: i18next.t('field.task_status'),
|
|
227
179
|
key: 'status',
|
|
228
180
|
width: 20,
|
|
229
181
|
type: 'string'
|
|
@@ -231,26 +183,26 @@ class InventoryCheckList extends localize(i18next)(PageView) {
|
|
|
231
183
|
},
|
|
232
184
|
{
|
|
233
185
|
type: 'datetime',
|
|
234
|
-
name: '
|
|
235
|
-
header: i18next.t('field.
|
|
186
|
+
name: 'createdAt',
|
|
187
|
+
header: i18next.t('field.created_at'),
|
|
236
188
|
sortable: true,
|
|
237
189
|
width: 160,
|
|
238
190
|
imex: {
|
|
239
|
-
header: i18next.t('field.
|
|
240
|
-
key: '
|
|
191
|
+
header: i18next.t('field.created_at'),
|
|
192
|
+
key: 'createdAt',
|
|
241
193
|
width: 30,
|
|
242
194
|
type: 'datetime'
|
|
243
195
|
}
|
|
244
196
|
},
|
|
245
197
|
{
|
|
246
198
|
type: 'datetime',
|
|
247
|
-
name: '
|
|
248
|
-
header: i18next.t('field.
|
|
199
|
+
name: 'updatedAt',
|
|
200
|
+
header: i18next.t('field.updated_at'),
|
|
249
201
|
sortable: true,
|
|
250
202
|
width: 160,
|
|
251
203
|
imex: {
|
|
252
|
-
header: i18next.t('field.
|
|
253
|
-
key: '
|
|
204
|
+
header: i18next.t('field.updated_at'),
|
|
205
|
+
key: 'updatedAt',
|
|
254
206
|
width: 30,
|
|
255
207
|
type: 'datetime'
|
|
256
208
|
}
|
|
@@ -284,47 +236,29 @@ class InventoryCheckList extends localize(i18next)(PageView) {
|
|
|
284
236
|
return this.searchForm.shadowRoot.querySelector('input[name=bizplace]')
|
|
285
237
|
}
|
|
286
238
|
|
|
287
|
-
async fetchHandler({ page, limit, sorters }) {
|
|
239
|
+
async fetchHandler({ page, limit, sorters = [] }) {
|
|
288
240
|
const filters = await this.searchForm.getQueryFilters()
|
|
289
|
-
filters.push({
|
|
290
|
-
name: 'type',
|
|
291
|
-
operator: 'in',
|
|
292
|
-
value: [
|
|
293
|
-
WORKSHEET_TYPE.CYCLE_COUNT.value,
|
|
294
|
-
WORKSHEET_TYPE.CYCLE_COUNT_RECHECK.value,
|
|
295
|
-
WORKSHEET_TYPE.STOCK_TAKE.value
|
|
296
|
-
]
|
|
297
|
-
})
|
|
298
241
|
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
{ name: 'endedAt', desc: true }
|
|
302
|
-
]
|
|
242
|
+
const pagination = { page, limit }
|
|
243
|
+
const sortings = sorters
|
|
303
244
|
|
|
304
245
|
const response = await client.query({
|
|
305
246
|
query: gql`
|
|
306
|
-
query
|
|
307
|
-
|
|
247
|
+
query inventoryChecks($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
|
|
248
|
+
inventoryChecks(filters: $filters, pagination: $pagination, sortings: $sortings) {
|
|
308
249
|
items {
|
|
309
250
|
id
|
|
310
251
|
name
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
status
|
|
317
|
-
}
|
|
252
|
+
description
|
|
253
|
+
executionDate
|
|
254
|
+
status
|
|
255
|
+
createdAt
|
|
256
|
+
updatedAt
|
|
318
257
|
bizplace {
|
|
319
258
|
id
|
|
320
259
|
name
|
|
321
260
|
description
|
|
322
261
|
}
|
|
323
|
-
type
|
|
324
|
-
status
|
|
325
|
-
startedAt
|
|
326
|
-
createdAt
|
|
327
|
-
endedAt
|
|
328
262
|
updater {
|
|
329
263
|
name
|
|
330
264
|
description
|
|
@@ -336,23 +270,15 @@ class InventoryCheckList extends localize(i18next)(PageView) {
|
|
|
336
270
|
`,
|
|
337
271
|
variables: {
|
|
338
272
|
filters,
|
|
339
|
-
pagination
|
|
340
|
-
sortings
|
|
273
|
+
pagination,
|
|
274
|
+
sortings
|
|
341
275
|
}
|
|
342
276
|
})
|
|
343
277
|
|
|
344
278
|
if (!response.errors) {
|
|
345
279
|
return {
|
|
346
|
-
total: response.data
|
|
347
|
-
records:
|
|
348
|
-
response.data.worksheets.items.map(item => {
|
|
349
|
-
return {
|
|
350
|
-
...item,
|
|
351
|
-
executionDate: item.inventoryCheck && item.inventoryCheck.executionDate,
|
|
352
|
-
status: item.status,
|
|
353
|
-
inventoryCheckStatus: item.inventoryCheck && item.inventoryCheck.status
|
|
354
|
-
}
|
|
355
|
-
}) || {}
|
|
280
|
+
total: response.data?.inventoryChecks?.total || 0,
|
|
281
|
+
records: response.data?.inventoryChecks?.items || []
|
|
356
282
|
}
|
|
357
283
|
}
|
|
358
284
|
}
|