@things-factory/operato-wms 4.0.22 → 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 (101) hide show
  1. package/client/bootstrap.js +13 -6
  2. package/client/pages/adjustment/transfer-inventory.js +32 -6
  3. package/client/pages/billing/claim-chit/claim-chit-detail.js +32 -35
  4. package/client/pages/billing/claim-chit/claim-chit-list.js +17 -17
  5. package/client/pages/billing/claim-chit/create-claim-chit.js +39 -30
  6. package/client/pages/billing/transport-summary-report.js +21 -23
  7. package/client/pages/bulk-operation/bulk-operation.js +189 -64
  8. package/client/pages/bulk-operation/validate-gan-popup.js +391 -0
  9. package/client/pages/bulk-operation/validate-ro-popup.js +44 -54
  10. package/client/pages/components/popup-unloading.js +47 -34
  11. package/client/pages/components/select-product-popup.js +74 -27
  12. package/client/pages/components/worksheet-information-popup.js +100 -0
  13. package/client/pages/inbound/expiry-date-popup.js +2 -2
  14. package/client/pages/inbound/inbound-reusable-pallet.js +21 -19
  15. package/client/pages/inbound/palletizing-pallets-popup.js +10 -9
  16. package/client/pages/inbound/putaway-product.js +196 -235
  17. package/client/pages/inbound/putaway-worksheet-generate-popup.js +4 -4
  18. package/client/pages/inbound/undo-unload-popup.js +295 -0
  19. package/client/pages/inbound/unload-product.js +236 -646
  20. package/client/pages/inbound/unloaded-inventories-popup.js +129 -0
  21. package/client/pages/inbound/vas-selector.js +9 -8
  22. package/client/pages/inbound/worksheet-unloading.js +15 -11
  23. package/client/pages/inventory/inventory-adjustment.js +9 -10
  24. package/client/pages/inventory-check/check-inventory-popup.js +20 -18
  25. package/client/pages/inventory-check/cycle-count-recheck-popup.js +25 -15
  26. package/client/pages/inventory-check/inspecting-product.js +2 -2
  27. package/client/pages/inventory-check/inventory-check-list.js +30 -19
  28. package/client/pages/inventory-check/search-popup.js +15 -14
  29. package/client/pages/inventory-check/worksheet-cycle-count.js +17 -15
  30. package/client/pages/master/location-list.js +60 -52
  31. package/client/pages/master/pallet-list.js +34 -30
  32. package/client/pages/master/print-location-label.js +37 -36
  33. package/client/pages/master/product/product-list.js +1 -1
  34. package/client/pages/master/warehouse-list.js +33 -29
  35. package/client/pages/master/worker-list.js +30 -30
  36. package/client/pages/order/arrival-notice/arrival-notice-detail.js +409 -21
  37. package/client/pages/order/arrival-notice/assign-buffer-location.js +1 -1
  38. package/client/pages/order/arrival-notice/create-arrival-notice.js +89 -13
  39. package/client/pages/order/arrival-notice/duplicate-arrival-notice.js +90 -10
  40. package/client/pages/order/arrival-notice/edit-product-popup.js +2 -2
  41. package/client/pages/order/goods-received-note/customer-grn-list.js +9 -8
  42. package/client/pages/order/goods-received-note/customer-received-note.js +8 -7
  43. package/client/pages/order/goods-received-note/received-note-list.js +9 -8
  44. package/client/pages/order/release-order/b2b/b2b-order-list.js +78 -2
  45. package/client/pages/order/release-order/b2b/b2b-order-requests.js +32 -16
  46. package/client/pages/order/release-order/b2c/b2c-order-requests.js +49 -5
  47. package/client/pages/order/release-order/batch-generate-single-picking-worksheet-popup.js +314 -0
  48. package/client/pages/order/release-order/batch-picking-popup.js +19 -2
  49. package/client/pages/order/release-order/create-release-order.js +194 -89
  50. package/client/pages/order/release-order/release-extra-product-popup.js +3 -7
  51. package/client/pages/order/release-order/release-order-detail.js +390 -107
  52. package/client/pages/order/return-order/check-return-order.js +15 -13
  53. package/client/pages/order/return-order/create-return-order.js +3 -3
  54. package/client/pages/order/return-order/receive-return-order-requests.js +25 -22
  55. package/client/pages/order/return-order/rejected-return-order.js +8 -14
  56. package/client/pages/order/return-order/return-order-assign-buffer-location.js +16 -14
  57. package/client/pages/order/return-order/return-order-detail.js +35 -31
  58. package/client/pages/order/return-order/return-order-list.js +9 -8
  59. package/client/pages/order/return-order/return-order-requests.js +20 -18
  60. package/client/pages/order/reverse-kitting-order/reverse-kitting-order-list.js +9 -8
  61. package/client/pages/order/transfer-order/receive-transfer-order-request.js +67 -66
  62. package/client/pages/order/transfer-order/rejected-transfer-order.js +7 -6
  63. package/client/pages/order/transfer-order/transfer-order-detail.js +7 -6
  64. package/client/pages/order/transfer-order/transfer-order-requests.js +20 -18
  65. package/client/pages/order/transport-order/contact-point-selector-popup.js +20 -20
  66. package/client/pages/order/transport-order/create-delivery-order.js +1 -1
  67. package/client/pages/order/transport-order/delivery-note-popup.js +52 -46
  68. package/client/pages/order/transport-order/delivery-order-list.js +1 -1
  69. package/client/pages/order/transport-order/print-delivery-note.js +17 -16
  70. package/client/pages/order/transport-order/upload-delivery-note.js +21 -18
  71. package/client/pages/order/transport-order/view-delivery-note.js +19 -22
  72. package/client/pages/order/vas-order/create-vas-order.js +12 -11
  73. package/client/pages/order/vas-order/receive-vas-order.js +25 -22
  74. package/client/pages/order/vas-order/vas-order-detail.js +26 -23
  75. package/client/pages/order/vas-order/vas-order-list.js +9 -8
  76. package/client/pages/order/vas-order/vas-order-requests.js +11 -12
  77. package/client/pages/outbound/outbound-reusable-pallet.js +25 -33
  78. package/client/pages/outbound/packing-product.js +111 -236
  79. package/client/pages/outbound/picking-product.js +287 -380
  80. package/client/pages/outbound/single-outbound-worksheet.js +9 -8
  81. package/client/pages/outbound/sorting-product.js +66 -63
  82. package/client/pages/outbound/worksheet-loading.js +7 -3
  83. package/client/pages/outbound/worksheet-packing.js +3 -3
  84. package/client/pages/outbound/worksheet-picking.js +22 -18
  85. package/client/pages/report/job-sheet-list.js +9 -8
  86. package/client/pages/vas/print-product-label.js +17 -9
  87. package/client/route.js +16 -32
  88. package/dist-server/graphql/resolvers/reports/product-label-report.js +1 -0
  89. package/dist-server/graphql/resolvers/reports/product-label-report.js.map +1 -1
  90. package/package.json +65 -65
  91. package/server/graphql/resolvers/reports/product-label-report.ts +1 -0
  92. package/things-factory.config.js +0 -16
  93. package/translations/en.json +34 -2
  94. package/translations/ko.json +34 -3
  95. package/translations/ms.json +34 -3
  96. package/translations/zh.json +34 -3
  97. package/client/pages/inbound/location-selector.js +0 -224
  98. package/client/pages/master/picking-bin-list.js +0 -354
  99. package/client/pages/order/retail-replenishment-order/retail-replenishment-order-detail.js +0 -315
  100. package/client/pages/order/retail-replenishment-order/retail-replenishment-order-requests.js +0 -307
  101. package/client/pages/order/vas-order/rejected-vas-order.js +0 -300
