@things-factory/operato-wms 4.0.25 → 4.0.26

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.
Files changed (66) hide show
  1. package/client/bootstrap.js +1 -1
  2. package/client/pages/billing/claim-chit/claim-chit-detail.js +32 -35
  3. package/client/pages/billing/claim-chit/claim-chit-list.js +17 -17
  4. package/client/pages/billing/claim-chit/create-claim-chit.js +39 -30
  5. package/client/pages/billing/transport-summary-report.js +21 -23
  6. package/client/pages/bulk-operation/validate-ro-popup.js +14 -54
  7. package/client/pages/inbound/expiry-date-popup.js +2 -2
  8. package/client/pages/inbound/inbound-reusable-pallet.js +21 -19
  9. package/client/pages/inbound/palletizing-pallets-popup.js +10 -9
  10. package/client/pages/inbound/putaway-product.js +16 -8
  11. package/client/pages/inbound/putaway-worksheet-generate-popup.js +4 -4
  12. package/client/pages/inbound/unload-product.js +16 -88
  13. package/client/pages/inbound/vas-selector.js +9 -8
  14. package/client/pages/inventory-check/check-inventory-popup.js +20 -18
  15. package/client/pages/inventory-check/cycle-count-recheck-popup.js +25 -15
  16. package/client/pages/inventory-check/inspecting-product.js +2 -2
  17. package/client/pages/inventory-check/inventory-check-list.js +30 -19
  18. package/client/pages/inventory-check/search-popup.js +15 -14
  19. package/client/pages/inventory-check/worksheet-cycle-count.js +17 -15
  20. package/client/pages/master/location-list.js +60 -52
  21. package/client/pages/master/pallet-list.js +34 -30
  22. package/client/pages/master/print-location-label.js +37 -36
  23. package/client/pages/master/warehouse-list.js +33 -29
  24. package/client/pages/master/worker-list.js +30 -30
  25. package/client/pages/order/arrival-notice/assign-buffer-location.js +1 -1
  26. package/client/pages/order/goods-received-note/customer-grn-list.js +9 -8
  27. package/client/pages/order/goods-received-note/customer-received-note.js +8 -7
  28. package/client/pages/order/goods-received-note/received-note-list.js +9 -8
  29. package/client/pages/order/release-order/release-extra-product-popup.js +3 -7
  30. package/client/pages/order/return-order/check-return-order.js +15 -13
  31. package/client/pages/order/return-order/receive-return-order-requests.js +25 -22
  32. package/client/pages/order/return-order/rejected-return-order.js +8 -14
  33. package/client/pages/order/return-order/return-order-assign-buffer-location.js +16 -14
  34. package/client/pages/order/return-order/return-order-detail.js +35 -31
  35. package/client/pages/order/return-order/return-order-list.js +9 -8
  36. package/client/pages/order/return-order/return-order-requests.js +20 -18
  37. package/client/pages/order/reverse-kitting-order/reverse-kitting-order-list.js +9 -8
  38. package/client/pages/order/transfer-order/receive-transfer-order-request.js +67 -66
  39. package/client/pages/order/transfer-order/rejected-transfer-order.js +7 -6
  40. package/client/pages/order/transfer-order/transfer-order-detail.js +7 -6
  41. package/client/pages/order/transfer-order/transfer-order-requests.js +20 -18
  42. package/client/pages/order/transport-order/contact-point-selector-popup.js +20 -20
  43. package/client/pages/order/transport-order/delivery-note-popup.js +52 -46
  44. package/client/pages/order/transport-order/print-delivery-note.js +17 -16
  45. package/client/pages/order/transport-order/upload-delivery-note.js +21 -18
  46. package/client/pages/order/transport-order/view-delivery-note.js +19 -22
  47. package/client/pages/order/vas-order/create-vas-order.js +12 -11
  48. package/client/pages/order/vas-order/receive-vas-order.js +25 -22
  49. package/client/pages/order/vas-order/vas-order-detail.js +26 -23
  50. package/client/pages/order/vas-order/vas-order-list.js +9 -8
  51. package/client/pages/order/vas-order/vas-order-requests.js +11 -12
  52. package/client/pages/outbound/outbound-reusable-pallet.js +25 -33
  53. package/client/pages/outbound/single-outbound-worksheet.js +9 -8
  54. package/client/pages/report/job-sheet-list.js +9 -8
  55. package/client/route.js +16 -32
  56. package/package.json +65 -65
  57. package/things-factory.config.js +0 -16
  58. package/translations/en.json +3 -0
  59. package/translations/ko.json +3 -1
  60. package/translations/ms.json +3 -1
  61. package/translations/zh.json +3 -1
  62. package/client/pages/inbound/location-selector.js +0 -224
  63. package/client/pages/master/picking-bin-list.js +0 -354
  64. package/client/pages/order/retail-replenishment-order/retail-replenishment-order-detail.js +0 -315
  65. package/client/pages/order/retail-replenishment-order/retail-replenishment-order-requests.js +0 -307
  66. package/client/pages/order/vas-order/rejected-vas-order.js +0 -300
