@hitsoft/uretim-yonetimi 1.0.15 → 1.0.17

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 (137) hide show
  1. package/.eslintrc.json +44 -0
  2. package/config/ng-package.json +7 -0
  3. package/config/src/enums/route-names.ts +3 -0
  4. package/config/src/providers/create-barcode-route.provider.ts +21 -0
  5. package/config/src/providers/issues-for-production-route.provider.ts +21 -0
  6. package/config/src/providers/production-order-route.provider.ts +21 -0
  7. package/config/src/providers/receipt-from-production-route.provider.ts +21 -0
  8. package/config/src/providers/route.provider.ts +26 -0
  9. package/config/src/uretim-yonetimi-config.module.ts +22 -0
  10. package/karma.conf.js +44 -0
  11. package/ng-package.json +7 -0
  12. package/package.json +14 -42
  13. package/src/lib/components/hit-create-barcodes/hit-create-barcodes-component.css +10 -0
  14. package/src/lib/components/hit-create-barcodes/hit-create-barcodes-routing.module.ts +19 -0
  15. package/src/lib/components/hit-create-barcodes/hit-create-barcodes.component.html +80 -0
  16. package/src/lib/components/hit-create-barcodes/hit-create-barcodes.component.ts +219 -0
  17. package/src/lib/components/hit-create-barcodes/hit-create-barcodes.module.ts +39 -0
  18. package/src/lib/components/hit-issues-for-productions/hit-issues-for-productions-routing.module.ts +19 -0
  19. package/src/lib/components/hit-issues-for-productions/hit-issues-for-productions.componenet.css +7 -0
  20. package/src/lib/components/hit-issues-for-productions/hit-issues-for-productions.component.html +100 -0
  21. package/src/lib/components/hit-issues-for-productions/hit-issues-for-productions.component.ts +276 -0
  22. package/src/lib/components/hit-issues-for-productions/hit-issues-for-productions.module.ts +46 -0
  23. package/src/lib/components/hit-production-orders/hit-production-orders-routing.module.ts +19 -0
  24. package/src/lib/components/hit-production-orders/hit-production-orders.component.html +79 -0
  25. package/src/lib/components/hit-production-orders/hit-production-orders.component.ts +213 -0
  26. package/src/lib/components/hit-production-orders/hit-production-orders.module.ts +39 -0
  27. package/src/lib/components/hit-receipt-from-productions/hit-receipt-from-production-component.css +10 -0
  28. package/src/lib/components/hit-receipt-from-productions/hit-receipt-from-production-routing.module.ts +19 -0
  29. package/src/lib/components/hit-receipt-from-productions/hit-receipt-from-productions.component.html +106 -0
  30. package/src/lib/components/hit-receipt-from-productions/hit-receipt-from-productions.component.ts +259 -0
  31. package/src/lib/components/hit-receipt-from-productions/hit-receipt-from-productions.module.ts +38 -0
  32. package/src/lib/components/uretim-yonetimi.component.ts +9 -0
  33. package/src/lib/hit-proxy/devexpress-query-builder/devexpress-load-options.model.ts +20 -0
  34. package/src/lib/hit-proxy/devexpress-query-builder/devexpress-query-builder.ts +51 -0
  35. package/src/lib/hit-proxy/hit-create-barcodes/hit-create-barcodes.service.ts +41 -0
  36. package/src/lib/hit-proxy/hit-create-barcodes/models.ts +6 -0
  37. package/src/lib/hit-proxy/hit-issues-for-productions/hit-issues-for-productions.service.ts +39 -0
  38. package/src/lib/hit-proxy/hit-issues-for-productions/models.ts +42 -0
  39. package/src/lib/hit-proxy/hit-production-orders/hit-production-orders.service.ts +60 -0
  40. package/src/lib/hit-proxy/hit-production-orders/models.ts +137 -0
  41. package/src/lib/hit-proxy/hit-receipt-from-productions/hit-receipt-from-productions.service.ts +32 -0
  42. package/src/lib/hit-proxy/hit-receipt-from-productions/models.ts +44 -0
  43. package/src/lib/hit-proxy/models.ts +116 -0
  44. package/src/lib/uretim-yonetimi-routing.module.ts +30 -0
  45. package/src/lib/uretim-yonetimi.component.spec.ts +24 -0
  46. package/src/lib/uretim-yonetimi.module.ts +52 -0
  47. package/src/lib/uretim-yonetimi.service.spec.ts +15 -0
  48. package/{public-api.d.ts → src/public-api.ts} +4 -0
  49. package/src/test.ts +29 -0
  50. package/tsconfig.lib.json +20 -0
  51. package/tsconfig.lib.prod.json +10 -0
  52. package/tsconfig.spec.json +17 -0
  53. package/config/enums/route-names.d.ts +0 -3
  54. package/config/index.d.ts +0 -5
  55. package/config/providers/create-barcode-route.provider.d.ts +0 -9
  56. package/config/providers/issues-for-production-route.provider.d.ts +0 -9
  57. package/config/providers/production-order-route.provider.d.ts +0 -9
  58. package/config/providers/receipt-from-production-route.provider.d.ts +0 -9
  59. package/config/providers/route.provider.d.ts +0 -8
  60. package/config/uretim-yonetimi-config.module.d.ts +0 -8
  61. package/esm2020/config/enums/index.mjs +0 -2
  62. package/esm2020/config/enums/route-names.mjs +0 -2
  63. package/esm2020/config/hitsoft-uretim-yonetimi-config.mjs +0 -5
  64. package/esm2020/config/providers/create-barcode-route.provider.mjs +0 -19
  65. package/esm2020/config/providers/index.mjs +0 -2
  66. package/esm2020/config/providers/issues-for-production-route.provider.mjs +0 -19
  67. package/esm2020/config/providers/production-order-route.provider.mjs +0 -19
  68. package/esm2020/config/providers/receipt-from-production-route.provider.mjs +0 -19
  69. package/esm2020/config/providers/route.provider.mjs +0 -24
  70. package/esm2020/config/public-api.mjs +0 -4
  71. package/esm2020/config/uretim-yonetimi-config.module.mjs +0 -28
  72. package/esm2020/hitsoft-uretim-yonetimi.mjs +0 -5
  73. package/esm2020/lib/components/hit-create-barcodes/hit-create-barcodes-routing.module.mjs +0 -26
  74. package/esm2020/lib/components/hit-create-barcodes/hit-create-barcodes.component.mjs +0 -186
  75. package/esm2020/lib/components/hit-create-barcodes/hit-create-barcodes.module.mjs +0 -65
  76. package/esm2020/lib/components/hit-issues-for-productions/hit-issues-for-productions-routing.module.mjs +0 -26
  77. package/esm2020/lib/components/hit-issues-for-productions/hit-issues-for-productions.component.mjs +0 -252
  78. package/esm2020/lib/components/hit-issues-for-productions/hit-issues-for-productions.module.mjs +0 -68
  79. package/esm2020/lib/components/hit-production-orders/hit-production-orders-routing.module.mjs +0 -26
  80. package/esm2020/lib/components/hit-production-orders/hit-production-orders.component.mjs +0 -153
  81. package/esm2020/lib/components/hit-production-orders/hit-production-orders.module.mjs +0 -65
  82. package/esm2020/lib/components/hit-receipt-from-productions/hit-receipt-from-production-routing.module.mjs +0 -26
  83. package/esm2020/lib/components/hit-receipt-from-productions/hit-receipt-from-productions.component.mjs +0 -217
  84. package/esm2020/lib/components/hit-receipt-from-productions/hit-receipt-from-productions.module.mjs +0 -62
  85. package/esm2020/lib/components/uretim-yonetimi.component.mjs +0 -11
  86. package/esm2020/lib/hit-proxy/devexpress-query-builder/devexpress-load-options.model.mjs +0 -2
  87. package/esm2020/lib/hit-proxy/devexpress-query-builder/devexpress-query-builder.mjs +0 -54
  88. package/esm2020/lib/hit-proxy/hit-create-barcodes/hit-create-barcodes.service.mjs +0 -35
  89. package/esm2020/lib/hit-proxy/hit-create-barcodes/models.mjs +0 -3
  90. package/esm2020/lib/hit-proxy/hit-issues-for-productions/hit-issues-for-productions.service.mjs +0 -35
  91. package/esm2020/lib/hit-proxy/hit-issues-for-productions/models.mjs +0 -24
  92. package/esm2020/lib/hit-proxy/hit-production-orders/hit-production-orders.service.mjs +0 -44
  93. package/esm2020/lib/hit-proxy/hit-production-orders/models.mjs +0 -65
  94. package/esm2020/lib/hit-proxy/hit-receipt-from-productions/hit-receipt-from-productions.service.mjs +0 -30
  95. package/esm2020/lib/hit-proxy/hit-receipt-from-productions/models.mjs +0 -20
  96. package/esm2020/lib/hit-proxy/models.mjs +0 -85
  97. package/esm2020/lib/uretim-yonetimi-routing.module.mjs +0 -33
  98. package/esm2020/lib/uretim-yonetimi.module.mjs +0 -55
  99. package/esm2020/public-api.mjs +0 -6
  100. package/fesm2015/hitsoft-uretim-yonetimi-config.mjs +0 -121
  101. package/fesm2015/hitsoft-uretim-yonetimi-config.mjs.map +0 -1
  102. package/fesm2015/hitsoft-uretim-yonetimi.mjs +0 -1548
  103. package/fesm2015/hitsoft-uretim-yonetimi.mjs.map +0 -1
  104. package/fesm2020/hitsoft-uretim-yonetimi-config.mjs +0 -121
  105. package/fesm2020/hitsoft-uretim-yonetimi-config.mjs.map +0 -1
  106. package/fesm2020/hitsoft-uretim-yonetimi.mjs +0 -1526
  107. package/fesm2020/hitsoft-uretim-yonetimi.mjs.map +0 -1
  108. package/index.d.ts +0 -5
  109. package/lib/components/hit-create-barcodes/hit-create-barcodes-routing.module.d.ts +0 -7
  110. package/lib/components/hit-create-barcodes/hit-create-barcodes.component.d.ts +0 -45
  111. package/lib/components/hit-create-barcodes/hit-create-barcodes.module.d.ts +0 -16
  112. package/lib/components/hit-issues-for-productions/hit-issues-for-productions-routing.module.d.ts +0 -7
  113. package/lib/components/hit-issues-for-productions/hit-issues-for-productions.component.d.ts +0 -48
  114. package/lib/components/hit-issues-for-productions/hit-issues-for-productions.module.d.ts +0 -16
  115. package/lib/components/hit-production-orders/hit-production-orders-routing.module.d.ts +0 -7
  116. package/lib/components/hit-production-orders/hit-production-orders.component.d.ts +0 -44
  117. package/lib/components/hit-production-orders/hit-production-orders.module.d.ts +0 -16
  118. package/lib/components/hit-receipt-from-productions/hit-receipt-from-production-routing.module.d.ts +0 -7
  119. package/lib/components/hit-receipt-from-productions/hit-receipt-from-productions.component.d.ts +0 -57
  120. package/lib/components/hit-receipt-from-productions/hit-receipt-from-productions.module.d.ts +0 -16
  121. package/lib/components/uretim-yonetimi.component.d.ts +0 -5
  122. package/lib/hit-proxy/devexpress-query-builder/devexpress-load-options.model.d.ts +0 -17
  123. package/lib/hit-proxy/devexpress-query-builder/devexpress-query-builder.d.ts +0 -18
  124. package/lib/hit-proxy/hit-create-barcodes/hit-create-barcodes.service.d.ts +0 -23
  125. package/lib/hit-proxy/hit-create-barcodes/models.d.ts +0 -6
  126. package/lib/hit-proxy/hit-issues-for-productions/hit-issues-for-productions.service.d.ts +0 -17
  127. package/lib/hit-proxy/hit-issues-for-productions/models.d.ts +0 -30
  128. package/lib/hit-proxy/hit-production-orders/hit-production-orders.service.d.ts +0 -19
  129. package/lib/hit-proxy/hit-production-orders/models.d.ts +0 -85
  130. package/lib/hit-proxy/hit-receipt-from-productions/hit-receipt-from-productions.service.d.ts +0 -16
  131. package/lib/hit-proxy/hit-receipt-from-productions/models.d.ts +0 -39
  132. package/lib/hit-proxy/models.d.ts +0 -21
  133. package/lib/uretim-yonetimi-routing.module.d.ts +0 -7
  134. package/lib/uretim-yonetimi.module.d.ts +0 -17
  135. /package/config/{enums/index.d.ts → src/enums/index.ts} +0 -0
  136. /package/config/{providers/index.d.ts → src/providers/index.ts} +0 -0
  137. /package/config/{public-api.d.ts → src/public-api.ts} +0 -0
