position-unit.component.html 23 KB
Newer Older
1
<div class="w-full min-height-50px mb-10px justify-between items-center">
2
    <div class="flex justify-between">
3
        <div class="flex pr-2">
4
            <div class="px-1">
5 6
                <button type="button" class="ti-btn ti-btn-soft-secondary h-20px m-0 shadow-md"
                    data-hs-overlay="#company-registration-page-upload-modal">
7 8 9
                    <i class="ri-add-line"></i>
                    นำเข้าข้อมูล
                </button>
10 11
                <a class="mx-2 justify-center  -mb-px  inline-flex items-center gap-2 font-weight-500 font-size-12px text-center text-secondary border-secondary border-b-2 align-items-end"
                    href="javascript:void(0);">
12
                    ดาวน์โหลดตัวอย่างไฟล์
13
                </a>
Natthaphat Pankiang committed
14
            </div>
15
        </div>
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
         <div class="flex justify-end">
             <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" style="height: 40px;"
                         [(ngModel)]="search" (ngModelChange)="searchChange()">
                     <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 class="px-1">
                 <button type="button" class="ti-btn ti-btn-soft-secondary h-20px m-0 shadow-md"
                     data-hs-overlay="#position-unit-component-modal-add">
                     <i class="ri-add-line"></i>
                     Add
                 </button>
             </div>
             <div class="px-1">
                 <button href="javascript:void(0);" class="ti-btn ti-btn-soft-danger h-20px m-0 shadow-md"
                 data-hs-overlay="#position-unit-component-alert-delete-modal">
                     <i class="ri-delete-bin-6-line"></i>
                     Delete
                 </button>
             </div>
             <div class="px-1">
                 <button href="javascript:void(0);" class="ti-btn ti-btn-soft-warning h-20px m-0 shadow-md">
                     <i class="ti ti-book fs-l"></i>
                     Help
                 </button>
             </div>
         </div>
     </div>
 </div>
Natthaphat Pankiang committed
51

52 53 54
 <div class="page px-rem">
    <div class="overflow-auto shadow-md rounded-t-md">
        <table class="ti-custom-table ti-custom-table-head ti-custom-table-hover table-bordered">
55 56 57
                    <thead>
                        <tr>
                            <ng-container
Ooh-Ao committed
58
                                *ngFor="let item of ['รหัสตำแหน่ง','รายละเอียด(ไทย) ','รายละเอียด(อังกฤษ)','การจัดการ']; let f = first; let l = last; let i = index">
