department-list.component.html 35.1 KB
Newer Older
1
<div class="flex justify-end pt-2rem">
2
    <div class="px-1">
3 4
        <div class="relative shadow-md">
            <input type="text" id="hs-leading-icon" name="hs-leading-icon"
LAPTOP-CV4JFSHE\kantavee committed
5
                class="ti-form-input ltr:pl-11 rtl:pr-11 focus:z-10 " placeholder="Search by No. or Name"
6 7
                [(ngModel)]="bu2Table.search" (ngModelChange)="onBu2TableSearchChange()">

8 9 10
            <div
                class="absolute inset-y-0 ltr:left-0 rtl:right-0 flex items-center pointer-events-none z-20 ltr:pl-4 rtl:pr-4">
                <i class="ri-search-line text-gray"></i>
11 12 13 14
            </div>
        </div>
    </div>
    <div class="px-1">
15
        <button type="button" class="ti-btn ti-btn-soft-secondary h-45px m-0 shadow-md"
16
            (click)="currentModal='add';selectBu1();selectBu2()" data-hs-overlay="#department-list-modal-add">
17 18 19
            <i class="ri-add-line"></i>
            Add
        </button>
20 21
    </div>
    <div class="px-1">
22 23 24 25
        <button href="javascript:void(0);" class="ti-btn ti-btn-soft-info h-45px m-0 shadow-md">
            <i class="ri-printer-line"></i>
            Print
        </button>
26 27
    </div>
    <div class="px-1">
28 29 30
        <button href="javascript:void(0);" class="ti-btn ti-btn-soft-warning h-45px m-0 shadow-md">
            <i class="ti ti-book fs-l"></i>
            Help
31 32 33 34
        </button>
    </div>
</div>

35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
<div class="page px-rem">
    <div class="border-b border-gray-200 dark:border-white/10">
        <nav class="flex space-x-2 rtl:space-x-reverse">
            <a class="justify-center rounded-t-sm hs-tab-active:!bg-primary hs-tab-active:border-primary hs-tab-active:!text-white -mb-px py-2 px-3 inline-flex items-center gap-2 text-sm font-medium text-center border-2 text-gray-600 hover:text-gray-900 dark:bg-black/20 dark:border-white/10 dark:text-white/70 dark:hover:text-gray-300 active"
                href="javascript:void(0);" id="card-type-item-1" data-hs-tab="#card-type-1" aria-controls="card-type-1">
                นำเข้าข้อมูล
            </a>
            <a class="justify-center  -mb-px  inline-flex items-center gap-2 text-sm font-medium text-center text-secondary border-secondary border-b-2 dark:bg-black/20 dark:border-white/10 dark:text-white/70 dark:hover:text-gray-300 align-items-end"
                href="javascript:void(0);">
                ดาวโหลดตัวอย่างไฟล์
            </a>
        </nav>
    </div>
    <div id="card-type-1" role="tabpanel" aria-labelledby="card-type-item-1">
        <div class="overflow-auto shadow-md">
50
            <table class="ti-custom-table ti-custom-table-head">
51
                <thead>
52 53
                    <tr>
                        <ng-container
54
                            *ngFor="let item of ['ลำดับ','รหัสแผนก','รายละเอียดแผนก (ไทย)','รายละเอียดแผนก (อังกฤษ)','การจัดการ']; let f = first; let l = last">
55 56
                            <th scope="col" class="relative px-10px py-10px bg-soft-secondary text-primary"
                                [class.!text-center]="f||l">
57
                                <span class="!text-sm">{{ item }}</span>
58
                                <div class="absolute top-1/2 transform -translate-y-1/2 right-0" *ngIf="!l">
59
                                    <i class="ti ti-dots-vertical fs-l"></i>
60 61 62 63 64
                                </div>
                            </th>
                        </ng-container>
                    </tr>
                </thead>
65
                <tbody *ngIf="!filterBu2Table().length">
LAPTOP-CV4JFSHE\kantavee committed
66 67 68 69 70 71
                    <tr>
                        <td class="text-center" colspan="100%">
                            ไม่พบข้อมูล
                        </td>
                    </tr>
                </tbody>
