diff --git a/src/app/@config/menus.ts b/src/app/@config/menus.ts index 616c1d5..9342f41 100644 --- a/src/app/@config/menus.ts +++ b/src/app/@config/menus.ts @@ -15,138 +15,6 @@ export interface MENU { } export const MENU: MENU[] = [ - // { - // name: 'ประเมินราคา/ค่ามัดจำ', - // link: 'appraisal', - // permission: 'appraisal', - // icon: 'bi bi-ui-checks', - // params: [], - // badge: '', - // type: 'collapsable', - // children: [ - // { - // name: 'ประเมินราคาครั้งที่ 1', - // link: 'appraisal/1st-time', - // permission: 'appraisal-1st-time', - // type: 'link', - // icon: '', - // params: [], - // badge: '', - // children: [ - // { - // name: 'ประวัติการสร้างใบเสนอราคา', - // link: 'appraisal/1st-time/history', - // permission: 'appraisal-1st-time-history', - // notShowing: true, - // children: [ - // { - // name: 'ใบเสนอราคา', - // link: 'appraisal/1st-time/history/pdf', - // permission: 'appraisal-1st-time-pdf', - // notShowing: true, - // } - // ] - // }, - - // ] - // }, - // { - // name: 'ประเมินราคาครั้งที่ 2', - // link: 'appraisal/2nd-time', - // permission: 'appraisal-2nd-time', - // type: 'link', - // icon: '', - // params: [], - // badge: '', - // }, - // { - // name: 'ประเมินราคาครั้งที่ 3', - // link: 'appraisal/3rd-time', - // permission: 'appraisal-3rd-time', - // type: 'link', - // icon: '', - // params: [], - // badge: '', - // }, - // ] - // }, - // { - // name: 'การเงิน', - // link: 'finance', - // permission: 'finance', - // icon: 'bi bi-coin', - // params: [], - // badge: '', - // type: 'collapsable', - // children: [ - // { - // name: 'รับชำระเงิน/ใบเสร็จรับเงิน', - // link: 'finance/payment', - // permission: 'payment', - // type: 'link', - // icon: '', - // params: [], - // badge: '', - // children: [ - // { - // name: 'ใบเสร็จรับเงิน', - // link: 'finance/payment/paid/pdf', - // permission: 'finance-payment-pdf', - // notShowing: true, - // } - // ] - // }, - // { - // name: 'การแจ้งหนี้/ตั้งเจ้าหนี้', - // link: 'finance/invoice', - // permission: 'invoice', - // type: 'link', - // icon: '', - // params: [], - // badge: '', - // }, - // { - // name: 'การจ่ายชำระเงิน', - // link: 'finance/paying', - // permission: 'paying', - // type: 'link', - // icon: '', - // params: [], - // badge: '', - // }, - - - // ] - // }, - // { - // name: 'สัญญา', - // link: 'contract', - // permission: 'contract', - // icon: 'bi bi-file-earmark-text-fill', - // params: [], - // badge: '', - // type: 'collapsable', - // children: [ - // { - // name: 'ทำสัญญา', - // link: 'contract/make', - // permission: 'contract-make', - // type: 'link', - // icon: '', - // params: [], - // badge: '', - // }, - // { - // name: 'อนุมัติสัญญา', - // link: 'contract/approved', - // permission: 'contract-approved', - // type: 'link', - // icon: '', - // params: [], - // badge: '', - // } - // ] - // }, { name: 'Manage', link: 'manage', @@ -157,49 +25,34 @@ export const MENU: MENU[] = [ type: 'collapsable', children: [ { - name: 'Manage KYC', + name: 'KYC', link: 'manage/kyc', permission: 'manage-kyc', type: 'link', icon: '', params: [], badge: '', - // children: [ - // { - // name: 'ประวัติการสร้างใบเสนอราคา', - // link: 'appraisal/1st-time/history', - // permission: 'appraisal-1st-time-history', - // notShowing: true, - // children: [ - // { - // name: 'ใบเสนอราคา', - // link: 'appraisal/1st-time/history/pdf', - // permission: 'appraisal-1st-time-pdf', - // notShowing: true, - // } - // ] - // }, - - // ] }, - // { - // name: 'ประเมินราคาครั้งที่ 2', - // link: 'appraisal/2nd-time', - // permission: 'appraisal-2nd-time', - // type: 'link', - // icon: '', - // params: [], - // badge: '', - // }, - // { - // name: 'ประเมินราคาครั้งที่ 3', - // link: 'appraisal/3rd-time', - // permission: 'appraisal-3rd-time', - // type: 'link', - // icon: '', - // params: [], - // badge: '', - // }, + ] + }, + { + name: 'Report', + link: 'report', + permission: 'report', + icon: 'bi bi-file-bar-graph', + params: [], + badge: '', + type: 'collapsable', + children: [ + { + name: 'Transactions', + link: 'report/transactions', + permission: 'transactions', + type: 'link', + icon: '', + params: [], + badge: '', + }, ] }, ]; diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index c5b25b0..2eb2d39 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -31,11 +31,19 @@ const routes: Routes = [ children: [ { path: 'kyc', - // loadChildren: () => import('./pages/appraisal/1st-time/appraisal-1st-time.module').then(m => m.Appraisal1stTimeModule) loadChildren: () => import('./pages/manage/kyc/kyc.module').then(m => m.KycModule) }, ] }, + { + path: 'report', + children: [ + { + path: 'transactions', + loadChildren: () => import('./pages/report/transactions/transactions.module').then(m => m.TransactionsModule) + }, + ] + }, { path: 'not-found', loadChildren: () => import('./pages/errors/errors.module').then(m => m.ErrorsModule) diff --git a/src/app/auth/login/login.component.html b/src/app/auth/login/login.component.html index 7aa0862..993f624 100644 --- a/src/app/auth/login/login.component.html +++ b/src/app/auth/login/login.component.html @@ -1,7 +1,7 @@
@@ -9,10 +9,10 @@
- - กรุณากรอกข้อมูล + กรุณากรอกข้อมูล
diff --git a/src/app/auth/login/login.component.ts b/src/app/auth/login/login.component.ts index 9e8154c..0f89546 100644 --- a/src/app/auth/login/login.component.ts +++ b/src/app/auth/login/login.component.ts @@ -1,9 +1,10 @@ import { Component, OnInit } from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; import { AppService } from '../../app.service'; -import { lastValueFrom } from "rxjs"; -import { EAction, EText } from "../../@config/app"; import { environment } from "../../../environments/environment"; +import { AuthService } from 'src/app/core/service/auth/auth.service'; +import { catchError, lastValueFrom, tap, throwError } from 'rxjs'; +import { EAction, EText } from 'src/app/@config/app'; @Component({ @@ -19,7 +20,8 @@ export class LoginComponent implements OnInit { constructor( private router: Router, private appService: AppService, - private route: ActivatedRoute + private route: ActivatedRoute, + private authService: AuthService ) { } @@ -28,30 +30,19 @@ export class LoginComponent implements OnInit { if (!environment.production) { this.dataForm = { username: 'admin', - password: 'password@1', + password: 'admin', } } } async onSubmit(form: any) { if (!form.valid) return false; - const dataForm = { - username: this.dataForm.username, - password: this.dataForm.password, - userType: 'ADMIN' - }; - - try { - // console.log(this.apiUrl) - // const result = await lastValueFrom(this.appService.post(this.apiUrl, dataForm)); - // this.appService.setAuth(result.data); - // this.appService.setToken(result.accessToken); + await lastValueFrom(this.authService.login(this.dataForm)); return this.router.navigate(['/pages']); } catch (err) { return this.appService.message(EAction.ERROR, EText.NO_DATA); } - } diff --git a/src/app/core/intercepter/token-intercepter.interceptor.ts b/src/app/core/intercepter/token-intercepter.interceptor.ts index 570ce65..81e05a4 100644 --- a/src/app/core/intercepter/token-intercepter.interceptor.ts +++ b/src/app/core/intercepter/token-intercepter.interceptor.ts @@ -1,44 +1,37 @@ -import { OidcAuthService } from 'src/app/core/oidc/oidc.service'; import { Injectable } from '@angular/core'; import { - HttpRequest, - HttpHandler, - HttpEvent, - HttpInterceptor + HttpRequest, + HttpHandler, + HttpEvent, + HttpInterceptor } from '@angular/common/http'; import { Observable, throwError } from 'rxjs'; import { catchError, finalize } from 'rxjs/operators'; import { Router } from '@angular/router'; -import { NgProgress } from 'ngx-progressbar'; -import { ApplicationSecurityService } from '../service/security/application-security.service'; @Injectable() export class TokenIntercepterInterceptor implements HttpInterceptor { - constructor( - private odicSV: OidcAuthService, - private router: Router, - private progress: NgProgress, - private appTokenSV: ApplicationSecurityService - ) { - } + constructor( + private router: Router, + ) { + } - intercept(request: HttpRequest, next: HttpHandler): Observable> { - const isRegisterSubjectAPI = request.url.includes('rsu-reg-api') - const customReq = request.clone({ - setHeaders:{ - Authorization: request.url.includes('app_tokens') ? `${this.odicSV.getAuthorizationHeaderValue()}` : `Bearer ${this.appTokenSV.getToken()}` - } - }); - this.progress.ref('progressBar').start() - return next.handle(customReq).pipe( - finalize(() => this.progress.ref('progressBar').complete()), - catchError(err => { - if (err.status == 401) { - this.router.navigate(['./'],{ replaceUrl: true }) - } - return throwError(err) - }) - ); - } + intercept(request: HttpRequest, next: HttpHandler): Observable> { + const customReq = request.clone({ + setHeaders: { + // Authorization: request.url.includes('app_tokens') ? `${this.odicSV.getAuthorizationHeaderValue()}` : `Bearer ${this.appTokenSV.getToken()}` + } + }); + return next.handle(customReq) + // return next.handle(customReq).pipe( + // finalize(() => this.progress.ref('progressBar').complete()), + // catchError(err => { + // if (err.status == 401) { + // this.router.navigate(['./'], { replaceUrl: true }) + // } + // return throwError(err) + // }) + // ); + } } diff --git a/src/app/core/service/auth/auth.service.ts b/src/app/core/service/auth/auth.service.ts new file mode 100644 index 0000000..49c6466 --- /dev/null +++ b/src/app/core/service/auth/auth.service.ts @@ -0,0 +1,20 @@ +import { HttpClient } from '@angular/common/http'; +import { Injectable } from '@angular/core'; +import { BaseService } from 'src/app/core/base/base-service'; + +@Injectable({ + providedIn: 'root' +}) +export class AuthService extends BaseService{ + + constructor( + public http: HttpClient + ) { + super('/common/user_login', http) + } + + login(payload : {'loginname': string , 'password' : string}){ + return this.http.get(`${this.prefix}/common/user_login/login/${payload.loginname}/${payload.password}`) + } + +} diff --git a/src/app/pages/@layouts/layouts.component.ts b/src/app/pages/@layouts/layouts.component.ts index cd9097c..54c2570 100644 --- a/src/app/pages/@layouts/layouts.component.ts +++ b/src/app/pages/@layouts/layouts.component.ts @@ -2,8 +2,6 @@ import { ChangeDetectorRef, Component, OnInit } from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; import { AppService } from '../../app.service'; import { MENU } from "../../@config/menus"; -import { lastValueFrom } from "rxjs"; -import { environment } from 'src/environments/environment'; @Component({ selector: 'app-pages-layouts', @@ -24,7 +22,6 @@ export class PagesLayoutsComponent implements OnInit { constructor( private app: AppService, private router: Router, - private activatedRoute: ActivatedRoute, public changeDetectorRef: ChangeDetectorRef, ) { diff --git a/src/app/pages/report/transactions/container/transactions/transactions.container.html b/src/app/pages/report/transactions/container/transactions/transactions.container.html new file mode 100644 index 0000000..e42b219 --- /dev/null +++ b/src/app/pages/report/transactions/container/transactions/transactions.container.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/app/pages/report/transactions/container/transactions/transactions.container.scss b/src/app/pages/report/transactions/container/transactions/transactions.container.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/pages/report/transactions/container/transactions/transactions.container.spec.ts b/src/app/pages/report/transactions/container/transactions/transactions.container.spec.ts new file mode 100644 index 0000000..8257a6b --- /dev/null +++ b/src/app/pages/report/transactions/container/transactions/transactions.container.spec.ts @@ -0,0 +1,23 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { TransactionsContainer } from './transactions.container'; + +describe('TransactionsContainer', () => { + let component: TransactionsContainer; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ TransactionsContainer ] + }) + .compileComponents(); + + fixture = TestBed.createComponent(TransactionsContainer); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/pages/report/transactions/container/transactions/transactions.container.ts b/src/app/pages/report/transactions/container/transactions/transactions.container.ts new file mode 100644 index 0000000..1921bd4 --- /dev/null +++ b/src/app/pages/report/transactions/container/transactions/transactions.container.ts @@ -0,0 +1,17 @@ +import { Component } from '@angular/core'; +import { Observable } from 'rxjs'; +import { KycService } from 'src/app/core/service/manage/kyc.service'; + +@Component({ + selector: 'app-transactions', + templateUrl: './transactions.container.html', + styleUrls: ['./transactions.container.scss'] +}) +export class TransactionsContainer { + kyc$ = new Observable(); + constructor( + private kycService: KycService + ) { + this.kyc$ = this.kycService.getAll(); + } +} diff --git a/src/app/pages/report/transactions/presenter/list/list.component.html b/src/app/pages/report/transactions/presenter/list/list.component.html new file mode 100644 index 0000000..d9d22f8 --- /dev/null +++ b/src/app/pages/report/transactions/presenter/list/list.component.html @@ -0,0 +1,136 @@ +
+ +
+
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+ + + + +
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ลำดับ{{item.code}}Phone + {{item.name }} + ID{{item?.masterProductBrand.name }}PayeeFullname{{item?.masterProductBrand.name }}PayerFullname{{item.size }}InvoiceID{{item.weight }}ref 1{{item.color }}ref 2{{item.year }}ref 3 +
{{item.price | number : '1.2-2'}}
+
paymentStatus +
{{item.latestPrice | number : '1.2-2' }}
+
payment Channel +
+
+ +
+
+
จำนวนเงิน +
{{item.latestPrice | number : '1.2-2' }}
+
Create by +
{{item.latestPrice | number : '1.2-2' }}
+
Update by +
{{item.latestPrice | number : '1.2-2' }}
+
More Detail +
+
+ +
+
+
+
+ + +
+
\ No newline at end of file diff --git a/src/app/pages/report/transactions/presenter/list/list.component.scss b/src/app/pages/report/transactions/presenter/list/list.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/pages/report/transactions/presenter/list/list.component.spec.ts b/src/app/pages/report/transactions/presenter/list/list.component.spec.ts new file mode 100644 index 0000000..54ae348 --- /dev/null +++ b/src/app/pages/report/transactions/presenter/list/list.component.spec.ts @@ -0,0 +1,23 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ListComponent } from './list.component'; + +describe('ListComponent', () => { + let component: ListComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ ListComponent ] + }) + .compileComponents(); + + fixture = TestBed.createComponent(ListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/pages/report/transactions/presenter/list/list.component.ts b/src/app/pages/report/transactions/presenter/list/list.component.ts new file mode 100644 index 0000000..76bc684 --- /dev/null +++ b/src/app/pages/report/transactions/presenter/list/list.component.ts @@ -0,0 +1,17 @@ +import { Component, Input } from '@angular/core'; + +@Component({ + selector: 'app-list', + templateUrl: './list.component.html', + styleUrls: ['./list.component.scss'] +}) +export class ListComponent { + @Input() kycList: any = []; + constructor() { + + } + + getData(event: any) { + + } +} diff --git a/src/app/pages/report/transactions/router/router.ts b/src/app/pages/report/transactions/router/router.ts new file mode 100644 index 0000000..4cfd668 --- /dev/null +++ b/src/app/pages/report/transactions/router/router.ts @@ -0,0 +1,16 @@ +import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; + +@Component({ + selector: 'app-transactions-router', + template: '', + changeDetection: ChangeDetectionStrategy.OnPush +}) +export class TransactionsRouter implements OnInit { + + constructor() { } + + ngOnInit(): void { + } + +} + diff --git a/src/app/pages/report/transactions/transactions.module.ts b/src/app/pages/report/transactions/transactions.module.ts new file mode 100644 index 0000000..9a08b9a --- /dev/null +++ b/src/app/pages/report/transactions/transactions.module.ts @@ -0,0 +1,35 @@ +import { NgOptimizedImage } from "@angular/common"; +import { RouterModule, Routes } from "@angular/router"; +import { AppSharedModule } from "src/app/app.shared"; +import { NgModule } from "@angular/core"; +import { ListComponent } from "./presenter/list/list.component"; +import { TransactionsRouter } from "./router/router"; +import { TransactionsContainer } from "./container/transactions/transactions.container"; + + +const routes: Routes = [ + { + path: '', + component: TransactionsRouter, + children: [ + { + path: '', + component: TransactionsContainer + } + ] + } +] + +@NgModule({ + declarations: [ + TransactionsRouter, + TransactionsContainer, + ListComponent + ], + imports: [ + AppSharedModule, + NgOptimizedImage, + RouterModule.forChild(routes) + ] +}) +export class TransactionsModule { } diff --git a/src/assets/images/logo-b.png b/src/assets/images/logo-b.png index 073c80f..b28365c 100644 Binary files a/src/assets/images/logo-b.png and b/src/assets/images/logo-b.png differ diff --git a/src/assets/images/logo.png b/src/assets/images/logo.png index 64e625a..50aa934 100644 Binary files a/src/assets/images/logo.png and b/src/assets/images/logo.png differ diff --git a/src/environments/environment.development.ts b/src/environments/environment.development.ts index ca08abb..d50f7be 100644 --- a/src/environments/environment.development.ts +++ b/src/environments/environment.development.ts @@ -1,5 +1,5 @@ export const environment = { production: false, hideForm: false, - APIURL: 'https://cathaypay.71dev.com/cathaypay-api/api' + APIURL: 'https://cathaypay.71dev.com/cathaypay-api' }; diff --git a/src/favicon.ico b/src/favicon.ico index 568394c..f15ecb3 100644 Binary files a/src/favicon.ico and b/src/favicon.ico differ diff --git a/src/favicon2.ico b/src/favicon2.ico new file mode 100644 index 0000000..568394c Binary files /dev/null and b/src/favicon2.ico differ diff --git a/src/styles/_layout-auth.scss b/src/styles/_layout-auth.scss index 8998c6f..b230da3 100644 --- a/src/styles/_layout-auth.scss +++ b/src/styles/_layout-auth.scss @@ -7,8 +7,11 @@ .auth-logo { height: 140px; } + +.logo-auth { + width: 150px; +} .auth-heading { - margin-top: -20px; margin-bottom: 20px; text-align: left; font-size: 20px; diff --git a/tsconfig.json b/tsconfig.json index f959a8e..2b467f7 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,33 +1,22 @@ -/* To learn more about this file see: https://angular.io/config/tsconfig. */ { - "compileOnSave": false, - "compilerOptions": { - "baseUrl": "./", - "outDir": "./dist/out-tsc", - "forceConsistentCasingInFileNames": true, - "strict": true, - "noImplicitOverride": false, - "noPropertyAccessFromIndexSignature": true, - "noImplicitReturns": true, - "noFallthroughCasesInSwitch": true, - "sourceMap": true, - "declaration": false, - "downlevelIteration": true, - "experimentalDecorators": true, - "moduleResolution": "node", - "importHelpers": true, - "target": "ES2022", - "module": "ES2022", - "useDefineForClassFields": false, - "lib": [ - "ES2022", - "dom" - ] - }, - "angularCompilerOptions": { - "enableI18nLegacyMessageIdFormat": false, - "strictInjectionParameters": true, - "strictInputAccessModifiers": true, - "strictTemplates": true + "compileOnSave": false, + "compilerOptions": { + "baseUrl": "./", + "outDir": "./dist/out-tsc", + "sourceMap": true, + "declaration": false, + "module": "es2020", + "moduleResolution": "node", + "experimentalDecorators": true, + "importHelpers": true, + "target": "es2015", + "typeRoots": [ + "node_modules/@types" + ], + "lib": [ + "es2018", + "dom" + ] + } } -} + \ No newline at end of file