@things-factory/operato-wms 4.0.9 → 4.0.13

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 (160) hide show
  1. package/client/pages/adjustment/transfer-inventory.js +368 -165
  2. package/client/pages/billing/claim-chit/claim-chit-list.js +7 -6
  3. package/client/pages/bulk-operation/bulk-operation.js +316 -0
  4. package/client/pages/bulk-operation/validate-ro-popup.js +445 -0
  5. package/client/pages/components/select-product-popup.js +15 -2
  6. package/client/pages/constants/inventory.js +1 -0
  7. package/client/pages/constants/location.js +33 -6
  8. package/client/pages/constants/order.js +10 -0
  9. package/client/pages/constants/worksheet.js +2 -2
  10. package/client/pages/inbound/inbound-worksheet.js +78 -9
  11. package/client/pages/inbound/putaway-product.js +214 -139
  12. package/client/pages/inbound/putaway-worksheet-generate-popup.js +24 -2
  13. package/client/pages/inbound/unload-product.js +149 -76
  14. package/client/pages/inbound/worksheet-putaway-return.js +22 -5
  15. package/client/pages/inbound/worksheet-putaway.js +21 -8
  16. package/client/pages/inbound/worksheet-unloading-return.js +22 -5
  17. package/client/pages/inbound/worksheet-unloading.js +8 -0
  18. package/client/pages/inventory/inventory-adjustment-approval.js +11 -19
  19. package/client/pages/inventory/inventory-adjustment.js +136 -101
  20. package/client/pages/inventory/inventory-by-product-detail.js +3 -5
  21. package/client/pages/inventory/inventory-by-product.js +8 -0
  22. package/client/pages/inventory/inventory-history-by-pallet.js +12 -5
  23. package/client/pages/inventory/inventory-history.js +14 -5
  24. package/client/pages/inventory/onhand-inventory.js +11 -2
  25. package/client/pages/inventory-check/create-cycle-count.js +12 -6
  26. package/client/pages/inventory-check/cycle-count-report.js +8 -0
  27. package/client/pages/inventory-check/inspecting-product.js +146 -80
  28. package/client/pages/inventory-check/worksheet-cycle-count.js +14 -0
  29. package/client/pages/manifest/create-loading-manifest.js +314 -0
  30. package/client/pages/manifest/dispatcher-verification-popup.js +86 -0
  31. package/client/pages/manifest/loading-manifest-detail.js +345 -0
  32. package/client/pages/manifest/loading-manifest-list.js +305 -0
  33. package/client/pages/master/location-list.js +58 -17
  34. package/client/pages/master/product/product-detail-bizplace-setting-popup.js +2 -2
  35. package/client/pages/master/product/product-details-popup.js +2 -2
  36. package/client/pages/master/product/product-list.js +5 -5
  37. package/client/pages/order/arrival-notice/arrival-notice-detail.js +134 -115
  38. package/client/pages/order/arrival-notice/arrival-notice-list.js +87 -6
  39. package/client/pages/order/arrival-notice/arrival-notice-requests.js +83 -6
  40. package/client/pages/order/arrival-notice/assign-buffer-location.js +8 -1
  41. package/client/pages/order/arrival-notice/check-arrived-notice.js +9 -1
  42. package/client/pages/order/arrival-notice/create-arrival-notice.js +38 -3
  43. package/client/pages/order/arrival-notice/duplicate-arrival-notice.js +290 -25
  44. package/client/pages/order/arrival-notice/edit-product-popup.js +36 -5
  45. package/client/pages/order/arrival-notice/receive-arrival-notice.js +8 -1
  46. package/client/pages/order/goods-received-note/received-note-list.js +138 -6
  47. package/client/pages/order/release-order/b2b/b2b-order-list.js +45 -5
  48. package/client/pages/order/release-order/b2b/b2b-order-requests.js +52 -12
  49. package/client/pages/order/release-order/b2c/b2c-order-requests.js +244 -24
  50. package/client/pages/order/release-order/bulk-print-packing-list.js +23 -0
  51. package/client/pages/order/release-order/create-release-order.js +55 -8
  52. package/client/pages/order/release-order/receive-release-order-request.js +35 -24
  53. package/client/pages/order/release-order/release-extra-product-popup.js +204 -63
  54. package/client/pages/order/release-order/release-order-detail.js +301 -74
  55. package/client/pages/order/return-order/check-return-order.js +9 -1
  56. package/client/pages/order/return-order/create-return-order.js +14 -2
  57. package/client/pages/order/return-order/receive-return-order-requests.js +9 -1
  58. package/client/pages/order/return-order/return-order-detail.js +15 -6
  59. package/client/pages/order/return-order/return-order-inventory-popup.js +7 -0
  60. package/client/pages/order/reverse-kitting-order/reverse-kitting-order-detail.js +124 -59
  61. package/client/pages/order/reverse-kitting-order/reverse-kitting-order-list.js +1 -6
  62. package/client/pages/order/reverse-kitting-order/reverse-kitting-pallet-label-popup.js +239 -0
  63. package/client/pages/order/transport-order/delivery-order-list.js +102 -59
  64. package/client/pages/outbound/inventory-assign-popup.js +23 -6
  65. package/client/pages/outbound/inventory-auto-assign-popup.js +22 -6
  66. package/client/pages/outbound/loading-product.js +4 -1
  67. package/client/pages/outbound/merged-outbound-worksheet.js +43 -1
  68. package/client/pages/outbound/packing-product.js +4 -1
  69. package/client/pages/outbound/packing-worksheet-list.js +39 -1
  70. package/client/pages/outbound/picking-product.js +803 -431
  71. package/client/pages/outbound/picking-replacement-popup.js +1 -1
  72. package/client/pages/outbound/serial-number-popup.js +280 -0
  73. package/client/pages/outbound/single-outbound-worksheet.js +47 -1
  74. package/client/pages/outbound/worksheet-batch-picking.js +22 -8
  75. package/client/pages/outbound/worksheet-loading.js +22 -5
  76. package/client/pages/outbound/worksheet-packing.js +8 -0
  77. package/client/pages/outbound/worksheet-picking.js +62 -8
  78. package/client/pages/outbound/worksheet-return.js +9 -1
  79. package/client/pages/outbound/worksheet-sorting.js +9 -1
  80. package/client/pages/report/custom-elccl/elccl-inventory-report.js +31 -30
  81. package/client/pages/report/custom-elccl/elccl-inventory-summary-report.js +23 -26
  82. package/client/pages/report/inventory-pallet-storage-report.js +11 -10
  83. package/client/pages/report/inventory-report.js +41 -43
  84. package/client/pages/report/inventory-summary-report.js +25 -28
  85. package/client/pages/report/product-label-report.js +401 -0
  86. package/client/pages/support/inventory-comparison.js +296 -0
  87. package/client/pages/vas/print-product-label.js +298 -132
  88. package/client/pages/vas/reverse-kitting/execute-reverse-kitting.js +38 -23
  89. package/client/pages/vas/reverse-kitting/popup-combination-sets.js +98 -15
  90. package/client/pages/vas/reverse-kitting/popup-reverse-kitting-template.js +129 -21
  91. package/client/pages/vas/vas-pallet-label-popup.js +5 -8
  92. package/client/route.js +28 -0
  93. package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-report.js +1 -1
  94. package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-report.js.map +1 -1
  95. package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-summary-report.js +64 -54
  96. package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-summary-report.js.map +1 -1
  97. package/dist-server/graphql/resolvers/extra/add-release-good-products.js +34 -9
  98. package/dist-server/graphql/resolvers/extra/add-release-good-products.js.map +1 -1
  99. package/dist-server/graphql/resolvers/index.js +5 -1
  100. package/dist-server/graphql/resolvers/index.js.map +1 -1
  101. package/dist-server/graphql/resolvers/inventory-comparison/index.js +6 -0
  102. package/dist-server/graphql/resolvers/inventory-comparison/index.js.map +1 -0
  103. package/dist-server/graphql/resolvers/inventory-comparison/inventory-comparison-list.js +78 -0
  104. package/dist-server/graphql/resolvers/inventory-comparison/inventory-comparison-list.js.map +1 -0
  105. package/dist-server/graphql/resolvers/reports/index.js +2 -1
  106. package/dist-server/graphql/resolvers/reports/index.js.map +1 -1
  107. package/dist-server/graphql/resolvers/reports/product-label-report.js +56 -0
  108. package/dist-server/graphql/resolvers/reports/product-label-report.js.map +1 -0
  109. package/dist-server/graphql/resolvers/shipping-provider/index.js +6 -0
  110. package/dist-server/graphql/resolvers/shipping-provider/index.js.map +1 -0
  111. package/dist-server/graphql/resolvers/shipping-provider/shipping-providers.js +20 -0
  112. package/dist-server/graphql/resolvers/shipping-provider/shipping-providers.js.map +1 -0
  113. package/dist-server/graphql/types/custom/elccl/elccl-inventory-report.js +1 -1
  114. package/dist-server/graphql/types/index.js +8 -2
  115. package/dist-server/graphql/types/index.js.map +1 -1
  116. package/dist-server/graphql/types/inventory-comparison/index.js +13 -0
  117. package/dist-server/graphql/types/inventory-comparison/index.js.map +1 -0
  118. package/dist-server/graphql/types/inventory-comparison/inventory-comparison-list.js +14 -0
  119. package/dist-server/graphql/types/inventory-comparison/inventory-comparison-list.js.map +1 -0
  120. package/dist-server/graphql/types/inventory-comparison/inventory-comparison.js +18 -0
  121. package/dist-server/graphql/types/inventory-comparison/inventory-comparison.js.map +1 -0
  122. package/dist-server/graphql/types/reports/index.js +6 -1
  123. package/dist-server/graphql/types/reports/index.js.map +1 -1
  124. package/dist-server/graphql/types/reports/product-label-report-list.js +14 -0
  125. package/dist-server/graphql/types/reports/product-label-report-list.js.map +1 -0
  126. package/dist-server/graphql/types/reports/product-label-report.js +16 -0
  127. package/dist-server/graphql/types/reports/product-label-report.js.map +1 -0
  128. package/dist-server/graphql/types/shipping-provider/index.js +10 -0
  129. package/dist-server/graphql/types/shipping-provider/index.js.map +1 -0
  130. package/dist-server/graphql/types/shipping-provider/shipping-provider-list.js +13 -0
  131. package/dist-server/graphql/types/shipping-provider/shipping-provider-list.js.map +1 -0
  132. package/dist-server/graphql/types/shipping-provider/shipping-provider.js +13 -0
  133. package/dist-server/graphql/types/shipping-provider/shipping-provider.js.map +1 -0
  134. package/package.json +65 -65
  135. package/server/graphql/resolvers/custom/elccl/elccl-inventory-history-report.ts +4 -2
  136. package/server/graphql/resolvers/custom/elccl/elccl-inventory-history-summary-report.ts +75 -65
  137. package/server/graphql/resolvers/extra/add-release-good-products.ts +57 -15
  138. package/server/graphql/resolvers/index.ts +5 -1
  139. package/server/graphql/resolvers/inventory-comparison/index.ts +5 -0
  140. package/server/graphql/resolvers/inventory-comparison/inventory-comparison-list.ts +99 -0
  141. package/server/graphql/resolvers/reports/index.ts +3 -1
  142. package/server/graphql/resolvers/reports/product-label-report.ts +56 -0
  143. package/server/graphql/resolvers/shipping-provider/index.ts +5 -0
  144. package/server/graphql/resolvers/shipping-provider/shipping-providers.ts +20 -0
  145. package/server/graphql/types/custom/elccl/elccl-inventory-report.ts +1 -1
  146. package/server/graphql/types/index.ts +8 -2
  147. package/server/graphql/types/inventory-comparison/index.ts +11 -0
  148. package/server/graphql/types/inventory-comparison/inventory-comparison-list.ts +8 -0
  149. package/server/graphql/types/inventory-comparison/inventory-comparison.ts +12 -0
  150. package/server/graphql/types/reports/index.ts +6 -1
  151. package/server/graphql/types/reports/product-label-report-list.ts +8 -0
  152. package/server/graphql/types/reports/product-label-report.ts +10 -0
  153. package/server/graphql/types/shipping-provider/index.ts +8 -0
  154. package/server/graphql/types/shipping-provider/shipping-provider-list.ts +7 -0
  155. package/server/graphql/types/shipping-provider/shipping-provider.ts +7 -0
  156. package/things-factory.config.js +30 -0
  157. package/translations/en.json +91 -11
  158. package/translations/ko.json +109 -11
  159. package/translations/ms.json +111 -12
  160. package/translations/zh.json +123 -26