72
                <tbody *ngIf="filterBu2Table().length">
LAPTOP-CV4JFSHE\kantavee committed
73
                    <tr
74
                        *ngFor="let item of filterBu2Table() | slice:((bu2Table.currentPage-1) * 10) : (((bu2Table.currentPage-1) * 10) + 10);let i = index">
75
                        <td class="flex justify-center">
76
                            {{((bu2Table.currentPage-1) * 10)+(i+1)}}
LAPTOP-CV4JFSHE\kantavee committed
77 78 79 80 81
                        </td>
                        <td>{{item.bu2id}}</td>
                        <td>{{item.tdesc}}</td>
                        <td>{{item.edesc}}</td>
                        <td class="flex justify-center">
82 83
                            <i class="ti ti-edit cursor-pointer i-gray fs-l px-1"
                                (click)="selectBu2(item);currentModal='edit'"
LAPTOP-CV4JFSHE\kantavee committed
84 85
                                data-hs-overlay="#department-list-modal-edit"></i>
                            <i class="ti ti-trash cursor-pointer i-gray fs-l px-1" (click)="deleteBu2(item)"></i>
86 87 88 89 90
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
91
        <nav class="pagination-style-3 overflow-auto my-5" *ngIf="bu2Table.page.length">
LAPTOP-CV4JFSHE\kantavee committed
92 93 94
            <ul class="ti-pagination">
                <li>
                    <a aria-label="anchor" class="page-link" href="javascript:void(0);"
95
                        (click)="bu2Table.currentPage = (bu2Table.currentPage-1 || 1)">
LAPTOP-CV4JFSHE\kantavee committed
96 97 98
                        <i class="ri-arrow-left-s-line align-middle rtl:rotate-180"></i>
                    </a>
                </li>
99 100 101
                <li *ngFor="let item of bu2Table.page">
                    <a class="page-link" href="javascript:void(0);" [class.active]="item==bu2Table.currentPage"
                        (click)="bu2Table.currentPage=item">{{item}}
LAPTOP-CV4JFSHE\kantavee committed
102 103 104 105
                    </a>
                </li>
                <li>
                    <a aria-label="anchor" class="page-link" href="javascript:void(0);"
106
                        (click)="bu2Table.currentPage = (bu2Table.currentPage > bu2Table.page.length-1 ? bu2Table.currentPage: bu2Table.currentPage+1 )">
LAPTOP-CV4JFSHE\kantavee committed
107 108 109 110 111
                        <i class="ri-arrow-right-s-line align-middle rtl:rotate-180"></i>
                    </a>
                </li>
            </ul>
        </nav>
112
    </div>
113 114 115 116 117 118 119 120 121 122 123

</div>


<div id="department-list-modal-add" class="hs-overlay hidden ti-modal">
    <div class="hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out h-[calc(100%-3.5rem)]">
        <div class="max-h-full overflow-hidden ti-modal-content">
            <div class="ti-modal-header">
                <h3 class="text-xxl font-bold text-primary">
                    เพิ่มข้อมูลทะเบียนเเผนก
                </h3>
124
                <div class="flex justify-end">
125 126 127 128 129 130 131 132 133 134
                    <button type="button" class="hs-dropdown-toggle ti-modal-clode-btn text-danger"
                        data-hs-overlay="#department-list-modal-add">
                        <span class="sr-only">Close</span>
                        <i class="ti ti-circle-x fs-xxl"></i>
                    </button>
                </div>
            </div>
            <div class="ti-modal-center">
                <div class="flex justify-end" style="padding-right: 1rem;">
                    <div class="px-1">
135
                        <button type="button" class="ti-btn ti-btn-soft-indigo h-45px m-0 shadow-md"
136
                        (click)="selectBu1();selectBu2()">
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151
                            <svg class="svg-indigo" width="16" height="16" viewBox="0 0 64.00 64.00"
                                xmlns="http://www.w3.org/2000/svg" fill="none" stroke="#595BEA" stroke-width="3.84"
                                transform="rotate(45)matrix(-1, 0, 0, 1, 0, 0)">
                                <g id="SVGRepo_bgCarrier" stroke-width="0"></g>
                                <g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g>
                                <g id="SVGRepo_iconCarrier">
                                    <path d="M15 49A24 24 0 0 1 32 8"></path>
                                    <path d="M49 15a24 24 0 0 1-17 41"></path>
                                    <polyline points="15.03 40 15.03 48.97 8 48.97"></polyline>
                                    <polyline points="48.97 24 48.97 15.03 56 15.03"></polyline>
                                </g>
                            </svg>
                            Clear
                        </button>
                    </div>
