@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
@@ -49,7 +49,9 @@ class CreateArrivalNotice extends localize(i18next)(PageView) {
49
49
  vasData: Object,
50
50
  _bizplaces: Object,
51
51
  _bizplaceId: String,
52
- _bizplaceName: String
52
+ _bizplaceName: String,
53
+ _showAddProducts: Boolean,
54
+ _vasExpanded: Boolean
53
55
  }
54
56
  }
55
57
 
@@ -101,6 +103,10 @@ class CreateArrivalNotice extends localize(i18next)(PageView) {
101
103
  overflow-y: hidden;
102
104
  flex: 1;
103
105
  }
106
+ data-grist#vas-grist {
107
+ padding-top: 0px;
108
+ height: 100%;
109
+ }
104
110
  h2 {
105
111
  padding: var(--subtitle-padding);
106
112
  font: var(--subtitle-font);
@@ -113,18 +119,31 @@ class CreateArrivalNotice extends localize(i18next)(PageView) {
113
119
  font: var(--grist-title-font);
114
120
  color: var(--secondary-color);
115
121
  }
116
-
117
122
  .grist h2 mwc-icon {
118
123
  vertical-align: middle;
119
124
  margin: var(--grist-title-icon-margin);
120
125
  font-size: var(--grist-title-icon-size);
121
126
  color: var(--grist-title-icon-color);
122
127
  }
123
-
124
128
  h2 + data-grist {
125
129
  padding-top: var(--grist-title-with-grid-padding);
126
130
  }
127
-
131
+ h2.vas-title {
132
+ padding-bottom: 0px;
133
+ }
134
+ #button-add-products {
135
+ padding: 10px 15px 0 0;
136
+ float: right;
137
+ }
138
+ .button-div {
139
+ margin: 0 0 -30px 0;
140
+ }
141
+ .vas[collapsable] {
142
+ height: 40%;
143
+ }
144
+ .vas[collapsable][collapsed] {
145
+ display: none;
146
+ }
128
147
  [hidden] {
129
148
  display: none;
130
149
  }
@@ -151,6 +170,7 @@ class CreateArrivalNotice extends localize(i18next)(PageView) {
151
170
  }
152
171
 
