EIT Forms Bug Fixing

production
haroon amjad 7 years ago
parent a2511c41ce
commit 7f03817a38

@ -16,34 +16,49 @@
<ion-card> <ion-card>
<ion-card-header class="boxHdr"> <ion-card-header class="boxHdr">
<div class="hrTitle">{{'general, addAttach' | translate}}</div> <ion-grid no-padding>
<div class="fileDiv"> <input end class="inputfile" type="file" ng2FileSelect [uploader]="uploader"
<ion-row style="width: 100%;" nowrap align-items-center>
<ion-col size="10">
<div class="hrTitle">{{'general, addAttach' | translate}}</div>
</ion-col>
<ion-col size="2">
<div class="fileDiv"> <input end class="inputfile" type="file" ng2FileSelect [uploader]="uploader"
(change)="onFileSelected($event)" />
<label end for="file">
<ion-icon style="font-size: 30px;" name="add"></ion-icon>
</label></div>
</ion-col>
</ion-row>
</ion-grid>
<!-- <div class="fileDiv"> <input end class="inputfile" type="file" ng2FileSelect [uploader]="uploader"
(change)="onFileSelected($event)" /> (change)="onFileSelected($event)" />
<label end for="file"> <label end for="file">
<ion-icon name="add"></ion-icon> <ion-icon name="add"></ion-icon>
</label></div> </label></div> -->
</ion-card-header> </ion-card-header>
<ion-card-content> <ion-card-content>
<ion-grid class=" gridAH" *ngIf="uploader?.queue?.length > 0"> <ion-grid class=" gridAH" *ngIf="uploader?.queue?.length > 0">
<ion-row class="rowAH titleH"> <ion-row class="rowAH titleH" align-items-center>
<ion-col col-4> <ion-col size="4">
<label class="Header" for="">{{'addAttach.name' | translate}}</label> <label class="Header" for="">{{'addAttach, name' | translate}}</label>
</ion-col> </ion-col>
<ion-col col-4> <ion-col size="4">
<label class="Header" for="">{{'addAttach.size' | translate}}</label> <label class="Header" for="">{{'addAttach, size' | translate}}</label>
</ion-col> </ion-col>
<ion-col col-4> <ion-col size="4">
<label class="Header" for="">{{'addAttach.remove' | translate}}</label> <label class="Header" for="">{{'addAttach, remove' | translate}}</label>
</ion-col> </ion-col>
</ion-row> </ion-row>
<ion-row class="rowAH" *ngFor="let item of uploader.queue"> <ion-row class="rowAH" *ngFor="let item of uploader.queue">
<ion-col col-4> <ion-col size="4">
<label for="">{{ item?.file?.name }}</label> <label for="">{{ item?.file?.name }}</label>
</ion-col> </ion-col>
<ion-col col-4> <ion-col size="4">
<label *ngIf="uploader.options.isHTML5">{{ item?.file?.size/1024/1024 | number:'.2' }} MB</label> <label *ngIf="uploader.options.isHTML5">{{ item?.file?.size/1024/1024 | number:'.2' }} MB</label>
</ion-col> </ion-col>
<ion-col col-4> <ion-col size="4">
<button class="iconButton" ion-button (click)="removeFile(item)"> <img class="imgSize" <button class="iconButton" ion-button (click)="removeFile(item)"> <img class="imgSize"
src="../assets/imgs/deletegray.png"></button> src="../assets/imgs/deletegray.png"></button>
</ion-col> </ion-col>

@ -8,3 +8,12 @@
height: 40px; height: 40px;
// z-index: -1; // z-index: -1;
} }
.imgSize {
width: 22px;
height: 22px;
}
.Header {
font-weight: bold;
color: #1a586d;
}

@ -24,7 +24,7 @@ export class AddAttachComponent implements OnInit {
index: any = 1; index: any = 1;
dirPage: any; dirPage: any;
TransactionID: 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']; filterAllowedType: any = ['application/pdf', 'image/jpeg', 'image/png', 'text/plain', 'image/jpg', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'];