152
                    <div class="px-1">
153 154 155 156 157 158 159
                        <button href="javascript:void(0);" class="ti-btn ti-btn-soft-warning h-45px m-0 shadow-md">
                            <i class="ti ti-book fs-l"></i>
                            Help
                        </button>
                    </div>
                </div>
            </div>
160
            <div class="ti-modal-body">
161
                <label class="ti-form-label">อยู่ภายใต้หน่วยงาน</label>
162
                <div class="flex">
163 164 165 166 167 168 169 170 171 172
                    <div class="relative flex rounded-md">
                        <input type="text" id="hs-leading-button-add-on-with-icon-and-button" name="hs-leading-button-add-on-with-icon-and-button" class="ti-form-input rounded-none ltr:rounded-r-md rtl:rounded-l-md focus:z-10" style="padding-right: 3.5rem;"
                         [(ngModel)]="bu1.bu1id" (ngModelChange)="bu1idChange()">
                        <div class="absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center z-20 ltr:pr-4 rtl:pl-4 space-x-2">
                            <button type="button" class="flex items-center text-red-500"  (click)="selectBu1()">
                                <i class="ti ti-circle-x cursor-pointer"></i>
                            </button>
                            <button type="button" class="flex items-center text-gray-500 dark:text-white/70"  data-hs-overlay="#department-list-bu1-table-modal">
                                <i class="ri-search-line cursor-pointer text-gray"></i>
                            </button>
173 174
                        </div>
                    </div>
175 176 177 178 179 180
                    <div class="flex rounded-md w-1/2 pl-1rem">
                        <input type="text" id="input-label" class="ti-form-input w-full pr-10 bg-input-readonly"
                            readonly [value]="bu1.tdesc">
                    </div>
                </div>
                <label class="ti-form-label mt-2rem">เเผนก</label>
181 182 183 184 185 186 187 188 189 190
                <div class="relative flex rounded-md w-1/2">
                    <input type="text" id="hs-leading-button-add-on-with-icon-and-button" name="hs-leading-button-add-on-with-icon-and-button" class="ti-form-input rounded-none ltr:rounded-r-md rtl:rounded-l-md focus:z-10" style="padding-right: 3.5rem;"
                     [(ngModel)]="bu2.bu2id" (ngModelChange)="bu2idChange()">
                    <div class="absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center z-20 ltr:pr-4 rtl:pl-4 space-x-2">
                        <button type="button" class="flex items-center text-red-500"  (click)="selectBu2()">
                            <i class="ti ti-circle-x cursor-pointer"></i>
                        </button>
                        <button type="button" class="flex items-center text-gray-500 dark:text-white/70"  data-hs-overlay="#department-list-bu2-table-modal">
                            <i class="ri-search-line cursor-pointer text-gray"></i>
                        </button>
191
                    </div>
192 193
                </div>
                <label for="detail_th" class="ti-form-label mt-2rem">รายละเอียด (ไทย)</label>
194
                <input type="text" id="detail_th" class="ti-form-input h-16" [(ngModel)]="bu2.tdesc">
195
                <label for="detail_eng" class="ti-form-label mt-2rem">รายละเอียด (อังกฤษ)</label>
196
                <input type="text" id="detail_eng" class="ti-form-input h-16" [(ngModel)]="bu2.edesc">
197
                <div class="flex justify-end mt-2rem mb-1rem space-x-4">
198 199 200 201 202
                    <button type="button"
                        class="hs-dropdown-toggle ti-btn ti-border font-medium bg-white text-gray-700 shadow-sm align-middle hover:bg-gray-50 focus:ring-offset-white focus:ring-primary dark:bg-bgdark dark:hover:bg-black/20 dark:border-white/10 dark:text-white/70 dark:hover:text-white dark:focus:ring-offset-white/10"
                        data-hs-overlay="#department-list-modal-add">
                        ย้อนกลับ
                    </button>