59 60 61 62
                                <th scope="col" class="relative px-10px py-10px bg-soft-secondary text-primary !text-center">
                                    <span class="font-size-12px font-weight-700">{{ 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>
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
                                    </div>
                                </th>
                            </ng-container>
                        </tr>
                    </thead>
                    <tbody *ngIf="!positionListFilter().length">
                        <tr>
                            <td class="text-center" colspan="100%">
                                ไม่พบข้อมูล
                            </td>
                        </tr>
                    </tbody>
                    <tbody *ngIf="positionListFilter().length">
                        <tr
                            *ngFor="let item of positionListFilter() | slice:((currentPage-1) * 10) : (((currentPage-1) * 10) + 10);let i = index">
78 79 80
                            <td class="text-center">
                                <input type="checkbox" class="ti-form-checkbox cursor-pointer" id="checkbox-{{item.positionId}}">
                                <label for="checkbox-{{item.positionId}}">&nbsp;{{item.positionId}}</label>
81
                            </td>
82 83
                            <td >{{item.tdesc}}</td>
                            <td >{{item.edesc}}</td>
84 85 86 87 88 89 90 91 92
                            <td class="flex justify-center">
                                <i class="ti ti-edit cursor-pointer i-gray fs-l px-1" (click)="selectPosition(item)"
                                    data-hs-overlay="#position-unit-component-modal-edit"></i>
                                <i class="ti ti-trash cursor-pointer i-gray fs-l px-1" (click)="deletePosition(item)"
                                    data-hs-overlay="#position-unit-component-alert-delete-modal"></i>
                            </td>
                        </tr>
                    </tbody>
                </table>
Natthaphat Pankiang committed
93
        </div>
94 95 96 97 98 99 100 101
        <nav class="pagination-style-3 overflow-auto my-5" *ngIf="page.length">
            <ul class="ti-pagination">
                <li>
                    <a aria-label="anchor" class="page-link" href="javascript:void(0);"
                        (click)="currentPage = (currentPage-1 || 1)">
                        <i class="ri-arrow-left-s-line align-middle rtl:rotate-180"></i>
                    </a>
                </li>
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116
                <li *ngFor="let item of page;let f = first;let l = last">
                    <ng-container *ngIf="item==3&&currentPage!=1&&currentPage!=2&&currentPage!=3">
                        <a aria-label="anchor" class="page-link" href="javascript:void(0);"><i class="ri-more-line"></i>
                        </a>
                    </ng-container>
                    <ng-container *ngIf="(f||l)||(item==currentPage-1||item==currentPage||item==currentPage+1)">
                        <a class="page-link" href="javascript:void(0);" [class.active]="item==currentPage"
                            (click)="currentPage=item">{{item}}
                        </a>
                    </ng-container>
                    <ng-container
                        *ngIf="item==page.length-2&&currentPage!=page.length&&currentPage!=page.length-1&&currentPage!=page.length-2">
                        <a aria-label="anchor" class="page-link" href="javascript:void(0);"><i class="ri-more-line"></i>
                        </a>
                    </ng-container>
117 118 119 120 121 122 123 124 125
                </li>
                <li>
                    <a aria-label="anchor" class="page-link" href="javascript:void(0);"
                        (click)="currentPage = (currentPage > page.length-1 ? currentPage: currentPage+1 )">
                        <i class="ri-arrow-right-s-line align-middle rtl:rotate-180"></i>
                    </a>
                </li>
            </ul>
        </nav>
126 127 128
</div>


129
<div id="position-unit-component-modal-add" class="hs-overlay hidden ti-modal">
130 131 132 133 134 135 136
    <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">
137 138 139 140 141 142 143 144 145 146
                    <button type="button" class="hs-dropdown-toggle ti-modal-clode-btn text-danger"
                        data-hs-overlay="#position-unit-component-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">
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162
                        <button type="button" class="ti-btn ti-btn-soft-indigo h-45px m-0 shadow-md">
                            <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>
163
                    <div class="px-1">
164 165 166 167 168 169 170
                        <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>
171
            <div class="ti-modal-body ">
172 173 174
                <label for="input-label" class="ti-form-label mt-2rem">รหัสตำเเหน่ง *</label>
                <input type="text" id="input-label" class="ti-form-input w-1/2" placeholder="">
                <label for="detail_th" class="ti-form-label mt-2rem">รายละเอียดฝ่าย (ไทย)</label>
175
                <input type="text" id="detail_th" class="ti-form-input h-16" placeholder="">
176
                <label for="detail_eng" class="ti-form-label mt-2rem">รายละเอียดฝ่าย (อังกฤษ)</label>
177
                <input type="text" id="detail_eng" class="ti-form-input h-16" placeholder="">
178 179 180
                <div class="flex justify-end mt-2rem mb-1rem space-x-2">
                    <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"
181
                        data-hs-overlay="#position-unit-component-modal-add">
182 183
                        ย้อนกลับ
                    </button>
184 185
                    <a class="ti-btn ti-btn-success" href="javascript:void(0);"
                        data-hs-overlay="#position-unit-component-alert-modal">
186 187 188 189 190 191 192 193
                        บันทึกข้อมูล
                    </a>
                </div>
            </div>
        </div>
    </div>
</div>

194
<div id="position-unit-component-modal-edit" class="hs-overlay hidden ti-modal">
195 196 197 198 199 200 201
    <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">
202 203 204 205 206 207 208 209 210 211
                    <button type="button" class="hs-dropdown-toggle ti-modal-clode-btn text-danger"
                        data-hs-overlay="#position-unit-component-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">
212 213 214 215 216 217 218
                        <button type="button" class="ti-btn ti-btn-soft-indigo h-45px m-0 shadow-md">
                            <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">
219
                                    <path d="M15 49A24 24 0 0 1 32 8"></path>
220 221 222 223 224 225 226 227
                                    <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>
228
                    <div class="px-1">
229 230 231 232 233 234 235
                        <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>
236
            <div class="ti-modal-body ">
237
                <label for="input-label" class="ti-form-label mt-2rem">รหัสตำเเหน่ง</label>
238 239
                <input type="text" id="input-label" class="ti-form-input w-1/2 bg-input-readonly" readonly
                    [(ngModel)]="position.positionId">
240
                <label for="detail_th" class="ti-form-label mt-2rem">รายละเอียดฝ่าย (ไทย)</label>
241
                <input type="text" id="detail_th" class="ti-form-input h-16" [(ngModel)]="position.tdesc">
242
                <label for="detail_eng" class="ti-form-label mt-2rem">รายละเอียดฝ่าย (อังกฤษ)</label>
243
                <input type="text" id="detail_eng" class="ti-form-input h-16" [(ngModel)]="position.edesc">
244 245 246
                <div class="flex justify-end mt-2rem mb-1rem">
                    <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"
247
                        data-hs-overlay="#position-unit-component-modal-edit">
248 249
                        ย้อนกลับ
                    </button>
250
                    <a class="ti-btn ti-btn-success" href="javascript:void(0);"
251
                        data-hs-overlay="#position-unit-component-alert-edit-modal">
252 253 254 255 256 257
                        บันทึกข้อมูล
                    </a>
                </div>
            </div>
        </div>
    </div>
258 259 260
</div>
<div id="position-unit-component-modal-upload" 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)]">
261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283
        <div class="max-h-full overflow-hidden ti-modal-content-upload">
            <div class="modal-headerupload bg-primary">
                <h5 class="text-xxl font-bold text-white">
                    นำเข้าข้อมูลบริษัท
                </h5>
            </div>
            <h1 class="mt-2" style="text-align: center;">ไฟล์</h1>
            <div class="mt-2" style="margin-left: 10px;">
                <div class="flex rounded-md">
                    <input type="text" id="hs-trailing-button-add-on-with-icon"
                        name="hs-trailing-button-add-on-with-icon"
                        class="ti-form-input rounded-none ltr:rounded-l-md rtl:rounded-r-md focus:z-10">
                    <button aria-label="button" type="button"
                        class="inline-flex flex-shrink-0 justify-center items-center h-[2.875rem] w-[2.875rem] ltr:rounded-r-md rtl:rounded-l-md border border-transparent font-semibold bg-primary text-white hover:bg-primary focus:z-10 focus:outline-none focus:ring-0 focus:ring-primary transition-all text-sm">
                        <i class="ti ti-upload"></i>
                    </button>
                </div>
                <div class="flex justify-center mt-2rem mb-1rem space-x-4">
                    <a class="ti-btn ti-btn-primary" href="javascript:void(0);">
                        อัปโหลด
                    </a>
                </div>
            </div>