@ -14,22 +14,22 @@
<ion-card-content> <ion-card-content>
<!-- <ion-item class="itemAH" > --> <!-- <ion-item class="itemAH" > -->
<ion-grid class=" gridAH" *ngIf="approversList?.length > 0"> <ion-grid no-padding class=" gridAH" *ngIf="approversList?.length > 0">
<ion-row class="rowAH titleH"> <ion-row class="rowAH titleH" nowrap>
<ion-col col-1> <ion-col size="1">
<label class="Header" for="">{{'confirmAddEit, no' | translate}}</label> <ion-label class="Header" for="">{{'confirmAddEit, no' | translate}}</ion-label>
</ion-col> </ion-col>
<ion-col col-3> <ion-col size="3">
<label class="Header" for="">{{'confirmAddEit, approver' | translate}}</label> <ion-label class="Header" for="">{{'confirmAddEit, approver' | translate}}</ion-label>
</ion-col> </ion-col>
<ion-col col-3> <ion-col size="3">
<label class="Header" for="">{{'confirmAddEit, approverCategory' | translate}}</label> <ion-label class="Header" for="">{{'confirmAddEit, approverCategory' | translate}}</ion-label>
</ion-col> </ion-col>
<ion-col col-3> <ion-col size="3">
<label class="Header" for="">{{'confirmAddEit, approverType' | translate}}</label> <ion-label class="Header" for="">{{'confirmAddEit, approverType' | translate}}</ion-label>
</ion-col> </ion-col>
<ion-col col-2> <ion-col size="2">
<label class="Header" for="">{{'confirmAddEit, status' | translate}}</label> <ion-label class="Header" for="">{{'confirmAddEit, status' | translate}}</ion-label>
</ion-col> </ion-col>
</ion-row> </ion-row>
<!-- </ion-grid> <!-- </ion-grid>
@ -40,21 +40,21 @@
<!-- <ion-item class="itemAH" *ngFor="let item of approversList" > <!-- <ion-item class="itemAH" *ngFor="let item of approversList" >
<ion-grid class=" gridAH"> --> <ion-grid class=" gridAH"> -->
<ion-row class="rowAH" *ngFor="let item of approversList"> <ion-row class="rowAH" *ngFor="let item of approversList" nowrap>
<ion-col col-1> <ion-col size="1">
<label for="">{{item.APPROVER_ORDER_NUMBER}}</label> <ion-label class="tbData" for="">{{item.APPROVER_ORDER_NUMBER}}</ion-label>
</ion-col> </ion-col>
<ion-col col-3> <ion-col size="3">
<label for="">{{item.APPROVER}}</label> <ion-label class="tbData" for="">{{item.APPROVER}}</ion-label>
</ion-col> </ion-col>
<ion-col col-3> <ion-col size="3">
<label for="">{{item.APPROVER_CATEGORY}}</label> <ion-label class="tbData" for="">{{item.APPROVER_CATEGORY}}</ion-label>
</ion-col> </ion-col>
<ion-col col-3> <ion-col size="3">
<label for="">{{item.APPROVER_TYPE}}</label> <ion-label class="tbData" for="">{{item.APPROVER_TYPE}}</ion-label>
</ion-col> </ion-col>
<ion-col col-2> <ion-col csize="2">
<label for="">{{item.APPROVAL_STATUS}}</label> <ion-label class="tbData" for="">{{item.APPROVAL_STATUS}}</ion-label>
</ion-col> </ion-col>
</ion-row> </ion-row>
</ion-grid> </ion-grid>
@ -112,7 +112,6 @@
<ion-card> <ion-card>
<ion-card-header class="boxHdr"> <ion-card-header class="boxHdr">
<ion-grid no-padding> <ion-grid no-padding>
<ion-row style="width: 100%;" class="hrTitle" nowrap> <ion-row style="width: 100%;" class="hrTitle" nowrap>
<ion-col size="10"> <ion-col size="10">