LAPTOP-CV4JFSHE\kantavee committed
203
                    <a class="ti-btn ti-btn-success" href="javascript:void(0);"
204
                        data-hs-overlay="#department-list-alert-modal">
205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220
                        บันทึกข้อมูล
                    </a>
                </div>
            </div>
        </div>
    </div>
</div>

<div id="department-list-modal-edit" class="hs-overlay hidden ti-modal">
    <div class="hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out h-[calc(100%-3.5rem)]">
        <div class="max-h-full overflow-hidden ti-modal-content">
            <div class="ti-modal-header">
                <h3 class="text-xxl font-bold text-primary">
                    แก้ไขข้อมูลทะเบียนเเผนก
                </h3>
                <div class="flex justify-end">
221 222 223 224 225 226 227 228 229 230
                    <button type="button" class="hs-dropdown-toggle ti-modal-clode-btn text-danger"
                        data-hs-overlay="#department-list-modal-edit">
                        <span class="sr-only">Close</span>
                        <i class="ti ti-circle-x fs-xxl"></i>
                    </button>
                </div>
            </div>
            <div class="ti-modal-center">
                <div class="flex justify-end" style="padding-right: 1rem;">
                    <div class="px-1">
231
                        <button type="button" class="ti-btn ti-btn-soft-indigo h-45px m-0 shadow-md"
232
                        (click)="selectBu1();bu2.tdesc='';bu2.edesc=''">
233 234 235 236 237 238
                            <svg class="svg-indigo" width="16" height="16" viewBox="0 0 64.00 64.00"
                                xmlns="http://www.w3.org/2000/svg" fill="none" stroke="#595BEA" stroke-width="3.84"
                                transform="rotate(45)matrix(-1, 0, 0, 1, 0, 0)">
                                <g id="SVGRepo_bgCarrier" stroke-width="0"></g>
                                <g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g>
                                <g id="SVGRepo_iconCarrier">
239
                                    <path d="M15 49A24 24 0 0 1 32 8"></path>
240 241 242 243 244 245 246 247
                                    <path d="M49 15a24 24 0 0 1-17 41"></path>
                                    <polyline points="15.03 40 15.03 48.97 8 48.97"></polyline>
                                    <polyline points="48.97 24 48.97 15.03 56 15.03"></polyline>
                                </g>
                            </svg>
                            Clear
                        </button>
                    </div>
248
                    <div class="px-1">
249 250 251 252 253 254 255
                        <button href="javascript:void(0);" class="ti-btn ti-btn-soft-warning h-45px m-0 shadow-md">
                            <i class="ti ti-book fs-l"></i>
                            Help
                        </button>
                    </div>
                </div>
            </div>
256 257
            <div class="ti-modal-body">
                <label for="hs-trailing-button-add-on-with-icon"
258
                    class="ti-form-label">อยู่ภายใต้หน่วยงาน</label>
259
                <div class="flex">
260 261 262 263 264 265 266 267 268 269
                    <div class="relative flex rounded-md">
                        <input type="text" id="hs-leading-button-add-on-with-icon-and-button" name="hs-leading-button-add-on-with-icon-and-button" class="ti-form-input rounded-none ltr:rounded-r-md rtl:rounded-l-md focus:z-10" style="padding-right: 3.5rem;"
                         [(ngModel)]="bu1.bu1id" (ngModelChange)="bu1idChange()">
                        <div class="absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center z-20 ltr:pr-4 rtl:pl-4 space-x-2">
                            <button type="button" class="flex items-center text-red-500"  (click)="selectBu1()">
                                <i class="ti ti-circle-x cursor-pointer"></i>
                            </button>
                            <button type="button" class="flex items-center text-gray-500 dark:text-white/70"  data-hs-overlay="#department-list-bu1-table-modal">
                                <i class="ri-search-line cursor-pointer text-gray"></i>
                            </button>
270
                        </div>
