From 4d6167d6e83abc4c2bc5ff3d6ec5d80e4c1c5caa Mon Sep 17 00:00:00 2001 From: Mohamed Mekawy Date: Wed, 19 Feb 2020 12:25:18 +0300 Subject: [PATCH] finish confirmation page --- .../confirm-add-eit.component.html | 166 ++++++++++-------- .../confirm-add-eit.component.scss | 156 +++++++++++++++- .../confirm-add-eit.component.ts | 111 ++++++++++++ .../work-list-attach.component.ts | 1 + Mohem/src/theme/worklist.scss | 5 + 5 files changed, 361 insertions(+), 78 deletions(-) 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 b8cc8a57..af315623 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 @@ -8,36 +8,100 @@ - - - - - - - - -

{{ 'general, notAttch' | translate}}

+ + +
{{'general, addAttach' | translate}}
+
+ +
+ +
+
+
+ + + {{ 'general, notAttch' | translate}} + +
+ + +
+ + + + {{attachList.AttachmentID +1 }} . + + + + {{attachList.P_FILE_NAME }} + + + + + + + - +
+
+ +
+ + +
+
+ + {{attachRes.FILE_NAME }} + +
+ + + + + + + +
+
+ +
+ - - {{'confirmAddEit, comment' | translate}} +
{{'confirmAddEit, comment' | translate}}
+ +
-
{{'confirmAddEit, approverList' | translate}}
- -
+
+
- +
@@ -47,10 +111,10 @@ src="../assets/imgs/profile.png">
- + {{employee.APPROVER}} - + {{employee.APPROVER_TYPE}} @@ -63,13 +127,13 @@ - + + @@ -88,14 +152,10 @@ {{'confirmAddEit, status' | translate}} - - + - - + {{item.APPROVER_ORDER_NUMBER}} @@ -114,9 +174,7 @@ - + @@ -125,44 +183,7 @@
- - - - - +
@@ -225,18 +246,15 @@ - +
- + --> + -
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 86b81e89..c78deefc 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 @@ -27,11 +27,11 @@ .attachmentDiv{ background: #ffffff; - height: 80px; + height: auto; text-align: center; padding-top: 1px; margin: 10px; - border-radius: 34px; + border-radius: 15px; border: 1px solid grey; } @@ -47,10 +47,9 @@ .submitNote{ background: #ffffff; height: 80px; - text-align: center; padding-top: 1px; margin: 10px; - border-radius: 34px; + border-radius: 15px; border: 1px solid grey; } @@ -63,3 +62,152 @@ margin: 10px; border-radius: 5px; } + +/************************New Design**********************************/ +.notification-list{ + background: none; + background: none; + border-radius: 32px; + ion-item{ + // margin-top: 5px; + // margin-bottom: 5px; + + background-color: transparent; + .item-date{ + width: 100%; + font-size: 16px; + font-weight: bold; + + text-align: start; + padding: 0; + margin: 0; + + position: absolute; + left: 0; + top: 12%; + } + ion-label , [item-end]{ + + white-space: normal; + font-size: 14px; + padding-top: 15%; + // :root[dir="ltr"]{ + // margin-left: 10px; + // } + // :root[dir="rtl"]{ + // margin-right: 10px; + // } + + } + + } +} + + + + + + +.timeline { + position: relative; + margin: 15px 0 0 0; + // border-bottom: solid 1px var(--cusgray); +} + +.timeline:before { + + content: ''; + position: inherit !important; + top: 0; + bottom: 0; + width: 4px; + // background: #e4e4e4; + z-index: 1; + left: 35px; + /* margin-left: -10px; */ + /* z-index: 1; */ +} + +.timeline .timeline-thumb { + + border-radius: 500px; + width: 70px !important; + z-index: 2; + position: absolute; + left: 0px; + // :root[dir="ltr"]{ + // left: 37px; + // } + // :root[dir="rtl"]{ + // right: 37px; + // } + float: right; + top: 9px; +} + +.timeline .timeline-thumb.timeline-icon { + height: 70px; + // text-align: center; + // color: white; + // border: 5px solid #CBD0D3; + // transform: scale(0.2); +} + + + +.timeline .timeline-item { + width: 40px; + +} + +.timeline .timeline-stats { + position: relative; + font-size: 12px; + color: var(--darkgray); + +} + +.empImge{ + border-radius: 50%; + width:100%; + height: 100%; + border: #dedede solid 1px; + +} +.empImgeRep { + border-radius: 50% !important; + width: 80px; + height: 80px; + border: #dedede solid 1px; +} + +.line{ + padding-bottom:87px; +} + +.attachLable{ + position: absolute; + top: 0px; + z-index: 0; + background: #30b8c6; + color: #fff; + border-radius: 50%; + border: 0px; + width: 24px; + height: 24px; + text-align: center; + font-size: 5px; +} + +.removeLable{ + top: 0px; + z-index: 0; + background: #d8252d; + color: #fff; + border-radius: 50%; + border: 0px; + width: 20px; + height: 20px; + text-align: center; + font-size: 5px; +} \ No newline at end of file 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 4171b53f..f8168390 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 @@ -12,6 +12,7 @@ import { CommonService } from 'src/app/hmg-common/services/common/common.service import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; import { EitService } from '../services/eit.service'; import { AddEitResponse } from '../models/add.eit.response'; +import { FileUploader } from 'ng2-file-upload'; @Component({ selector: 'app-confirm-add-eit', @@ -46,6 +47,20 @@ export class ConfirmAddEitComponent implements OnInit { isSubmitBtnClicked: boolean; isDelete: boolean = false; + /***Add Attchment Vars */ + isUpload: boolean = false; + inQueue: boolean = false; + addAttachmentListReq: any; + attachmentID: number = 0; + addAttachRequest: any = []; + fileData: any; + fileType: any; + dirPage: any; + TransactionID: 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']; + + constructor(public modalController: ModalController, public cs: CommonService, private ts: TranslatorService, private eitService: EitService) { this.isSubmitBtnClicked = false; this.eitRequest = new EitRequest(); @@ -413,4 +428,100 @@ export class ConfirmAddEitComponent implements OnInit { this.cancelEitProcess(); } + /*******************Add attchement Functions*************/ + + public uploader: FileUploader = new FileUploader({ + allowedMimeType: ['application/pdf', 'image/jpeg', 'image/png', 'text/plain', 'image/jpg', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'], + maxFileSize: 10 * 1024 * 1024, + formatDataFunctionIsAsync: true, + formatDataFunction: async (item) => { + return new Promise((resolve, reject) => { + resolve({ + name: item._file.name, + length: item._file.size, + contentType: item._file.type, + date: new Date() + }); + }); + } + }); + + + onFileSelected(input) { + + // this.uploader.onWhenAddingFileFailed = function (item: any, filter: any, options: any){ + + if (!(this.filterAllowedType.indexOf(input.target.files[0].type) > -1)) { + let msg: string = ""; + msg = this.ts.trPK("general", "notSupport"); + this.cs.presentAlert(msg); + return + } // todo: show alert that you tried uploading wrong files + + else { + + const file = input.target.files[0]; + + // console.log(file); + + //var encoded = Base64.encode(file); + this.getBase64(file).then( + data => this.pushObject(data, file.name, file.type) + ); + + // } + // }; + + } + } + + + getBase64(file) { + return new Promise((resolve, reject) => { + const reader = new FileReader(); + reader.readAsDataURL(file); + reader.onload = () => resolve(reader.result); + reader.onerror = error => reject(error); + }); + } + + + pushObject(fileData, name, type) { + + console.log("before push: "+ this.index); + //this.attachListOver.length++; + try { + let array = name.split('.'); + let attachType: string = array[array.length - 1]; + + this.attachListOver.push( + { + AttachmentID: this.attachListOver.length, + P_FILE_CONTENT_TYPE: attachType,//type.split('/')[1], + P_FILE_DATA: fileData.split(',')[1], + P_FILE_NAME: name,//.split('.')[0], + P_TRANSACTION_ID: this.TransactionID + }) + + } catch (e) { + + } + + + //console.log("after push: "+ this.index); + // return this.addAttachRequest + } + + + // removeFile(objectitem) { + + // let objIndex1 = this.uploader.queue.findIndex(item => item == objectitem); + // this.uploader.queue.splice(objIndex1, 1); + // let objIndex = this.addAttachRequest.findIndex(item => item.AttachmentID == objectitem.AttachmentID); + // this.addAttachRequest.splice(objIndex, 1); + // // this.addAttachRequest =this.addAttachRequest.filter(item => item.AttachmentID !== objectitem.AttachmentID); + + // } + + } diff --git a/Mohem/src/app/notification/work-list-attach/work-list-attach.component.ts b/Mohem/src/app/notification/work-list-attach/work-list-attach.component.ts index c73997b3..5a43d43c 100644 --- a/Mohem/src/app/notification/work-list-attach/work-list-attach.component.ts +++ b/Mohem/src/app/notification/work-list-attach/work-list-attach.component.ts @@ -32,6 +32,7 @@ export class WorkListAttachComponent implements OnInit { // modal.present(); this.cs.sharedService.setSharedData({ displayData: value, TypeData: Type }, 'WorkListAttachViewPage') + const modal = await this.modalCtrl.create({ component: WorkListAttachViewComponent }); diff --git a/Mohem/src/theme/worklist.scss b/Mohem/src/theme/worklist.scss index 17f43754..be2127bc 100644 --- a/Mohem/src/theme/worklist.scss +++ b/Mohem/src/theme/worklist.scss @@ -366,3 +366,8 @@ left: 66px; } +.approvalTitle{ + font-weight: bold; + font-size: 16px; + text-align: left; +} \ No newline at end of file