@@ -1,6 +1,9 @@
1
1
  import '@things-factory/grist-ui'
2
2
  import '../../components/attachment-viewer'
3
3
  import '../../components/vas-templates'
4
+ import '../../components/popup-note'
5
+ import '../../inbound/carton-label-popup'
6
+ import '../../inbound/pallet-label-popup'
4
7
  import './edit-product-popup'
5
8
  import './proceed-edit-product-popup'
6
9
  import './view-product-changes-popup'
@@ -15,6 +18,8 @@ import { openPopup } from '@things-factory/layout-base'
15
18
  import { client, CustomAlert, navigate, PageView } from '@things-factory/shell'
16
19
  import { CommonButtonStyles } from '@things-factory/styles'
17
20
  import { isMobileDevice } from '@things-factory/utils'
21
+ import { BufferLocationSelector } from '@things-factory/warehouse-ui'
22
+ import { fetchSettingRule } from '../../../fetch-setting-value'
18
23
 
19
24
  import {
20
25
  ORDER_PRODUCT_STATUS,
@@ -44,11 +49,16 @@ class ArrivalNoticeDetail extends localize(i18next)(PageView) {
44
49
  _status: String,
45
50
  _bizplaceName: String,
46
51
  _attachments: Array,
52
+ data: Object,
47
53
  productGristConfig: Object,
48
54
  vasGristConfig: Object,
49
55
  productData: Object,
50
56
  vasData: Object,
51
- _template: Object
57
+ _template: Object,
58
+ _showAssignWarehouse: Boolean,
59
+ _vasExpanded: Boolean,
60
+ _enableCartonLabel: Boolean,
61
+ arrivalNoticeId: String
52
62
  }
53
63
  }