@@ -1,354 +0,0 @@
1
- import { getCodeByName } from '@things-factory/code-base'
2
- import '@things-factory/form-ui'
3
- import '@things-factory/grist-ui'
4
- import { i18next, localize } from '@things-factory/i18n-base'
5
- import '@things-factory/import-ui'
6
- import { openPopup } from '@things-factory/layout-base'
7
- import { client, CustomAlert, PageView } from '@things-factory/shell'
8
- import { ScrollbarStyles, CommonButtonStyles } from '@things-factory/styles'
9
- import { gqlBuilder, isMobileDevice } from '@things-factory/utils'
10
- import gql from 'graphql-tag'
11
- import { css, html } from 'lit-element'
12
-
13
- class PickingBinList extends localize(i18next)(PageView) {
14
- static get properties() {
15
- return {
16
- config: Object,
17
- data: Object,
18
- importHandler: Object
19
- }
20
- }
21
-
22
- static get styles() {
23
- return [
24
- ScrollbarStyles,
25
- css`
26
- :host {
27
- display: flex;
28
- flex-direction: column;
29
- overflow: hidden;
30
- }
31
-
32
- search-form {
33
- overflow: visible;
34
- }
35
-
36
- data-grist {
37
- overflow-y: auto;
38
- flex: 1;
39
- }
40
- `
41
- ]
42
- }
43
-
44
- render() {
45
- return html`
46
- <search-form id="search-form" .fields=${this._searchFields} @submit=${e => this.dataGrist.fetch()}></search-form>
47
-
48
- <data-grist
49
- .mode=${isMobileDevice() ? 'LIST' : 'GRID'}
50
- .config=${this.config}
51
- .fetchHandler="${this.fetchHandler.bind(this)}"
52
- ></data-grist>
53
- `
54
- }
55
-
56
- get context() {
57
- return {
58
- title: i18next.t('title.picking_bins'),
59
- actions: [
60
- {
61
- title: i18next.t('button.save'),
62
- action: this._savePickingBin.bind(this),
63
- ...CommonButtonStyles.save
64
- },
65
- {
66
- title: i18next.t('button.delete'),
67
- action: this._deletePickingBin.bind(this),
68
- ...CommonButtonStyles.delete
69
- }
70
- ],
71
- exportable: {
72
- name: i18next.t('title.picking_bins'),
73
- data: this._exportableData.bind(this)
74
- },
75
- importable: {
76
- handler: this._importableData.bind(this)
77
- }
78
- }
79
- }
80
-
81
- pageUpdated(changes, lifecycle) {
82
- if (this.active) {
83
- this.dataGrist.fetch()
84
- }
85
- }
86
-
87
- async pageInitialized() {
88
- const _pickingBinStatus = await getCodeByName('PICKING_BIN_STATUS')
89
-
90
- this._searchFields = [
91
- {
92
- label: i18next.t('field.ref_no'),
93
- name: 'name',
94
- type: 'text',
95
- props: { searchOper: 'i_like' }
96
- },
97
- {
98
- label: i18next.t('field.status'),
99
- name: 'status',
100
- type: 'select',
101
- options: [
102
- { value: '' },
103
- ..._pickingBinStatus.map(status => {
104
- return {
105
- name: status.name,
106
- value: status.name
107
- }
108
- })
109
- ],
110
- props: { searchOper: 'eq' }
111
- }
112
- ]
113
-
114
- this.config = {
115
- list: {
116
- fields: ['name', 'status']
117
- },
118
- rows: { selectable: { multiple: true } },
119
- columns: [
120
- { type: 'gutter', gutterName: 'dirty' },
121
- { type: 'gutter', gutterName: 'sequence' },
122
- { type: 'gutter', gutterName: 'row-selector', multiple: true },
123
- {
124
- type: 'string',
125
- name: 'name',
126
- header: i18next.t('field.name'),
127
- imex: { header: i18next.t('field.name'), key: 'name', width: 50, type: 'string' },
128
- record: { editable: true },
129
- sortable: true,
130
- width: 100
131
- },
132
- {
133
- type: 'code',
134
- name: 'status',
135
- header: i18next.t('field.status'),
136
- imex: { header: i18next.t('field.status'), key: 'status', width: 50, type: 'string' },
137
- record: {
138
- editable: true,
139
- codeName: 'PICKING_BIN_STATUS'
140
- },
141
- sortable: true,
142
- width: 130
143
- },
144
- {
145
- type: 'datetime',
146
- name: 'updatedAt',
147
- header: i18next.t('field.updated_at'),
148
- sortable: true,
149
- width: 150
150
- },
151
- {
152
- type: 'object',
153
- name: 'updater',
154
- header: i18next.t('field.updater'),
155
- sortable: true,
156
- width: 150
157
- }
158
- ]
159
- }
160
- }
161
-
162
- get searchForm() {
163
- return this.shadowRoot.querySelector('search-form')
164
- }
165
-
166
- get dataGrist() {
167
- return this.shadowRoot.querySelector('data-grist')
168
- }
169
-
170
- _importableData(records) {
171
- setTimeout(() => {
172
- openPopup(
173
- html`
174
- <import-pop-up
175
- .records=${records}
176
- .config=${{
177
- rows: this.config.rows,
178
- columns: [...this.config.columns.filter(column => column.imex !== undefined)]
179
- }}
180
- .importHandler="${this.importHandler.bind(this)}"
181
- ></import-pop-up>
182
- `,
183
- {
184
- backdrop: true,
185
- size: 'large',
186
- title: i18next.t('title.import')
187
- }
188
- )
189
- }, 500)
190
- }
191
-
192
- async fetchHandler({ page, limit, sorters = [] }) {
193
- const response = await client.query({
194
- query: gql`
195
- query {
196
- pickingBins(${gqlBuilder.buildArgs({
197
- filters: [...this.searchForm.queryFilters],
198
- pagination: { page, limit },
199
- sortings: sorters
200
- })}) {
201
- items {
202
- id
203
- name
204
- status
205
- updatedAt
206
- updater{
207
- id
208
- name
209
- description
210
- }
211
- }
212
- total
213
- }
214
- }
215
- `
216
- })
217
-
218
- return {
219
- total: response.data.pickingBins.total || 0,
220
- records: response.data.pickingBins.items || []
221
- }
222
- }
223
-
224
- async importHandler(patches) {
225
- this.dataGrist.showSpinner()
226
- const response = await client.query({
227
- query: gql`
228
- mutation {
229
- updateMultiplePickingBin(${gqlBuilder.buildArgs({
230
- patches
231
- })}) {
232
- name
233
- }
234
- }
235
- `
236
- })
237
- if (!response.errors) {
238
- history.back()
239
- this.dataGrist.fetch()
240
- document.dispatchEvent(
241
- new CustomEvent('notify', {
242
- detail: {
243
- message: i18next.t('text.data_imported_successfully')
244
- }
245
- })
246
- )
247
- }
248
- this.dataGrist.hideSpinner()
249
- }
250
-
251
- async _savePickingBin() {
252
- let patches = this.dataGrist.exportPatchList({ flagName: 'cuFlag' })
253
- if (patches && patches.length) {
254
- this.dataGrist.showSpinner()
255
- const response = await client.query({
256
- query: gql`
257
- mutation {
258
- updateMultiplePickingBin(${gqlBuilder.buildArgs({
259
- patches
260
- })}) {
261
- name
262
- }
263
- }
264
- `
265
- })
266
-
267
- if (!response.errors) {
268
- this.dataGrist.fetch()
269
- document.dispatchEvent(
270
- new CustomEvent('notify', {
271
- detail: {
272
- message: i18next.t('text.data_updated_successfully')
273
- }
274
- })
275
- )
276
- }
277
- this.dataGrist.hideSpinner()
278
- }
279
- }
280
-
281
- async _deletePickingBin() {
282
- CustomAlert({
283
- title: i18next.t('text.are_you_sure'),
284
- text: i18next.t('text.you_wont_be_able_to_revert_this'),
285
- type: 'warning',
286
- confirmButton: { text: i18next.t('button.delete'), color: '#22a6a7' },
287
- cancelButton: { text: 'cancel', color: '#cfcfcf' },
288
- callback: async result => {
289
- if (result.value) {
290
- this.dataGrist.showSpinner()
291
- const ids = this.dataGrist.selected.map(record => record.id)
292
- if (ids && ids.length > 0) {
293
- const response = await client.query({
294
- query: gql`
295
- mutation {
296
- deletePickingBins(${gqlBuilder.buildArgs({ ids })})
297
- }
298
- `
299
- })
300
-
301
- if (!response.errors) {
302
- this.dataGrist.fetch()
303
- document.dispatchEvent(
304
- new CustomEvent('notify', {
305
- detail: {
306
- message: i18next.t('text.data_deleted_successfully')
307
- }
308
- })
309
- )
310
- }
311
- }
312
- this.dataGrist.hideSpinner()
313
- }
314
- }
315
- })
316
- }
317
-
318
- get _columns() {
319
- return this.config.columns
320
- }
321
-
322
- _exportableData() {
323
- let records = []
324
- if (this.dataGrist.selected && this.dataGrist.selected.length > 0) {
325
- records = this.dataGrist.selected
326
- } else {
327
- records = this.dataGrist.data.records
328
- }
329
-
330
- var headerSetting = this.dataGrist._config.columns
331
- .filter(column => column.type !== 'gutter' && column.record !== undefined && column.imex !== undefined)
332
- .map(column => {
333
- return column.imex
334
- })
335
-
336
- var data = records.map(item => {
337
- return {
338
- id: item.id,
339
- ...this._columns
340
- .filter(column => column.type !== 'gutter' && column.record !== undefined && column.imex !== undefined)
341
- .reduce((record, column) => {
342
- record[column.imex.key] = column.imex.key
343
- .split('.')
344
- .reduce((obj, key) => (obj && obj[key] !== 'undefined' ? obj[key] : undefined), item)
345
- return record
346
- }, {})
347
- }
348
- })
349
-
350
- return { header: headerSetting, data: data }
351
- }
352
- }
353
-
354
- window.customElements.define('picking-bin-list', PickingBinList)
@@ -1,315 +0,0 @@
1
- import { getCodeByName } from '@things-factory/code-base'
2
- import '@things-factory/form-ui'
3
- import '@things-factory/grist-ui'
4
- import { i18next, localize } from '@things-factory/i18n-base'
5
- import { client, navigate, PageView } from '@things-factory/shell'
6
- import { MultiColumnFormStyles } from '@things-factory/form-ui'
7
- import { gqlBuilder, isMobileDevice } from '@things-factory/utils'
8
- import gql from 'graphql-tag'
9
- import { css, html } from 'lit-element'
10
- import { ORDER_STATUS } from '../../constants'
11
-
12
- class RetailReplenishmentOrderDetail extends localize(i18next)(PageView) {
13
- static get styles() {
14
- return [
15
- MultiColumnFormStyles,
16
- css`
17
- :host {
18
- display: flex;
19
- flex-direction: column;
20
- overflow-x: auto;
21
- }
22
- .container {
23
- flex: 1;
24
- display: flex;
25
- }
26
- .grist {
27
- background-color: var(--main-section-background-color);
28
- display: flex;
29
- flex-direction: column;
30
- flex: 1;
31
- overflow-y: auto;
32
- }
33
- .guide-container {
34
- max-width: 30vw;
35
- display: flex;
36
- flex-direction: column;
37
- }
38
- data-grist {
39
- overflow-y: hidden;
40
- flex: 1;
41
- }
42
- h2 {
43
- padding: var(--subtitle-padding);
44
- font: var(--subtitle-font);
45
- color: var(--subtitle-text-color);
46
- border-bottom: var(--subtitle-border-bottom);
47
- }
48
- .grist h2 {
49
- margin: var(--grist-title-margin);
50
- border: var(--grist-title-border);
51
- font: var(--grist-title-font);
52
- color: var(--secondary-color);
53
- }
54
-
55
- .grist h2 mwc-icon {
56
- vertical-align: middle;
57
- margin: var(--grist-title-icon-margin);
58
- font-size: var(--grist-title-icon-size);
59
- color: var(--grist-title-icon-color);
60
- }
61
-
62
- h2 + data-grist {
63
- padding-top: var(--grist-title-with-grid-padding);
64
- }
65
-
66
- .gan-preview {
67
- display: flex;
68
- flex-direction: row;
69
- flex: 1;
70
- }
71
- attachment-viewer {
72
- flex: 1;
73
- }
74
- `
75
- ]
76
- }
77
-
78
- static get properties() {
79
- return {
80
- config: Object,
81
- data: Object,
82
- productData: Object,
83
- _ownTransport: Boolean,
84
- _status: String,
85
- _rrNo: String
86
- }
87
- }
88
-
89
- constructor() {
90
- super()
91
- this.productData = { records: [] }
92
- }
93
-
94
- render() {
95
- return html`
96
- <form name="retailReplenishmentOrder" class="multi-column-form">
97
- <fieldset>
98
- <legend>${i18next.t('title.retail_replenishment_order_no')}: ${this._rrNo}</legend>
99
-
100
- <label>${i18next.t('label.ref_no')}</label>
101
- <input name="refNo" readonly />
102
-
103
- <label>${i18next.t('label.issued_date')}</label>
104
- <input name="issuedDate" type="date" readonly />
105
-
106
- <label>${i18next.t('label.status')}</label>
107
- <select name="status" disabled>
108
- ${Object.keys(ORDER_STATUS).map(key => {
109
- const status = ORDER_STATUS[key]
110
- return html` <option value="${status.value}">${i18next.t(`label.${status.name}`)}</option> `
111
- })}
112
- </select>
113
-
114
- <input
115
- id="ownTransport"
116
- type="checkbox"
117
- name="ownTransport"
118
- ?checked="${this._ownTransport}"
119
- @change="${e => (this._ownTransport = e.currentTarget.checked)}"
120
- disabled
121
- />
122
- <label>${i18next.t('label.own_transport')}</label>
123
- </fieldset>
124
- </form>
125
-
126
- <div class="container">
127
- <div class="grist">
128
- <h2><mwc-icon>list_alt</mwc-icon>${i18next.t('title.product')}</h2>
129
- <data-grist
130
- .mode=${isMobileDevice() ? 'LIST' : 'GRID'}
131
- .config=${this.config}
132
- .data="${this.productData}"
133
- ></data-grist>
134
- </div>
135
- </div>
136
- `
137
- }
138
-
139
- get context() {
140
- return {
141
- title: i18next.t('title.retail_replenishment_order_detail'),
142
- exportable: {
143
- name: i18next.t('title.retail_replenishment_order_detail'),
144
- data: this._exportableData.bind(this)
145
- }
146
- }
147
- }
148
-
149
- async pageUpdated(changes, lifecycle) {
150
- if (this.active) {
151
- this._rrNo = changes.resourceId || this._rrNo || ''
152
- this.dataGrist.fetch()
153
- await this._fetchRRO()
154
- }
155
- }
156
-
157
- async pageInitialized() {
158
- this.config = {
159
- rows: { selectable: { multiple: true }, appendable: false },
160
- list: { fields: ['name', 'bizplace', 'releaseDate', 'status', 'updatedAt'] },
161
- columns: [
162
- { type: 'gutter', gutterName: 'sequence' },
163
- {
164
- type: 'string',
165
- name: 'batchId',
166
- header: i18next.t('field.batch_id'),
167
- record: { align: 'left' },
168
- width: 100
169
- },
170
- {
171
- type: 'object',
172
- name: 'product',
173
- header: i18next.t('field.product'),
174
- record: { options: { queryName: 'products' } },
175
- width: 350
176
- },
177
- {
178
- type: 'string',
179
- name: 'packingType',
180
- header: i18next.t('field.packing_type'),
181
- width: 150
182
- },
183
- {
184
- type: 'float',
185
- name: 'uomValue',
186
- header: i18next.t('field.uom_value'),
187
- record: { align: 'center', options: { min: 0 } },
188
- width: 100
189
- },
190
- {
191
- type: 'string',
192
- name: 'uom',
193
- header: i18next.t('field.uom'),
194
- record: { align: 'center' },
195
- width: 150
196
- },
197
- {
198
- type: 'float',
199
- name: 'packQty',
200
- header: i18next.t('field.pack_qty'),
201
- record: { options: { min: 0 } },
202
- width: 100
203
- },
204
- {
205
- type: 'float',
206
- name: 'totalUomValue',
207
- header: i18next.t('field.total_uom_value'),
208
- record: { align: 'center', options: { min: 0 } },
209
- width: 100
210
- },
211
- {
212
- type: 'string',
213
- name: 'status',
214
- header: i18next.t('field.status'),
215
- width: 150
216
- }
217
- ]
218
- }
219
- }
220
-
221
- get dataGrist() {
222
- return this.shadowRoot.querySelector('data-grist')
223
- }
224
-
225
- get retailReplenishmentOrderForm() {
226
- return this.shadowRoot.querySelector('form[name=retailReplenishmentOrder]')
227
- }
228
-
229
- _fillupRROForm(data) {
230
- this._fillupForm(this.retailReplenishmentOrderForm, data)
231
- }
232
-
233
- _fillupForm(form, data) {
234
- form.reset()
235
- for (let key in data) {
236
- Array.from(form.querySelectorAll('input, textarea, select')).forEach(field => {
237
- if (field.name === key && field.type === 'checkbox') {
238
- field.checked = data[key]
239
- } else if (field.name === key && field.type === 'datetime-local') {
240
- const datetime = Number(data[key])
241
- const timezoneOffset = new Date(datetime).getTimezoneOffset() * 60000
242
- field.value = new Date(datetime - timezoneOffset).toISOString().slice(0, -1)
243
- } else if (field.name === key) {
244
- if (data[key] instanceof Object) {
245
- const objectData = data[key]
246
- field.value = `${objectData.name} ${objectData.description ? ` (${objectData.description})` : ''}`
247
- } else {
248
- field.value = data[key]
249
- }
250
- }
251
- })
252
- }
253
- }
254
-
255
- async _fetchRRO() {
256
- if (!this._rrNo) return
257
-
258
- try {
259
- const response = await client.query({
260
- query: gql`
261
- query {
262
- retailReplenishmentOrder(${gqlBuilder.buildArgs({
263
- name: this._rrNo
264
- })}) {
265
- name
266
- issuedDate
267
- status
268
- refNo
269
- remark
270
- ownTransport
271
- orderProducts {
272
- batchId
273
- status
274
- product {
275
- sku
276
- name
277
- description
278
- }
279
- packQty
280
- uomValue
281
- totalUomValue
282
- uom
283
- packingType
284
- packingSize
285
- }
286
- updatedAt
287
- }
288
- }
289
- `
290
- })
291
-
292
- if (!response.errors) {
293
- const retailReplenishment = response.data.retailReplenishmentOrder
294
- const orderVass = retailReplenishment.orderVass
295
- const orderProducts = retailReplenishment.orderProducts
296
- this._ownTransport = retailReplenishment.ownTransport
297
- this._status = retailReplenishment.status
298
- this.productData = { records: orderProducts }
299
- this._fillupRROForm(retailReplenishment)
300
- }
301
- } catch (e) {
302
- this._showToast(e)
303
- }
304
- }
305
-
306
- get _columns() {
307
- return this.config.columns
308
- }
309
-
310
- _exportableData() {
311
- return this.dataGrist.exportRecords()
312
- }
313
- }
314
-
315
- window.customElements.define('retail-replenishment-order-detail', RetailReplenishmentOrderDetail)