284 285
        </div>
    </div>
286
</div>
287
<div id="position-unit-component-alert-modal" class="hs-overlay hidden ti-modal">
288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313
    <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="#position-unit-component-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">
                    <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="#position-unit-component-alert-modal">
                        ย้อนกลับ
                    </button>
                    <a class="ti-btn ti-btn-success" href="javascript:void(0);"
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
                        data-hs-overlay="#position-unit-component-alert-modal" (click)="addPosition();showSuccess()">
                        บันทึกข้อมูล
                    </a>
                </div>
            </div>
        </div>
    </div>
</div>

<div id="position-unit-component-alert-edit-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="#position-unit-component-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">
                    <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="#position-unit-component-alert-modal">
                        ย้อนกลับ
                    </button>
                    <a class="ti-btn ti-btn-success" href="javascript:void(0);"
350 351
                        data-hs-overlay="#position-unit-component-alert-edit-modal"
                        (click)="addPosition();showSuccesssEdit()">
352 353 354 355 356 357
                        บันทึกข้อมูล
                    </a>
                </div>
            </div>
        </div>
    </div>
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
</div>


<div id="position-unit-component-alert-delete-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="#position-unit-component-alert-delete-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">
                    <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="#position-unit-component-alert-modal">
                        ย้อนกลับ
                    </button>
                    <a class="ti-btn ti-btn-success" href="javascript:void(0);"
388 389
                        data-hs-overlay="#position-unit-component-alert-delete-modal"
                        (click)="addPosition();showSuccessDelete()">
390 391 392 393 394 395
                        ลบข้อมูล
                    </a>
                </div>
            </div>
        </div>
    </div>
Ooh-Ao committed
396
</div>