@things-factory/operato-wms 5.0.13 → 6.0.0-alpha.1

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 (206) hide show
  1. package/client/pages/bulk-operation/bulk-operation.js +96 -8
  2. package/client/pages/bulk-operation/validate-gan-popup.js +37 -27
  3. package/client/pages/bulk-operation/validate-ro-popup.js +40 -0
  4. package/client/pages/components/select-inventory-popup.js +633 -0
  5. package/client/pages/constants/order.js +2 -1
  6. package/client/pages/inbound/pallet-label-popup.js +2 -0
  7. package/client/pages/inbound/select-product-batch.js +7 -1
  8. package/client/pages/inbound/undo-unload-popup.js +37 -21
  9. package/client/pages/inbound/unload-product.js +147 -59
  10. package/client/pages/inbound/worksheet-putaway.js +1 -1
  11. package/client/pages/inbound/worksheet-unloading.js +11 -7
  12. package/client/pages/inventory/inventory-adjustment.js +261 -238
  13. package/client/pages/inventory/inventory-by-product-detail.js +99 -92
  14. package/client/pages/inventory/inventory-by-product.js +170 -68
  15. package/client/pages/inventory/onhand-inventory.js +10 -12
  16. package/client/pages/inventory/serial-number-list-popup.js +36 -5
  17. package/client/pages/inventory-check/inspecting-product.js +1 -1
  18. package/client/pages/manifest/create-loading-manifest.js +47 -22
  19. package/client/pages/manifest/dispatcher-verification-popup.js +24 -13
  20. package/client/pages/manifest/loading-manifest-detail.js +311 -46
  21. package/client/pages/manifest/loading-manifest-list.js +86 -13
  22. package/client/pages/order/arrival-notice/arrival-notice-detail.js +305 -52
  23. package/client/pages/order/arrival-notice/arrival-notice-list.js +20 -1
  24. package/client/pages/order/arrival-notice/create-arrival-notice.js +2 -2
  25. package/client/pages/order/goods-received-note/received-note-detail.js +187 -15
  26. package/client/pages/order/release-order/b2b/b2b-order-list.js +76 -80
  27. package/client/pages/order/release-order/b2c/b2c-order-requests.js +148 -123
  28. package/client/pages/order/release-order/batch-picking-popup.js +11 -0
  29. package/client/pages/order/release-order/create-release-order.js +762 -250
  30. package/client/pages/order/release-order/release-extra-product-popup.js +10 -3
  31. package/client/pages/order/release-order/release-order-detail.js +897 -215
  32. package/client/pages/order/transport-order/delivery-note-popup.js +1050 -107
  33. package/client/pages/order/transport-order/print-delivery-note.js +214 -33
  34. package/client/pages/order/transport-order/upload-delivery-note.js +6 -4
  35. package/client/pages/order/transport-order/view-delivery-note.js +0 -1
  36. package/client/pages/outbound/generate-worksheet-popup.js +374 -0
  37. package/client/pages/outbound/inventory-reassign-popup.js +1097 -0
  38. package/client/pages/outbound/loading-product.js +88 -78
  39. package/client/pages/outbound/merged-outbound-worksheet.js +1 -1
  40. package/client/pages/outbound/packing-product.js +193 -82
  41. package/client/pages/outbound/packing-worksheet-list.js +10 -9
  42. package/client/pages/outbound/picking-product.js +979 -905
  43. package/client/pages/outbound/route-label-popup.js +283 -191
  44. package/client/pages/outbound/serial-number-popup.js +1 -0
  45. package/client/pages/outbound/sorting-product.js +12 -12
  46. package/client/pages/outbound/worksheet-batch-picking.js +39 -5
  47. package/client/pages/outbound/worksheet-packing.js +17 -4
  48. package/client/pages/outbound/worksheet-picking.js +45 -6
  49. package/client/pages/report/inbound-serial-number-report.js +86 -9
  50. package/client/pages/report/inventory-report.js +10 -0
  51. package/client/pages/report/inventory-summary-report.js +28 -19
  52. package/client/pages/report/outbound-order-details-report.js +204 -43
  53. package/client/pages/report/outbound-serial-number-report.js +87 -9
  54. package/client/pages/report/release-inventory-report.js +503 -0
  55. package/client/route.js +5 -0
  56. package/client/util/index.js +2 -0
  57. package/client/util/page-settings.js +43 -0
  58. package/client/util/toast.js +10 -0
  59. package/dist-server/graphql/resolvers/board-setting/board-settings.js +3 -3
  60. package/dist-server/graphql/resolvers/board-setting/board-settings.js.map +1 -1
  61. package/dist-server/graphql/resolvers/custom/elccl/elccl-daily-collection-report.js +2 -2
  62. package/dist-server/graphql/resolvers/custom/elccl/elccl-daily-collection-report.js.map +1 -1
  63. package/dist-server/graphql/resolvers/custom/elccl/elccl-daily-order-inventory-report.js +1 -1
  64. package/dist-server/graphql/resolvers/custom/elccl/elccl-daily-order-inventory-report.js.map +1 -1
  65. package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-pallet-detail-report.js +2 -2
  66. package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-pallet-detail-report.js.map +1 -1
  67. package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-report.js +9 -10
  68. package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-report.js.map +1 -1
  69. package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-summary-report.js +2 -2
  70. package/dist-server/graphql/resolvers/custom/elccl/elccl-inventory-history-summary-report.js.map +1 -1
  71. package/dist-server/graphql/resolvers/custom/elccl/elccl-onhand-inventory-counter.js +6 -4
  72. package/dist-server/graphql/resolvers/custom/elccl/elccl-onhand-inventory-counter.js.map +1 -1
  73. package/dist-server/graphql/resolvers/custom/kimeda/kimeda-onhand-inventory-counter.js +6 -4
  74. package/dist-server/graphql/resolvers/custom/kimeda/kimeda-onhand-inventory-counter.js.map +1 -1
  75. package/dist-server/graphql/resolvers/dashboard/arrival-notices-by-status.js +21 -10
  76. package/dist-server/graphql/resolvers/dashboard/arrival-notices-by-status.js.map +1 -1
  77. package/dist-server/graphql/resolvers/dashboard/collection-orders-by-status.js +1 -2
  78. package/dist-server/graphql/resolvers/dashboard/collection-orders-by-status.js.map +1 -1
  79. package/dist-server/graphql/resolvers/dashboard/delivery-orders-by-status.js +1 -2
  80. package/dist-server/graphql/resolvers/dashboard/delivery-orders-by-status.js.map +1 -1
  81. package/dist-server/graphql/resolvers/dashboard/index.js +2 -1
  82. package/dist-server/graphql/resolvers/dashboard/index.js.map +1 -1
  83. package/dist-server/graphql/resolvers/dashboard/inventory-expiry-monitor.js +17 -1
  84. package/dist-server/graphql/resolvers/dashboard/inventory-expiry-monitor.js.map +1 -1
  85. package/dist-server/graphql/resolvers/dashboard/outbound-order-by-status.js +113 -75
  86. package/dist-server/graphql/resolvers/dashboard/outbound-order-by-status.js.map +1 -1
  87. package/dist-server/graphql/resolvers/dashboard/release-goods-by-status.js +21 -10
  88. package/dist-server/graphql/resolvers/dashboard/release-goods-by-status.js.map +1 -1
  89. package/dist-server/graphql/resolvers/dashboard/unit-inbounded-outbounded.js +56 -0
  90. package/dist-server/graphql/resolvers/dashboard/unit-inbounded-outbounded.js.map +1 -0
  91. package/dist-server/graphql/resolvers/index.js +5 -4
  92. package/dist-server/graphql/resolvers/index.js.map +1 -1
  93. package/dist-server/graphql/resolvers/inventory-comparison/inventory-comparison-list.js.map +1 -1
  94. package/dist-server/graphql/resolvers/opa-menu/opa-menus.js +8 -7
  95. package/dist-server/graphql/resolvers/opa-menu/opa-menus.js.map +1 -1
  96. package/dist-server/graphql/resolvers/{extra → other}/add-release-good-products.js +59 -8
  97. package/dist-server/graphql/resolvers/other/add-release-good-products.js.map +1 -0
  98. package/dist-server/graphql/resolvers/{extra → other}/index.js +3 -1
  99. package/dist-server/graphql/resolvers/other/index.js.map +1 -0
  100. package/dist-server/graphql/resolvers/other/page-settings.js +87 -0
  101. package/dist-server/graphql/resolvers/other/page-settings.js.map +1 -0
  102. package/dist-server/graphql/resolvers/reports/costing-report.js +4 -4
  103. package/dist-server/graphql/resolvers/reports/costing-report.js.map +1 -1
  104. package/dist-server/graphql/resolvers/reports/inbound-order-details-report.js +3 -3
  105. package/dist-server/graphql/resolvers/reports/inbound-order-details-report.js.map +1 -1
  106. package/dist-server/graphql/resolvers/reports/inbound-serial-number-report.js +36 -7
  107. package/dist-server/graphql/resolvers/reports/inbound-serial-number-report.js.map +1 -1
  108. package/dist-server/graphql/resolvers/reports/index.js +2 -1
  109. package/dist-server/graphql/resolvers/reports/index.js.map +1 -1
  110. package/dist-server/graphql/resolvers/reports/outbound-order-details-report.js +69 -30
  111. package/dist-server/graphql/resolvers/reports/outbound-order-details-report.js.map +1 -1
  112. package/dist-server/graphql/resolvers/reports/outbound-serial-number-report.js +36 -11
  113. package/dist-server/graphql/resolvers/reports/outbound-serial-number-report.js.map +1 -1
  114. package/dist-server/graphql/resolvers/reports/product-label-report.js +3 -3
  115. package/dist-server/graphql/resolvers/reports/product-label-report.js.map +1 -1
  116. package/dist-server/graphql/resolvers/reports/release-inventory-report.js +180 -0
  117. package/dist-server/graphql/resolvers/reports/release-inventory-report.js.map +1 -0
  118. package/dist-server/graphql/resolvers/shipping-provider/shipping-providers.js +2 -2
  119. package/dist-server/graphql/resolvers/shipping-provider/shipping-providers.js.map +1 -1
  120. package/dist-server/graphql/resolvers/warehouse-inventory-adjustment/warehouse-intentory-adjustment.js +1 -1
  121. package/dist-server/graphql/resolvers/warehouse-inventory-adjustment/warehouse-intentory-adjustment.js.map +1 -1
  122. package/dist-server/graphql/types/dashboard/index.js +1 -0
  123. package/dist-server/graphql/types/dashboard/index.js.map +1 -1
  124. package/dist-server/graphql/types/index.js +7 -2
  125. package/dist-server/graphql/types/index.js.map +1 -1
  126. package/dist-server/graphql/types/other/index.js +19 -0
  127. package/dist-server/graphql/types/other/index.js.map +1 -0
  128. package/dist-server/graphql/types/other/page-setting.js +34 -0
  129. package/dist-server/graphql/types/other/page-setting.js.map +1 -0
  130. package/dist-server/graphql/types/reports/index.js +6 -1
  131. package/dist-server/graphql/types/reports/index.js.map +1 -1
  132. package/dist-server/graphql/types/reports/outbound-order-details-report.js +17 -1
  133. package/dist-server/graphql/types/reports/outbound-order-details-report.js.map +1 -1
  134. package/dist-server/graphql/types/reports/release-inventory-report-list.js +12 -0
  135. package/dist-server/graphql/types/reports/release-inventory-report-list.js.map +1 -0
  136. package/dist-server/graphql/types/reports/release-inventory-report.js +27 -0
  137. package/dist-server/graphql/types/reports/release-inventory-report.js.map +1 -0
  138. package/dist-server/migrations/1568858861188-SeedSetting.js +5 -6
  139. package/dist-server/migrations/1568858861188-SeedSetting.js.map +1 -1
  140. package/dist-server/migrations/1623308919899-SeedLocationRecommendSetting.js +1 -1
  141. package/dist-server/migrations/1623308919899-SeedLocationRecommendSetting.js.map +1 -1
  142. package/dist-server/migrations/1623381200659-SeedStoringRule.js +1 -1
  143. package/dist-server/migrations/1623381200659-SeedStoringRule.js.map +1 -1
  144. package/dist-server/tsconfig.tsbuildinfo +1 -1
  145. package/dist-server/utils/report-query-util.js +5 -2
  146. package/dist-server/utils/report-query-util.js.map +1 -1
  147. package/helps/release-note.ko.md +8 -20
  148. package/helps/release-note.md +8 -20
  149. package/helps/release-note.ms.md +8 -20
  150. package/helps/release-note.zh.md +8 -20
  151. package/package.json +42 -42
  152. package/server/graphql/resolvers/board-setting/board-settings.ts +4 -6
  153. package/server/graphql/resolvers/custom/elccl/elccl-daily-collection-report.ts +4 -5
  154. package/server/graphql/resolvers/custom/elccl/elccl-daily-order-inventory-report.ts +9 -10
  155. package/server/graphql/resolvers/custom/elccl/elccl-inventory-history-pallet-detail-report.ts +4 -5
  156. package/server/graphql/resolvers/custom/elccl/elccl-inventory-history-report.ts +17 -19
  157. package/server/graphql/resolvers/custom/elccl/elccl-inventory-history-summary-report.ts +10 -8
  158. package/server/graphql/resolvers/custom/elccl/elccl-onhand-inventory-counter.ts +9 -9
  159. package/server/graphql/resolvers/custom/kimeda/kimeda-onhand-inventory-counter.ts +9 -9
  160. package/server/graphql/resolvers/dashboard/arrival-notices-by-status.ts +23 -14
  161. package/server/graphql/resolvers/dashboard/collection-orders-by-status.ts +4 -5
  162. package/server/graphql/resolvers/dashboard/delivery-orders-by-status.ts +4 -5
  163. package/server/graphql/resolvers/dashboard/index.ts +3 -1
  164. package/server/graphql/resolvers/dashboard/inventory-expiry-monitor.ts +18 -6
  165. package/server/graphql/resolvers/dashboard/outbound-order-by-status.ts +114 -81
  166. package/server/graphql/resolvers/dashboard/release-goods-by-status.ts +23 -14
  167. package/server/graphql/resolvers/dashboard/unit-inbounded-outbounded.ts +61 -0
  168. package/server/graphql/resolvers/index.ts +5 -4
  169. package/server/graphql/resolvers/inventory-comparison/inventory-comparison-list.ts +11 -9
  170. package/server/graphql/resolvers/opa-menu/opa-menus.ts +7 -6
  171. package/server/graphql/resolvers/{extra → other}/add-release-good-products.ts +73 -12
  172. package/server/graphql/resolvers/other/index.ts +10 -0
  173. package/server/graphql/resolvers/other/page-settings.ts +105 -0
  174. package/server/graphql/resolvers/reports/costing-report.ts +8 -10
  175. package/server/graphql/resolvers/reports/inbound-order-details-report.ts +7 -9
  176. package/server/graphql/resolvers/reports/inbound-serial-number-report.ts +41 -13
  177. package/server/graphql/resolvers/reports/index.ts +3 -1
  178. package/server/graphql/resolvers/reports/outbound-order-details-report.ts +76 -38
  179. package/server/graphql/resolvers/reports/outbound-serial-number-report.ts +42 -18
  180. package/server/graphql/resolvers/reports/product-label-report.ts +4 -6
  181. package/server/graphql/resolvers/reports/release-inventory-report.ts +201 -0
  182. package/server/graphql/resolvers/shipping-provider/shipping-providers.ts +3 -5
  183. package/server/graphql/resolvers/warehouse-inventory-adjustment/warehouse-intentory-adjustment.ts +10 -10
  184. package/server/graphql/types/dashboard/index.ts +1 -0
  185. package/server/graphql/types/index.ts +8 -2
  186. package/server/graphql/types/other/index.ts +19 -0
  187. package/server/graphql/types/other/page-setting.ts +33 -0
  188. package/server/graphql/types/reports/index.ts +6 -1
  189. package/server/graphql/types/reports/outbound-order-details-report.ts +17 -1
  190. package/server/graphql/types/reports/release-inventory-report-list.ts +8 -0
  191. package/server/graphql/types/reports/release-inventory-report.ts +23 -0
  192. package/server/migrations/1568858861188-SeedSetting.ts +4 -4
  193. package/server/migrations/1623308919899-SeedLocationRecommendSetting.ts +3 -2
  194. package/server/migrations/1623381200659-SeedStoringRule.ts +3 -2
  195. package/server/utils/report-query-util.ts +5 -2
  196. package/things-factory.config.js +4 -0
  197. package/translations/en.json +148 -27
  198. package/translations/ko.json +185 -105
  199. package/translations/ms.json +183 -98
  200. package/translations/zh.json +197 -112
  201. package/dist-server/graphql/resolvers/extra/add-release-good-products.js.map +0 -1
  202. package/dist-server/graphql/resolvers/extra/index.js.map +0 -1
  203. package/dist-server/graphql/types/extra/index.js +0 -11
  204. package/dist-server/graphql/types/extra/index.js.map +0 -1
  205. package/server/graphql/resolvers/extra/index.ts +0 -5
  206. package/server/graphql/types/extra/index.ts +0 -7