271 272 273 274 275 276
                    </div>
                    <div class="flex rounded-md w-1/2 pl-1rem">
                        <input type="text" id="input-label" class="ti-form-input w-full pr-10 bg-input-readonly"
                            readonly [value]="bu1.tdesc">
                    </div>
                </div>
277
                <label for="input-label" class="ti-form-label mt-2rem">เเผนก</label>
278
                <div class="sm:grid grid-cols-2 gap-1">
279
                    <div class="relative w-full">
280 281
                        <input type="text" id="input-label" class="ti-form-input w-full pr-10 bg-input-readonly"
                            readonly [value]="bu2.bu2id">
282 283
                    </div>
                </div>
284
                <label for="detail_th" class="ti-form-label mt-2rem">รายละเอียด (ไทย)</label>
285
                <input type="text" id="detail_th" class="ti-form-input h-16" [(ngModel)]="bu2.tdesc">
286
                <label for="detail_eng" class="ti-form-label mt-2rem">รายละเอียด (อังกฤษ)</label>
LAPTOP-CV4JFSHE\kantavee committed
287
                <input type="text" id="detail_eng" class="ti-form-input h-16" [(ngModel)]="bu2.edesc">
288
                <div class="flex justify-end mt-2rem mb-1rem space-x-4 ">
289 290 291 292 293
                    <button type="button"
                        class="hs-dropdown-toggle ti-btn ti-border font-medium bg-white text-gray-700 shadow-sm align-middle hover:bg-gray-50 focus:ring-offset-white focus:ring-primary dark:bg-bgdark dark:hover:bg-black/20 dark:border-white/10 dark:text-white/70 dark:hover:text-white dark:focus:ring-offset-white/10"
                        data-hs-overlay="#department-list-modal-edit">
                        ย้อนกลับ
                    </button>
LAPTOP-CV4JFSHE\kantavee committed
294
                    <a class="ti-btn ti-btn-success" href="javascript:void(0);"
295
                        data-hs-overlay="#department-list-alert-modal">
LAPTOP-CV4JFSHE\kantavee committed
296 297 298 299 300 301 302
                        บันทึกข้อมูล
                    </a>
                </div>
            </div>
        </div>
    </div>
</div>
303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533

