From 7f03817a3899c6d1fa9ead3c110deeb656a784c4 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 16 Jul 2019 16:20:24 +0300 Subject: [PATCH] EIT Forms Bug Fixing --- .../eit/add-attach/add-attach.component.html | 41 ++++++++---- .../eit/add-attach/add-attach.component.scss | 9 +++ .../eit/add-attach/add-attach.component.ts | 2 +- .../confirm-add-eit.component.html | 47 +++++++------ .../confirm-add-eit.component.scss | 10 +++ .../confirm-add-eit.component.ts | 66 +++---------------- Mohem/src/app/eit/eit.module.ts | 4 ++ 7 files changed, 83 insertions(+), 96 deletions(-) diff --git a/Mohem/src/app/eit/add-attach/add-attach.component.html b/Mohem/src/app/eit/add-attach/add-attach.component.html index b89e6572..6bd3f873 100644 --- a/Mohem/src/app/eit/add-attach/add-attach.component.html +++ b/Mohem/src/app/eit/add-attach/add-attach.component.html @@ -16,34 +16,49 @@ -
{{'general, addAttach' | translate}}
-
+ + + +
{{'general, addAttach' | translate}}
+
+ +
+
+
+
+ + + - - - + + + - - + + - - + + - + - + - + diff --git a/Mohem/src/app/eit/add-attach/add-attach.component.scss b/Mohem/src/app/eit/add-attach/add-attach.component.scss index 5d75b59d..e6ced223 100644 --- a/Mohem/src/app/eit/add-attach/add-attach.component.scss +++ b/Mohem/src/app/eit/add-attach/add-attach.component.scss @@ -8,3 +8,12 @@ height: 40px; // z-index: -1; } + +.imgSize { + width: 22px; + height: 22px; +} +.Header { + font-weight: bold; + color: #1a586d; +} diff --git a/Mohem/src/app/eit/add-attach/add-attach.component.ts b/Mohem/src/app/eit/add-attach/add-attach.component.ts index 8afdc22d..b692cf45 100644 --- a/Mohem/src/app/eit/add-attach/add-attach.component.ts +++ b/Mohem/src/app/eit/add-attach/add-attach.component.ts @@ -24,7 +24,7 @@ export class AddAttachComponent implements OnInit { index: any = 1; dirPage: any; TransactionID: any; - indexLastObj: any + indexLastObj: any = 0; filterAllowedType: any = ['application/pdf', 'image/jpeg', 'image/png', 'text/plain', 'image/jpg', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']; diff --git a/Mohem/src/app/eit/confirm-add-eit/confirm-add-eit.component.html b/Mohem/src/app/eit/confirm-add-eit/confirm-add-eit.component.html index d919f3e3..531ceafe 100644 --- a/Mohem/src/app/eit/confirm-add-eit/confirm-add-eit.component.html +++ b/Mohem/src/app/eit/confirm-add-eit/confirm-add-eit.component.html @@ -14,22 +14,22 @@ - - - - + + + + {{'confirmAddEit, no' | translate}} - - + + {{'confirmAddEit, approver' | translate}} - - + + {{'confirmAddEit, approverCategory' | translate}} - - + + {{'confirmAddEit, approverType' | translate}} - - + + {{'confirmAddEit, status' | translate}} - - - + + + {{item.APPROVER_ORDER_NUMBER}} - - + + {{item.APPROVER}} - - + + {{item.APPROVER_CATEGORY}} - - + + {{item.APPROVER_TYPE}} - - + + {{item.APPROVAL_STATUS}} @@ -112,7 +112,6 @@ - diff --git a/Mohem/src/app/eit/confirm-add-eit/confirm-add-eit.component.scss b/Mohem/src/app/eit/confirm-add-eit/confirm-add-eit.component.scss index 6371d2b9..94ace281 100644 --- a/Mohem/src/app/eit/confirm-add-eit/confirm-add-eit.component.scss +++ b/Mohem/src/app/eit/confirm-add-eit/confirm-add-eit.component.scss @@ -10,6 +10,16 @@ height: 22px; } +.Header { + font-weight: bold; + color: #1a586d !important; + font-size: 10px; +} + +.tbData { + font-size: 10px; +} + .btnBack { background: transparent; float: right; diff --git a/Mohem/src/app/eit/confirm-add-eit/confirm-add-eit.component.ts b/Mohem/src/app/eit/confirm-add-eit/confirm-add-eit.component.ts index b1579cc8..62fe1d69 100644 --- a/Mohem/src/app/eit/confirm-add-eit/confirm-add-eit.component.ts +++ b/Mohem/src/app/eit/confirm-add-eit/confirm-add-eit.component.ts @@ -30,7 +30,7 @@ export class ConfirmAddEitComponent implements OnInit { respID: number; selMenu: MenuResponse; getAttachList: any; - attachListDisplay: any; + attachListDisplay: any = []; headerTitle: string = ""; isTrue: any = 0; attachItems: any; @@ -58,9 +58,7 @@ export class ConfirmAddEitComponent implements OnInit { this.selEmp = this.cs.sharedService.getSharedData(MenuResponse.SHARED_SEL_EMP, false); this.respID = this.cs.sharedService.getSharedData(MenuResponse.SHARED_SEL_RESP_ID, false); this.eitRequest = this.cs.sharedService.getSharedData(EitRequest.SHARED_DATA, false); - this.isResubmitEIT = this.cs.sharedService.getSharedData('confirmAddEITData', false).isResubmit; - if (this.isResubmitEIT) { this.getPassNotificationDetails = this.cs.sharedService.getSharedData(EITNotificatonBodyResponse.NOT_WORKLIST, true); // console.log("this.getPassNotificationDetails: " + this.getPassNotificationDetails); @@ -82,7 +80,6 @@ export class ConfirmAddEitComponent implements OnInit { this.addrespList = this.cs.sharedService.getSharedData(AddEitResponse.SHARED_DATA); this.itemKey = this.addrespList.SubmitEITTransactionList.P_ITEM_KEY; this.P_TransactionID = this.addrespList.SubmitEITTransactionList.P_TRANSACTION_ID; - this.isDelete = this.isResubmitEIT = this.cs.sharedService.getSharedData('confirmAddEITData', false).isDelete; @@ -128,8 +125,8 @@ export class ConfirmAddEitComponent implements OnInit { let request = { AddAttachmentList: this.attachListOver - } + this.eitService.addAttachment( request). subscribe((result: any) => { @@ -232,6 +229,9 @@ export class ConfirmAddEitComponent implements OnInit { //open the modal with return data let attachDocID = attachItems.ATTACHED_DOCUMENT_ID; + this.cs.sharedService.setSharedData( this.P_TransactionID, 'TransactionID'); + this.cs.sharedService.setSharedData(this.attachListOver.length, 'indexLastObj'); + const modal = await this.modalController.create({ component: AddAttachComponent }); @@ -252,7 +252,8 @@ export class ConfirmAddEitComponent implements OnInit { //.ATTACHED_DOCUMENT_ID this.updateFile(data, attachDocID); } else { - this.attachListDisplay = data; + console.log(data); + this.attachListDisplay = data.data; this.attachItems = this.attachListDisplay.map(function (el) { var o = Object.assign({}, el); o.isSuccess = false; @@ -260,6 +261,7 @@ export class ConfirmAddEitComponent implements OnInit { }); this.attachListOver = this.attachListOver ? this.attachListOver.concat(this.attachItems) : this.attachItems; + // this.attachListOver = this.attachListDisplay; } // this.attachListDisplay=data; @@ -268,62 +270,10 @@ export class ConfirmAddEitComponent implements OnInit { // o.isSuccess = false; // return o; // }) - // console.log(this.attachListDisplay); - // console.log(this.attachItems); } }); return await modal.present(); - - // var modalPage = this.modalController.create('AddAttachPage', { indexLastObj: this.attachListOver.length, TransactionID: this.P_TransactionID, enableBackdropDismiss: false });//enableBackdropDismiss: false ,enableBackdropDismiss: false - - // modalPage.onDidDismiss(data => { - // if (data == "cancel" || data == "undefined") { - - // return; - // } - - // else { - // if (!str) { - - // // this.attachItems = data.map(function(el) { - // // var o = Object.assign({}, el); - // // o.isSuccess = false; - // // return o; - // // }) - // // this.objIndex1 =this.attachmentRes.findIndex(item => item == attachItems); //to use it in remove attach - // //.ATTACHED_DOCUMENT_ID - // this.updateFile(data, attachDocID); - // } - - // else { - // this.attachListDisplay = data; - // this.attachItems = this.attachListDisplay.map(function (el) { - // var o = Object.assign({}, el); - // o.isSuccess = false; - // return o; - // }); - - // this.attachListOver = this.attachListOver ? this.attachListOver.concat(this.attachItems) : this.attachItems; - - - // } - - // // this.attachListDisplay=data; - - // // this.attachItems = this.attachListDisplay.map(function(el) { - // // var o = Object.assign({}, el); - // // o.isSuccess = false; - // // return o; - // // }) - // // console.log(this.attachListDisplay); - // // console.log(this.attachItems); - - - // }// end else - // }); - // modalPage.present(); - } removeFile(objectitem) { diff --git a/Mohem/src/app/eit/eit.module.ts b/Mohem/src/app/eit/eit.module.ts index 148cd9db..648bb042 100644 --- a/Mohem/src/app/eit/eit.module.ts +++ b/Mohem/src/app/eit/eit.module.ts @@ -11,6 +11,7 @@ import { EITPage } from './eit.page'; import { HomeComponent } from './home/home.component'; import { EitListComponent } from './eit-list/eit-list.component'; import { DatePicker } from '@ionic-native/date-picker/ngx'; +import { WorkListAttachViewComponent } from '../notification/work-list-attach-view/work-list-attach-view.component'; const routes: Routes = [ @@ -58,6 +59,9 @@ const routes: Routes = [ ConfirmAddEitComponent, AddAttachComponent ], + entryComponents: [ + WorkListAttachViewComponent + ], providers: [ DatePicker ]