-login guard
All checks were successful
Build Docker Image / Preparing Dependecies (push) Successful in 4s

-caching
-budget
This commit is contained in:
2025-11-19 18:30:35 +07:00
parent 213fd197ef
commit 15308ababa
25 changed files with 667 additions and 479 deletions

View File

@@ -1,7 +1,9 @@
:host {
display: block;
padding: 2rem clamp(1.25rem, 4vw, 3rem) 3rem;
background: radial-gradient(120% 120% at 0% 0%, #f6f8ff 0%, #eef5ff 55%, #ffffff 100%);
/* background: radial-gradient(120% 120% at 0% 0%, #f6f8ff 0%, #eef5ff 55%, #ffffff 100%); */
/* background: white; */
background-color: var(--color-gray-100);
min-height: 100%;
}
@@ -643,4 +645,4 @@
max-height: 25rem;
overflow-y: auto;
padding-right: 0.5rem;
}
}

View File

@@ -2,7 +2,7 @@
<!-- Summary Cards -->
<div class="grid grid-cols-1 sm:grid-cols-3 gap-6 mb-8">
<!--
<div class="bg-white border border-gray-200 rounded-2xl p-5 shadow-sm hover:shadow-md transition">
<div class="text-gray-500 text-sm">งบทั้งหมด</div>
<div class="text-3xl font-bold text-gray-800 mt-1">
@@ -25,7 +25,7 @@
>
{{ remainingBudget | number:'1.0-2' }} บาท
</div>
</div>
</div> -->
</div>
@@ -38,6 +38,8 @@
</button>
</div>
<!-- Table -->
<div class="overflow-x-auto bg-white border border-gray-200 rounded-2xl shadow-sm">
<table class="min-w-full text-left border-collapse">
@@ -55,90 +57,67 @@
</tr>
</thead>
<tbody>
<tr
*ngFor="let p of projects; let i = index"
class="border-b border-gray-100 hover:bg-blue-50/20 transition"
>
<td class="py-4 px-4 text-gray-700">{{ i + 1 }}</td>
<tbody>
<tr *ngFor="let p of projects; let i = index"class="border-b border-gray-100 hover:bg-blue-50/20 transition">
<td class="py-4 px-4 text-gray-700">{{ i + 1 }}</td>
<td class="py-4 px-4 font-medium text-gray-700"> {{ p.code }}</td>
<td class="py-4 px-4 text-gray-800 font-semibold leading-tight">{{ p.name }}</td>
<td class="py-4 px-4 text-gray-700">{{ p.owner }}</td>
<td class="py-4 px-4 text-blue-700 font-bold whitespace-nowrap"> {{ p.budget | number:'1.0-0' }} บาท</td>
<td class="py-4 px-4 font-medium text-gray-700">
{{ p.code }}
</td>
<td class="py-4 px-4 w-64">
<!-- <select class="w-full px-4 py-2.5 border border-gray-300 rounded-xl bg-white
focus:outline-none focus:ring-2 focus:ring-blue-200 focus:border-blue-300
text-sm transition">
<option value="">ไม่เลือก</option>
@for (item of budgetCategoriesDrop.expense; track item.dtlcod) {
<option [value]="item.dtlcod">
{{ item.dtlnam }}
</option>
}
</select> -->
{{ p.bdgnam }}
</td>
<td class="py-4 px-4 text-gray-800 font-semibold leading-tight">
{{ p.name }}
</td>
<td class="py-4 px-4 w-40">
<!-- <input type="number" class="w-full px-4 py-2.5 border border-gray-300 rounded-xl bg-white focus:outline-none focus:ring-2 focus:ring-blue-200 focus:border-blue-300 text-sm transition"/> -->
{{ p.acp }} บาท
</td>
<td class="py-4 px-4 text-gray-700">
{{ p.owner }}
</td>
<td class="py-4 px-4 text-center">
<span
class="px-3 py-1.5 rounded-full text-xs font-semibold inline-flex items-center gap-1
shadow-sm border"
[ngClass]="{
'bg-yellow-50 text-yellow-700 border-yellow-200': p.status === 'WAIT',
'bg-green-50 text-green-700 border-green-200': p.status === 'APPROVED',
'bg-red-50 text-red-700 border-red-200': p.status === 'REJECTED'
}"
>
<ng-container *ngIf="p.status === 'APPROVED'">อนุมัติแล้ว</ng-container>
<ng-container *ngIf="p.status === 'WAIT'">รออนุมัติ</ng-container>
<ng-container *ngIf="p.status === 'REJECTED'">ไม่อนุมัติ</ng-container>
</span>
</td>
<td class="py-4 px-4 text-blue-700 font-bold whitespace-nowrap">
{{ p.budget | number:'1.0-0' }} บาท
</td>
<td class="py-4 px-4 text-center space-x-2 whitespace-nowrap">
<td class="py-4 px-4 w-64">
<select
class="w-full px-4 py-2.5 border border-gray-300 rounded-xl bg-white
focus:outline-none focus:ring-2 focus:ring-blue-200 focus:border-blue-300
text-sm transition"
>
<option value="">ไม่เลือก</option>
@for (item of budgetCategoriesDrop.expense; track item.dtlcod) {
<option [value]="item.dtlcod">
{{ item.dtlnam }}
</option>
}
</select>
</td>
<td class="py-4 px-4 w-40">
<input
type="number"
class="w-full px-4 py-2.5 border border-gray-300 rounded-xl bg-white
focus:outline-none focus:ring-2 focus:ring-blue-200 focus:border-blue-300
text-sm transition"
/>
</td>
<td class="py-4 px-4 text-center">
<span
class="px-3 py-1.5 rounded-full text-xs font-semibold inline-flex items-center gap-1
shadow-sm border"
[ngClass]="{
'bg-yellow-50 text-yellow-700 border-yellow-200': p.status === 'WAIT',
'bg-green-50 text-green-700 border-green-200': p.status === 'APPROVED',
'bg-red-50 text-red-700 border-red-200': p.status === 'REJECTED'
}"
>
<ng-container *ngIf="p.status === 'APPROVED'">อนุมัติแล้ว</ng-container>
<ng-container *ngIf="p.status === 'WAIT'">รออนุมัติ</ng-container>
<ng-container *ngIf="p.status === 'REJECTED'">ไม่อนุมัติ</ng-container>
</span>
</td>
<td class="py-4 px-4 text-center space-x-2 whitespace-nowrap">
<button
class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-xl text-sm
shadow-sm font-medium transition"
(click)="openBudgetDetail(p)"
>
จัดการงบประมาณ
</button>
<button
class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-xl text-sm
shadow-sm font-medium transition"
(click)="openBudgetDetail(p)">
จัดสรรงบประมาณ
</button>
</td>
</tr>
</tbody>
</td>
</tr>
</tbody>
</table>
<!-- endtable -->
</div>
</table>
</div>
<!-- Pagination
<div class="flex justify-end items-center gap-3 mt-5">
<button class="px-4 py-2 border border-gray-300 rounded-xl bg-white hover:bg-gray-100">

View File

@@ -27,9 +27,9 @@ export class MainManagerComponent implements OnInit {
projects = [
{ code: 'PRJ001', name: 'ระบบจัดการน้ำดื่ม', owner: 'นาย A', budget: 20000, status: 'WAIT' },
{ code: 'PRJ002', name: 'ปรับปรุงอาคาร B', owner: 'นางสาว B', budget: 45000, status: 'WAIT' },
{ code: 'PRJ003', name: 'ซื้อคอมพิวเตอร์', owner: 'นาย C', budget: 30000, status: 'APPROVED' }
{ code: 'PRJ001', name: 'ระบบจัดการน้ำดื่ม', owner: 'นาย A', budget: 20000, status: 'WAIT', acp: 0, bdgnam: 'ยังไมจัดสรร' },
{ code: 'PRJ002', name: 'ปรับปรุงอาคาร B', owner: 'นางสาว B', budget: 45000, status: 'WAIT', acp: 0, bdgnam: 'ยังไมจัดสรร'},
{ code: 'PRJ003', name: 'ซื้อคอมพิวเตอร์', owner: 'นาย C', budget: 30000, status: 'APPROVED', acp: 20000, bdgnam: 'งบดำเนินงาน' }
];
approveProject(p: any) {