<div id="department-list-bu1-table-modal" class="hs-overlay hidden ti-modal">
    <div class="hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out lg:!max-w-4xl lg:w-full m-3 lg:!mx-auto">
        <div class="max-h-full overflow-hidden ti-modal-content">
            <div class="ti-modal-header">
                <h3 class="text-xxl font-bold text-primary">
                    ข้อมูลทะเบียนฝ่าย
                </h3>
                <div class="flex justify-end">
                    <button *ngIf="currentModal=='add'" type="button"
                        class="hs-dropdown-toggle ti-modal-clode-btn text-danger"
                        data-hs-overlay="#department-list-modal-add">
                        <span class="sr-only">Close</span>
                        <i class="ti ti-circle-x fs-xxl"></i>
                    </button>
                    <button *ngIf="currentModal=='edit'" type="button"
                        class="hs-dropdown-toggle ti-modal-clode-btn text-danger"
                        data-hs-overlay="#department-list-modal-edit">
                        <span class="sr-only">Close</span>
                        <i class="ti ti-circle-x fs-xxl"></i>
                    </button>
                </div>
            </div>
            <div class="ti-modal-body">
                <div class="flex justify-end pb-1rem">
                    <div class="px-1">
                        <div class="relative shadow-md">
                            <input type="text" id="hs-leading-icon" name="hs-leading-icon"
                                class="ti-form-input ltr:pl-11 rtl:pr-11 focus:z-10 "
                                placeholder="Search by No. or Name" [(ngModel)]="bu1Modal.search"
                                (ngModelChange)="onBu1ModalSearchChange()">
                            <div
                                class="absolute inset-y-0 ltr:left-0 rtl:right-0 flex items-center pointer-events-none z-20 ltr:pl-4 rtl:pr-4">
                                <i class="ri-search-line text-gray"></i>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="overflow-auto border">
                    <table class="ti-custom-table ti-custom-table-head">
                        <thead>
                            <tr>
                                <ng-container
                                    *ngFor="let item of ['ลำดับ','รหัสฝ่าย','รายละเอียดฝ่าย (ไทย)','รายละเอียดฝ่าย (อังกฤษ)']; let f = first; let l = last">
                                    <th scope="col" class="relative px-10px py-10px bg-soft-secondary text-primary"
                                        [class.!text-center]="f">
                                        <span class="text-sm">{{ item }}</span>
                                        <div class="absolute top-1/2 transform -translate-y-1/2 right-0" *ngIf="!l">
                                            <i class="ti ti-dots-vertical fs-l"></i>
                                        </div>
                                    </th>
                                </ng-container>
                            </tr>
                        </thead>
                        <tbody *ngIf="!filterBu1Modal().length">
                            <tr>
                                <td class="text-center" colspan="100%">
                                    ไม่พบข้อมูล
                                </td>
                            </tr>
                        </tbody>
                        <tbody *ngIf="filterBu1Modal().length">
                            <ng-container *ngIf="currentModal=='add'">
                                <tr *ngFor="let item of filterBu1Modal() | slice:((bu1Modal.currentPage-1) * 10) : (((bu1Modal.currentPage-1) * 10) + 10);let i = index"
                                    class="cursor-pointer" (click)="selectBu1(item)"
                                    data-hs-overlay="#department-list-modal-add">
                                    <td class="flex justify-center">
                                        {{((bu1Modal.currentPage-1) * 10)+(i+1)}}
                                    </td>
                                    <td>{{item.bu1id}}</td>
                                    <td>{{item.tdesc}}</td>
                                    <td>{{item.edesc}}</td>
                                </tr>
                            </ng-container>
                            <ng-container *ngIf="currentModal=='edit'">
                                <tr *ngFor="let item of filterBu1Modal() | slice:((bu1Modal.currentPage-1) * 10) : (((bu1Modal.currentPage-1) * 10) + 10);let i = index"
                                    class="cursor-pointer" (click)="selectBu1(item)"
                                    data-hs-overlay="#department-list-modal-edit">
                                    <td class="flex justify-center">
                                        {{((bu1Modal.currentPage-1) * 10)+(i+1)}}
                                    </td>
                                    <td>{{item.bu1id}}</td>
                                    <td>{{item.tdesc}}</td>
                                    <td>{{item.edesc}}</td>
                                </tr>
                            </ng-container>
                        </tbody>
                    </table>
                </div>
                <nav class="pagination-style-3 overflow-auto my-5" *ngIf="bu1Modal.page.length">
                    <ul class="ti-pagination">
                        <li>
                            <a aria-label="anchor" class="page-link" href="javascript:void(0);"
                                (click)="bu1Modal.currentPage = (bu1Modal.currentPage-1 || 1)">
                                <i class="ri-arrow-left-s-line align-middle rtl:rotate-180"></i>
                            </a>
                        </li>
                        <li *ngFor="let item of bu1Modal.page">
                            <a class="page-link" href="javascript:void(0);" [class.active]="item==bu1Modal.currentPage"
                                (click)="bu1Modal.currentPage=item">{{item}}
                            </a>
                            <!-- <a aria-label="anchor" class="page-link" href="javascript:void(0);"><i class="ri-more-line"></i>
                            </a> -->
                        </li>
                        <li>
                            <a aria-label="anchor" class="page-link" href="javascript:void(0);"
                                (click)="bu1Modal.currentPage = (bu1Modal.currentPage > bu1Modal.page.length-1 ? bu1Modal.currentPage: bu1Modal.currentPage+1 )">
                                <i class="ri-arrow-right-s-line align-middle rtl:rotate-180"></i>
                            </a>
                        </li>
                    </ul>
                </nav>
                <div class="flex justify-end mt-2rem mb-1rem space-x-4">
                    <button type="button" *ngIf="currentModal=='add'"
                        class="hs-dropdown-toggle ti-btn ti-border font-medium bg-white text-gray-700 shadow-sm align-middle hover:bg-gray-50 focus:ring-offset-white focus:ring-primary dark:bg-bgdark dark:hover:bg-black/20 dark:border-white/10 dark:text-white/70 dark:hover:text-white dark:focus:ring-offset-white/10"
                        data-hs-overlay="#department-list-modal-add">
                        ย้อนกลับ
                    </button>
                    <button type="button" *ngIf="currentModal=='edit'"
                        class="hs-dropdown-toggle ti-btn ti-border font-medium bg-white text-gray-700 shadow-sm align-middle hover:bg-gray-50 focus:ring-offset-white focus:ring-primary dark:bg-bgdark dark:hover:bg-black/20 dark:border-white/10 dark:text-white/70 dark:hover:text-white dark:focus:ring-offset-white/10"
                        data-hs-overlay="#department-list-modal-edit">
                        ย้อนกลับ
                    </button>
                </div>
            </div>
        </div>
    </div>