@ -10,6 +10,16 @@
height: 22px; height: 22px;
} }
.Header {
font-weight: bold;
color: #1a586d !important;
font-size: 10px;
}
.tbData {
font-size: 10px;
}
.btnBack { .btnBack {
background: transparent; background: transparent;
float: right; float: right;

@ -30,7 +30,7 @@ export class ConfirmAddEitComponent implements OnInit {
respID: number; respID: number;
selMenu: MenuResponse; selMenu: MenuResponse;
getAttachList: any; getAttachList: any;
attachListDisplay: any; attachListDisplay: any = [];
headerTitle: string = ""; headerTitle: string = "";
isTrue: any = 0; isTrue: any = 0;
attachItems: any; attachItems: any;
@ -58,9 +58,7 @@ export class ConfirmAddEitComponent implements OnInit {
this.selEmp = this.cs.sharedService.getSharedData(MenuResponse.SHARED_SEL_EMP, false); this.selEmp = this.cs.sharedService.getSharedData(MenuResponse.SHARED_SEL_EMP, false);
this.respID = this.cs.sharedService.getSharedData(MenuResponse.SHARED_SEL_RESP_ID, false); this.respID = this.cs.sharedService.getSharedData(MenuResponse.SHARED_SEL_RESP_ID, false);
this.eitRequest = this.cs.sharedService.getSharedData(EitRequest.SHARED_DATA, false); this.eitRequest = this.cs.sharedService.getSharedData(EitRequest.SHARED_DATA, false);
this.isResubmitEIT = this.cs.sharedService.getSharedData('confirmAddEITData', false).isResubmit; this.isResubmitEIT = this.cs.sharedService.getSharedData('confirmAddEITData', false).isResubmit;
if (this.isResubmitEIT) { if (this.isResubmitEIT) {
this.getPassNotificationDetails = this.cs.sharedService.getSharedData(EITNotificatonBodyResponse.NOT_WORKLIST, true); this.getPassNotificationDetails = this.cs.sharedService.getSharedData(EITNotificatonBodyResponse.NOT_WORKLIST, true);
// console.log("this.getPassNotificationDetails: " + this.getPassNotificationDetails); // 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.addrespList = this.cs.sharedService.getSharedData(AddEitResponse.SHARED_DATA);
this.itemKey = this.addrespList.SubmitEITTransactionList.P_ITEM_KEY; this.itemKey = this.addrespList.SubmitEITTransactionList.P_ITEM_KEY;
this.P_TransactionID = this.addrespList.SubmitEITTransactionList.P_TRANSACTION_ID; this.P_TransactionID = this.addrespList.SubmitEITTransactionList.P_TRANSACTION_ID;
this.isDelete = this.isResubmitEIT = this.cs.sharedService.getSharedData('confirmAddEITData', false).isDelete; this.isDelete = this.isResubmitEIT = this.cs.sharedService.getSharedData('confirmAddEITData', false).isDelete;
@ -128,8 +125,8 @@ export class ConfirmAddEitComponent implements OnInit {
let request = { let request = {
AddAttachmentList: this.attachListOver AddAttachmentList: this.attachListOver
} }
this.eitService.addAttachment( this.eitService.addAttachment(
request). request).
subscribe((result: any) => { subscribe((result: any) => {
@ -232,6 +229,9 @@ export class ConfirmAddEitComponent implements OnInit {
//open the modal with return data //open the modal with return data
let attachDocID = attachItems.ATTACHED_DOCUMENT_ID; 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({ const modal = await this.modalController.create({
component: AddAttachComponent component: AddAttachComponent
}); });
@ -252,7 +252,8 @@ export class ConfirmAddEitComponent implements OnInit {
//.ATTACHED_DOCUMENT_ID //.ATTACHED_DOCUMENT_ID
this.updateFile(data, attachDocID); this.updateFile(data, attachDocID);
} else { } else {
this.attachListDisplay = data; console.log(data);
this.attachListDisplay = data.data;
this.attachItems = this.attachListDisplay.map(function (el) { this.attachItems = this.attachListDisplay.map(function (el) {
var o = Object.assign({}, el); var o = Object.assign({}, el);
o.isSuccess = false; 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.attachListOver ? this.attachListOver.concat(this.attachItems) : this.attachItems;
// this.attachListOver = this.attachListDisplay;
} }
// this.attachListDisplay=data; // this.attachListDisplay=data;
@ -268,62 +270,10 @@ export class ConfirmAddEitComponent implements OnInit {
// o.isSuccess = false; // o.isSuccess = false;
// return o; // return o;
// }) // })
// console.log(this.attachListDisplay);
// console.log(this.attachItems);
} }
}); });
return await modal.present(); 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) { removeFile(objectitem) {

@ -11,6 +11,7 @@ import { EITPage } from './eit.page';
import { HomeComponent } from './home/home.component'; import { HomeComponent } from './home/home.component';
import { EitListComponent } from './eit-list/eit-list.component'; import { EitListComponent } from './eit-list/eit-list.component';
import { DatePicker } from '@ionic-native/date-picker/ngx'; import { DatePicker } from '@ionic-native/date-picker/ngx';
import { WorkListAttachViewComponent } from '../notification/work-list-attach-view/work-list-attach-view.component';
const routes: Routes = [ const routes: Routes = [
@ -58,6 +59,9 @@ const routes: Routes = [
ConfirmAddEitComponent, ConfirmAddEitComponent,
AddAttachComponent AddAttachComponent
], ],
entryComponents: [
WorkListAttachViewComponent
],
providers: [ providers: [
DatePicker DatePicker
] ]

Loading…
Cancel
Save