@@ -0,0 +1,633 @@
1
+ import '@things-factory/grist-ui'
2
+
3
+ import gql from 'graphql-tag'
4
+ import { css, html, LitElement } from 'lit-element'
5
+
6
+ import { getCodeByName } from '@things-factory/code-base'
7
+ import { i18next, localize } from '@things-factory/i18n-base'
8
+ import { client } from '@things-factory/shell'
9
+ import { ScrollbarStyles } from '@things-factory/styles'
10
+ import { isMobileDevice } from '@things-factory/utils'
11
+
12
+ import { GROUP_TYPES, INVENTORY_STATUS } from '../constants'
13
+
14
+ class SelectInventoryPopUp extends localize(i18next)(LitElement) {
15
+ static get properties() {
16
+ return {
17
+ productConfig: Object,
18
+ data: Object,
19
+ bizplaceId: String,
20
+ searchFields: Array,
21
+ selectMultipleProducts: Boolean,
22
+ switchTypePane: String,
23
+ recall: Boolean,
24
+ inventoryData: Object
25
+ }
26
+ }
27
+
28
+ static get styles() {
29
+ return [
30
+ ScrollbarStyles,
31
+ css`
32
+ :host {
33
+ display: flex;
34
+ flex-direction: column;
35
+ overflow: hidden;
36
+ background-color: white;
37
+ }
38
+
39
+ search-form {
40
+ overflow: visible;
41
+ }
42
+ .grist {
43
+ display: flex;
44
+ flex-direction: column;
45
+ flex: 1;
46
+ overflow-y: auto;
47
+ }
48
+ .grist-container {
49
+ overflow-y: hidden;
50
+ display: flex;
51
+ flex: 1;
52
+ }
53
+ data-grist {
54
+ overflow-y: hidden;
55
+ flex: 1;
56
+ }
57
+ h2 {
58
+ padding: var(--subtitle-padding);
59
+ font: var(--subtitle-font);
60
+ color: var(--subtitle-text-color);
61
+ border-bottom: var(--subtitle-border-bottom);
62
+ }
63
+ .grist h2 {
64
+ font: var(--grist-title-font);
65
+ }
66
+ .button-container {
67
+ padding: var(--button-container-padding);
68
+ margin: var(--button-container-margin);
69
+ text-align: var(--button-container-align);
70
+ background-color: var(--button-container-background);
71
+ height: var(--button-container-height);
72
+ }
73
+ `
74
+ ]
75
+ }
76
+
77
+ render() {
78
+ return html`
79
+ <search-form
80
+ id="search-form"
81
+ .fields=${this.searchFields}
82
+ @submit=${() => this.productGrist.fetch()}
83
+ ></search-form>
84
+
85
+ <div class="grist-container">
86
+ <div class="grist">
87
+ <data-grist
88
+ id="product"
89
+ .mode=${isMobileDevice() ? 'LIST' : 'GRID'}
90
+ .config=${this.productConfig}
91
+ .fetchHandler=${this.fetchProducts.bind(this)}
92
+ ></data-grist>
93
+ </div>
94
+ </div>
95
+
96
+ <div class="button-container">
97
+ <mwc-button
98
+ @click="${this.selectProduct.bind(this)}"
99
+ label="${`${i18next.t('button.select')}`}"
100
+ raised
101
+ ></mwc-button>
102
+ </div>
103
+ `
104
+ }
105
+
106
+ get productGrist() {
107
+ return this.shadowRoot.querySelector('data-grist#product')
108
+ }
109
+
110
+ get searchForm() {
111
+ return this.shadowRoot.querySelector('search-form')
112
+ }
113
+
114
+ async firstUpdated() {
115
+ const paneType = this.switchTypePane
116
+ const _packingType = await getCodeByName('PACKING_TYPES')
117
+ const { SINGLE, BUNDLE } = GROUP_TYPES
118
+ const _groupTypes = [SINGLE, BUNDLE]
119
+
120
+ if (paneType === 'product') {
121
+ this.searchFields = [
122
+ {
123
+ label: i18next.t('field.batch_id'),
124
+ name: 'batchId',
125
+ props: { searchOper: 'i_like' }
126
+ },
127
+ {
128
+ label: i18next.t('field.product_info'),
129
+ name: 'productName',
130
+ props: { searchOper: 'i_like' }
131
+ },
132
+ {
133
+ label: i18next.t('field.packing_type'),
134
+ name: 'packingType',
135
+ type: 'select',
136
+ options: [
137
+ { value: '' },
138
+ ..._packingType.map(packingType => {
139
+ return {
140
+ name: packingType.name,
141
+ value: packingType.name
142
+ }
143
+ })
144
+ ],
145
+ props: { searchOper: 'eq' }
146
+ },
147
+ {
148
+ label: i18next.t('field.group_type'),
149
+ name: 'groupType',
150
+ type: 'select',
151
+ options: [
152
+ { value: '' },
153
+ ..._groupTypes.map(groupType => {
154
+ return {
155
+ name: groupType.value,
156
+ value: groupType.value
157
+ }
158
+ })
159
+ ],
160
+ props: { searchOper: 'eq' }
161
+ }
162
+ ]
163
+
164
+ this.productConfig = {
165
+ pagination: { pages: [10, 20, 50, 100] },
166
+ rows: {
167
+ appendable: false,
168
+ selectable: { multiple: this.selectMultipleProducts ? this.selectMultipleProducts : false }
169
+ },
170
+ columns: [
171
+ { type: 'gutter', gutterName: 'sequence' },
172
+ {
173
+ type: 'gutter',
174
+ gutterName: 'row-selector',
175
+ multiple: this.selectMultipleProducts ? this.selectMultipleProducts : false,
176
+ label: true
177
+ },
178
+ {
179
+ type: 'string',
180
+ name: 'productId',
181
+ hidden: true,
182
+ label: true
183
+ },
184
+ { type: 'string', name: 'remainUomValue', hidden: true, label: true },
185
+ {
186
+ type: 'string',
187
+ name: 'batchId',
188
+ header: i18next.t('field.batch_id'),
189
+ sortable: true,
190
+ label: true,
191
+ width: 120
192
+ },
193
+ {
194
+ type: 'string',
195
+ name: 'batchIdRef',
196
+ header: i18next.t('field.batch_no_ref'),
197
+ label: true,
198
+ width: 120
199
+ },
200
+ {
201
+ type: 'string',
202
+ name: 'productSKU',
203
+ header: i18next.t('field.sku'),
204
+ sortable: true,
205
+ label: true,
206
+ width: 150
207
+ },
208
+ {
209
+ type: 'string',
210
+ name: 'productName',
211
+ header: i18next.t('field.product_info'),
212
+ sortable: true,
213
+ label: true,
214
+ width: 220
215
+ },
216
+ {
217
+ type: 'string',
218
+ name: 'productBrand',
219
+ header: i18next.t('field.brand'),
220
+ label: true,
221
+ width: 180
222
+ },
223
+ {
224
+ type: 'string',
225
+ name: 'packingType',
226
+ header: i18next.t('field.packing_type'),
227
+ label: true,
228
+ width: 100
229
+ },
230
+ {
231
+ type: 'string',
232
+ name: 'packingSize',
233
+ header: i18next.t('field.packing_size'),
234
+ label: true,
235
+ width: 120
236
+ },
237
+ {
238
+ type: 'string',
239
+ name: 'uom',
240
+ header: i18next.t('field.uom'),
241
+ label: true,
242
+ width: 120
243
+ },
244
+ {
245
+ type: 'string',
246
+ name: 'remainQty',
247
+ header: i18next.t('field.remain_qty'),
248
+ label: true,
249
+ width: 120
250
+ },
251
+ {
252
+ type: 'string',
253
+ name: 'remainUomValueWithUom',
254
+ header: i18next.t('field.remain_uom_value'),
255
+ label: true,
256
+ width: 120
257
+ },
258
+ {
259
+ type: 'string',
260
+ name: 'groupType',
261
+ header: i18next.t('field.group_type'),
262
+ label: true,
263
+ width: 120
264
+ }
265
+ ]
266
+ }
267
+ } else {
268
+ this.searchFields = [
269
+ {
270
+ label: i18next.t('field.batch_id'),
271
+ name: 'batchId',
272
+ props: { searchOper: 'i_like' }
273
+ },
274
+ {
275
+ label: i18next.t('field.product_info'),
276
+ name: 'productName',
277
+ props: { searchOper: 'i_like' }
278
+ },
279
+ {
280
+ label: i18next.t('field.location'),
281
+ name: 'locationName',
282
+ props: { searchOper: 'i_like' }
283
+ }
284
+ ]
285
+
286
+ this.productConfig = {
287
+ pagination: { pages: [10, 20, 50, 100] },
288
+ rows: {
289
+ appendable: false,
290
+ selectable: { multiple: this.selectMultipleProducts ? this.selectMultipleProducts : false }
291
+ },
292
+ columns: [
293
+ { type: 'gutter', gutterName: 'sequence' },
294
+ {
295
+ type: 'gutter',
296
+ gutterName: 'row-selector',
297
+ multiple: this.selectMultipleProducts ? this.selectMultipleProducts : false
298
+ },
299
+ {
300
+ type: 'string',
301
+ name: 'productId',
302
+ hidden: true,
303
+ label: true
304
+ },
305
+ { type: 'string', name: 'remainUomValue', hidden: true, label: true },
306
+ {
307
+ type: 'string',
308
+ name: 'palletId',
309
+ header: i18next.t('field.lot_id'),
310
+ label: true,
311
+ width: 120
312
+ },
313
+ {
314
+ type: 'string',
315
+ name: 'cartonId',
316
+ header: i18next.t('field.carton_id'),
317
+ label: true,
318
+ width: 120
319
+ },
320
+ {
321
+ type: 'string',
322
+ name: 'productSKU',
323
+ header: i18next.t('field.sku'),
324
+ sortable: true,
325
+ label: true,
326
+ width: 150
327
+ },
328
+ {
329
+ type: 'string',
330
+ name: 'productName',
331
+ header: i18next.t('field.product_name'),
332
+ sortable: true,
333
+ label: true,
334
+ width: 220
335
+ },
336
+ {
337
+ type: 'string',
338
+ name: 'productBrand',
339
+ header: i18next.t('field.brand'),
340
+ label: true,
341
+ width: 180
342
+ },
343
+ {
344
+ type: 'string',
345
+ name: 'batchId',
346
+ header: i18next.t('field.batch_id'),
347
+ sortable: true,
348
+ label: true,
349
+ width: 120
350
+ },
351
+ {
352
+ type: 'string',
353
+ name: 'location',
354
+ header: i18next.t('field.location'),
355
+ label: true,
356
+ width: 120
357
+ },
358
+ {
359
+ type: 'string',
360
+ name: 'packingType',
361
+ header: i18next.t('field.packing_type'),
362
+ label: true,
363
+ width: 100
364
+ },
365
+ {
366
+ type: 'string',
367
+ name: 'packingSize',
368
+ header: i18next.t('field.packing_size'),
369
+ label: true,
370
+ width: 120
371
+ },
372
+ {
373
+ type: 'string',
374
+ name: 'uom',
375
+ header: i18next.t('field.uom'),
376
+ label: true,
377
+ width: 120
378
+ },
379
+ {
380
+ type: 'string',
381
+ name: 'remainQty',
382
+ header: i18next.t('field.remain_qty'),
383
+ label: true,
384
+ width: 120
385
+ },
386
+ {
387
+ type: 'string',
388
+ name: 'remainUomValueWithUom',
389
+ header: i18next.t('field.remain_uom_value'),
390
+ label: true,
391
+ width: 120
392
+ },
393
+ {
394
+ type: 'string',
395
+ name: 'batchIdRef',
396
+ header: i18next.t('field.batch_no_ref'),
397
+ label: true,
398
+ width: 120
399
+ },
400
+ {
401
+ type: 'string',
402
+ name: 'remark',
403
+ header: i18next.t('field.remark'),
404
+ label: true,
405
+ width: 120
406
+ }
407
+ ]
408
+ }
409
+ }
410
+ }
411
+
412
+ async fetchProducts({ page, limit, sorters = [] }) {
413
+ let filters = [...this.searchForm.queryFilters, { name: 'bizplace_id', operator: 'eq', value: this.bizplaceId }]
414
+ const pagination = { page, limit }
415
+ const sortings = sorters
416
+
417
+ const paneType = this.switchTypePane
418
+ const recall = this.recall
419
+
420
+ if (recall) {
421
+ filters.push({ name: 'recall', operator: '', value: recall })
422
+ }
423
+
424
+ if (paneType === 'product') {
425
+ const data = this.inventoryData.filter(res => res.batchId !== null)
426
+
427
+ if (data?.length > 0) {
428
+ const remapData = data.map(res => {
429
+ return {
430
+ batchId: res.batchId,
431
+ groupType: res.groupType,
432
+ packingType: res.packingType,
433
+ packingSize: res.packingSize,
434
+ productId: res.productId,
435
+ releaseQty: res.releaseQty,
436
+ releaseUomValue: res.releaseUomValue
437
+ }
438
+ })
439
+ filters.push({ name: 'batch_product', operator: 'notin', value: remapData })
440
+ }
441
+
442
+ const response = await client.query({
443
+ query: gql`
444
+ query inventoryProductGroup($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
445
+ inventoryProductGroup(filters: $filters, pagination: $pagination, sortings: $sortings) {
446
+ items {
447
+ id
448
+ productId
449
+ batchId
450
+ batchIdRef
451
+ groupType
452
+ packingSize
453
+ productBrand
454
+ productName
455
+ productSKU
456
+ packingType
457
+ remainQty
458
+ remainUomValue
459
+ remainUomValueWithUom
460
+ uom
461
+ }
462
+ total
463
+ }
464
+ }
465
+ `,
466
+ variables: { filters, pagination, sortings }
467
+ })
468
+
469
+ if (!response.errors) {
470
+ return {
471
+ total: response.data.inventoryProductGroup.total || 0,
472
+ records: response.data.inventoryProductGroup.items || []
473
+ }
474
+ }
475
+ } else {
476
+ filters.push({ name: 'status', operator: 'eq', value: INVENTORY_STATUS.STORED.value })
477
+
478
+ const data = this.inventoryData
479
+ if (data?.length > 0) {
480
+ filters.push({
481
+ name: 'id',
482
+ value: data.map(record => record.inventory.id),
483
+ operator: 'notin'
484
+ })
485
+ }
486
+ const response = await client.query({
487
+ query: gql`
488
+ query inventoriesByPallet($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
489
+ inventoriesByPallet(filters: $filters, pagination: $pagination, sortings: $sortings) {
490
+ items {
491
+ id
492
+ batchId
493
+ palletId
494
+ cartonId
495
+ productId
496
+ productSKU
497
+ productName
498
+ productBrand
499
+ palletId
500
+ location {
501
+ name
502
+ }
503
+ packingType
504
+ packingSize
505
+ uom
506
+ remainQty
507
+ remainUomValue
508
+ remainUomValueWithUom
509
+ batchIdRef
510
+ remark
511
+ }
512
+ total
513
+ }
514
+ }
515
+ `,
516
+ variables: { filters, pagination, sortings }
517
+ })
518
+
519
+ if (!response.errors) {
520
+ return {
521
+ total: response.data.inventoriesByPallet.total || 0,
522
+ records:
523
+ response.data.inventoriesByPallet.items.map(item => {
524
+ return {
525
+ ...item,
526
+ location: item.location.name
527
+ }
528
+ }) || []
529
+ }
530
+ }
531
+ }
532
+ }
533
+
534
+ selectProduct() {
535
+ const paneType = this.switchTypePane
536
+
537
+ if (this.selectMultipleProducts !== true) {
538
+ const selectedProduct = this.productGrist.selected[0]
539
+ if (selectedProduct) {
540
+ this.dispatchEvent(
541
+ new CustomEvent('selected', {
542
+ detail: {
543
+ productDetailId: selectedProduct.id,
544
+ packingType: selectedProduct.packingType,
545
+ uom: selectedProduct.uom,
546
+ uomValue: selectedProduct.uomValue,
547
+ productName: `${selectedProduct.name}(${selectedProduct.description}(${selectedProduct.sku}))`,
548
+ isError: false,
549
+ productBrand: selectedProduct.brand,
550
+ product: {
551
+ id: selectedProduct.productId,
552
+ name: selectedProduct.name,
553
+ sku: selectedProduct.sku,
554
+ packingType: selectedProduct.packingType,
555
+ packingSize: selectedProduct.packingSize,
556
+ primaryUnit: selectedProduct.uom,
557
+ primaryValue: selectedProduct.uomValue
558
+ }
559
+ }
560
+ })
561
+ )
562
+ history.back()
563
+ } else {
564
+ document.dispatchEvent(
565
+ new CustomEvent('notify', { detail: { message: i18next.t('text.product_is_not_selected') } })
566
+ )
567
+ }
568
+ } else {
569
+ const selectedMultipleProducts = this.productGrist.selected
570
+ if (selectedMultipleProducts) {
571
+ const multipleProducts = selectedMultipleProducts.map(itm => {
572
+ return {
573
+ productName:
574
+ paneType === 'product' ? `${itm.batchId}(${itm.productName})` : `${itm.batchId}(${itm.palletId})`,
575
+ productSKU: itm.productSKU,
576
+ product: { id: itm.productId, name: itm.productName },
577
+ uom: itm.uom,
578
+ uomValue: itm.uomValue,
579
+ productBrand: itm.productBrand,
580
+ packingType: itm.packingType,
581
+ packingSize: itm.packingSize,
582
+ remainQty: itm.remainQty,
583
+ remainUomValueWithUom: itm.remainUomValueWithUom,
584
+ productId: itm.productId,
585
+ remainUomValue: itm.remainUomValue,
586
+ batchId: itm.batchId,
587
+ batchIdRef: itm.batchIdRef,
588
+ groupType: itm.groupType,
589
+ location: itm.location,
590
+ releaseQty: 0,
591
+ releaseUomValue: 0,
592
+ palletId: itm.palletId,
593
+ inventory: {
594
+ id: itm.id,
595
+ productName:
596
+ paneType === 'product' ? `${itm.batchId}(${itm.productName})` : `${itm.batchId}(${itm.palletId})`,
597
+ productSKU: itm.productSKU,
598
+ uom: itm.uom,
599
+ uomValue: itm.uomValue,
600
+ productBrand: itm.productBrand,
601
+ packingType: itm.packingType,
602
+ packingSize: itm.packingSize,
603
+ remainQty: itm.remainQty,
604
+ remainUomValueWithUom: itm.remainUomValueWithUom,
605
+ productId: itm.productId,
606
+ remainUomValue: itm.remainUomValue,
607
+ batchId: itm.batchId,
608
+ batchIdRef: itm.batchIdRef,
609
+ groupType: itm.groupType,
610
+ location: itm.location,
611
+ palletId: itm.palletId
612
+ }
613
+ }
614
+ })
615
+
616
+ this.dispatchEvent(
617
+ new CustomEvent('selected', {
618
+ detail: {
619
+ multipleProducts
620
+ }
621
+ })
622
+ )
623
+ history.back()
624
+ } else {
625
+ document.dispatchEvent(
626
+ new CustomEvent('notify', { detail: { message: i18next.t('text.product_is_not_selected') } })
627
+ )
628
+ }
629
+ }
630
+ }
631
+ }
632
+
633
+ window.customElements.define('select-inventory-popup', SelectInventoryPopUp)
@@ -69,7 +69,8 @@ export const ORDER_STATUS = {
69
69
 
70
70
  export const MANIFEST_STATUS = {
71
71
  OPEN: { name: 'open', value: 'OPEN' },
72
- CLOSED: { name: 'closed', value: 'CLOSED' }
72
+ CLOSED: { name: 'closed', value: 'CLOSED' },
73
+ IN_QUEUE: { name: 'in_queue', value: 'IN_QUEUE' }
73
74
  }
74
75
 
75
76
  export const DISPATCHMENT_STATUS = {
@@ -157,6 +157,7 @@ class PalletLabelPopup extends connect(store)(localize(i18next)(LitElement)) {
157
157
  orderProductRemark
158
158
  purchaseOrderNo
159
159
  arrivalNoticeRefNo
160
+ arrivalNoticeNo
160
161
  }
161
162
  }
162
163
  `,
@@ -194,6 +195,7 @@ class PalletLabelPopup extends connect(store)(localize(i18next)(LitElement)) {
194
195
  searchParams.append('orderProductRemark', results[i].orderProductRemark)
195
196
  searchParams.append('purchaseOrderNo', results[i].purchaseOrderNo)
196
197
  searchParams.append('refNo', results[i].arrivalNoticeRefNo)
198
+ searchParams.append('ganNo', results[i].arrivalNoticeNo)
197
199
  try {
198
200
  const response = await fetch(`label-command/${labelId}?${searchParams.toString()}`, {
199
201
  method: 'GET'
@@ -69,10 +69,16 @@ class SelectProductBatch extends LitElement {
69
69
  this.config = {
70
70
  pagination: { infinite: true },
71
71
  rows: { selectable: { multiple: false }, appendable: false },
72
- list: { fields: ['batchId', 'product', 'packingType', 'packingSize'] },
72
+ list: { fields: ['sku', 'batchId', 'product', 'packingType', 'packingSize'] },
73
73
  columns: [
74
74
  { type: 'gutter', gutterName: 'sequence' },
75
75
  { type: 'gutter', gutterName: 'row-selector', multiple: false },
76
+ {
77
+ type: 'string',
78
+ name: 'sku',
79
+ header: i18next.t('field.sku'),
80
+ width: 120
81
+ },
76
82
  {
77
83
  type: 'string',
78
84
  name: 'batchId',