153
172
  get context() {
173
+ this._vasExpanded = false
154
174
  return {
155
175
  title: i18next.t('title.create_arrival_notice'),
156
176
  actions: [
@@ -324,8 +344,16 @@ class CreateArrivalNotice extends localize(i18next)(PageView) {
324
344
 
325
345
  <div class="container">
326
346
  <div class="grist">
347
+ <div class="button-div">
348
+ <mwc-button
349
+ id="button-add-products"
350
+ label=${i18next.t('button.add_products')}
351
+ raised
352
+ @click=${e => this._openBulkProductSelection()}
353
+ ?disabled=${!this._showAddProducts}
354
+ ></mwc-button>
355
+ </div>
327
356
  <h2><mwc-icon>list_alt</mwc-icon>${i18next.t('title.product')}</h2>
328
-
329
357
  <data-grist
330
358
  id="product-grist"
331
359
  .mode=${isMobileDevice() ? 'LIST' : 'GRID'}
@@ -334,14 +362,25 @@ class CreateArrivalNotice extends localize(i18next)(PageView) {
334
362
  @record-change="${this._onProductChangeHandler.bind(this)}"
335
363
  ></data-grist>
336
364
 
337
- <h2><mwc-icon>list_alt</mwc-icon>${i18next.t('title.vas')}</h2>
338
-
339
- <data-grist
340
- id="vas-grist"
341
- .mode=${isMobileDevice() ? 'LIST' : 'GRID'}
342
- .config=${this.vasGristConfig}
343
- .data="${this.vasData}"
344
- ></data-grist>
365
+ <h2
366
+ @click="${e => {
367
+ this._vasExpanded = !this._vasExpanded
368
+ }}"
369
+ class="vas-title"
370
+ >
371
+ <mwc-icon>list_alt</mwc-icon>${i18next.t('title.vas')}<mwc-icon
372
+ >${this._vasExpanded ? 'expand_less' : 'expand_more'}</mwc-icon
373
+ >
374
+ </h2>
375
+ <div class="vas" collapsable ?collapsed=${!this._vasExpanded}>
376
+ <data-grist
377
+ id="vas-grist"
378
+ .mode=${isMobileDevice() ? 'LIST' : 'GRID'}
379
+ .config=${this.vasGristConfig}
380
+ .data="${this.vasData}"
381
+ ></data-grist>
382
+ </div>
383
+ </div>
345
384
  </div>
346
385
  </div>
347
386
  `
@@ -366,6 +405,8 @@ class CreateArrivalNotice extends localize(i18next)(PageView) {
366
405
  this._enableTransportForCustomClearanceSetting = false
367
406
  this._disableTransport = false
368
407
  this._strictProductSelection = false
408
+ this._showAddProducts = false
409
+ this._vasExpanded = false
369
410
  }
370
411
 
371
412
  get arrivalNoticeForm() {
@@ -458,18 +499,21 @@ class CreateArrivalNotice extends localize(i18next)(PageView) {
458
499
  type: 'string',
459
500
  name: 'targetType',
460
501
  header: i18next.t('field.target_type'),
502
+ label: true,
461
503
  width: 150
462
504
  },
463
505
  {
464
506
  type: 'string',
465
507
  name: 'targetDisplay',
466
508
  header: i18next.t('field.target'),
509
+ label: true,
467
510
  width: 250
468
511
  },
469
512
  {
470
513
  type: 'string',
471
514
  name: 'packingType',
472
515
  header: i18next.t('field.packing_type'),
516
+ label: true,
473
517
  width: 250
474
518
  },
475
519
  {
@@ -710,6 +754,36 @@ class CreateArrivalNotice extends localize(i18next)(PageView) {
710
754
  }
711
755
  }
712
756
 
757
+ _openBulkProductSelection() {
758
+ if (this._bizplaceId) {
759
+ openPopup(
760
+ html`
761
+ <select-product-popup
762
+ .bizplaceId="${this._bizplaceId}"
763
+ .selectMultipleProducts="${this._showAddProducts}"
764
+ @selected="${e => {
765
+ let newRecords = []
766
+ for (let i = 0; i < e.detail.multipleProducts.length; i++) {
767
+ newRecords.push(e.detail.multipleProducts[i])
768
+ }
769
+ this.productData = {
770
+ ...this.productData,
771
+ records: [...this.productGrist.dirtyData.records, ...newRecords]
772
+ }
773
+ }}"
774
+ ></select-product-popup>
775
+ `,
776
+ {
777
+ backdrop: true,
778
+ size: 'large',
779
+ title: i18next.t('title.select_item')
780
+ }
781
+ )
782
+ } else {
783
+ this._showToast({ message: i18next.t('text.company_selection_is_empty') })
784
+ }
785
+ }
786
+
713
787
  _openProductSelection(rowIndex) {
714
788
  if (this._bizplaceId) {
715
789
  openPopup(
@@ -923,6 +997,7 @@ class CreateArrivalNotice extends localize(i18next)(PageView) {
923
997
  if (bizplaces.length == 1) {
924
998
  this._bizplaceId = bizplaces[0].id
925
999
  this._bizplaceName = bizplaces[0].name
1000
+ this._showAddProducts = true
926
1001
  } else {
927
1002
  this._bizplaceId = ''
928
1003
  this._bizplaceName = ''
@@ -1482,6 +1557,7 @@ class CreateArrivalNotice extends localize(i18next)(PageView) {
1482
1557
  this._strictProductSelection = await fetchSettingRule('strict-product-selection', e.detail.domain.id)
1483
1558
  this._configureProductGrist()
1484
1559
  this._clearView()
1560
+ this._showAddProducts = true
1485
1561
  }}"
1486
1562
  ></popup-partner-bizplaces-selector>
1487
1563
  `,
@@ -56,7 +56,9 @@ class DuplicateArrivalNotice extends localize(i18next)(PageView) {
56
56
  vasData: Object,
57
57
  _bizplaces: Object,
58
58
  _bizplaceId: String,
59
- _bizplaceName: String
59
+ _bizplaceName: String,
60
+ _showAddProducts: Boolean,
61
+ _vasExpanded: Boolean
60
62
  }
61
63
  }