54
64
 
@@ -93,17 +103,28 @@ class ArrivalNoticeDetail extends localize(i18next)(PageView) {
93
103
  font: var(--grist-title-font);
94
104
  color: var(--secondary-color);
95
105
  }
96
-
97
106
  .grist h2 mwc-icon {
98
107
  vertical-align: middle;
99
108
  margin: var(--grist-title-icon-margin);
100
109
  font-size: var(--grist-title-icon-size);
101
110
  color: var(--grist-title-icon-color);
102
111
  }
103
-
104
112
  h2 + data-grist {
105
113
  padding-top: var(--grist-title-with-grid-padding);
106
114
  }
115
+ .vas[collapsable] {
116
+ height: 40%;
117
+ }
118
+ .vas[collapsable][collapsed] {
119
+ display: none;
120
+ }
121
+ data-grist#vas-grist {
122
+ padding-top: 0px;
123
+ height: 100%;
124
+ }
125
+ h2.vas-title {
126
+ padding-bottom: 0px;
127
+ }
107
128
  [options-wrap] *,
108
129
  [attachment-wrap] a * {
109
130
  vertical-align: middle;
@@ -150,6 +171,8 @@ class ArrivalNoticeDetail extends localize(i18next)(PageView) {
150
171
  }
151
172
 
152
173
  get context() {
174
+ var titleName = i18next.t('title.arrival_notice_detail')
175
+ this._vasExpanded = false
153
176
  var actions = [
154
177
  {
155
178
  title: i18next.t('button.back'),
@@ -179,15 +202,62 @@ class ArrivalNoticeDetail extends localize(i18next)(PageView) {
179
202
  }
180
203
  }
181
204
 
182
- if (
183
- (this._status === ORDER_STATUS.PROCESSING.value || this._status === ORDER_STATUS.READY_TO_UNLOAD.value) &&
184
- this.isUserBelongsDomain
185
- ) {
186
- actions.push({
187
- title: i18next.t('button.edit_product'),
188
- action: this.openEditProductPopup.bind(this),
189
- ...CommonButtonStyles.add
190
- })
205
+ if (this.isUserBelongsDomain) {
206
+ if (this._status === ORDER_STATUS.PROCESSING.value || this._status === ORDER_STATUS.READY_TO_UNLOAD.value) {
207
+ actions.push({
208
+ title: i18next.t('button.edit_product'),
209
+ action: this.openEditProductPopup.bind(this),
210
+ ...CommonButtonStyles.add
211
+ })
212
+
213
+ if (this._enableCartonLabel) {
214
+ actions.push({
215
+ title: i18next.t('button.carton_label_print'),
216
+ action: this._openCartonLabelPrintPopup.bind(this),
217
+ ...CommonButtonStyles.label
218
+ })
219
+ } else {
220
+ actions.push({
221
+ title: i18next.t('button.lot_label_print'),
222
+ action: this._openLotLabelPrintPopup.bind(this),
223
+ ...CommonButtonStyles.label
224
+ })
225
+ }
226
+ } else if (this._status === ORDER_STATUS.PENDING_RECEIVE.value) {
227
+ titleName = i18next.t('title.receive_arrival_notice')
228
+ actions.push(
229
+ {
230
+ title: i18next.t('button.reject'),
231
+ action: this._rejectArrivalNotice.bind(this),
232
+ ...CommonButtonStyles.reject
233
+ },
234
+ {
235
+ title: i18next.t('button.receive'),
236
+ action: this._receiveArrivalNotice.bind(this),
237
+ ...CommonButtonStyles.receive
238
+ }
239
+ )
240
+ } else if (this._status === ORDER_STATUS.INTRANSIT.value) {
241
+ titleName = i18next.t('title.check_arrived_notice')
242
+ actions.push({
243
+ title: i18next.t('button.arrived'),
244
+ action: this._checkArrivedNotice.bind(this),
245
+ ...CommonButtonStyles.arrived
246
+ })
247
+ } else if (this._status === ORDER_STATUS.ARRIVED.value) {
248
+ titleName = i18next.t('title.assign_warehouse')
249
+ actions.push({
250
+ title: i18next.t('button.assign_warehouse'),
251
+ action: this._assignBufferLocation.bind(this),
252
+ ...CommonButtonStyles.warehouse
253
+ })
254
+ }
255
+ }
256
+
257
+ if (this._status === ORDER_STATUS.ARRIVED.value && this.isUserBelongsDomain) {
258
+ this._showAssignWarehouse = true
259
+ } else {
260
+ this._showAssignWarehouse = false
191
261
  }
192
262
 
193
263
  if (
@@ -233,7 +303,7 @@ class ArrivalNoticeDetail extends localize(i18next)(PageView) {
233
303
  }
234
304
 
235
305
  return {
236
- title: i18next.t('title.arrival_notice_detail'),
306
+ title: titleName,
237
307
  actions,
238
308
  help: 'operato-wms/arrival-notice/gan-detail'
239
309
  }
@@ -343,6 +413,17 @@ class ArrivalNoticeDetail extends localize(i18next)(PageView) {
343
413
  `
344
414
  : ''}
345
415
  </fieldset>
416
+
417
+ <fieldset style=${this._showAssignWarehouse ? '' : 'display: none'}>
418
+ <legend>${i18next.t('title.assign_warehouse')}</legend>
419
+ <label>${i18next.t('label.warehouse')}</label>
420
+ <input
421
+ id="buffer-location"
422
+ name="buffer-location"
423
+ readonly
424
+ @click="${this._openBufferSelector.bind(this)}"
425
+ />
426
+ </fieldset>
346
427
  </form>
347
428
  <barcode-tag bcid="qrcode" .value=${this._ganNo}></barcode-tag>
348
429
  </div>
@@ -357,13 +438,23 @@ class ArrivalNoticeDetail extends localize(i18next)(PageView) {
357
438
  .data="${this.productData}"
358
439
  ></data-grist>
359
440
 
360
- <h2><mwc-icon>list_alt</mwc-icon>${i18next.t('title.vas')}</h2>
361
- <data-grist
362
- id="vas-grist"
363
- .mode=${isMobileDevice() ? 'LIST' : 'GRID'}
364
- .config=${this.vasGristConfig}
365
- .data="${this.vasData}"
366
- ></data-grist>
441
+ <h2
442
+ @click="${e => {
443
+ this._vasExpanded = !this._vasExpanded
444
+ }}"
445
+ >
446
+ <mwc-icon>list_alt</mwc-icon>${i18next.t('title.vas')}<mwc-icon
447
+ >${this._vasExpanded ? 'expand_less' : 'expand_more'}</mwc-icon
448
+ >
449
+ </h2>
450
+ <div class="vas" collapsable ?collapsed=${!this._vasExpanded}>
451
+ <data-grist
452
+ id="vas-grist"
453
+ .mode=${isMobileDevice() ? 'LIST' : 'GRID'}
454
+ .config=${this.vasGristConfig}
455
+ .data="${this.vasData}"
456
+ ></data-grist>
457
+ </div>
367
458
  </div>
368
459
 
369
460
  <div class="guide-container">${this._template}</div>
@@ -377,6 +468,8 @@ class ArrivalNoticeDetail extends localize(i18next)(PageView) {
377
468
  this._downloadable = true
378
469
  this._attachments = []
379
470
  this.vasData = { records: [] }
471
+ this._showAssignWarehouse = false
472
+ this._vasExpanded = false
380
473
  }
381
474
 
382
475
  get arrivalNoticeForm() {
@@ -391,6 +484,10 @@ class ArrivalNoticeDetail extends localize(i18next)(PageView) {
391
484
  return this.shadowRoot.querySelector('data-grist#vas-grist')
392
485
  }
393
486
 
487
+ get bufferLocationField() {
488
+ return this.shadowRoot.querySelector('input#buffer-location')
489
+ }
490
+
394
491
  async pageInitialized() {
395
492
  this.isUserBelongsDomain = await this._checkUserBelongsDomain()
396
493
  this.vasGristConfig = {
@@ -658,10 +755,14 @@ class ArrivalNoticeDetail extends localize(i18next)(PageView) {
658
755
  query: gql`
659
756
  query arrivalNotice($name: String!) {
660
757
  arrivalNotice(name: $name) {
758
+ id
661
759
  name
662
760
  bizplace {
663
761
  id
664
762
  name
763
+ domain {
764
+ id
765
+ }
665
766
  }
666
767
  containerNo
667
768
  containerSize
@@ -752,7 +853,9 @@ class ArrivalNoticeDetail extends localize(i18next)(PageView) {
752
853
  if (!response.errors) {
753
854
  const { arrivalNotice } = response.data
754
855
  const { orderProducts, orderVass } = arrivalNotice
856
+ const partnerDomainId = arrivalNotice.bizplace.domain.id
755
857
 
858
+ this.arrivalNoticeId = arrivalNotice.id
756
859
  this.orderBizplace = arrivalNotice.bizplace
757
860
  this._hasContainer = arrivalNotice.containerNo ? true : false
758
861
  this._looseItem = arrivalNotice.looseItem
@@ -789,7 +892,7 @@ class ArrivalNoticeDetail extends localize(i18next)(PageView) {
789
892
  }
790
893
  })
791
894
  }
792
-
895
+ this._enableCartonLabel = await fetchSettingRule('enable-carton-label', partnerDomainId)
793
896
  this.updateContext()
794
897
  }
795
898
  }
@@ -887,6 +990,194 @@ class ArrivalNoticeDetail extends localize(i18next)(PageView) {
887
990
  }
888
991
  }
889
992
 
993
+ async _rejectArrivalNotice() {
994
+ const popup = openPopup(
995
+ html`
996
+ <popup-note
997
+ .title="${i18next.t('title.remark')}"
998
+ @submit="${async e => {
999
+ try {
1000
+ if (!e.detail.value) throw new Error(i18next.t('text.remark_is_empty'))
1001
+ const result = await CustomAlert({
1002
+ title: i18next.t('title.are_you_sure'),
1003
+ text: i18next.t('text.reject_arrival_notice'),
1004
+ confirmButton: { text: i18next.t('button.confirm') },
1005
+ cancelButton: { text: i18next.t('button.cancel') }
1006
+ })
1007
+
1008
+ if (!result.value) return
1009
+
1010
+ if (this._crossDocking) {
1011
+ const result = await CustomAlert({
1012
+ title: i18next.t('title.cross_docking'),
1013
+ text: i18next.t('text.related_release_order_will_be_rejected'),
1014
+ confirmButton: { text: i18next.t('button.confirm') },
1015
+ cancelButton: { text: i18next.t('button.cancel') }
1016
+ })
1017
+
1018
+ if (!result.value) return
1019
+ }
1020
+
1021
+ const response = await client.mutate({
1022
+ mutation: gql`
1023
+ mutation rejectArrivalNotice($name: String!, $patch: ArrivalNoticePatch!) {
1024
+ rejectArrivalNotice(name: $name, patch: $patch) {
1025
+ name
1026
+ }
1027
+ }
1028
+ `,
1029
+ variables: { name: this._ganNo, patch: { remark: e.detail.value } }
1030
+ })
1031
+
1032
+ if (!response.errors) {
1033
+ navigate('arrival_notices')
1034
+ this._showToast({ message: i18next.t('text.arrival_notice_rejected') })
1035
+ }
1036
+ } catch (e) {
1037
+ this._showToast(e)
1038
+ }
1039
+ }}"
1040
+ ></popup-note>
1041
+ `,
1042
+ {
1043
+ backdrop: true,
1044
+ size: 'medium',
1045
+ title: i18next.t('title.reject_arrival_notice')
1046
+ }
1047
+ )
1048
+
1049
+ popup.onclosed
1050
+ }
1051
+
1052
+ async _receiveArrivalNotice() {
1053
+ try {
1054
+ let result = await CustomAlert({
1055
+ title: i18next.t('title.are_you_sure'),
1056
+ text: i18next.t('text.receive_arrival_notice'),
1057
+ confirmButton: { text: i18next.t('button.confirm') },
1058
+ cancelButton: { text: i18next.t('button.cancel') }
1059
+ })
1060
+
1061
+ if (!result.value) return
1062
+
1063
+ if (this._crossDocking) {
1064
+ result = await CustomAlert({
1065
+ title: i18next.t('title.are_you_sure'),
1066
+ text: i18next.t('text.this_is_cross_docking'),
1067
+ confirmButton: { text: i18next.t('button.confirm') },
1068
+ cancelButton: { text: i18next.t('button.cancel') }
1069
+ })
1070
+
1071
+ if (!result.value) return
1072
+ }
1073
+
1074
+ const response = await client.mutate({
1075
+ mutation: gql`
1076
+ mutation receiveArrivalNotice($name: String!) {
1077
+ receiveArrivalNotice(name: $name) {
1078
+ name
1079
+ }
1080
+ }
1081
+ `,
1082
+ variables: { name: this._ganNo }
1083
+ })
1084
+
1085
+ if (!response.errors) {
1086
+ navigate(`arrival_notices`)
1087
+ this._showToast({ message: i18next.t('text.arrival_notice_received') })
1088
+ }
1089
+ } catch (e) {
1090
+ this._showToast(e)
1091
+ }
1092
+ }
1093
+
1094
+ async _checkArrivedNotice() {
1095
+ try {
1096
+ const result = await CustomAlert({
1097
+ title: i18next.t('title.are_you_sure'),
1098
+ text: i18next.t('text.check_to_arrived'),
1099
+ confirmButton: { text: i18next.t('button.confirm') },
1100
+ cancelButton: { text: i18next.t('button.cancel') }
1101
+ })
1102
+
1103
+ if (!result.value) {
1104
+ return
1105
+ }
1106
+
1107
+ const response = await client.mutate({
1108
+ mutation: gql`
1109
+ mutation checkArrivedNotice($name: String!) {
1110
+ checkArrivedNotice(name: $name) {
1111
+ name
1112
+ }
1113
+ }
1114
+ `,
1115
+ variables: { name: this._ganNo }
1116
+ })
1117
+
1118
+ if (!response.errors) {
1119
+ this._showToast({ message: i18next.t('text.arrival_notice_is_arrived') })
1120
+ this.pageReset()
1121
+ }
1122
+ } catch (e) {
1123
+ this._showToast(e)
1124
+ }
1125
+ }
1126
+
1127
+ async _assignBufferLocation() {
1128
+ try {
1129
+ this._validateBufferLocation()
1130
+
1131
+ let result = await CustomAlert({
1132
+ title: i18next.t('title.are_you_sure'),
1133
+ text: i18next.t('text.assign_warehouse'),
1134
+ confirmButton: { text: i18next.t('button.confirm') },
1135
+ cancelButton: { text: i18next.t('button.cancel') }
1136
+ })
1137
+
1138
+ if (!result.value) return
1139
+
1140
+ if (this._crossDocking) {
1141
+ result = await CustomAlert({
1142
+ title: i18next.t('title.cross_docking'),
1143
+ text: i18next.t('text.picking_worksheet_will_be_generated'),
1144
+ confirmButton: { text: i18next.t('button.confirm') },
1145
+ cancelButton: { text: i18next.t('button.cancel') }
1146
+ })
1147
+
1148
+ if (!result.value) return
1149
+ }
1150
+
1151
+ const response = await client.mutate({
1152
+ mutation: gql`
1153
+ mutation generateArrivalNoticeWorksheet($arrivalNoticeNo: String!, $bufferLocation: ObjectRef!) {
1154
+ generateArrivalNoticeWorksheet(arrivalNoticeNo: $arrivalNoticeNo, bufferLocation: $bufferLocation) {
1155
+ unloadingWorksheet {
1156
+ name
1157
+ }
1158
+ }
1159
+ }
1160
+ `,
1161
+ variables: {
1162
+ arrivalNoticeNo: this._ganNo,
1163
+ bufferLocation: { id: this.bufferLocationField.getAttribute('location-id') }
1164
+ }
1165
+ })
1166
+
1167
+ if (!response.errors) {
1168
+ navigate(`inbound_worksheets`)
1169
+ this._showToast({ message: i18next.t('text.warehouse_is_assigned') })
1170
+ }
1171
+ } catch (e) {
1172
+ this._showToast(e)
1173
+ }
1174
+ }
1175
+
1176
+ _validateBufferLocation() {
1177
+ if (!this.bufferLocationField.getAttribute('location-id'))
1178
+ throw new Error(i18next.t('text.warehouse_is_not_assigned'))
1179
+ }
1180
+
890
1181
  async _confirmArrivalNotice() {
891
1182
  let result = await CustomAlert({
892
1183
  title: i18next.t('title.are_you_sure'),
@@ -929,6 +1220,103 @@ class ArrivalNoticeDetail extends localize(i18next)(PageView) {
929
1220
  }
930
1221
  }
931
1222
 
1223
+ _openBufferSelector() {
1224
+ openPopup(
1225
+ html`
1226
+ <buffer-location-selector
1227
+ @selected="${e => {
1228
+ this.bufferLocationField.value = `${e.detail.name} ${
1229
+ e.detail.description ? `(${e.detail.description})` : ''
1230
+ }`
1231
+ this.bufferLocationField.setAttribute('location-id', e.detail.id)
1232
+ }}"
1233
+ ></buffer-location-selector>
1234
+ `,
1235
+ {
1236
+ backdrop: true,
1237
+ size: 'large',
1238
+ title: i18next.t('title.select_warehouse')
1239
+ }
1240
+ )
1241
+ }
1242
+
1243
+ async _fetchWorksheet() {
1244
+ const response = await client.query({
1245
+ query: gql`
1246
+ query worksheet($name: String!) {
1247
+ worksheet(name: $name) {
1248
+ id
1249
+ name
1250
+ worksheetDetails {
1251
+ id
1252
+ name
1253
+ targetProduct {
1254
+ product {
1255
+ id
1256
+ sku
1257
+ brand
1258
+ name
1259
+ type
1260
+ description
1261
+ }
1262
+ batchId
1263
+ packingType
1264
+ palletQty
1265
+ }
1266
+ }
1267
+ }
1268
+ }
1269
+ `,
1270
+ variables: { name: this.arrivalNoticeId }
1271
+ })
1272
+
1273
+ if (!response.errors) {
1274
+ this.data = {
1275
+ records: response.data.worksheet.worksheetDetails.map(worksheetDetail => {
1276
+ return {
1277
+ ...worksheetDetail.targetProduct,
1278
+ id: worksheetDetail.id,
1279
+ batchId: worksheetDetail.batchId,
1280
+ printQty: worksheetDetail.targetProduct.palletQty,
1281
+ packingType: worksheetDetail.targetProduct.packingType
1282
+ }
1283
+ })
1284
+ }
1285
+ }
1286
+ }
1287
+
1288
+ async _openLotLabelPrintPopup() {
1289
+ await this._fetchWorksheet()
1290
+ let a = this.data
1291
+ const _pallets = {
1292
+ records: this.data.records.map(record => {
1293
+ return {
1294
+ id: record.id,
1295
+ palletId: record.palletId,
1296
+ batchId: record.batchId,
1297
+ product: record.product,
1298
+ palletQty: record.palletQty,
1299
+ printQty: record.palletQty,
1300
+ packingType: record.packingType,
1301
+ bizplace: this._bizplace
1302
+ }
1303
+ })
1304
+ }
1305
+ openPopup(html` <pallet-label-popup .pallets="${_pallets}"></pallet-label-popup> `, {
1306
+ backdrop: true,
1307
+ size: 'large',
1308
+ title: i18next.t('title.lot_label')
1309
+ })
1310
+ }
1311
+
1312
+ _openCartonLabelPrintPopup() {
1313
+ openPopup(html` <carton-label-popup .bizplaceName="${this._bizplace}"></carton-label-popup> `, {
1314
+ backdrop: true,
1315
+ size: 'small',
1316
+ title: i18next.t('title.carton_label')
1317
+ })
1318
+ }
1319
+
932
1320
  openEditProductPopup() {
933
1321
  this.productData.records = this.productData.records.filter(
934
1322
  orderProduct => orderProduct.status !== ORDER_PRODUCT_STATUS.UNLOADED.value
@@ -5,7 +5,7 @@ import { getRenderer } from '@things-factory/grist-ui'
5
5
  import { i18next, localize } from '@things-factory/i18n-base'
6
6
  import { openPopup } from '@things-factory/layout-base'
7
7
  import { client, CustomAlert, navigate, PageView } from '@things-factory/shell'
8
- import { gqlBuilder, isMobileDevice } from '@things-factory/utils'
8
+ import { isMobileDevice } from '@things-factory/utils'
9
9
  import gql from 'graphql-tag'
10
10
  import { css, html } from 'lit-element'
11
11
  import '../../components/attachment-viewer'