@things-factory/operato-wms 4.0.21 → 4.0.25

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 (44) hide show
  1. package/client/bootstrap.js +13 -6
  2. package/client/pages/adjustment/transfer-inventory.js +32 -6
  3. package/client/pages/bulk-operation/bulk-operation.js +189 -64
  4. package/client/pages/bulk-operation/validate-gan-popup.js +391 -0
  5. package/client/pages/bulk-operation/validate-ro-popup.js +52 -22
  6. package/client/pages/components/popup-unloading.js +47 -34
  7. package/client/pages/components/select-product-popup.js +74 -27
  8. package/client/pages/components/worksheet-information-popup.js +100 -0
  9. package/client/pages/inbound/putaway-product.js +184 -231
  10. package/client/pages/inbound/undo-unload-popup.js +295 -0
  11. package/client/pages/inbound/unload-product.js +229 -567
  12. package/client/pages/inbound/unloaded-inventories-popup.js +129 -0
  13. package/client/pages/inbound/worksheet-unloading.js +15 -11
  14. package/client/pages/inventory/inventory-adjustment.js +9 -10
  15. package/client/pages/master/product/product-list.js +1 -1
  16. package/client/pages/order/arrival-notice/arrival-notice-detail.js +409 -21
  17. package/client/pages/order/arrival-notice/create-arrival-notice.js +89 -13
  18. package/client/pages/order/arrival-notice/duplicate-arrival-notice.js +90 -10
  19. package/client/pages/order/arrival-notice/edit-product-popup.js +2 -2
  20. package/client/pages/order/release-order/b2b/b2b-order-list.js +78 -2
  21. package/client/pages/order/release-order/b2b/b2b-order-requests.js +32 -16
  22. package/client/pages/order/release-order/b2c/b2c-order-requests.js +49 -5
  23. package/client/pages/order/release-order/batch-generate-single-picking-worksheet-popup.js +314 -0
  24. package/client/pages/order/release-order/batch-picking-popup.js +19 -2
  25. package/client/pages/order/release-order/create-release-order.js +194 -89
  26. package/client/pages/order/release-order/release-order-detail.js +390 -107
  27. package/client/pages/order/return-order/create-return-order.js +3 -3
  28. package/client/pages/order/transport-order/create-delivery-order.js +1 -1
  29. package/client/pages/order/transport-order/delivery-order-list.js +1 -1
  30. package/client/pages/outbound/packing-product.js +111 -236
  31. package/client/pages/outbound/picking-product.js +287 -380
  32. package/client/pages/outbound/sorting-product.js +66 -63
  33. package/client/pages/outbound/worksheet-loading.js +7 -3
  34. package/client/pages/outbound/worksheet-packing.js +3 -3
  35. package/client/pages/outbound/worksheet-picking.js +22 -18
  36. package/client/pages/vas/print-product-label.js +17 -9
  37. package/dist-server/graphql/resolvers/reports/product-label-report.js +1 -0
  38. package/dist-server/graphql/resolvers/reports/product-label-report.js.map +1 -1
  39. package/package.json +65 -65
  40. package/server/graphql/resolvers/reports/product-label-report.ts +1 -0
  41. package/translations/en.json +31 -2
  42. package/translations/ko.json +32 -3
  43. package/translations/ms.json +32 -3
  44. package/translations/zh.json +32 -3
@@ -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
@@ -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)) {
@@ -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'
@@ -65,12 +66,17 @@ class B2cOrderRequests extends localize(i18next)(PageView) {
65
66
  title: i18next.t('button.generate_packing_list'),
66
67
  action: this._generatePackingList.bind(this),
67
68
  ...CommonButtonStyles.label
69
+ },
70
+ {
71
+ title: i18next.t('button.batch_picking'),
72
+ action: this._openBatchPickingPopup.bind(this),
73
+ ...CommonButtonStyles.activate
74
+ },
75
+ {
76
+ title: i18next.t('button.generate_worksheet'),
77
+ action: this._openBatchGenerateSinglePickingWorksheetPopup.bind(this),
78
+ ...CommonButtonStyles.activate
68
79
  }
69
- // {
70
- // title: i18next.t('button.batch_picking'),
71
- // action: this._openBatchPickingPopup.bind(this),
72
- // ...CommonButtonStyles.activate
73
- // }
74
80
  ],
75
81
  exportable: {
76
82
  name: i18next.t('title.release_order_requests'),
@@ -209,6 +215,7 @@ class B2cOrderRequests extends localize(i18next)(PageView) {
209
215
  this.config = {
210
216
  rows: { selectable: { multiple: true }, appendable: false },
211
217
  list: { fields: ['name', 'bizplace', 'releaseDate', 'status', 'updatedAt'] },
218
+ pagination: { limit: 100, pages: [20, 50, 100, 200, 500] },
212
219
  columns: [
213
220
  { type: 'gutter', gutterName: 'sequence' },
214
221
  { type: 'gutter', gutterName: 'row-selector', multiple: true },
@@ -562,6 +569,43 @@ class B2cOrderRequests extends localize(i18next)(PageView) {
562
569
  }
563
570
  }
564
571
 
572
+ _openBatchGenerateSinglePickingWorksheetPopup() {
573
+ openPopup(
574
+ html`
575
+ <batch-generate-single-picking-worksheet-popup
576
+ @generated="${() => {
577
+ this._showToast({ message: i18next.t('text.orders_has_been_activated') })
578
+ this.dataGrist.fetch()
579
+ }}"
580
+ ></batch-generate-single-picking-worksheet-popup>
581
+ `,
582
+ {
583
+ backdrop: true,
584
+ size: 'large',
585
+ title: i18next.t('title.generate_picking_worksheet')
586
+ }
587
+ )
588
+ }
589
+
590
+ _compareValues(key, order = 'asc') {
591
+ return function innerSort(a, b) {
592
+ if (!a.hasOwnProperty(key) || !b.hasOwnProperty(key)) {
593
+ return 0
594
+ }
595
+
596
+ const varA = typeof a[key] === 'string' ? a[key].toUpperCase() : a[key]
597
+ const varB = typeof b[key] === 'string' ? b[key].toUpperCase() : b[key]
598
+
599
+ let comparison = 0
600
+ if (varA > varB) {
601
+ comparison = 1
602
+ } else if (varA < varB) {
603
+ comparison = -1
604
+ }
605
+ return order === 'desc' ? comparison * -1 : comparison
606
+ }
607
+ }
608
+
565
609
  _modifyDateRange(e) {
566
610
  const fromDate = e.currentTarget.value
567
611