62
64
 
@@ -109,6 +111,10 @@ class DuplicateArrivalNotice extends localize(i18next)(PageView) {
109
111
  overflow-y: hidden;
110
112
  flex: 1;
111
113
  }
114
+ data-grist#vas-grist {
115
+ padding-top: 0px;
116
+ height: 100%;
117
+ }
112
118
  h2 {
113
119
  padding: var(--subtitle-padding);
114
120
  font: var(--subtitle-font);
@@ -130,7 +136,22 @@ class DuplicateArrivalNotice extends localize(i18next)(PageView) {
130
136
  h2 + data-grist {
131
137
  padding-top: var(--grist-title-with-grid-padding);
132
138
  }
133
-
139
+ h2.vas-title {
140
+ padding-bottom: 0px;
141
+ }
142
+ #button-add-products {
143
+ padding: 10px 15px 0 0;
144
+ float: right;
145
+ }
146
+ .button-div {
147
+ margin: 0 0 -30px 0;
148
+ }
149
+ .vas[collapsable] {
150
+ height: 40%;
151
+ }
152
+ .vas[collapsable][collapsed] {
153
+ display: none;
154
+ }
134
155
  [hidden] {
135
156
  display: none;
136
157
  }
@@ -157,6 +178,12 @@ class DuplicateArrivalNotice extends localize(i18next)(PageView) {
157
178
  }
158
179
 
159
180
  get context() {
181
+ this._vasExpanded = false
182
+
183
+ if (this._bizplaceName) {
184
+ this._showAddProducts = true
185
+ }
186
+
160
187
  return {
161
188
  title: i18next.t('title.create_arrival_notice'),
162
189
  actions: [
@@ -327,6 +354,15 @@ class DuplicateArrivalNotice extends localize(i18next)(PageView) {
327
354
 
328
355
  <div class="container">
329
356
  <div class="grist">
357
+ <div class="button-div">
358
+ <mwc-button
359
+ id="button-add-products"
360
+ label=${i18next.t('button.add_products')}
361
+ raised
362
+ @click=${e => this._openBulkProductSelection(0)}
363
+ ?disabled=${!this._showAddProducts}
364
+ ></mwc-button>
365
+ </div>
330
366
  <h2><mwc-icon>list_alt</mwc-icon>${i18next.t('title.product')}</h2>
331
367
 
332
368
  <data-grist
@@ -337,14 +373,24 @@ class DuplicateArrivalNotice extends localize(i18next)(PageView) {
337
373
  @record-change="${this._onProductChangeHandler.bind(this)}"
338
374
  ></data-grist>
339
375
 
340
- <h2><mwc-icon>list_alt</mwc-icon>${i18next.t('title.vas')}</h2>
341
-
342
- <data-grist
343
- id="vas-grist"
344
- .mode=${isMobileDevice() ? 'LIST' : 'GRID'}
345
- .config=${this.vasGristConfig}
346
- .data="${this.vasData}"
347
- ></data-grist>
376
+ <h2
377
+ @click="${e => {
378
+ this._vasExpanded = !this._vasExpanded
379
+ }}"
380
+ class="vas-title"
381
+ >
382
+ <mwc-icon>list_alt</mwc-icon>${i18next.t('title.vas')}<mwc-icon
383
+ >${this._vasExpanded ? 'expand_less' : 'expand_more'}</mwc-icon
384
+ >
385
+ </h2>
386
+ <div class="vas" collapsable ?collapsed=${!this._vasExpanded}>
387
+ <data-grist
388
+ id="vas-grist"
389
+ .mode=${isMobileDevice() ? 'LIST' : 'GRID'}
390
+ .config=${this.vasGristConfig}
391
+ .data="${this.vasData}"
392
+ ></data-grist>
393
+ </div>
348
394
  </div>
349
395
  </div>
350
396
  `
@@ -369,6 +415,8 @@ class DuplicateArrivalNotice extends localize(i18next)(PageView) {
369
415
  this._enableTransportForCustomClearanceSetting = false
370
416
  this._disableTransport = false
371
417
  this._strictProductSelection = false
418
+ this._showAddProducts = false
419
+ this._vasExpanded = false
372
420
  }
373
421
 
374
422
  get arrivalNoticeForm() {
@@ -705,6 +753,36 @@ class DuplicateArrivalNotice extends localize(i18next)(PageView) {
705
753
  }
706
754
  }
707
755
 
756
+ _openBulkProductSelection() {
757
+ if (this._bizplaceId) {
758
+ openPopup(
759
+ html`
760
+ <select-product-popup
761
+ .bizplaceId="${this._bizplaceId}"
762
+ .selectMultipleProducts="${this._showAddProducts}"
763
+ @selected="${e => {
764
+ let newRecords = []
765
+ for (let i = 0; i < e.detail.multipleProducts.length; i++) {
766
+ newRecords.push(e.detail.multipleProducts[i])
767
+ }
768
+ this.productData = {
769
+ ...this.productData,
770
+ records: [...this.productGrist.dirtyData.records, ...newRecords]
771
+ }
772
+ }}"
773
+ ></select-product-popup>
774
+ `,
775
+ {
776
+ backdrop: true,
777
+ size: 'large',
778
+ title: i18next.t('title.select_item')
779
+ }
780
+ )
781
+ } else {
782
+ this._showToast({ message: i18next.t('text.company_selection_is_empty') })
783
+ }
784
+ }
785
+
708
786
  _openProductSelection(rowIndex) {
709
787
  if (this._bizplaceId) {
710
788
  openPopup(
@@ -925,6 +1003,7 @@ class DuplicateArrivalNotice extends localize(i18next)(PageView) {
925
1003
  if (bizplaces.length == 1) {
926
1004
  this._bizplaceId = bizplaces[0].id
927
1005
  this._bizplaceName = bizplaces[0].name
1006
+ this._showAddProducts = true
928
1007
  } else {
929
1008
  this._bizplaceId = ''
930
1009
  this._bizplaceName = ''
@@ -1548,6 +1627,7 @@ class DuplicateArrivalNotice extends localize(i18next)(PageView) {
1548
1627
  this.productGrist.reset()
1549
1628
  this.vasGrist.reset()
1550
1629
  this._configureProductGrist()
1630
+ this._showAddProducts = true
1551
1631
  }}"
1552
1632
  ></popup-partner-bizplaces-selector>
1553
1633
  `,
@@ -611,8 +611,8 @@ export class EditProductPopup extends localize(i18next)(LitElement) {
611
611
  mutation: gql`
612
612
  mutation addEditArrivalNoticeProducts(
613
613
  $ganNo: String!
614
- $newOrderProducts: [NewOrderProduct]
615
- $existingOrderProducts: [OrderProductPatch]
614
+ $newOrderProducts: [NewOrderProduct!]
615
+ $existingOrderProducts: [OrderProductPatch!]
616
616
  ) {
617
617
  addEditArrivalNoticeProducts(
618
618
  ganNo: $ganNo
@@ -3,7 +3,7 @@ import '@things-factory/grist-ui'
3
3
  import { i18next, localize } from '@things-factory/i18n-base'
4
4
  import { client, navigate, PageView } from '@things-factory/shell'
5
5
  import { ScrollbarStyles } from '@things-factory/styles'
6
- import { gqlBuilder, isMobileDevice } from '@things-factory/utils'
6
+ import { isMobileDevice } from '@things-factory/utils'
7
7
  import gql from 'graphql-tag'
8
8
  import { css, html } from 'lit-element'
9
9
  import { getCodeByName } from '@things-factory/code-base'
@@ -174,12 +174,8 @@ class CustomerGrnList extends localize(i18next)(PageView) {
174
174
  const filters = await this.searchForm.getQueryFilters()
175
175
  const response = await client.query({
176
176
  query: gql`
177
- query {
178
- goodsReceivalNotes(${gqlBuilder.buildArgs({
179
- filters: [...filters],
180
- pagination: { page, limit },
181
- sortings: sorters
182
- })}) {
177
+ query goodsReceivalNotes($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
178
+ goodsReceivalNotes(filters: $filters, pagination: $pagination, sortings: $sortings) {
183
179
  items {
184
180
  id
185
181
  name
@@ -208,7 +204,12 @@ class CustomerGrnList extends localize(i18next)(PageView) {
208
204
  total
209
205
  }
210
206
  }
211
- `
207
+ `,
208
+ variables: {
209
+ filters: [...filters],
210
+ pagination: { page, limit },
211
+ sortings: sorters
212
+ }
212
213
  })
213
214
 
214
215
  if (!response.errors) {
@@ -4,7 +4,7 @@ import { css, html } from 'lit-element'
4
4
  import { i18next, localize } from '@things-factory/i18n-base'
5
5
  import { client, CustomAlert, navigate, PageView } from '@things-factory/shell'
6
6
  import { CommonButtonStyles, ScrollbarStyles } from '@things-factory/styles'
7
- import { getPathInfo, gqlBuilder } from '@things-factory/utils'
7
+ import { getPathInfo } from '@things-factory/utils'
8
8
 
9
9
  class CustomerReceivedNote extends localize(i18next)(PageView) {
10
10
  static get properties() {
@@ -136,14 +136,15 @@ class CustomerReceivedNote extends localize(i18next)(PageView) {
136
136
 
137
137
  const response = await client.query({
138
138
  query: gql`
139
- mutation {
140
- receivedGoodsReceivalNote(${gqlBuilder.buildArgs({
141
- name: this._grnNo
142
- })}) {
143
- name
139
+ mutation receivedGoodsReceivalNote($name: String!) {
140
+ receivedGoodsReceivalNote(name: $name) {
141
+ name
142
+ }
144
143
  }
144
+ `,
145
+ variables: {
146
+ name: this._grnNo
145
147
  }
146
- `
147
148
  })
148
149
 
149
150
  if (!response.errors) {
@@ -8,7 +8,7 @@ import { getCodeByName } from '@things-factory/code-base'
8
8
  import { i18next, localize } from '@things-factory/i18n-base'
9
9
  import { client, navigate, PageView } from '@things-factory/shell'
10
10
  import { ScrollbarStyles } from '@things-factory/styles'
11
- import { gqlBuilder, isMobileDevice } from '@things-factory/utils'
11
+ import { isMobileDevice } from '@things-factory/utils'
12
12
 
13
13
  class ReceivedNoteList extends localize(i18next)(PageView) {
14
14
  static get styles() {
@@ -317,12 +317,8 @@ class ReceivedNoteList extends localize(i18next)(PageView) {
317
317
  async fetchHandler({ page, limit, sorters = [{ name: 'createdAt', desc: true }] }) {
318
318
  const response = await client.query({
319
319
  query: gql`
320
- query {
321
- goodsReceivalNotes(${gqlBuilder.buildArgs({
322
- filters: this.searchForm.queryFilters,
323
- pagination: { page, limit },
324
- sortings: sorters
325
- })}) {
320
+ query goodsReceivalNotes($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
321
+ goodsReceivalNotes(filters: $filters, pagination: $pagination, sortings: $sortings) {
326
322
  items {
327
323
  id
328
324
  name
@@ -359,7 +355,12 @@ class ReceivedNoteList extends localize(i18next)(PageView) {
359
355
  total
360
356
  }
361
357
  }
362
- `
358
+ `,
359
+ variables: {
360
+ filters: this.searchForm.queryFilters,
361
+ pagination: { page, limit },
362
+ sortings: sorters
363
+ }
363
364
  })
364
365
 
365
366
  if (!response.errors) {
@@ -1,5 +1,7 @@
1
1
  import '@things-factory/form-ui'
2
2
  import '@things-factory/grist-ui'
3
+ import '../batch-picking-popup'
4
+ import '../batch-generate-single-picking-worksheet-popup'
3
5
 
4
6
  import gql from 'graphql-tag'
5
7
  import { css, html } from 'lit-element'
@@ -7,7 +9,8 @@ import { css, html } from 'lit-element'
7
9
  import { getCodeByName } from '@things-factory/code-base'
8
10
  import { i18next, localize } from '@things-factory/i18n-base'
9
11
  import { client, navigate, PageView } from '@things-factory/shell'
10
- import { ScrollbarStyles } from '@things-factory/styles'
12
+ import { openPopup } from '@things-factory/layout-base'
13
+ import { ScrollbarStyles, CommonButtonStyles } from '@things-factory/styles'
11
14
  import { isMobileDevice } from '@things-factory/utils'
12
15
 
13
16
  import { ORDER_STATUS } from '../../../constants'
@@ -41,7 +44,8 @@ class B2bOrderList extends localize(i18next)(PageView) {
41
44
  config: Object,
42
45
  data: Object,
43
46
  _ownTransport: Boolean,
44
- _exportOption: Boolean
47
+ _exportOption: Boolean,
48
+ isUserBelongsDomain: Boolean
45
49
  }
46
50
  }
47
51
 
@@ -58,8 +62,25 @@ class B2bOrderList extends localize(i18next)(PageView) {
58
62
  }
59
63
 
60
64
  get context() {
65
+ var actions = []
66
+
67
+ if (this.isUserBelongsDomain) {
68
+ actions.push(
69
+ {
70
+ title: i18next.t('button.batch_picking'),
71
+ action: this._openBatchPickingPopup.bind(this),
72
+ ...CommonButtonStyles.activate
73
+ },
74
+ {
75
+ title: i18next.t('button.generate_worksheet'),
76
+ action: this._openBatchGenerateSinglePickingWorksheetPopup.bind(this),
77
+ ...CommonButtonStyles.activate
78
+ }
79
+ )
80
+ }
61
81
  return {
62
82
  title: i18next.t('title.release_orders'),
83
+ actions,
63
84
  exportable: {
64
85
  name: i18next.t('title.release_orders'),
65
86
  data: this._exportableData.bind(this)
@@ -83,6 +104,7 @@ class B2bOrderList extends localize(i18next)(PageView) {
83
104
  }
84
105
 
85
106
  async pageInitialized() {
107
+ this.isUserBelongsDomain = await this._checkUserBelongsDomain()
86
108
  const [_orderStatusReq, _bizplacesReq] = await Promise.allSettled([
87
109
  getCodeByName('RO_LIST_STATUS'),
88
110
  this._fetchBizplaces()
@@ -440,6 +462,60 @@ class B2bOrderList extends localize(i18next)(PageView) {
440
462
  }
441
463
  }
442
464
 
465
+ async _checkUserBelongsDomain() {
466
+ try {
467
+ const response = await client.query({
468
+ query: gql`
469
+ query {
470
+ checkUserBelongsDomain
471
+ }
472
+ `
473
+ })
474
+
475
+ if (!response.errors) {
476
+ return response.data.checkUserBelongsDomain
477
+ }
478
+ } catch (e) {
479
+ this._showToast(e)
480
+ }
481
+ }
482
+
483
+ _openBatchPickingPopup() {
484
+ openPopup(
485
+ html`
486
+ <batch-picking-popup
487
+ @generated="${() => {
488
+ navigate('merged_outbound_worksheets')
489
+ this._showToast({ message: i18next.t('text.worksheet_has_been_generated') })
490
+ }}"
491
+ ></batch-picking-popup>
492
+ `,
493
+ {
494
+ backdrop: true,
495
+ size: 'large',
496
+ title: i18next.t('title.generate_batch_picking')
497
+ }
498
+ )
499
+ }
500
+
501
+ _openBatchGenerateSinglePickingWorksheetPopup() {
502
+ openPopup(
503
+ html`
504
+ <batch-generate-single-picking-worksheet-popup
505
+ @generated="${() => {
506
+ this._showToast({ message: i18next.t('text.orders_has_been_activated') })
507
+ this.dataGrist.fetch()
508
+ }}"
509
+ ></batch-generate-single-picking-worksheet-popup>
510
+ `,
511
+ {
512
+ backdrop: true,
513
+ size: 'large',
514
+ title: i18next.t('title.generate_picking_worksheet')
515
+ }
516
+ )
517
+ }
518
+
443
519
  _compareValues(key, order = 'asc') {
444
520
  return function innerSort(a, b) {
445
521
  if (!a.hasOwnProperty(key) || !b.hasOwnProperty(key)) {
@@ -1,6 +1,7 @@
1
1
  import '@things-factory/form-ui'
2
2
  import '@things-factory/grist-ui'
3
3
  import '../batch-picking-popup'
4
+ import '../batch-generate-single-picking-worksheet-popup'
4
5
 
5
6
  import gql from 'graphql-tag'
6
7
  import { css, html } from 'lit-element'
@@ -60,13 +61,18 @@ class B2bOrderRequests extends localize(i18next)(PageView) {
60
61
  get context() {
61
62
  return {
62
63
  title: i18next.t('title.release_order_requests'),
63
- // actions: [
64
- // {
65
- // title: i18next.t('button.batch_picking'),
66
- // action: this._openBatchPickingPopup.bind(this),
67
- // ...CommonButtonStyles.activate
68
- // }
69
- // ],
64
+ actions: [
65
+ {
66
+ title: i18next.t('button.batch_picking'),
67
+ action: this._openBatchPickingPopup.bind(this),
68
+ ...CommonButtonStyles.activate
69
+ },
70
+ {
71
+ title: i18next.t('button.generate_worksheet'),
72
+ action: this._openBatchGenerateSinglePickingWorksheetPopup.bind(this),
73
+ ...CommonButtonStyles.activate
74
+ }
75
+ ],
70
76
  exportable: {
71
77
  name: i18next.t('title.release_order_requests'),
72
78
  data: this._exportableData.bind(this)
@@ -215,15 +221,7 @@ class B2bOrderRequests extends localize(i18next)(PageView) {
215
221
  handlers: {
216
222
  click: (columns, data, column, record, rowIndex) => {
217
223
  const status = record.status
218
- if (
219
- status === ORDER_STATUS.PENDING_RECEIVE.value ||
220
- status === ORDER_STATUS.PENDING_CANCEL.value ||
221
- status === ORDER_STATUS.PENDING_WORKSHEET.value
222
- ) {
223
- navigate(`receive_release_order_request/${record.name}`) // 1. move to order receiving page
224
- } else {
225
- navigate(`release_order_detail/${record.name}`)
226
- }
224
+ navigate(`release_order_detail/${record.name}`)
227
225
  }
228
226
  }
229
227
  },
@@ -442,6 +440,24 @@ class B2bOrderRequests extends localize(i18next)(PageView) {
442
440
  )
443
441
  }
444
442
 
443
+ _openBatchGenerateSinglePickingWorksheetPopup() {
444
+ openPopup(
445
+ html`
446
+ <batch-generate-single-picking-worksheet-popup
447
+ @generated="${() => {
448
+ this._showToast({ message: i18next.t('text.orders_has_been_activated') })
449
+ this.dataGrist.fetch()
450
+ }}"
451
+ ></batch-generate-single-picking-worksheet-popup>
452
+ `,
453
+ {
454
+ backdrop: true,
455
+ size: 'large',
456
+ title: i18next.t('title.generate_picking_worksheet')
457
+ }
458
+ )
459
+ }
460
+
445
461
  _compareValues(key, order = 'asc') {
446
462
  return function innerSort(a, b) {
447
463
  if (!a.hasOwnProperty(key) || !b.hasOwnProperty(key)) {