</div>

<div id="department-list-bu2-table-modal" class="hs-overlay hidden ti-modal">
    <div class="hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out lg:!max-w-4xl lg:w-full m-3 lg:!mx-auto">
        <div class="max-h-full overflow-hidden ti-modal-content">
            <div class="ti-modal-header">
                <h3 class="text-xxl font-bold text-primary">
                    ข้อมูลทะเบียนแผนก
                </h3>
                <div class="flex justify-end">
                    <button type="button" class="hs-dropdown-toggle ti-modal-clode-btn text-danger"
                        data-hs-overlay="#department-list-modal-add">
                        <span class="sr-only">Close</span>
                        <i class="ti ti-circle-x fs-xxl"></i>
                    </button>
                </div>
            </div>
            <div class="ti-modal-body">
                <div class="flex justify-end pb-1rem">
                    <div class="px-1">
                        <div class="relative shadow-md">
                            <input type="text" id="hs-leading-icon" name="hs-leading-icon"
                                class="ti-form-input ltr:pl-11 rtl:pr-11 focus:z-10 "
                                placeholder="Search by No. or Name" [(ngModel)]="bu2Modal.search"
                                (ngModelChange)="onBu2ModalSearchChange()">
                            <div
                                class="absolute inset-y-0 ltr:left-0 rtl:right-0 flex items-center pointer-events-none z-20 ltr:pl-4 rtl:pr-4">
                                <i class="ri-search-line text-gray"></i>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="overflow-auto border">
                    <table class="ti-custom-table ti-custom-table-head">
                        <thead>
                            <tr>
                                <ng-container
                                    *ngFor="let item of ['ลำดับ','รหัสแผนก','รายละเอียดแผนก (ไทย)','รายละเอียดแผนก (อังกฤษ)']; let f = first; let l = last">
                                    <th scope="col" class="relative px-10px py-10px bg-soft-secondary text-primary"
                                        [class.!text-center]="f">
                                        <span class="text-sm">{{ item }}</span>
                                        <div class="absolute top-1/2 transform -translate-y-1/2 right-0" *ngIf="!l">
                                            <i class="ti ti-dots-vertical fs-l"></i>
                                        </div>
                                    </th>
                                </ng-container>
                            </tr>
                        </thead>
                        <tbody *ngIf="!filterBu2Modal().length">
                            <tr>
                                <td class="text-center" colspan="100%">
                                    ไม่พบข้อมูล
                                </td>
                            </tr>
                        </tbody>
                        <tbody *ngIf="filterBu2Modal().length">
                            <tr *ngFor="let item of filterBu2Modal() | slice:((bu2Modal.currentPage-1) * 10) : (((bu2Modal.currentPage-1) * 10) + 10);let i = index"
                                class="cursor-pointer" (click)="selectBu2(item)"
                                data-hs-overlay="#department-list-modal-add">
                                <td class="flex justify-center">
                                    {{((bu2Modal.currentPage-1) * 10)+(i+1)}}
                                </td>
                                <td>{{item.bu2id}}</td>
                                <td>{{item.tdesc}}</td>
                                <td>{{item.edesc}}</td>
                            </tr>
                        </tbody>
                    </table>
                </div>
                <nav class="pagination-style-3 overflow-auto my-5" *ngIf="bu2Modal.page.length">
                    <ul class="ti-pagination">
                        <li>
                            <a aria-label="anchor" class="page-link" href="javascript:void(0);"
                                (click)="bu2Modal.currentPage = (bu2Modal.currentPage-1 || 1)">
                                <i class="ri-arrow-left-s-line align-middle rtl:rotate-180"></i>
                            </a>
                        </li>
                        <li *ngFor="let item of bu2Modal.page">
                            <a class="page-link" href="javascript:void(0);" [class.active]="item==bu2Modal.currentPage"
                                (click)="bu2Modal.currentPage=item">{{item}}
                            </a>
                            <!-- <a aria-label="anchor" class="page-link" href="javascript:void(0);"><i class="ri-more-line"></i>
                            </a> -->
                        </li>
                        <li>
                            <a aria-label="anchor" class="page-link" href="javascript:void(0);"
                                (click)="bu2Modal.currentPage = (bu2Modal.currentPage > bu2Modal.page.length-1 ? bu2Modal.currentPage: bu2Modal.currentPage+1 )">
                                <i class="ri-arrow-right-s-line align-middle rtl:rotate-180"></i>
                            </a>
                        </li>
                    </ul>
                </nav>
                <div class="flex justify-end mt-2rem mb-1rem space-x-4">
                    <button type="button"
                        class="hs-dropdown-toggle ti-btn ti-border font-medium bg-white text-gray-700 shadow-sm align-middle hover:bg-gray-50 focus:ring-offset-white focus:ring-primary dark:bg-bgdark dark:hover:bg-black/20 dark:border-white/10 dark:text-white/70 dark:hover:text-white dark:focus:ring-offset-white/10"
                        data-hs-overlay="#department-list-modal-add">
                        ย้อนกลับ
                    </button>
                </div>
            </div>
        </div>
    </div>