@@ -0,0 +1,213 @@
1
+ import {ABP, ListService, PagedResultDto, TrackByService} from '@abp/ng.core';
2
+ import {Confirmation, ConfirmationService} from '@abp/ng.theme.shared';
3
+ import {DateAdapter} from '@abp/ng.theme.shared/extensions';
4
+ import {
5
+ AfterViewInit,
6
+ ChangeDetectionStrategy,
7
+ Component,
8
+ NgZone,
9
+ OnInit,
10
+ ViewChild,
11
+ } from '@angular/core';
12
+ import {FormBuilder, FormControl, FormGroup, Validators} from '@angular/forms';
13
+ import {NgbDateAdapter} from '@ng-bootstrap/ng-bootstrap';
14
+ import {filter, finalize, switchMap, tap} from 'rxjs/operators';
15
+ import {HitProductionOrdersService} from '../../hit-proxy/hit-production-orders/hit-production-orders.service';
16
+ import {DevExtremeModule, DxNumberBoxComponent, DxTextBoxComponent} from 'devextreme-angular';
17
+ import {GetProductionOrderDto} from '../../hit-proxy/hit-receipt-from-productions/models';
18
+ import {
19
+ BatchNumber,
20
+ ProductionOrderLine,
21
+ ProductionOrderLineForListing,
22
+ ProductionOrderList,
23
+ ProductionOrderPatchDto,
24
+ TuketilenHammadde,
25
+ Warehouse,
26
+ } from '../../hit-proxy/hit-production-orders/models';
27
+ import {firstValueFrom} from 'rxjs';
28
+ import {HitHelper} from '../../hit-proxy/models';
29
+
30
+ @Component({
31
+ selector: 'lib-hit-production-orders',
32
+ changeDetection: ChangeDetectionStrategy.Default,
33
+ providers: [ListService, {provide: NgbDateAdapter, useClass: DateAdapter}],
34
+ templateUrl: './hit-production-orders.component.html',
35
+ styles: [],
36
+ })
37
+ export class HitProductionOrdersComponent implements AfterViewInit, OnInit {
38
+ protected readonly HitHelper = HitHelper;
39
+ @ViewChild('barkodNumarasiRef', {static: false}) nmbBoxBarkodNumarasi: DxTextBoxComponent;
40
+ @ViewChild('hammaddeQRRef', {static: false}) nmbBoxHammaddeQR: DxTextBoxComponent;
41
+ options: Partial<Confirmation.Options> = {
42
+ hideYesBtn: true,
43
+ cancelText: 'Kapat',
44
+ dismissible: false,
45
+ };
46
+
47
+ constructor(
48
+ private ngZone: NgZone,
49
+ public readonly list: ListService,
50
+ public readonly track: TrackByService,
51
+ public readonly service: HitProductionOrdersService,
52
+ private confirmation: ConfirmationService,
53
+ private fb: FormBuilder,
54
+ private productionOrdersService: HitProductionOrdersService
55
+ ) {
56
+ }
57
+
58
+ ngOnInit(): void {
59
+ this.getWarehouses();
60
+ }
61
+
62
+ ngAfterViewInit() {
63
+ this.nmbBoxBarkodNumarasi.instance.focus();
64
+ }
65
+
66
+ isLoading: boolean = false;
67
+ isEmriBarkoduGecerliMi: boolean = false;
68
+ searcheBasildiMi: boolean = false;
69
+ isEmriBarkodu: number;
70
+ hammaddeQR: string = '';
71
+ productionOrder: GetProductionOrderDto;
72
+ productionOrderPatch: ProductionOrderPatchDto;
73
+ productionOrderList: ProductionOrderList;
74
+ qrOkutulduMu: boolean = false;
75
+ unitOfMeasure: string;
76
+
77
+ async getProductionOrderDetails() {
78
+ if (!this.isEmriBarkodu) {
79
+ return;
80
+ }
81
+
82
+ try {
83
+ this.isLoading = true;
84
+ this.isEmriBarkoduGecerliMi = false;
85
+ this.searcheBasildiMi = true;
86
+
87
+ const response = await firstValueFrom(this.productionOrdersService.get(this.isEmriBarkodu));
88
+ const response2 = await this.productionOrdersService.get2(this.isEmriBarkodu).subscribe();
89
+
90
+ if (response?.items) {
91
+ this.unitOfMeasure = response.items.unitOfMeasurement;
92
+ this.productionOrder = response.items;
93
+ this.productionOrderList = new ProductionOrderList();
94
+ this.isEmriBarkoduGecerliMi = true;
95
+ this.ngZone.run(() => {
96
+ setTimeout(() => {
97
+ this.nmbBoxHammaddeQR.instance.focus();
98
+ }, 0);
99
+ });
100
+ }
101
+ } catch (error) {
102
+ this.isEmriBarkoduGecerliMi = false;
103
+ this.searcheBasildiMi = false;
104
+ } finally {
105
+ this.isLoading = false;
106
+ }
107
+ }
108
+
109
+ async parseAndAddQR() {
110
+ if (!this.hammaddeQR) {
111
+ return;
112
+ }
113
+
114
+ const parsed = HitHelper.parseQR(this.hammaddeQR);
115
+
116
+ if (!parsed) {
117
+ this.confirmation.error('', 'Geçersiz barkod!', this.options).subscribe({
118
+ next: () => {
119
+ this.hammaddeQR = '';
120
+ this.nmbBoxHammaddeQR.instance.focus();
121
+ },
122
+ });
123
+ return;
124
+ }
125
+
126
+ const response = await firstValueFrom(
127
+ this.service.getWareHouseInfo(
128
+ parsed.chemicalCode,
129
+ this.productionOrder.absoluteEntry.toString()
130
+ )
131
+ );
132
+
133
+ const response2 = await firstValueFrom(this.service.getItemInfo(parsed.chemicalCode));
134
+
135
+ if (response?.items && response.isSuccessful) {
136
+ const productionOrderLineForListing = new ProductionOrderLineForListing(
137
+ parsed.chemicalCode,
138
+ response2.items.itemName,
139
+ response.items.selectedWarehouse,
140
+ parsed.weightKg,
141
+ parsed.weightKg,
142
+ parsed.lotNumber,
143
+ 202,
144
+ this.productionOrder.absoluteEntry,
145
+ 0
146
+ );
147
+ this.productionOrderList.ProductionOrderLines.push(productionOrderLineForListing);
148
+
149
+ this.qrOkutulduMu = true;
150
+ }
151
+
152
+ this.hammaddeQR = '';
153
+ }
154
+
155
+ patchProductionOrder() {
156
+ this.isLoading = true;
157
+ this.isEmriBarkoduGecerliMi = false;
158
+ const productionOrderLines: ProductionOrderLine[] =
159
+ this.productionOrderList.ProductionOrderLines.map(productionLine => {
160
+ return new ProductionOrderLine(
161
+ productionLine.ItemCode,
162
+ productionLine.WarehouseCode,
163
+ productionLine.Quantity,
164
+ productionLine.Quantity,
165
+ productionLine.Quantity,
166
+ '',
167
+ productionLine.BaseEntry,
168
+ 0,
169
+ [new BatchNumber(productionLine.BatchNumber, productionLine.Quantity)]
170
+ );
171
+ });
172
+ this.productionOrderPatch = new ProductionOrderPatchDto(productionOrderLines);
173
+
174
+ this.service.patch(this.productionOrderPatch).subscribe({
175
+ next: result => {
176
+ if (result.isSuccessful) {
177
+ this.confirmation.success('', 'İşlem başarılı!', this.options).subscribe(() => {
178
+ });
179
+ }
180
+ },
181
+ });
182
+ this.clearAll();
183
+ this.isLoading = false;
184
+ }
185
+
186
+ clearAll() {
187
+ this.isEmriBarkoduGecerliMi = false;
188
+ this.searcheBasildiMi = false;
189
+ this.qrOkutulduMu = false;
190
+ this.productionOrderPatch = null;
191
+ this.isEmriBarkodu = null;
192
+ this.hammaddeQR = '';
193
+ this.productionOrder = null;
194
+ this.unitOfMeasure = null;
195
+ this.ngZone.run(() => {
196
+ setTimeout(() => {
197
+ this.nmbBoxBarkodNumarasi.instance.focus();
198
+ }, 0);
199
+ });
200
+ }
201
+
202
+ warehouses: Warehouse[] = [];
203
+
204
+ getWarehouses() {
205
+ this.isLoading = true;
206
+ this.service.getWarehouses().subscribe(result => {
207
+ if (result.items) {
208
+ this.warehouses = result.items.slice();
209
+ }
210
+ });
211
+ this.isLoading = false;
212
+ }
213
+ }
@@ -0,0 +1,39 @@
1
+ import {CoreModule} from '@abp/ng.core';
2
+ import {ThemeSharedModule} from '@abp/ng.theme.shared';
3
+ import {NgModule} from '@angular/core';
4
+ import {
5
+ NgbCollapseModule,
6
+ NgbDatepickerModule,
7
+ NgbDropdownModule,
8
+ } from '@ng-bootstrap/ng-bootstrap';
9
+ import {NgxValidateCoreModule} from '@ngx-validate/core';
10
+ import {CommercialUiModule} from '@volo/abp.commercial.ng.ui';
11
+ import {PageModule} from '@abp/ng.components/page';
12
+ import {HitProductionOrdersComponent} from "./hit-production-orders.component";
13
+ import {HitProductionOrdersRoutingModule} from "./hit-production-orders-routing.module";
14
+ import {DxButtonModule, DxDataGridModule, DxNumberBoxModule, DxTextBoxModule} from "devextreme-angular";
15
+
16
+ @NgModule({
17
+ declarations: [HitProductionOrdersComponent],
18
+ imports: [
19
+ HitProductionOrdersRoutingModule,
20
+ CoreModule,
21
+ ThemeSharedModule,
22
+ CommercialUiModule,
23
+ NgxValidateCoreModule,
24
+ NgbCollapseModule,
25
+ NgbDatepickerModule,
26
+ NgbDropdownModule,
27
+ PageModule,
28
+ DxTextBoxModule,
29
+ DxButtonModule,
30
+ DxDataGridModule,
31
+ DxNumberBoxModule
32
+ ],
33
+ })
34
+ export class HitProductionOrderModule {
35
+ }
36
+
37
+ export function loadHitProductionOrdersAsChild() {
38
+ return Promise.resolve(HitProductionOrderModule);
39
+ }
@@ -0,0 +1,10 @@
1
+ .mobilde-gorunur {
2
+ display: none;
3
+ }
4
+
5
+ /* Ekran genişliği 768px veya daha küçükse (mobil cihazlar) görünür yap */
6
+ @media (max-width: 768px) {
7
+ .mobilde-gorunur {
8
+ display: block; /* ya da inline-block / flex — ne gerekiyorsa */
9
+ }
10
+ }
@@ -0,0 +1,19 @@
1
+ import {AuthGuard, PermissionGuard} from '@abp/ng.core';
2
+ import {NgModule} from '@angular/core';
3
+ import {RouterModule, Routes} from '@angular/router';
4
+ import {HitReceiptFromProductionsComponent} from "./hit-receipt-from-productions.component";
5
+
6
+ const routes: Routes = [
7
+ {
8
+ path: '',
9
+ component: HitReceiptFromProductionsComponent,
10
+ canActivate: [AuthGuard, PermissionGuard],
11
+ },
12
+ ];
13
+
14
+ @NgModule({
15
+ imports: [RouterModule.forChild(routes)],
16
+ exports: [RouterModule],
17
+ })
18
+ export class HitReceiptFromProductionRoutingModule {
19
+ }
@@ -0,0 +1,106 @@
1
+ <abp-page [breadcrumb]="false" style="padding: 0;">
2
+ <abp-page-toolbar-container class="col">
3
+ <div class="row">
4
+ <h3 class="page-title">
5
+ {{ 'UretimYonetimi::ReceiptFromProductions.Title' | abpLocalization }}
6
+ </h3>
7
+ </div>
8
+ <div class="row text-lg-end pt-2">
9
+ <div class="col-8">
10
+ <button class="btn btn-success btn-sm" type="button"
11
+ (click)="postReceiptFromProductions()"
12
+ [disabled]="!isProductionOrderValid">
13
+ <i class="fa fa-plus me-1" aria-hidden="true"></i>
14
+ {{ 'UretimYonetimi::ReceiptFromProductions.Create' | abpLocalization }}
15
+ </button>
16
+ </div>
17
+ <div class="col-4">
18
+ <button class="btn btn-warning btn-sm" type="button" (click)="clearAll()">
19
+ <i class="fa fa-broom me-1" aria-hidden="true"></i>
20
+ {{ 'UretimYonetimi::ReceiptFromProductions.Clean' | abpLocalization }}
21
+ </button>
22
+ </div>
23
+ </div>
24
+ </abp-page-toolbar-container>
25
+ <div class="card">
26
+ <div class="card-body">
27
+ <div style="display: flex; align-items: center;">
28
+ <dx-number-box class="me-1 w-100"
29
+ #barkodNumarasiRef
30
+ [label]="'UretimYonetimi::ReceiptFromProductions.WorkOrderNo' | abpLocalization"
31
+ [(value)]="barkodNumarasi"
32
+ (onChange)="getProductionOrder()"
33
+ (onEnterKey)="getProductionOrder()"
34
+ [disabled]="searcheBasildiMi || isProductionOrderValid">
35
+ </dx-number-box>
36
+ <dx-button style="margin-top: 7.5px;" icon="search" type="default"
37
+ (onClick)="getProductionOrder()"
38
+ [disabled]="searcheBasildiMi || isProductionOrderValid">
39
+ </dx-button>
40
+ </div>
41
+ <div *ngIf="isProductionOrderValid">
42
+ <dx-text-box [label]="'UretimYonetimi::ReceiptFromProductions.StokCode' | abpLocalization"
43
+ [(value)]="productionOrder.itemNo"
44
+ [disabled]="true">
45
+ </dx-text-box>
46
+
47
+ <dx-text-box [label]="'UretimYonetimi::ReceiptFromProductions.StokDesc' | abpLocalization"
48
+ [(value)]="productionOrder.productDescription"
49
+ [maxLength]="128" [disabled]="true">
50
+ </dx-text-box>
51
+
52
+ <dx-text-box style="width:100%;"
53
+ [label]="'UretimYonetimi::ReceiptFromProductions.Boiler' | abpLocalization"
54
+ [(value)]="productionOrder.u_Kazan" [disabled]="true">
55
+ </dx-text-box>
56
+
57
+ <dx-text-box [label]="'UretimYonetimi::ReceiptFromProductions.ToWhs' | abpLocalization" [maxLength]="128"
58
+ [value]="getWarehouseName(receiptFromProductionsPostDtoDocumentLine.warehouseCode)"
59
+ [disabled]="true">
60
+ </dx-text-box>
61
+
62
+ <dx-text-box [label]="'UretimYonetimi::ReceiptFromProductions.BatchNumber' | abpLocalization"
63
+ [(value)]="receiptFromProductionsPostDtoBatchNumber.batchNumber"
64
+ [maxLength]="128" [disabled]="true">
65
+ </dx-text-box>
66
+
67
+ <dx-number-box [label]="'UretimYonetimi::ReceiptFromProductions.PlannedQty' | abpLocalization"
68
+ [(value)]="productionOrder.plannedQuantity"
69
+ [format]="HitHelper.getMeasurementFormatted(unitOfMeasure)"
70
+ [disabled]="true">
71
+ </dx-number-box>
72
+
73
+ <dx-number-box [label]="'UretimYonetimi::ReceiptFromProductions.CompletedQty' | abpLocalization"
74
+ [(value)]="productionOrder.completedQuantity"
75
+ [format]="HitHelper.getMeasurementFormatted(unitOfMeasure)"
76
+ [disabled]="true">
77
+ </dx-number-box>
78
+
79
+ <dx-number-box [label]="'UretimYonetimi::ReceiptFromProductions.Quantity' | abpLocalization"
80
+ [(value)]="receiptFromProductionsPostDtoBatchNumber.quantity"
81
+ (onValueChanged)="quantityChanged($event)"
82
+ [format]="HitHelper.getMeasurementFormatted(unitOfMeasure)"
83
+ [showSpinButtons]="true" [min]="0" #toplananMiktarRef>
84
+ </dx-number-box>
85
+ </div>
86
+ </div>
87
+ </div>
88
+ </abp-page>
89
+
90
+ <abp-modal [(visible)]="showModal" (appear)="generateReport()" (disappear)="clearAll()">
91
+ <ng-template #abpHeader>
92
+ <h3>{{ 'UretimYonetimi::CreateBarcodes.BarcodePreview' | abpLocalization }}</h3>
93
+ </ng-template>
94
+ <ng-template #abpBody>
95
+ <iframe *ngIf="pdfSrc" [src]="pdfSrc" width="100%" height="300"
96
+ webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
97
+ </ng-template>
98
+ <ng-template #abpFooter>
99
+ <button (click)="downloadPdf(blobUrl)" type="button"
100
+ class="btn btn-secondary mobilde-gorunur" abpClose> İndir
101
+ </button>
102
+ <button type="button"
103
+ class="btn btn-secondary" abpClose> {{ 'UretimYonetimi::CreateBarcodes.Close' | abpLocalization }}
104
+ </button>
105
+ </ng-template>
106
+ </abp-modal>
@@ -0,0 +1,259 @@
1
+ import { ListService, TrackByService } from '@abp/ng.core';
2
+ import { ConfirmationService, Confirmation } from '@abp/ng.theme.shared';
3
+ import { DateAdapter } from '@abp/ng.theme.shared/extensions';
4
+ import {
5
+ AfterViewInit,
6
+ ChangeDetectionStrategy,
7
+ Component,
8
+ NgZone,
9
+ OnInit,
10
+ ViewChild,
11
+ } from '@angular/core';
12
+ import { NgbDateAdapter } from '@ng-bootstrap/ng-bootstrap';
13
+ import { HitReceiptFromProductionsService } from '../../hit-proxy/hit-receipt-from-productions/hit-receipt-from-productions.service';
14
+ import {
15
+ GetProductionOrderDto,
16
+ ReceiptFromProductionsBatchNumbers,
17
+ ReceiptFromProductionsLines,
18
+ ReceiptFromProductionsPostDto,
19
+ } from '../../hit-proxy/hit-receipt-from-productions/models';
20
+ import { HitProductionOrdersService } from '../../hit-proxy/hit-production-orders/hit-production-orders.service';
21
+ import { HitHelper } from '../../hit-proxy/models';
22
+ import { DxNumberBoxComponent, DxTextBoxComponent } from 'devextreme-angular';
23
+ import { Warehouse } from '../../hit-proxy/hit-production-orders/models';
24
+ import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser';
25
+
26
+ @Component({
27
+ selector: 'lib-hit-receipt-from-productions',
28
+ changeDetection: ChangeDetectionStrategy.Default,
29
+ providers: [ListService, { provide: NgbDateAdapter, useClass: DateAdapter }],
30
+ templateUrl: './hit-receipt-from-productions.component.html',
31
+ styles: [],
32
+ styleUrls: ['./hit-receipt-from-production-component.css'],
33
+ })
34
+ export class HitReceiptFromProductionsComponent implements OnInit, AfterViewInit {
35
+ protected readonly HitHelper = HitHelper;
36
+ @ViewChild('barkodNumarasiRef', { static: false }) nmbBoxBarkodNumarasi: DxTextBoxComponent;
37
+ @ViewChild('toplananMiktarRef', { static: false }) nmbBoxToplananMiktar: DxNumberBoxComponent;
38
+ isLoading = false;
39
+ options: Partial<Confirmation.Options> = {
40
+ hideYesBtn: true,
41
+ cancelText: 'Kapat',
42
+ dismissible: false,
43
+ };
44
+
45
+ constructor(
46
+ private ngZone: NgZone,
47
+ public readonly list: ListService,
48
+ public readonly track: TrackByService,
49
+ public readonly service: HitReceiptFromProductionsService,
50
+ private confirmation: ConfirmationService,
51
+ private productionOrdersService: HitProductionOrdersService,
52
+ private sanitizer: DomSanitizer
53
+ ) {}
54
+
55
+ ngOnInit(): void {
56
+ this.clearAll();
57
+ this.getWarehouses();
58
+ }
59
+
60
+ ngAfterViewInit() {
61
+ this.focusOnBarkodNumarasi();
62
+ }
63
+
64
+ barkodNumarasi: number;
65
+ isProductionOrderValid: boolean = false;
66
+ searcheBasildiMi: boolean = false;
67
+ unitOfMeasure: string;
68
+ blobUrl: string;
69
+ showModal: boolean = false;
70
+ pdfSrc: SafeResourceUrl | null = null;
71
+ newRecordDocEntry: number;
72
+ isEmriNumarasiForBarcode: number;
73
+
74
+ generateReport() {
75
+ this.service
76
+ .getBarcodeInfo(this.isEmriNumarasiForBarcode, this.newRecordDocEntry, 1)
77
+ .subscribe({
78
+ next: response => {
79
+ const base64Data = response.base64; // base64 string (sadece veri kısmı, "data:application/pdf;base64,..." değilse)
80
+
81
+ // Base64'ü decode edip binary veriye çeviriyoruz
82
+ const byteCharacters = atob(base64Data);
83
+ const byteNumbers = new Array(byteCharacters.length);
84
+ for (let i = 0; i < byteCharacters.length; i++) {
85
+ byteNumbers[i] = byteCharacters.charCodeAt(i);
86
+ }
87
+ const byteArray = new Uint8Array(byteNumbers);
88
+
89
+ // Blob oluşturuyoruz
90
+ const blob = new Blob([byteArray], { type: 'application/pdf' });
91
+
92
+ // Blob'tan URL oluşturup yeni sekmede açıyoruz (veya download edebilirsin)
93
+ this.blobUrl = URL.createObjectURL(blob);
94
+ this.pdfSrc = this.bypassAndSanitize(this.blobUrl);
95
+ },
96
+ });
97
+ }
98
+
99
+ bypassAndSanitize(url): SafeResourceUrl {
100
+ return this.sanitizer.bypassSecurityTrustResourceUrl(url);
101
+ }
102
+
103
+ downloadPdf(blobUrl) {
104
+ const a = document.createElement('a');
105
+ a.href = blobUrl;
106
+ const parts = blobUrl.split('/');
107
+ const lastPart = parts.pop(); // "myfile.pdf"
108
+ a.download = lastPart + '.pdf'; // Kaydedilecek dosya adı
109
+ a.style.display = 'none';
110
+
111
+ // iOS'ta desteklenmesi için target=_blank eklenebilir
112
+ a.target = '_blank';
113
+
114
+ // DOM'a ekleyip tıklat
115
+ document.body.appendChild(a);
116
+ a.click();
117
+ document.body.removeChild(a);
118
+ }
119
+
120
+ productionOrder: GetProductionOrderDto = new GetProductionOrderDto();
121
+
122
+ async getProductionOrder() {
123
+ this.clearForm();
124
+ this.isLoading = true;
125
+ this.searcheBasildiMi = true;
126
+ this.productionOrdersService.get(this.barkodNumarasi).subscribe({
127
+ next: result => {
128
+ if (result.isSuccessful) {
129
+ this.productionOrder = result.items;
130
+ this.receiptFromProductionsPostDtoQuantity =
131
+ result.items.plannedQuantity - result.items.completedQuantity;
132
+
133
+ this.receiptFromProductionsPostDtoDocumentLine.baseEntry = this.barkodNumarasi;
134
+ this.receiptFromProductionsPostDtoDocumentLine.baseType = 202;
135
+ this.receiptFromProductionsPostDtoDocumentLine.quantity =
136
+ this.receiptFromProductionsPostDtoQuantity;
137
+ this.receiptFromProductionsPostDtoDocumentLine.warehouseCode = result.items.warehouse;
138
+ this.receiptFromProductionsPostDtoBatchNumber.batchNumber = result.items.u_trkBatch;
139
+ this.receiptFromProductionsPostDtoBatchNumber.quantity =
140
+ this.receiptFromProductionsPostDtoQuantity;
141
+
142
+ this.unitOfMeasure = result.items.unitOfMeasurement;
143
+ this.isProductionOrderValid = true;
144
+ this.focusOnToplananMiktar();
145
+ } else {
146
+ if (result?.isSuccessful == false) {
147
+ this.confirmation.status$.subscribe({
148
+ next: () => {
149
+ this.clearAll();
150
+ },
151
+ });
152
+ }
153
+ }
154
+ },
155
+ });
156
+
157
+ this.isLoading = false;
158
+ }
159
+
160
+ receiptFromProductionsPostDtoQuantity: number = 0;
161
+ receiptFromProductionsPostDto: ReceiptFromProductionsPostDto =
162
+ new ReceiptFromProductionsPostDto();
163
+ receiptFromProductionsPostDtoDocumentLine: ReceiptFromProductionsLines =
164
+ new ReceiptFromProductionsLines();
165
+ receiptFromProductionsPostDtoBatchNumber: ReceiptFromProductionsBatchNumbers =
166
+ new ReceiptFromProductionsBatchNumbers();
167
+
168
+ async postReceiptFromProductions() {
169
+ this.isLoading = true;
170
+ this.isProductionOrderValid = false;
171
+ this.receiptFromProductionsPostDtoDocumentLine.batchNumbers = [
172
+ this.receiptFromProductionsPostDtoBatchNumber,
173
+ ];
174
+ this.receiptFromProductionsPostDto.documentLines = [
175
+ this.receiptFromProductionsPostDtoDocumentLine,
176
+ ];
177
+
178
+ this.service.create(this.receiptFromProductionsPostDto).subscribe({
179
+ next: result => {
180
+ if (result.isSuccessful) {
181
+ this.confirmation.success('İşlem Başarılı', '', this.options).subscribe(() => {
182
+ this.newRecordDocEntry = result.items.docEntry;
183
+ this.isEmriNumarasiForBarcode = this.barkodNumarasi;
184
+ this.showModal = true;
185
+ this.clearAll();
186
+ });
187
+ } else {
188
+ this.confirmation.status$.subscribe(() => {
189
+ this.focusOnToplananMiktar();
190
+ });
191
+ }
192
+ },
193
+ error: () => {
194
+ this.confirmation.status$.subscribe(() => {
195
+ this.clearAll();
196
+ this.focusOnToplananMiktar();
197
+ });
198
+ },
199
+ });
200
+
201
+ this.isLoading = false;
202
+ }
203
+
204
+ clearAll() {
205
+ this.barkodNumarasi = null;
206
+ this.clearForm();
207
+ }
208
+
209
+ clearForm() {
210
+ this.productionOrder = new GetProductionOrderDto();
211
+ this.receiptFromProductionsPostDto = new ReceiptFromProductionsPostDto();
212
+ this.receiptFromProductionsPostDtoDocumentLine = new ReceiptFromProductionsLines();
213
+ this.receiptFromProductionsPostDtoBatchNumber = new ReceiptFromProductionsBatchNumbers();
214
+ this.unitOfMeasure = null;
215
+ this.isProductionOrderValid = false;
216
+ this.searcheBasildiMi = false;
217
+ this.focusOnBarkodNumarasi();
218
+ }
219
+
220
+ warehouses: Warehouse[] = [];
221
+
222
+ async getWarehouses() {
223
+ this.isLoading = true;
224
+ this.productionOrdersService.getWarehouses().subscribe({
225
+ next: result => {
226
+ if (result.items) {
227
+ this.warehouses = result.items.slice();
228
+ }
229
+ },
230
+ });
231
+ this.isLoading = false;
232
+ }
233
+
234
+ focusOnBarkodNumarasi() {
235
+ this.ngZone.run(() => {
236
+ setTimeout(() => {
237
+ this.nmbBoxBarkodNumarasi.instance.focus();
238
+ }, 0);
239
+ });
240
+ }
241
+
242
+ focusOnToplananMiktar() {
243
+ this.ngZone.run(() => {
244
+ setTimeout(() => {
245
+ this.nmbBoxToplananMiktar.instance.focus();
246
+ }, 0);
247
+ });
248
+ }
249
+
250
+ getWarehouseName(code: string): string {
251
+ const match = this.warehouses.find(x => x.whsCode === code);
252
+ return match ? match.whsName : '';
253
+ }
254
+
255
+ quantityChanged(e: any) {
256
+ this.receiptFromProductionsPostDtoBatchNumber.quantity = e.value;
257
+ this.receiptFromProductionsPostDtoDocumentLine.quantity = e.value;
258
+ }
259
+ }
@@ -0,0 +1,38 @@
1
+ import {CoreModule} from '@abp/ng.core';
2
+ import {ThemeSharedModule} from '@abp/ng.theme.shared';
3
+ import {NgModule} from '@angular/core';
4
+ import {
5
+ NgbCollapseModule,
6
+ NgbDatepickerModule,
7
+ NgbDropdownModule,
8
+ } from '@ng-bootstrap/ng-bootstrap';
9
+ import {NgxValidateCoreModule} from '@ngx-validate/core';
10
+ import {CommercialUiModule} from '@volo/abp.commercial.ng.ui';
11
+ import {PageModule} from '@abp/ng.components/page';
12
+ import {HitReceiptFromProductionsComponent} from "./hit-receipt-from-productions.component";
13
+ import {HitReceiptFromProductionRoutingModule} from "./hit-receipt-from-production-routing.module";
14
+ import {DevExtremeModule, DxButtonModule, DxNumberBoxModule} from "devextreme-angular";
15
+
16
+ @NgModule({
17
+ declarations: [HitReceiptFromProductionsComponent],
18
+ imports: [
19
+ HitReceiptFromProductionRoutingModule,
20
+ CoreModule,
21
+ ThemeSharedModule,
22
+ CommercialUiModule,
23
+ NgxValidateCoreModule,
24
+ NgbCollapseModule,
25
+ NgbDatepickerModule,
26
+ NgbDropdownModule,
27
+ PageModule,
28
+ DxButtonModule,
29
+ DxNumberBoxModule,
30
+ DevExtremeModule,
31
+ ],
32
+ })
33
+ export class HitReceiptFromProductionsModule {
34
+ }
35
+
36
+ export function loadHitReceiptFromProductionsAsChild() {
37
+ return Promise.resolve(HitReceiptFromProductionsModule);
38
+ }