@@ -72,9 +72,6 @@ class ExecuteReverseKitting extends connect(store)(localize(i18next)(PageView))
72
72
  ? html`<form class="multi-column-form" id="info-form">
73
73
  <fieldset>
74
74
  <legend>${`${i18next.t('title.order_no')}: ${this._orderNo}`}</legend>
75
-
76
- <!-- <label>${i18next.t('label.company')}</label>
77
- <input name="bizplaceName" readonly /> -->
78
75
  </fieldset>
79
76
  </form>
80
77
 
@@ -109,8 +106,11 @@ class ExecuteReverseKitting extends connect(store)(localize(i18next)(PageView))
109
106
 
110
107
  get completable() {
111
108
  let completable = false
112
- if (this.orderData.records.length > 0) {
113
- completable = this.orderData.records.every(item => item.completed)
109
+ const orderDataWithIssues = this.orderData.records.filter(reverseKittingOI => !reverseKittingOI.completed)
110
+ if (!orderDataWithIssues?.length) {
111
+ completable = this.orderData.records.every(record => record.completed)
112
+ } else {
113
+ completable = orderDataWithIssues.every(record => record.issue)
114
114
  }
115
115
 
116
116
  return completable
@@ -131,7 +131,7 @@ class ExecuteReverseKitting extends connect(store)(localize(i18next)(PageView))
131
131
  pageInitialized() {
132
132
  this.orderGristConfig = {
133
133
  pagination: { infinite: true },
134
- list: { fields: ['completed', 'batchId', 'palletId', 'product', 'qty'] },
134
+ list: { fields: ['completed', 'batchId', 'palletId', 'product', 'qty', 'issue'] },
135
135
  rows: {
136
136
  appendable: false,
137
137
  handlers: {
@@ -179,6 +179,13 @@ class ExecuteReverseKitting extends connect(store)(localize(i18next)(PageView))
179
179
  header: i18next.t('field.uom_value'),
180
180
  label: true,
181
181
  width: 60
182
+ },
183
+ {
184
+ type: 'string',
185
+ name: 'issue',
186
+ header: i18next.t('field.issue'),
187
+ label: true,
188
+ width: 200
182
189
  }
183
190
  ]
184
191
  }
@@ -198,7 +205,7 @@ class ExecuteReverseKitting extends connect(store)(localize(i18next)(PageView))
198
205
  name
199
206
  description
200
207
  }
201
- orderReverseKittings {
208
+ reverseKittingOrderInventories {
202
209
  id
203
210
  name
204
211
  set
@@ -236,6 +243,7 @@ class ExecuteReverseKitting extends connect(store)(localize(i18next)(PageView))
236
243
  otherTarget
237
244
  operationGuide
238
245
  status
246
+ issue
239
247
  description
240
248
  remark
241
249
  }
@@ -247,20 +255,15 @@ class ExecuteReverseKitting extends connect(store)(localize(i18next)(PageView))
247
255
 
248
256
  if (!response.errors) {
249
257
  const reverseKittingOrder = response.data.executingReverseKittingOrder
250
- const orderReverseKittings = reverseKittingOrder.orderReverseKittings
258
+ const reverseKittingOIs = reverseKittingOrder.reverseKittingOrderInventories
251
259
  this._orderStatus = reverseKittingOrder.status
252
260
 
253
- // this._fillupForm({
254
- // ...reverseKittingOrder,
255
- // bizplace: reverseKittingOrder.bizplace.name
256
- // })
257
-
258
261
  this.orderData = {
259
- records: orderReverseKittings.map(orderReverseKitting => {
260
- const inventory = orderReverseKitting.inventory
262
+ records: reverseKittingOIs.map(reverseKittingOI => {
263
+ const inventory = reverseKittingOI.inventory
261
264
  return {
262
- ...orderReverseKitting,
263
- completed: this.checkComplete(orderReverseKitting),
265
+ ...reverseKittingOI,
266
+ completed: this.checkComplete(reverseKittingOI),
264
267
  batchId: inventory.batchId,
265
268
  palletId: inventory.palletId,
266
269
  location: inventory.location,
@@ -336,7 +339,6 @@ class ExecuteReverseKitting extends connect(store)(localize(i18next)(PageView))
336
339
 
337
340
  _clearView() {
338
341
  this.orderData = { records: [] }
339
- this.inputForm.reset()
340
342
  this._selectedParentInventory = null
341
343
  this.updateContext()
342
344
  }
@@ -346,11 +348,24 @@ class ExecuteReverseKitting extends connect(store)(localize(i18next)(PageView))
346
348
  }
347
349
 
348
350
  _openPopupCombinationSets(record) {
349
- openPopup(html` <popup-combination-sets .orderNo="${this._orderNo}" .data="${record}"></popup-combination-sets> `, {
350
- backdrop: true,
351
- size: 'large',
352
- title: record.palletId
353
- })
351
+ openPopup(
352
+ html`
353
+ <popup-combination-sets
354
+ .orderNo="${this._orderNo}"
355
+ .data="${record}"
356
+ @order-reverse-kitting-data="${e => {
357
+ this.fetchReverseKittingOrder(this._orderNo)
358
+ }}"
359
+ ></popup-combination-sets>
360
+ `,
361
+ {
362
+ backdrop: true,
363
+ escapable: false,
364
+ closable: false,
365
+ size: 'large',
366
+ title: record.palletId
367
+ }
368
+ )
354
369
  }
355
370
 
356
371
  _showToast({ type, message }) {
@@ -1,10 +1,13 @@
1
1
  import '../../vas/reverse-kitting/popup-reverse-kitting-template'
2
+ import '../../components/popup-note'
2
3
 
4
+ import gql from 'graphql-tag'
3
5
  import { css, html, LitElement } from 'lit-element'
4
6
 
5
7
  import { MultiColumnFormStyles } from '@things-factory/form-ui'
6
8
  import { i18next, localize } from '@things-factory/i18n-base'
7
9
  import { openPopup } from '@things-factory/layout-base'
10
+ import { client } from '@things-factory/shell'
8
11
  import { isMobileDevice } from '@things-factory/utils'
9
12
 
10
13
  class PopupCombinationSets extends localize(i18next)(LitElement) {
@@ -53,12 +56,15 @@ class PopupCombinationSets extends localize(i18next)(LitElement) {
53
56
  font-size: var(--grist-title-icon-size);
54
57
  color: var(--grist-title-icon-color);
55
58
  }
59
+ .grist {
60
+ display: flex;
61
+ flex-direction: column;
62
+ flex: 1;
63
+ overflow-y: auto;
64
+ }
56
65
  .button-container {
57
- padding: var(--button-container-padding);
58
- margin: var(--button-container-margin);
59
- text-align: var(--button-container-align);
60
- background-color: var(--button-container-background);
61
- height: var(--button-container-height);
66
+ padding: 10px 0 12px 0;
67
+ text-align: center;
62
68
  }
63
69
  `
64
70
  ]
@@ -129,11 +135,23 @@ class PopupCombinationSets extends localize(i18next)(LitElement) {
129
135
  ></data-grist>
130
136
  </div>`
131
137
  : ''}
138
+ ${this.data
139
+ ? html`<div class="button-container">
140
+ <mwc-button
141
+ raised
142
+ @click=${this._openIssueNote.bind(this)}
143
+ label="${i18next.t('button.issue')}"
144
+ ></mwc-button>
145
+ <mwc-button raised @click=${this._closePopup.bind(this)} label="${i18next.t('button.back')}"></mwc-button>
146
+ </div>`
147
+ : html`<div class="button-container">
148
+ <mwc-button raised @click=${this._closePopup.bind(this)} label="${i18next.t('button.back')}"></mwc-button>
149
+ </div>`}
132
150
  `
133
151
  }
134
152
 
135
153
  async fetchReverseKittingOrder() {
136
- if (!this._orderNo) return
154
+ if (!this.orderNo) return
137
155
  const response = await client.query({
138
156
  query: gql`
139
157
  query executingReverseKittingOrder($name: String!) {
@@ -146,7 +164,7 @@ class PopupCombinationSets extends localize(i18next)(LitElement) {
146
164
  name
147
165
  description
148
166
  }
149
- orderReverseKittings {
167
+ reverseKittingOrderInventories {
150
168
  id
151
169
  name
152
170
  set
@@ -190,30 +208,58 @@ class PopupCombinationSets extends localize(i18next)(LitElement) {
190
208
  }
191
209
  }
192
210
  `,
193
- variables: { name: this._orderNo }
211
+ variables: { name: this.orderNo }
194
212
  })
195
213
 
196
214
  if (!response.errors) {
197
215
  const reverseKittingOrder = response.data.executingReverseKittingOrder
198
- const orderReverseKittings = reverseKittingOrder.orderReverseKittings
216
+ const reverseKittingOIs = reverseKittingOrder.reverseKittingOrderInventories
199
217
 
200
- this.data = {
201
- records: orderReverseKittings.map(orderReverseKitting => {
202
- const inventory = orderReverseKitting.inventory
218
+ const prevReverseKittingOIName = this.data.name
219
+ const matchedReverseKittingOI = reverseKittingOIs
220
+ .filter(item => item.name === prevReverseKittingOIName)
221
+ .map(reverseKittingOI => {
222
+ const inventory = reverseKittingOI.inventory
203
223
  return {
204
- ...orderReverseKitting,
224
+ ...reverseKittingOI,
205
225
  batchId: inventory.batchId,
206
226
  palletId: inventory.palletId,
207
227
  location: inventory.location,
208
228
  product: inventory.product
209
229
  }
210
230
  })
211
- }
231
+
232
+ this.data = { ...matchedReverseKittingOI[0] }
212
233
 
213
234
  this.getProductCombination()
214
235
  }
215
236
  }
216
237
 
238
+ async updateReverseKittingIssue(reverseKittingOrder, issue) {
239
+ try {
240
+ if (!issue) return
241
+ const response = await client.mutate({
242
+ mutation: gql`
243
+ mutation updateReverseKittingOrderInventory($id: String!, $patch: ReverseKittingOrderInventoryPatch!) {
244
+ updateReverseKittingOrderInventory(id: $id, patch: $patch) {
245
+ id
246
+ name
247
+ }
248
+ }
249
+ `,
250
+ variables: { id: reverseKittingOrder.id, patch: { issue } }
251
+ })
252
+
253
+ if (!response.errors) {
254
+ this._showToast({ message: i18next.t('text.issue_updated') })
255
+ this.dispatchEvent(new CustomEvent('order-reverse-kitting-data', { detail: this.data }))
256
+ history.back()
257
+ }
258
+ } catch (e) {
259
+ this._showToast(e)
260
+ }
261
+ }
262
+
217
263
  getProductCombination() {
218
264
  let operationGuide = JSON.parse(this.data.operationGuide)
219
265
  this.productCombinationSets = {
@@ -229,11 +275,30 @@ class PopupCombinationSets extends localize(i18next)(LitElement) {
229
275
  }
230
276
  }
231
277
 
278
+ _openIssueNote() {
279
+ openPopup(
280
+ html`
281
+ <popup-note
282
+ .title="${i18next.t('title.issue')}"
283
+ .value="${this.data.issue}"
284
+ @submit="${async e => {
285
+ await this.updateReverseKittingIssue(this.data, e.detail.value)
286
+ }}"
287
+ ></popup-note>
288
+ `,
289
+ {
290
+ backdrop: true,
291
+ size: 'medium',
292
+ title: i18next.t('title.issue')
293
+ }
294
+ )
295
+ }
296
+
232
297
  _openPopupReverseKittingTemplate(record) {
233
298
  openPopup(
234
299
  html`
235
300
  <popup-reverse-kitting-template
236
- .orderReverseKittingName="${this.data.name}"
301
+ .reverseKittingOIName="${this.data.name}"
237
302
  .data="${record}"
238
303
  @updated="${async () => {
239
304
  await this.fetchReverseKittingOrder()
@@ -242,11 +307,29 @@ class PopupCombinationSets extends localize(i18next)(LitElement) {
242
307
  `,
243
308
  {
244
309
  backdrop: true,
310
+ escapable: false,
311
+ closable: false,
245
312
  size: 'large',
246
313
  title: i18next.t('title.reverse_kitting')
247
314
  }
248
315
  )
249
316
  }
317
+
318
+ _closePopup() {
319
+ this.dispatchEvent(new CustomEvent('order-reverse-kitting-data', { detail: {} }))
320
+ history.back()
321
+ }
322
+
323
+ _showToast({ type, message }) {
324
+ document.dispatchEvent(
325
+ new CustomEvent('notify', {
326
+ detail: {
327
+ type,
328
+ message
329
+ }
330
+ })
331
+ )
332
+ }
250
333
  }
251
334
 
252
335
  window.customElements.define('popup-combination-sets', PopupCombinationSets)
@@ -7,21 +7,24 @@ import { css, html, LitElement } from 'lit-element'
7
7
  import { MultiColumnFormStyles } from '@things-factory/form-ui'
8
8
  import { i18next, localize } from '@things-factory/i18n-base'
9
9
  import { openPopup } from '@things-factory/layout-base'
10
- import { client } from '@things-factory/shell'
10
+ import { client, CustomAlert } from '@things-factory/shell'
11
11
  import { isMobileDevice } from '@things-factory/utils'
12
12
 
13
13
  class PopupReverseKittingTemplate extends localize(i18next)(LitElement) {
14
14
  static get properties() {
15
15
  return {
16
- orderReverseKittingName: String,
16
+ reverseKittingOIName: String,
17
17
  data: Object,
18
18
  productSku: String,
19
19
  qty: Number,
20
20
  actualQty: Number,
21
21
  incompleteLocationName: Boolean,
22
22
  locations: Array,
23
+ _selectedInventory: Object,
23
24
  reverseKittingInventoriesConfig: Object,
24
- _reverseKittingInventories: Array
25
+ _reverseKittingInventories: Array,
26
+ _palletId: String,
27
+ _locationCode: String
25
28
  }
26
29
  }
27
30
 
@@ -62,11 +65,8 @@ class PopupReverseKittingTemplate extends localize(i18next)(LitElement) {
62
65
  color: var(--grist-title-icon-color);
63
66
  }
64
67
  .button-container {
65
- padding: var(--button-container-padding);
66
- margin: var(--button-container-margin);
67
- text-align: var(--button-container-align);
68
- background-color: var(--button-container-background);
69
- height: var(--button-container-height);
68
+ padding: 10px 0 12px 0;
69
+ text-align: center;
70
70
  }
71
71
  `
72
72
  ]
@@ -99,13 +99,23 @@ class PopupReverseKittingTemplate extends localize(i18next)(LitElement) {
99
99
  <legend>${this.productSku} [ ${this.actualQty} / ${this.qty} ]</legend>
100
100
 
101
101
  <label>${i18next.t('label.lot_id')}</label>
102
- <barcode-scanable-input name="palletId" without-enter custom-input></barcode-scanable-input>
102
+ <barcode-scanable-input
103
+ name="palletId"
104
+ value="${this._palletId}"
105
+ without-enter
106
+ custom-input
107
+ ></barcode-scanable-input>
103
108
 
104
109
  <label>${i18next.t('label.qty')}</label>
105
- <input name="qty" type="number" min="1" />
110
+ <input name="qty" type="number" value="" min="1" />
106
111
 
107
112
  <label>${i18next.t('label.location')}</label>
108
- <barcode-scanable-input name="locationCode" without-enter custom-input></barcode-scanable-input>
113
+ <barcode-scanable-input
114
+ name="locationCode"
115
+ value="${this._locationCode}"
116
+ without-enter
117
+ custom-input
118
+ ></barcode-scanable-input>
109
119
  </fieldset>
110
120
  </form>
111
121
 
@@ -118,12 +128,32 @@ class PopupReverseKittingTemplate extends localize(i18next)(LitElement) {
118
128
  .config=${this.reverseKittingInventoriesConfig}
119
129
  .data=${this._reverseKittingInventories}
120
130
  ></data-grist>
121
- </div>`
122
- : ''}
131
+ </div>
132
+ <div class="button-container">
133
+ <mwc-button
134
+ raised
135
+ @click=${this._confirmInventory.bind(this)}
136
+ label="${i18next.t('button.confirm')}"
137
+ ></mwc-button>
138
+ <mwc-button
139
+ raised
140
+ @click=${this._undoInventory.bind(this)}
141
+ label="${i18next.t('button.undo')}"
142
+ ></mwc-button>
143
+ </div> `
144
+ : html`<div class="button-container">
145
+ <mwc-button
146
+ raised
147
+ @click=${this._confirmInventory.bind(this)}
148
+ label="${i18next.t('button.confirm')}"
149
+ ></mwc-button>
150
+ </div> `}
123
151
  `
124
152
  }
125
153
 
126
154
  async firstUpdated() {
155
+ this._palletId = ''
156
+ this._locationCode = ''
127
157
  this.productSku = this.data.productSku
128
158
  this.qty = this.data.qty
129
159
  this.actualQty = this.data.actualQty
@@ -133,7 +163,10 @@ class PopupReverseKittingTemplate extends localize(i18next)(LitElement) {
133
163
  appendable: false,
134
164
  handlers: {
135
165
  click: (columns, data, column, record, rowIndex) => {
136
- return
166
+ this._selectedInventory = record
167
+ this._palletId = record.palletId
168
+ this._locationCode = record.locationCode
169
+ this._fillUpForm(this.inputForm, record)
137
170
  }
138
171
  }
139
172
  },
@@ -202,8 +235,8 @@ class PopupReverseKittingTemplate extends localize(i18next)(LitElement) {
202
235
  async _fetchInventories() {
203
236
  const response = await client.query({
204
237
  query: gql`
205
- query reverseKittingInventories($orderReverseKittingName: String!) {
206
- reverseKittingInventories(orderReverseKittingName: $orderReverseKittingName) {
238
+ query reverseKittingInventories($reverseKittingOIName: String!, $productDetailId: String) {
239
+ reverseKittingInventories(reverseKittingOIName: $reverseKittingOIName, productDetailId: $productDetailId) {
207
240
  batchId
208
241
  packingType
209
242
  bizplace {
@@ -218,6 +251,11 @@ class PopupReverseKittingTemplate extends localize(i18next)(LitElement) {
218
251
  qty
219
252
  expirationDate
220
253
  status
254
+ location {
255
+ id
256
+ name
257
+ description
258
+ }
221
259
  product {
222
260
  id
223
261
  name
@@ -227,7 +265,7 @@ class PopupReverseKittingTemplate extends localize(i18next)(LitElement) {
227
265
  }
228
266
  }
229
267
  `,
230
- variables: { orderReverseKittingName: this.orderReverseKittingName }
268
+ variables: { reverseKittingOIName: this.reverseKittingOIName, productDetailId: this.data.productDetailId }
231
269
  })
232
270
 
233
271
  if (!response.errors) {
@@ -237,15 +275,24 @@ class PopupReverseKittingTemplate extends localize(i18next)(LitElement) {
237
275
  return {
238
276
  ...reverseKittingInventory,
239
277
  sku: reverseKittingInventory.product.sku,
240
- packingTypeSize: `${reverseKittingInventory.packingType}(${reverseKittingInventory.packingSize})`
278
+ packingTypeSize: `${reverseKittingInventory.packingType}(${reverseKittingInventory.packingSize})`,
279
+ locationCode: reverseKittingInventory.location.name
241
280
  }
242
281
  }) || []
243
282
  }
283
+
284
+ let totalActualQty = 0
285
+ response.data.reverseKittingInventories.forEach(inventory => {
286
+ totalActualQty += inventory.qty
287
+ })
288
+
289
+ this.actualQty = totalActualQty
244
290
  }
245
291
  }
246
292
 
247
293
  async _executeReverseKitting(e) {
248
294
  if (e.keyCode === 13) {
295
+ e.preventDefault()
249
296
  try {
250
297
  await this._validateReverseKitting()
251
298
  if (!this.incompleteLocationName) {
@@ -256,7 +303,7 @@ class PopupReverseKittingTemplate extends localize(i18next)(LitElement) {
256
303
  }
257
304
  `,
258
305
  variables: {
259
- name: this.orderReverseKittingName,
306
+ name: this.reverseKittingOIName,
260
307
  inventory: {
261
308
  palletId: this.palletInput.value.trim(),
262
309
  qty: parseInt(this.qtyInput.value),
@@ -266,8 +313,8 @@ class PopupReverseKittingTemplate extends localize(i18next)(LitElement) {
266
313
  }
267
314
  })
268
315
  if (!response.errors) {
269
- this.dispatchEvent(new CustomEvent('updated'))
270
- history.back()
316
+ this._clearView()
317
+ await this._fetchInventories()
271
318
  }
272
319
  } else {
273
320
  this._openSelectLocationPopup()
@@ -278,6 +325,46 @@ class PopupReverseKittingTemplate extends localize(i18next)(LitElement) {
278
325
  }
279
326
  }
280
327
 
328
+ async _undoInventory() {
329
+ try {
330
+ this._validateSelectedInventory()
331
+ const result = await CustomAlert({
332
+ title: i18next.t('title.are_you_sure'),
333
+ text: i18next.t('text.undo_x', { state: { x: this._palletId } }),
334
+ confirmButton: { text: i18next.t('button.confirm') },
335
+ cancelButton: { text: i18next.t('button.cancel') }
336
+ })
337
+
338
+ if (!result.value) {
339
+ return
340
+ }
341
+
342
+ let response = await client.mutate({
343
+ mutation: gql`
344
+ mutation undoReverseKittingInventory($reverseKittingOIName: String!, $palletId: String!) {
345
+ undoReverseKittingInventory(reverseKittingOIName: $reverseKittingOIName, palletId: $palletId)
346
+ }
347
+ `,
348
+ variables: {
349
+ reverseKittingOIName: this.reverseKittingOIName,
350
+ palletId: this._palletId.trim()
351
+ }
352
+ })
353
+
354
+ if (!response.errors) {
355
+ this._clearView()
356
+ await this._fetchInventories()
357
+ }
358
+ } catch (e) {
359
+ this._showToast(e)
360
+ }
361
+ }
362
+
363
+ _confirmInventory() {
364
+ this.dispatchEvent(new CustomEvent('updated', { detail: {} }))
365
+ history.back()
366
+ }
367
+
281
368
  _fillUpForm(form, data) {
282
369
  for (let key in data) {
283
370
  Array.from(form.querySelectorAll('input')).forEach(field => {
@@ -299,12 +386,25 @@ class PopupReverseKittingTemplate extends localize(i18next)(LitElement) {
299
386
  }
300
387
  }
301
388
 
389
+ _clearView() {
390
+ this.inputForm.reset()
391
+ this._palletId = ''
392
+ this._locationCode = ''
393
+ }
394
+
302
395
  async _validateReverseKitting() {
303
396
  if (!this.palletInput.value) {
304
397
  this._focusOnPalletInput()
305
398
  throw new Error(i18next.t('text.lot_id_is_empty'))
306
399
  }
307
400
 
401
+ if (!this.qtyInput.value) {
402
+ this._focusOnQtyInput()
403
+ throw new Error(i18next.t('text.qty_is_empty'))
404
+ } else {
405
+ if (!this.qtyInput.checkValidity()) throw new Error(i18next.t('text.qty_invalid'))
406
+ }
407
+
308
408
  // 4. location code existing
309
409
  if (!this.locationInput.value) {
310
410
  this._focusOnLocationInput()
@@ -327,6 +427,10 @@ class PopupReverseKittingTemplate extends localize(i18next)(LitElement) {
327
427
  }
328
428
  }
329
429
 
430
+ _validateSelectedInventory() {
431
+ if (!this._selectedInventory) throw new Error(i18next.t('text.target_does_not_selected'))
432
+ }
433
+
330
434
  async _fetchLocations(zone, row, column) {
331
435
  const filters = [
332
436
  {
@@ -420,6 +524,10 @@ class PopupReverseKittingTemplate extends localize(i18next)(LitElement) {
420
524
  setTimeout(() => this.palletInput.focus(), 100)
421
525
  }
422
526
 
527
+ _focusOnQtyInput() {
528
+ setTimeout(() => this.qtyInput.focus(), 100)
529
+ }
530
+
423
531
  _focusOnLocationInput() {
424
532
  setTimeout(() => this.locationInput.focus(), 100)
425
533
  }
@@ -1,14 +1,11 @@
1
- import '@things-factory/grist-ui'
2
-
3
- import gql from 'graphql-tag'
4
- import { css, html, LitElement } from 'lit-element'
5
- import { connect } from 'pwa-helpers/connect-mixin'
6
-
7
1
  import { DirectPrinter } from '@things-factory/barcode-base'
2
+ import '@things-factory/grist-ui'
8
3
  import { i18next, localize } from '@things-factory/i18n-base'
9
4
  import { client, store } from '@things-factory/shell'
10
5
  import { gqlBuilder, isMobileDevice } from '@things-factory/utils'
11
-
6
+ import gql from 'graphql-tag'
7
+ import { css, html, LitElement } from 'lit-element'
8
+ import { connect } from 'pwa-helpers/connect-mixin'
12
9
  import { PALLET_LABEL_SETTING_KEY } from '../constants'
13
10
 
14
11
  class VasPalletLabelPopup extends connect(store)(localize(i18next)(LitElement)) {
@@ -262,7 +259,7 @@ class VasPalletLabelPopup extends connect(store)(localize(i18next)(LitElement))
262
259
  ]
263
260
  const response = await client.query({
264
261
  query: gql`
265
- query products($filters: [Filter!]) {
262
+ query products($filters: [Filter]) {
266
263
  products(filters: $filters) {
267
264
  items {
268
265
  sku
package/client/route.js CHANGED
@@ -212,6 +212,18 @@ export default function route(page) {
212
212
  import('./pages/order/release-order/bulk-print-packing-list')
213
213
  return page
214
214
 
215
+ case 'create_loading_manifest':
216
+ import('./pages/manifest/create-loading-manifest')
217
+ return page
218
+
219
+ case 'loading_manifest_list':
220
+ import('./pages/manifest/loading-manifest-list')
221
+ return page
222
+
223
+ case 'loading_manifest_detail':
224
+ import('./pages/manifest/loading-manifest-detail')
225
+ return page
226
+
215
227
  /**
216
228
  * GRN Menus Section
217
229
  */
@@ -452,6 +464,10 @@ export default function route(page) {
452
464
  import('./pages/report/outbound-order-details-report')
453
465
  return page
454
466
 
467
+ case 'product_label_report':
468
+ import('./pages/report/product-label-report')
469
+ return page
470
+
455
471
  /**
456
472
  * Custom ELCCL Menus Section
457
473
  */
@@ -479,6 +495,13 @@ export default function route(page) {
479
495
  import('./pages/report/custom-elccl/elccl-delivery-order-summary')
480
496
  return page
481
497
 
498
+ /**
499
+ * Support
500
+ */
501
+ case 'inventory_comparison':
502
+ import('./pages/support/inventory-comparison')
503
+ return page
504
+
482
505
  /** Custom VAS */
483
506
  case 'reverse_kitting_orders':
484
507
  import('./pages/order/reverse-kitting-order/reverse-kitting-order-list')
@@ -491,5 +514,10 @@ export default function route(page) {
491
514
  case 'execute_reverse_kitting':
492
515
  import('./pages/vas/reverse-kitting/execute-reverse-kitting')
493
516
  return page
517
+
518
+ /* Bulk Operations */
519
+ case 'bulk_operation':
520
+ import('./pages/bulk-operation/bulk-operation')
521
+ return page
494
522
  }
495
523
  }