</div>

LAPTOP-CV4JFSHE\kantavee committed
534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554
<div id="department-list-alert-modal" class="hs-overlay hidden ti-modal">
    <div class="hs-overlay-open:mt-7 ti-modal-box mt-0 ease-out h-[calc(100%-3.5rem)] flex items-center">
        <div class="max-h-full overflow-hidden ti-modal-content w-full">
            <div class="ti-modal-header">
                <h3 class="text-xxl font-bold text-primary">
                    แจ้งเตือน
                </h3>
                <div class="flex justify-end">
                    <button type="button" class="hs-dropdown-toggle ti-modal-clode-btn text-danger"
                        data-hs-overlay="#department-list-alert-modal">
                        <span class="sr-only">Close</span>
                        <i class="ti ti-circle-x fs-xxl"></i>
                    </button>
                </div>
            </div>
            <div class="ti-modal-body ">
                <p class="mt-1 text-gray-800 dark:text-white/70">
                    ยืนยันการบันทึกข้อมูลหรือไม่
                </p>

                <div class="flex justify-end mt-2rem mb-1rem">
555
                    <button type="button" *ngIf="currentModal=='add'"
LAPTOP-CV4JFSHE\kantavee committed
556
                        class="hs-dropdown-toggle ti-btn ti-border font-medium bg-white text-gray-700 shadow-sm align-middle hover:bg-gray-50 focus:ring-offset-white focus:ring-primary dark:bg-bgdark dark:hover:bg-black/20 dark:border-white/10 dark:text-white/70 dark:hover:text-white dark:focus:ring-offset-white/10"
557 558 559 560 561 562
                        data-hs-overlay="#department-list-modal-add">
                        ย้อนกลับ
                    </button>
                    <button type="button" *ngIf="currentModal=='edit'"
                        class="hs-dropdown-toggle ti-btn ti-border font-medium bg-white text-gray-700 shadow-sm align-middle hover:bg-gray-50 focus:ring-offset-white focus:ring-primary dark:bg-bgdark dark:hover:bg-black/20 dark:border-white/10 dark:text-white/70 dark:hover:text-white dark:focus:ring-offset-white/10"
                        data-hs-overlay="#department-list-modal-edit">
LAPTOP-CV4JFSHE\kantavee committed
563 564 565 566
                        ย้อนกลับ
                    </button>
                    <a class="ti-btn ti-btn-success" href="javascript:void(0);"
                        data-hs-overlay="#department-list-alert-modal" (click)="addBu2()">
567 568 569 570 571 572
                        บันทึกข้อมูล
                    </a>
                </div>
            </div>
        </div>
    </div>
573
</div>