Advertisement
coffeecode12

Untitled

Mar 24th, 2020
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.11 KB | None | 0 0
  1.  
  2. KODINGAN UNDANGAN KOMITE
  3.  
  4.  
  5. import { Component, OnInit, ChangeDetectorRef, ViewChild } from '@angular/core';
  6. import { AuthenticationService } from 'src/app/service/auth-service';
  7. import { ToastrService } from 'ngx-toastr';
  8. import { ModalDirective } from 'ngx-bootstrap';
  9. import * as $ from 'jquery';
  10. import 'datatables.net';
  11. import 'datatables.net-bs4';
  12. import { PraKomiteService } from 'src/app/service/pra-komite/pra-komite.service';
  13. import { PraKomiteAll } from 'src/app/domain/pra-komite/pra-komite';
  14. import { ConfirmPrakomite } from 'src/app/domain/pra-komite/confirm-prakomite';
  15. import { AnalisaYuridisService } from 'src/app/service/analisa-yuridis/analisa-yuridis.service';
  16. import { BodyAnalisaYuridis } from 'src/app/domain/analisa-yuridis/entry-analisa-yuridis/body';
  17. import { HeaderAnalisaYuridis } from 'src/app/domain/analisa-yuridis/entry-analisa-yuridis/header';
  18. import { MasterEntryYuridis } from 'src/app/domain/analisa-yuridis/entry-analisa-yuridis/master';
  19. import { RapatKomiteAll } from 'src/app/domain/rapat-komite/rapat-komite';
  20. import { DetailNotulen } from 'src/app/domain/pra-komite/notulen-prakomite/detail-notulen';
  21. import { MasterDetailNotulen } from 'src/app/domain/pra-komite/notulen-prakomite/master-detail-notulen';
  22. import { UndaganKomiteService } from 'src/app/service/komite/undagan-komite.service';
  23. import { MasterViewUndanganKomite } from 'src/app/domain/komite/undangan-komite/master-view-undangan-komite';
  24. import { ViewUndanganKomite } from 'src/app/domain/komite/undangan-komite/view-undangan-komite';
  25. import { MasterUndanganKomite } from 'src/app/domain/pra-komite/undangan-prakomite/master-undangan-prakomite';
  26. import { HeaderUndanganKomite } from 'src/app/domain/pra-komite/undangan-prakomite/header-undangan-komite';
  27. import { YthUndanganKomite } from 'src/app/domain/komite/undangan-komite/yth-undangan-komite';
  28. import { DaftarUndanganKomite } from 'src/app/domain/komite/undangan-komite/daftar-undangan-komite';
  29.  
  30.  
  31. declare const terbilang: any;
  32. @Component({
  33. selector: 'app-undangan-komite',
  34. templateUrl: './undangan-komite.component.html',
  35. styleUrls: ['./undangan-komite.component.scss']
  36. })
  37. export class UndanganKomiteComponent implements OnInit {
  38.  
  39. clients: any[];
  40. dataTable: any;
  41. loading = 'true';
  42. bagian: string;
  43. kadiv1: string;
  44. kabag1: string;
  45. stafbisnis1: string;
  46. jenis: string;
  47. jenisModal :string;
  48. divisi:string = localStorage.getItem('sesiondivisi');
  49.  
  50. //TABS BISNIS
  51. bedaComponentInfoDataUmum = 'close';
  52. bedaComponentAgunan = 'close';
  53. bedaComponentStrukturKredit = 'close';
  54. bedaComponentUploadDokumen = 'close';
  55. bedaComponentCreditRating = 'close';
  56. bedaComponentCatatan = 'close';
  57. //TABS RESIKO
  58. bedaComponentInfoDataUmumResiko = 'close';
  59. bedaComponentRisNF = 'close';
  60. bedaComponentSubjectiveJudgement = 'close';
  61. bedaComponentRepaimentCapacity = 'close';
  62. bedaComponentViewFinancialRatio = 'close';
  63. bedaComponentSC = 'close';
  64.  
  65. constructor(
  66. private chRef: ChangeDetectorRef,
  67. private service: UndaganKomiteService,
  68. private authenticationService: AuthenticationService,
  69. private toastr: ToastrService,
  70. private analisayuridis: AnalisaYuridisService
  71.  
  72. ) {}
  73.  
  74.  
  75. @ViewChild('modalView') private modalView: ModalDirective;
  76. @ViewChild('modalConfirm') private modalConfirm: ModalDirective;
  77. @ViewChild('modalViewBisnis') private modalViewBisnis: ModalDirective;
  78. @ViewChild('modalTabResiko') private modalTabResiko: ModalDirective;
  79. @ViewChild('modalTabYuridis') private modalTabYuridis: ModalDirective;
  80. @ViewChild('modalRapatKomite') private modalRapatKomite: ModalDirective;
  81. @ViewChild('ctdTabset') ctdTabset;
  82. @ViewChild('tabsResiko') tabsResiko;
  83. @ViewChild('tabsYuridis') tabsYuridis;
  84.  
  85. //BUAT RAPAT KOMITE
  86. rapatKomites: RapatKomiteAll[] = [];
  87. rapatKomite: RapatKomiteAll = new RapatKomiteAll();
  88.  
  89. //detail
  90. masterDetail: MasterDetailNotulen = new MasterDetailNotulen();
  91. masterDetails: MasterDetailNotulen[] = [];
  92.  
  93. detailRapat: DetailNotulen = new DetailNotulen();
  94. detailRapats: DetailNotulen[] = [];
  95.  
  96.  
  97. uk: MasterViewUndanganKomite = new MasterViewUndanganKomite();
  98. uks: MasterViewUndanganKomite [] =[];
  99.  
  100. // view undangan komite baru
  101. view: ViewUndanganKomite = new ViewUndanganKomite();
  102. views: ViewUndanganKomite [] =[];
  103.  
  104. // model untuk undangan
  105. undangan: MasterUndanganKomite = new MasterUndanganKomite();
  106. undangans: MasterUndanganKomite[] = [];
  107.  
  108. //data undangan
  109. dataUndangan :HeaderUndanganKomite = new HeaderUndanganKomite();
  110. dataUndangans: HeaderUndanganKomite[] = [];
  111.  
  112. // yth undangan
  113. ythUndangan :YthUndanganKomite = new YthUndanganKomite();
  114. ythUndangans: YthUndanganKomite[] = [];
  115.  
  116. // daftar undangan
  117. daftarundangan :DaftarUndanganKomite = new DaftarUndanganKomite();
  118. daftarundangans: DaftarUndanganKomite[] = [];
  119.  
  120. ngOnInit() {
  121. this.getUsername();
  122. }
  123.  
  124. public hide(): void {
  125. window.localStorage.removeItem('IdProposalLS');
  126. window.localStorage.removeItem('jenisMitraLS');
  127. window.localStorage.removeItem('namaMitraLS');
  128. window.localStorage.removeItem('alamatMitraLS');
  129. window.localStorage.removeItem('statusView');
  130. // this.modalView.hide();
  131. this.modalRapatKomite.hide();
  132.  
  133. // console.log('hapus semua LS');
  134.  
  135. }
  136.  
  137. switchNgBTab(id: string) {
  138. this.ctdTabset.select(id);
  139. }
  140.  
  141. dafaultTabsResiko(id: string) {
  142. this.tabsResiko.select(id);
  143. }
  144.  
  145. dafaultTabsYuridis(id: string) {
  146. this.tabsYuridis.select(id);
  147. }
  148.  
  149. public showModalViewKoreksi(idProposal: string, jenisMitra: string, namaMitra:string, alamat:string, jenisModal:string) {
  150. this.modalView.show();
  151. this.jenisModal = jenisModal;
  152.  
  153. //untuk beda component
  154. localStorage.setItem('IdProposalLS',idProposal);
  155. localStorage.setItem('jenisMitraLS',jenisMitra);
  156. localStorage.setItem('namaMitraLS',namaMitra);
  157. localStorage.setItem('alamatMitraLS',alamat);
  158.  
  159. if(this.jenisModal == 'view'){
  160. localStorage.setItem('statusView','readonly');
  161. }else if(this.jenisModal == 'koreksi'){
  162. localStorage.setItem('statusView','bisaEdit');
  163. }
  164.  
  165. // melempar ke model sementara
  166. // this.prakomite.idProposal = Number(idProposal);
  167. // this.prakomite.jenisMitra = jenisMitra;
  168. // this.prakomite.namaMitra = namaMitra;
  169. // this.prakomite.alamat = alamat;
  170.  
  171. }
  172.  
  173. btnViewBisnis(){
  174. this.modalViewBisnis.show();
  175. this.bedaComponentInfoDataUmum = 'open';
  176. this.switchNgBTab('tab1');
  177. }
  178.  
  179. btnTabsResiko(){
  180. this.modalTabResiko.show();
  181. this.dafaultTabsResiko('tab1');
  182. this.bedaComponentInfoDataUmumResiko = 'open';
  183. }
  184.  
  185. hideModalTabResiko(){
  186. this.modalTabResiko.hide();
  187. this.bedaComponentInfoDataUmumResiko = 'close';
  188. this.bedaComponentRisNF = 'close';
  189. this.bedaComponentSubjectiveJudgement = 'close';
  190. this.bedaComponentRepaimentCapacity = 'close';
  191. this.bedaComponentViewFinancialRatio = 'close';
  192. this.bedaComponentCatatan = 'close';
  193. this.bedaComponentSC = 'close';
  194.  
  195. this.dafaultTabsResiko('tab1');
  196. }
  197.  
  198. hideModalViewBisnis(){
  199.  
  200. this.modalViewBisnis.hide();
  201.  
  202. this.bedaComponentInfoDataUmum = 'close';
  203. this.bedaComponentAgunan = 'close';
  204. this.bedaComponentStrukturKredit = 'close';
  205. this.bedaComponentUploadDokumen = 'close';
  206. this.bedaComponentCreditRating = 'close';
  207. this.bedaComponentCatatan = 'close';
  208. this.switchNgBTab('tab1');
  209. }
  210.  
  211. // TABS BISNIS
  212. tabInformasiDataUmum(){
  213. this.bedaComponentInfoDataUmum = 'open';
  214. }
  215.  
  216. tabAgunan(){
  217. this.bedaComponentAgunan = 'open';
  218. }
  219.  
  220. tabStrukturKredit(){
  221. this.bedaComponentStrukturKredit = 'open';
  222. }
  223.  
  224. tabUploadDokumen(){
  225. this.bedaComponentUploadDokumen = 'open'
  226. }
  227.  
  228. tabCreditRating(){
  229. this.bedaComponentCreditRating = 'open'
  230. }
  231.  
  232. // END TABS BISNIS
  233.  
  234. //TABS RESIKO
  235. // tabInformasiDataUmumResiko(){
  236. // this.bedaComponentInfoDataUmumResiko = 'open';
  237. // console.log('buka tabs info data umum');
  238. // }
  239.  
  240. // tabRisNF(){
  241. // this.bedaComponentRisNF = 'open';
  242. // console.log('buka tabs ris nf');
  243. // }
  244.  
  245. // tabSubjectiveJudgement(){
  246. // this.bedaComponentSubjectiveJudgement = 'open';
  247. // console.log('buka tabs SJ');
  248. // }
  249.  
  250. // tabRepaimentCapacity(){
  251. // this.bedaComponentRepaimentCapacity = 'open';
  252. // console.log('buka tabs rpc');
  253. // }
  254.  
  255. // tabViewFinancialRatio(){
  256. // this.bedaComponentViewFinancialRatio = 'open';
  257. // console.log('buka tabs financial ratio');
  258. // }
  259.  
  260.  
  261. // tabRiskScoreCard(){
  262. // this.bedaComponentSC = 'open';
  263. // }
  264.  
  265. // tabCatatan(){
  266. // this.bedaComponentCatatan = 'open';
  267. // console.log('buka tabs Catatan');
  268. // }
  269. //END TABS RESIKO
  270.  
  271.  
  272. // getDetailRapatKom(idProposal) {
  273. // this.rapatkom.getDetailRapatKom(
  274. // idProposal
  275. // )
  276. // .subscribe(
  277. // data => {
  278. // // this.loading = 'false';
  279. // this.masterDetails = data;
  280. // this.detailRapat = data.data;
  281. // },
  282. // error => {
  283. // }
  284. // );
  285.  
  286. // }
  287.  
  288. getUsername() {
  289. this.service.getViewUndanganKomite(
  290. this.authenticationService.currentUserValue.username
  291. )
  292. .subscribe(
  293. data => {
  294. // this.loading = 'false'
  295. this.uks = data;
  296. this.uk =data;
  297. // this.uks = data;
  298. this.uk.data = data.data;
  299.  
  300. if (this.uks.length != 0 || this.uks.length != null){
  301. this.loading = 'false'
  302. }
  303. this.chRef.detectChanges();
  304. const table: any = $('table');
  305. this.dataTable = table.DataTable();
  306. },
  307. error => {
  308. }
  309.  
  310. );
  311. }
  312.  
  313. //+++++++++++++++++++++++ Modal Rapat Komite +++++++++++++++++++++++++++++++++
  314.  
  315. // btnViewRapatKomite(idProposal) {
  316. // this.modalRapatKomite.show();
  317. // localStorage.setItem('idProposalLS', idProposal);
  318. // this.getDetailRapatKom(idProposal);
  319. // }
  320.  
  321. public showConfirm(idProposal) {
  322. this.confirm.idProposal = idProposal;
  323. this.modalConfirm.show();
  324.  
  325. //menyimpan ke local storage
  326. // localStorage.setItem('idPro', idProposal);
  327. // localStorage.setItem('jenisMitra', jenisMitra);
  328. // localStorage.setItem('namaMitra', namaMitra);
  329.  
  330. // console.log(idProposal);
  331.  
  332. // melempar ke model sementara
  333. // this.masterOpiniBisnis.idProposal = idProposal;
  334. // this.masterOpiniBisnis.jenisMitra = jenisMitra;
  335. // this.masterOpiniBisnis.namaMitra = namaMitra;
  336. // this.refreshAprroval(idProposal);
  337. // this.getListFeedBack(idProposal);
  338. }
  339.  
  340. //+++++++++++++++++++++++ APPROVAL DAN REJECT +++++++++++++++++++++++++++++++++
  341.  
  342. confirm: ConfirmPrakomite = new ConfirmPrakomite();
  343. // selectModelApprovalorReject : string;
  344.  
  345. // selectConfirmOrReject(value){
  346. // this.confirm.flStatus = Number(value);
  347. // // console.log(value);
  348. // }
  349.  
  350. // btnConfirm(prakomite:PraKomiteAll){
  351. // this.confirm.idProposal = prakomite.idProposal;
  352.  
  353. // this.modalConfirm.show();
  354. // }
  355.  
  356. btnHideConfirm(){
  357. // this.prakomites = [];
  358. // this.getAllPraKomite();
  359. this.confirm = new ConfirmPrakomite();
  360. this.modalConfirm.hide();
  361. }
  362.  
  363. // confirmOrRejectFungsi() {
  364.  
  365. // this.confirm.username = this.authservice.currentUserValue.username;
  366. // this.confirm.divisi = localStorage.getItem('sesiondivisi');
  367. // this.confirm.flStatus = this.confirm.flStatus;
  368. // // this.confirm.idProposal = Number(localStorage.getItem('idProposalLS'));
  369.  
  370. // // console.log(this.confirm);
  371. // this.rapatkom.confirmRapatKomite(this.confirm)
  372. // .subscribe(
  373. // data => {
  374. // this.toastr["success"]("", 'Confirm Rapat Komite Success', {timeOut: 6000})
  375. // this.btnHideConfirm();
  376. // this.getAllRapatKom();
  377. // },
  378. // error => {
  379. // this.toastr.error('Connection Server Error', 'Error', {timeOut: 6000});
  380. // }
  381. // );
  382. // }
  383.  
  384. // btnApproval(){
  385. // this.confirmOrRejectFungsi();
  386. // }
  387.  
  388.  
  389. //+++++++++++++++++++++++ END APPROVAL DAN REJECT +++++++++++++++++++++++++++++++++
  390.  
  391.  
  392. // // +++++ TABS YURIDIS +++++
  393. // loadingYuridis='true';
  394. // header: HeaderAnalisaYuridis= new HeaderAnalisaYuridis();
  395. // body:BodyAnalisaYuridis = new BodyAnalisaYuridis();
  396. // masters :MasterEntryYuridis[] = [];
  397. // master:MasterEntryYuridis= new MasterEntryYuridis();
  398. // bedaComponentYuridis:string;
  399.  
  400. // clearAnalisaYuridis() {
  401. // this.master = new MasterEntryYuridis();
  402. // this.header = new HeaderAnalisaYuridis();
  403. // this.body = new BodyAnalisaYuridis();
  404. // }
  405.  
  406. // btnTabYuridis(){
  407. // this.getAllEntryYuridis();
  408.  
  409. // this.dafaultTabsYuridis('tab1');
  410. // this.bedaComponentYuridis = 'open';
  411. // this.modalTabYuridis.show();
  412. // }
  413.  
  414. // tabYuridis(){
  415. // this.loadingYuridis='true';
  416. // this.bedaComponentYuridis = 'open';
  417.  
  418. // this.getAllEntryYuridis();
  419. // }
  420.  
  421. // btnHideTabYuridis(){
  422. // this.modalTabYuridis.hide();
  423. // this.bedaComponentYuridis = 'close';
  424. // this.bedaComponentCatatan = 'close';
  425. // this.dafaultTabsYuridis('tab1');
  426. // }
  427.  
  428. // getAllEntryYuridis() {
  429. // this.analisayuridis.getEntryYuridis(
  430. // localStorage.getItem('IdProposalLS'), localStorage.getItem('jenisMitraLS')
  431. // )
  432. // .subscribe(
  433. // data => {
  434. // this.clearAnalisaYuridis();
  435.  
  436. // setTimeout(()=>{ this.loadingYuridis = 'false' }, 800);
  437. // this.master= data;
  438. // this.header= data.header;
  439. // this.body = data.body;
  440.  
  441. // },
  442. // error => {
  443. // }
  444. // );
  445. // }
  446.  
  447. // parseDate(dateString: string): Date {
  448. // if (dateString) {
  449. // return new Date(dateString);
  450. // }
  451. // return null;
  452. // }
  453.  
  454. // inputTerbilang(value){
  455. // // console.log(terbilang(value) + " Rupiah");
  456. // this.body.modalTerbilang=terbilang(value) + " Rupiah";
  457. // // console.log('ini nilai terbaru'+this.dataumumrisk.kspTerbilangRekomondasiDivisiBisnis)
  458.  
  459. // }
  460.  
  461. // saverAnalisaYuridis() {
  462. // this.loadingYuridis = 'true';
  463. // this.header.idProposal = Number(localStorage.getItem('IdProposalLS'));
  464. // this.header.updatedBy = this.authservice.currentUserValue.username;
  465. // this.header.createdBy = this.authservice.currentUserValue.username;
  466.  
  467. // this.body.idProposal = Number(localStorage.getItem('IdProposalLS'));
  468. // this.body.updatedBy = this.authservice.currentUserValue.username;
  469. // this.body.createdBy = this.authservice.currentUserValue.username;
  470.  
  471. // this.analisayuridis.createDataEntryYuridis(this.master)
  472. // .subscribe(
  473. // data => {
  474. // setTimeout(()=>{ this.loadingYuridis = 'false' }, 600);
  475. // if (this.toastr["success"]("", 'Save Analisa Yuridis Success', {timeOut: 6000})) {
  476. // this.masters.push(data);
  477. // }
  478.  
  479. // },
  480. // error => {
  481. // this.toastr.error('Connection Server Error', 'Error', {timeOut: 6000});
  482. // }
  483. // );
  484. // }
  485. // +++++ END TABS YURIDIS +++++
  486. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement