+
+
{{ts.trPK('myTeam','my-team-members')}}
+
{{EmployeeTotal}}
+
+
+
-
+
+
@@ -241,46 +478,49 @@
diff --git a/Mohem/src/app/my-team/details/details.component.scss b/Mohem/src/app/my-team/details/details.component.scss
index 136a9943..49b07c86 100644
--- a/Mohem/src/app/my-team/details/details.component.scss
+++ b/Mohem/src/app/my-team/details/details.component.scss
@@ -32,11 +32,19 @@ ion-title{
text-align: center;
margin-bottom: 15px;
.user-image-container{
- position: relative;
- width: 80px;
- height: 80px;
- display: block;
- margin: 0 auto;
+ position: relative;
+ width: 100%;
+ height: 24px;
+ justify-content: space-between;
+ display: flex;
+ margin: 0 auto;
+ align-items: center;
+ }
+ // position: relative;
+ // width: 80px;
+ // height: 80px;
+ // display: block;
+ // margin: 0 auto;
// &:before{
// position: absolute;
// content: "";
@@ -53,16 +61,27 @@ ion-title{
// background-color: green !important;
// }
}
+
+ @media screen and (min-width: 1px) and (max-width:767px){
.user-image{
- overflow: hidden;
- position: relative;
- display: block;
- width: 100%;
- height: 100%;
- border-radius: 80px;
- border: 1px solid #ccc;
- margin: 0px auto 6px;
- }
+ position: relative;
+ display: block;
+ width: 30%;
+ height: 100%;
+ border-radius: 80px;
+ /* border: 1px solid #ccc; */
+ margin-top: -125px;
+
+ }}
+ @media screen and (min-width: 768px) and (max-width:1024px){
+ .user-image{
+ position: relative;
+ display: block;
+ width: 30%;
+ height: 100%;
+ border-radius: 80px;
+ margin-bottom: 371px;
+ }}
h1{
margin: 0;
padding: 0;
@@ -71,18 +90,21 @@ ion-title{
margin-bottom: 4px;
}
span{
- font-size: 14px;
+ font-size: 12px;
display: block;
- color: #888
+ // color: #888
+
}
- }
+
$actionBtnSize : 36px;
.user-actions{
text-align: center;
+ margin-left: 1px;
.action-button{
font-size: 11px;
- white-space: nowrap;
- color: #888;
+ font-weight: bold;
+ // white-space: nowrap;
+ // color: #888;
.action-button-icon{
width: $actionBtnSize;
height: $actionBtnSize;
@@ -92,33 +114,52 @@ ion-title{
background-color: #269DB8;
line-height: $actionBtnSize;
margin-bottom: 3px;
+ font-family: var(--fontFamilyPoppins-SemiBold, inherit);
+ display: flex;
img{
margin: 0 auto;
vertical-align: middle;
}
+ .span{
+ font-size: 10px;
+ display: block;
+ font-family: var(--fontFamilyPoppins-SemiBold, inherit);
+ }
}
}
}
-.employee-information-indetail{
- background: white;
- margin-top: 15px;
+
+ .employee-information-indetail{
+ background: #FFFFFF 0% 0% no-repeat padding-box;
+ box-shadow: 0px 0px 5px #00000029;
border-radius: 20px;
- margin-bottom: 15px;
- ion-col{
- padding: 15px;
- border-bottom: 1px solid #ccc;
- }
- h2{
- font-size: 13px;
- font-family: WorkSans-Bold;
- margin: 0;
- font-weight: bold;
- }
- p{
- font-size: 13px;
- margin: 0;
- }
-}
+ opacity: 1;
+ }
+// .employee-information-indetail{
+// background: white;
+// margin-top: 15px;
+// border-radius: 20px;
+// margin-bottom: 15px;
+// border-radius: 20px;
+// border: 1px solid #ccc;
+// ion-col{
+// padding: 15px;
+// // border-bottom: 1px solid #ccc;
+// }
+// h2{
+// font-size: 13px;
+// // font-family: WorkSans-Bold;
+// margin: 0;
+// font-weight: bold;
+// color: rgb(128, 124, 124);
+// }
+// p{
+// font-size: 13px;
+// margin: 0;
+// font-family: WorkSans-Bold;
+// // margin-bottom: 10px;
+// }
+// }
.segments-container {
border-radius: 100px;
@@ -128,33 +169,115 @@ ion-title{
color: black;
}
-.active-Segment {
- font-size: 0.3cm !important;
- background: #269DB8 !important;
- text-transform: none;
- --color-checked: none;
- border-radius: 100px;
- border:0;
- }
- .active-Segment ion-label{
- font-size: 11px;
- color: white !important;
- }
- .normal-Segment ion-label{
- color: black !important;
- font-size: 11px;
- }
- .normal-Segment {
- font-size: 0.3cm !important;
- text-transform: none;
- --color-checked: none;
- border: 0;
- }
+@media screen and (min-width: 1px) and (max-width:767px){
+ .active-Segment {
+ width: 11%;
+ max-width: 11%;
+ min-width: 39px;
+ height: 30% !important;
+ min-height: 39px;
+ padding-right: -10px;
+ border-radius: 50% !important;
+ // margin-right: 22px;
+ // margin-left: 22px;
+ margin-left: 19px;
+ background-color: #269DB8;
+ display: flex;
+ }
+ }
+ @media screen and (min-width: 768px) and (max-width:1024px){
+ .active-Segment{
+
+ background: #269DB8 !important;
+ // padding-left: 17px;
+ // display: flex;
+ width: 11%;
+ max-width: 11%;
+ min-width: 39px;
+ height: 30% !important;
+ min-height: 39px;
+ padding-right: -10px;
+ border-radius: 50% !important;
+ padding-left: 6px;
+ margin-right: 10px;
+ margin-left: 57px;
+ // margin-left: 14px;
+ display: flex;
+
+ }}
+
+ @media screen and (min-width: 1px) and (max-width:767px){
+ .normal-Segment {
+ width: 11%;
+ max-width: 11%;
+ min-width: 39px;
+ height: 30% !important;
+ min-height: 39px;
+ padding-right: -10px;
+ border-radius: 50% !important;
+ // margin-right: 22px;
+ // margin-left: 22px;
+ margin-left: 15px;
+ background: #414040 !important;
+ display: flex;
+
+ }
+ }
+ @media screen and (min-width: 768px) and (max-width:1024px){
+ .normal-Segment{
+ width: 11%;
+ max-width: 11%;
+ min-width: 39px;
+ height: 30% !important;
+ min-height: 39px;
+ padding-right: -10px;
+ border-radius: 50% !important;
+ padding-left: 6px;
+ margin-right: 10px;
+ margin-left: 57px;
+ // margin-left: 14px;
+ background: #414040 !important;
+ display: flex;
+ }}
+
+
+
+ @media screen and (min-width: 1px) and (max-width:767px){
+ .imgSize{
+ position: absolute;
+ /* right: 15px; */
+ top: 0;
+ bottom: 0;
+ // left: 7px;
+ margin: auto;
+ height: 18px;
+ display: flex;
+ }}
+ @media screen and (min-width: 768px) and (max-width:1024px){
+ .imgSize{position: absolute;
+ top: 0;
+ bottom: 0;
+ left: 2px;
+ margin: auto;
+ height: 28px;
+ display: flex;}}
+
+
.colum-container{
padding: 15px;
border-bottom: 1px solid #ccc;
}
-
+ .img{
+ width: 100px;
+ height: 100px;
+ display: inline-flex;
+ overflow: hidden;
+ border-radius: 78% !important;
+ position: relative;
+ /* top: 34px; */
+ background: transparent;
+ margin-left: -3px;
+ }
///////////////////////// Team Members css //////////////////////@extend
.filters-row {
@@ -207,7 +330,8 @@ ion-title{
/////////////////////////////////////////////////////// Attendance ///////////////////////
.header{
- margin-top: 20px;
+ // margin-top: 20px;
+ margin-top: 1px;
}
.slidPrev{
@@ -244,14 +368,47 @@ ion-title{
/* margin-left: 136px; */
margin-right: -251px;
}
+
+@media screen and (min-width: 1px) and (max-width:767px){
.result-graph {
position: relative;
background: white;
- margin-top: 20px;
+ // margin-top: 20px;
+ padding-bottom: 5px;
+ border-radius: 20px;
+ z-index: 1;
+ margin-bottom: 10px;
+ margin-top: 56px;
+ border-radius: 20px;
+ border: 1px solid #ccc;
+ padding-top: 12px;
+}}
+
+@media screen and (min-width: 768px) and (max-width:1024px){
+ .result-graph {
+ position: relative;
+ background: white;
+ // margin-top: 20px;
+ padding-bottom: 5px;
+ border-radius: 20px;
+ z-index: 1;
+ margin-bottom: 10px;
+ margin-top: 89px;
+ border-radius: 20px;
+ border: 1px solid #ccc;
+ padding-top: 114px !important;
+ }}
+.result-graph-attendence {
+ position: relative;
+ background: white;
+ // margin-top: 20px;
padding-bottom: 20px;
border-radius: 20px;
z-index: 1;
margin-bottom: 10px;
+ margin-top: 10px;
+ border-radius: 20px;
+ border: 1px solid #ccc;
}
.request-heading {
@@ -273,7 +430,7 @@ ion-title{
padding: 0;
margin: 0;
position: absolute;
- left: 50%;
+ left: 69%;
top: 50%;
display: block;
text-align: center;
@@ -292,9 +449,31 @@ ion-title{
font-family: workSans-Regular;
}
}
+ @media screen and (min-width: 325px){
+ .today-graph {
+ // width: 100%;
+ max-height: 4cm;
+ display: block;
+ height: 132px;
+ width: 264px;
+ margin-left: 154px;
+ }}
+ @media screen and (min-width: 1px) and (max-width:320px) {
.today-graph {
- width: 100%;
+ // width: 100%;
+ max-height: 4cm;
+ display: block;
+ height: 132px;
+ width: 264px;
+ margin-left: 84px;
+ }}
+
+ .today-graph-ar {
max-height: 4cm;
+ display: block;
+ height: 132px;
+ width: 264px;
+ margin-right: -74px;
}
.green-label{
@@ -359,68 +538,163 @@ ion-title{
.attendance-information{
background: white;
border-radius: 20px;
- padding: 10px;
- @media screen and (min-width: 300px) and (max-width:359px) {
+ padding: 9px;
+ font-weight: bolder;
+ // border-right: 1px solid rgb(221, 221, 221);
+
+ // @media screen and (min-width: 300px) and (max-width:359px) {
h2{
padding: 0;
margin: 0;
- font-size: 14px;
+ font-size: 10px;
+ font-family: var(--fontFamilyPoppins-SemiBold, inherit);
}
span{
- font-size: 9px;
+ font-size: 10px;
+ font-family: var(--fontFamilyPoppins-SemiBold, inherit);
}
- }
+
+ // }
- @media screen and (min-width: 360px) {
- h2{
- padding: 0;
- margin: 0;
- font-size: 18px;
- }
- span{
- font-size: 11px;
- }
- }
+ // @media screen and (min-width: 360px) {
+ // h2{
+ // padding: 0;
+ // margin: 0;
+ // font-size: 10px;
+ // font-family: var(--fontFamilyPoppins-SemiBold, inherit);
+ // }
+ // span{
+ // font-size: 10px;
+ // font-family: var(--fontFamilyPoppins-SemiBold, inherit);
+ // margin-bottom: 3px;
+ // }
+
+ // }
}
+ @media screen and (min-width: 325px) {
+ .statsIcon{
+ background: white;
+ margin-left: 12px;
+ margin-top: 6px;
+ }}
+ @media screen and (min-width: 1px) and (max-width:320px) {
+ .statsIcon{
+ background: white;
+ margin-left: -15px;
+ margin-top: 6px;
+ }}
+ @media screen and (min-width: 325px) {
+ .statsIcon-ar{
+ background: white;
+// margin-left: 12px;
+ margin-top: 6px;
+}}
+@media screen and (min-width: 1px) and (max-width:320px) {
+.statsIcon-ar{
+ background: white;
+ margin-right: -2px;
+ margin-top: 6px;
+}}
.month-year-span{
- font-size: 20px;
- font-family: WorkSans-Bold;
+ font-size: 16px;
+ // font-family: WorkSans-Bold;
+ font-weight: bold;
}
.green-label-container{
- border-top: 5px solid #269DB8;
- padding: 1px 0px;
- margin: 15px 0px
+ // border-top: 5px solid #269DB8;
+ // padding: 1px 0px;
+ // margin: 15px 0px
+ width: 12px;
+ height: 12px;
+ padding-right: -10px;
+ border-radius: 100%;
+ background-color: #269DB8;
+
}
.blue-label-container{
- border-top: 5px solid #292F42;
- padding: 1px 0px;
- margin: 15px 0px
+ // border-top: 5px solid #292F42;
+ // padding: 1px 0px;
+ // margin: 15px 0px
+ width: 12px;
+ height: 12px;
+ padding-right: -10px;
+ border-radius: 100%;
+ background-color: #292F42;
+ margin-top: 30px;
}
.span-one{
+ // display: block;
+ // font-size: 12px;
+ // color: black;
display: block;
font-size: 12px;
color: black;
+ margin-left: 6px;
+ margin-top: -2px;
+ font-weight: bold;
+
}
.span-two{
+ // display: block;
+ // font-size: 22px;
display: block;
- font-size: 22px;
+ font-size: 12px;
+ color: black;
+ margin-left: 6px;
+ margin-top: -2px;
+ font-weight: bold;
font-family: WorkSans-Bold;
+
+}
+
+.spa-one{
+ // display: block;
+ // font-size: 12px;
+ // color: black;
+ display: block;
+ font-size: 12px;
+ color: black;
+ margin-left: 6px;
+ margin-top: 28px;
+ font-weight: bold;
+
+}
+.spa-two{
+ // display: block;
+ // font-size: 22px;
+ display: block;
+ font-size: 12px;
+ color: black;
+ margin-left: 6px;
+ margin-top: 28px;
+ font-weight: bold;
+ font-family: WorkSans-Bold;
+
}
.graph-container{
margin-left: -50px;
position: relative;
margin-right: 50px;
}
+
+.graph-container-ar{
+ margin-right: -50px;
+ position: relative;
+ margin-left: 50px;
+}
.label-container{
position: absolute;
- width: 20%;
- right: 30px;
+ // width: 20%;
+ // right: 30px;
top: 50%;
- margin-top: -60px;
+ margin-top: -27px;
+ left: 20px;
+
}
+@media screen and (min-width: 325px){
.attendance-summary .attendance-information {
span{
height: 32px;
@@ -428,17 +702,37 @@ ion-title{
line-height: 14px;
}
h2{
- text-align: right;
- font-family: WorkSans-Bold;
+ // text-align: right;
+ // font-family: WorkSans-Bold;
+ font-weight: bolder;
+ font-size: 13px;
}
-}
+}}
+@media screen and (min-width: 1px) and (max-width:320px) {
+.attendance-summary .attendance-information {
+ span{
+ height: 32px;
+ display: block;
+ line-height: 7px;
+ font-size: 7px;
+ }
+ h2{
+ // text-align: right;
+ // font-family: WorkSans-Bold;
+ font-weight: bolder;
+ font-size: 13px;
+ }
+
+}}
.calendar-container{
background: white;
margin-bottom: 100px;
- margin-top: 20px;
+ margin-top: 10px;
border-radius: 20px;
+ border: 1px solid #ccc;
+ padding-bottom: 25px;
span{
text-align: left;
display: block;
@@ -462,4 +756,282 @@ ion-title{
}
+.Boldtext{
+ // font-size: 13px;
+ // font-family: WorkSans-Bold;
+ // color: black !important;
+ // display: block !important;
+ text-align: center;
+ letter-spacing: -0.64px;
+ color: #2B353E;
+ opacity: 1;
+ font-family: var(--fontFamilyPoppins-SemiBold, inherit);
+ font-size: 16px;
+ line-height: 19px;
+}
+
+.attendence{
+ position: relative;
+ background: white;
+ border-radius: 20px;
+ border: 1px solid #ccc;
+}
+
+.attendence-text{
+ margin-bottom: 1px;
+ margin-left: 10px;
+ // font-family: WorkSans-Bold;
+ font-size: 16px;
+ font-family: var(--fontFamilyPoppins-SemiBold, inherit);
+}
+.stats{
+ color: #289DB8; font-size: 9px;
+ margin-right: 5px;
+ font-family: 'WorkSans-Bold';
+}
+
+.stats-ar{
+ color: #289DB8; font-size: 9px;
+ margin-left: 5px;
+ font-family: 'WorkSans-Bold';
+}
+
+.text{
+ font-size: 16px;
+ font-weight: bolder;
+ font-family: 'WorkSans-Bold';
+ margin-top: 27px;
+}
+
+.number{
+ width: 22px;
+ height: 20px;
+ border-radius: 100%;
+ background-color: #269DB8;
+ z-index: 9;
+ margin-top: 25px;
+ padding-left: 4px;
+}
+
+.number-ar{
+ width: 22px;
+ height: 20px;
+ border-radius: 100%;
+ background-color: #269DB8;
+ z-index: 9;
+ margin-top: 25px;
+ padding-right: 4px;
+}
+
+.numberEmp{
+ color: white;
+ font-size: 12px;
+ font-weight: bolder;
+ /* margin-left: 3px; */
+ padding-top: 2px;
+}
+
+.slider-container{
+ padding-bottom: 20px;
+}
+
+.filters-row {
+ margin-top: 10px;
+ margin-left: 20px;
+ }
+
+ .disable-filter {
+ pointer-events: none;
+ opacity: .3;
+ }
+.favIcon{
+ height: 18px; margin-left: 23px;
+}
+
+.favIcon-ar{
+ height: 18px; margin-right: 23px;
+}
+
+.call{
+ margin-right: 16px;
+}
+
+.call-ar{
+ margin-left: 16px;
+}
+.name{
+ text-align: center;
+ letter-spacing: -0.84px;
+ color: #2B353E;
+ opacity: 1;
+ font-family: var(--fontFamilyPoppins-SemiBold, inherit);
+ line-height: 21px;
+ font-size: 21px;
+}
+.email{
+ text-align: center;
+ font-family: var(--fontFamilyPoppins-SemiBold, inherit);
+ font-size: 13px;
+ line-height: 6px;
+ letter-spacing: -0.52px;
+ color: #A2A2A2;
+ opacity: 1;
+ padding-top: 3px;
+}
+.subTitle{
+ text-align: center;
+ letter-spacing: -0.52px;
+ color: #A2A2A2;
+ opacity: 1;
+ font-family: var(--fontFamilyPoppins-SemiBold, inherit);
+ font-size: 13px;
+ line-height: 0px;
+}
+.profile{
+ text-align: left;
+ font-family: var(--fontFamilyPoppins-SemiBold, inherit);
+ line-height: 20px;
+ font-size: 20px;
+ letter-spacing: -0.8px;
+ color: #2B353E;
+ opacity: 1;
+ margin-top: 20px;
+ margin-bottom: 2px;
+}
+.label1{
+ text-align: left;
+ font-family: var(--fontFamilyPoppins-SemiBold, inherit);
+ line-height: 0px;
+ font-size: 13px;
+ letter-spacing: -0.52px;
+ color: #A2A2A2;
+ opacity: 1;
+}
+
+.label2{
+ text-align: left;
+ font-family: var(--fontFamilyPoppins-SemiBold, inherit);
+ line-height: 5px;
+ font-size: 16px;
+ letter-spacing: -0.64px;
+ color: #2B353E;
+ opacity: 1;
+}
+
+.profile-ar{
+ text-align: right;
+ font-family: var(--fontFamilyPoppins-SemiBold, inherit);
+ line-height: 20px;
+ font-size: 20px;
+ letter-spacing: -0.8px;
+ color: #2B353E;
+ opacity: 1;
+ margin-top: 20px;
+ margin-bottom: 2px;
+}
+.label1-ar{
+text-align: right;
+font-family: var(--fontFamilyPoppins-SemiBold, inherit);
+line-height: 0px;
+font-size: 13px;
+letter-spacing: -0.52px;
+color: #A2A2A2;
+opacity: 1;
+}
+
+.label2-ar{
+text-align: right;
+font-family: var(--fontFamilyPoppins-SemiBold, inherit);
+line-height: 5px;
+font-size: 16px;
+letter-spacing: -0.64px;
+color: #2B353E;
+opacity: 1;
+}
+@media screen and (min-width: 768px) and (max-width:1024px){
+.div{
+ position: relative;
+ display: flex;
+ margin-left: 48px;
+
+}}
+@media screen and (min-width: 1px) and (max-width:767px){
+.div{
+ position: relative;
+ display: flex;
+ margin-left: -1px;
+}}
+
+.MyTeamdiv{
+ position: relative;
+ display: flex;
+ margin-bottom: -12px;
+}
+.numberEmp{
+ color: white;
+ font-size: 12px;
+ font-weight: bolder;
+ /* padding-top: 5px; */
+ /* padding-right: 20px; */
+ margin-left: 13px;
+ width: 23px;
+ height: 23px;
+ border-radius: 100%;
+ background-color: #269DB8;
+ z-index: 9;
+ margin-top: 25px;
+ /* padding-left: 4px; */
+ text-align: center;
+ padding-top: 3px;
+}
+
+.numberEmp-ar{
+ color: white;
+ font-size: 12px;
+ font-weight: bolder;
+ /* padding-top: 5px; */
+ /* padding-right: 20px; */
+ margin-right: 13px;
+ width: 23px;
+ height: 23px;
+ border-radius: 100%;
+ background-color: #269DB8;
+ z-index: 9;
+ margin-top: 25px;
+ /* padding-left: 4px; */
+ text-align: center;
+ padding-top: 3px;
+}
+
+.MyTeamtext{
+ text-align: left;
+ font-family: var(--fontFamilyPoppins-SemiBold, inherit);
+ line-height: 11px;
+ font-size: 20px;
+ letter-spacing: -0.8px;
+ color: #2B353E;
+ opacity: 1;
+ margin-top: 30px;
+ margin-bottom: 28px;
+}
+
+ .btnTitle{
+ text-align: center;
+ font-family: var(--fontFamilyPoppins-SemiBold, inherit);
+ line-height: 10px;
+ font-size: 11px;
+ color: #4D4D4D;
+ margin-top: -13px;
+ }
+.btnDiv{
+ position: relative;
+ display: flex;
+ justify-content: space-between;
+ margin-bottom: -15px;
+ margin-top: -12px;
+
+}
+
+
+
\ No newline at end of file
diff --git a/Mohem/src/app/my-team/details/details.component.ts b/Mohem/src/app/my-team/details/details.component.ts
index 42f15451..4a2b0d4a 100644
--- a/Mohem/src/app/my-team/details/details.component.ts
+++ b/Mohem/src/app/my-team/details/details.component.ts
@@ -13,6 +13,7 @@ import { GetDayAndHoursDetailsRequest } from 'src/app/time-card/service/models/g
import { GetTimeCardSummaryRequest } from 'src/app/time-card/service/models/get-time-card-summary.request';
import { DashboredService } from 'src/app/hmg-common/services/dashbored/dashbored.service';
import { AttendanceTrackingResponse } from 'src/app/hmg-common/services/dashbored/attendance-tracking.response';
+import { WorklistService } from 'src/app/notification/service/worklist.service';
@Component({
selector: 'app-details',
templateUrl: './details.component.html',
@@ -57,7 +58,8 @@ export class DetailsComponent implements OnInit {
public yearTitle: string;
public activeMonth: any;
public currentMonthName = '';
-
+ favoriteUserList: [] = [];
+ public showAttendence = false;
public showData = false;
public currentYear = new Date().getFullYear();
public attendanceTrackingList: any = [];
@@ -67,6 +69,7 @@ export class DetailsComponent implements OnInit {
year: any;
preMonth: number;
nextMonth: any;
+ currentMonth: any;
public direction: string;
public options = {
cutoutPercentage: 80,
@@ -85,7 +88,134 @@ export class DetailsComponent implements OnInit {
// tslint:disable-next-line: max-line-length
public monthsNameArray = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
public monthIndex = new Date().getMonth() + 1;
+ public EmpTotal = [];
+ public selectedFilter = '';
+ public itemType = '';
+ public monthNo: any;
+ isFavorite = false;
+ public EmpNumer:any;
+ public isFavor:any;
+ public EmployeeTotal:any;
+ // public activeSegment = 'About';
+
+
+
+ public filters = [
+ {
+ // value: '',
+ name: 'JAN',
+ active: true,
+ color: '#0a0a0a',
+ key: 'January',
+ monthNo: 1,
+ disable: false
+ },
+ {
+ // value: '',
+ name: 'FEB',
+ active: false,
+ color: '#0a0a0a',
+ key: 'February',
+ monthNo: 2,
+ disable: false
+ },
+ {
+ // value: '',
+ name: 'MAR',
+ active: false,
+ color: '#0a0a0a',
+ key: 'March',
+ monthNo: 3,
+ disable: false
+ },
+ {
+ // value: '',
+ name: 'APRIL',
+ active: false,
+ color: '#0a0a0a',
+ key: 'April',
+ monthNo: 4,
+ disable: false
+ },
+ {
+ // value: '',
+ name: 'MAY',
+ active: false,
+ color: '#0a0a0a',
+ key: 'May',
+ monthNo: 5,
+ disable: false
+ },
+ {
+ // value: '',
+ name: 'JUN',
+ active: false,
+ color: '#0a0a0a',
+ key: 'June',
+ monthNo: 6,
+ disable: false
+ },
+ {
+ // value: '',
+ name: 'JUL',
+ active: false,
+ color: '#0a0a0a',
+ key: 'July',
+ monthNo: 7,
+ disable: false
+ },
+ {
+ // value: '',
+ name: 'AUG',
+ active: false,
+ color: '#0a0a0a',
+ key: 'Augest',
+ monthNo: 8,
+ disable: false
+ },
+ {
+ // value: '',
+ name: 'SEP',
+ active: false,
+ color: '#0a0a0a',
+ key: 'September',
+ monthNo: 9,
+ disable: false
+ },
+ {
+ // value: '',
+ name: 'NOV',
+ active: false,
+ color: '#0a0a0a',
+ key: 'November',
+ monthNo: 10,
+ disable: false
+ },
+ {
+ // value: '',
+ name: 'OCT',
+ active: false,
+ color: '#0a0a0a',
+ key: 'October',
+ monthNo: 11,
+ disable: false
+ },
+ {
+ // value: '',
+ name: 'DEC',
+ active: false,
+ color: '#0a0a0a',
+ key: 'December',
+ monthNo: 12,
+ disable: false
+ }
+ ];
+ public slideOptsOne = {
+ slidesPerView: 7,
+ spaceBetween: 1
+ };
+ public jobName: any;
constructor(
public timeCardService: TimeCardService,
@@ -96,6 +226,7 @@ export class DetailsComponent implements OnInit {
public modalController: ModalController,
public authService: AuthenticationService,
public dashboardService: DashboredService,
+ public worklistService: WorklistService,
) {
this.direction = TranslatorService.getCurrentLanguageName();
}
@@ -111,15 +242,22 @@ export class DetailsComponent implements OnInit {
showAttendanceTracking() {
this.common.startLoading();
this.employee = this.common.sharedService.getSharedData(MyTeamService.EMPLOYEE_SHARED_DATA, false);
+ console.log(this.employee);
+
+ let jobTitle = this.employee.POSITION_NAME.split('.');
+ if (jobTitle && jobTitle.length > 1) {
+ this.jobName = jobTitle[0] + " " + jobTitle[1];
+ }
+
const request = {
P_SELECTED_EMPLOYEE_NUMBER: this.employee.EMPLOYEE_NUMBER
};
this.dashboardService.getAttendanceTracking(request).subscribe((result: AttendanceTrackingResponse) => {
- if (this.common.validResponse(result)) {
- const key = 'GetAttendanceTrackingList';
- this.attendanceTrackingList = result[key];
- }
- });
+ if (this.common.validResponse(result)) {
+ const key = 'GetAttendanceTrackingList';
+ this.attendanceTrackingList = result[key];
+ }
+ });
}
public segmentChanged(event: any) {
@@ -128,8 +266,14 @@ export class DetailsComponent implements OnInit {
this.common.startLoading();
this.initAttendance();
}
+ else if(this.activeSegment != 'Attendance' && this.activeSegment != 'TeamMembers'){
+ this.activeSegment = 'About';
+ }
}
+
+
+
initAttendance() {
this.data = {};
// tslint:disable-next-line: max-line-length
@@ -139,7 +283,10 @@ export class DetailsComponent implements OnInit {
this.showData = false;
this.nextMonth = new Date().getMonth() + 2;
this.preMonth = new Date().getMonth();
- this.calendarConfig(this.common.getMonthName(new Date().getMonth() + 1) , new Date().getFullYear());
+ // this.currentActiveIndex = this.nextMonth -1;
+ this.activeFilter(this.preMonth);
+ this.calendarConfig(this.common.getMonthName(new Date().getMonth() + 1), new Date().getFullYear());
+
}
calendarConfig(month?, year?) {
@@ -169,26 +316,43 @@ export class DetailsComponent implements OnInit {
this.timeCardService.getDayHoursTypeDetails(dayAndHoursReqObj, '', '', this.isPostNoLoad).subscribe((result) => {
if (this.common.validResponse(result)) {
- console.log(result.GetDayHoursTypeDetailsList);
this.common.sharedService.setSharedData(result.GetDayHoursTypeDetailsList, 'RTP_IDs');
this.countAllAttendDays(result.GetDayHoursTypeDetailsList);
}
});
}
+ monthCardSliders(monthNo) {
+
+
+ /* change
+ */
+ this.currentMonthName = this.direction === 'en' ? this.common.getMonthName(this.monthIndex) : this.common.getMonthNameAr(this.monthIndex);
+ this.currentYear = new Date().getFullYear();
+ this.currentDate = new Date(new Date().getFullYear(), monthNo - 1);
+ this.showData = false;
+ this.nextMonth = monthNo;//new Date().getMonth() + 2;
+ this.preMonth = monthNo - 1;///new Date().getMonth();
+
+ //end
+ this.calendarConfig(this.getMonthName(monthNo), this.currentYear);
+
+
+ }
nextSlide() {
if (this.currentMonthName !== this.month) {
- this.common.startLoading();
- this.showData = false;
- if (this.nextMonth > 12) {
- this.currentYear = this.currentYear + 1;
- this.nextMonth = 1;
- }
- this.currentDate = new Date(this.currentYear, (this.nextMonth - 1), 1);
- this.calendarConfig(this.getMonthName(this.nextMonth) , this.currentYear);
- this.nextMonth = this.nextMonth + 1;
- this.preMonth = this.nextMonth - 2;
+ this.common.startLoading();
+ this.showData = false;
+ if (this.nextMonth > 12) {
+ this.currentYear = this.currentYear + 1;
+ this.nextMonth = 1;
+ }
+ this.currentDate = new Date(this.currentYear, (this.nextMonth - 1), 1);
+ this.calendarConfig(this.getMonthName(this.nextMonth), this.currentYear);
+ this.nextMonth = this.nextMonth + 1;
+ this.preMonth = this.nextMonth - 2;
+
}
}
@@ -196,12 +360,12 @@ export class DetailsComponent implements OnInit {
this.common.startLoading();
this.showData = false;
if (this.preMonth === 0) {
- this.currentYear = this.currentYear - 1;
- this.preMonth = 12;
+ this.currentYear = this.currentYear - 1;
+ this.preMonth = 12;
}
this.currentDate = new Date(this.currentYear, (this.preMonth - 1), 1);
- console.log(this.currentDate);
- this.calendarConfig(this.getMonthName(this.preMonth) , this.currentYear);
+
+ this.calendarConfig(this.getMonthName(this.preMonth), this.currentYear);
this.preMonth = this.preMonth - 1;
this.nextMonth = this.preMonth + 2;
}
@@ -226,14 +390,14 @@ export class DetailsComponent implements OnInit {
allDays[i].customDaysOff = false;
allDays[i].customSchedule = false;
allDays[i].customScheduleDate = new Date(allDays[i].SCHEDULE_DATE);
- // tslint:disable-next-line: triple-equals
+ // tslint:disable-next-line: triple-equals
} else if (allDays[i].ATTENDED_FLAG == 'N' && allDays[i].ABSENT_FLAG == 'Y') {
allDays[i].customPresent = false;
allDays[i].customAbsent = true;
allDays[i].customDaysOff = false;
allDays[i].customSchedule = false;
allDays[i].customScheduleDate = new Date(allDays[i].SCHEDULE_DATE);
- // tslint:disable-next-line: triple-equals
+ // tslint:disable-next-line: triple-equals
} else if (allDays[i].ATTENDED_FLAG == 'N' && allDays[i].DAY_TYPE === 'OFF') {
allDays[i].customPresent = false;
allDays[i].customAbsent = false;
@@ -276,15 +440,24 @@ export class DetailsComponent implements OnInit {
this.totalAttendancePrecentage = this.absentDays + this.attendedDays;
if (this.totalAttendancePrecentage > 0) {
this.data = {
+ // labels: ['Apsent', 'Present'],
datasets: [
{
+ label: "# of Votes",
data: [this.absentDays, this.attendedDays],
backgroundColor: [
- '#269DB8',
+ 'black',
'#269DB8'
],
- borderWidth: 2
- }]
+ borderWidth: 1,
+ // cutoutPrecentage:20 ,
+
+ }],
+ labels: [
+ 'Apsent',
+ 'Present'
+
+ ]
};
}
}
@@ -309,7 +482,7 @@ export class DetailsComponent implements OnInit {
return 'July';
case 8:
return 'August';
- case 9 :
+ case 9:
return 'September';
case 10:
return 'October';
@@ -322,32 +495,32 @@ export class DetailsComponent implements OnInit {
}
public getMonthNameAr(value: any): any {
switch (value) {
- case 1:
- return 'يناير';
- case 2:
- return ' فبراير';
- case 3:
- return 'مارس';
- case 4:
- return 'أبريل';
- case 5:
- return 'مايو';
- case 6:
- return 'يونيو';
- case 7:
- return 'يوليو';
- case 8:
- return 'أغسطس';
- case 9:
- return 'سبتمبر';
- case 10:
- return ' اكتوبر';
- case 11:
- return ' نوفمبر';
- case 12:
- return 'ديسمبر';
+ case 1:
+ return 'يناير';
+ case 2:
+ return ' فبراير';
+ case 3:
+ return 'مارس';
+ case 4:
+ return 'أبريل';
+ case 5:
+ return 'مايو';
+ case 6:
+ return 'يونيو';
+ case 7:
+ return 'يوليو';
+ case 8:
+ return 'أغسطس';
+ case 9:
+ return 'سبتمبر';
+ case 10:
+ return ' اكتوبر';
+ case 11:
+ return ' نوفمبر';
+ case 12:
+ return 'ديسمبر';
}
-}
+ }
intializeMemberDetail(userID?) {
@@ -356,8 +529,8 @@ export class DetailsComponent implements OnInit {
this.pageLimit = 50;
this.pageNum = 1;
this.employee = this.common.sharedService.getSharedData(MyTeamService.EMPLOYEE_SHARED_DATA, false);
- const employees = this.common.sharedService.getSharedData( DetailsComponent.opendEmployeesARR, false);
- if ( employees ) {
+ const employees = this.common.sharedService.getSharedData(DetailsComponent.opendEmployeesARR, false);
+ if (employees) {
this.opendEmployees.push(this.employee);
this.common.sharedService.setSharedData(this.opendEmployees, DetailsComponent.opendEmployeesARR);
}
@@ -366,6 +539,8 @@ export class DetailsComponent implements OnInit {
this.isSpecialist = this.common.sharedService.getSharedData('isSpecialist', false) ? true : false;
if (this.employee) {
this.getEmpSubordinate(userID);
+ this.isFavorite = false;
+ this.getFavorit();
}
}
@@ -378,14 +553,14 @@ export class DetailsComponent implements OnInit {
} else {
// tslint:disable-next-line: prefer-for-of
for (let i = 0; i < this.opendEmployees.length; i++) {
- if (this.opendEmployees[i].EMPLOYEE_NUMBER === this.employee.SUPERVISOR_NUMBER) {
- this.common.sharedService.setSharedData(
- this.opendEmployees[i],
- MyTeamService.EMPLOYEE_SHARED_DATA
- );
- break;
+ if (this.opendEmployees[i].EMPLOYEE_NUMBER === this.employee.SUPERVISOR_NUMBER) {
+ this.common.sharedService.setSharedData(
+ this.opendEmployees[i],
+ MyTeamService.EMPLOYEE_SHARED_DATA
+ );
+ break;
+ }
}
- }
this.intializeMemberDetail(this.employee.SUPERVISOR_NUMBER);
}
}
@@ -416,8 +591,8 @@ export class DetailsComponent implements OnInit {
if (userID) {
selEmpNo = userID;
} else {
- selEmpNo = this.employee.EMPLOYEE_NUMBER;
- }
+ selEmpNo = this.employee.EMPLOYEE_NUMBER;
+ }
const body = {
P_SELECTED_EMPLOYEE_NUMBER: selEmpNo,
P_SEARCH_EMPLOYEE_NUMBER: searchEmpNum,
@@ -428,14 +603,15 @@ export class DetailsComponent implements OnInit {
};
this.getEmployeeSubordinatesRequestObject = body;
this.myTeamService.getEmployeeSubordinates(body).subscribe((result: any) => {
- console.log('one');
+
if (this.common.validResponse(result)) {
- this.handleEmpResult(result.GetEmployeeSubordinatesList);
- }
+ this.handleEmpResult(result.GetEmployeeSubordinatesList);
+ }
});
}
handleEmpResult(result) {
+ this.EmployeeTotal = result.length;
const lastItemIndex = result.length - 1;
const lastItem = result[lastItemIndex];
if (lastItem) {
@@ -461,23 +637,23 @@ export class DetailsComponent implements OnInit {
} else {
this.empSubordinate = [];
}
-}
+ }
-doInfinite(infiniteScroll) {
- if (!this.isReachEnd) {
- this.myTeamService.getEmployeeSubordinates(this.getEmployeeSubordinatesRequestObject).subscribe((result: any) => {
- console.log('two');
+ doInfinite(infiniteScroll) {
+ if (!this.isReachEnd) {
+ this.myTeamService.getEmployeeSubordinates(this.getEmployeeSubordinatesRequestObject).subscribe((result: any) => {
+
if (this.common.validResponse(result)) {
this.handleEmpResult(result.GetEmployeeSubordinatesList);
}
this.infiniteScroll.complete();
});
- } else {
- if (this.infiniteScroll) {
- this.infiniteScroll.complete();
+ } else {
+ if (this.infiniteScroll) {
+ this.infiniteScroll.complete();
+ }
}
}
-}
getDetails(index) {
this.common.sharedService.setSharedData(this.empSubordinate[index], MyTeamService.EMPLOYEE_SHARED_DATA);
@@ -546,4 +722,158 @@ doInfinite(infiniteScroll) {
this.showEmailInput = true;
}
}
+
+ showCalender() {
+ if (this.showAttendence) {
+ this.showAttendence = false
+
+ } else {
+ this.showAttendence = true
+ }
+ }
+
+ // getSuborinatesAttStatus() {
+ // const request = {
+ // // SearchMonth: "January",
+ // // SearchYear: 2021
+ // SearchMonth: "",
+ // SearchYear: Number
+
+ // };
+ // // this.myTeamService.getSuborinatesAttStatus().subscribe((result: any) =>
+ // this.myTeamService.getSuborinatesAttStatus(request, () => { }, this.ts.trPK('general', 'retry')).subscribe((result) => {
+ // this.handleRespondSuborinatesAttStatusResult(result);
+
+ // })
+ // }
+
+ // handleRespondSuborinatesAttStatusResult(result) {
+ // // this.EmpTotal = result.GetSubordinatesAttdStatusList.length;
+ // this.EmpTotal = result.GetSubordinatesAttdStatusList[0].NUMBER_OF_EMPLOYEES;
+
+ // }
+
+ activeFilter(index: number) {
+
+ if (this.currentActiveIndex !== index) {
+ this.previousActiveIndex = this.currentActiveIndex;
+ this.currentActiveIndex = index;
+ this.filters[this.previousActiveIndex].active = false;
+ this.filters[this.currentActiveIndex].active = true;
+ this.selectedFilter = this.filters[this.currentActiveIndex].key;
+ }
+ }
+
+ disableFilters() {
+ for (const filter of this.filters) {
+ if (filter.key === this.itemType) {
+ filter.disable = false;
+ filter.active = true;
+ // filter.value = this.nextMonth - 1;
+ this.selectedFilter = filter.name;
+ } else if (this.itemType === '') {
+ filter.disable = false;
+ filter.active = false;
+ } else {
+ filter.disable = true;
+ filter.active = false;
+ }
+ }
+ if (this.itemType === '') {
+ this.filters[0].active = true;
+ }
+ }
+
+ //save favorite here
+
+ setFavorite(selEmp) {
+ selEmp.EMPLOYEE_DISPLAY_NAME = selEmp.EMPLOYEE_DISPLAY_NAME ? selEmp.EMPLOYEE_DISPLAY_NAME : selEmp.NAME;
+ selEmp.EMPLOYEE_IMAGE = selEmp.EMPLOYEE_IMAGE ? selEmp.EMPLOYEE_IMAGE : '';
+ selEmp.EMAIL_ADDRESS = selEmp.EMAIL_ADDRESS ? selEmp.EMAIL_ADDRESS : '';
+ var confirmBoxhtml = `
+
Do you want to add ` + selEmp.EMPLOYEE_DISPLAY_NAME + ` in your favorite list
+
+
+
`;
+ if (selEmp.EMPLOYEE_IMAGE)
+ confirmBoxhtml += '';
+ if (!selEmp.EMPLOYEE_IMAGE)
+ confirmBoxhtml += '';
+
+ confirmBoxhtml += `
+
+ ` + selEmp.EMPLOYEE_DISPLAY_NAME + `
+
+
+
+
+
`
+ let userIndex = this.favoriteUserList.findIndex(x => x['USER_NAME'] == selEmp.USER_NAME)
+ if (userIndex == -1)
+ this.common.presentConfirmDialog(
+ confirmBoxhtml
+ , () => {
+
+ var request =
+ [ { "USER_NAME": this.employee.EMPLOYEE_NUMBER, "EMPLOYEE_DISPLAY_NAME": this.employee.EMPLOYEE_DISPLAY_NAME, "EMAIL_ADDRESS": this.employee.EMAIL_ADDRESS, "EMPLOYEE_IMAGE": this.employee.EMPLOYEE_IMAGE, "IsFavorite": !this.isFavorite}];
+
+ this.saveUserFavruiteList(request);
+ // this.isFavorite = false;
+
+ }, () => {
+
+ })
+
+ // if (selectValue == "1" || selectValue == "2" || selectValue == "3") {
+ // this.isSelect = true;
+ // }
+ // else {
+ // this.isSelect = false;
+
+
+
+ // }
+ }
+
+ getFavruite() {
+
+ this.worklistService.getFavorite({}, () => {
+ }).subscribe((result) => {
+ if (this.common.validResponse(result)) {
+ this.common.stopLoading();
+ this.favoriteUserList = result['Mohemm_GetFavoriteReplacementsList'];
+
+
+
+ }
+ })
+ }
+ saveUserFavruiteList(request) {
+ this.worklistService.saveFavoriteList(request, () => {
+ }).subscribe((result) => {
+ if (this.common.validResponse(result)) {
+ this.common.toastPK("replacementRoll", "favorite-saved");
+ this.isFavorite = !this.isFavorite;
+
+ }
+ })
+ }
+
+ getFavorit(){
+ this.worklistService.getFavoriteMyTeam({}, () => {
+ }).subscribe((result) => {
+ this.EmpNumer = result.Mohemm_GetFavoriteReplacementsList;
+
+ this.EmpNumer.forEach(element => {
+ if(element.USER_NAME === this.employee.EMPLOYEE_NUMBER){
+
+ this.isFavorite = true;
+
+ }
+ });
+
+ });
+ }
+
+
}
diff --git a/Mohem/src/app/my-team/home/home.component.html b/Mohem/src/app/my-team/home/home.component.html
index 5af1f667..2280064d 100644
--- a/Mohem/src/app/my-team/home/home.component.html
+++ b/Mohem/src/app/my-team/home/home.component.html
@@ -7,7 +7,72 @@
-
+
+
+ {{ts.trPK('myTeam','search-by')}}
+
+
+
+
+
+
+
+ {{ts.trPK('searchForReplacment','name')}}
+ {{ts.trPK('searchForReplacment','name')}}
+
+
+
+ {{ts.trPK('searchForReplacment','userName')}}
+ {{ts.trPK('searchForReplacment','userName')}}
+
+
+
+ {{ts.trPK('searchForReplacment','email')}}
+ {{ts.trPK('searchForReplacment','email')}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
{{ts.trPK('myTeam','my-team-members')}}
+
{{EmployeeTotal}}
+
+
+
+
+
+
-
+
-
+
+
+
+
-
\ No newline at end of file
+
+
\ No newline at end of file
diff --git a/Mohem/src/app/my-team/home/home.component.scss b/Mohem/src/app/my-team/home/home.component.scss
index ded6a0aa..04d07eca 100644
--- a/Mohem/src/app/my-team/home/home.component.scss
+++ b/Mohem/src/app/my-team/home/home.component.scss
@@ -10,6 +10,11 @@ ion-title{
height: 100%;
}
+@media only screen and (max-width: 360px) {
+ .contentBg{
+ padding: 0px 15px !important;
+ }
+}
.contentBg{
padding: 0px 20px;
@@ -29,21 +34,52 @@ ion-content {
--ion-background-color: whitesmoke;
}
.request-heading {
+ padding-left: 15px;
+ margin-top: 10px;
span {
- text-align: center;
- display: block;
- padding-top: 8px;
- font-family: workSans-Regular;
+ // display: block;
+ // padding-top: 8px;
+ // padding-left: 15px;
+ // font-weight: bold;
+ // font-size: 12px;
+ // margin-top: 9px;
+ text-align: left;
+ font-family: var(--fontFamilyPoppins-SemiBold, inherit);
+ line-height: 18px;
+ font-size: 12px;
+ letter-spacing: -0.48px;
+ color: #2B353E;
+ opacity: 1;
}
}
+.search-label{
+ // border: 1px solid #ccc;
+ // margin-left: 15px;
+ // margin-right: 15px;
+ // border-radius: 22px;
+ // margin-top: 24px;
+ // font-size: 11px;
+ // color: rgb(143, 141, 141);
+ border: 1px solid #ccc;
+ margin-left: 15px;
+ margin-right: 15px;
+ border-radius: 35px;
+ margin-top: 24px;
+ font-size: 11px;
+ color: #8f8d8d;
+ margin-right: 15px !important;
+ padding: 10px;
+}
+
.result-graph {
position: relative;
background: white;
margin-top: 20px;
- padding-bottom: 20px;
+ padding-bottom: 35px;
border-radius: 20px;
z-index: 1;
+ border: 1px solid #ccc;
}
.result-text-container {
padding: 0;
@@ -139,16 +175,24 @@ ion-content {
width: 100%;
height: 100%;
border-radius: 80px;
- border: 1px solid #ccc;
+ border: 1px solid rgb(170, 169, 169);
margin: 0px auto 6px;
}
.search-container{
- margin-top: 15px;
+ // margin-top: 15px;
+ // margin-top: -35px;
+ // margin-left: 262px;
+ width: 30px;
+ height: 30px;
+ position: absolute;
+ top: 45px;
+ right: 38px;
+ z-index: 999999;
ion-col{
- background: white;
- border-radius: 12px;
- padding-right: 10px;
+ // background: white;
+ // border-radius: 12px;
+ // padding-right: 10px;
flex: none;
ion-icon{
margin-right: 3px;
@@ -162,3 +206,156 @@ ion-content {
}
}
}
+
+// .myClass .toggle-icon {
+// background-color: purple; // this changes the background, ie the grey stripe.
+// .toggle-inner {
+// background-color: yellow; // this changes the backgroundcolor of the toggle dot.
+// }
+// }
+
+@media only screen and (max-width: 375px) {
+ .text-label{
+ margin-left: 6px !important;
+ }
+}
+
+@media only screen and (max-width: 320px) {
+ .text-label{
+ margin-left: 2px !important;
+ }
+}
+
+
+.text-label{
+ // --color: black !important;
+ // font-size: 13px;
+ // margin-left: 15px;
+ // margin-right: 18px;
+ text-align: left;
+ // font: normal normal 600 12px/18px Poppins;
+ font-family: var(--fontFamilyPoppins-SemiBold, inherit);
+ line-height: 18px;
+ font-size: 12px;
+ letter-spacing: -0.48px;
+ color: #575757 !important;
+ opacity: 1;
+ margin-left: 15px;
+ margin-right: 18px;
+}
+
+.radio-list{
+ background: white;
+ // margin-left: 18px;
+ /* margin-right: 10px; */
+ // margin-top: 12px;
+}
+
+// .selected .radio-icon {
+// border-color: #0064D9;
+// color: red;
+// }
+
+ .radio-icon{
+
+.custom-radio .radio-icon {
+ margin: 0px;
+ border-radius: 50%;
+ border-width: var(--border-width);
+ border-style: var(--border-style);
+ border-color: #dcdcdc;
+ margin-top: 6px !important;
+ border-color: #d8d4d4 !important;}
+}
+.text{
+ // font-size: 16px;
+ // font-weight: bolder;
+ // font-family: 'WorkSans-Bold';
+ // margin-top: 27px;
+ text-align: left;
+ font-family: var(--fontFamilyPoppins-SemiBold, inherit);
+ line-height: 11px;
+ font-size: 20px;
+ letter-spacing: -0.8px;
+ color: #2B353E;
+ opacity: 1;
+ margin-top: 30px;
+ margin-bottom: 28px;
+}
+
+
+// .number{
+// width: 21px;
+// height: 21px;
+// padding-right: -10px;
+// border-radius: 100%;
+// background-color: #269DB8;
+// z-index: 9;
+// margin-top: 26px;
+// }
+
+// .numberEmp{
+// color: white;
+// font-size: 12px;
+// font-weight: bolder;
+// margin-left: 3px;
+// padding-top: 2px;
+// }
+.number{
+ width: 22px;
+ height: 20px;
+ border-radius: 100%;
+ background-color: #269DB8;
+ z-index: 9;
+ margin-top: 25px;
+ padding-left: 4px;
+}
+.number-ar{
+ width: 22px;
+ height: 20px;
+ border-radius: 100%;
+ background-color: #269DB8;
+ z-index: 9;
+ margin-top: 25px;
+ padding-right: 4px;
+}
+.numberEmp{
+ color: white;
+ font-size: 12px;
+ font-weight: bolder;
+ /* padding-top: 5px; */
+ /* padding-right: 20px; */
+ margin-left: 13px;
+ width: 23px;
+ height: 23px;
+ border-radius: 100%;
+ background-color: #269DB8;
+ z-index: 9;
+ margin-top: 25px;
+ /* padding-left: 4px; */
+ text-align: center;
+ padding-top: 3px;
+}
+.numberEmp-ar{
+ color: white;
+ font-size: 12px;
+ font-weight: bolder;
+ /* padding-top: 5px; */
+ /* padding-right: 20px; */
+ margin-right: 13px;
+ width: 23px;
+ height: 23px;
+ border-radius: 100%;
+ background-color: #269DB8;
+ z-index: 9;
+ margin-top: 25px;
+ /* padding-left: 4px; */
+ text-align: center;
+ padding-top: 3px;
+}
+.div{
+ position: relative;
+ display: flex;
+ // justify-content: space-between;
+ margin-bottom: -12px;
+}
diff --git a/Mohem/src/app/my-team/home/home.component.ts b/Mohem/src/app/my-team/home/home.component.ts
index edc30021..6e5f23da 100644
--- a/Mohem/src/app/my-team/home/home.component.ts
+++ b/Mohem/src/app/my-team/home/home.component.ts
@@ -7,6 +7,7 @@ import { MenuResponse } from 'src/app/hmg-common/services/menu/models/menu-respo
import { MyTeamService } from '../service/my-team.service';
import { ModalController, IonInfiniteScroll } from '@ionic/angular';
import { DetailsComponent } from '../details/details.component';
+import { Body } from '@angular/http/src/body';
@Component({
selector: 'app-home',
templateUrl: './home.component.html',
@@ -28,6 +29,10 @@ export class HomeComponent implements OnInit {
public selEmpNo: any;
public totalEmployees = 0;
public pageFirstVisit = false;
+ myColor: string = 'secondary';
+ public EmpTotal = [];
+ public EmployeeTotal: any;
+ public direction:any;
public options = {
cutoutPercentage: 80,
@@ -79,9 +84,12 @@ export class HomeComponent implements OnInit {
public previousActiveIndex = 0;
public currentActiveIndex = 0;
public searchNameOrUserName = '';
+ public searchUserName = '';
public searchEmail = '';
public showEmailInput = false;
public showUserNameOrNameInput = true;
+ public showUserNameInput = false;
+ arrList: any[];
constructor(
public ts: TranslatorService,
@@ -90,12 +98,21 @@ export class HomeComponent implements OnInit {
public myTeamService: MyTeamService,
public modalController: ModalController,
private location: Location
- ) {}
+ ) {
+
+ this.direction = TranslatorService.getCurrentLanguageName();
+ }
ngOnInit() {
this.common.sharedService.setSharedData( [], DetailsComponent.opendEmployeesARR);
this.setIntitial();
+
+ // this.getSuborinatesAttStatus();
}
+ toggleColor() {
+ this.myColor = 'secondary';
+ // this.myColor = '#269DB8'
+}
// activeFilter(index: number) {
// this.previousActiveIndex = this.currentActiveIndex;
@@ -117,16 +134,39 @@ export class HomeComponent implements OnInit {
}
}
- searchEmployee() {
- this.isSearch = true;
- this.empSubordinate = [];
- this.getEmpSubordinate();
+ searchEmployee(event) {
+ // this.isSearch = true;
+ // this.empSubordinate = [];
+ // this.getEmpSubordinate();
+ const val = event.target.value;
+ console.log(this.searchKeySelect)
+ if (val === '') {
+ this.empSubordinate = this.arrList;
+ this.isSearch = false;
+ }
+ if(this.searchKeySelect === 'Name'){
+ this.empSubordinate = this.arrList.filter((item) => {
+ this.isSearch = true;
+ return (item.EMPLOYEE_NAME.toLowerCase().indexOf(val.toLowerCase()) > -1);
+ });
+ } else if(this.searchKeySelect === 'User Name'){
+ this.empSubordinate = this.arrList.filter((item) => {
+ this.isSearch = true;
+ return (item.EMPLOYEE_NUMBER.toLowerCase().indexOf(val.toLowerCase()) > -1);
+ });
+ } else if(this.searchKeySelect === 'Email'){
+ this.empSubordinate = this.arrList.filter((item) => {
+ this.isSearch = true;
+ return (item.EMPLOYEE_EMAIL_ADDRESS.toLowerCase().indexOf(val.toLowerCase()) > -1);
+ });
+ }
+
}
getEmpSubordinate() {
this.pageNum = 1;
this.isReachEnd = false;
- const searchEmpNum = (this.searchKeySelect === 'User Name') ? this.searchNameOrUserName : '';
+ const searchEmpNum = (this.searchKeySelect === 'User Name') ? this.searchUserName : '';
const searchEmpName = (this.searchKeySelect === 'Name') ? this.searchNameOrUserName : '';
const searchEmpEmail = (this.searchKeySelect === 'Email') ? this.searchEmail : '';
@@ -157,6 +197,7 @@ export class HomeComponent implements OnInit {
}
handleEmpResult(result) {
+ this.EmployeeTotal = result.length;
const lastItemIndex = result.length - 1;
const lastItem = result[lastItemIndex];
if (lastItem) {
@@ -182,6 +223,7 @@ export class HomeComponent implements OnInit {
} else {
this.empSubordinate = [];
}
+ this.arrList = this.empSubordinate;
}
doInfinite(infiniteScroll) {
@@ -201,12 +243,18 @@ export class HomeComponent implements OnInit {
clearSearch() {
this.isSearch = false;
- this.getEmployeeSubordinatesRequestObject.P_PAGE_NUM = 1;
- this.empSubordinate = [];
- this.isReachEnd = false;
+ this.empSubordinate = this.arrList;
this.searchNameOrUserName = '';
+ this.searchUserName = '';
this.searchEmail = '';
- this.getEmpSubordinate();
+ // this.isSearch = false;
+ // this.getEmployeeSubordinatesRequestObject.P_PAGE_NUM = 1;
+ // this.empSubordinate = [];
+ // this.isReachEnd = false;
+ // this.searchNameOrUserName = '';
+ // this.searchUserName = '';
+ // this.searchEmail = '';
+ // this.getEmpSubordinate();
}
getDetails(index) {
@@ -220,12 +268,49 @@ export class HomeComponent implements OnInit {
}
showSelectedField(value: any) {
- if (this.searchKeySelect === 'User Name' || this.searchKeySelect === 'User Name') {
+ if (this.searchKeySelect === 'Name') {
this.showEmailInput = false;
+ this.showUserNameInput = false;
this.showUserNameOrNameInput = true;
} else if (this.searchKeySelect === 'Email') {
this.showUserNameOrNameInput = false;
+ this.showUserNameInput = false;
this.showEmailInput = true;
+ } else if (this.searchKeySelect === 'User Name') {
+ this.showUserNameOrNameInput = false;
+ this.showEmailInput = false;
+ this.showUserNameInput = true;
}
}
+
+
+
+ // getSuborinatesAttStatus(){
+ // const request = {
+ // // SearchMonth:"January",
+ // SearchYear:Number,
+
+ // };
+ // // this.myTeamService.getSuborinatesAttStatus().subscribe((result: any) =>
+ // this.myTeamService.getSuborinatesAttStatus(request, ()=> {} , this.ts.trPK('general', 'retry')).subscribe((result)=>
+ // {
+ // this.handleRespondSuborinatesAttStatusResult(result);
+
+ // })
+ // }
+
+ // handleRespondSuborinatesAttStatusResult(result){
+ // // this.EmpTotal = result.GetSubordinatesAttdStatusList.length;
+ // this.EmpTotal = result.GetSubordinatesAttdStatusList[0].NUMBER_OF_EMPLOYEES;
+ // console.log("total no "+this.EmpTotal)
+ // }
+ filterList(event) {
+ const val = event.target.value;
+ if (val === '') {
+ this.arrList = this.empSubordinate;
+ }
+ this.arrList = this.empSubordinate.filter((item) => {
+ return (item.title_EN.toLowerCase().indexOf(val.toLowerCase()) > -1);
+ });
+ }
}
diff --git a/Mohem/src/app/my-team/my-team.module.ts b/Mohem/src/app/my-team/my-team.module.ts
index 784d9bbb..49925b71 100644
--- a/Mohem/src/app/my-team/my-team.module.ts
+++ b/Mohem/src/app/my-team/my-team.module.ts
@@ -8,12 +8,15 @@ import { IonicModule } from '@ionic/angular';
import { MyTeamPage } from './my-team.page';
import { HmgCommonModule } from '../hmg-common/hmg-common.module';
+import { from } from 'rxjs';
+import { WorklistService } from '../notification/service/worklist.service';
+
const routes: Routes = [
{
path: '',
component: MyTeamPage,
- children:[{
+ children: [{
path: 'home',
component: HomeComponent
},
@@ -24,8 +27,10 @@ const routes: Routes = [
{
path: 'details-2',
component: DetailsComponent
- }
- ]
+ },
+
+
+ ]
}
];
@@ -36,7 +41,10 @@ const routes: Routes = [
FormsModule,
IonicModule,
RouterModule.forChild(routes)
+
],
- declarations: [MyTeamPage,HomeComponent,DetailsComponent]
+ providers: [WorklistService],
+ declarations: [MyTeamPage, HomeComponent, DetailsComponent,
+ ]
})
-export class MyTeamPageModule {}
+export class MyTeamPageModule { }
diff --git a/Mohem/src/app/my-team/service/my-team.service.ts b/Mohem/src/app/my-team/service/my-team.service.ts
index ebda3f1d..87507d70 100644
--- a/Mohem/src/app/my-team/service/my-team.service.ts
+++ b/Mohem/src/app/my-team/service/my-team.service.ts
@@ -7,6 +7,9 @@ import { AuthenticationService } from "src/app/hmg-common/services/authenticatio
export class MyTeamService {
public static EMPLOYEE_SHARED_DATA = 'employee';
public static getMyTeam = 'Services/ERP.svc/REST/GET_EMPLOYEE_SUBORDINATES';
+ // public static getSuborinateStatus = 'Services/ERP.svc/REST/GET_SUBORDINATES_ATTD_STATUS';
+
+
constructor(
public con: ConnectorService,
private authService: AuthenticationService
@@ -16,4 +19,16 @@ export class MyTeamService {
this.authService.authenticateRequest(request);
return this.con.post(MyTeamService.getMyTeam, request, onError, errorLabel);
}
+
+ // public getSuborinatesAttStatus(absence: any, onError?: any, errorLabel?: string){
+ // const request = absence;
+ // this.authService.authenticateRequest(request);
+ // console.log("________________________________");
+ // console.log(request);
+ // return this.con.post(MyTeamService.getSuborinateStatus, request, onError, errorLabel);
+ // }
+
+
+
+
}
diff --git a/Mohem/src/app/notification/home/home.component.ts b/Mohem/src/app/notification/home/home.component.ts
index fc4f266c..66268864 100644
--- a/Mohem/src/app/notification/home/home.component.ts
+++ b/Mohem/src/app/notification/home/home.component.ts
@@ -1,4 +1,4 @@
-import { Component, OnInit, ViewChild } from '@angular/core';
+import { Component, OnInit, ViewChild, NgZone } from '@angular/core';
import { ModalController } from '@ionic/angular';
import { CommonService } from 'src/app/hmg-common/services/common/common.service';
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
@@ -75,6 +75,8 @@ export class HomeComponent implements OnInit {
public totalPO = 0;
public totalPR = 0;
public totalMR = 0;
+ public totalIC = 0;
+
public showChart = false;
public isPostNoLoad = true;
@@ -86,13 +88,14 @@ export class HomeComponent implements OnInit {
public data = {
datasets: [
{
- data: [0, 0, 0, 0, 0],
+ data: [0, 0, 0, 0, 0, 0],
backgroundColor: [
'#18a169',
'#38c9b3',
'#114475',
'#3cb9d5',
- '#cc3232'
+ '#cc3232',
+ '#9e7e97'
],
borderWidth: 5
}]
@@ -145,6 +148,14 @@ export class HomeComponent implements OnInit {
color: '#cc3232',
key: 'ITG',
disable: false
+ },
+ {
+ value: 0,
+ name: 'IC',
+ active: false,
+ color: '#9e7e97',
+ key: 'INVITEM',
+ disable: false
}
];
public slideOptsOne = {
@@ -162,7 +173,8 @@ export class HomeComponent implements OnInit {
public WorklistService: WorklistService,
public workListService: WorklistMainService,
public modalController: ModalController,
- public DS: DashboredService
+ public DS: DashboredService,
+ public ngZone: NgZone
) {
this.WorkListObj = new WorkListRequest();
this.WorkListObj.P_NOTIFICATION_TYPE = '1';
@@ -221,11 +233,15 @@ export class HomeComponent implements OnInit {
}
assignDataToFilters() {
- this.filters[0].value = this.worklistNotifications.P_OPEN_NTF_NUMBER;
- this.filters[1].value = this.totalHR;
- this.filters[2].value = this.totalPO;
- this.filters[3].value = this.totalPR;
- this.filters[4].value = this.totalMR;
+ this.ngZone.run(() => {
+ this.filters[0].value = this.worklistNotifications.P_OPEN_NTF_NUMBER;
+ this.filters[1].value = this.totalHR;
+ this.filters[2].value = this.totalPO;
+ this.filters[3].value = this.totalPR;
+ this.filters[4].value = this.totalMR;
+ this.filters[6].value = this.totalIC;
+ });
+
if (this.totalHR === 0) {
this.data.datasets[0].data[0] = 0;
@@ -243,6 +259,10 @@ export class HomeComponent implements OnInit {
this.data.datasets[0].data[3] = 0;
}
+ if (this.totalIC === 0) {
+ this.data.datasets[0].data[5] = 0;
+ }
+
const openNotificationsArray = this.worklistNotifications.GetOpenNotificationsList;
for (const notification of openNotificationsArray) {
@@ -258,6 +278,9 @@ export class HomeComponent implements OnInit {
} else if (notification.ITEM_TYPE === 'INVMOA') {
this.filters[4].value = this.totalMR;
this.data.datasets[0].data[3] = notification.OPEN_NTF_NUMBER;
+ } else if (notification.ITEM_TYPE === 'INVITEM') {
+ this.filters[6].value = this.totalIC;
+ this.data.datasets[0].data[5] = notification.OPEN_NTF_NUMBER;
}
}
// this.data.datasets[0].data[4] = this.ITGCount;
@@ -290,7 +313,7 @@ export class HomeComponent implements OnInit {
}
openProfilePage() {
- this.common.openProfile();
+ this.common.openProfile('sideMenu');
}
disableFilters() {
@@ -414,14 +437,19 @@ export class HomeComponent implements OnInit {
this.totalPR = this.totalPR + 1;
} else if (workList.ITEM_TYPE === 'INVMOA') {
this.totalMR = this.totalMR + 1;
+ } else if (workList.ITEM_TYPE === 'INVITEM') {
+ this.totalIC = this.totalIC + 1;
}
}
categorizeData(arrayToCategorize: any) {
- this.totalHR = 0;
- this.totalPO = 0;
- this.totalPR = 0;
- this.totalMR = 0;
+ this.ngZone.run(() => {
+ this.totalHR = 0;
+ this.totalPO = 0;
+ this.totalPR = 0;
+ this.totalMR = 0;
+ this.totalIC = 0;
+ })
const datePipe = new DatePipe('en-US');
const formattedData = [];
@@ -490,6 +518,10 @@ export class HomeComponent implements OnInit {
}
} else {
this.newWorkListResponse = [];
+ // this.assignDataToFilters();
+ if (this.showFormattedData.length === 0) {
+ this.resetFiltersUI();
+ }
this.data.datasets[0].data[4] = this.ITGCount;
this.showChart = true;
// this.common.stopLoading();
@@ -497,6 +529,23 @@ export class HomeComponent implements OnInit {
}
}
+ public resetFiltersUI () {
+ this.ngZone.run(() => {
+ this.filters[0].value = 0;
+ this.filters[1].value = 0;
+ this.filters[2].value = 0;
+ this.filters[3].value = 0;
+ this.filters[4].value = 0;
+ this.filters[6].value = 0;
+
+ this.data.datasets[0].data[0] = 0;
+ this.data.datasets[0].data[1] = 0;
+ this.data.datasets[0].data[2] = 0;
+ this.data.datasets[0].data[3] = 0;
+ this.data.datasets[0].data[5] = 0;
+ });
+ }
+
openNotificationDetail(obj) {
this.common.sharedService.setSharedData(this.selectedFilter, 'selectedFilter');
this.common.sharedService.setSharedData(false, 'loadWorkList');
@@ -507,6 +556,8 @@ export class HomeComponent implements OnInit {
this.common.openWorklistMainPOPage();
} else if (obj.REQUEST_TYPE === 'MO') {
this.common.openWorklistMainMRPage();
+ } else if (obj.REQUEST_TYPE === 'ITEM_CREATION') {
+ this.common.openWorklistMainICPage();
} else {
this.common.openWorklistMainPage();
}
diff --git a/Mohem/src/app/notification/notification.module.ts b/Mohem/src/app/notification/notification.module.ts
index e191db27..d9b5da73 100644
--- a/Mohem/src/app/notification/notification.module.ts
+++ b/Mohem/src/app/notification/notification.module.ts
@@ -28,9 +28,10 @@ import { WorklistMainMRComponent } from './worklist-main-mr/worklist-main-mr.com
import { WorklistAdvancedSearchComponent } from './worklist-advanced-search/worklist-advanced-search.component';
import { WorkListMainItgComponent } from './work-list-main-itg/work-list-main-itg.component';
// import { WorklistMainComponent } from './worklist-main/worklist-main.component';
-import {MoreActionModalComponent} from './more-action-modal/more-action-modal.component'
+import { MoreActionModalComponent } from './more-action-modal/more-action-modal.component'
import { WorkListReplacementItgComponent } from './work-list-replacement-itg/work-list-replacement-itg.component';
import { MoItemHistoryComponent } from './mo-item-history/mo-item-history.component';
+import { WorklistMainIcComponent } from './worklist-main-ic/worklist-main-ic.component';
const routes: Routes = [
@@ -50,7 +51,7 @@ const routes: Routes = [
path: 'worklist-main',
component: WorklistMainComponent
},
- {
+ {
path: 'work-list-replacement-roll',
component: WorkListReplacementRollComponent
},
@@ -84,40 +85,44 @@ const routes: Routes = [
component: WorklistMainPRComponent
},
{
- path: 'apply-action-modal',
- component: ApplyActionModalComponent
- },
- {
- path: 'worklist-main-PO',
- component: WorklistMainPoComponent
- },
- {
- path: 'item-history-PO',
- component: ItemHistoryComponent
- },
- {
- path: 'qutation-analysis-PO',
- component: QutationAnalysisComponent
- },
- {
- path: 'worklist-main-MR',
- component: WorklistMainMRComponent
- },
- {
- path: 'worklist-main-ITG',
- component: WorkListMainItgComponent
- },
- {
- path: 'more-action-modal',
- component: MoreActionModalComponent
- },
- {
- path: 'worklist-replacement-itg',
- component: WorkListReplacementItgComponent
- },
- {
- path: 'item-history-MO',
- component: MoItemHistoryComponent
+ path: 'apply-action-modal',
+ component: ApplyActionModalComponent
+ },
+ {
+ path: 'worklist-main-PO',
+ component: WorklistMainPoComponent
+ },
+ {
+ path: 'item-history-PO',
+ component: ItemHistoryComponent
+ },
+ {
+ path: 'qutation-analysis-PO',
+ component: QutationAnalysisComponent
+ },
+ {
+ path: 'worklist-main-MR',
+ component: WorklistMainMRComponent
+ },
+ {
+ path: 'worklist-main-ITG',
+ component: WorkListMainItgComponent
+ },
+ {
+ path: 'more-action-modal',
+ component: MoreActionModalComponent
+ },
+ {
+ path: 'worklist-replacement-itg',
+ component: WorkListReplacementItgComponent
+ },
+ {
+ path: 'item-history-MO',
+ component: MoItemHistoryComponent
+ },
+ {
+ path: 'item-creation-IC',
+ component: WorklistMainIcComponent
}
]
}
@@ -153,7 +158,8 @@ const routes: Routes = [
WorklistAdvancedSearchComponent,
WorkListMainItgComponent,
WorkListReplacementItgComponent,
- MoItemHistoryComponent
+ MoItemHistoryComponent,
+ WorklistMainIcComponent
// WorklistMainComponent
],
entryComponents: [
@@ -161,4 +167,4 @@ const routes: Routes = [
],
providers: [WorklistService, WorklistMainService, WorklistAttachService]
})
-export class NotificationPageModule {}
+export class NotificationPageModule { }
diff --git a/Mohem/src/app/notification/service/work-list.main.service.ts b/Mohem/src/app/notification/service/work-list.main.service.ts
index b4d19488..dec72b70 100644
--- a/Mohem/src/app/notification/service/work-list.main.service.ts
+++ b/Mohem/src/app/notification/service/work-list.main.service.ts
@@ -23,33 +23,22 @@ import { itgRequest } from '../models/itgFormDetailsRequest';
@Injectable()
export class WorklistMainService {
- public static getEITNotificationBody =
- "Services/ERP.svc/REST/GET_EIT_NOTIFICATION_BODY";
- public static getAbsenceNotificationBody =
- "Services/ERP.svc/REST/GET_ABSENCE_NOTIFICATION_BODY";
- public static getPoNotificationBody =
- "Services/ERP.svc/REST/GET_PO_NOTIFICATION_BODY";
- public static getMONotificationBody =
- "Services/ERP.svc/REST/GET_MO_NOTIFICATION_BODY";
- public static getPRNotificationBody =
- "Services/ERP.svc/REST/GET_PR_NOTIFICATION_BODY";
+ public static getEITNotificationBody = "Services/ERP.svc/REST/GET_EIT_NOTIFICATION_BODY";
+ public static getAbsenceNotificationBody = "Services/ERP.svc/REST/GET_ABSENCE_NOTIFICATION_BODY";
+ public static getPoNotificationBody = "Services/ERP.svc/REST/GET_PO_NOTIFICATION_BODY";
+ public static getMONotificationBody = "Services/ERP.svc/REST/GET_MO_NOTIFICATION_BODY";
+ public static getPRNotificationBody = "Services/ERP.svc/REST/GET_PR_NOTIFICATION_BODY";
+ public static getICNotificationBody = "Services/ERP.svc/REST/GET_ITEM_CREATION_NTF_BODY";
public static getPOItemHistory = "Services/ERP.svc/REST/GET_PO_ITEM_HISTORY";
public static getMOItemHistory = "Services/ERP.svc/REST/GET_MO_ITEM_HISTORY";
- public static getNotificationButtons =
- "Services/ERP.svc/REST/GET_NOTIFICATION_BUTTONS";
+ public static getNotificationButtons = "Services/ERP.svc/REST/GET_NOTIFICATION_BUTTONS";
public static getUserInfo = "Services/ERP.svc/REST/Get_UserInformation";
- public static getNotificationAction =
- "Services/ERP.svc/REST/NOTIFICATION_ACTIONS";
- public static getNotificationRespondAtt =
- "Services/ERP.svc/REST/NOTIFICATION_GET_RESPOND_ATTRIBUTES";
- public static getQutationAnalysisUrl =
- "Services/ERP.svc/REST/GET_QUOTATION_ANALYSIS";
- public static getITGFormTaskCount =
- 'Services/COCWS.svc/REST/ITGGetTaskCountRequestType';
- public static getITGFormTaskDetails =
- 'Services/COCWS.svc/REST/ITGFormsPendingTasks';
- public static getITGFormDetails =
- 'Services/COCWS.svc/REST/ITGGetFormDetials';
+ public static getNotificationAction = "Services/ERP.svc/REST/NOTIFICATION_ACTIONS";
+ public static getNotificationRespondAtt = "Services/ERP.svc/REST/NOTIFICATION_GET_RESPOND_ATTRIBUTES";
+ public static getQutationAnalysisUrl = "Services/ERP.svc/REST/GET_QUOTATION_ANALYSIS";
+ public static getITGFormTaskCount = 'Services/COCWS.svc/REST/ITGGetTaskCountRequestType';
+ public static getITGFormTaskDetails = 'Services/COCWS.svc/REST/ITGFormsPendingTasks';
+ public static getITGFormDetails = 'Services/COCWS.svc/REST/ITGGetFormDetials';
@@ -118,6 +107,21 @@ export class WorklistMainService {
);
}
+ public getICNotificationBody(
+ WorkListBodyRequest: any,
+ onError?: any,
+ errorLabel?: string
+ ): Observable {
+ const request = WorkListBodyRequest;
+ this.authService.authenticateRequest(request);
+ return this.api.post(
+ WorklistMainService.getICNotificationBody,
+ request,
+ onError,
+ errorLabel
+ );
+ }
+
public getPONotificationBody(
WorkListBodyRequest: any,
onError?: any,
diff --git a/Mohem/src/app/notification/service/worklist.service.ts b/Mohem/src/app/notification/service/worklist.service.ts
index 2c719e86..1673443f 100644
--- a/Mohem/src/app/notification/service/worklist.service.ts
+++ b/Mohem/src/app/notification/service/worklist.service.ts
@@ -15,7 +15,8 @@ export class WorklistService {
public static getReplacmentEmployeeList = 'Services/ERP.svc/REST/GET_REPLACEMENT_LIST';
public static getRFCEmployeeList = 'Services/ERP.svc/REST/GET_RFC_EMPLOYEE_LIST';
public static getActionHistory = 'Services/ERP.svc/REST/GET_ACTION_HISTORY';
-
+ public static getFavorite = 'Services/ERP.svc/REST/Mohemm_GetFavoriteReplacements';
+ public static saveFavorite = 'Services/ERP.svc/REST/Mohemm_ChangeFavoriteReplacements';
constructor(
public api: ConnectorService,
public authService: AuthenticationService,
@@ -50,4 +51,21 @@ export class WorklistService {
return this.api.post(WorklistService.getActionHistory, request, onError, errorLabel);
}
-}
\ No newline at end of file
+ public getFavorite(req: any, onError?: any, errorLabel?: string): Observable {
+ this.authService.authenticateRequest(req);
+ return this.api.post(WorklistService.getFavorite, req, onError, errorLabel);
+ }
+ public saveFavoriteList(request: any, onError?: any, errorLabel?: string): Observable {
+ var req: any = {};
+ req['Mohemm_ChangeReplacementsInputList'] = request;
+ this.authService.authenticateRequest(req);
+ console.log(req);
+ return this.api.post(WorklistService.saveFavorite, req, onError, errorLabel);
+ }
+
+ public getFavoriteMyTeam(req: any, onError?: any, errorLabel?: string): Observable {
+ this.authService.authenticateRequest(req);
+ return this.api.post(WorklistService.getFavorite, req, onError, errorLabel);
+ }
+}
+
diff --git a/Mohem/src/app/notification/work-list-details/work-list-details.component.html b/Mohem/src/app/notification/work-list-details/work-list-details.component.html
index eefc7a43..3c25611b 100644
--- a/Mohem/src/app/notification/work-list-details/work-list-details.component.html
+++ b/Mohem/src/app/notification/work-list-details/work-list-details.component.html
@@ -38,7 +38,7 @@
{{'userProfile, position' | translate}}
- {{submitterInfo.POSITION_NAME}}
+ {{formatJobName(submitterInfo.POSITION_NAME)}}
@@ -54,7 +54,7 @@
{{'userProfile, job' | translate}}
- {{submitterInfo.JOB_NAME}}
+ {{formatJobName(submitterInfo.POSITION_NAME)}}
diff --git a/Mohem/src/app/notification/work-list-details/work-list-details.component.ts b/Mohem/src/app/notification/work-list-details/work-list-details.component.ts
index 460148c8..2635ee81 100644
--- a/Mohem/src/app/notification/work-list-details/work-list-details.component.ts
+++ b/Mohem/src/app/notification/work-list-details/work-list-details.component.ts
@@ -44,6 +44,19 @@ export class WorkListDetailsComponent implements OnInit {
this.handleNotificationBody();
}
+ public formatJobName(title: any) {
+ let jobName: any;
+ if (title) {
+ let jobTitle = title.split('.');
+ if (jobTitle && jobTitle.length > 1) {
+ jobName = jobTitle[0] + " " + jobTitle[1];
+ }
+ } else {
+ jobName = '';
+ }
+ return jobName;
+ }
+
getsubmitterInfo(notificationSubmitterInfoObj) {
this.worklistMainService.getSubmitterInfo(notificationSubmitterInfoObj).
subscribe((result: WorklistsubmitterInfoResponse) => {
diff --git a/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.html b/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.html
index 0f66b227..3cdc7f66 100644
--- a/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.html
+++ b/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.html
@@ -37,11 +37,11 @@
{{dataContant.Title}}
{{dataContant.Value}}
-
+
{{data}}
-
+
@@ -88,8 +88,70 @@
+
-
+
+
+
+
+
+
+
+
+
+
+ {{approvalInfo.Name}}
+
+
+
+
+
+ Note: {{approvalInfo.Notes}}
+
+
+
+
+
+
+
+ Note: {{approvalInfo.Notes}}
+
+
+
+
+
+ {{approvalInfo.Action}}
+
+
+ {{returnDateTime(approvalInfo.Date) }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -139,11 +203,11 @@
{{dataContant.Title}}
{{dataContant.Value}}
-
+
{{data}}
-
+
@@ -191,7 +255,7 @@
-
+
-
+
-
+
+ if there is additional screen like in VIDA -->
+
+
+
+
+
+
+ {{ 'submitAbsence, comments' | translate}}
+
+
+
+
+
+
+
+
+
+
-
+
-
+
- {{'worklistMain, Tran_Succ' | translate}}
+ {{'worklistMain, Tran_Succ' | translate}}
-
+
@@ -466,22 +547,23 @@
-
+
-
- {{action.name}}
- Request Info
-
+
+ {{action.name}}
+
+ {{'worklistMain, request' | translate}}
+
-
- Skip
+
+ Skip
diff --git a/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.scss b/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.scss
index a2fcbc06..b8bf1e75 100644
--- a/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.scss
+++ b/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.scss
@@ -6,11 +6,38 @@
}
.timeline-icon{
- width: 30px !important;
+ width: 55px !important;
}
.timeline:before{
position: fixed !important;
}
.tabs-margin{
margin-left: 0px;
-}
\ No newline at end of file
+}
+
+@media only screen and (max-width: 320px) {
+ .footer-btn-img{
+ max-width: none !important;
+ width: 40px !important;
+ }
+}
+.footer-btn-img{
+ max-width: none;
+ width: 50px;
+}
+.timeline-item{
+ margin: 0;
+ white-space: nowrap;
+ font-size: 10px;
+ }
+
+ .req_info{
+ width: 25px;
+ height: 25px;
+ display: inline-block;
+ margin: 0;
+ }
+
+ .deligate{
+ margin-left: 25px;
+ }
\ No newline at end of file
diff --git a/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.ts b/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.ts
index fd126539..4db168ab 100644
--- a/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.ts
+++ b/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.ts
@@ -18,20 +18,22 @@ import { ApplyActionModalComponent } from '../apply-action-modal/apply-action-mo
export class WorkListMainItgComponent implements OnInit {
@ViewChild('slides') slides: IonSlides;
- public static APPROVAL = "Services/COCWS.svc/REST/ITGApproveRequest"
- public static REJECT = 'Services/COCWS.svc/REST/ITGRejectRequest'
+ // tslint:disable: member-ordering
+ public static APPROVAL = 'Services/COCWS.svc/REST/ITGApproveRequest';
+ public static REJECT = 'Services/COCWS.svc/REST/ITGRejectRequest';
public static DELEGATE = 'Services/COCWS.svc/REST/ITGDelegateRequest';
public static REQUEST_INFORMATION = 'Services/COCWS.svc/REST/ITGRequestInformation';
public static ANSWER = 'Services/COCWS.svc/REST/ITGAnswer';
public static GRANT = 'Services/COCWS.svc/REST/ITGGrantAccess';
+ // tslint:disable: variable-name
public request_info: any;
public request_name: any;
public all_request: any;
public all_request_names: any;
public is_all_items_sents: any;
public request = new itgRequest();
- public activeSegment: any = "info";
+ public activeSegment: any = 'info';
public request_details: any;
public segmentsArray: { name: string, number: number }[] = [];
public segmentData: { name: string, data: any }[] = [];
@@ -44,7 +46,7 @@ export class WorkListMainItgComponent implements OnInit {
public replcamentID: string;
public actionSelected: any;
public options: any;
- public index: number = 0;
+ public index = 0;
public grantDATA: any;
public grantInfo: any;
public grantFieldsConditionalValue: any = [];
@@ -67,7 +69,7 @@ export class WorkListMainItgComponent implements OnInit {
public modalCtrl: ModalController) { }
ngOnInit() {
- this.direction = TranslatorService.getCurrentLanguageName()
+ this.direction = TranslatorService.getCurrentLanguageName();
this.request_info = this.common.sharedService.getSharedData(HomeComponent.REQUSET_INFO);
this.request_name = this.common.sharedService.getSharedData(HomeComponent.REQUSET_NAME);
this.all_request = this.common.sharedService.getSharedData(HomeComponent.ALL_REQUEST);
@@ -90,25 +92,22 @@ export class WorkListMainItgComponent implements OnInit {
this.workListService.getITGFormDetails(this.request).subscribe((result: any) => {
this.request_details = result.ITGRequest;
this.grantInfo = result.ITGRequest.GrantFields;
- let count = 0;
for (let i = 0; i < result.ITGRequest.FieldGoups.length; i++) {
this.segmentsArray[i] = { name: result.ITGRequest.FieldGoups[i].Title, number: i };
- this.segmentData[i] = { name: result.ITGRequest.FieldGoups[i].Title, data: result.ITGRequest.FieldGoups[i].Fields }
+ this.segmentData[i] = { name: result.ITGRequest.FieldGoups[i].Title, data: result.ITGRequest.FieldGoups[i].Fields };
+ // tslint:disable: prefer-for-of
for (let j = 0; j < this.segmentData[i].data.length; j++) {
- if (this.segmentData[i].data[j].Type === "table") {
- this.dataLabelAndValue.push(JSON.parse(this.segmentData[i].data[j].Value))
+ if (this.segmentData[i].data[j].Type === 'table') {
+ this.dataLabelAndValue.push(JSON.parse(this.segmentData[i].data[j].Value));
}
- // if (this.segmentData[i].data[j].TableValue){
- // this.requestDetailsData[count] ={ name:this.segmentData[i].data[j].TableValue.Header,
- // data: this.segmentData[i].data[j].TableValue.Rows}
- // count++;
- // }
}
}
this.segmentsArray[this.segmentsArray.length] = { name: 'Approval Level', number: this.segmentsArray.length };
this.segmentsArray = [this.segmentsArray[1], this.segmentsArray[2], this.segmentsArray[0]];
this.segmentData = [this.segmentData[1], this.segmentData[0]];
- this.workList = this.request_details.WFHistory;
+ this.workList = this.request_details.WFHistory.reverse();
+ this.common.sharedService.setSharedData(this.workList, 'workflow-user');
+ // this.workList = this.request_details.WFHistory;
this.options = this.request_details.AllowedActions;
this.activeSegment = this.segmentsArray[0].name;
for (let i = 0; i < this.options.length; i++) {
@@ -135,50 +134,56 @@ export class WorkListMainItgComponent implements OnInit {
}
}
}
- //result.ITGRequest.FieldGoups.Fields
});
}
imageURL(actionName) {
- if (actionName == "Approve") {
- return "../assets/imgs/mohemm-action/Approve.png"
+ if (actionName === 'Approve') {
+ return '../assets/imgs/mohemm-action/Approve.png';
}
- if (actionName == "Reject") {
- return "../assets/imgs/mohemm-action/Reject.png"
+ if (actionName === 'Reject') {
+ return '../assets/imgs/mohemm-action/Reject.png';
}
- if (actionName == "RequestInformation") {
- return "../assets/imgs/mohemm-action/info.png"
+ if (actionName === 'RequestInformation') {
+ return '../assets/imgs/mohemm-action/info.png';
}
- if (actionName == "Grant") {
- return "../assets/imgs/mohemm-action/info.png"
+ if (actionName === 'Grant') {
+ return '../assets/imgs/mohemm-action/info.png';
}
- if (actionName == "Delegate") {
- return "../assets/imgs/mohemm-action/info.png"
+ if (actionName === 'Delegate') {
+ return '../assets/imgs/mohemm-action/delegate.png';
}
- if (actionName == "Answer") {
- return "../assets/imgs/mohemm-action/info.png"
+ if (actionName === 'Answer') {
+ return '../assets/imgs/mohemm-action/info.png';
+ }
+ if (actionName === 'Question') {
+ return '../assets/imgs/mohemm-action/info.png';
+ }
+ if (actionName === 'ReportGenerated') {
+ return '../assets/imgs/mohemm-action/ReportGenerated.png';
+ }
+ if (actionName === 'Doable') {
+ return '../assets/imgs/mohemm-action/info.png';
+ }
+ if (actionName === 'NotDoable') {
+ return '../assets/imgs/mohemm-action/info.png';
+ }
+ if (actionName === 'DataCorrected') {
+ return '../assets/imgs/mohemm-action/info.png';
}
}
public segmentChangedClick(event: any) {
- if (event.detail.value === "Request Details") {
+ if (event.detail.value === 'Request Details') {
this.slides.slideTo(0);
this.activeSegment = event.detail.value;
- }
- else if (event.detail.value === "Approval Level") {
+ } else if (event.detail.value === 'Approval Level') {
this.slides.slideTo(1);
this.activeSegment = event.detail.value;
- }
- else if (event.detail.value === "Requester Details") {
+ } else if (event.detail.value === 'Requester Details') {
this.slides.slideTo(2);
this.activeSegment = event.detail.value;
}
- // for(let i=0; i< this.segmentsArray.length; i++){
- // if(this.segmentsArray[i].name === event.detail.value){
- // this.slides.slideTo(i);
- // this.activeSegment = event.detail.value;
- // }
- // }
}
slideChanged(event: any) {
@@ -212,11 +217,9 @@ export class WorkListMainItgComponent implements OnInit {
}
}
}
- }
- //if user clicked on spicific type of ITG request
- else {
+ } else { // if user clicked on spicific type of ITG request
for (let i = 0; i < this.all_request.length; i++) { // search for the request that clicked on all request
- if (this.request_info.ID == this.all_request[i].ID) { // check if the ID for the request is found.
+ if (this.request_info.ID === this.all_request[i].ID) { // check if the ID for the request is found.
this.index = i + 1;
if (this.index !== this.all_request.length) { // check if its last one to redirecte to home otherwise to next request.
this.clearDataArray();
@@ -228,11 +231,6 @@ export class WorkListMainItgComponent implements OnInit {
return;
}
}
- // else {
- // this.common.sharedService.setSharedData(true, 'loadWorkList');
- // this.common.openNotificationPage();
- // return;
- // }
}
}
this.common.sharedService.setSharedData(true, 'loadWorkList');
@@ -254,7 +252,7 @@ export class WorkListMainItgComponent implements OnInit {
actionService(action, comments?, grantRequests?) {
let url: string;
- let request = new itgRequest();
+ const request = new itgRequest();
request.RequestType = this.request_name;
request.ItemID = this.request_info.ItemID;
request.TaskID = this.request_info.ID;
@@ -264,14 +262,14 @@ export class WorkListMainItgComponent implements OnInit {
request.NewUserEMPId = this.replcamentID;
this.common.confirmAlertDialogAction(
() => {
- if (action == 1) { //approved
+ if (action === 1) { // approved
url = WorkListMainItgComponent.APPROVAL;
this.workListService.getITGActionRequest(request, url)
.subscribe((result: any) => {
- if (result.MessageStatus != 1) {
+ if (result.MessageStatus !== 1) {
this.common.presentAlert(this.ts.trPK('general', 'error-itg'));
- } else if (result.MessageStatus == 1) {
+ } else if (result.MessageStatus === 1) {
this.messageSuccess = true;
setTimeout(() => {
this.messageSuccess = false;
@@ -281,26 +279,28 @@ export class WorkListMainItgComponent implements OnInit {
}, 2000);
}
});
- } else if (action == 2) {//reject
+ } else if (action === 2) {// reject
url = WorkListMainItgComponent.REJECT;
- this.workListService.getITGActionRequest(request, url)
- .subscribe((result: any) => {
- if (result.MessageStatus != 1) {
- this.common.presentAlert(this.ts.trPK('general', 'error-itg'));
+ if (!comments) {
+ this.common.presentAlert(this.ts.trPK('worklist', 'empty-comment'));
+ } else {
+ this.workListService.getITGActionRequest(request, url)
+ .subscribe((result: any) => {
+ if (result.MessageStatus !== 1) {
+ this.common.presentAlert(this.ts.trPK('general', 'error-itg'));
- } else if (result.MessageStatus == 1) {
- setTimeout(() => {
- this.messageSuccess = true;
- this.common.sharedService.setSharedData(true, 'loadWorkList');
- // this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ'));
- // this.common.sharedService.setSharedData(true, 'loadWorkList');
- this.confirmMsg(2);
- this.skip();
- this.messageSuccess = false;
- }, 2000);
- }
- });
- } else if (action == 3) {//request more info
+ } else if (result.MessageStatus === 1) {
+ setTimeout(() => {
+ this.messageSuccess = true;
+ this.common.sharedService.setSharedData(true, 'loadWorkList');
+ this.confirmMsg(2);
+ this.skip();
+ this.messageSuccess = false;
+ }, 2000);
+ }
+ });
+ }
+ } else if (action === 3) {// request more info
request.NewUserEMPId = this.replcamentID;
url = WorkListMainItgComponent.REQUEST_INFORMATION;
if (!comments) {
@@ -309,12 +309,11 @@ export class WorkListMainItgComponent implements OnInit {
request.Comments = comments;
this.workListService.getITGActionRequest(request, url)
.subscribe((result: any) => {
- if (result.MessageStatus != 1) {
- //this.common.presentAlert(result.Message);
+ if (result.MessageStatus !== 1) {
this.common.presentAlert(this.ts.trPK('general', 'error-itg'));
}
- if (result.MessageStatus == 1) {
+ if (result.MessageStatus === 1) {
this.messageSuccess = true;
setTimeout(() => {
this.messageSuccess = false;
@@ -327,15 +326,15 @@ export class WorkListMainItgComponent implements OnInit {
}
});
}
- } else if (action == 4) {//delegate
+ } else if (action === 4) {// delegate
request.NewUserEMPId = this.replcamentID;
url = WorkListMainItgComponent.DELEGATE;
this.workListService.getITGActionRequest(request, url)
.subscribe((result: any) => {
- if (result.MessageStatus != 1) {
+ if (result.MessageStatus !== 1) {
this.common.presentAlert(this.ts.trPK('general', 'error-itg'));
- } else if (result.MessageStatus == 1) {
+ } else if (result.MessageStatus === 1) {
this.messageSuccess = true;
setTimeout(() => {
this.messageSuccess = false;
@@ -347,17 +346,17 @@ export class WorkListMainItgComponent implements OnInit {
}, 2000);
}
});
- } else if (action == 5) { //answer
+ } else if (action === 5) { // answer
url = WorkListMainItgComponent.ANSWER;
if (!comments) {
this.common.presentAlert(this.ts.trPK('worklist', 'empty-comment'));
} else {
this.workListService.getITGActionRequest(request, url)
.subscribe((result: any) => {
- if (result.MessageStatus != 1) {
+ if (result.MessageStatus !== 1) {
this.common.presentAlert(this.ts.trPK('general', 'error-itg'));
- } else if (result.MessageStatus == 1) {
+ } else if (result.MessageStatus === 1) {
this.messageSuccess = true;
setTimeout(() => {
this.messageSuccess = false;
@@ -370,20 +369,19 @@ export class WorkListMainItgComponent implements OnInit {
}
});
}
- } else if (action == 6) { //grant
+ } else if (action === 6) { // grant
url = WorkListMainItgComponent.GRANT;
if (!comments) {
this.common.presentAlert(this.ts.trPK('worklist', 'empty-comment'));
- }
- else {
+ } else {
if (this.grantRequest) {
request.AdditionalFields = this.grantRequest;
this.workListService.getITGActionRequest(request, url)
.subscribe((result: any) => {
- if (result.MessageStatus != 1) {
+ if (result.MessageStatus !== 1) {
this.common.presentAlert(this.ts.trPK('general', 'error-itg'));
- } else if (result.MessageStatus == 1) {
+ } else if (result.MessageStatus === 1) {
this.messageSuccess = true;
setTimeout(() => {
this.messageSuccess = false;
@@ -400,6 +398,31 @@ export class WorkListMainItgComponent implements OnInit {
}
}
+ } else if (action === 7) { // grant
+ url = WorkListMainItgComponent.GRANT;
+ if (this.grantRequest) {
+ request.AdditionalFields = this.grantRequest;
+ this.workListService.getITGActionRequest(request, url)
+ .subscribe((result: any) => {
+ if (result.MessageStatus !== 1) {
+ this.common.presentAlert(this.ts.trPK('general', 'error-itg'));
+
+ } else if (result.MessageStatus === 1) {
+ this.messageSuccess = true;
+ setTimeout(() => {
+ this.messageSuccess = false;
+ this.common.sharedService.setSharedData(true, 'loadWorkList');
+ // this.common.presentAlert(this.ts.trPK('worklistMain', 'Tran_Succ'));
+ this.common.sharedService.setSharedData(true, 'loadWorkList');
+ this.confirmMsg(6);
+ this.skip();
+ }, 2000);
+ }
+ });
+ } else {
+ this.common.presentAlert(this.ts.trPK('worklist', 'empty-comment'));
+ }
+
}
}, this.ts.trPK('general', 'ok'),
() => {
@@ -431,30 +454,34 @@ export class WorkListMainItgComponent implements OnInit {
if (action === 6) {
return this.ts.trPK('worklist', 'grantMsg');
}
+ if (action === 7) {
+ return this.ts.trPK('worklist', 'grantMsg');
+ }
}
selectAtion(actionSelected) {
this.actionSelected = actionSelected;
- if (this.actionSelected == "Answer") {
- this.actionService(5, this.commentText)
+ if (this.actionSelected === 'Answer') {
+ this.actionService(5, this.commentText);
}
- if (this.actionSelected == "Approve") {
+ if (this.actionSelected === 'Approve') {
this.actionService(1, this.commentText);
}
- if (this.actionSelected == "Delegate") {
- // this.actionService(4, this.commentText)
- // this.common.openWorklistRollReplacement();
+ if (this.actionSelected === 'Delegate') {
this.presentModal(4);
}
if (this.actionSelected === 'Doable') {
+ this.actionService(1, this.commentText);
}
if (this.actionSelected === 'Grant') {
this.actionService(6, this.commentText, this.grantRequest);
}
if (this.actionSelected === 'NotDoable') {
+ this.actionService(2, this.commentText);
}
if (this.actionSelected === 'Question') {
+ this.actionService(5, this.commentText);
}
if (this.actionSelected === 'Reject') {
this.actionService(2, this.commentText);
@@ -462,7 +489,12 @@ export class WorkListMainItgComponent implements OnInit {
if (this.actionSelected === 'RequestInformation') {
this.presentModal(3);
}
-
+ if (this.actionSelected === 'ReportGenerated') {
+ this.actionService(7, this.grantRequest);
+ }
+ if (this.actionSelected === 'DataCorrected') {
+ this.actionService(7, this.grantRequest);
+ }
}
@@ -475,12 +507,14 @@ export class WorkListMainItgComponent implements OnInit {
modal.cssClass = 'replaceRoll-modal';
modal.onDidDismiss()
.then((data) => {
- this.replcamentID = data.data.empData.USER_NAME;
-
- if (actionNumber == 3) {
- this.actionService(3, this.commentText);
- } else if (actionNumber == 4) {
- this.actionService(4);
+ if(data.data.empData){
+ this.replcamentID = data.data.empData.USER_NAME ? data.data.empData.USER_NAME : data.data.empData.EmployeeID;
+ this.commentText = data.data.comments ? data.data.comments: null;
+ if (actionNumber === 3) {
+ this.actionService(3, this.commentText);
+ } else if (actionNumber === 4) {
+ this.actionService(4);
+ }
}
});
@@ -503,4 +537,47 @@ export class WorkListMainItgComponent implements OnInit {
}
}
+ returnDateTime(stringDate: string) {
+ let allDateTime = stringDate.split(' ');
+ let time = allDateTime[1].split(':', 2);
+ let dateArr= allDateTime[0].split('/')
+ let correctDate = dateArr[1]+'/'+dateArr[0]+'/'+dateArr[2];
+ let fullDate = this.transform(correctDate);
+ return fullDate + ' ' + time[0] + ':' + time[1] + ' ' + allDateTime[2];
+
+ }
+ locale = {
+ en: {
+ // month_names: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
+ month_names_short: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
+ }
+ };
+ transform(value: string) {
+ let x = new Date(Date.parse(value));
+ //return value.toLowerCase();
+ let month = this.getMonthNameShort('en', x.getMonth())
+ return "" + x.getDate() + " " + month + " " + x.getFullYear();
+
+
+ }
+
+ getMonthNameShort(lang, month) {
+ lang = lang && (lang in this.locale) ? lang : 'en';
+ return this.locale[lang].month_names_short[month];
+ }
+
+ backgroundColor(statusName: string){
+ // {'bg-blue-txt' : approvalInfo.Action === 'Submit','bg-red-txt': approvalInfo.Action == 'Not Doable' ,'bg-orange-txt' : approvalInfo.Action === 'Pending' ,'bg-red-txt' : approvalInfo.Action === 'Rejected','bg-green-txt' : approvalInfo.Action != 'Pending' && approvalInfo.Action != 'Rejected' && approvalInfo.Action != 'Submit'}
+ switch (statusName) {
+ case 'Submit':
+ return 'bg-blue-txt';
+ case 'Pending':
+ return 'bg-orange-txt';
+ case 'Not Doable' || 'Rejected':
+ return 'bg-red-txt';
+ default:
+ return 'bg-green-txt';
+ }
+ }
+
}
diff --git a/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.html b/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.html
index 70329cb2..aec4a7d0 100644
--- a/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.html
+++ b/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.html
@@ -1,19 +1,19 @@
-
-
- {{ 'vacation-rule, search-employee' | translate}}
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+ {{ 'worklistMain, delegate' | translate}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{'replacementRoll, searchBy' | translate}}
+
+
+
+
+
+
+ {{'replacementRoll, workflow' | translate}}
+
+
+
+
+
+ {{'replacementRoll, favorite' | translate}}
+
+
+
+
+
+ {{'replacementRoll, employee-id' | translate}}
+
+
+
+
+
+ {{'replacementRoll, employee-email' | translate}}
+
+
+
+
+
+ {{'replacementRoll, employee-name' | translate}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
0" class="uk-margin">
+ {{'replacementRoll, search-result' | translate}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{employee.EMPLOYEE_DISPLAY_NAME}}
+
+
+
+
+
+
+
+
+
+
+
+
0 && !userSelected && ReplacementList.length ==0 && searchKeySelect == '1'">
+
+ {{'replacementRoll, related' | translate}}
+
+
+
+
+
+
+
+
+
+
+ {{employee.Name}}
+
+
+
+
+
+
+
+
+
+
-
-
-
+
0 && !userSelected && ReplacementList.length ==0 && searchKeySelect == '4'">
+
+ {{'replacementRoll, favorite' | translate}}
-
\ No newline at end of file
+
+
+
+
+
+
+
+
+
+ {{employee.EMPLOYEE_DISPLAY_NAME}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Transaction Successful
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.scss b/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.scss
index e69de29b..5f0ca300 100644
--- a/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.scss
+++ b/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.scss
@@ -0,0 +1,280 @@
+
+.disabledButton{
+ opacity:.5;
+
+ }
+
+ .radio-label{
+ margin: 4px;
+ position: relative;
+ bottom: 4px;
+ }
+ ion-radio{
+ --color-checked: #269db8;
+ }
+ .center{text-align: center;}
+ .boldTxtNav{
+ font-weight: bold;
+ }
+ .employee-details{
+ display:inline-block;
+ margin: 10px;
+ }
+ .empImgeRep{
+ display: inline-block;
+ height: 40px;
+ width: 40px;
+ }
+ .star-fav{
+ float: right;
+ margin: 10px;
+ }
+ .star-fav-left{
+ float: right;
+ margin: 10px 5px;
+ }
+ .uk-margin{margin: 15px 15px 0px 15px;
+ font-weight: bold;
+ clear: both;
+ position: relative;
+ top: 10px;}
+ .uk-padding{ padding: 20px;}
+ .uk-padding .employee-details{
+ bottom: 10px;
+ position: relative;}
+
+ .filterInput{
+ border: solid var(--gray) 1px;
+ border-radius: 21px;
+ padding-left: 10px !important;
+ }
+ .filterInput-ar{
+
+ border: solid var(--gray) 1px;
+ border-radius: 21px;
+ --padding-start: 10px !important;
+
+ }
+ .square-container{
+ width:100%;
+ clear: both;
+ }
+ .square{
+ clear: both;
+ }
+ .top-radio-row{
+ font-size: 12px;
+ }
+
+ button.item-button.button.button-md.button-clear.button-clear-md {
+ background-color: transparent;
+ }
+
+ .footer-button {
+ background: #dbdbdb;
+ border-radius: 10px;
+ color: black;
+ --background: transparent;
+ font-weight: bold;
+ width: 75%;
+ }
+
+ // ion-item {
+ // margin-top: 5%;
+ // margin-right: 7%;
+ // width: 100%;
+ // }
+ .ionItem{
+ border: #e4e4e4 solid;
+ /* margin: 6px; */
+ /* padding: 11px; */
+ height: 85px;
+ width: 164px;
+ border-radius: 5px;
+ text-align: center;
+
+ }
+
+
+ .profileImageDiv{
+
+ z-index: 3;
+ position: relative;
+ top: 0;
+
+ }
+ .profileImage{
+ width:60px !important;
+
+ }
+
+ .activated{
+ border: #209a83 0.02cm solid ;
+ }
+ .deactivated{ border: #e4e4e4 0.02cm solid;
+ }
+ .repContentDiv{
+ text-align: center;
+ width: 85%;
+ font-size: 14px;
+ border: #e4e4e4 solid;
+ border-radius: 5px;
+ padding: 20px 8px 8px 8px;
+ margin-top: -9px;
+ margin-right: -35px
+
+ }
+ .selIEmpDiv{
+ text-align: right;
+ margin-bottom: -26px;
+ margin-right: 0px;
+ z-index: 3;
+ position: relative;
+ top: 0;
+ }
+
+ .selIEmpImage{
+ width:22px !important
+
+ }
+
+ .noteInput{
+ border: solid var(--gray) 1px;
+ border-radius: 15px;
+ margin: 8px 17px 0px 17px;
+ padding: 10px 2px 10px 2px;
+ }
+ .filterInput{
+ border: solid var(--gray) 1px;
+ border-radius: 21px;
+ padding-left: 10px !important;
+ }
+
+ .filterInput-ar{
+ // border: solid var(--gray) 1px;
+ // border-radius: 21px;
+ // padding-left: 10px !important;
+ border: solid var(--gray) 1px;
+ border-radius: 21px;
+ // width:250px
+ // padding-left: 145px !important;
+ //margin-left: 123px;
+ // padding-right: 129px;
+ //margin-right: -136px;
+
+ }
+ .filterBtn{
+ background: var(--newgreen);
+ --background: var (--newgreen);
+ border-radius: 50%;
+ height: 60px;
+ width: 60px;
+ }
+ .filterBtn-ar{
+ // background: var(--newgreen);
+ // --background: var (--newgreen);
+ // border-radius: 50%;
+ // height: 60px;
+ // width: 60px;
+ background: var(--newgreen);
+ --background: var (--newgreen);
+ border-radius: 50%;
+ height: 60px;
+ width: 60px;
+ margin-left: -183px;
+ margin-right: 260px;
+ }
+
+
+
+ *{
+ box-sizing: border-box;
+ }
+
+ .square-container{
+ // padding: 8px;
+ width:100%;
+ }
+ .square{
+ // width:calc(100% / 2);
+ width:100%;
+ float:left;
+ position: relative;
+ // padding-bottom: calc(100% / 2);
+ }
+
+ .square .content{
+ width: calc(100% - 16px) !important;
+ height: calc(100% - 16px) !important;
+ margin: 8px;
+ padding: 16px;
+ // position: absolute;
+ color: white;
+ border-radius: 9px;
+ text-align: center;
+ min-height: 92px;
+ // background-color: #0095ff;
+ // box-shadow: 0 2px 5px rgba(0, 0, 0, 0.26);
+ }
+
+ .disabledButton{
+ opacity:.5;
+
+ }
+
+ .radio-label{
+ font-size: 9px;
+ margin: 4px;
+ position: relative;
+ bottom: 4px;
+ }
+ ion-radio{
+ --color-checked: #269db8;
+ }
+ .center{text-align: center;padding: 5px;}
+ .boldTxtNav{
+ font-weight: bold;
+ padding: 5px;
+ }
+ .employee-details{
+ display:inline-block;
+ margin: 10px;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ width: 70%;
+ }
+ .empImgeRep{
+ display: inline-block;
+ height: 40px;
+ width: 40px;
+ }
+ .star-fav{
+ float: right;
+ margin: 15px 0px 0px 0px;
+ }
+ .uk-margin{margin: 15px 15px 0px 15px;
+ font-weight: bold;
+ clear: both;
+ position: relative;
+ top: 10px;}
+ .uk-padding{ padding: 20px;}
+ .uk-padding .employee-details{
+ bottom: 10px;
+ position: relative;}
+
+ .star-fav-left{
+ float: left;
+ margin: 10px 5px;
+ }
+ .top-radio-row{
+ font-size: 12px;
+ display: block;
+ padding-bottom: 25px;
+ padding-top: 15px;
+ }
+ .textSearchType{
+ padding-top: 8px;
+ font-size: 12px;
+ }
+
+
\ No newline at end of file
diff --git a/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.ts b/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.ts
index da811721..a1c5c5c1 100644
--- a/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.ts
+++ b/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.ts
@@ -4,6 +4,7 @@ import { ReplacementServiceRequest } from 'src/app/vacation-rule/model/replaceme
import { VacationRuleServiceService } from 'src/app/vacation-rule/service/vacation-rule-service.service';
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
import { CommonService } from 'src/app/hmg-common/services/common/common.service';
+import { WorklistService } from '../service/worklist.service';
@Component({
@@ -12,6 +13,7 @@ import { CommonService } from 'src/app/hmg-common/services/common/common.service
styleUrls: ['./work-list-replacement-itg.component.scss'],
})
export class WorkListReplacementItgComponent implements OnInit {
+ messageSuccess = false;
P_SEARCH_USER_NAME: string = "";
P_SEARCH_EMPLOYEE_DISPLAY_NAME: string = "";
P_SEARCH_EMAIL_ADDRESS: string = "";
@@ -22,17 +24,44 @@ export class WorkListReplacementItgComponent implements OnInit {
selEmp: string = null;
callback: any;
searchKey: any = "";
- searchKeySelect: string = "";
+ searchKeySelect: string = "1";
replacmentRequest: any = "";
isAbs: boolean = false;
isSave: boolean = false;
+ isSelect: boolean = false;
+ typingTimer: any;
+ userSelected: any;
+ active: any;
+ isAnswer: boolean = false;
+ favoriteUserList = [];
+ userNote: any;
+ isFilter = true;
+ relatedList = [];
+ public direction = '';
+ arr = [];
+ constructor(public vacationRuleService: VacationRuleServiceService,
+ public ts: TranslatorService,
+ public cs: CommonService,
+ public worklistService: WorklistService,
+ public modalController: ModalController) {
+ this.direction = TranslatorService.getCurrentDirection();
+ }
- constructor(public vacationRuleService: VacationRuleServiceService,
- public ts: TranslatorService,
- public cs: CommonService,
- public modalController: ModalController) { }
-
- ngOnInit() {}
+ ngOnInit() {
+ this.getFavruite();
+ if(!this.relatedList || this.relatedList.length === 0 || this.relatedList === undefined){
+ this.arr = this.cs.sharedService.getSharedData('workflow-user', false);
+ var lookupObject = {};
+
+ for(var i in this.arr) {
+ lookupObject[this.arr[i]['Name']] = this.arr[i];
+ }
+ console.log(lookupObject);
+ for(i in lookupObject) {
+ this.relatedList.push(lookupObject[i]);
+ }
+ }
+ }
SearchReplacementList() {
this.ReplacementList = [];
@@ -105,16 +134,17 @@ export class WorkListReplacementItgComponent implements OnInit {
}
}
- doInfinite(infiniteScroll) {
+ // doInfinite(infiniteScroll) {
- }
+ // }
closePage() {
this.isSave = true;
let data: any = null;
if (this.isSave == true) {
if (this.selEmp) {
- data = this.ReplacementList[this.selEmp];
+ data = this.selEmp;
+ this.messageSuccess = true;
} else {
data = null;
}
@@ -124,8 +154,153 @@ export class WorkListReplacementItgComponent implements OnInit {
this.modalController.dismiss({
'dismissed': true,
- empData: data
+ empData: data,
+ comments: this.userNote
});
}
}
+
+ closeFunction(){
+ this.modalController.dismiss({
+ 'dismissed': true,
+ // comments: this.userNote
+ });
+ }
+
+ onChangeSelect(select) {
+ console.log(select.detail.value);
+ let selectValue = select.detail.value;
+
+ if (selectValue == "1") {
+ this.listOfRealted = this.relatedList;
+ this.isSelect = true;
+ this.isFilter = true;
+ } else if(selectValue == "4" ){
+ this.listOfFav = this.favoriteUserList;
+ this.isFilter = true;
+ } else if(selectValue === '2' || selectValue === '3' || selectValue === '5'){
+ this.isSelect = true;
+ this.isFilter = false;
+ }
+ else {
+ this.isSelect = false;
+
+ }
+ }
+ getPlaceHolder() {
+ return this.searchKeySelect == '1' ? this.ts.trPK('replacementRoll', 'searchbyname') : this.searchKeySelect == '2' ? this.ts.trPK('replacementRoll', 'searchbyusername') : this.ts.trPK('replacementRoll', 'searchbyemail');
+ }
+ onChangeInput() {
+ this.ReplacementList = [];
+ clearTimeout(this.typingTimer);
+ this.typingTimer = setTimeout(() => {
+ if (this.searchKey.length > 2) {
+ this.SearchReplacementList();
+ }
+ }, 3000);
+ }
+ select(selectEmp, index) {
+ console.log(selectEmp);
+ this.selEmp = selectEmp
+ this.userSelected = true;
+ this.active = index;
+ this.searchKey = selectEmp.EMPLOYEE_DISPLAY_NAME ? selectEmp.EMPLOYEE_DISPLAY_NAME : selectEmp.Name;
+ console.log(this.searchKey)
+ //this.closePage();
+ }
+
+
+ setFavorite(selEmp) {
+ selEmp.EMPLOYEE_DISPLAY_NAME = selEmp.EMPLOYEE_DISPLAY_NAME ? selEmp.EMPLOYEE_DISPLAY_NAME : selEmp.NAME;
+ selEmp.EMPLOYEE_IMAGE = selEmp.EMPLOYEE_IMAGE ? selEmp.EMPLOYEE_IMAGE : '';
+ selEmp.EMAIL_ADDRESS = selEmp.EMAIL_ADDRESS ? selEmp.EMAIL_ADDRESS : '';
+ var confirmBoxhtml = `
+
Do you want to add ` + selEmp.EMPLOYEE_DISPLAY_NAME + ` in your favorite list
+
+
+
`;
+ if (selEmp.EMPLOYEE_IMAGE)
+ confirmBoxhtml += '';
+ if (!selEmp.EMPLOYEE_IMAGE)
+ confirmBoxhtml += '';
+
+ confirmBoxhtml += `
+
+ ` + selEmp.EMPLOYEE_DISPLAY_NAME + `
+
+
+
+
+
`
+ let userIndex = this.favoriteUserList.findIndex(x => x['USER_NAME'] == selEmp.USER_NAME)
+ if (userIndex == -1)
+ this.cs.presentConfirmDialog(
+ confirmBoxhtml
+ , () => {
+ var request =
+ [{ "USER_NAME": selEmp['USER_NAME'], "EMPLOYEE_DISPLAY_NAME": selEmp['EMPLOYEE_DISPLAY_NAME'], "EMAIL_ADDRESS": selEmp.EMAIL_ADDRESS, "EMPLOYEE_IMAGE": selEmp.EMPLOYEE_IMAGE, "IsFavorite": true }];
+
+ this.saveUserFavruiteList(request);
+ }, () => {
+
+ })
+
+ // if (selectValue == "1" || selectValue == "2" || selectValue == "3") {
+ // this.isSelect = true;
+ // }
+ // else {
+ // this.isSelect = false;
+
+
+
+ // }
+ }
+ saveUserFavruiteList(request) {
+ this.worklistService.saveFavoriteList(request, () => {
+ }).subscribe((result) => {
+ if (this.cs.validResponse(result)) {
+ this.cs.toastPK("replacementRoll", "favorite-saved");
+
+ }
+ })
+ }
+ getFavruite() {
+ this.cs.startLoading();
+ this.worklistService.getFavorite({}, () => {
+
+ }).subscribe((result) => {
+ if (this.cs.validResponse(result)) {
+ this.cs.stopLoading();
+ this.favoriteUserList = result['Mohemm_GetFavoriteReplacementsList'];
+ }
+ })
+ }
+
+ listOfRealted = [];
+ listOfFav = []
+
+ filterList(event){
+ console.log(this.relatedList);
+ console.log(this.favoriteUserList);
+ const val = event.target.value;
+ if(this.searchKeySelect === '1'){
+ if(val === '') {
+ this.relatedList = this.listOfRealted;
+ } else {
+ this.relatedList = this.listOfRealted.filter((item) => {
+ return (item.Name.toLowerCase().indexOf(val.toLowerCase()) > -1);
+ });
+ }
+ } else if(this.searchKeySelect ==='4') {
+ if(val === '') {
+ this.favoriteUserList = this.listOfFav;
+ } else {
+ this.favoriteUserList = this.listOfFav.filter((item) => {
+ return (item.EMPLOYEE_DISPLAY_NAME.toLowerCase().indexOf(val.toLowerCase()) > -1);
+ });
+ }
+ }else{
+ return;
+ }
+ }
}
diff --git a/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.html b/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.html
index f6d2571c..6b6e238d 100644
--- a/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.html
+++ b/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.html
@@ -1,165 +1,213 @@
- {{ 'replacementRoll, title' | translate}}
+ {{
+ 'replacementRoll, title' | translate}}
+ {{ 'worklistMain, request' | translate}}
+
+ {{ 'worklistMain, delegate' | translate}}
+
-
-
-
-
- {{'replacementRoll, searchBy' | translate}}
-
- {{'addAttach, name' | translate}}
- {{'login, username' | translate}}
- {{'general, email' | translate}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+ {{'replacementRoll, searchBy' | translate}}
+
+
+
+
+
+ {{'replacementRoll, workflow' | translate}}
+
+
+
+ {{'replacementRoll, favorite' | translate}}
+
+
+
+ {{'replacementRoll, employee-id' | translate}}
+
+
+
+ {{'replacementRoll, employee-email' | translate}}
+
+
+
+ {{'replacementRoll, employee-name' | translate}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{"replacementRoll, question" | translate}} :
+ {{pQuestion}} ?
+ {{"replacementRoll, answer" | translate}}
+
+
+
+
+
+
+
+
0 && !userSelected && searchBy === '1'">
+
+ {{'replacementRoll, related' | translate}}
+
+
+
+
+
+
+
+
+ {{employee.NAME}}
-
-
-
-
-
- {{"replacementRoll, question" | translate}} :
- {{pQuestion}} ?
- {{"replacementRoll, answer" | translate}}
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
0 && !userSelected && searchBy === '4'">
+
+ {{'replacementRoll, favorite' | translate}}
+
+
+
+
-
-
+
+
+
-
-
-
-
+
{{employee.EMPLOYEE_DISPLAY_NAME}}
-
-
+
+
+
+
+
+
+
+
+
+
+ Sorry there is no data
+
+
+
+
0 && !userSelected" class="uk-margin">
+ {{'replacementRoll, search-result' | translate}}
+
+
-
+
-
-
-
-
-
+
+
+
+
- {{employee.EMPLOYEE_DISPLAY_NAME}}
- {{employee.USER_NAME}}
- {{employee.EMAIL_ADDRESS}}
-
-
-
+
+
+
+
+ {{employee.EMPLOYEE_DISPLAY_NAME}}
+
+
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
Transaction Successful
-
+
+
+
+
+
+ Transaction Successful
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
-
\ No newline at end of file
diff --git a/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.scss b/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.scss
index 5fbd6377..64b9ebd1 100644
--- a/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.scss
+++ b/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.scss
@@ -3,10 +3,12 @@ button.item-button.button.button-md.button-clear.button-clear-md {
}
.footer-button {
- border-radius: 3px;
- padding: 0 1.1em;
- min-height: 45px;
- min-width: 200px;
+ background: #dbdbdb;
+ border-radius: 10px;
+ color: black;
+ --background: transparent;
+ font-weight: bold;
+ width: 75%;
}
// ion-item {
@@ -27,8 +29,7 @@ button.item-button.button.button-md.button-clear.button-clear-md {
.profileImageDiv{
- text-align: center;
- margin-bottom: -27px;
+
z-index: 3;
position: relative;
top: 0;
@@ -36,8 +37,7 @@ button.item-button.button.button-md.button-clear.button-clear-md {
}
.profileImage{
width:60px !important;
- // margin-left: -25px;
- // margin-right: 22px;
+
}
.activated{
@@ -81,16 +81,18 @@ button.item-button.button.button-md.button-clear.button-clear-md {
border-radius: 21px;
padding-left: 10px !important;
}
+
.filterInput-ar{
// border: solid var(--gray) 1px;
// border-radius: 21px;
// padding-left: 10px !important;
border: solid var(--gray) 1px;
border-radius: 21px;
+ // width:250px
// padding-left: 145px !important;
- margin-left: 123px;
+ //margin-left: 123px;
// padding-right: 129px;
- margin-right: -136px;
+ //margin-right: -136px;
}
.filterBtn{
@@ -127,7 +129,7 @@ button.item-button.button.button-md.button-clear.button-clear-md {
}
.square{
// width:calc(100% / 2);
- width:50%;
+ width:100%;
float:left;
position: relative;
// padding-bottom: calc(100% / 2);
@@ -152,9 +154,58 @@ button.item-button.button.button-md.button-clear.button-clear-md {
}
-
-
-
-
-
+.radio-label{
+ font-size: 9px;
+ margin: 4px;
+ position: relative;
+ bottom: 4px;
+}
+ion-radio{
+ --color-checked: #269db8;
+ }
+.center{text-align: center;padding: 5px;}
+.boldTxtNav{
+ font-weight: bold;
+ padding: 5px;
+}
+.employee-details{
+ display:inline-block;
+ margin: 10px;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ width: 70%;
+}
+.empImgeRep{
+ display: inline-block;
+ height: 40px;
+ width: 40px;
+}
+.star-fav{
+ float: right;
+ margin: 15px 0px 0px 0px;
+}
+.uk-margin{margin: 15px 15px 0px 15px;
+ font-weight: bold;
+ clear: both;
+ position: relative;
+ top: 10px;}
+.uk-padding{ padding: 20px;}
+.uk-padding .employee-details{
+ bottom: 10px;
+ position: relative;}
+
+ .star-fav-left{
+ float: left;
+ margin: 10px 5px;
+ }
+ .top-radio-row{
+ font-size: 12px;
+ display: block;
+ padding-bottom: 25px;
+ padding-top: 15px;
+ }
+ .textSearchType{
+ padding-top: 8px;
+ font-size: 12px;
+ }
diff --git a/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.ts b/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.ts
index e2c9f2ed..88cd77b1 100644
--- a/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.ts
+++ b/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.ts
@@ -30,7 +30,7 @@ export class WorkListReplacementRollComponent implements OnInit {
P_PAGE_NUM: number;
P_PAGE_LIMIT: number;
ReplacementList: any = [];
- searchBy: string = "";
+ searchBy: string = "1";
IsReachEnd: boolean = false;
ReplacmentListRes: WorKListReplacmentEmployeeResponse;
private WorkListReplacmentEmployeeObj: WorkListReplacmentEmployeeRequest = new WorkListReplacmentEmployeeRequest();
@@ -43,17 +43,38 @@ export class WorkListReplacementRollComponent implements OnInit {
messageSuccess: boolean = false;
public direction: string;
P_RESPOND_ATTRIBUTES_TBL: any[];
+ typingTimer: any;
+ userSelected: boolean;
+ actionHistory = [];
+ arr = [];
+ favoriteUserList: [] = [];
+ isFilter = true;
constructor(public worklistService: WorklistService, private cs: CommonService, public ts: TranslatorService, public workListMainService: WorklistMainService, public modalCtrl: ModalController) {
this.P_PAGE_NUM = 1;
this.P_PAGE_LIMIT = 50;
this.getPassActionMode = this.cs.sharedService.getSharedData('passActionMode', false);
console.log(this.getPassActionMode);
-
+ // this.getFavruite();
this.getPassNotificationDetails = this.cs.sharedService.getSharedData('passNotificationInfo', false);
this.getpassResAttr = this.cs.sharedService.getSharedData('passResAttr', false);
console.log(this.getpassResAttr);
this.pQuestion = this.cs.sharedService.getSharedData('pQuestion', false);
- if (this.getPassActionMode == "ANSWER_INFO") {
+
+ // tslint:disable-next-line: max-line-length
+ this.arr = this.cs.sharedService.getSharedData('actionHistoryData', false) ? this.cs.sharedService.getSharedData('actionHistoryData', false) : [];
+ var lookupObject = {};
+
+ for(var i in this.arr) {
+ lookupObject[this.arr[i]['USER_NAME']] = this.arr[i];
+ }
+
+ for(i in lookupObject) {
+ this.actionHistory.push(lookupObject[i]);
+ }
+
+ console.log(this.actionHistory);
+
+ if (this.getPassActionMode === 'ANSWER_INFO') {
this.isAnswer = true;
}
@@ -68,6 +89,12 @@ export class WorkListReplacementRollComponent implements OnInit {
this.WorkListActionObj.RespondAttributeList = [];// this.getpassResAttr;
this.WorkListActionObj.P_APPROVER_INDEX = null;
this.direction = TranslatorService.getCurrentLanguageName();
+ var requestInfoDel = this.cs.sharedService.getSharedData('requestInfoDelUser');
+ if (requestInfoDel != null) {
+ this.userSelected = true;
+ this.inputSearch = requestInfoDel.NAME;
+ this.selEmp = requestInfoDel;
+ }
}
ngOnInit() {
@@ -100,6 +127,14 @@ export class WorkListReplacementRollComponent implements OnInit {
this.WorkListReplacmentEmployeeObj.P_SEARCH_EMPLOYEE_DISPLAY_NAME = "";
break;
}
+ case '5': {
+
+ this.WorkListReplacmentEmployeeObj.P_SEARCH_EMPLOYEE_DISPLAY_NAME = this.inputSearch;
+ this.WorkListReplacmentEmployeeObj.P_SEARCH_USER_NAME = "";
+ this.WorkListReplacmentEmployeeObj.P_SEARCH_EMAIL_ADDRESS = "";
+
+ break;
+ }
default: {
this.WorkListReplacmentEmployeeObj.P_SEARCH_USER_NAME = "";
this.WorkListReplacmentEmployeeObj.P_SEARCH_EMPLOYEE_DISPLAY_NAME = "";
@@ -182,6 +217,10 @@ export class WorkListReplacementRollComponent implements OnInit {
console.log(selectEmp.EMPLOYEE_DISPLAY_NAME);
this.selEmp = selectEmp
this.active = index;
+ this.userSelected = true;
+ this.selEmp.EMPLOYEE_DISPLAY_NAME = this.selEmp.EMPLOYEE_DISPLAY_NAME ? this.selEmp.EMPLOYEE_DISPLAY_NAME : selectEmp.NAME;
+ this.inputSearch = selectEmp.EMPLOYEE_DISPLAY_NAME ? selectEmp.EMPLOYEE_DISPLAY_NAME : selectEmp.NAME;
+ //this.getreplacmentemployee();
}
clear() {
this.selEmpName = "";
@@ -246,21 +285,31 @@ export class WorkListReplacementRollComponent implements OnInit {
// this.modalCtrl.dismiss();
}
+
+
+
this.workListMainService.actionButton(this.WorkListActionObj).
subscribe((result: any) => {
- this.handleApplayActionResult(result);
+ if (this.cs.validResponse(result)) {
+ if (result.MessageStatus == 1) {
+
+ this.handleApplayActionResult(result);
+ }
+ }
});
} else {
- let msg: string = this.ts.trPK("replacementRoll", "enterNote");
- this.cs.showErrorMessageDialog(() => {
- }, this.ts.trPK('general', 'ok'), msg);
+ this.cs.redToastPK("replacementRoll", "enterNote");
+ // let msg: string = this.ts.trPK("replacementRoll", "enterNote");
+ // this.cs.showErrorMessageDialog(() => {
+ // }, this.ts.trPK('general', 'ok'), msg);
}
} else {
- let msg: string = this.ts.trPK("replacementRoll", "msg");
- this.cs.showErrorMessageDialog(() => {
- }, this.ts.trPK('general', 'ok'), msg);
+ this.cs.redToastPK("replacementRoll", "msg");
+ // let msg: string = this.ts.trPK("replacementRoll", "msg");
+ // this.cs.showErrorMessageDialog(() => {
+ // }, this.ts.trPK('general', 'ok'), msg);
}
} else if (this.isAnswer == true) {
if (this.userNote) {
@@ -275,14 +324,16 @@ export class WorkListReplacementRollComponent implements OnInit {
this.handleApplayActionResult(result);
});
} else {
- let msg: string = this.ts.trPK("replacementRoll", "enterNote");
- this.cs.showErrorMessageDialog(() => {
- }, this.ts.trPK('general', 'ok'), msg);
+ this.cs.redToastPK("replacementRoll", "enterNote");
+ // let msg: string = this.ts.trPK("replacementRoll", "enterNote");
+ // this.cs.showErrorMessageDialog(() => {
+ // }, this.ts.trPK('general', 'ok'), msg);
}
} else {
- let msg: string = this.ts.trPK("replacementRoll", "msg");
- this.cs.showErrorMessageDialog(() => {
- }, this.ts.trPK('general', 'ok'), msg);
+ this.cs.redToastPK("replacementRoll", "msg");
+ // let msg: string = this.ts.trPK("replacementRoll", "msg");
+ // this.cs.showErrorMessageDialog(() => {
+ // }, this.ts.trPK('general', 'ok'), msg);
}
}
@@ -292,6 +343,21 @@ export class WorkListReplacementRollComponent implements OnInit {
this.cs.sharedService.setSharedData(true, 'loadWorkList');
+
+ this.messageSuccess = true;
+
+ setTimeout(() => {
+ this.messageSuccess = false;
+ //this.modalCtrl.dismiss(succ);
+ this.modalCtrl.dismiss({
+ 'dismissed': true,
+ data: "Success"
+ });
+ if (this.selEmp && this.isAnswer == false)
+ this.setFavorite(this.selEmp);
+ }, 5000);
+
+ this.cs.openNotificationPage();
// this.messageSuccess = true;
// setTimeout(() => {
@@ -369,26 +435,157 @@ export class WorkListReplacementRollComponent implements OnInit {
closeModal() {
this.modalCtrl.dismiss();
}
+
+ selectedType;
onChangeSelect(select) {
console.log(select.detail.value);
let selectValue = select.detail.value;
- if (selectValue == "1" || selectValue == "2" || selectValue == "3") {
+ if (selectValue == '1') {
this.isSelect = true;
+ this.isFilter = true;
+ this.selectedType = 1;
+ this.listOfRealted = this.actionHistory;
+ } else if(selectValue === '4'){
+ console.log(this.listOfFav.length)
+ if(this.favoriteUserList.length === 0 || this.favoriteUserList === undefined ) {
+ this.getFavruite();
+ }
+ this.isFilter = true;
+ this.selectedType = 4;
+ } else if( selectValue === '2' || selectValue === '3' || selectValue === '5'){
+ this.isSelect = true;
+ this.isFilter = false;
+ this.selectedType = 0;
}
else {
this.isSelect = false;
-
+ this.selectedType = 0;
}
}
onChangeInput() {
- if (this.inputSearch.length > 0) {
- this.searchKeyEnter = true;
+ this.ReplacementList = [];
+ clearTimeout(this.typingTimer);
+ this.typingTimer = setTimeout(() => {
+ if (this.inputSearch.length > 2) {
+ this.getreplacmentemployee();
+ }
+ }, 3000);
- } else {
- this.searchKeyEnter = false;
+ // if (this.inputSearch.length > 0) {
+ // this.searchKeyEnter = true;
+ // this.getreplacmentemployee();
+ // } else {
+ // this.searchKeyEnter = false;
+
+ // }
+ }
+ getPlaceHolder() {
+ return this.searchBy == '1' ? this.ts.trPK('replacementRoll', 'searchbyname') : this.searchBy == '2' ? this.ts.trPK('replacementRoll', 'searchbyusername') : this.ts.trPK('replacementRoll', 'searchbyemail');
+ }
+ getFavruite() {
+ this.cs.startLoading();
+ this.worklistService.getFavorite({}, () => {
+
+ }).subscribe((result) => {
+ if (this.cs.validResponse(result)) {
+ this.cs.stopLoading();
+ this.favoriteUserList = result['Mohemm_GetFavoriteReplacementsList'];
+ this.listOfFav = this.favoriteUserList;
+ }
+ })
+ }
+ saveUserFavruiteList(request) {
+ this.worklistService.saveFavoriteList(request, () => {
+ }).subscribe((result) => {
+ if (this.cs.validResponse(result)) {
+ this.cs.toastPK("replacementRoll", "favorite-saved");
+
+ }
+ })
+ }
+
+ setFavorite(selEmp) {
+ selEmp.EMPLOYEE_DISPLAY_NAME = selEmp.EMPLOYEE_DISPLAY_NAME ? selEmp.EMPLOYEE_DISPLAY_NAME : selEmp.NAME;
+ selEmp.EMPLOYEE_IMAGE = selEmp.EMPLOYEE_IMAGE ? selEmp.EMPLOYEE_IMAGE : '';
+ selEmp.EMAIL_ADDRESS = selEmp.EMAIL_ADDRESS ? selEmp.EMAIL_ADDRESS : '';
+ var confirmBoxhtml = `
+
Do you want to add ` + selEmp.EMPLOYEE_DISPLAY_NAME + ` in your favorite list
+
+
+
`;
+ if (selEmp.EMPLOYEE_IMAGE)
+ confirmBoxhtml += '';
+ if (!selEmp.EMPLOYEE_IMAGE)
+ confirmBoxhtml += '';
+
+ confirmBoxhtml += `
+
+ ` + selEmp.EMPLOYEE_DISPLAY_NAME + `
+
+
+
+
+
`
+ let userIndex = this.favoriteUserList.findIndex(x => x['USER_NAME'] == selEmp.USER_NAME)
+ if (userIndex == -1)
+ this.cs.presentConfirmDialog(
+ confirmBoxhtml
+ , () => {
+ var request =
+ [{ "USER_NAME": selEmp['USER_NAME'], "EMPLOYEE_DISPLAY_NAME": selEmp['EMPLOYEE_DISPLAY_NAME'], "EMAIL_ADDRESS": selEmp.EMAIL_ADDRESS, "EMPLOYEE_IMAGE": selEmp.EMPLOYEE_IMAGE, "IsFavorite": true }];
+
+ this.saveUserFavruiteList(request);
+ }, () => {
+
+ })
+
+ // if (selectValue == "1" || selectValue == "2" || selectValue == "3") {
+ // this.isSelect = true;
+ // }
+ // else {
+ // this.isSelect = false;
+
+
+
+ // }
+ }
+
+ // onChangeInput() {
+ // if (this.inputSearch.length > 0) {
+ // this.searchKeyEnter = true;
+
+ // } else {
+ // this.searchKeyEnter = false;
+
+ // }
+ // }
+
+ listOfRealted: any = [];
+ listOfFav: any = [];
+
+ filterList(event){
+ const val = event.target.value;
+ if(this.selectedType === 1){
+ if(val === '') {
+ this.actionHistory = this.listOfRealted;
+ } else {
+ this.actionHistory = this.listOfRealted.filter((item) => {
+ return (item.NAME.toLowerCase().indexOf(val.toLowerCase()) > -1);
+ });
+ }
+ } else if(this.selectedType === 4) {
+ if(val === '') {
+ this.favoriteUserList = this.listOfFav;
+ } else {
+ this.favoriteUserList = this.listOfFav.filter((item) => {
+ return (item.EMPLOYEE_DISPLAY_NAME.toLowerCase().indexOf(val.toLowerCase()) > -1);
+ });
+ }
+ }else{
+ return;
}
}
}
diff --git a/Mohem/src/app/notification/work-list-rfc/work-list-rfc.component.scss b/Mohem/src/app/notification/work-list-rfc/work-list-rfc.component.scss
index c40369aa..b625942e 100644
--- a/Mohem/src/app/notification/work-list-rfc/work-list-rfc.component.scss
+++ b/Mohem/src/app/notification/work-list-rfc/work-list-rfc.component.scss
@@ -87,6 +87,7 @@
border-radius: 21px;
padding-left: 10px !important;
}
+
.filterBtn{
background: var(--newgreen);
--background: var (--newgreen);
diff --git a/Mohem/src/app/notification/worklist-advanced-search/worklist-advanced-search.component.html b/Mohem/src/app/notification/worklist-advanced-search/worklist-advanced-search.component.html
index 33b67cfb..67b487cc 100644
--- a/Mohem/src/app/notification/worklist-advanced-search/worklist-advanced-search.component.html
+++ b/Mohem/src/app/notification/worklist-advanced-search/worklist-advanced-search.component.html
@@ -53,6 +53,7 @@
PO
PR
MR
+ IC
diff --git a/Mohem/src/app/notification/worklist-main-ic/worklist-main-ic.component.html b/Mohem/src/app/notification/worklist-main-ic/worklist-main-ic.component.html
new file mode 100644
index 00000000..b22aa453
--- /dev/null
+++ b/Mohem/src/app/notification/worklist-main-ic/worklist-main-ic.component.html
@@ -0,0 +1,451 @@
+
+
+
+
+
+
{{getPassNotificationDetails.SUBJECT}}
+
+
+
+
+
+ {{'worklistMain,itemReq'| translate}}
+
+
+
+ {{'worklistMain, action' | translate}}
+
+
+
+ {{'worklistMain, attach-file' | translate}}
+
+
+
+
+ {{'worklistMain, info'| translate}}
+
+
+
+
+
+
+ 0" style="width: 100% !important">
+
{{ 'general, empty' | translate}}
+
+
+
+
+
+
+
+ {{pInformation}}
+
+
+
+
+
+
+
+
+ {{'worklist, product-name'| translate}}
+
+ {{header.PRODUCT_NAME}}
+
+
+ {{'worklist, product-description'| translate}}
+
+ {{header.PRODUCT_DESCRIPTION}}
+
+
+
+
+ {{'worklist, Unit-price'| translate}}
+
+ {{header.UNIT_PRICE}}
+
+
+ {{'worklist, manufacturer-name'| translate}}
+
+ {{header.USER_MANUFACTURER_NAME}}
+
+
+
+
+ {{'worklist, manufacturer-part-number'| translate}}
+
+ {{header.USER_MFG_PART_NUM}}
+
+
+ {{'worklist, supplier-name'| translate}}
+
+ {{header.SUPPLIER_NAME}}
+
+
+
+
+ {{'worklist, supplier-contact'| translate}}
+
+ {{header.SUPPLIER_CONTACT}}
+
+
+ {{'worklist, charge-to-patient'| translate}}
+
+ {{header.CHARGE_TO_PATIENT}}
+
+
+
+
+ {{'worklist, justification'| translate}}
+
+ {{header.JUSTIFICATION}}
+
+
+ {{'worklist, item-code'| translate}}
+
+ {{header.ITEM_CODE}}
+
+
+
+
+ {{'worklist, item-description'| translate}}
+
+ {{header.ITEM_DESCRIPTION}}
+
+
+ {{'worklist, group-code'| translate}}
+
+ {{header.ITEM_GROUP_CODE}}
+
+
+
+
+ {{'worklist, group-description'| translate}}
+
+ {{header.ITEM_GROUP}}
+
+
+ {{'worklist, subgroup-code'| translate}}
+
+ {{header.ITEM_SUBGROUP_CODE}}
+
+
+
+
+ {{'worklist, subgroup-description'| translate}}
+
+ {{header.ITEM_SUBGROUP}}
+
+
+ {{'worklist, primary-uom'| translate}}
+
+ {{header.PRIMARY_UOM}}
+
+
+
+
+ {{'worklist, manufacturer-name'| translate}}
+
+ {{header.STANDARD_MANUFACTURER_NAME}}
+
+
+ {{'worklist, manufacturer-part-number'| translate}}
+
+ {{header.STANDARD_MFG_PART_NUM}}
+
+
+
+
+ {{'worklist, template-name'| translate}}
+
+ {{header.TEMPLATE_NAME}}
+
+
+ {{'worklist, item-creation-status'| translate}}
+
+ {{header.ITEM_CREATION_STATUS_DISP}}
+
+
+
+
+ {{'worklist, standardization-approval-status'| translate}}
+
+ {{header.STANDARD_STATUS}}
+
+
+ {{'worklist, standardization-approval-rejection-reason'| translate}}
+
+ {{header.STANDARD_REJECT_REASON}}
+
+
+
+
+
+
+ {{ 'general, load-more' | translate}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0">
+
{{ 'general, empty' | translate}}
+
+ 0 ">
+
+
+
+
+
+
+
+
+
+
+
+ {{actionHistory.NAME}}
+
+
+
+
+
+ Note: {{actionHistory.NOTE}}
+
+
+
+
+
+
+
+ Note: {{actionHistory.NOTE}}
+
+
+
+
{{ actionHistory.visible ? 'Show less': 'Show More' }}
+
+
+
+ {{actionHistory.ACTION}}
+
+
+
+ {{returnDateTime(actionHistory.NOTIFICATION_DATE)}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ 'general, load-more' | translate}}
+
+
+
+
+
+
+
+
+
+
+
+
+ 0">
+
{{ 'general, notAttch' | translate}}
+
+ 0 ">
+
+
+
+
+ {{i+1}}. {{attachList.FILE_NAME}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{'worklist, operating-unit'| translate}}
+
+ {{Lines.OPERATING_UNIT}}
+
+
+ {{'worklist, category'| translate}}
+
+
+ {{Lines.CATEGORY}}
+
+
+
+
+ {{'worklist, requester'| translate}}
+
+
+ {{Lines.REQUESTER}}
+
+
+ {{'worklist, analyzed-by'| translate}}
+
+ {{Lines.ANALYZED_BY}}
+
+
+
+
+ {{'worklist, approved-date'| translate}}
+
+
+ {{Lines.APPROVED_DATE}}
+
+
+ {{'worklist, item-type'| translate}}
+
+ {{Lines.ITEM_TYPE}}
+
+
+
+
+ {{'worklist, related-to'| translate}}
+
+
+ {{Lines.RELATED_TO}}
+
+
+ {{'worklist, request-date'| translate}}
+
+ {{Lines.REQUEST_DATE| date}}
+
+
+
+
+
+ {{'worklist, analyzed-date'| translate}}
+
+ {{Lines.ANALYZED_DATE| date}}
+
+
+ {{'worklist, urgent'| translate}}
+
+ {{Lines.URGENT_FLAG_DISP}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{'worklistMain, Tran_Succ' | translate}}
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Mohem/src/app/notification/worklist-main-ic/worklist-main-ic.component.scss b/Mohem/src/app/notification/worklist-main-ic/worklist-main-ic.component.scss
new file mode 100644
index 00000000..cf5e4beb
--- /dev/null
+++ b/Mohem/src/app/notification/worklist-main-ic/worklist-main-ic.component.scss
@@ -0,0 +1,50 @@
+
+.no-padding-label {
+ padding: 0px !important;
+}
+
+.margin-left {
+ margin-left: 0px;
+}
+
+.active-Segment {
+ font-size: 0.3cm !important;
+ background: #269DB8 !important;
+ text-transform: none;
+ --color-checked: none;
+ border-radius: 100px;
+ border:0;
+ }
+ .active-Segment ion-label{
+ font-size: 11px;
+ color: white !important;
+ }
+ .normal-Segment ion-label{
+ color: black !important;
+ font-size: 11px;
+ }
+ .normal-Segment {
+ font-size: 0.3cm !important;
+ text-transform: none;
+ --color-checked: none;
+ border: 0;
+ }
+ .action-btn {
+ white-space: nowrap;
+ font-size: 10px;
+ }
+ .name{
+ color:black !important ;font-weight: bold;
+ }
+ .timeline-item{
+ margin: 0;
+ white-space: nowrap;
+ font-size: 10px;
+ }
+ .req_info{
+ width: 20px;
+ height: 20px;
+ display: inline-block;
+ margin:15px 10px 0px 0px;
+ }
+
\ No newline at end of file
diff --git a/Mohem/src/app/notification/worklist-main-ic/worklist-main-ic.component.spec.ts b/Mohem/src/app/notification/worklist-main-ic/worklist-main-ic.component.spec.ts
new file mode 100644
index 00000000..5364d18a
--- /dev/null
+++ b/Mohem/src/app/notification/worklist-main-ic/worklist-main-ic.component.spec.ts
@@ -0,0 +1,27 @@
+import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { WorklistMainIcComponent } from './worklist-main-ic.component';
+
+describe('WorklistMainIcComponent', () => {
+ let component: WorklistMainIcComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ WorklistMainIcComponent ],
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(WorklistMainIcComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/Mohem/src/app/notification/worklist-main-ic/worklist-main-ic.component.ts b/Mohem/src/app/notification/worklist-main-ic/worklist-main-ic.component.ts
new file mode 100644
index 00000000..f5c2abec
--- /dev/null
+++ b/Mohem/src/app/notification/worklist-main-ic/worklist-main-ic.component.ts
@@ -0,0 +1,1305 @@
+import { Component, OnInit, ElementRef, ViewChild } from "@angular/core";
+import { CommonService } from "src/app/hmg-common/services/common/common.service";
+import { TranslatorService } from "src/app/hmg-common/services/translator/translator.service";
+import { WorkListBodyRequest } from "../models/NotificationBodyReq";
+import { EITNotificatonBodyResponse } from "../models/EITNotificationBodyRes";
+import { AbsenceNotificatonBodyResponse } from "../models/AbsenceNotificationBodyRes";
+import { NotificatonButtonResponse } from "../models/NotificationButtonRes";
+import { WorkListActionRequest } from "../models/NotificationActionReq";
+import { WorkListButtonRequest } from "../models/NotificationButtonReq";
+// import { isDate } from 'angular6-json-schema-form';
+import { MenuResponse } from "src/app/hmg-common/services/menu/models/menu-response";
+import { LoginRequest } from "src/app/hmg-common/services/authentication/models/login.request";
+import { WorklistMainService } from "../service/work-list.main.service";
+import { HomeComponent } from "src/app/notification/home/home.component";
+import { TextInput } from 'src/app/uI-elements/text.input';
+import { TextAreaInput } from 'src/app/uI-elements/text-area.input';
+import { MenuService } from 'src/app/hmg-common/services/menu/menuservice.service';
+import { Events, ModalController } from '@ionic/angular';
+import { PONotificatonBodyResponse } from '../models/PONotificationBodyRes';
+import { MONotificatonBodyResponse } from '../models/MONotificationBodyRes';
+import { PRNotificatonBodyResponse } from '../models/PRNotificationBodyRes';
+import { WorklistAttachService } from 'src/app/absence/service/work-list-attach.service';
+import { NotificationGetAttachResponse } from 'src/app/eit/models/NotificationGetAttachRes';
+import { PRNotificatonBodyList } from '../models/PRNotificationBodyList';
+import { WorkListActionHistoryRequest } from '../models/ActionHistoryReq';
+import { WorklistService } from '../service/worklist.service';
+import { ViewNoteModalComponent } from '../view-note-modal/view-note-modal.component';
+import { WorkListActionHistoryResponse } from '../models/ActionHistoryRes';
+import { WorkListAttachViewComponent } from '../work-list-attach-view/work-list-attach-view.component';
+import { ApplyActionModalComponent } from '../apply-action-modal/apply-action-modal.component';
+import { POItemHistoryRes } from '../models/POItemHistoryRes';
+import { POItemHistoryRequest } from '../models/POItemHistoryReq';
+import { QuotationAnalysisResponse } from '../models/quotationAnalysisRes';
+import { QuotationAnalysisRequest } from '../models/quotationAnalysisReq';
+import { MoreActionModalComponent } from '../more-action-modal/more-action-modal.component'
+import { WorkListReplacementRollComponent } from '../work-list-replacement-roll/work-list-replacement-roll.component';
+import { WorkListRfcComponent } from '../work-list-rfc/work-list-rfc.component';
+import { DashboredService } from 'src/app/hmg-common/services/dashbored/dashbored.service';
+import { GetOpenNotificationsResponse } from 'src/app/hmg-common/services/dashbored/models/GetOpenNotificationsResponse';
+import { IonSlides } from '@ionic/angular';
+
+@Component({
+ selector: 'app-worklist-main-ic',
+ templateUrl: './worklist-main-ic.component.html',
+ styleUrls: ['./worklist-main-ic.component.scss'],
+})
+export class WorklistMainIcComponent implements OnInit {
+ @ViewChild('slides') slides: IonSlides;
+ private WorkListBodyObj: WorkListBodyRequest;
+ private WorkListButtonsObj: WorkListButtonRequest;
+ private WorkListActionObj: WorkListActionRequest;
+ private WorkListActionHistoryObj: WorkListActionHistoryRequest;
+ private WorkListAttachObj: WorkListButtonRequest;
+ private PRList: PRNotificatonBodyList;
+
+ public static PASS_NOTIFICATION_INFO = "passNotificationInfo";
+ public static PASS_PO_INFO = "passPOInfo";
+ public static PASS_PO_HEADER_ID = "passPOHeader";
+ public static PASS_ACTION_MODE = "passActionMode";
+ public static PASS_ACTION_MORE = "passActioMore";
+ public isPostNoLoad = true;
+ public worklistNotifications: any;
+ public totalRequestCount = 0;
+ getPassNotificationDetails: any;
+ public static PASS_RES_ATTR = "passResAttr";
+ TransactionID: number = -999;
+ notificationBodyRes: any = [];
+ actionHistoryRes: any = [];
+ notificationButtonRes: any;
+ actionMode: any;
+ pInformation: string = "";
+ pQuestion: string = "";
+ RespondAttributesListRes: any;
+ schemaNotific: any;
+ NotRespondAttributeList: any;
+ Resp2_val: any;
+ notExampleJsonObject: any;
+ hideForwordEmployee: any;
+ exampleJsonObject: any;
+ dataOfAttr: any;
+ P_RESPOND_ATTRIBUTES_TBL: any;
+ selEmployeeID: any;
+ actionType: string = "";
+ notificationArray: any;
+ notificationDynamicAttributeArr: any;
+ private textInput: TextInput;
+ private textArea: TextAreaInput;
+ notificationCount: any;
+ attachmentRes: any;
+ PRHeader: any;//change the tpye later
+ PRLines: any;//change the tpye later
+ IsReachEnd: boolean = true;
+ P_PAGE_NUM: number = 1;
+ P_PAGE_LIMIT: number = 100;
+ headerTotal: any;
+ totalH: any;
+ valueH: any;
+ taxH: any;
+ taxvalueH: any;
+ NotificationGetRespondAttributesList: any;
+ confirmMsg: string;
+ delMsg: string;
+ closeMsg: string;
+ POHeader: any;
+ POLines: any;
+ PO_NUMBER: any;
+ itemHistoryRes: any;
+ QutationAnalysisRes: any;
+ activeSegment: any = "line_details";
+ lines_note_limit: number = 19;
+ notiActionBtnMore: any = [];
+ demoeAttach: any = [];
+ orgNote: any;
+ truncating: boolean = true;
+ hidden: boolean = true;
+ selectedIndex = -1;
+ showLessBtn: boolean;
+ showMoreBtn: boolean = true;
+ selectedAction: any = [];
+ messageSuccess: boolean = false;
+ approveDis: boolean = false;
+ rejectDis: boolean = false;
+ requestDis: boolean = false;
+ moreDisabled: boolean = true;
+ direction: string;
+ defaultSegment = '';
+ approve_label: any;
+ reject_label: any;
+ reqInfo_label: any;
+ closeDis: boolean = false;
+ selectedFilter: string;
+ ;
+ close_label: any;
+
+ constructor(
+ public common: CommonService,
+ public ts: TranslatorService,
+ public worklistMainService: WorklistMainService,
+ public elementRef: ElementRef,
+ public menuService: MenuService,
+ public events: Events,
+ public worklistAttachService: WorklistAttachService,
+ private modalCtrl: ModalController,
+ public worklistService: WorklistService,
+ public dashboredService: DashboredService,
+
+ ) {
+ this.direction = TranslatorService.getCurrentLanguageName()
+ this.WorkListActionHistoryObj = new WorkListActionHistoryRequest();
+ this.WorkListActionHistoryObj.P_PAGE_NUM = 1;
+ this.WorkListActionHistoryObj.P_PAGE_LIMIT = this.P_PAGE_LIMIT;
+ }
+
+ ngOnInit() {
+ this.WorkListAttachObj = new WorkListButtonRequest();
+ this.selectedFilter = this.common.sharedService.getSharedData('selectedFilter', false);
+ this.intializeNotificationDetail();
+ }//ngOn
+
+
+ public segmentChanged(event: any) {
+ this.activeSegment = event.detail.value;
+ if (this.activeSegment === 'line_details') {
+ this.slides.slideTo(0);
+ }
+ else if (this.activeSegment === 'action-history') {
+ this.slides.slideTo(1);
+ }
+ else if (this.activeSegment === 'attach') {
+ this.slides.slideTo(2);
+ }
+ else if (this.activeSegment === 'info') {
+ this.slides.slideTo(3);
+ }
+ // console.log(" event.detail.value: " + event.detail.value);
+ }
+
+ public slideChanged(event: any) {
+ this.slides.getActiveIndex().then(index => {
+ // console.log(index);
+ // console.log(event);
+ if (index === 0) {
+ this.activeSegment = 'line_details';
+ }
+ else if (index === 1) {
+ this.activeSegment = 'action-history';
+ }
+ else if (index === 2) {
+ this.activeSegment = 'attach';
+ }
+ else if (index === 3) {
+ this.activeSegment = 'info';
+ }
+ // console.log(this.activeSegment);
+ });
+ }
+
+
+
+
+ intializeNotificationDetail() {
+ this.approveDis = false;
+ this.rejectDis = false;
+ this.requestDis = false;
+ this.closeDis = false;
+ this.moreDisabled = true;
+
+ if (this.messageSuccess) {
+ document.getElementById("notificationDynamicFieldsPO").innerHTML = "";
+ }
+ // console.log("intializeNotificationDetail");
+ this.getPassNotificationDetails = this.common.sharedService.getSharedData(
+ HomeComponent.NOTIFICATION_DATA,
+ false
+ );
+ // console.log(this.getPassNotificationDetails.ROW_NUM);
+ this.notificationArray = this.common.sharedService.getSharedData(
+ HomeComponent.NOTIFICATION_ARR,
+ false
+ );
+ this.WorkListBodyObj = new WorkListBodyRequest();
+ this.WorkListButtonsObj = new WorkListButtonRequest();
+
+ this.WorkListActionObj = new WorkListActionRequest();
+
+ this.WorkListBodyObj.P_TRANSACTION_ID = this.TransactionID;
+ this.WorkListBodyObj.P_NOTIFICATION_ID = this.getPassNotificationDetails.NOTIFICATION_ID;
+ this.WorkListBodyObj.P_PAGE_NUM = 1;
+ this.WorkListBodyObj.P_PAGE_LIMIT = this.P_PAGE_LIMIT;
+
+ this.WorkListButtonsObj.P_NOTIFICATION_ID = this.getPassNotificationDetails.NOTIFICATION_ID;
+
+ this.WorkListActionObj.P_NOTIFICATION_ID = this.getPassNotificationDetails.NOTIFICATION_ID;
+ this.WorkListActionObj.P_FORWARD_TO_USER_NAME = "";
+ this.WorkListActionObj.P_ACTION_MODE = "";
+ this.WorkListActionObj.P_COMMENTS = "";
+ this.WorkListActionObj.P_APPROVER_INDEX = null;
+
+ this.WorkListActionHistoryObj.P_PAGE_NUM = 1;
+ this.WorkListActionHistoryObj.P_PAGE_LIMIT = this.P_PAGE_LIMIT;
+ this.WorkListActionHistoryObj.P_NOTIFICATION_ID = this.getPassNotificationDetails.NOTIFICATION_ID;
+
+ this.WorkListAttachObj.P_NOTIFICATION_ID = this.getPassNotificationDetails.NOTIFICATION_ID;
+
+ this.getNotificationButtons(this.WorkListButtonsObj);
+ this.getNotificationResAttr(this.WorkListButtonsObj);
+ this.getActionHistory(this.WorkListActionHistoryObj);
+ this.getAttachmentNotification(this.WorkListAttachObj);
+
+
+ if (this.getPassNotificationDetails.REQUEST_TYPE == "ITEM_CREATION") {
+ this.getICNotificationDetails(this.WorkListBodyObj);
+ }
+ }
+
+ public segmentChanged1(event: any) {
+ this.activeSegment = event.detail.value;
+ // console.log(" event.detail.value: " + event.detail.value);
+ }
+
+ getICNotificationDetails(notificationBodyObj) {
+ this.worklistMainService
+ .getICNotificationBody(notificationBodyObj)
+ .subscribe((result: any) => {
+ // console.log(result.GetPoNotificationBodyList.POHeader[0].BUYER);
+ this.handleWorkListBodyResult(result, "IC");
+ });
+ }
+
+ handleWorkListBodyResult(result, Type) {
+ this.notificationBodyRes = [];
+ if (this.common.validResponse(result)) {
+ this.pInformation = result.P_INFORMATION;
+ this.pQuestion = result.P_QUESTION;
+ if (Type == "EIT") {
+ if (result.GetEITCollectionNotificationBodyList) {
+ this.notificationBodyRes =
+ result.GetEITCollectionNotificationBodyList;
+ }
+ } else if (Type == "ABSENCE") {
+ // console.log("ABSENCE");
+ if (result.GetAbsenceCollectionNotificationBodyList) {
+ this.notificationBodyRes =
+ result.GetAbsenceCollectionNotificationBodyList;
+ }
+ } else if (Type == "PR") {
+ if (result.GetPrNotificationBodyList) {
+ // console.log("PR");
+
+ this.PRHeader = result.GetPrNotificationBodyList.PRHeader;
+ this.PRLines = result.GetPrNotificationBodyList.PRLines;
+ for (var i = 0; i < this.PRHeader.length; i++) {
+ if (this.PRHeader[i].HDR_ATTRIBUTE_NAME === 'Requisition Total') {
+ this.totalH = this.PRHeader[i].HDR_ATTRIBUTE_NAME;
+ this.valueH = this.PRHeader[i].HDR_ATTRIBUTE_VALUE;
+
+ //this. header.HDR_ATTRIBUTE_NAME != 'Non-Recoverable Tax'"
+ }
+ if (this.PRHeader[i].HDR_ATTRIBUTE_NAME === 'Non-Recoverable Tax') {
+ this.taxH = this.PRHeader[i].HDR_ATTRIBUTE_NAME;
+ this.taxvalueH = this.PRHeader[i].HDR_ATTRIBUTE_VALUE;
+
+ }
+
+ // HDR_ATTRIBUTE_VALUE
+ }
+ this.notificationBodyRes =
+ result.GetPrNotificationBodyList;
+ }
+
+ } else if (Type == "PO") {
+ if (result.GetPoNotificationBodyList) {
+ // console.log("PO");
+
+ this.POHeader = result.GetPoNotificationBodyList.POHeader;
+ this.POLines = result.GetPoNotificationBodyList.POLines;
+ for (var i = 0; i < this.POHeader.length; i++) {
+ this.PO_NUMBER = this.POHeader[i].PO_NUMBER;
+
+ if (this.POHeader[i].HDR_ATTRIBUTE_NAME === 'Requisition Total') {
+ this.totalH = this.POHeader[i].HDR_ATTRIBUTE_NAME;
+ this.valueH = this.POHeader[i].HDR_ATTRIBUTE_VALUE;
+
+ //this. header.HDR_ATTRIBUTE_NAME != 'Non-Recoverable Tax'"
+ }
+ if (this.POHeader[i].HDR_ATTRIBUTE_NAME === 'Non-Recoverable Tax') {
+ this.taxH = this.POHeader[i].HDR_ATTRIBUTE_NAME;
+ this.taxvalueH = this.POHeader[i].HDR_ATTRIBUTE_VALUE;
+
+ }
+
+ // HDR_ATTRIBUTE_VALUE
+ }
+ this.notificationBodyRes =
+ result.GetPoNotificationBodyList;
+ }
+ } else if (Type == "IC") {
+ if (result.GetItemCreationNtfBodyList) {
+ this.POHeader = result.GetItemCreationNtfBodyList.ItemCreationHeader;
+ this.POLines = result.GetItemCreationNtfBodyList.ItemCreationLines;
+ for (var i = 0; i < this.POHeader.length; i++) {
+ this.PO_NUMBER = this.POHeader[i].PO_NUMBER;
+ if (this.POHeader[i].HDR_ATTRIBUTE_NAME === 'Requisition Total') {
+ this.totalH = this.POHeader[i].HDR_ATTRIBUTE_NAME;
+ this.valueH = this.POHeader[i].HDR_ATTRIBUTE_VALUE;
+
+ //this. header.HDR_ATTRIBUTE_NAME != 'Non-Recoverable Tax'"
+ }
+ if (this.POHeader[i].HDR_ATTRIBUTE_NAME === 'Non-Recoverable Tax') {
+ this.taxH = this.POHeader[i].HDR_ATTRIBUTE_NAME;
+ this.taxvalueH = this.POHeader[i].HDR_ATTRIBUTE_VALUE;
+
+ }
+
+ // HDR_ATTRIBUTE_VALUE
+ }
+ this.notificationBodyRes =
+ result.GetPoNotificationBodyList;
+ }
+ }//
+ }
+ } //End handleWorkListBodyResult
+
+
+
+
+ getNotificationButtons(notificationButtonsObj) {
+ this.worklistMainService
+ .getNotificationButtons(notificationButtonsObj)
+ .subscribe((result: NotificatonButtonResponse) => {
+ this.handleWorkListButtonsResult(result);
+ });
+ }
+
+ handleWorkListButtonsResult(result) {
+ if (this.common.validResponse(result)) {
+ this.notiActionBtnMore = []
+ // this.sharedData.setSharedData(result, WorKListResponse.SHARED_DATA);
+ if (result.GetNotificationButtonsList != null) {
+ this.notificationButtonRes = result.GetNotificationButtonsList;
+ this.common.sharedService.setSharedData(this.notificationButtonRes, "passActionMore");
+ // console.log("test" + this.notificationButtonRes.length);
+ for (let i = 0; i < this.notificationButtonRes.length; i++) {
+ if (this.notificationButtonRes[i].BUTTON_ACTION == "APPROVE") {
+ this.approve_label = this.notificationButtonRes[i].BUTTON_LABEL;
+
+ this.approveDis = true;
+ } else
+ if (this.notificationButtonRes[i].BUTTON_ACTION == "REJECT") {
+ this.reject_label = this.notificationButtonRes[i].BUTTON_LABEL;
+ this.rejectDis = true;
+ } else
+ if (this.notificationButtonRes[i].BUTTON_ACTION == "REQUEST_INFO") {
+ this.reqInfo_label = this.notificationButtonRes[i].BUTTON_LABEL;
+
+ this.requestDis = true;
+ } // if result == null
+ else if // if result == null
+ (this.notificationButtonRes[i].BUTTON_ACTION == "CLOSE") {
+ this.close_label = this.notificationButtonRes[i].BUTTON_LABEL;
+ this.closeDis = true;
+ }
+ else if (
+ this.notificationButtonRes[i].BUTTON_ACTION != "APPROVE" && this.notificationButtonRes[i].BUTTON_ACTION != "REJECT" && this.notificationButtonRes[i].BUTTON_ACTION != "REQUEST_INFO" && this.notificationButtonRes[i].BUTTON_ACTION != "CLOSE") {
+ this.moreDisabled = false;
+
+ }
+
+ } // valid it
+
+ } // valid it
+ } // End handleWorkListButtonsResult
+
+
+ }
+ applyAction(WorkListActionObj) {
+ // console.log("applyactio");
+ this.worklistMainService
+ .actionButton(WorkListActionObj)
+ .subscribe((result: any) => {
+ this.handleApplayActionResult(result);
+ });
+ }
+
+ handleApplayActionResult(result) {
+ if (this.common.validResponse(result)) {
+ // tslint:disable-next-line: triple-equals
+ if (result.MessageStatus == 1) {
+ this.common.sharedService.setSharedData(true, 'loadWorkList');
+ this.messageSuccess = true;
+ setTimeout(() => {
+ this.messageSuccess = false;
+ // this.openNotificationsDashboard();
+ this.nextNotfification();
+ }, 5000);
+ }
+ } // valid it
+ }
+
+ // public nextNotfification() {
+ // //let itemExist = false;
+ // let itemNo = this.getPassNotificationDetails.ROW_NUM;
+ // itemNo += 1;
+ // if (itemNo > this.notificationArray.length) {
+ // this.common.openNotificationPage();
+ // } else {
+ // for (let i = 0; i < this.notificationArray.length; i++) {
+ // if (this.notificationArray[i].ROW_NUM == itemNo) {
+ // this.common.sharedService.setSharedData(this.notificationArray[i], HomeComponent.NOTIFICATION_DATA);
+ // // itemExist = true;
+ // this.intializeNotificationDetail();
+ // break;
+ // }
+ // }
+ // // if(itemExist==false){
+ // // this.nextNotfification();
+ // // }
+ // }
+ // }
+
+ public nextNotfification() {
+ if (document.getElementById('notificationDynamicFieldsPO') != null) {
+ document.getElementById('notificationDynamicFieldsPO').innerHTML = '';
+ }
+
+ let itemNo = this.getPassNotificationDetails.ROW_NUM;
+ let index = this.notificationArray.findIndex(x => x.ROW_NUM === itemNo);
+ let previousRequest = this.notificationArray[index].REQUEST_TYPE;
+ let previousRequestType = this.notificationArray[index].ITEM_TYPE;
+ index += 1;
+
+ if (index < this.notificationArray.length) {
+ this.common.sharedService.setSharedData(this.notificationArray[index], HomeComponent.NOTIFICATION_DATA);
+ this.activeSegment = 'line_details';
+ if (this.selectedFilter === 'ALL') {
+ this.checkRequestType(index);
+ } else if (previousRequest === this.notificationArray[index].REQUEST_TYPE) {
+ this.checkRequestType(index);
+ } else {
+ this.common.openNotificationPage();
+ }
+ } else {
+ this.common.openNotificationPage();
+ }
+ }
+
+
+ checkRequestType(index) {
+ if (this.notificationArray[index].REQUEST_TYPE === 'PO') {
+ this.intializeNotificationDetail();
+ } else
+ if (this.notificationArray[index].REQUEST_TYPE === 'PR') {
+ this.common.openWorklistMainPRPage();
+ } else
+ if (this.notificationArray[index].REQUEST_TYPE === 'MO') {
+ this.common.openWorklistMainMRPage();
+ } else {
+ this.common.openWorklistMainPage();
+ }
+ }
+
+ actionButton(action) {
+
+ // console.log("actionButton" + action);
+ // alert("don't forget");
+ //let ButtonAction: string = this.actionType;
+ let ButtonAction: string = action;
+
+ var responseAttrDic = this.notExampleJsonObject;
+ this.P_RESPOND_ATTRIBUTES_TBL = [];
+ for (let i = 0; i < this.notificationDynamicAttributeArr.length; i++) {
+ let obj: any = {};
+ obj.ATTRIBUTE_NAME = this.notificationDynamicAttributeArr[i].ATTRIBUTE_NAME;
+ if (this.notificationDynamicAttributeArr[i].ATTRIBUTE_TYPE === "number") {
+ obj.ATTRIBUTE_NUMBER_VALUE = (document.getElementById(this.notificationDynamicAttributeArr[i].ATTRIBUTE_NAME) as HTMLInputElement).value;
+ }
+ // else if (isDate(responseAttrDic[key])) {
+ // obj.ATTRIBUTE_DATE_VALUE = responseAttrDic[key];
+ // }
+ else if (this.notificationDynamicAttributeArr[i].ATTRIBUTE_TYPE == "VARCHAR2") {
+ obj.ATTRIBUTE_TEXT_VALUE = (document.getElementById(this.notificationDynamicAttributeArr[i].ATTRIBUTE_NAME) as HTMLInputElement).value;
+ }
+ this.P_RESPOND_ATTRIBUTES_TBL.push(obj);
+ }
+ // console.log("a" + this.P_RESPOND_ATTRIBUTES_TBL);
+
+ let repUserName = this.selEmployeeID;
+ // if (this.hideForwordEmployee && this.hideForwordEmployee.ATTRIBUTE_NAME) {
+ // let obj: any = {};
+ // repUserName = "";
+ // obj.ATTRIBUTE_NAME = this.hideForwordEmployee.ATTRIBUTE_NAME;
+ // obj.ATTRIBUTE_TEXT_VALUE = this.selEmployeeID;
+ // this.P_RESPOND_ATTRIBUTES_TBL.push(obj);
+ // }
+
+ if (
+ ButtonAction == "APPROVE" ||
+ ButtonAction == "REJECT" ||
+ ButtonAction == "DEL" ||
+ ButtonAction == "CLOSE"
+ ) {
+ this.WorkListActionObj.P_FORWARD_TO_USER_NAME = "";
+ this.WorkListActionObj.P_ACTION_MODE = ButtonAction;
+ this.WorkListActionObj.P_COMMENTS = "";
+ this.WorkListActionObj.RespondAttributeList = this.P_RESPOND_ATTRIBUTES_TBL;
+
+ //sheardData
+
+ // this.common.sharedService.setSharedData(
+ // this.WorkListActionObj,
+ // WorklistMainPRComponent.PASS_NOTIFICATION_INFO
+ // );
+ if (ButtonAction == "APPROVE") {
+ this.confirmMsg = this.ts.trPK('worklistMain', 'approveMsg')
+ }
+ else if (ButtonAction == "REJECT") {
+ this.confirmMsg = this.ts.trPK('worklistMain', 'rejectMsg')
+
+ }
+ else if (ButtonAction == "DEL") {
+ this.confirmMsg = this.ts.trPK('worklistMain', 'delMsg')
+
+ }
+ else if (ButtonAction == "CLOSE") {
+ this.confirmMsg = this.ts.trPK('worklistMain', 'closeMsg')
+
+ }
+
+ this.common.confirmAlertDialogAction(
+ () => {
+ this.applyAction(this.WorkListActionObj);
+ }, this.ts.trPK('general', 'ok'),
+ () => { }, this.ts.trPK('general', 'cancel'),
+ this.ts.trPK('vacation-rule', 'confirmation'),
+ this.confirmMsg);
+
+
+
+
+
+ // alert.onDidDismiss((data) => {
+ // if (data == true) {
+ // this.continueDelete(attach);
+ // }
+ // });
+
+ //this.openApplyModal(this.WorkListActionObj);
+
+
+
+ ////////////this.applyAction(this.WorkListActionObj);
+ }
+
+ if (ButtonAction == "RFC") {
+ // alert("Return For Correction");
+ this.WorkListActionObj.P_ACTION_MODE = ButtonAction;
+ // this.navCtrl.push("WorkListRfcPage", {
+ // passNotificationInfo: this.getPassNotificationDetails,
+ // passActionMode: ButtonAction,
+ // passResAttr: this.P_RESPOND_ATTRIBUTES_TBL
+ // });
+ this.common.sharedService.setSharedData(
+ this.getPassNotificationDetails,
+ WorklistMainIcComponent.PASS_NOTIFICATION_INFO
+ );
+ this.common.sharedService.setSharedData(
+ ButtonAction,
+ WorklistMainIcComponent.PASS_ACTION_MODE
+ );
+ this.common.sharedService.setSharedData(
+ this.P_RESPOND_ATTRIBUTES_TBL,
+ WorklistMainIcComponent.PASS_RES_ATTR
+ );
+ //this.common.openWorklistRFCPage();
+ this.openRFCModal();
+ } else if (ButtonAction == "ANSWER_INFO") {
+ // this.navCtrl.push("WorkListReplacmentRollPage", {
+ // pQuestion: this.pQuestion,
+ // passNotificationInfo: this.getPassNotificationDetails,
+ // passActionMode: ButtonAction,
+ // passResAttr: this.P_RESPOND_ATTRIBUTES_TBL
+ // });
+ this.common.sharedService.setSharedData(this.pQuestion, "pQuestion");
+ this.common.sharedService.setSharedData(
+ this.getPassNotificationDetails,
+ WorklistMainIcComponent.PASS_NOTIFICATION_INFO
+ );
+ this.common.sharedService.setSharedData(
+ ButtonAction,
+ WorklistMainIcComponent.PASS_ACTION_MODE
+ );
+ this.common.sharedService.setSharedData(
+ this.P_RESPOND_ATTRIBUTES_TBL,
+ WorklistMainIcComponent.PASS_RES_ATTR
+ );
+ // console.log("c" + this.P_RESPOND_ATTRIBUTES_TBL);
+
+ // this.common.openWorklistRollReplacement();
+ this.openRepRolModal();
+ } else if (
+ ButtonAction == "DELEGATE" ||
+ ButtonAction == "REQUEST_INFO" ||
+ ButtonAction == "TRANSFER" ||
+ ButtonAction == "TRANSFER_INFO" ||
+ ButtonAction == "APPROVE_AND_FORWARD" ||
+ ButtonAction == "FORWARD"
+
+
+ ) {
+ // alert("multi option: "+ ButtonAction);
+ this.WorkListActionObj.P_ACTION_MODE = ButtonAction;
+ // this.navCtrl.push("WorkListReplacmentRollPage", {
+ // passNotificationInfo: this.getPassNotificationDetails,
+ // passActionMode: ButtonAction,
+ // passResAttr: this.P_RESPOND_ATTRIBUTES_TBL
+ // });
+ this.common.sharedService.setSharedData(
+ this.getPassNotificationDetails,
+ WorklistMainIcComponent.PASS_NOTIFICATION_INFO
+ );
+ this.common.sharedService.setSharedData(
+ ButtonAction,
+ WorklistMainIcComponent.PASS_ACTION_MODE
+ );
+ this.common.sharedService.setSharedData(
+ this.P_RESPOND_ATTRIBUTES_TBL,
+ WorklistMainIcComponent.PASS_RES_ATTR
+ );
+ // this.common.openWorklistRollReplacement();
+ this.openRepRolModal();
+ } else if (
+ ButtonAction == "UPDATE_ACTION" ||
+ ButtonAction == "CONTINUE_ACTION"
+ ) {
+ if (this.getPassNotificationDetails.REQUEST_TYPE == "EIT") {
+ this.common.sharedService.setSharedData(
+ this.notificationBodyRes,
+ EITNotificatonBodyResponse.SHARED_DATA
+ );
+ this.common.sharedService.setSharedData(
+ this.getPassNotificationDetails,
+ EITNotificatonBodyResponse.NOT_WORKLIST
+ );
+ // this.navCtrl.push("EitUpdateListPage");
+ } else if (this.getPassNotificationDetails.REQUEST_TYPE == "ABSENCE") {
+ this.common.sharedService.setSharedData(
+ this.notificationBodyRes,
+ AbsenceNotificatonBodyResponse.SHARED_DATA
+ );
+ this.common.sharedService.setSharedData(
+ this.getPassNotificationDetails,
+ AbsenceNotificatonBodyResponse.NOT_WORKLIST
+ );
+ // this.navCtrl.push("SubmitAbsencePage", {
+ // dirfromNotificationPage: true,
+ // submitAbsObjList: this.notificationBodyRes[0].Collection_Notification
+ // });
+ this.common.openConfirmAbsece();
+ }
+ }
+ else if (this.notificationButtonRes.length > 0 && !ButtonAction) {
+ (this.elementRef.nativeElement.querySelectorAll(
+ "ion-item"
+ ) as HTMLElement[]).forEach(x => {
+ if (x.classList.contains("requiredItem")) {
+ x.classList.add("ng-touched");
+ x.classList.remove("ng-untouched");
+ }
+ });
+ this.common.presentAlert(
+ this.ts.trPK("worklistMain", "actionRequird")
+ );
+ }
+ }
+
+ openActionHistory() {
+ // this.navCtrl.push("WorkListActionHistoryPage", {
+ // passNotificationInfo: this.getPassNotificationDetails
+ // });
+ this.common.sharedService.setSharedData(
+ this.getPassNotificationDetails,
+ WorklistMainIcComponent.PASS_NOTIFICATION_INFO
+ );
+ this.common.openWorklistHistoryPage();
+ }
+
+
+
+ openSupportDocuments() {
+ // this.navCtrl.push("WorkListAttachPage", {
+ // passNotificationInfo: this.getPassNotificationDetails
+ // });
+ this.common.sharedService.setSharedData(
+ this.getPassNotificationDetails,
+ WorklistMainIcComponent.PASS_NOTIFICATION_INFO
+ );
+ this.common.openWorklistAttachPage();
+ }
+
+ getNotificationResAttr(notificationButtonsObj) {
+ // console.log("getNotificationResAttr");
+ this.NotRespondAttributeList = [];
+
+ this.worklistMainService
+ .notificationResponseAttr(notificationButtonsObj)
+ .subscribe((result: NotificatonButtonResponse) => {
+ this.handleNotificationResAttrResult(result);
+ });
+ }
+
+ handleNotificationResAttrResult(result) {
+ if (this.common.validResponse(result)) {
+ // this.sharedData.setSharedData(result, WorKListResponse.SHARED_DATA);
+ this.NotRespondAttributeList =
+ result.NotificationGetRespondAttributesList;
+ if (
+ result.NotificationRespondRolesList != "" &&
+ result.NotificationRespondRolesList[0].ATTRIBUTE_NAME != null &&
+ result.NotificationRespondRolesList[0].ATTRIBUTE_NAME != undefined
+ ) {
+ this.Resp2_val = result.NotificationRespondRolesList[0].ATTRIBUTE_NAME;
+ this.hideForwordEmployee = result.NotificationRespondRolesList[0];
+ }
+ this.notificationDynamicFields(result.NotificationGetRespondAttributesList);
+ this.NotificationGetRespondAttributesList = result.NotificationGetRespondAttributesList;
+
+ this.common.sharedService.setSharedData(
+ this.NotificationGetRespondAttributesList,
+ WorklistMainIcComponent.PASS_RES_ATTR
+ );
+
+ this.notificationDynamicAttributeArr = result.NotificationGetRespondAttributesList;
+ if (result.P_Schema) this.schemaNotific = JSON.parse(result.P_Schema);
+ } // valid it
+ } // End handleWorkListButtonsResult
+
+ notificationDynamicFields(notificationAttr) {
+ const containerId = 'notificationDynamicFieldsPO';
+ for (let i = 0; i < notificationAttr.length; i++) {
+ if (notificationAttr[i].ATTRIBUTE_TYPE == "VARCHAR2") {
+ this.textArea = new TextAreaInput(notificationAttr[i].ATTRIBUTE_DISPLAY_NAME, notificationAttr[i].ATTRIBUTE_NAME, "", containerId, "", "", "");
+ // console.log(this.textArea);
+
+ } else if (notificationAttr[i].ATTRIBUTE_TYPE == "ROLE") {
+
+ } else if (notificationAttr[i].ATTRIBUTE_TYPE == "DATE") {
+
+ } else if (notificationAttr[i].ATTRIBUTE_TYPE == "NUMBER") {
+
+ }
+ }
+ }
+
+ openNotificationBody() {
+ if (this.getPassNotificationDetails.REQUEST_TYPE == "EIT") {
+ this.common.sharedService.setSharedData(
+ this.notificationBodyRes,
+ EITNotificatonBodyResponse.SHARED_DATA
+ );
+ this.common.sharedService.setSharedData(
+ this.getPassNotificationDetails,
+ EITNotificatonBodyResponse.NOT_WORKLIST
+ );
+ // this.navCtrl.push("WorkListDetailsPage", { NotBodyType: "EIT" });
+ this.common.sharedService.setSharedData("EIT", "NotBodyType");
+ this.common.openNotificationDetailsPage();
+ } else if (this.getPassNotificationDetails.REQUEST_TYPE == "ABSENCE") {
+ this.common.sharedService.setSharedData(
+ this.notificationBodyRes,
+ AbsenceNotificatonBodyResponse.SHARED_DATA
+ );
+ this.common.sharedService.setSharedData(
+ this.getPassNotificationDetails,
+ AbsenceNotificatonBodyResponse.NOT_WORKLIST
+ );
+ this.common.sharedService.setSharedData("ABSENCE", "NotBodyType");
+ //this.navCtrl.push("WorkListDetailsPage", { NotBodyType: "ABSENCE" });
+ this.common.openNotificationDetailsPage();
+ }
+ }
+
+ // getNotificationCountAfterSubmit() {
+ // const req: any = {};
+ // this.menuService.getNotificationCount(req).subscribe((result: any) => {
+ // if (this.common.validResponse(result)) {
+ // this.notificationCount =
+ // result.GetOpenNotificationsNumList.P_OPEN_NOTIFICATIONS_NUM;
+ // if (this.notificationCount <= 0) {
+ // this.notificationCount = null;
+ // }
+ // this.events.publish("getNotCount", this.notificationCount);
+ // }
+ // });
+ // }
+
+
+
+
+ getAttachmentNotification(WorkListAttachObj) {
+ this.attachmentRes = [];
+ this.worklistAttachService.getAttach(WorkListAttachObj).
+ subscribe((result: NotificationGetAttachResponse) => {
+ this.handleWorkListAttachResult(result);
+ });
+ }
+
+ handleWorkListAttachResult(result) {
+ if (this.common.validResponse(result)) {
+ // this.sharedData.setSharedData(result, WorKListResponse.SHARED_DATA);
+ if (result.GetAttachementList != null) {
+ this.attachmentRes = result.GetAttachementList;
+ } // if result == null
+ } // valid it
+ }
+
+ getActionHistory(WorkListActionHistoryObj) {
+ this.IsReachEnd = true;
+ this.actionHistoryRes = [];
+ this.worklistService.getActionHistory(WorkListActionHistoryObj).
+ subscribe((result: WorkListActionHistoryResponse) => {
+ this.handleWorkListActionHistoryResult(result);
+ });
+
+
+ }
+ handleWorkListActionHistoryResult(result) {
+ if (this.common.validResponse(result)) {
+ if (this.common.hasData(result.GetActionHistoryList)) {
+ this.actionHistoryRes = result.GetActionHistoryList;
+
+ this.P_PAGE_NUM++;
+ this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM;
+ let lastItemIndex = this.actionHistoryRes.length - 1;
+ if (result.GetActionHistoryList[lastItemIndex]) {
+ let lastitem = result.GetActionHistoryList[lastItemIndex];
+ if (lastitem.NO_OF_ROWS == lastitem.ROW_NUM) {
+ this.IsReachEnd = true;
+ } else {
+ this.IsReachEnd = false;
+ }
+ }
+ }
+ this.turnCateFun(this.actionHistoryRes);
+
+ }
+ }
+
+ async openNoteDetail(note, sender) {
+ // let modalPage = this.modalCtrl.create('ViewNoteModalPage', { textNote: note });
+ // modalPage.present();
+ // console.log("note" + note);
+
+ this.common.sharedService.setSharedData(note, 'ViewNoteModalPage')
+ this.common.sharedService.setSharedData(sender, 'ViewNoteModalPageSender')
+
+ const modal = await this.modalCtrl.create({
+ component: ViewNoteModalComponent,
+ backdropDismiss: false,
+
+ });
+ modal.cssClass = 'note-modal';
+
+ return await modal.present();
+ }
+
+ doInfinite(infiniteScroll) {
+ // console.log("doInfinite action history");
+ if (!this.IsReachEnd) {
+ this.worklistService.getActionHistory(this.WorkListActionHistoryObj).
+ subscribe((result: any) => {
+ if (this.common.validResponse(result)) {
+ if (result.GetActionHistoryList != undefined) {
+ this.P_PAGE_NUM++;
+ this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM;
+
+ (result.GetActionHistoryList).forEach(element => {
+ if (element.ROW_NUM == element.NO_OF_ROWS) {
+ this.IsReachEnd = true;
+ } else {
+ this.IsReachEnd = false;
+ }
+ this.actionHistoryRes.push(element);
+ }, (Error) => console.log(Error), () => infiniteScroll.target.complete());
+ }// if list length >0
+ else {
+ this.IsReachEnd = true;
+ }
+ }// if response == 1
+ //this.pageNum++;
+ infiniteScroll.target.complete();
+
+ });
+ } else {
+ if (infiniteScroll)
+ infiniteScroll.target.complete();
+ }
+ }//end infiniteScroll
+
+ //**********Attachment *****************//
+
+
+ async OpenAttachFiles(value, Type) {
+ // let modal: Modal = this.modalCtrl.create('WorkListAttachViewPage', { displayData: value, TypeData: Type });
+ // modal.present();
+
+ this.common.sharedService.setSharedData({ displayData: value, TypeData: Type }, 'WorkListAttachViewPage')
+ const modal = await this.modalCtrl.create({
+ component: WorkListAttachViewComponent
+ });
+
+ return await modal.present();
+ }
+
+ getItemHistory(itemID) {
+ // console.log(itemID);
+ this.IsReachEnd = false;
+ const request = new POItemHistoryRequest();
+ request.P_ITEM_ID = parseInt(itemID);
+ request.P_PAGE_LIMIT = 100;
+ request.P_PAGE_NUM = 1;
+ this.worklistMainService.getPOItemHistory(request).
+ subscribe((result: POItemHistoryRes) => {
+ // this.common.sharedService.setSharedData(
+ // result.GetItemHistoryList,
+ // WorklistMainIcComponent.ItemHistoryList
+ // );
+ this.common.sharedService.setSharedData(
+ itemID,
+ WorklistMainIcComponent.PASS_PO_INFO
+ );
+ //open page
+ // this.common.openItemHistoryPage();
+ this.handleItemHistoryResult(result);
+ });
+ }
+
+
+ handleItemHistoryResult(result) {
+ if (this.common.validResponse(result)) {
+ if (this.common.hasData(result.GetPoItemHistoryList)) {
+ this.common.openItemHistoryPage();
+
+ }
+ }
+ else {
+ this.common.presentAlert(
+ this.ts.trPK("general", "empty")
+ );
+ }
+
+ }
+
+ getQutationAnalysis(headerID, itemID) {
+ // console.log(itemID + headerID);
+ this.IsReachEnd = false;
+ const request = new QuotationAnalysisRequest();
+ request.P_ITEM_ID = parseInt(itemID);
+ request.P_PO_HEADER_ID = headerID;
+ request.P_PAGE_LIMIT = 100;
+ request.P_PAGE_NUM = 1;
+ this.worklistMainService.getQutationAnalysis(request).
+ subscribe((result: QuotationAnalysisResponse) => {
+ this.common.sharedService.setSharedData(
+ itemID,
+ WorklistMainIcComponent.PASS_PO_INFO
+ );
+ this.common.sharedService.setSharedData(
+ headerID,
+ WorklistMainIcComponent.PASS_PO_HEADER_ID
+ );
+ //open page
+
+ this.handleQutationAnalysisResult(result);
+ });
+
+
+ }
+ handleQutationAnalysisResult(result) {
+ if (this.common.validResponse(result)) {
+ if (this.common.hasData(result.GetQuotationAnalysisList)) {
+
+ //open page
+ //set sheard data
+ //
+
+ this.common.openQutationAnalysisPage();
+
+
+ // this.QutationAnalysisRes = result.GetQutationAnalysisList;
+ // this.P_PAGE_NUM++;
+ // let lastItemIndex = this.QutationAnalysisRes.length - 1;
+ // if (result.GetQutationAnalysisList[lastItemIndex]) {
+ // let lastitem = result.GetQutationAnalysisList[lastItemIndex];
+ // if (lastitem.NO_OF_ROWS == lastitem.ROW_NUM) {
+ // this.IsReachEnd = true;
+ // } else {
+ // this.IsReachEnd = false;
+ // }
+ // }
+ }//hasData
+ else {
+ this.common.presentAlert(
+ this.ts.trPK("general", "empty")
+ );
+ }
+
+ }
+ }
+
+ loadMoreNotificationBody() {
+ // console.log("loadMoreNotificationBody PO");
+ if (!this.IsReachEnd) {
+ // console.log("this.IsReachEnd" + this.IsReachEnd);
+
+ this.worklistMainService.getPONotificationBody(this.WorkListBodyObj).
+ subscribe((result: any) => {
+ if (this.common.validResponse(result)) {
+ if (result.GetPoNotificationBodyList != undefined) {
+ this.P_PAGE_NUM++;
+ this.WorkListBodyObj.P_PAGE_NUM = this.P_PAGE_NUM;
+ (result.GetPoNotificationBodyList).forEach(element => {
+ if (element.ROW_NUM == element.NO_OF_ROWS) {
+ this.IsReachEnd = true;
+ } else {
+ this.IsReachEnd = false;
+ }
+ this.notificationBodyRes.push(element);
+ }, (Error) => console.log(Error), () =>
+ //infiniteScroll.target.complete()
+ console.log("test")
+ );
+ }// if list length >0
+ else {
+ this.IsReachEnd = true;
+ }
+ }// if response == 1
+ //this.pageNum++;
+ // infiniteScroll.target.complete();
+
+ });
+ } else {
+ // if (infiniteScroll)
+ // infiniteScroll.target.complete();
+ }
+ }//end infiniteScroll
+
+ loadMoreActionHistory() {
+ console.log("doInfinite action history MR");
+
+ if (!this.IsReachEnd) {
+ this.worklistService.getActionHistory(this.WorkListActionHistoryObj).
+ subscribe((result: any) => {
+ if (this.common.validResponse(result)) {
+ if (result.GetActionHistoryList != undefined) {
+ this.P_PAGE_NUM++;
+ this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM;
+ (result.GetActionHistoryList).forEach(element => {
+ if (element.ROW_NUM == element.NO_OF_ROWS) {
+ this.IsReachEnd = true;
+ } else {
+ this.IsReachEnd = false;
+ }
+ this.actionHistoryRes.push(element);
+ }, (Error) => console.log(Error), () =>
+ //infiniteScroll.target.complete()
+ console.log("TEST"));
+ }// if list length >0
+ else {
+ this.IsReachEnd = true;
+ }
+ }// if response == 1
+ //this.pageNum++;
+ // infiniteScroll.target.complete();
+
+ });
+ } else {
+ //if (infiniteScroll)
+ //infiniteScroll.target.complete();
+ }
+ }//end infiniteScroll
+
+ async openMoreActions() {
+
+
+
+
+ const modal = await this.modalCtrl.create({
+ component: MoreActionModalComponent,
+ backdropDismiss: false,
+
+ });
+ modal.cssClass = 'note-modal';
+
+ modal.onDidDismiss()
+ .then((data) => {
+ console.log(data.data);
+
+ if (data.data == "cancel" || data.data == undefined) {
+ return;
+ } else {
+
+ // this.selectedAction = data.data;
+ this.actionType = data.data.BUTTON_ACTION;
+ console.log(this.actionType);
+ ///call Action button
+ this.actionButton(this.actionType);
+ }
+ });
+
+ return await modal.present();
+
+
+
+
+ }
+
+ ///////////////////////////////////////////
+
+ public checkLines(note) {
+ console.log(note.split("\n").length);
+ console.log(note.length);
+
+ if (note && note != null) {
+
+
+ return (note.length > this.lines_note_limit) ? true : false;
+
+
+
+ }
+
+
+
+ return false;
+ };
+
+
+ public turnCateFun(actionHis) {
+ for (let i = 0; i < actionHis.length; i++) {
+ actionHis[i].visible = false;
+
+ }
+ // actionHis.map((obj) => {
+ // obj.visible = false;
+ // // or via brackets
+ // // obj['total'] = 2;
+ // return obj;
+ // })
+ this.actionHistoryRes = actionHis;
+ console.log("test");
+ }
+
+ async openRepRolModal() {
+
+
+ this.common.sharedService.setSharedData(this.actionHistoryRes, 'actionHistoryData');
+
+ const modal = await this.modalCtrl.create({
+ component: WorkListReplacementRollComponent,
+ backdropDismiss: false,
+
+ });
+ modal.cssClass = 'replaceRoll-modal';
+
+ modal.onDidDismiss()
+ .then((data) => {
+ console.log(data.data);
+
+ if (data.data.data == "cancel" || data.data.data == undefined) {
+ return;
+ } else if (data.data.data == "Success") {
+ // this.openNotificationsDashboard();
+ this.messageSuccess = true;
+ setTimeout(() => {
+ this.messageSuccess = false;
+ this.nextNotfification();
+ }, 2000);
+ // this.nextNotfification();
+
+ }
+ });
+
+ return await modal.present();
+
+
+
+
+ }
+
+ async openRFCModal() {
+
+
+
+
+ const modal = await this.modalCtrl.create({
+ component: WorkListRfcComponent,
+ backdropDismiss: false,
+
+ });
+ modal.cssClass = 'replaceRoll-modal';
+
+ modal.onDidDismiss()
+ .then((data) => {
+ console.log(data.data);
+
+ if (data.data == "cancel" || data.data == undefined) {
+ return;
+ } else {
+
+
+ }
+ });
+
+ return await modal.present();
+
+
+
+
+ }
+
+ openNotificationsDashboard() {
+ this.dashboredService.getOpenNotifications('', '', this.isPostNoLoad).subscribe((result: GetOpenNotificationsResponse) => {
+ if (this.common.validResponse(result)) {
+ this.worklistNotifications = result;
+ this.totalRequestCount = this.worklistNotifications.P_OPEN_NTF_NUMBER;
+ this.common.sharedService.setSharedData(result, 'worklistNotifications');
+ }
+ });
+ }
+ openRequestInfoDel(userData, flag) {
+ this.common.sharedService.setSharedData(userData, 'requestInfoDelUser');
+ this.actionButton(flag);
+ }
+
+ returnDateTime(stringDate: string){
+ let allDateTime = stringDate.split(' ');
+ let time = allDateTime[1].split(':', 2);
+ let fullDate = this.transform(stringDate);
+ return fullDate + ' ' + time[0] + ':' + time[1] + ' ' + allDateTime[2];
+
+ }
+ locale = {
+ en: {
+ // month_names: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
+ month_names_short: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
+ }
+};
+ transform(value: string) {
+ let x = new Date(Date.parse(value));
+ //return value.toLowerCase();
+ let month = this.getMonthNameShort('en',x.getMonth())
+ return ""+ x.getDate()+" "+ month +" "+x.getFullYear();
+
+
+ }
+
+
+
+
+ getMonthNameShort(lang,month) {
+ lang = lang && (lang in this.locale) ? lang : 'en';
+ return this.locale[lang].month_names_short[month];
+};
+
+}
diff --git a/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.html b/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.html
index 56e1f721..59a8ead5 100644
--- a/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.html
+++ b/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.html
@@ -437,89 +437,79 @@
-
-
-
- 0">
-
{{ 'general, empty' | translate}}
-
- 0 ">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{actionHistory.NAME}}
-
-
-
-
-
- Note: {{actionHistory.NOTE}}
-
-
-
-
-
-
-
- Note: {{actionHistory.NOTE}}
-
-
-
-
{{
- actionHistory.visible ? 'Show less': 'Show More' }}
+
+
+ 0">
+
{{ 'general, empty' | translate}}
+
+ 0 ">
+
+
+
+
+
+
+
+
+
+
+
+ {{actionHistory.NAME}}
+
+
+
+
+
+ Note: {{actionHistory.NOTE}}
+
+
+
+
+
+
+
+ Note: {{actionHistory.NOTE}}
+
+
+
+
{{ actionHistory.visible ? 'Show less': 'Show More' }}
+
+
+
+ {{actionHistory.ACTION}}
+
+
+
+ {{returnDateTime(actionHistory.NOTIFICATION_DATE)}}
+
+
+
+
+
+
+
+
-
-
-
-
-
- {{actionHistory.ACTION}}
-
-
-
- {{actionHistory.NOTIFICATION_DATE| dateString }}
-
-
+
-
-
- {{ 'general,
- load-more' | translate}}
-
+
+ {{ 'general, load-more' | translate}}
+
-
+
-
-
-
+
+
diff --git a/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.scss b/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.scss
index b539fa22..424d9366 100644
--- a/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.scss
+++ b/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.scss
@@ -1,110 +1,3 @@
-// .itemHISBtn{
-// padding: 5px;
-// color: var(--light);
-// background: var(--darkgray);
-// border-radius: 3px;
-// width: 85%;
-// height: 40px;
-// }
-
-
-// .rowBtn{
-// display: flex;
-// flex-direction: row;
-// justify-content: center;
-// align-items: center;
-// background: white;
-// }
-
-
-
-// .rowBorder{
-// border-bottom: solid 0.03cm var(--grayBG);
-
-// }
-// .colBorder{
-// border-right: solid 0.03cm var(--grayBG);
-
-// }
-
-// .dateActionHistory{
-// text-align: end;
-// // margin-top: -25px;
-// }
-
-
-// .actionBtn{
-// --border-radius: 50% !important;
-// height: 55px;
-// width: 55px;
-// --background: var(--newgreen); // will be dynamic
-// background: transparent;
-// margin:10px;
-// }
-
-// .itemAttch{
-// border-radius: 11px;
-// margin: 8px;
-// --min-height: 60px;
-// --max-height: 60px;
-// }
-
-// .less {
-// max-height: 54px;
-// }
-
-// .noDataDiv{
-// background: #ffffff;
-// height: 11%;
-// text-align: center;
-// padding-top: 1px;
-// border-radius: 10px;
-// margin: 10px;
-// }
-
-// .container {
-// font-size: 14px;
-// line-height: 14px;
-// height: 15px;
-// overflow: hidden;
-// text-align: justify;
-// }
-
-// .show {
-// overflow: visible;
-// height: auto;
-// }
-
-// .showMore{
-// padding: 0px;
-// background: transparent;
-// color: blue;
-// text-decoration: underline;
-// font-size: 14px;
-// }
-// .succssfullMSG{
-// height: 100%;
-// width: 100%;
-// background: var(--newgreen);
-// color: white;
-// font-weight: bold;
-// font-size: 20px;
-// text-align: center;
-// vertical-align: middle;
-// padding-top: 30px;
-// }
-
-// .succssfullIcon{
-// width: 60%;
-// text-align: center;
-// height: 60%;
-// }
-// .subjectNotification{
-// text-align: center;
-// padding-top: 10px;
-// font-weight: bold;
-// }
-
.no-padding-label {
padding: 0px !important;
}
@@ -112,7 +5,30 @@
.margin-left {
margin-left: 0px;
}
-
+@media only screen and (max-width: 320px) {
+ .active-Segment {
+ font-size: 0.3cm !important;
+ background: #269DB8 !important;
+ text-transform: none;
+ --color-checked: none;
+ border-radius: 100px;
+ border:0;
+ }
+ .active-Segment ion-label{
+ font-size: 8px !important;
+ color: white !important;
+ }
+ .normal-Segment ion-label{
+ color: black;
+ font-size: 8px !important;
+ }
+ .normal-Segment {
+ font-size: 0.3cm;
+ text-transform: none;
+ --color-checked: none;
+ border: 0;
+ }
+}
.active-Segment {
font-size: 0.3cm !important;
background: #269DB8 !important;
@@ -139,4 +55,18 @@
.action-btn {
white-space: nowrap;
font-size: 10px;
+ }
+ .req_info{
+ width: 20px;
+ height: 20px;
+ display: inline-block;
+ margin: 15px 10px 0px 0px;
+ }
+ .name{
+ color:black !important ;font-weight: bold;
+ }
+ .timeline-item{
+ margin: 0;
+ white-space: nowrap;
+ font-size: 10px;
}
\ No newline at end of file
diff --git a/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.ts b/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.ts
index 180ef69d..c64765f5 100644
--- a/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.ts
+++ b/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.ts
@@ -94,7 +94,7 @@ export class WorklistMainMRComponent implements OnInit {
delMsg: string;
closeMsg: string;
activeSegment: any = 'info';
- lines_note_limit: any = 24;
+ lines_note_limit: any = 19;
orgNote: string;
truncating: boolean;
selectedIndex: any;
@@ -112,9 +112,9 @@ export class WorklistMainMRComponent implements OnInit {
public isPostNoLoad = true;
public worklistNotifications: any;
public totalRequestCount = 0;
- approve_label: any ="";
- reject_label: any="";
- reqInfo_label: any="";
+ approve_label: any = "";
+ reject_label: any = "";
+ reqInfo_label: any = "";
close_label: any;
closeDis: boolean = false;
selectedFilter: string;
@@ -142,47 +142,39 @@ export class WorklistMainMRComponent implements OnInit {
ngOnInit() {
this.WorkListAttachObj = new WorkListButtonRequest();
- this.selectedFilter = this.common.sharedService.getSharedData('selectedFilter', false);
+ this.selectedFilter = this.common.sharedService.getSharedData('selectedFilter', false);
this.intializeNotificationDetail();
}
public segmentChanged(event: any) {
this.activeSegment = event.detail.value;
- if(this.activeSegment === 'info')
- {
- this.slides.slideTo(0);
- }
- else if(this.activeSegment === 'item-req')
- {
- this.slides.slideTo(1);
- }
- else if(this.activeSegment === 'action-history')
- {
- this.slides.slideTo(2);
- }
- else if(this.activeSegment === 'attach')
- {
- this.slides.slideTo(3);
- }
+ if (this.activeSegment === 'info') {
+ this.slides.slideTo(0);
+ }
+ else if (this.activeSegment === 'item-req') {
+ this.slides.slideTo(1);
+ }
+ else if (this.activeSegment === 'action-history') {
+ this.slides.slideTo(2);
+ }
+ else if (this.activeSegment === 'attach') {
+ this.slides.slideTo(3);
+ }
}
public slideChanged(event: any) {
this.slides.getActiveIndex().then(index => {
- if(index === 0)
- {
+ if (index === 0) {
this.activeSegment = 'info';
}
- else if(index === 1)
- {
+ else if (index === 1) {
this.activeSegment = 'item-req';
}
- else if(index === 2)
- {
+ else if (index === 2) {
this.activeSegment = 'action-history';
}
- else if(index === 3)
- {
+ else if (index === 3) {
this.activeSegment = 'attach';
}
});
@@ -316,7 +308,7 @@ export class WorklistMainMRComponent implements OnInit {
getNotificationButtons(notificationButtonsObj) {
- this.notificationButtonRes=[];
+ this.notificationButtonRes = [];
this.worklistMainService
.getNotificationButtons(notificationButtonsObj)
.subscribe((result: NotificatonButtonResponse) => {
@@ -332,31 +324,30 @@ export class WorklistMainMRComponent implements OnInit {
this.common.sharedService.setSharedData(this.notificationButtonRes, 'passActionMore');
// console.log('test' + this.notificationButtonRes.length);
for (let i = 0; i < this.notificationButtonRes.length; i++) {
- if (this.notificationButtonRes[i].BUTTON_ACTION == "APPROVED" ) {
- this.approve_label=this.notificationButtonRes[i].BUTTON_LABEL;
-
+ if (this.notificationButtonRes[i].BUTTON_ACTION == "APPROVED") {
+ this.approve_label = this.notificationButtonRes[i].BUTTON_LABEL;
+
this.approveDis = true;
} else
- if (this.notificationButtonRes[i].BUTTON_ACTION == "REJECTED" ) {
- this.reject_label=this.notificationButtonRes[i].BUTTON_LABEL;
+ if (this.notificationButtonRes[i].BUTTON_ACTION == "REJECTED") {
+ this.reject_label = this.notificationButtonRes[i].BUTTON_LABEL;
this.rejectDis = true;
} else
if (this.notificationButtonRes[i].BUTTON_ACTION == 'REQUEST_INFO') {
- this.reqInfo_label=this.notificationButtonRes[i].BUTTON_LABEL;
+ this.reqInfo_label = this.notificationButtonRes[i].BUTTON_LABEL;
this.requestDis = true;
} // if result == null
else if // if result == null
- (this.notificationButtonRes[i].BUTTON_ACTION == "CLOSE") {
- this.close_label = this.notificationButtonRes[i].BUTTON_LABEL;
- this.closeDis = true;
- }
- else if(
- this.notificationButtonRes[i].BUTTON_ACTION != "APPROVED" && this.notificationButtonRes[i].BUTTON_ACTION != "REJECTED" && this.notificationButtonRes[i].BUTTON_ACTION != "REQUEST_INFO" && this.notificationButtonRes[i].BUTTON_ACTION != "CLOSE")
- {
- this.moreDisabled = false;
+ (this.notificationButtonRes[i].BUTTON_ACTION == "CLOSE") {
+ this.close_label = this.notificationButtonRes[i].BUTTON_LABEL;
+ this.closeDis = true;
+ }
+ else if (
+ this.notificationButtonRes[i].BUTTON_ACTION != "APPROVED" && this.notificationButtonRes[i].BUTTON_ACTION != "REJECTED" && this.notificationButtonRes[i].BUTTON_ACTION != "REQUEST_INFO" && this.notificationButtonRes[i].BUTTON_ACTION != "CLOSE") {
+ this.moreDisabled = false;
- }
+ }
} // valid it
@@ -413,10 +404,10 @@ export class WorklistMainMRComponent implements OnInit {
public nextNotfification() {
//let itemExist = false;
- if( document.getElementById("notificationDynamicFieldsMR") != null){
+ if (document.getElementById("notificationDynamicFieldsMR") != null) {
document.getElementById("notificationDynamicFieldsMR").innerHTML = "";
- }
+ }
let itemNo = this.getPassNotificationDetails.ROW_NUM;
let index = this.notificationArray.findIndex(x => x.ROW_NUM === itemNo);
let previousRequest = this.notificationArray[index].REQUEST_TYPE;
@@ -438,23 +429,23 @@ export class WorklistMainMRComponent implements OnInit {
}
}
- checkRequestType(index){
- if (this.notificationArray[index].REQUEST_TYPE === 'PO' ) {
+ checkRequestType(index) {
+ if (this.notificationArray[index].REQUEST_TYPE === 'PO') {
this.common.openWorklistMainPOPage();
} else
- if (this.notificationArray[index].REQUEST_TYPE === 'PR' ) {
- this.common.openWorklistMainPRPage();
- } else
- if (this.notificationArray[index].REQUEST_TYPE === 'MO' ) {
- this.intializeNotificationDetail();
- } else {
- this.common.openWorklistMainPage();
- }
+ if (this.notificationArray[index].REQUEST_TYPE === 'PR') {
+ this.common.openWorklistMainPRPage();
+ } else
+ if (this.notificationArray[index].REQUEST_TYPE === 'MO') {
+ this.intializeNotificationDetail();
+ } else {
+ this.common.openWorklistMainPage();
+ }
}
actionButton(action) {
// console.log('actionButton' + action);
- // alert("don't forget");
+ // alert("don't forget");
//let ButtonAction: string = this.actionType;
let ButtonAction: string = action;
var responseAttrDic = this.notExampleJsonObject;
@@ -514,7 +505,7 @@ export class WorklistMainMRComponent implements OnInit {
this.confirmMsg = this.ts.trPK('worklistMain', 'closeMsg')
}
- // this.openApplyModal(this.WorkListActionObj);
+ // this.openApplyModal(this.WorkListActionObj);
this.common.confirmAlertDialogAction(
() => {
@@ -682,7 +673,7 @@ export class WorklistMainMRComponent implements OnInit {
getNotificationResAttr(notificationButtonsObj) {
// console.log("getNotificationResAttr");
- this.NotRespondAttributeList=[];
+ this.NotRespondAttributeList = [];
this.worklistMainService
.notificationResponseAttr(notificationButtonsObj)
.subscribe((result: NotificatonButtonResponse) => {
@@ -779,7 +770,7 @@ export class WorklistMainMRComponent implements OnInit {
getAttachmentNotification(WorkListAttachObj) {
- this.attachmentRes=[];
+ this.attachmentRes = [];
this.worklistAttachService.getAttach(WorkListAttachObj).
subscribe((result: NotificationGetAttachResponse) => {
this.handleWorkListAttachResult(result);
@@ -797,7 +788,7 @@ export class WorklistMainMRComponent implements OnInit {
getActionHistory(WorkListActionHistoryObj) {
this.IsReachEnd = true;
- this.actionHistoryRes=[];
+ this.actionHistoryRes = [];
this.worklistService.getActionHistory(WorkListActionHistoryObj).
subscribe((result: WorkListActionHistoryResponse) => {
this.handleWorkListActionHistoryResult(result);
@@ -1105,7 +1096,7 @@ export class WorklistMainMRComponent implements OnInit {
async openReplacementRoll() {
-
+ this.common.sharedService.setSharedData(this.actionHistoryRes, 'actionHistoryData');
const modal = await this.modalCtrl.create({
component: WorkListReplacementRollComponent,
backdropDismiss: false,
@@ -1118,13 +1109,13 @@ export class WorklistMainMRComponent implements OnInit {
if (data.data.data == 'cancel' || data.data.data == undefined) {
return;
- } else if (data.data.data == 'Success') {
+ } else if (data.data.data == 'Success') {
// this.openNotificationsDashboard();
this.messageSuccess = true;
- setTimeout(() => {
- this.messageSuccess = false;
- this.nextNotfification();
- }, 2000);
+ setTimeout(() => {
+ this.messageSuccess = false;
+ this.nextNotfification();
+ }, 2000);
// this.nextNotfification();
}
@@ -1170,17 +1161,17 @@ export class WorklistMainMRComponent implements OnInit {
}
- getMOItemHistory(itemID ,orgID) {
+ getMOItemHistory(itemID, orgID) {
// console.log(itemID);
this.IsReachEnd = false;
const request = new MOItemHistoryReq();
request.P_ITEM_ID = parseInt(itemID);
request.P_PAGE_LIMIT = 100;
request.P_PAGE_NUM = 1;
- request.P_ORG_ID= parseInt(orgID);
-
+ request.P_ORG_ID = parseInt(orgID);
+
+
-
this.worklistMainService.getMOItemHistory(request).
subscribe((result: MOItemHistoryRes) => {
// this.common.sharedService.setSharedData(
@@ -1222,6 +1213,41 @@ export class WorklistMainMRComponent implements OnInit {
}
});
}
+ openRequestInfoDel(userData, flag) {
+ this.common.sharedService.setSharedData(userData, 'requestInfoDelUser');
+ this.actionButton(flag);
+ }
+
+ returnDateTime(stringDate: string){
+ let allDateTime = stringDate.split(' ');
+ let time = allDateTime[1].split(':', 2);
+ let fullDate = this.transform(stringDate);
+ return fullDate + ' ' + time[0] + ':' + time[1] + ' ' + allDateTime[2];
+
+ }
+ locale = {
+ en: {
+ // month_names: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
+ month_names_short: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
+ }
+};
+ transform(value: string) {
+ let x = new Date(Date.parse(value));
+ //return value.toLowerCase();
+ let month = this.getMonthNameShort('en',x.getMonth())
+ return ""+ x.getDate()+" "+ month +" "+x.getFullYear();
+
+
+ }
+
+
+
+
+ getMonthNameShort(lang,month) {
+ lang = lang && (lang in this.locale) ? lang : 'en';
+ return this.locale[lang].month_names_short[month];
+};
+
}
diff --git a/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.html b/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.html
index 02711308..37ba1670 100644
--- a/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.html
+++ b/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.html
@@ -170,6 +170,81 @@
+
+
+
+ 0">
+
{{ 'general, empty' | translate}}
+
+ 0 ">
+
+
+
+
+
+
+
+
+
+
+
+ {{actionHistory.NAME}}
+
+
+
+
+
+ Note: {{actionHistory.NOTE}}
+
+
+
+
+
+
+
+ Note: {{actionHistory.NOTE}}
+
+
+
+
{{ actionHistory.visible ? 'Show less': 'Show More' }}
+
+
+
+ {{actionHistory.ACTION}}
+
+
+
+ {{returnDateTime(actionHistory.NOTIFICATION_DATE)}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
0">
{{ 'general, notAttch' | translate}}
diff --git a/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.scss b/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.scss
index ffee0278..593f2549 100644
--- a/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.scss
+++ b/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.scss
@@ -1,112 +1,3 @@
-// .itemHISBtn{
-// padding: 5px;
-// color: var(--light);
-// background: var(--darkgray);
-// border-radius: 3px;
-// width: 85%;
-// height: 40px;
-// }
-
-
-// .rowBtn{
-// display: flex;
-// flex-direction: row;
-// justify-content: center;
-// align-items: center;
-// background: white;
-// }
-
-
-
-// .rowBorder{
-// border-bottom: solid 0.03cm var(--grayBG);
-
-// }
-// .colBorder{
-// border-right: solid 0.03cm var(--grayBG);
-
-// }
-
-// .dateActionHistory{
-// text-align: end;
-// // margin-top: -25px;
-// }
-
-
-// .actionBtn{
-// --border-radius: 50% !important;
-// height: 55px;
-// width: 55px;
-// --background: var(--newgreen); // will be dynamic
-// background: transparent;
-// margin:10px;
-// }
-
-// .itemAttch{
-// border-radius: 11px;
-// margin: 8px;
-// --min-height: 60px;
-// --max-height: 60px;
-// }
-
-// .less {
-// max-height: 54px;
-// }
-
-// .noDataDiv{
-// background: #ffffff;
-// height: 11%;
-// text-align: center;
-// padding-top: 1px;
-// border-radius: 10px;
-// margin: 10px;
-// }
-
-
-// .container {
-// font-size: 14px;
-// line-height: 14px;
-// height: 16px;
-// overflow: hidden;
-// text-align: justify;
-// }
-
-// .show {
-// overflow: visible;
-// height: auto;
-// }
-
-// .showMore{
-// padding: 0px;
-// background: transparent;
-// color: blue;
-// text-decoration: underline;
-// font-size: 14px;
-// }
-
-// .succssfullMSG{
-// height: 100%;
-// width: 100%;
-// background: var(--newgreen);
-// color: white;
-// font-weight: bold;
-// font-size: 20px;
-// text-align: center;
-// vertical-align: middle;
-// padding-top: 30px;
-// }
-
-// .succssfullIcon{
-// width: 60%;
-// text-align: center;
-// height: 60%;
-// }
-
-// .subjectNotification{
-// text-align: center;
-// padding-top: 10px;
-// font-weight: bold;
-// }
.no-padding-label {
padding: 0px !important;
@@ -116,7 +7,8 @@
margin-left: 0px;
}
-.active-Segment {
+@media only screen and (max-width: 320px) {
+ .active-Segment {
font-size: 0.3cm !important;
background: #269DB8 !important;
text-transform: none;
@@ -124,21 +16,62 @@
border-radius: 100px;
border:0;
}
+ .active-Segment ion-label{
+ font-size: 8px !important;
+ color: white !important;
+ }
+ .normal-Segment ion-label{
+ color: black;
+ font-size: 8px !important;
+ }
+ .normal-Segment {
+ font-size: 0.3cm;
+ text-transform: none;
+ --color-checked: none;
+ border: 0;
+ }
+}
+
+.active-Segment {
+ font-size: 0.3cm;
+ background: #269DB8 ;
+ text-transform: none;
+ --color-checked: none;
+ border-radius: 100px;
+ border:0;
+ }
.active-Segment ion-label{
font-size: 11px;
color: white !important;
}
.normal-Segment ion-label{
- color: black !important;
+ color: black;
font-size: 11px;
}
.normal-Segment {
- font-size: 0.3cm !important;
+ font-size: 0.3cm;
text-transform: none;
--color-checked: none;
border: 0;
}
+
+
.action-btn {
white-space: nowrap;
font-size: 10px;
- }
\ No newline at end of file
+ }
+ .name{
+ color:black !important ;font-weight: bold;
+ }
+ .timeline-item{
+ margin: 0;
+ white-space: nowrap;
+ font-size: 10px;
+ }
+ .req_info{
+ width: 20px;
+ height: 20px;
+ display: inline-block;
+ margin: 15px 10px 0px 0px;
+ }
+
\ No newline at end of file
diff --git a/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.ts b/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.ts
index a37979ef..844f3af6 100644
--- a/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.ts
+++ b/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.ts
@@ -107,7 +107,7 @@ export class WorklistMainPoComponent implements OnInit {
itemHistoryRes: any;
QutationAnalysisRes: any;
activeSegment: any = "line_details";
- lines_note_limit: number = 24;
+ lines_note_limit: number = 19;
notiActionBtnMore: any = [];
demoeAttach: any = [];
orgNote: any;
@@ -129,7 +129,7 @@ export class WorklistMainPoComponent implements OnInit {
reqInfo_label: any;
closeDis: boolean = false;
selectedFilter: string;
-;
+ ;
close_label: any;
constructor(
@@ -449,11 +449,11 @@ export class WorklistMainPoComponent implements OnInit {
if (index < this.notificationArray.length) {
this.common.sharedService.setSharedData(this.notificationArray[index], HomeComponent.NOTIFICATION_DATA);
this.activeSegment = 'line_details';
- if(this.selectedFilter === 'ALL'){
- this.checkRequestType(index);
+ if (this.selectedFilter === 'ALL') {
+ this.checkRequestType(index);
} else if (previousRequest === this.notificationArray[index].REQUEST_TYPE) {
this.checkRequestType(index);
- }else {
+ } else {
this.common.openNotificationPage();
}
} else {
@@ -462,7 +462,7 @@ export class WorklistMainPoComponent implements OnInit {
}
- checkRequestType(index){
+ checkRequestType(index) {
if (this.notificationArray[index].REQUEST_TYPE === 'PO') {
this.intializeNotificationDetail();
} else
@@ -1170,7 +1170,7 @@ export class WorklistMainPoComponent implements OnInit {
async openRepRolModal() {
-
+ this.common.sharedService.setSharedData(this.actionHistoryRes, 'actionHistoryData');
const modal = await this.modalCtrl.create({
component: WorkListReplacementRollComponent,
@@ -1245,5 +1245,38 @@ export class WorklistMainPoComponent implements OnInit {
});
}
+ openRequestInfoDel(userData, flag) {
+ this.common.sharedService.setSharedData(userData, 'requestInfoDelUser');
+ this.actionButton(flag);
+ }
+
+ returnDateTime(stringDate: string){
+ let allDateTime = stringDate.split(' ');
+ let time = allDateTime[1].split(':', 2);
+ let fullDate = this.transform(stringDate);
+ return fullDate + ' ' + time[0] + ':' + time[1] + ' ' + allDateTime[2];
+
+ }
+ locale = {
+ en: {
+ // month_names: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
+ month_names_short: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
+ }
+};
+ transform(value: string) {
+ let x = new Date(Date.parse(value));
+ //return value.toLowerCase();
+ let month = this.getMonthNameShort('en',x.getMonth())
+ return ""+ x.getDate()+" "+ month +" "+x.getFullYear();
+
+
+ }
+
+
+
+ getMonthNameShort(lang,month) {
+ lang = lang && (lang in this.locale) ? lang : 'en';
+ return this.locale[lang].month_names_short[month];
+};
}
diff --git a/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.html b/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.html
index b4f6cd3a..ccc730ee 100644
--- a/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.html
+++ b/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.html
@@ -199,44 +199,50 @@
-
+
+
+
0">
{{ 'general, empty' | translate}}
0 ">
-
-
-
+
+
+
-
+ src="../assets/imgs/profile.png">
-
-
+
+
{{actionHistory.NAME}}
-
-
-
-
- Note: {{actionHistory.NOTE}}
-
+
+
+
+
+ Note: {{actionHistory.NOTE}}
-
-
- Note: {{actionHistory.NOTE}}
-
-
{{
- actionHistory.visible ? 'Show less': 'Show More' }}
+
+
+
+
+
+
+ Note: {{actionHistory.NOTE}}
+
+
+
{{ actionHistory.visible ? 'Show less': 'Show More' }}
+
- {{actionHistory.NOTIFICATION_DATE| dateString }}
+ {{returnDateTime(actionHistory.NOTIFICATION_DATE)}}
+
+
+
+
+
+
-
- {{ 'general, load-more' | translate}}
+
+
+
-
-
+
+
diff --git a/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.scss b/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.scss
index c58a5c9b..a8895a39 100644
--- a/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.scss
+++ b/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.scss
@@ -1,109 +1,3 @@
-// .itemHISBtn{
-// padding: 5px;
-// color: var(--light);
-// background: var(--darkgray);
-// border-radius: 3px;
-// width: 85%;
-// height: 40px;
-// }
-
-
-// .rowBtn{
-// display: flex;
-// flex-direction: row;
-// justify-content: center;
-// align-items: center;
-// background: white;
-// }
-
-
-
-// .rowBorder{
-// border-bottom: solid 0.03cm var(--grayBG);
-
-// }
-// .colBorder{
-// border-right: solid 0.03cm var(--grayBG);
-
-// }
-
-// .dateActionHistory{
-// text-align: end;
-// // margin-top: -25px;
-// }
-
-
-// .actionBtn{
-// --border-radius: 50% !important;
-// height: 55px;
-// width: 55px;
-// --background: var(--newgreen); // will be dynamic
-// background: transparent;
-// margin:10px;
-// }
-
-// .itemAttch{
-// border-radius: 11px;
-// margin: 8px;
-// --min-height: 60px;
-// --max-height: 60px;
-// }
-
-// .less {
-// max-height: 54px;
-// }
-
-// .noDataDiv{
-// background: #ffffff;
-// height: 11%;
-// text-align: center;
-// padding-top: 1px;
-// border-radius: 10px;
-// margin: 10px;
-// }
-
-// .container {
-// font-size: 14px;
-// line-height: 14px;
-// height: 16px;
-// overflow: hidden;
-// text-align: justify;
-// }
-
-// .show {
-// overflow: visible;
-// height: auto;
-// }
-
-// .showMore{
-// padding: 0px;
-// background: transparent;
-// color: blue;
-// text-decoration: underline;
-// font-size: 14px;
-// }
-// .succssfullMSG{
-// height: 100%;
-// width: 100%;
-// background: var(--newgreen);
-// color: white;
-// font-weight: bold;
-// font-size: 20px;
-// text-align: center;
-// vertical-align: middle;
-// padding-top: 30px;
-// }
-
-// .succssfullIcon{
-// width: 60%;
-// text-align: center;
-// height: 60%;
-// }
-// .subjectNotification{
-// text-align: center;
-// padding-top: 10px;
-// font-weight: bold;
-// }
.no-padding-label {
padding: 0px !important;
@@ -139,4 +33,19 @@
// white-space: pre-wrap;
white-space: nowrap;
font-size: 10px;
- }
\ No newline at end of file
+ }
+
+.name{
+ color:black !important ;font-weight: bold;
+}
+.timeline-item{
+ margin: 0;
+ white-space: nowrap;
+ font-size: 10px;
+}
+.req_info{
+ width: 20px;
+ height: 20px;
+ display: inline-block;
+ margin:15px 10px 0px 0px;
+}
diff --git a/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.ts b/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.ts
index 7fa0f6d3..83f68c84 100644
--- a/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.ts
+++ b/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.ts
@@ -95,7 +95,7 @@ export class WorklistMainPRComponent implements OnInit {
closeMsg: string;
truncating: boolean;
orgNote: any;
- lines_note_limit: any = 24;
+ lines_note_limit: any = 19;
selectedIndex: any;
showLessBtn: boolean;
showMoreBtn: boolean;
@@ -146,22 +146,18 @@ export class WorklistMainPRComponent implements OnInit {
public segmentChanged(event: any) {
this.activeSegment = event.detail.value;
- if(this.activeSegment === 'info')
- {
- this.slides.slideTo(0);
- }
- else if(this.activeSegment === 'item-req')
- {
- this.slides.slideTo(1);
- }
- else if(this.activeSegment === 'action-history')
- {
- this.slides.slideTo(2);
- }
- else if(this.activeSegment === 'attach')
- {
- this.slides.slideTo(3);
- }
+ if (this.activeSegment === 'info') {
+ this.slides.slideTo(0);
+ }
+ else if (this.activeSegment === 'item-req') {
+ this.slides.slideTo(1);
+ }
+ else if (this.activeSegment === 'action-history') {
+ this.slides.slideTo(2);
+ }
+ else if (this.activeSegment === 'attach') {
+ this.slides.slideTo(3);
+ }
console.log(" event.detail.value: " + event.detail.value);
}
@@ -169,20 +165,16 @@ export class WorklistMainPRComponent implements OnInit {
this.slides.getActiveIndex().then(index => {
console.log(index);
console.log(event);
- if(index === 0)
- {
+ if (index === 0) {
this.activeSegment = 'info';
}
- else if(index === 1)
- {
+ else if (index === 1) {
this.activeSegment = 'item-req';
}
- else if(index === 2)
- {
+ else if (index === 2) {
this.activeSegment = 'action-history';
}
- else if(index === 3)
- {
+ else if (index === 3) {
this.activeSegment = 'attach';
}
console.log(this.activeSegment);
@@ -194,7 +186,7 @@ export class WorklistMainPRComponent implements OnInit {
this.approveDis = false;
this.rejectDis = false;
this.requestDis = false;
- this.closeDis =false;
+ this.closeDis = false;
this.moreDisabled = true;
if (this.messageSuccess) {
@@ -362,29 +354,28 @@ export class WorklistMainPRComponent implements OnInit {
console.log('test' + this.notificationButtonRes.length);
for (let i = 0; i < this.notificationButtonRes.length; i++) {
if (this.notificationButtonRes[i].BUTTON_ACTION == 'APPROVE') {
- this.approve_label=this.notificationButtonRes[i].BUTTON_LABEL;
+ this.approve_label = this.notificationButtonRes[i].BUTTON_LABEL;
this.approveDis = true;
} else
if (this.notificationButtonRes[i].BUTTON_ACTION == 'REJECT') {
- this.reject_label=this.notificationButtonRes[i].BUTTON_LABEL;
+ this.reject_label = this.notificationButtonRes[i].BUTTON_LABEL;
this.rejectDis = true;
} else
if (this.notificationButtonRes[i].BUTTON_ACTION == 'REQUEST_INFO') {
- this.reqInfo_label=this.notificationButtonRes[i].BUTTON_LABEL;
+ this.reqInfo_label = this.notificationButtonRes[i].BUTTON_LABEL;
this.requestDis = true;
} // if result == null
else if // if result == null
- (this.notificationButtonRes[i].BUTTON_ACTION == "CLOSE") {
- this.close_label = this.notificationButtonRes[i].BUTTON_LABEL;
- this.closeDis = true;
- }
+ (this.notificationButtonRes[i].BUTTON_ACTION == "CLOSE") {
+ this.close_label = this.notificationButtonRes[i].BUTTON_LABEL;
+ this.closeDis = true;
+ }
else if (
- this.notificationButtonRes[i].BUTTON_ACTION != "APPROVE" && this.notificationButtonRes[i].BUTTON_ACTION != "REJECT" && this.notificationButtonRes[i].BUTTON_ACTION != "REQUEST_INFO" && this.notificationButtonRes[i].BUTTON_ACTION != "CLOSE")
- {
- this.moreDisabled = false;
+ this.notificationButtonRes[i].BUTTON_ACTION != "APPROVE" && this.notificationButtonRes[i].BUTTON_ACTION != "REJECT" && this.notificationButtonRes[i].BUTTON_ACTION != "REQUEST_INFO" && this.notificationButtonRes[i].BUTTON_ACTION != "CLOSE") {
+ this.moreDisabled = false;
- }
+ }
} // valid it
}
} // valid it
@@ -438,11 +429,11 @@ export class WorklistMainPRComponent implements OnInit {
public nextNotfification() {
//let itemExist = false;
- if( document.getElementById("notificationDynamicFieldsPR") != null){
-
+ if (document.getElementById("notificationDynamicFieldsPR") != null) {
+
document.getElementById("notificationDynamicFieldsPR").innerHTML = "";
- }
+ }
let itemNo = this.getPassNotificationDetails.ROW_NUM;
console.log(itemNo);
let index = this.notificationArray.findIndex(x => x.ROW_NUM === itemNo);
@@ -454,31 +445,31 @@ export class WorklistMainPRComponent implements OnInit {
if (index < this.notificationArray.length) {
this.common.sharedService.setSharedData(this.notificationArray[index], HomeComponent.NOTIFICATION_DATA);
this.activeSegment = 'info';
- if(this.selectedFilter === 'ALL'){
+ if (this.selectedFilter === 'ALL') {
this.checkRequestType(index);
} else if (previousRequest === this.notificationArray[index].REQUEST_TYPE) {
this.checkRequestType(index);
- } else {
- this.common.openNotificationPage();
- }
+ } else {
+ this.common.openNotificationPage();
+ }
} else {
this.common.openNotificationPage();
}
}
- checkRequestType(index){
- if (this.notificationArray[index].REQUEST_TYPE === 'PO' ) {
+ checkRequestType(index) {
+ if (this.notificationArray[index].REQUEST_TYPE === 'PO') {
this.common.openWorklistMainPOPage();
} else
- if (this.notificationArray[index].REQUEST_TYPE === 'PR' ) {
- this.intializeNotificationDetail();
- } else
- if (this.notificationArray[index].REQUEST_TYPE === 'MO' ) {
- this.common.openWorklistMainMRPage();
- } else {
- this.common.openWorklistMainPage();
- }
+ if (this.notificationArray[index].REQUEST_TYPE === 'PR') {
+ this.intializeNotificationDetail();
+ } else
+ if (this.notificationArray[index].REQUEST_TYPE === 'MO') {
+ this.common.openWorklistMainMRPage();
+ } else {
+ this.common.openWorklistMainPage();
+ }
}
actionButton(action) {
@@ -755,7 +746,7 @@ export class WorklistMainPRComponent implements OnInit {
for (let i = 0; i < notificationAttr.length; i++) {
if (notificationAttr[i].ATTRIBUTE_TYPE == 'VARCHAR2') {
this.textArea = new TextAreaInput(notificationAttr[i].ATTRIBUTE_DISPLAY_NAME, notificationAttr[i].ATTRIBUTE_NAME, '', containerId, '', '', '');
- console.log(this.textArea );
+ console.log(this.textArea);
} else if (notificationAttr[i].ATTRIBUTE_TYPE == 'ROLE') {
@@ -1104,7 +1095,7 @@ export class WorklistMainPRComponent implements OnInit {
-
+ this.common.sharedService.setSharedData(this.actionHistoryRes, 'actionHistoryData');
const modal = await this.modalCtrl.create({
component: WorkListReplacementRollComponent,
backdropDismiss: false,
@@ -1176,5 +1167,38 @@ export class WorklistMainPRComponent implements OnInit {
}
});
}
+ openRequestInfoDel(userData, flag) {
+ this.common.sharedService.setSharedData(userData, 'requestInfoDelUser');
+ this.actionButton(flag);
+ }
+
+ returnDateTime(stringDate: string){
+ let allDateTime = stringDate.split(' ');
+ let time = allDateTime[1].split(':', 2);
+ let fullDate = this.transform(stringDate);
+ return fullDate + ' ' + time[0] + ':' + time[1] + ' ' + allDateTime[2];
+
+ }
+ locale = {
+ en: {
+ // month_names: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
+ month_names_short: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
+ }
+};
+ transform(value: string) {
+ let x = new Date(Date.parse(value));
+ //return value.toLowerCase();
+ let month = this.getMonthNameShort('en',x.getMonth())
+ return ""+ x.getDate()+" "+ month +" "+x.getFullYear();
+
+
+ }
+
+
+
+ getMonthNameShort(lang,month) {
+ lang = lang && (lang in this.locale) ? lang : 'en';
+ return this.locale[lang].month_names_short[month];
+};
}
\ No newline at end of file
diff --git a/Mohem/src/app/notification/worklist-main/worklist-main.component.html b/Mohem/src/app/notification/worklist-main/worklist-main.component.html
index b9a2af3f..7366e112 100644
--- a/Mohem/src/app/notification/worklist-main/worklist-main.component.html
+++ b/Mohem/src/app/notification/worklist-main/worklist-main.component.html
@@ -10,8 +10,7 @@
class="ion-segment-all">
-
+
{{'worklistMain, info'| translate}}
@@ -24,8 +23,9 @@
[ngClass]="activeSegment == 'action-history' ? 'active-Segment' : 'normal-Segment'">
{{'worklistMain, action' | translate}}
-
-
+
+
{{'worklistMain, attach-file' | translate}}
@@ -40,21 +40,24 @@
- {{pInformation}}
+ {{pInformation}}
+
0 ">
-
+
0">
- {{notificationBody.SEGMENT_PROMPT}}
+ *ngFor="let notificationBody of item.Collection_Notification;"
+ size="6" [hidden]="notificationBody.DISPLAY_FLAG == 'N'">
+ {{notificationBody.SEGMENT_PROMPT}}
{{notificationBody.SEGMENT_VALUE_DSP}}
@@ -65,41 +68,49 @@
0">
- {{ts.trPK('worklistMain','employee-on-leave')}}
+ {{ts.trPK('worklistMain','employee-on-leave')}}
-
-
+
-
-
+
- {{ts.trPK('worklistMain','from')}}
+
+ {{ts.trPK('worklistMain','from')}}
{{List.DATE_START |date}}
- {{ts.trPK('worklistMain','to')}}
+ {{ts.trPK('worklistMain','to')}}
{{List.DATE_END | date}}
@@ -107,181 +118,193 @@
-
+
-
-
-
-
-
-
-
-
-
- {{ts.trPK('worklistMain','from')}}
-
-
-
- {{getPassNotificationDetails.FROM_USER}}
-
-
- {{ts.trPK('worklistMain','to')}}
-
-
- {{getPassNotificationDetails.TO_USER}}
-
-
-
-
-
- {{ts.trPK('worklistMain','sent')}}
-
-
- {{getPassNotificationDetails.BEGIN_DATE}}
-
-
- {{ts.trPK('worklistMain','closed')}}
-
-
- {{getPassNotificationDetails.END_DATE}}
-
-
-
-
- {{ts.trPK('worklistMain','id')}}
-
-
- {{getPassNotificationDetails.NOTIFICATION_ID}}
-
-
- {{ts.trPK('worklistMain','responder')}}
-
-
- {{getPassNotificationDetails.RESPONDER}}
-
-
-
-
-
-
-
-
-
-
-
- 0 ">
-
-
-
- {{'userProfile, emp-detail' | translate}}
-
-
-
-
- {{'userProfile, empNo' | translate}}
-
- {{submitterInfo.EMPLOYEE_NUMBER}}
-
-
-
-
- {{'userProfile, name' | translate}}
-
- {{submitterInfo.EMPLOYEE_NAME}}
-
-
-
-
- {{'worklistMain, job-name' | translate}}
-
- {{submitterInfo.POSITION_NAME}}
-
-
-
-
- {{'userProfile, grade' | translate}}
-
- {{submitterInfo.GRADE_NAME}}
-
-
-
-
- {{'worklistMain, job_cate' | translate}}
-
- {{submitterInfo.JOB_NAME}}
-
-
-
-
- {{'worklistMain, category' | translate}}
-
- {{submitterInfo.EMPLOYMENT_CATEGORY_MEANING}}
-
-
-
-
- {{'worklistMain, emp-email' | translate}}
-
- {{submitterInfo.EMPLOYEE_EMAIL_ADDRESS}}
-
-
-
-
- {{'worklistMain, org-name' | translate}}
-
- {{submitterInfo.ORGANIZATION_NAME}}
-
-
-
-
-
- {{'worklistMain, loc-name' | translate}}
-
-
- {{submitterInfo.LOCATION_NAME}}
-
-
-
-
- {{'worklistMain, branch-payrol' | translate}}
-
-
- {{submitterInfo.PAYROLL_NAME}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+ {{ts.trPK('worklistMain','from')}}
+
+
+
+ {{getPassNotificationDetails.FROM_USER}}
+
+
+ {{ts.trPK('worklistMain','to')}}
+
+
+ {{getPassNotificationDetails.TO_USER}}
+
+
+
+
+
+ {{ts.trPK('worklistMain','sent')}}
+
+
+ {{getPassNotificationDetails.BEGIN_DATE}}
+
+
+ {{ts.trPK('worklistMain','closed')}}
+
+
+ {{getPassNotificationDetails.END_DATE}}
+
+
+
+
+ {{ts.trPK('worklistMain','id')}}
+
+
+ {{getPassNotificationDetails.NOTIFICATION_ID}}
+
+
+ {{ts.trPK('worklistMain','responder')}}
+
+
+ {{getPassNotificationDetails.RESPONDER}}
+
+
+
+
+
+
+
+
+
+
+
+ 0 ">
+
+
+
+ {{'userProfile, emp-detail' | translate}}
+
+
+
+
+ {{'userProfile, empNo' |
+ translate}}
+
+ {{submitterInfo.EMPLOYEE_NUMBER}}
+
+
+
+
+ {{'userProfile, name' |
+ translate}}
+
+ {{submitterInfo.EMPLOYEE_NAME}}
+
+
+
+
+ {{'worklistMain, job-name' |
+ translate}}
+
+ {{formatJobName(submitterInfo.POSITION_NAME)}}
+
+
+
+
+ {{'userProfile, grade' |
+ translate}}
+
+ {{submitterInfo.GRADE_NAME}}
+
+
+
+
+ {{'worklistMain, job_cate' |
+ translate}}
+
+ {{formatJobName(submitterInfo.POSITION_NAME)}}
+
+
+
+
+ {{'worklistMain, category' |
+ translate}}
+
+ {{submitterInfo.EMPLOYMENT_CATEGORY_MEANING}}
+
+
+
+
+ {{'worklistMain, emp-email' |
+ translate}}
+
+ {{submitterInfo.EMPLOYEE_EMAIL_ADDRESS}}
+
+
+
+
+
+
+
+ {{'worklistMain, branch-payrol' |
+ translate}}
+
+
+ {{submitterInfo.PAYROLL_NAME}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
0">
@@ -298,10 +321,11 @@
+ src="../assets/imgs/profile.png">
+
-
-
+
+
{{actionHistory.NAME}}
@@ -322,7 +346,8 @@
{{ actionHistory.visible ? 'Show less': 'Show More' }}
+ (click)="actionHistory.visible = !actionHistory.visible">{{
+ actionHistory.visible ? 'Show less': 'Show More' }}
@@ -333,7 +358,14 @@
- {{actionHistory.NOTIFICATION_DATE| dateString }}
+ {{returnDateTime(actionHistory.NOTIFICATION_DATE)}}
+
+
+
+
+
@@ -341,9 +373,9 @@
-
+
@@ -447,37 +479,37 @@
- {{approve_label}}
+ {{approve_label}}
- {{close_label}}
+ {{close_label}}
- {{reject_label}}
+ {{reject_label}}
- {{reqInfo_label}}
+ {{reqInfo_label}}
- {{'worklistMain, skip' | translate}}
+ {{'worklistMain, skip' | translate}}
- {{'worklistMain, more' | translate}}
+ {{'worklistMain, more' | translate}}
diff --git a/Mohem/src/app/notification/worklist-main/worklist-main.component.scss b/Mohem/src/app/notification/worklist-main/worklist-main.component.scss
index a9e8bbf9..a60545fb 100644
--- a/Mohem/src/app/notification/worklist-main/worklist-main.component.scss
+++ b/Mohem/src/app/notification/worklist-main/worklist-main.component.scss
@@ -95,12 +95,20 @@
}
.dateActionHistory{
- text-align: end;
- // margin-top: -25px;
- margin-top: -3px;
+ display: inline-block;
+ margin-left: 5px;
+ text-align: left;
+ }
+ .req_info{
+ width: 25px;
+ height: 25px;
+ display: inline-block;
+ margin: 0;
}
-
+ .deligate{
+ margin-left: 25px;
+ }
.actionBtn{
--border-radius: 50% !important;
height: 55px;
@@ -283,7 +291,12 @@ font-size: 14px;
padding-top: 10px;
font-weight: bold;
}
-
+.action-history ion-card-content{
+ padding:0;
+}
+ion-card.action-history {
+ margin:10px
+}
.submitterInfo{
padding-top: 10px;
padding-bottom: 10px;
@@ -330,6 +343,14 @@ ion-card{
border: 0;
}
.action-btn {
+ white-space: pre-wrap;
+ font-size: 11px;
+}
+.name{
+ color:black !important ;font-weight: bold;
+}
+.timeline-item{
+ margin: 0;
white-space: nowrap;
font-size: 10px;
}
\ No newline at end of file
diff --git a/Mohem/src/app/notification/worklist-main/worklist-main.component.ts b/Mohem/src/app/notification/worklist-main/worklist-main.component.ts
index d3642403..09c18a12 100644
--- a/Mohem/src/app/notification/worklist-main/worklist-main.component.ts
+++ b/Mohem/src/app/notification/worklist-main/worklist-main.component.ts
@@ -35,7 +35,7 @@ import { WorkListRfcComponent } from '../work-list-rfc/work-list-rfc.component';
import { ApplyActionModalComponent } from '../apply-action-modal/apply-action-modal.component';
import { GetOpenNotificationsResponse } from 'src/app/hmg-common/services/dashbored/models/GetOpenNotificationsResponse';
import { IonSlides } from '@ionic/angular';
-import { ActivatedRoute } from '@angular/router';
+import { ActivatedRoute } from '@angular/router';
@Component({
selector: "app-worklist-main",
@@ -78,7 +78,7 @@ export class WorklistMainComponent implements OnInit {
P_PAGE_LIMIT: number = 100;
notificationCount: any;
activeSegment: any = 'info';
- lines_note_limit: any = 24;
+ lines_note_limit: any = 19;
attachmentRes: any = [];
private WorkListActionHistoryObj: WorkListActionHistoryRequest;
IsReachEnd: boolean = true;
@@ -106,7 +106,7 @@ export class WorklistMainComponent implements OnInit {
close_label: any;
closeDis: boolean = false;
public selectedFilter: string;
- public arr_hr_req_only= [];
+ public arr_hr_req_only = [];
constructor(
public worklistService: WorklistService,
@@ -135,9 +135,9 @@ export class WorklistMainComponent implements OnInit {
}
- ngOnInit() {}
+ ngOnInit() { }
- ionAlwaysEnter(){
+ ionAlwaysEnter() {
this.selEmp = this.common.sharedService.getSharedData(
MenuResponse.SHARED_SEL_EMP,
false
@@ -217,7 +217,7 @@ export class WorklistMainComponent implements OnInit {
false
);
console.log(this.selectedFilter);
- if(this.selectedFilter === 'HRSSA') {
+ if (this.selectedFilter === 'HRSSA') {
this.arr_hr_req_only = [];
this.sortRequests();
}
@@ -464,19 +464,19 @@ export class WorklistMainComponent implements OnInit {
let previousRequest = this.notificationArray[index].REQUEST_TYPE;
index += 1;
- if(index < this.notificationArray.length){
+ if (index < this.notificationArray.length) {
this.activeSegment = 'info';
if (this.selectedFilter === 'ALL') {
this.common.sharedService.setSharedData(this.notificationArray[index], HomeComponent.NOTIFICATION_DATA);
this.checkRequestType(index);
} else {
- if(this.arr_hr_req_only){
+ if (this.arr_hr_req_only) {
let requestIndex = this.arr_hr_req_only.findIndex(x => x.ROW_NUM === itemNo);
requestIndex++;
- if(requestIndex < this.arr_hr_req_only.length){
+ if (requestIndex < this.arr_hr_req_only.length) {
this.common.sharedService.setSharedData(this.arr_hr_req_only[requestIndex], HomeComponent.NOTIFICATION_DATA);
this.intializeNotificationDetail();
- }else{
+ } else {
this.common.openNotificationPage();
}
}
@@ -503,7 +503,7 @@ export class WorklistMainComponent implements OnInit {
// }
}
- checkRequestType(index){
+ checkRequestType(index) {
if (this.notificationArray[index].REQUEST_TYPE === 'PO') {
this.common.openWorklistMainPOPage();
} else
@@ -868,6 +868,19 @@ export class WorklistMainComponent implements OnInit {
}
}
+ public formatJobName(title: any) {
+ let jobName: any;
+ if (title) {
+ let jobTitle = title.split('.');
+ if (jobTitle && jobTitle.length > 1) {
+ jobName = jobTitle[0] + " " + jobTitle[1];
+ }
+ } else {
+ jobName = '';
+ }
+ return jobName;
+ }
+
public checkLines(note) {
if (note && note != null) {
return (note.length > this.lines_note_limit) ? true : false;
@@ -880,6 +893,7 @@ export class WorklistMainComponent implements OnInit {
actionHis[i].visible = false;
}
this.actionHistoryRes = actionHis;
+
console.log("test");
}
@@ -965,11 +979,12 @@ export class WorklistMainComponent implements OnInit {
}// End handleWorkListButtonsResult
async openRepRolModal() {
+ this.common.sharedService.setSharedData(this.actionHistoryRes, 'actionHistoryData');
const modal = await this.modalCtrl.create({
component: WorkListReplacementRollComponent,
backdropDismiss: false,
});
- modal.cssClass = 'replaceRoll-modal';
+ modal.cssClass = 'replaceRoll-modal2';
modal.onDidDismiss()
.then((data) => {
if (data.data.data == "cancel" || data.data.data == undefined) {
@@ -1061,13 +1076,47 @@ export class WorklistMainComponent implements OnInit {
}
});
}
-
- sortRequests(){
- for(let i=0; i< this.notificationArray.length; i++){
- if(this.notificationArray[i].ITEM_TYPE === 'HRSSA'){
+ openRequestInfoDel(userData, flag) {
+ this.common.sharedService.setSharedData(userData, 'requestInfoDelUser');
+ this.actionButton(flag);
+ }
+ sortRequests() {
+ for (let i = 0; i < this.notificationArray.length; i++) {
+ if (this.notificationArray[i].ITEM_TYPE === 'HRSSA') {
this.arr_hr_req_only.push(this.notificationArray[i]);
}
}
console.log(this.arr_hr_req_only);
}
+
+ returnDateTime(stringDate: string){
+ let allDateTime = stringDate.split(' ');
+ let time = allDateTime[1].split(':', 2);
+ let fullDate = this.transform(stringDate);
+ return fullDate + ' ' + time[0] + ':' + time[1] + ' ' + allDateTime[2];
+
+ }
+ locale = {
+ en: {
+ // month_names: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
+ month_names_short: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
+ }
+};
+ transform(value: string) {
+ let x = new Date(Date.parse(value));
+ //return value.toLowerCase();
+ let month = this.getMonthNameShort('en',x.getMonth())
+ return ""+ x.getDate()+" "+ month +" "+x.getFullYear();
+
+
+ }
+
+
+
+
+ getMonthNameShort(lang,month) {
+ lang = lang && (lang in this.locale) ? lang : 'en';
+ return this.locale[lang].month_names_short[month];
+}
+
}
diff --git a/Mohem/src/app/offersdiscount/filter/filter.component.html b/Mohem/src/app/offersdiscount/filter/filter.component.html
new file mode 100644
index 00000000..f8391b3b
--- /dev/null
+++ b/Mohem/src/app/offersdiscount/filter/filter.component.html
@@ -0,0 +1,35 @@
+
+
+
+
+
+0">
+
+
+
+ {{key.categoryName_en}}
+
+
+ {{key.categoryName_ar}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Mohem/src/app/offersdiscount/filter/filter.component.scss b/Mohem/src/app/offersdiscount/filter/filter.component.scss
new file mode 100644
index 00000000..2375e2ef
--- /dev/null
+++ b/Mohem/src/app/offersdiscount/filter/filter.component.scss
@@ -0,0 +1,38 @@
+ion-label{
+ font-size: 14px !important;
+}
+ion-thumbnail img{
+ width: 40px;
+ height: 40px;
+ margin: 10px;
+}
+.active::before{
+ position: absolute;
+ right: 10px;
+ top: 15px;
+ padding: 0px;
+ background: #3cc353;
+ padding: 3px 2px 1px 3px;
+ border-radius: 60%;
+ font-size: 12px;
+ color: #fff;
+ content: '✓';
+ width: 20px;
+ height: 20px;
+ text-align: center;
+ z-index: 2;
+}
+ion-item{
+ border-bottom: 1px solid #ccc;
+ --padding-start: 0px;
+ margin: 0 20px 4px 20px;
+}
+
+.footer-button{
+ background: var(--newgreen)!important;border-radius: 10px; --background: transparent;
+ width: 80%;
+}
+ion-footer{
+ position: fixed;
+ bottom: 0;
+}
\ No newline at end of file
diff --git a/Mohem/src/app/offersdiscount/filter/filter.component.spec.ts b/Mohem/src/app/offersdiscount/filter/filter.component.spec.ts
new file mode 100644
index 00000000..ff6002ba
--- /dev/null
+++ b/Mohem/src/app/offersdiscount/filter/filter.component.spec.ts
@@ -0,0 +1,27 @@
+import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { FilterComponent } from './filter.component';
+
+describe('FilterComponent', () => {
+ let component: FilterComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ FilterComponent ],
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(FilterComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/Mohem/src/app/offersdiscount/filter/filter.component.ts b/Mohem/src/app/offersdiscount/filter/filter.component.ts
new file mode 100644
index 00000000..14c15353
--- /dev/null
+++ b/Mohem/src/app/offersdiscount/filter/filter.component.ts
@@ -0,0 +1,105 @@
+import { AfterViewInit, Component, OnInit } from '@angular/core';
+import { CommonService } from 'src/app/hmg-common/services/common/common.service';
+import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
+import { OfferDiscountService } from '../services/service';
+import { ModalController } from '@ionic/angular';
+@Component({
+ selector: 'app-filter',
+ templateUrl: './filter.component.html',
+ styleUrls: ['./filter.component.scss'],
+})
+export class FilterComponent implements AfterViewInit {
+
+ segment: any = '1';
+ categoriesObj: any;
+ categories: any = [];
+ offersData: any = [];
+ activeClass: any;
+ tempSearch: any = [];
+ searchText: String;
+ public activeKey = {}
+ direction: any;
+ constructor(public ts: TranslatorService, public modalController: ModalController, public cs: CommonService, public offersService: OfferDiscountService) { }
+
+ ngAfterViewInit(): void {
+ this.direction = TranslatorService.getCurrentDirection();
+ this.categories = this.cs.sharedService.getSharedData(OfferDiscountService.categories, false);
+
+
+ // this.getOfferDiscount();
+ }
+
+
+ openDetails(offer) {
+ this.cs.sharedService.setSharedData(offer, OfferDiscountService.selected_offers);
+
+ var related = this.offersData.filter((res) => res.rowID != offer.rowID);
+ this.cs.sharedService.setSharedData(related, OfferDiscountService.related_offers);
+
+ this.cs.navigateForward('/offersdiscount/offer-details');
+ }
+ // getOfferDiscount() {
+ // this.cs.startLoading();
+ // this.offersService.getOffers({}, () => { }, this.ts.trPK('general', 'retry')).subscribe((res) => {
+ // var data = JSON.parse(res['Mohemm_ITG_ResponseItem']);
+ // this.cs.stopLoading();
+ // if (data['result'])
+ // this.displayOffers(data['result']);
+ // });
+
+ // }
+ // displayOffers(data) {
+ // if (data['data']) {
+ // var parseJSON = data['data'];
+ // var offers = JSON.parse(parseJSON)
+ // this.categoriesObj = this.groupBy(offers, TranslatorService.getCurrentDirection() == 'ltr' ? 'categoryName_en' : 'categoryName_ar');
+ // // = Object.keys(this.categoriesObj);
+
+
+
+ // for (var x in this.categoriesObj) {
+ // for (var y in offers) {
+ // if (x == offers[y].categoryName_en && this.categories.filter(item => item.name.includes(x)) == false) {
+ // this.categories.push({
+ // name: x,
+ // icon: offers[y].icon
+ // })
+
+ // }
+ // }
+ // }
+
+ // this.filterOffers(this.categories[0]);
+ // }
+ // }
+ // groupBy(xs, key) {
+ // return xs.reduce((rv, x) => {
+
+ // (rv[x[key.trim()]] = rv[x[key]] || []).push(x);
+ // return rv
+ // }, {});
+ // };
+ filterOffers(key) {
+ this.activeKey = key
+ this.activeClass = key.categoryName_en;
+ // this.offersData = this.categoriesObj[key.name];
+ // this.tempSearch = JSON.parse(JSON.stringify(this.offersData));
+ }
+ checkDate(date) {
+ return new Date(date) >= new Date()
+ }
+ getDotted(temp) {
+ return temp.substring(0, 60) + " ...";
+ }
+ search(t) {
+ this.offersData = this.tempSearch.filter((post, index) => {
+ if (post.Title.toLowerCase().indexOf(t.toLowerCase()) > -1)
+ return true;
+ });
+
+ }
+ applyFilters() {
+ this.cs.sharedService.setSharedData(this.activeKey, OfferDiscountService.selected_filters);
+ this.cs.back();
+ }
+}
diff --git a/Mohem/src/app/offersdiscount/home/home.component.html b/Mohem/src/app/offersdiscount/home/home.component.html
new file mode 100644
index 00000000..9c5cadcf
--- /dev/null
+++ b/Mohem/src/app/offersdiscount/home/home.component.html
@@ -0,0 +1,108 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ts.trPK('itemforsale','browse-categories')}}
+
+
+
+
+
+
+
+
0">
+
+
+
+
+
+
+
+
+
{{key.categoryName_en}}
+
{{key.categoryName_ar}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item.Title}}
+ {{item.Title_AR}}
+
+
+
+
+
+
+ {{item.Discount}}
+
+
+
+ {{ts.trPK('general','offer-valid')}}
+
+
+ {{ts.trPK('general','expired')}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ts.trPK('general','empty')}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Mohem/src/app/offersdiscount/home/home.component.scss b/Mohem/src/app/offersdiscount/home/home.component.scss
new file mode 100644
index 00000000..46e5e3b4
--- /dev/null
+++ b/Mohem/src/app/offersdiscount/home/home.component.scss
@@ -0,0 +1,212 @@
+
+.header{
+
+ width: 100%;
+
+ position: absolute;
+ background: #259CB8;
+ top: 0;
+}
+.header-toolbar{
+ --background: #259CB8 !important;
+}
+.bottom{
+ height: 100%;
+ width: 100%;
+ position: absolute;
+ background: #F5F5F5;
+
+}
+
+.SearchtextBox{
+ margin: 10px;
+ --border-radius: 25px;
+}
+.filterText{
+ padding: 0 4px 10px 5px;
+ font-size: 16px;
+ font-weight: bold;
+ margin: 0px 10px;
+}
+.container-icon{
+ padding: 0 5px 10px;
+ position: relative;
+ white-space: nowrap;
+ overflow-x: auto;
+ margin: 0 10px;
+}
+
+.box-icon{
+ width: 90px;
+ margin: 0px;
+ display: inline-block;
+}
+.sale-icon{
+ box-shadow: 1px 1px 5px 1px #cccc;
+ padding: 5px;
+ margin: 5px;
+ border-radius: 10px;
+ background: #fff;
+ height: 80px;
+ position: relative;
+}
+.sale-icon ion-icon{
+ font-size: 25px;
+}
+.sale-icon p{
+ margin-top: 0px;
+ margin-bottom: 10px;
+ text-transform: capitalize;
+ font-size: 10px;
+ text-align: left;
+ line-height: 1;
+}
+.bottom-icon{
+ text-overflow: ellipsis;
+ white-space: normal;
+ font-size: 14px;
+ padding: 1px;
+ font-weight: bold;
+ position: absolute;
+ width: 70px;
+ bottom: 5px;
+}
+ion-card-header{
+ background: #fff;
+}
+// ion-card-header img{
+// margin: 15px auto;
+// border-radius: 6px;
+// max-height: 80px;
+// min-height: 50px;
+// }
+
+.header-img{
+ height: 120px;
+ width: 100%;
+ background-position: center;
+ background-size: contain;
+ background-repeat: no-repeat;
+ margin-top: 5px;
+}
+ion-card-title{
+ font-size: 14px;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ overflow: hidden;
+ margin: 5px;
+}
+.orange{
+ color: orange;
+}
+.green{
+ color:#1FA169;
+ font-weight: bold;
+}
+ion-segment-button ion-label{
+ padding: 0;
+ font-size: 12px;
+}
+.segment-button-checked ion-label{
+color: #fff !important;
+}
+.segment-button-checked{
+ background: rgb(46, 46, 46);
+}
+ion-item{
+ --background: #fff;
+ margin: 10px;
+ border-radius: 25px;
+ padding: 0px;
+}
+ion-item h3{
+ color: #000;
+ font-weight: bold;
+ font-size: 16px;
+}
+.grid-container{
+ margin: 10px;
+}
+.yellow{
+ color:#ffc107;
+}
+
+ion-item .icon{
+margin: 5px;
+}
+.edit{
+ margin-left:20px !important;
+}
+.offer-valid{
+ margin: 2px 0px 5px -3px;
+ font-size: 14px;
+ font-weight: bold;
+}
+.offers-title{
+ font-size: 14px;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ overflow: hidden;
+ margin-top: 20px;
+ font-weight: bold;
+
+ font-size: 14px !important;
+}
+.active .top::before{
+ position: absolute;
+ right: 0px;
+ top: 2px;
+ padding: 0px;
+ background: #3cc353;
+ padding: 2px 3px 4px 3px;
+ border-radius: 60%;
+ font-size: 10px;
+ color: #fff;
+ content: '✓';
+ width: 12px;
+ height: 12px;
+ text-align: center;
+}
+
+ion-content{
+ --background:#F5F5F5 ;
+}
+.top{
+ text-align: left;
+ position: relative;
+}
+.top img{
+ width: 35px;
+ height: 35px;
+ margin: 5px 5px 0px 5px;
+}
+.filter{
+ position: absolute;
+ right: 20px;
+}
+ion-card-content{
+ padding: 0 15px 0px 15px;
+}
+ion-card{
+ margin: 3px;
+ --background: #fff;
+ --border-radius: 53px;
+ border-radius: 10px;
+}
+.red{
+ color: #de1717;
+ font-weight: bold;
+ margin-left: -5px;
+}
+.arrow-icon{
+ margin-top: 0px;
+ font-size: 25px;
+ color: #0298df;
+}
+ion-card-content strong{
+ font-size: 14px;
+}
+.arrow-icon-offer-ar{
+ transform: rotate(180deg);
+}
+.arrow-icon-offer-en{}
\ No newline at end of file
diff --git a/Mohem/src/app/offersdiscount/home/home.component.spec.ts b/Mohem/src/app/offersdiscount/home/home.component.spec.ts
new file mode 100644
index 00000000..5ec1377b
--- /dev/null
+++ b/Mohem/src/app/offersdiscount/home/home.component.spec.ts
@@ -0,0 +1,27 @@
+import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { HomeComponent } from './home.component';
+
+describe('HomeComponent', () => {
+ let component: HomeComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ HomeComponent ],
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(HomeComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/Mohem/src/app/offersdiscount/home/home.component.ts b/Mohem/src/app/offersdiscount/home/home.component.ts
new file mode 100644
index 00000000..b73c910c
--- /dev/null
+++ b/Mohem/src/app/offersdiscount/home/home.component.ts
@@ -0,0 +1,205 @@
+import { AfterViewInit, Component, ViewChild } from '@angular/core';
+import { ActivatedRoute } from '@angular/router';
+import { ModalController } from '@ionic/angular';
+import { CommonService } from 'src/app/hmg-common/services/common/common.service';
+import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
+import { OfferDiscountService } from '../services/service';
+import { IonInfiniteScroll } from '@ionic/angular';
+import { DomSanitizer} from '@angular/platform-browser';
+@Component({
+ selector: 'app-home',
+ templateUrl: './home.component.html',
+ styleUrls: ['./home.component.scss'],
+})
+export class HomeComponent implements AfterViewInit {
+
+ @ViewChild(IonInfiniteScroll) infiniteScroll: IonInfiniteScroll;
+
+ segment: any = '1';
+ categoriesObj: any;
+ categories: any = [];
+ offersData: any = [];
+ activeClass: any;
+ tempSearch: any = [];
+ searchText: String;
+ direction: any;
+ itemCounter = 1;
+ itemType: any;
+ isData = true;
+ // categories:any = [];
+ constructor(
+ public ts: TranslatorService,
+ public modalController: ModalController,
+ public cs: CommonService,
+ public offersService: OfferDiscountService,
+ public route: ActivatedRoute,
+ private sanitizer: DomSanitizer) {
+
+ this.route
+ .params.subscribe(val => {
+ setTimeout(() => {
+ this.ionEnter();
+ }, 100);
+ });
+ }
+
+ ngAfterViewInit(): void {
+ this.getOfferDiscount();
+ }
+
+ ionEnter() {
+ this.direction = TranslatorService.getCurrentDirection();
+ console.log(this.direction);
+ let activeClass = this.cs.sharedService.getSharedData(OfferDiscountService.selected_filters);
+
+ if (activeClass) {
+ this.filterOffers(activeClass);
+ } else {
+ this.getCategories();
+ this.tempSearch = JSON.parse(JSON.stringify(this.offersData));
+ }
+ }
+ getCategories() {
+ this.offersService.getCategories({}).subscribe((result) => {
+ this.categories = JSON.parse(result.Mohemm_ITG_ResponseItem).result.data; //result.result.data;
+ for (let i = 0; i < this.categories.length; i++) {
+ this.categories[i].content = this.sanitizer.bypassSecurityTrustHtml(this.categories[i].content);
+ }
+ this.cs.sharedService.setSharedData(this.categories, OfferDiscountService.categories);
+ });
+ }
+ openDetails(offer) {
+ this.cs.sharedService.setSharedData(offer, OfferDiscountService.selected_offers);
+
+ var related = this.offersData.filter((res) => res.rowID != offer.rowID);
+ this.cs.sharedService.setSharedData(related, OfferDiscountService.related_offers);
+
+ this.cs.navigateForward('/offersdiscount/offer-details');
+ }
+
+ getOfferDiscount(pageNo?, categoryId?) {
+ this.cs.startLoading();
+ if (categoryId) {
+ this.offersService.getOffers({}, () => { }, this.ts.trPK('general', 'retry'),pageNo, categoryId).subscribe((res) => {
+ var data = JSON.parse(res['Mohemm_ITG_ResponseItem']);
+ this.cs.stopLoading();
+ if (data['result']) {
+ this.displayOffers(data['result']);
+ this.isData = true;
+ }else{
+ this.isData = false;
+ }
+ });
+ } else {
+ this.offersService.getOffers({}, () => { }, this.ts.trPK('general', 'retry')).subscribe((res) => {
+ var data = JSON.parse(res['Mohemm_ITG_ResponseItem']);
+ this.cs.stopLoading();
+ if (data['result']){
+ this.displayOffers(data['result']);
+ this.isData = true;
+ } else{this.isData = false;}
+ });
+ }
+
+ }
+
+ displayOffers(data) {
+ if (data['data']) {
+ var parseJSON = data['data'];
+ var offers = JSON.parse(parseJSON);
+ this.offersData = offers;
+ this.tempSearch = this.offersData;
+ }
+ }
+
+ filterOffers(key) {
+ if(this.direction === 'ltr') {
+ this.activeClass = key.categoryName_en;
+ }else {
+ this.activeClass = key.categoryName_ar
+ }
+ this.itemType = key.id;
+ this.getOfferDiscount(1,this.itemType)
+ }
+
+ checkDate(date) {
+ return new Date(date) >= new Date()
+ }
+
+ getDotted(temp) {
+ temp = this.stripHtml(temp);
+ return temp.substring(0, 70) + " ...";
+ }
+
+ stripHtml(html) {
+ var temporalDivElement = document.createElement("div");
+
+ temporalDivElement.innerHTML = html;
+
+ return temporalDivElement.textContent || temporalDivElement.innerText || "";
+ }
+
+
+ search(t) {
+ console.log(this.tempSearch);
+ if(t === ''){
+ this.offersData = this.tempSearch;
+ } else{
+ this.offersData = this.tempSearch.filter((post) => {
+ return (post.Title.toLowerCase().indexOf(t.toLowerCase()) > -1);
+ });
+ }
+
+ }
+
+ async openModel() {
+ // const modal = await this.modalController.create({
+ // component: FilterComponent,
+
+ // });
+ // modal.cssClass = "filter-modal"
+ // modal.present();
+ this.cs.navigateForward('/offersdiscount/filter-page');
+ }
+
+ loadData(event) {
+ const counter = 1;
+ this.itemCounter += counter;
+ console.log(this.itemType);
+ if (this.itemType) {
+ setTimeout(() => {
+ event.target.complete();
+ console.log(this.itemCounter);
+ this.offersService.getOffers({}, () => { }, this.ts.trPK('general', 'retry'), this.itemCounter, this.itemType).subscribe((res) => {
+ const data = JSON.parse(res['Mohemm_ITG_ResponseItem']);
+ if (data['result']){
+ const allItem = JSON.parse(data.result['data']);
+ if (allItem) {
+ allItem.forEach(element => {
+ this.offersData.push(element);
+ });
+ }
+ }
+ });
+ // event.target.disabled = true;
+ }, 1000);
+ } else {
+ setTimeout(() => {
+ event.target.complete();
+ console.log(this.itemCounter);
+ this.offersService.getOffers({}, () => { }, this.ts.trPK('general', 'retry'), this.itemCounter).subscribe((res) => {
+ const data = JSON.parse(res['Mohemm_ITG_ResponseItem']);
+ if (data['result']){
+ const allItem = JSON.parse(data.result['data']);
+ if (allItem) {
+ allItem.forEach(element => {
+ this.offersData.push(element);
+ });
+ }
+ }
+ });
+ // event.target.disabled = true;
+ }, 1000);
+ }
+ }
+}
diff --git a/Mohem/src/app/offersdiscount/offer-details/offer-details.component.html b/Mohem/src/app/offersdiscount/offer-details/offer-details.component.html
new file mode 100644
index 00000000..f3a127c8
--- /dev/null
+++ b/Mohem/src/app/offersdiscount/offer-details/offer-details.component.html
@@ -0,0 +1,93 @@
+
+
+
+
+
+
+
+
+
+
+
+ {{details.Title}}
+ {{details.Title_AR}}
+
+
+
+
+
+
+
+
+ {{ts.trPK('general','offer-valid')}}
+
+
+ {{ts.trPK('general','expired')}}
+
+
+
+
+
+
+
+ {{details.Discount}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ts.trPK('itemforsale','related-offers')}}
+
+
+
+
+
+
+
+
+
+ {{item.Title}}
+
+
+
+
+
+ {{item.Discount}}
+
+
+
+
+ {{ts.trPK('general','offer-valid')}}
+
+
+ {{ts.trPK('general','expired')}}
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Mohem/src/app/offersdiscount/offer-details/offer-details.component.scss b/Mohem/src/app/offersdiscount/offer-details/offer-details.component.scss
new file mode 100644
index 00000000..b487cc9b
--- /dev/null
+++ b/Mohem/src/app/offersdiscount/offer-details/offer-details.component.scss
@@ -0,0 +1,147 @@
+.header{
+ height: 20%;
+ width: 100%;
+
+ position: absolute;
+ background: #259CB8;
+ top: 0;
+}
+.header-toolbar{
+ --background: #259CB8 !important;
+}
+.bottom{
+ height: 88%;
+ width: 100%;
+ position: absolute;
+ background: #F5F5F5;
+ top: 20%;
+}
+ion-card-header{
+ background-color: #fff;
+ padding: 10px 10px 1px 10px !important;
+}
+
+ ion-card-header img{
+ height: 170px;
+}
+.related-offers-container ion-card-header img{
+ margin: 15px auto;
+ border-radius: 6px;
+ max-height: 80px;
+ min-height: 50px;
+}
+.content-bottom{
+ padding: 0px 0px 10px;
+}
+.green{
+ color:green;
+ font-weight: bold;
+}
+.content-bottom h1{
+ font-size: 14px;
+ margin-top: -5px;
+ font-weight: bold;
+}
+.details-button ion-button{
+ --background: #565656;
+}
+ion-card-title{
+ margin: 15px 0px 0px 5px;
+ font-size: 22px;
+}
+ion-card-content{
+ padding-top:0px;
+}
+ion-card-content strong{
+ font-size: 14px;
+}
+ion-card-content p{
+ font-size: 11px;
+}
+.red{
+ color:rgb(172, 9, 9);
+ margin-left: -5px;
+}
+.green{
+ color:#00AE4D;
+}
+.related-card{
+ margin:5px;
+}
+.related-card ion-card-title{
+ font-size: 14px;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ overflow: hidden;
+ margin: 5px;
+}
+.related-offers{
+ position: relative;
+ margin-left: 20px;
+ font-size: 18px;
+}
+.description{
+ height: 30px;
+ overflow: hidden;
+ font-size: 11px;
+}
+ion-card{
+ margin: 20px;
+}
+ion-card-content{
+ padding: 0 15px 0px 15px;
+}
+ion-card{
+
+ --background: #fff;
+ --border-radius: 53px;
+ border-radius: 10px;
+}
+.offers-title{
+ font-size: 14px;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ overflow: hidden;
+ margin-top: 20px;
+ font-weight: bold;
+
+ font-size: 14px !important;
+}
+.red{
+ color: #de1717;
+ font-weight: bold;
+ margin-left: -5px;
+}
+.arrow-icon{
+ margin-top: 0px;
+ font-size: 25px;
+ color: #0298df;
+}
+.share-icon{
+ font-size: 25px;
+ position: absolute;
+ bottom: 6px;
+}
+.header-img{
+ height: 120px;
+ width: 100%;
+ background-position: center;
+ background-size: contain;
+ background-repeat: no-repeat;
+ margin-top: 5px;
+}
+.related-offers-container{
+ margin: 10px;
+}
+.header-img-main{
+ height: 170px;
+ width: 100%;
+ background-position: center;
+ background-size: contain;
+ background-repeat: no-repeat;
+}
+.offer-valid{
+ margin: 2px 0px 5px -3px;
+ font-size: 14px;
+ font-weight: bold;
+}
\ No newline at end of file
diff --git a/Mohem/src/app/offersdiscount/offer-details/offer-details.component.spec.ts b/Mohem/src/app/offersdiscount/offer-details/offer-details.component.spec.ts
new file mode 100644
index 00000000..7f2aaf24
--- /dev/null
+++ b/Mohem/src/app/offersdiscount/offer-details/offer-details.component.spec.ts
@@ -0,0 +1,27 @@
+import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { OfferDetailsComponent } from './offer-details.component';
+
+describe('OfferDetailsComponent', () => {
+ let component: OfferDetailsComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ OfferDetailsComponent ],
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(OfferDetailsComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/Mohem/src/app/offersdiscount/offer-details/offer-details.component.ts b/Mohem/src/app/offersdiscount/offer-details/offer-details.component.ts
new file mode 100644
index 00000000..20a253b7
--- /dev/null
+++ b/Mohem/src/app/offersdiscount/offer-details/offer-details.component.ts
@@ -0,0 +1,59 @@
+import { Component, OnInit } from '@angular/core';
+import { CommonService } from 'src/app/hmg-common/services/common/common.service';
+import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
+import { OfferDiscountService } from '../services/service';
+import { SocialSharing } from '@ionic-native/social-sharing/ngx';
+@Component({
+ selector: 'app-offer-details',
+ templateUrl: './offer-details.component.html',
+ styleUrls: ['./offer-details.component.scss'],
+})
+export class OfferDetailsComponent implements OnInit {
+ public details: any;
+ public direction: String;
+ public related: any;
+ constructor(public ts: TranslatorService, private socialSharing: SocialSharing, public cs: CommonService, public offersService: OfferDiscountService) { }
+
+ ngOnInit() {
+ this.direction = TranslatorService.getCurrentDirection();
+ this.details = this.cs.sharedService.getSharedData(OfferDiscountService.selected_offers, false);
+ this.related = this.cs.sharedService.getSharedData(OfferDiscountService.related_offers, false);
+ }
+
+ checkDate(date) {
+ return new Date(date) >= new Date()
+ }
+ getDotted(temp) {
+ temp = this.stripHtml(temp);
+ return temp.substring(0, 100) + " ...";
+ }
+ stripHtml(html) {
+ var temporalDivElement = document.createElement("div");
+
+ temporalDivElement.innerHTML = html;
+
+ return temporalDivElement.textContent || temporalDivElement.innerText || "";
+ }
+ share() {
+ console.log(this.details);
+ const offerMessage = this.direction === 'ltr' ? this.details.Description : this.details.Description_AR;
+ const offerSubject = this.direction === 'ltr' ? this.details.Title : this.details.Title_AR;
+
+ const options = {
+ message: this.stripHtml(offerMessage),
+ subject: this.stripHtml(offerSubject),
+ files: [this.details.Banner_Image]
+ }
+ this.socialSharing.shareWithOptions(options).then((result) => {
+ console.log(result);
+ })
+ }
+ openRelated(item) {
+ this.cs.sharedService.setSharedData(item, OfferDiscountService.selected_offers);
+ this.cs.back();
+ setTimeout(() => {
+ this.cs.navigateForward('/offersdiscount/offer-details');
+ }, 200);
+
+ }
+}
diff --git a/Mohem/src/app/offersdiscount/offersdiscount.module.ts b/Mohem/src/app/offersdiscount/offersdiscount.module.ts
new file mode 100644
index 00000000..c64e20bb
--- /dev/null
+++ b/Mohem/src/app/offersdiscount/offersdiscount.module.ts
@@ -0,0 +1,51 @@
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { FormsModule } from '@angular/forms';
+import { Routes, RouterModule } from '@angular/router';
+import { SocialSharing } from '@ionic-native/social-sharing/ngx';
+import { IonicModule } from '@ionic/angular';
+
+import { OffersdiscountPage } from './offersdiscount.page';
+import { HomeComponent } from './home/home.component';
+import { OfferDetailsComponent } from './offer-details/offer-details.component';
+import { HmgCommonModule } from '../hmg-common/hmg-common.module';
+import { OfferDiscountService } from './services/service';
+import { FilterComponent } from './filter/filter.component';
+
+
+const routes: Routes = [
+ {
+ path: '',
+ component: OffersdiscountPage,
+ children: [
+ {
+ path: 'home',
+ component: HomeComponent
+ },
+ {
+ path: 'offer-details',
+ component: OfferDetailsComponent
+ },
+ {
+ path: 'filter-page',
+ component: FilterComponent
+ },
+ ],
+ }
+];
+
+
+
+@NgModule({
+ imports: [
+ CommonModule,
+ FormsModule,
+ IonicModule,
+ HmgCommonModule,
+ RouterModule.forChild(routes)
+ ],
+ declarations: [OffersdiscountPage, HomeComponent, OfferDetailsComponent, FilterComponent],
+ entryComponents: [FilterComponent],
+ providers: [OfferDiscountService, SocialSharing]
+})
+export class OffersdiscountPageModule { }
diff --git a/Mohem/src/app/offersdiscount/offersdiscount.page.html b/Mohem/src/app/offersdiscount/offersdiscount.page.html
new file mode 100644
index 00000000..67cbe279
--- /dev/null
+++ b/Mohem/src/app/offersdiscount/offersdiscount.page.html
@@ -0,0 +1,3 @@
+
+
+
\ No newline at end of file
diff --git a/Mohem/src/app/offersdiscount/offersdiscount.page.scss b/Mohem/src/app/offersdiscount/offersdiscount.page.scss
new file mode 100644
index 00000000..e69de29b
diff --git a/Mohem/src/app/offersdiscount/offersdiscount.page.spec.ts b/Mohem/src/app/offersdiscount/offersdiscount.page.spec.ts
new file mode 100644
index 00000000..9ca9eb70
--- /dev/null
+++ b/Mohem/src/app/offersdiscount/offersdiscount.page.spec.ts
@@ -0,0 +1,27 @@
+import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { OffersdiscountPage } from './offersdiscount.page';
+
+describe('OffersdiscountPage', () => {
+ let component: OffersdiscountPage;
+ let fixture: ComponentFixture;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ OffersdiscountPage ],
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(OffersdiscountPage);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/Mohem/src/app/offersdiscount/offersdiscount.page.ts b/Mohem/src/app/offersdiscount/offersdiscount.page.ts
new file mode 100644
index 00000000..07cd6e41
--- /dev/null
+++ b/Mohem/src/app/offersdiscount/offersdiscount.page.ts
@@ -0,0 +1,15 @@
+import { Component, OnInit } from '@angular/core';
+
+@Component({
+ selector: 'app-offersdiscount',
+ templateUrl: './offersdiscount.page.html',
+ styleUrls: ['./offersdiscount.page.scss'],
+})
+export class OffersdiscountPage implements OnInit {
+
+ constructor() { }
+
+ ngOnInit() {
+ }
+
+}
diff --git a/Mohem/src/app/offersdiscount/services/service.ts b/Mohem/src/app/offersdiscount/services/service.ts
new file mode 100644
index 00000000..b3bd357f
--- /dev/null
+++ b/Mohem/src/app/offersdiscount/services/service.ts
@@ -0,0 +1,59 @@
+import { Injectable } from '@angular/core';
+import { ConnectorService } from 'src/app/hmg-common/services/connector/connector.service';
+import { AuthenticationService } from "src/app/hmg-common/services/authentication/authentication.service";
+import { CommonService } from 'src/app/hmg-common/services/common/common.service';
+import { Observable } from 'rxjs';
+@Injectable({
+ providedIn: 'root'
+})
+export class OfferDiscountService {
+
+ public static offersDiscountData = 'Services/COCWS.svc/REST/GetOfferDiscountsConfigData';
+ public static getSuborinateStatus = 'Services/ERP.svc/REST/GET_SUBORDINATES_ATTD_STATUS';
+ public static categoryList = 'Services/COCWS.svc/REST/Mohemm_ITG_GetCategories';
+ public static selected_offers = 'selected-offers';
+ public static related_offers = 'related-offers';
+ public static selected_filters = 'selected-filters';
+ public static categories = 'categories';
+ public static getCategories = 'Services/COCWS.svc/REST/Mohemm_ITG_GetCategories';
+
+ constructor(
+ public con: ConnectorService,
+ private authService: AuthenticationService,
+ public cs: CommonService
+ ) {
+ this.cs.sharedService.getSharedData(OfferDiscountService.selected_offers, false);
+ }
+
+ getOffers(offer_request, onError, errorLabel, pageNo?: number, categoryId?) {
+ let catId = categoryId;
+ var request = this.authService.getAuthenticatedRequest();
+ request['EmployeeNumber'] = request.UserName;
+ request['ItgIsActive'] = true;
+ request['ItgPageSize'] = 10;
+ request['ItgPageNo'] = pageNo;
+ if (catId) {
+ request['ItgCategoryID'] = categoryId;
+ }
+
+ return this.con.postNoLoad(OfferDiscountService.offersDiscountData, request, onError, errorLabel);
+
+ }
+ getCategories(request: any, onError?: any, errorLabel?: string): Observable {
+ this.authService.authenticateRequest(request);
+ request['EmployeeNumber'] = request.UserName;
+ request['ItgChannelId'] = 3;
+ request['ItgIsActive'] = true;
+ request['ItgPageSize'] = 100;
+ request['ItgPageNo'] = 1;
+ request['ItgId'] = 0;
+ request['ItgCategoryName_en'] = '';
+ request['ItgCategoryName_ar'] = '';
+ return this.con.postNoLoad(
+ OfferDiscountService.getCategories,
+ request,
+ onError,
+ errorLabel
+ );
+ }
+}
\ No newline at end of file
diff --git a/Mohem/src/app/profile/add-address/add-address.component.html b/Mohem/src/app/profile/add-address/add-address.component.html
new file mode 100644
index 00000000..b66eab09
--- /dev/null
+++ b/Mohem/src/app/profile/add-address/add-address.component.html
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+
+ {{ts.trPK('general','country')}}
+
+ {{country.COUNTRY_NAME}}
+
+
+
+
+ {{selectedCountryName}}
+
+
+
+ Effective Date
+
+
+
+
+
+
+
+
+
+ {{'vacation-rule, next-label' | translate}}
+
+
\ No newline at end of file
diff --git a/Mohem/src/app/profile/add-address/add-address.component.scss b/Mohem/src/app/profile/add-address/add-address.component.scss
new file mode 100644
index 00000000..e2348ac3
--- /dev/null
+++ b/Mohem/src/app/profile/add-address/add-address.component.scss
@@ -0,0 +1,44 @@
+.footer-button {
+ border-radius: 2px;
+ padding: 0 1.1em;
+ min-height: 45px;
+ min-width: 200px;
+ }
+
+ ion-label {
+ color: var(--customnavy) !important;
+ }
+
+ .daynamicForm-Label {
+ font-size: 16px;
+ color: #a2a5a6 !important;
+ display: block;
+ overflow: hidden;
+ -webkit-flex: 1;
+ flex: 1;
+ font-size: inherit;
+ white-space: normal;
+ padding: 5px 0px;
+ margin: 10px auto;
+ padding-left: 10px;
+ }
+
+
+ .header-toolbar-new{
+ --background: #269DB8;
+ }
+ .addEitOkButton{
+ white-space: normal !important;
+ text-transform: capitalize !important;
+ min-height: 45px !important;
+ min-width: 5px !important;
+ margin: 8px !important;
+ background-color: #269DB8;
+ width: 80% !important;
+ color: white!important;
+ border-radius: 16px !important;
+ }
+ .country{
+ margin-top: 10px;
+ padding: 10px;
+ }
\ No newline at end of file
diff --git a/Mohem/src/app/profile/add-address/add-address.component.spec.ts b/Mohem/src/app/profile/add-address/add-address.component.spec.ts
new file mode 100644
index 00000000..230a9c8c
--- /dev/null
+++ b/Mohem/src/app/profile/add-address/add-address.component.spec.ts
@@ -0,0 +1,27 @@
+import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { AddAddressComponent } from './add-address.component';
+
+describe('AddAddressComponent', () => {
+ let component: AddAddressComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ AddAddressComponent ],
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(AddAddressComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/Mohem/src/app/profile/add-address/add-address.component.ts b/Mohem/src/app/profile/add-address/add-address.component.ts
new file mode 100644
index 00000000..cf8a0365
--- /dev/null
+++ b/Mohem/src/app/profile/add-address/add-address.component.ts
@@ -0,0 +1,1724 @@
+import { Component, ElementRef, OnInit, ViewChild } from '@angular/core';
+import { DatePicker } from '@ionic-native/date-picker/ngx';
+import { ModalController } from '@ionic/angular';
+import * as moment from 'moment';
+import { AccrualService } from 'src/app/accrual-balances/services/accrual.service';
+import { AddEitComponent } from 'src/app/eit/add-eit/add-eit.component';
+import { AddEitResponse } from 'src/app/eit/models/add.eit.response';
+import { EitAddressRequest } from 'src/app/eit/models/eit-address.request';
+import { EitRequest } from 'src/app/eit/models/eit.request';
+import { EITTransactionsRequest } from 'src/app/eit/models/EITTransactionsReq';
+import { EIT_ACTION } from 'src/app/eit/models/submit.eit.action';
+import { EitService } from 'src/app/eit/services/eit.service';
+import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service';
+import { AuthenticatedUser } from 'src/app/hmg-common/services/authentication/models/authenticated-user';
+import { CommonService } from 'src/app/hmg-common/services/common/common.service';
+import { MenuResponse } from 'src/app/hmg-common/services/menu/models/menu-response';
+import { MenuEntry } from 'src/app/hmg-common/services/menu/models/menu.entry';
+import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
+import { EITNotificatonBodyResponse } from 'src/app/notification/models/EITNotificationBodyRes';
+import { ButtonInput } from 'src/app/uI-elements/button.input';
+import { DateTimeInput } from 'src/app/uI-elements/date-time.input';
+import { DateInput } from 'src/app/uI-elements/date.input';
+import { HiddenInput } from 'src/app/uI-elements/hidden.input';
+import { NumberInput } from 'src/app/uI-elements/number.input';
+import { SelectInput } from 'src/app/uI-elements/select.input';
+import { TextAreaInput } from 'src/app/uI-elements/text-area.input';
+import { TextInput } from 'src/app/uI-elements/text.input';
+import { TimeInput } from 'src/app/uI-elements/time.input';
+import { ProfileService } from '../service/profile.service';
+
+@Component({
+ selector: 'app-add-address',
+ templateUrl: './add-address.component.html',
+ styleUrls: ['./add-address.component.scss'],
+})
+export class AddAddressComponent implements OnInit {
+ public countries: any = [];
+ @ViewChild("containerDiv") containerDiv: ElementRef;
+
+ ////*new add*/////
+ getPassNotificationDetails: any;
+ getPassdirfromNotifiPage: boolean = false;
+ functionName: string = "";
+ menuType: any;
+ /////////////////
+
+ private textArea: TextAreaInput;
+ private numberInput: NumberInput;
+ private textInput: TextInput;
+ private selectInput: SelectInput;
+ private dateInput: DateInput;
+ private timeInput: TimeInput;
+ private datetimeInput: DateTimeInput;
+ private buttonInput: ButtonInput;
+ private hiddenInput: HiddenInput;
+ private eitResponse: any;
+
+ private eitVALSettoCall: any = [];
+ private comtransNo: number = 0;
+ // private parentChilds: any[];
+ getPassMnuEntryObj: MenuEntry;
+ selMenu: MenuResponse;
+ eitSubmitAction: number = 0; //not submit
+ private eitRequest: EitAddressRequest;
+ private validateEitObj: any = [];
+ private ExtraObj: any = {};
+ private arrValues: any = [];
+ selEmp: string;
+ respID: number;
+ headerTitle: string = "";
+ isResubmit: boolean = false;
+ //private updatedNotObject:any=[];
+ private updatedValues: any = [];
+ addEITData: any;
+ direction: string;
+ country: any = 'SA';
+ selectedCountryName: any;
+ public effectiveDate: any;
+ public submitAbsObjList: any = [];
+ public selectedStatus: any = {};
+ public isUpdate: boolean;
+ constructor(
+ public modalController: ModalController,
+ public cs: CommonService,
+ public ts: TranslatorService,
+ private eitService: EitService,
+ public datePicker: DatePicker,
+ public profileService: ProfileService
+ ) {
+ this.direction = TranslatorService.getCurrentLanguageName();
+ this.selEmp = this.cs.sharedService.getSharedData(
+ MenuResponse.SHARED_SEL_EMP,
+ false
+ );
+ this.respID = this.cs.sharedService.getSharedData(
+ MenuResponse.SHARED_SEL_RESP_ID,
+ false
+ );
+ this.selMenu = new MenuResponse();
+ this.selMenu = this.cs.sharedService.getSharedData(
+ MenuResponse.SHARED_DATA,
+ false
+ );
+ // this.addEITData = this.cs.sharedService.getSharedData("AddEITData", false);
+ // console.log("addEITData: " + this.addEITData);
+ // console.log("dirfromNotificationPage: " + this.addEITData.dirfromNotificationPage);
+
+ this.eitRequest = new EitAddressRequest();
+
+ // this.buttonInput = new ButtonInput('btnSubmit', 'Submit', 'containerDiv', 'Y');
+
+ ////*new add*/////
+ /**********resubmit************ */
+ // this.getPassNotificationDetails = this.cs.sharedService.getSharedData(EITNotificatonBodyResponse.NOT_WORKLIST, false);//WARINING
+ // this.getPassdirfromNotifiPage = this.addEITData.dirfromNotificationPage;
+ // if (this.getPassdirfromNotifiPage) {
+ // this.functionName = this.getPassNotificationDetails.FUNCTION_NAME; //;this.getPassNotificationDetails.NOTIFICATION_NAME;
+ // this.menuType = "E";
+ // this.selEmp = this.getPassNotificationDetails.SELECTED_EMPLOYEE_NUMBER;
+ // this.respID = -999;
+ // this.validateEitObj = this.addEITData.submitEITObjList;
+ // // this.eitSubmitAction=this.getPassNotificationDetails.EIT_ACTION;
+ // let msg: string = "";
+ // msg = this.ts.trPK("eit", "update-title");
+ // this.headerTitle = msg;
+ // } else {
+ // this.getPassMnuEntryObj = this.selMenu.GetMenuEntriesList;
+ // this.comtransNo = this.addEITData.transNo;
+ // this.functionName = this.getPassMnuEntryObj.FUNCTION_NAME;
+ // this.menuType = this.selMenu.List_Menu.MENU_TYPE;
+ // this.validateEitObj = this.addEITData.submitEITObjList;
+ this.headerTitle = this.selMenu.GetMenuEntriesList.PROMPT;
+ // this.eitSubmitAction = this.cs.sharedService.getSharedData(
+ // EITTransactionsRequest.SUBMIT_EIT_ACTION
+ // );
+ // }
+ }
+
+ ngOnInit() { }
+
+ ngAfterViewInit() {
+ console.log("ngAfterViewInit");
+ // console.log(this.containerDiv.nativeElement);
+ this.selectedStatus = this.cs.sharedService.getSharedData(ProfileService.SELECTED_STATUS);
+ var addressEntries = this.cs.sharedService.getSharedData(ProfileService.ADRESS_ENTRIES);
+ if (addressEntries && addressEntries.UPDATE_BUTTON === 'Y') {
+ this.isUpdate = true;
+ let countryDetail = this.cs.sharedService.getSharedData(ProfileService.COUNTRY);
+ this.selectedCountryName = countryDetail.name;
+ this.country = countryDetail.code;
+ } else {
+ this.isUpdate = false;
+ }
+ this.getEitDffStructure();
+ // this.addFieldToDOM(this.buttonInput, 'btnSubmit', this.cs.presentAlert('Clicked!'), true)
+
+
+ this.getCountires();
+ this.effectiveDate = new Date();
+ }
+
+ private getEitDffStructure() {
+ const body = {
+ P_FUNCTION_NAME: this.selMenu.GetMenuEntriesList.FUNCTION_NAME,
+ P_SELECTED_EMPLOYEE_NUMBER: this.selEmp,
+ P_MENU_TYPE: this.menuType,
+ P_SELECTED_RESP_ID: this.respID,
+ P_COUNTRY_CODE: 'SA'
+ // P_USER_NAME:this.userName
+ };
+ this.profileService.getAddressDiffStructure(body).subscribe((result: any) => {
+ this.handleEitDffStructureResult(result);
+ });
+ }
+
+ handleEitDffStructureResult(result) {
+ if (result.GetAddressDffStructureList != null) {
+ this.eitResponse = result.GetAddressDffStructureList;
+ this.drawEitFields(result.GetAddressDffStructureList);
+ if (this.isUpdate) {
+ this.submitAbsObjList = this.cs.sharedService.getSharedData(ProfileService.EMP_ADDRESS);
+ this.fillAbsStructure();
+ }
+ }
+ }
+
+ private drawEitFields(feildsList) {
+ const containerId = "containerDiv";
+ this.eitVALSettoCall = [];
+ for (let i = 0; i < feildsList.length; i++) {
+ let defaultVal: string = "";
+ let defaultValText: string = "";
+ // defaultVal = feildsList[i].E_SERVICES_DV.P_ID_COLUMN_NAME
+ // ? feildsList[i].E_SERVICES_DV.P_ID_COLUMN_NAME
+ // : "";
+ // defaultValText = feildsList[i].E_SERVICES_DV.P_VALUE_COLUMN_NAME
+ // ? feildsList[i].E_SERVICES_DV.P_VALUE_COLUMN_NAME
+ // : "";
+
+ if (feildsList[i].DISPLAY_FLAG != "N") {
+ //check if the field should be displayed
+ if (feildsList[i].VALIDATION_TYPE == "N") {
+ //text , date , time
+ if (feildsList[i].FORMAT_TYPE == "C") {
+ // character
+ // if(feildsList[i].DEFAULT_TYPE=="C"||feildsList[i].DEFAULT_TYPE==""){// default type constant
+ this.textInput = new TextInput(
+ feildsList[i].SEGMENT_PROMPT,
+ feildsList[i].APPLICATION_COLUMN_NAME,
+ defaultVal,
+ containerId,
+ defaultValText,
+ feildsList[i].MOBILE_ENABLED,
+ feildsList[i].DISPLAY_FLAG,
+ feildsList[i].REQUIRED_FLAG
+ );
+ // }else if(feildsList[i].DEFAULT_TYPE=="P"||feildsList[i].DEFAULT_TYPE=="S"){// profile/ sql
+ // this.textInput = new TextInput(feildsList[i].SEGMENT_PROMPT,feildsList[i].APPLICATION_COLUMN_NAME,this.getDefaultValue(feildsList[i].DESC_FLEX_NAME,feildsList[i].DESC_FLEX_CONTEXT_CODE,feildsList[i].SEGMENT_NAME,feildsList[i].PARENT_SEGMENTS_VS_SplitedVS,feildsList[i].PARENT_SEGMENTS_DV_Splited),containerId,feildsList[i].MOBILE_ENABLED);
+ // }
+ } else if (feildsList[i].FORMAT_TYPE == "N") {
+ // number
+ // if(feildsList[i].DEFAULT_TYPE=="C"||feildsList[i].DEFAULT_TYPE==""){
+ this.numberInput = new NumberInput(
+ feildsList[i].SEGMENT_PROMPT,
+ feildsList[i].APPLICATION_COLUMN_NAME,
+ defaultVal,
+ containerId,
+ feildsList[i].MOBILE_ENABLED,
+ feildsList[i].DISPLAY_FLAG,
+ feildsList[i].REQUIRED_FLAG
+ );
+ // }else if(feildsList[i].DEFAULT_TYPE=="P"||feildsList[i].DEFAULT_TYPE=="S"){
+ // this.numberInput = new NumberInput(feildsList[i].SEGMENT_PROMPT,feildsList[i].APPLICATION_COLUMN_NAME,this.getDefaultValue(feildsList[i].DESC_FLEX_NAME,feildsList[i].DESC_FLEX_CONTEXT_CODE,feildsList[i].SEGMENT_NAME,feildsList[i].PARENT_SEGMENTS_VS_SplitedVS,feildsList[i].PARENT_SEGMENTS_DV_Splited),containerId,feildsList[i].MOBILE_ENABLED);
+ // }
+ } else if (feildsList[i].FORMAT_TYPE == "X") {
+ // standard date
+ if (
+ feildsList[i].DEFAULT_TYPE == "C" ||
+ feildsList[i].DEFAULT_TYPE == "D" ||
+ feildsList[i].DEFAULT_TYPE == "P" ||
+ feildsList[i].DEFAULT_TYPE == "S"
+ ) {
+ //constant
+ this.dateInput = new DateInput(
+ feildsList[i].SEGMENT_PROMPT,
+ feildsList[i].APPLICATION_COLUMN_NAME,
+ this.cs.reverseFormatDate(defaultVal),
+ containerId,
+ feildsList[i].MOBILE_ENABLED,
+ feildsList[i].DISPLAY_FLAG,
+ feildsList[i].REQUIRED_FLAG,
+ this.direction
+ );
+ } else {
+ this.dateInput = new DateInput(
+ feildsList[i].SEGMENT_PROMPT,
+ feildsList[i].APPLICATION_COLUMN_NAME,
+ "",
+ containerId,
+ feildsList[i].MOBILE_ENABLED,
+ feildsList[i].DISPLAY_FLAG,
+ feildsList[i].REQUIRED_FLAG,
+ this.direction
+ );
+ }
+ // else if(feildsList[i].DEFAULT_TYPE=="D"){//current date
+ // // this.dateInput = new DateInput(feildsList[i].SEGMENT_PROMPT,feildsList[i].APPLICATION_COLUMN_NAME,"currentDate",containerId,feildsList[i].MOBILE_ENABLED);
+ // this.dateInput = new DateInput(feildsList[i].SEGMENT_PROMPT,feildsList[i].APPLICATION_COLUMN_NAME,defaultVal,containerId,feildsList[i].MOBILE_ENABLED);
+
+ // }else if(feildsList[i].DEFAULT_TYPE=="P"||feildsList[i].DEFAULT_TYPE=="S"){// sql and profile
+ // this.dateInput = new DateInput(feildsList[i].SEGMENT_PROMPT,feildsList[i].APPLICATION_COLUMN_NAME,this.getDefaultValue(feildsList[i].DESC_FLEX_NAME,feildsList[i].DESC_FLEX_CONTEXT_CODE,feildsList[i].SEGMENT_NAME,feildsList[i].PARENT_SEGMENTS_VS_SplitedVS,feildsList[i].PARENT_SEGMENTS_DV_Splited),containerId,feildsList[i].MOBILE_ENABLED);
+ // }
+ } else if (feildsList[i].FORMAT_TYPE == "Y") {
+ // standard date time
+ if (
+ feildsList[i].DEFAULT_TYPE == "C" ||
+ feildsList[i].DEFAULT_TYPE == "D" ||
+ feildsList[i].DEFAULT_TYPE == "P" ||
+ feildsList[i].DEFAULT_TYPE == "S"
+ ) {
+ this.datetimeInput = new DateTimeInput(
+ feildsList[i].SEGMENT_PROMPT,
+ feildsList[i].APPLICATION_COLUMN_NAME,
+ this.cs.reverseFormatStandardDate(defaultVal),
+ containerId,
+ feildsList[i].MOBILE_ENABLED,
+ feildsList[i].DISPLAY_FLAG,
+ feildsList[i].REQUIRED_FLAG,
+ this.direction
+ );
+ } else {
+ this.datetimeInput = new DateTimeInput(
+ feildsList[i].SEGMENT_PROMPT,
+ feildsList[i].APPLICATION_COLUMN_NAME,
+ "",
+ containerId,
+ feildsList[i].MOBILE_ENABLED,
+ feildsList[i].DISPLAY_FLAG,
+ feildsList[i].REQUIRED_FLAG,
+ this.direction
+ );
+ }
+ const elem = document.getElementById(
+ feildsList[i].APPLICATION_COLUMN_NAME
+ );
+ // elem.addEventListener("click", e => {
+ // if (feildsList[i].MOBILE_ENABLED != "Y") return false;
+ // this.showDateTimePicker(
+ // feildsList[i].APPLICATION_COLUMN_NAME,
+ // feildsList[i].MAXIMUM_SIZE
+ // );
+ // e.stopImmediatePropagation();
+ // });
+ // else if(feildsList[i].DEFAULT_TYPE=="D"){
+ // this.datetimeInput = new DateTimeInput(feildsList[i].SEGMENT_PROMPT,feildsList[i].APPLICATION_COLUMN_NAME,"currentDateTime",containerId,feildsList[i].MOBILE_ENABLED);
+ // }else if(feildsList[i].DEFAULT_TYPE=="P"||feildsList[i].DEFAULT_TYPE=="S"){
+ // this.datetimeInput = new DateTimeInput(feildsList[i].SEGMENT_PROMPT,feildsList[i].APPLICATION_COLUMN_NAME,this.getDefaultValue(feildsList[i].DESC_FLEX_NAME,feildsList[i].DESC_FLEX_CONTEXT_CODE,feildsList[i].SEGMENT_NAME,feildsList[i].PARENT_SEGMENTS_VS_SplitedVS,feildsList[i].PARENT_SEGMENTS_DV_Splited),containerId,feildsList[i].MOBILE_ENABLED);
+ // }
+ } else if (feildsList[i].FORMAT_TYPE == "I") {
+ //time
+ if (
+ feildsList[i].DEFAULT_TYPE == "C" ||
+ feildsList[i].DEFAULT_TYPE == "D" ||
+ feildsList[i].DEFAULT_TYPE == "P" ||
+ feildsList[i].DEFAULT_TYPE == "S"
+ ) {
+ this.timeInput = new TimeInput(
+ feildsList[i].SEGMENT_PROMPT,
+ feildsList[i].APPLICATION_COLUMN_NAME,
+ "",
+ containerId,
+ feildsList[i].MOBILE_ENABLED,
+ feildsList[i].DISPLAY_FLAG,
+ feildsList[i].REQUIRED_FLAG,
+ this.direction
+ );
+ } else {
+ this.timeInput = new TimeInput(
+ feildsList[i].SEGMENT_PROMPT,
+ feildsList[i].APPLICATION_COLUMN_NAME,
+ "",
+ containerId,
+ feildsList[i].MOBILE_ENABLED,
+ feildsList[i].DISPLAY_FLAG,
+ feildsList[i].REQUIRED_FLAG,
+ this.direction
+ );
+ }
+ }
+ } else {
+ if (feildsList[i].READ_ONLY == "Y") {
+ this.textInput = new TextInput(
+ feildsList[i].SEGMENT_PROMPT,
+ feildsList[i].APPLICATION_COLUMN_NAME,
+ defaultVal,
+ containerId,
+ defaultValText,
+ feildsList[i].MOBILE_ENABLED,
+ feildsList[i].DISPLAY_FLAG,
+ feildsList[i].REQUIRED_FLAG
+ );
+ } else {
+ // dropdown list missing open in differnt page
+ //check this validation since he doesnt check the other default_type
+ //if(feildsList[i].DEFAULT_TYPE=="P" || feildsList[i].DEFAULT_TYPE=="S"){
+ this.selectInput = new SelectInput(
+ feildsList[i].SEGMENT_PROMPT,
+ feildsList[i].APPLICATION_COLUMN_NAME,
+ defaultVal,
+ containerId,
+ feildsList[i].MOBILE_ENABLED,
+ feildsList[i].DISPLAY_FLAG,
+ feildsList[i].REQUIRED_FLAG
+ );
+ // }else{
+ // this.selectInput = new SelectInput(feildsList[i].SEGMENT_PROMPT,feildsList[i].APPLICATION_COLUMN_NAME,"",containerId,feildsList[i].MOBILE_ENABLED);
+ // }
+ // this.getValueSet(feildsList[i].SEGMENT_NAME);
+ this.fillDropdownList(
+ feildsList[i].SEGMENT_NAME,
+ feildsList[i].E_SERVICES_VS,
+ feildsList[i].E_SERVICES_DV
+ );
+ // this.eitVALSettoCall.push(feildsList[i]);
+ }
+ }
+ //const elem = document.getElementById(feildsList[i].APPLICATION_COLUMN_NAME);
+ //elem.addEventListener("click", (e) => {
+ // this.getValueSet(feildsList[i].SEGMENT_NAME);
+ // e.stopImmediatePropagation();
+ // });
+ this.bindHtmlElemEvents(
+ feildsList[i].APPLICATION_COLUMN_NAME,
+ feildsList[i]
+ );
+ } else {
+ // if(feildsList[i].VALIDATION_TYPE=="N"){
+ this.hiddenInput = new HiddenInput(
+ defaultVal,
+ feildsList[i].APPLICATION_COLUMN_NAME,
+ defaultValText,
+ containerId
+ );
+ // }else{
+ // this.selectInput = new SelectInput(feildsList[i].SEGMENT_PROMPT,feildsList[i].APPLICATION_COLUMN_NAME,defaultVal,containerId,feildsList[i].MOBILE_ENABLED,feildsList[i].DISPLAY_FLAG);
+ // this.fillDropdownList(feildsList[i].SEGMENT_NAME,feildsList[i].E_SERVICES_VS,feildsList[i].E_SERVICES_DV);
+ // }
+ this.bindHtmlElemEvents(
+ feildsList[i].APPLICATION_COLUMN_NAME,
+ feildsList[i]
+ );
+ }
+ }
+ // this.callValueSet();
+ // let msg:string="";
+ // msg=this.translate.translate("confirmAddEit.start");
+ // this.buttonInput = new ButtonInput("EIT_Btn_Submit", this.translate.translate('general.submit'), containerId, "");
+ // const elem = document.getElementById("EIT_Btn_Submit");
+ // elem.addEventListener("click", (e) => {
+ // this.validateEITTransaction();
+ // });
+ if (this.validateEitObj && this.validateEitObj.length > 0) {
+ this.fillEITStructure();
+ }
+ }
+
+ addFieldToDOM(
+ fieldObject: any,
+ fieldId: any,
+ clickListenerEvent: any,
+ hasClickListener: boolean
+ ) {
+ console.log("AddFieldToDOM");
+ const elemDiv = document.createElement("div");
+ elemDiv.className = "";
+ elemDiv.innerHTML = fieldObject.getTemplate();
+ console.log(this.containerDiv.nativeElement);
+
+ this.containerDiv.nativeElement.appendChild(elemDiv);
+ // document.getElementById('containerDiv').appendChild(elemDiv);
+
+ if (hasClickListener) {
+ let elem = document.getElementById(fieldId);
+ elem.addEventListener("click", e => {
+ clickListenerEvent(e);
+ e.stopImmediatePropagation();
+ });
+ }
+ }
+
+ closeModal() {
+ console.log("closeModal");
+ this.updatedValues = [];
+ this.modalController.dismiss();
+ }
+
+ public showDateTimePicker(elemID, maxSize) {
+ let elem = document.getElementById(elemID) as HTMLDivElement;
+ let date: any;
+ let value = elem.innerHTML;
+ if (value) date = moment(value, "YYYY/MM/DD HH:mm:ss").toDate();
+ else date = new Date();
+ this.datePicker
+ .show({
+ date: date,
+ is24Hour: true,
+ mode: "datetime"
+ })
+ .then(
+ date => {
+ let dateString: string = moment(date).format("YYYY/MM/DD HH:mm:ss");
+ //remove seconds if the maximum size is 17
+ if (maxSize == 17) {
+ elem.innerHTML = dateString.substring(0, 16);
+ elem.dataset.dtvalue = dateString.substring(0, 16);
+ } else {
+ elem.innerHTML = dateString;
+ elem.dataset.dtvalue = dateString;
+ }
+ //elem.innerHTML = dateString;
+ // elem.dataset.dtvalue = dateString;
+ },
+ err => console.log("Error occurred while getting date: ", err)
+ );
+ }
+ public showTimePicker(elemID, maxSize) {
+ let elem = document.getElementById(elemID) as HTMLDivElement;
+ let date: any;
+ let value = elem.innerHTML;
+ if (value) {
+ let nowDate = moment().format("YYYY/MM/DD") + " " + value;
+ date = moment(nowDate, "YYYY/MM/DD HH:mm:ss").toDate();
+ } else {
+ date = new Date();
+ }
+ this.datePicker
+ .show({
+ date: date,
+ is24Hour: true,
+ mode: "time"
+ })
+ .then(
+ date => {
+ let dateString: string = moment(date).format("HH:mm:ss");
+ //remove seconds if the maximum size is 5
+ if (maxSize == 5) {
+ elem.innerHTML = dateString.substring(0, 5);
+ elem.dataset.dtvalue = dateString.substring(0, 5);
+ } else {
+ elem.innerHTML = dateString;
+ elem.dataset.dtvalue = dateString;
+ }
+ },
+ err => console.log("Error occurred while getting date: ", err)
+ );
+ }
+
+ fillDropdownList(segmentName, optionList: any = [], DV: any = "") {
+ let elemID: any = "";
+ let eitObj: any;
+ if (optionList.length > 0) {
+ for (let i = 0; i < this.eitResponse.length; i++) {
+ if (this.eitResponse[i].SEGMENT_NAME == segmentName) {
+ eitObj = this.eitResponse[i];
+ if (
+ this.eitResponse[i].READ_ONLY == "Y" ||
+ this.eitResponse[i].DISPLAY_FLAG == "N"
+ ) {
+ return false;
+ }
+ elemID = this.eitResponse[i].APPLICATION_COLUMN_NAME;
+ break;
+ }
+ }
+ let select = document.getElementById(elemID) as HTMLSelectElement;
+ document.getElementById(elemID).innerHTML = "";
+
+ // for(let i = select.options.length - 1 ; i >= 0 ; i--)
+ // {
+ // select.remove(i);
+ // }
+ if (eitObj.IsEmptyOption && eitObj.REQUIRED_FLAG == "N") {
+ var firstoption = document.createElement("option");
+ firstoption.text = this.ts.trPK("general", "choose");
+ firstoption.value = "";
+ select.add(firstoption);
+ }
+ for (let i = 0; i < optionList.length; i++) {
+ var option = document.createElement("option");
+ option.text = optionList[i].VALUE_COLUMN_NAME;
+ option.value = optionList[i].ID_COLUMN_NAME;
+ select.add(option);
+ }
+ if (select.dataset.hiddenval) {
+ select.value = select.dataset.hiddenval;
+ //select.dataset.hiddenval="";
+ } else {
+ select.value = DV.P_ID_COLUMN_NAME;
+ }
+ select.disabled = false;
+ }
+ }
+
+ bindHtmlElemEvents(id, obj) {
+ const elem = document.getElementById(id);
+ console.log(elem);
+ console.log(obj);
+ const elemType = elem.tagName;
+ let changeEvent = "ionChange";
+
+ if (elemType == "SELECT") changeEvent = "change";
+
+ try {
+ // elem.addEventListener("change", (e) => {
+ elem.addEventListener(changeEvent, e => {
+ //console.log("elem change "+elem.id);
+ //let x=e.currentTarget as HTMLInputElement;
+ //let isEmpty:boolean=false;
+ // if(!x.value)
+ // isEmpty=true;
+ //emptyChildElement
+ elem.classList.remove("requiredClassElm");
+ if (
+ obj.CHILD_SEGMENTS_VS_Splited &&
+ obj.CHILD_SEGMENTS_VS_Splited.length > 0
+ ) {
+ let listArray: any = obj.CHILD_SEGMENTS_VS_Splited;
+ listArray.forEach(element => {
+ //if(isEmpty)
+ this.emptyChildElement(element);
+ // else
+ this.getValueSet(element);
+ });
+ }
+ if (
+ obj.CHILD_SEGMENTS_DV_Splited &&
+ obj.CHILD_SEGMENTS_DV_Splited.length > 0
+ ) {
+ let listArray: any = obj.CHILD_SEGMENTS_DV_Splited;
+ listArray.forEach(element => {
+ // if(isEmpty){
+ this.emptyChildElement(element);
+ // }else{
+ for (let i = 0; i < this.eitResponse.length; i++) {
+ if (this.eitResponse[i].SEGMENT_NAME == element) {
+ this.getDefaultValue(
+ this.eitResponse[i],
+ this.eitResponse[i].DESC_FLEX_NAME,
+ this.eitResponse[i].DESC_FLEX_CONTEXT_CODE,
+ this.eitResponse[i].SEGMENT_NAME,
+ this.eitResponse[i].PARENT_SEGMENTS_VS_SplitedVS,
+ this.eitResponse[i].PARENT_SEGMENTS_DV_Splited
+ );
+ }
+ }
+ // }
+ });
+ }
+ return false;
+ // e.stopImmediatePropagation();
+ });
+ } catch (e) {
+ console.log(e.status);
+ }
+ }
+
+ public getDefaultValue(
+ obj,
+ descFlexName,
+ descFlexContextCode,
+ segmentName,
+ parentValue,
+ ParentsList
+ ) {
+ let dependenciesList: any = [];
+ let parentVal: any = null;
+ let isStandardDate: boolean = false;
+ let isStandardTimeDate: boolean = false;
+ let isStandardTime: boolean = false;
+ let isHidden: boolean = false;
+ let isReadOnlyList: boolean = false;
+ let isSelectElement: boolean = false;
+ isStandardDate = this.isStandardDate(obj);
+ isStandardTimeDate = this.isStandardDateTime(obj);
+ isStandardTime = this.isStandardTime(obj);
+ if (obj.DISPLAY_FLAG == "N") isHidden = true;
+ if (obj.VALIDATION_TYPE != "N" && obj.READ_ONLY == "Y") {
+ isReadOnlyList = true;
+ }
+ if (obj.VALIDATION_TYPE != "N" && obj.READ_ONLY == "N") {
+ isSelectElement = true;
+ }
+ //if(parentValue!=""){ parentVal= this.getDependenciesParams(parentValue)[0].ID_COLUMN_NAME;}
+ //if(ParentsList!=""){dependenciesList =this.getDependenciesParams(ParentsList); }
+
+ if (
+ parentValue != "" &&
+ (obj.VALIDATION_TYPE == "D" || obj.VALIDATION_TYPE == "Y")
+ ) {
+ let parvalue = this.getDependenciesParams(parentValue);
+ if (parvalue && parvalue[0]) parentVal = parvalue[0].ID_COLUMN_NAME;
+ else {
+ parentVal = null;
+ }
+ if (!parentVal) {
+ return false;
+ }
+ }
+ if (ParentsList != "") {
+ if (parentValue) ParentsList.concat(parentValue);
+ dependenciesList = this.getDependenciesParams(ParentsList);
+ if (!dependenciesList) {
+ return false;
+ }
+ }
+
+ //if (dependenciesList==false){return false};
+ const body = {
+ P_SELECTED_EMPLOYEE_NUMBER: this.selEmp,
+ P_MENU_TYPE: this.menuType,
+ P_SELECTED_RESP_ID: this.respID, //-999,
+ P_DESC_FLEX_NAME: descFlexName,
+ P_DESC_FLEX_CONTEXT_CODE: descFlexContextCode,
+ P_SEGMENT_NAME: segmentName,
+ P_PARENT_VALUE: parentVal,
+ GetValueSetValuesTBL: dependenciesList
+ };
+
+ this.eitService.getDefaultValue(body).subscribe((result: any) => {
+ let elem = this.getElementByName(segmentName);
+ // console.log(elem);
+ // if(elem.dataset.hiddenval){
+ // elem.dataset.hiddenval="";
+ // return false;
+ // }
+ let obj = this.handleDefaultValueResult(result);
+ let val = obj.value;
+ let text = obj.text;
+ if (val == null) { val = ""; }
+ if (text == null) { text = ""; }
+ if (isStandardDate) {
+ console.log("isStandardDate");
+ elem.value = this.cs.reverseFormatDate(val);
+ } else if (isStandardTimeDate) {
+ console.log("isStandardTimeDate");
+ if (val) {
+ elem.dataset.dtvalue = this.cs.reverseFormatStandardDate(val);
+ elem.innerHTML = this.cs.reverseFormatStandardDate(val);
+ } else {
+ elem.dataset.dtvalue = "";
+ elem.innerHTML = "";
+ }
+ } else if (isStandardTime) {
+ console.log("isStandardTime");
+ if (val) {
+ elem.dataset.dtvalue = val;
+ elem.innerHTML = val;
+ elem.value = val;
+ } else {
+ elem.dataset.dtvalue = "";
+ elem.innerHTML = "";
+ }
+ } else {
+ if (isSelectElement) {
+ let elem = this.getSelectElementByName(segmentName);
+ elem = document.getElementById(elem),
+ //alert(elem.length);
+ // var firstoption = document.createElement("option");
+ // firstoption.text = text;
+ // firstoption.value = val;
+ // elem.add(firstoption);
+ elem.value = val;
+ //elem.text=text;
+
+ } else {
+ // console.log("else - " + elem.value);
+ elem.value = val;
+ elem.innerText = text;
+ elem.setAttribute("value", val);
+ // console.log("else - " + elem.value);
+ }
+ }
+ if (isHidden || isReadOnlyList) {
+ if (val) elem.dataset.colmText = val;
+ else elem.dataset.colmText = "";
+ elem.value = text;
+ }
+ var event = new Event("ionChange");
+ elem.dispatchEvent(event);
+ });
+ }
+
+ handleDefaultValueResult(result) {
+ let data = {
+ text: result.GetDefaultValueList.P_VALUE_COLUMN_NAME,
+ value: result.GetDefaultValueList.P_ID_COLUMN_NAME
+ };
+ return data;
+ }
+
+ callValueSet() {
+ for (var i = 0; i < this.eitVALSettoCall.length; i++) {
+ this.getValueSet(this.eitVALSettoCall[i].SEGMENT_NAME);
+ }
+ }
+
+ getParentValue(parentValue) {
+ if (parentValue.length == 0) {
+ for (let i = 0; i < this.eitResponse.length; i++) {
+ if (this.eitResponse[i].SEGMENT_NAME == parentValue[0].Name) {
+ if (this.eitResponse[i].VALIDATION_TYPE == "N") {
+ let val = (document.getElementById(
+ this.eitResponse[i].APPLICATION_COLUMN_NAME
+ ) as HTMLInputElement).value;
+ return val;
+ } else {
+ let x = document.getElementById(
+ this.eitResponse[i].APPLICATION_COLUMN_NAME
+ ) as HTMLSelectElement;
+ if (x.options.length > 0) {
+ let val = x.options[x.selectedIndex]
+ ? x.options[x.selectedIndex].value
+ : null;
+ return val;
+ } else {
+ return "";
+ }
+ }
+ }
+ }
+ } else {
+ return "";
+ }
+ }
+
+ public getValueSet(segmentName) {
+ let descFlexName: any = "";
+ let descFlexContextCode: any = "";
+ let parentValue: any = [];
+ let ParentsList: any = [];
+ let parentVal: any = null;
+ let dependenciesList: any = [];
+ let validationType: string = "";
+
+ for (let i = 0; i < this.eitResponse.length; i++) {
+ if (this.eitResponse[i].SEGMENT_NAME == segmentName) {
+ descFlexName = this.eitResponse[i].DESC_FLEX_NAME;
+ descFlexContextCode = this.eitResponse[i].DESC_FLEX_CONTEXT_CODE;
+ parentValue = this.eitResponse[i].PARENT_SEGMENTS_VS_SplitedVS;
+ ParentsList = this.eitResponse[i].PARENT_SEGMENTS_VS_SplitedVS;
+ validationType = this.eitResponse[i].VALIDATION_TYPE;
+ break;
+ }
+ }
+ if (parentValue != "" && (validationType == "D" || validationType == "Y")) {
+ let parvalue = this.getDependenciesParams(parentValue);
+ if (parvalue && parvalue[0]) parentVal = parvalue[0].ID_COLUMN_NAME;
+ else {
+ parentVal = null;
+ }
+ if (!parentVal) {
+ return false;
+ }
+ }
+ if (ParentsList != "") {
+ dependenciesList = this.getDependenciesParams(ParentsList);
+ if (!dependenciesList) {
+ return false;
+ }
+ }
+ const body = {
+ P_SELECTED_EMPLOYEE_NUMBER: this.selEmp,
+ P_MENU_TYPE: this.menuType,
+ P_SELECTED_RESP_ID: this.respID, //-999,
+ P_DESC_FLEX_NAME: descFlexName,
+ P_DESC_FLEX_CONTEXT_CODE: descFlexContextCode,
+ P_SEGMENT_NAME: segmentName,
+ P_PARENT_VALUE: parentVal,
+ GetValueSetValuesTBL: dependenciesList,
+ P_PAGE_NUM: 1,
+ P_PAGE_LIMIT: 1000
+ };
+
+ this.eitService.getSetValue(body).subscribe((result: any) => {
+ if (result.GetValueSetValuesList != null) {
+ this.fillDropdownList(segmentName, result.GetValueSetValuesList);
+ }
+ });
+ let arr: any = [];
+ return arr;
+ }
+
+ getDependenciesParams(parentsList) {
+ let parentArr: any = [];
+ for (let i = 0; i < parentsList.length; i++) {
+ for (let j = 0; j < this.eitResponse.length; j++) {
+ if (this.eitResponse[j].SEGMENT_NAME == parentsList[i].Name) {
+ if (this.eitResponse[j].DISPLAY_FLAG != "N") {
+ if (this.eitResponse[j].VALIDATION_TYPE == "N") {
+ let idColName: string;
+ let val: any;
+ if (
+ this.eitResponse[j].FORMAT_TYPE == "Y" ||
+ this.eitResponse[j].FORMAT_TYPE == "I"
+ ) {
+ //standard date time or //time
+ let elem = document.getElementById(
+ this.eitResponse[j].APPLICATION_COLUMN_NAME
+ ) as HTMLDivElement;
+ val = elem.dataset.dtvalue;
+ if (
+ (val == undefined || val == "") &&
+ parentsList[i].IsRequired == "REQUIRED"
+ ) {
+ //alert(parentsList[i].Name +" Is required");
+ return false;
+ }
+ idColName = val;
+ if (this.eitResponse[j].FORMAT_TYPE == "Y")
+ idColName = this.cs.formatStandardDate(val);
+ } else {
+ val = (document.getElementById(
+ this.eitResponse[j].APPLICATION_COLUMN_NAME
+ ) as HTMLInputElement).value;
+ if (
+ (val == undefined || val == "") &&
+ parentsList[i].IsRequired == "REQUIRED"
+ ) {
+ //alert(parentsList[i].Name +" Is required");
+ return false;
+ }
+ idColName = val;
+ if (this.eitResponse[j].FORMAT_TYPE == "X") {
+ //date
+ // idColName = this.cs.formatDate(val);
+ idColName = this.cs.formatDateNew(val);
+ }
+ }
+ parentArr.push({
+ SEGMENT_NAME: this.eitResponse[j].SEGMENT_NAME,
+ VALUE_COLUMN_NAME: val,
+ DESCRIPTION: "",
+ ID_COLUMN_NAME: idColName,
+ FLEX_VALUE_SET_NAME: this.eitResponse[j].FLEX_VALUE_SET_NAME
+ });
+ break;
+ } else {
+ if (this.eitResponse[j].READ_ONLY != "Y") {
+ let x = document.getElementById(
+ this.eitResponse[j].APPLICATION_COLUMN_NAME
+ ) as HTMLSelectElement;
+ let text = x.options[x.selectedIndex]
+ ? x.options[x.selectedIndex].text
+ : "";
+ let val = x.options[x.selectedIndex]
+ ? x.options[x.selectedIndex].value
+ : undefined;
+ if (
+ (val == undefined || val == "") &&
+ parentsList[i].IsRequired == "REQUIRED"
+ ) {
+ //alert(parentsList[i].Name +" Is required");
+ return false;
+ } else {
+ }
+ if (text == undefined) {
+ text = "";
+ }
+ parentArr.push({
+ SEGMENT_NAME: this.eitResponse[j].SEGMENT_NAME,
+ VALUE_COLUMN_NAME: text,
+ DESCRIPTION: "",
+ ID_COLUMN_NAME: val,
+ FLEX_VALUE_SET_NAME: this.eitResponse[j].FLEX_VALUE_SET_NAME
+ });
+ break;
+ } else {
+ let x = document.getElementById(
+ this.eitResponse[j].APPLICATION_COLUMN_NAME
+ ) as HTMLInputElement;
+ let text = x.value;
+ let val = x.dataset.colmText;
+ if (
+ (val == undefined || val == "") &&
+ parentsList[i].IsRequired == "REQUIRED"
+ ) {
+ //alert(parentsList[i].Name +" Is required");
+ return false;
+ } else {
+ }
+ if (text == undefined) {
+ text = "";
+ }
+ parentArr.push({
+ SEGMENT_NAME: this.eitResponse[j].SEGMENT_NAME,
+ VALUE_COLUMN_NAME: text,
+ DESCRIPTION: "",
+ ID_COLUMN_NAME: val,
+ FLEX_VALUE_SET_NAME: this.eitResponse[j].FLEX_VALUE_SET_NAME
+ });
+ break;
+ }
+ }
+ } else {
+ let x = document.getElementById(
+ this.eitResponse[j].APPLICATION_COLUMN_NAME
+ ) as HTMLInputElement;
+ let text = x.value;
+ let val = x.dataset.colmText;
+ if (
+ (val == undefined || val == "") &&
+ parentsList[i].IsRequired == "REQUIRED"
+ ) {
+ //alert(parentsList[i].Name +" Is required");
+ return false;
+ } else {
+ }
+ if (text == undefined) {
+ text = "";
+ }
+ parentArr.push({
+ SEGMENT_NAME: this.eitResponse[j].SEGMENT_NAME,
+ VALUE_COLUMN_NAME: text,
+ DESCRIPTION: "",
+ ID_COLUMN_NAME: val,
+ FLEX_VALUE_SET_NAME: this.eitResponse[j].FLEX_VALUE_SET_NAME
+ });
+ break;
+ }
+ }
+ }
+ }
+ return parentArr;
+ }
+
+ emptyChildElement(segmentName) {
+ let elem = this.getElementByName(segmentName);
+ elem.value = null;
+ elem.innerHTML = "";
+ if ("dtvalue" in elem.dataset) {
+ elem.dataset.dtvalue = "";
+ }
+ if ("colmText" in elem.dataset) {
+ elem.dataset.colmText = "";
+ }
+ var event = new Event("change");
+ elem.dispatchEvent(event);
+ elem.classList.remove("requiredClassElm");
+ }
+
+ getRequiredFilds() {
+ for (let i = 0; i < this.eitResponse.length; i++) {
+ if (this.eitResponse[i].REQUIRED_FLAG == "Y") {
+ let elemVal = (document.getElementById(
+ this.eitResponse[i].APPLICATION_COLUMN_NAME
+ ) as HTMLInputElement).value;
+ if (elemVal == "") {
+ //alert(this.eitResponse[i].SEGMENT_NAME+" is required");
+ break;
+ }
+ }
+ }
+ }
+
+ getElementByName(segmentName) {
+ let elemID: any = "";
+ for (let i = 0; i < this.eitResponse.length; i++) {
+ if (this.eitResponse[i].SEGMENT_NAME == segmentName) {
+ elemID = this.eitResponse[i].APPLICATION_COLUMN_NAME;
+ break;
+ }
+ }
+ return document.getElementById(elemID) as HTMLInputElement;
+ }
+
+ getSelectElementByName(segmentName) {
+ let elemID: any = "";
+ for (let i = 0; i < this.eitResponse.length; i++) {
+ if (this.eitResponse[i].SEGMENT_NAME == segmentName) {
+ elemID = this.eitResponse[i].APPLICATION_COLUMN_NAME;
+ break;
+ }
+ }
+ return elemID;
+ }
+
+ isStandardDate(obj: any): boolean {
+ let isSt: boolean = false;
+ if (obj.FORMAT_TYPE == "X") {
+ // standard date
+ if (
+ obj.DEFAULT_TYPE == "C" ||
+ obj.DEFAULT_TYPE == "D" ||
+ obj.DEFAULT_TYPE == "P" ||
+ obj.DEFAULT_TYPE == "S"
+ ) {
+ //constant
+ isSt = true;
+ }
+ }
+ return isSt;
+ }
+ isStandardDateTime(obj: any): boolean {
+ let isSt: boolean = false;
+ if (obj.FORMAT_TYPE == "Y") {
+ // standard date time
+ if (
+ obj.DEFAULT_TYPE == "C" ||
+ obj.DEFAULT_TYPE == "D" ||
+ obj.DEFAULT_TYPE == "P" ||
+ obj.DEFAULT_TYPE == "S"
+ ) {
+ //constant
+ isSt = true;
+ }
+ }
+ return isSt;
+ }
+ isStandardTime(obj: any): boolean {
+ let isSt: boolean = false;
+ if (obj.FORMAT_TYPE == "I") {
+ // standard date time
+ if (
+ obj.DEFAULT_TYPE == "C" ||
+ obj.DEFAULT_TYPE == "D" ||
+ obj.DEFAULT_TYPE == "P" ||
+ obj.DEFAULT_TYPE == "S"
+ ) {
+ //constant
+ isSt = true;
+ }
+ }
+ return isSt;
+ }
+
+ isStandardDateVal(obj: any): boolean {
+ let isSt: boolean = false;
+ if (obj.FORMAT_TYPE == "X") {
+ // standard date
+ // if(obj.DEFAULT_TYPE=="C" || obj.DEFAULT_TYPE=="D" || obj.DEFAULT_TYPE=="P"||obj.DEFAULT_TYPE=="S"){//constant
+ isSt = true;
+ // }
+ }
+ return isSt;
+ }
+ isStandardDateTimeVal(obj: any): boolean {
+ let isSt: boolean = false;
+ if (obj.FORMAT_TYPE == "Y") {
+ // standard date time
+ //if(obj.DEFAULT_TYPE=="C" || obj.DEFAULT_TYPE=="D" || obj.DEFAULT_TYPE=="P"||obj.DEFAULT_TYPE=="S"){//constant
+ isSt = true;
+ //}
+ }
+ return isSt;
+ }
+ isStandardTimeVal(obj: any): boolean {
+ let isSt: boolean = false;
+ if (obj.FORMAT_TYPE == "I") {
+ // standard time
+ //if(obj.DEFAULT_TYPE=="C" || obj.DEFAULT_TYPE=="D" || obj.DEFAULT_TYPE=="P"||obj.DEFAULT_TYPE=="S"){//constant
+ isSt = true;
+ //}
+ }
+ return isSt;
+ }
+
+ fillEITStructure() {
+ var obj = { peiObjVer: null, peiExtraInfoID: null };
+ for (let i = 0; i < this.validateEitObj.length; i++) {
+ let val: any;
+ if (this.validateEitObj[i].VARCHAR2_VALUE)
+ val = this.validateEitObj[i].VARCHAR2_VALUE;
+ else if (this.validateEitObj[i].DATE_VALUE)
+ val = this.validateEitObj[i].DATE_VALUE;
+ else if (this.validateEitObj[i].NUMBER_VALUE)
+ val = this.validateEitObj[i].NUMBER_VALUE;
+ const elem = document.getElementById(
+ this.validateEitObj[i].APPLICATION_COLUMN_NAME
+ ) as HTMLInputElement;
+ //obj.transactionNo=this.validateEitObj[i].TRANSACTION_NUMBER;
+ if (elem) {
+ if (val) {
+ let feldDetails = this.eitResponse.find(
+ x =>
+ x.APPLICATION_COLUMN_NAME ==
+ this.validateEitObj[i].APPLICATION_COLUMN_NAME
+ );
+ if (feldDetails) {
+ let isStandardDate = this.isStandardDateVal(feldDetails);
+ let isStandardDateTime = this.isStandardDateTimeVal(feldDetails);
+ let isStandardTime = this.isStandardTimeVal(feldDetails);
+ if (isStandardDate) {
+ elem.value = this.cs.reverseFormatDate(val);
+ } else if (isStandardDateTime) {
+ elem.innerHTML = this.cs.reverseFormatStandardDate(val);
+ elem.dataset.dtvalue = this.cs.reverseFormatStandardDate(val);
+ } else if (isStandardTime) {
+ elem.innerHTML = val;
+ elem.dataset.dtvalue = val;
+ } else {
+ elem.value = val;
+ elem.setAttribute("value", elem.value);
+ }
+ if (
+ feldDetails.DISPLAY_FLAG == "N" ||
+ (feldDetails.VALIDATION_TYPE != "N" &&
+ feldDetails.READ_ONLY == "Y")
+ ) {
+ elem.dataset.colmText = val;
+ elem.value = this.validateEitObj[i].SEGMENT_VALUE_DSP;
+ elem.setAttribute("value", elem.value);
+ }
+ }
+ elem.dataset.hiddenval = val; //hide the value to set it after calling get value set
+ if (
+ feldDetails.CHILD_SEGMENTS_VS_Splited &&
+ feldDetails.CHILD_SEGMENTS_VS_Splited.length > 0
+ ) {
+ let listArray: any = feldDetails.CHILD_SEGMENTS_VS_Splited;
+ listArray.forEach(element => {
+ this.getValueSet(element);
+ });
+ }
+ // var event = new Event('change');
+ // elem.dispatchEvent(event);
+ }
+ } else {
+ if (
+ this.validateEitObj[i].APPLICATION_COLUMN_NAME ==
+ "PEI_OBJECT_VERSION_NUMBER"
+ )
+ obj.peiObjVer = this.validateEitObj[i].NUMBER_VALUE;
+ else if (
+ this.validateEitObj[i].APPLICATION_COLUMN_NAME == "PEI_EXTRA_INFO_ID"
+ )
+ obj.peiExtraInfoID = this.validateEitObj[i].NUMBER_VALUE;
+ }
+ }
+ this.ExtraObj = obj;
+ }
+
+ public getElementsValues(): any {
+ this.updatedValues = []; //fill updated list
+ let valuseArr: any = [];
+ let varcharValue: any = null;
+ let numbervalue: any = 0;
+ let dateValue: any = null;
+ let transNo: number = this.comtransNo;
+ let textValue: any;
+ // if(this.ExtraObj.transactionNo)
+ // transNo=this.ExtraObj.transactionNo;
+ for (let i = 0; i < this.eitResponse.length; i++) {
+ varcharValue = null;
+ numbervalue = null;
+ dateValue = null;
+ /*********set transaction No of the updated object ********/
+ if (this.getPassdirfromNotifiPage) {
+ let updatedObj = this.validateEitObj.find(
+ x =>
+ x.APPLICATION_COLUMN_NAME ==
+ this.eitResponse[i].APPLICATION_COLUMN_NAME
+ );
+ let y = updatedObj;
+ transNo = y.TRANSACTION_NUMBER; // set the transaction number for all items in the updated loop
+ }
+ if (this.eitResponse[i].DISPLAY_FLAG != "N") {
+ if (this.eitResponse[i].VALIDATION_TYPE == "N") {
+ let elem = document.getElementById(
+ this.eitResponse[i].APPLICATION_COLUMN_NAME
+ ) as HTMLInputElement;
+ let elemVal = (document.getElementById(
+ this.eitResponse[i].APPLICATION_COLUMN_NAME
+ ) as HTMLInputElement).value;
+ textValue = elemVal;
+ //let elemVal= (document.getElementById(this.eitResponse[i].APPLICATION_COLUMN_NAME)).value;
+ if (
+ this.eitResponse[i].FORMAT_TYPE == "X" &&
+ this.eitResponse[i].DISPLAY_FLAG != "N"
+ ) {
+ //date
+ elemVal = this.cs.formatDate(elemVal);
+ } else if (
+ this.eitResponse[i].FORMAT_TYPE == "Y" &&
+ this.eitResponse[i].DISPLAY_FLAG != "N"
+ ) {
+ //standard date time
+ // elemVal = elem.dataset.dtvalue;
+ // elemVal = this.cs.formatStandardDate(elemVal);
+ elemVal = this.cs.formatDate(elemVal);
+ } else if (
+ this.eitResponse[i].FORMAT_TYPE == "I" &&
+ this.eitResponse[i].DISPLAY_FLAG != "N"
+ ) {
+ //time
+ if (elemVal.length > 5) {
+ elemVal = elemVal.substring(11, 16);
+ } else {
+ elemVal = elemVal;
+ }
+ }
+ if (this.eitResponse[i].REQUIRED_FLAG == "Y" && !elemVal) {
+ elem.classList.add("requiredClassElm");
+ //this.common.showRequiredMsg();
+ return false;
+ } else {
+ elem.classList.remove("requiredClassElm");
+ }
+ // if (elemVal != 'null'){
+ varcharValue = elemVal;
+ //} else{
+ // elemVal = null;
+ // }
+ valuseArr.push({
+ TRANSACTION_NUMBER: transNo,
+ NAME: this.eitResponse[i].APPLICATION_COLUMN_NAME,
+ VARCHAR2_VALUE: varcharValue,
+ NUMBER_VALUE: numbervalue,
+ DATE_VALUE: dateValue
+ });
+ } else {
+ let x = document.getElementById(
+ this.eitResponse[i].APPLICATION_COLUMN_NAME
+ ) as HTMLSelectElement;
+ if (this.eitResponse[i].READ_ONLY == "Y") {
+ let text = x.value;
+ let val = x.dataset.colmText;
+ varcharValue = val;
+ textValue = text;
+ } else {
+ let val = x.options[x.selectedIndex]
+ ? x.options[x.selectedIndex].value
+ : null;
+ let txt = x.options[x.selectedIndex]
+ ? x.options[x.selectedIndex].text
+ : null;
+ varcharValue = val;
+ textValue = txt;
+ }
+ if (this.eitResponse[i].REQUIRED_FLAG == "Y" && !varcharValue) {
+ x.classList.add("requiredClassElm");
+ //this.common.showRequiredMsg();
+ return false;
+ } else {
+ x.classList.remove("requiredClassElm");
+ }
+
+ valuseArr.push({
+ TRANSACTION_NUMBER: transNo,
+ NAME: this.eitResponse[i].APPLICATION_COLUMN_NAME,
+ VARCHAR2_VALUE: varcharValue,
+ NUMBER_VALUE: numbervalue,
+ DATE_VALUE: dateValue
+ });
+ } //end else
+ } else {
+ let x = document.getElementById(
+ this.eitResponse[i].APPLICATION_COLUMN_NAME
+ ) as HTMLSelectElement;
+ let val = x.dataset.colmText;
+ textValue = x.value;
+ if (this.eitResponse[i].REQUIRED_FLAG == "Y" && !val) {
+ x.classList.add("requiredClassElm");
+ //this.common.showRequiredMsg();
+ return false;
+ } else {
+ x.classList.remove("requiredClassElm");
+ }
+ if (val) varcharValue = val;
+ valuseArr.push({
+ TRANSACTION_NUMBER: transNo,
+ NAME: this.eitResponse[i].APPLICATION_COLUMN_NAME,
+ VARCHAR2_VALUE: varcharValue,
+ NUMBER_VALUE: numbervalue,
+ DATE_VALUE: dateValue
+ });
+ }
+
+ if (this.getPassdirfromNotifiPage) {
+ let updatedObj = this.validateEitObj.find(
+ x =>
+ x.APPLICATION_COLUMN_NAME ==
+ this.eitResponse[i].APPLICATION_COLUMN_NAME
+ );
+ let y = updatedObj;
+ y.VARCHAR2_VALUE = varcharValue;
+ y.NUMBER_VALUE = numbervalue;
+ y.DATE_VALUE = dateValue;
+ y.SEGMENT_VALUE_DSP = textValue;
+ transNo = y.TRANSACTION_NUMBER; // set the transaction number for all items in the updated loop
+ this.updatedValues.push(y);
+ } else {
+ if (this.validateEitObj && this.eitSubmitAction == EIT_ACTION.UPDATE) {
+ let updatedObj = this.validateEitObj.find(
+ x =>
+ x.APPLICATION_COLUMN_NAME ==
+ this.eitResponse[i].APPLICATION_COLUMN_NAME
+ );
+ let y = updatedObj;
+ y.VARCHAR2_VALUE = varcharValue;
+ y.NUMBER_VALUE = numbervalue;
+ y.DATE_VALUE = dateValue;
+ y.SEGMENT_VALUE_DSP = textValue;
+ transNo = transNo; // set the transaction number for all items in the updated loop
+ this.updatedValues.push(y);
+ } else {
+ let y = {
+ TRANSACTION_NUMBER: transNo,
+ VARCHAR2_VALUE: varcharValue,
+ NUMBER_VALUE: numbervalue,
+ DATE_VALUE: dateValue,
+ SEGMENT_VALUE_DSP: textValue,
+ APPLICATION_COLUMN_NAME: this.eitResponse[i]
+ .APPLICATION_COLUMN_NAME,
+ DATATYPE: this.eitResponse[i].DATATYPE,
+ DESC_FLEX_CONTEXT_CODE: this.eitResponse[i].DESC_FLEX_CONTEXT_CODE,
+ DESC_FLEX_NAME: this.eitResponse[i].DESC_FLEX_NAME,
+ DISPLAY_FLAG: this.eitResponse[i].DISPLAY_FLAG,
+ SEGMENT_NAME: this.eitResponse[i].SEGMENT_NAME,
+ SEGMENT_PROMPT: this.eitResponse[i].SEGMENT_PROMPT
+ };
+ transNo = transNo; // set the transaction number for all items in the updated loop
+ this.updatedValues.push(y);
+ }
+ }
+ } // end for
+
+ if (this.getPassdirfromNotifiPage) {
+ let updatedObj1 = this.validateEitObj.find(
+ x => x.APPLICATION_COLUMN_NAME === "PEI_ACTION"
+ );
+ let updatedObj2 = this.validateEitObj.find(
+ x => x.APPLICATION_COLUMN_NAME === "PEI_EXTRA_INFO_ID"
+ );
+ let updatedObj3 = this.validateEitObj.find(
+ x => x.APPLICATION_COLUMN_NAME === "PEI_OBJECT_VERSION_NUMBER"
+ );
+ this.updatedValues.push(updatedObj1);
+ this.updatedValues.push(updatedObj2);
+ this.updatedValues.push(updatedObj3);
+ valuseArr = this.fillExtraInformation(
+ valuseArr,
+ updatedObj1.VARCHAR2_VALUE,
+ updatedObj2.NUMBER_VALUE,
+ updatedObj3.NUMBER_VALUE,
+ transNo
+ );
+ } else {
+ if (this.eitSubmitAction == EIT_ACTION.ADD) {
+ this.updatedValues = this.fillExtraValuesUpdated(
+ this.updatedValues,
+ "NEW_ROW",
+ -1,
+ 0,
+ transNo
+ );
+ valuseArr = this.fillExtraInformation(
+ valuseArr,
+ "NEW_ROW",
+ -1,
+ 0,
+ transNo
+ );
+ } else if (this.eitSubmitAction == EIT_ACTION.UPDATE) {
+ valuseArr = this.fillExtraInformation(
+ valuseArr,
+ "UPDATE_ROW",
+ this.ExtraObj.peiExtraInfoID,
+ this.ExtraObj.peiObjVer,
+ transNo
+ );
+ } else if (this.eitSubmitAction == EIT_ACTION.DELETE) {
+ valuseArr = this.fillExtraInformation(
+ valuseArr,
+ "DELETE_ROW",
+ this.ExtraObj.peiExtraInfoID,
+ this.ExtraObj.peiObjVer,
+ transNo
+ );
+ }
+ }
+ return valuseArr;
+ } // end getElementsValues
+
+ fillExtraValuesUpdated(
+ values: any,
+ peiAction: string,
+ peiExtraInfoID: number,
+ peiObjVer: number,
+ transNo: number
+ ): any {
+ let obj1 = {
+ TRANSACTION_NUMBER: transNo,
+ VARCHAR2_VALUE: peiAction,
+ NUMBER_VALUE: null,
+ DATE_VALUE: null,
+ SEGMENT_VALUE_DSP: "",
+ APPLICATION_COLUMN_NAME: "PEI_ACTION",
+ DATATYPE: "VARCHAR2",
+ DESC_FLEX_CONTEXT_CODE: "",
+ DESC_FLEX_NAME: "",
+ DISPLAY_FLAG: "N",
+ SEGMENT_NAME: "",
+ SEGMENT_PROMPT: ""
+ };
+ let obj2 = {
+ TRANSACTION_NUMBER: 1,
+ APPLICATION_COLUMN_NAME: "PEI_OBJECT_VERSION_NUMBER",
+ VARCHAR2_VALUE: null,
+ NUMBER_VALUE: peiObjVer,
+ DATATYPE: "NUMBER",
+ SEGMENT_VALUE_DSP: "",
+ DATE_VALUE: null,
+ DESC_FLEX_CONTEXT_CODE: "",
+ DESC_FLEX_NAME: "",
+ DISPLAY_FLAG: "N",
+ SEGMENT_NAME: "",
+ SEGMENT_PROMPT: ""
+ };
+ let obj3 = {
+ APPLICATION_COLUMN_NAME: "PEI_EXTRA_INFO_ID",
+ DATATYPE: "NUMBER",
+ DATE_VALUE: null,
+ DESC_FLEX_CONTEXT_CODE: "",
+ DESC_FLEX_NAME: "",
+ DISPLAY_FLAG: "N",
+ NUMBER_VALUE: peiExtraInfoID,
+ SEGMENT_NAME: "",
+ SEGMENT_PROMPT: "",
+ SEGMENT_VALUE_DSP: "",
+ TRANSACTION_NUMBER: transNo,
+ VARCHAR2_VALUE: null
+ };
+ values.push(obj1);
+ values.push(obj2);
+ values.push(obj3);
+ return values;
+ }
+ fillExtraInformation(
+ values: any,
+ peiAction: string,
+ peiExtraInfoID: number,
+ peiObjVer: number,
+ transNo: number
+ ): any {
+ values.push({
+ TRANSACTION_NUMBER: transNo,
+ NAME: "PEI_ACTION",
+ VARCHAR2_VALUE: peiAction,
+ NUMBER_VALUE: null,
+ DATE_VALUE: null
+ });
+ values.push({
+ TRANSACTION_NUMBER: transNo,
+ NAME: "PEI_EXTRA_INFO_ID",
+ VARCHAR2_VALUE: null,
+ NUMBER_VALUE: peiExtraInfoID,
+ DATE_VALUE: null
+ });
+ values.push({
+ TRANSACTION_NUMBER: transNo,
+ NAME: "PEI_OBJECT_VERSION_NUMBER",
+ VARCHAR2_VALUE: null,
+ NUMBER_VALUE: peiObjVer,
+ DATE_VALUE: null
+ });
+ return values;
+ }
+
+ submitEit() {
+ // let list = this.eitRequest.EITTransactionTBL;
+ // this.eitRequest.EITTransactionTBL = this.fixTransactionNo(list);
+
+ this.eitService
+ .submitEit(this.eitRequest)
+ .subscribe((result: AddEitResponse) => {
+ this.handleSubmitEitResult(result);
+ });
+ }
+
+ fixTransactionNo(transactionTBL: any): any[] {
+ let list: any = [];
+ let newIndex: number = 1;
+ let length: number = transactionTBL.length;
+ if (length > 0) {
+ for (let i = 0; i < length; i++) {
+ // let item :any={};
+ const item = Object.assign({}, transactionTBL[i]);
+ let transNo: number = item.TRANSACTION_NUMBER;
+ let obj: any = item;
+ if (i == 0) {
+ obj.TRANSACTION_NUMBER = newIndex;
+ list.push(obj);
+ } else {
+ let prevEl: any = transactionTBL[i - 1].TRANSACTION_NUMBER;
+ if (transNo == prevEl) {
+ obj.TRANSACTION_NUMBER = newIndex;
+ list.push(obj);
+ } else {
+ newIndex++;
+ obj.TRANSACTION_NUMBER = newIndex;
+ list.push(obj);
+ }
+ }
+ }
+ }
+ return list;
+ }
+ handleSubmitEitResult(result) {
+ if (this.cs.validResponse(result)) {
+ this.cs.sharedService.setSharedData(
+ this.eitRequest,
+ EitRequest.SHARED_DATA
+ );
+ this.cs.sharedService.setSharedData(result, AddEitResponse.SHARED_DATA);
+ //this.addrespList=result.SubmitEITTransactionList;
+ // this.itemKey=this.addrespList.P_ITEM_KEY;
+ // this.P_TransactionID=result.SubmitEITTransactionList.P_TRANSACTION_ID;
+ // this.sharedData.setSharedData(result,AddEitResponse.SHARED_DATA);
+
+ // // this.sharedData.setSharedData(result.SubmitEITTransactionList.P_TRANSACTION_ID,"TransactionIDResubmit");
+ // // this.sharedData.setSharedData(this.eitRequest,EitRequest.SHARED_DATA);
+
+ this.cs.sharedService.setSharedData(
+ { isResubmit: false },
+ "confirmAddEITData"
+ );
+ this.cs.openConfirmAddAddress();
+ //this.cs.openConfirmEitPage();
+ // this.navCtrl.push("ConfirmAddEitPage", { isResubmit: false });
+ }
+ }
+
+ validateEITTransaction() {
+ // // let EITTransactionValues:any= [];
+ // let today = new Date(this.Sdate);
+ // let day = today.getDate();
+ // let month = today.getMonth() + 1;
+ // let year = today.getFullYear();
+ // let todayDate = month + '/' + day + '/' + year;
+ // let effectiveDate = todayDate;
+ this.arrValues = this.getElementsValues();
+ if (this.arrValues) {
+ this.eitRequest = {
+ P_SELECTED_EMPLOYEE_NUMBER: this.selEmp,
+ P_MENU_TYPE: this.selMenu.List_Menu.MENU_TYPE,
+ P_SELECTED_RESP_ID: this.respID, //this.selMenu.List_Menu.RESP_ID,//-999,
+ P_FUNCTION_NAME: this.selMenu.GetMenuEntriesList.FUNCTION_NAME,
+ P_DESC_FLEX_CONTEXT_CODE: this.eitResponse[0].DESC_FLEX_CONTEXT_CODE,
+ EITTransactionTBL: this.arrValues,
+ P_COUNTRY_CODE: this.country,
+ P_EFFECTIVE_DATE: moment(this.effectiveDate).format('DD-MMM-YYYY'),
+ P_ACTION: this.selectedStatus.data == '1' ? 'CHANGE' : this.selectedStatus.data == '2' ? 'CORRECT' : 'NEW'
+ };
+
+ this.profileService
+ .submitAddressTransaction(this.eitRequest)
+ .subscribe((result: any) => {
+ this.handleSubmitEitResult(result);
+ // this.handleEITValidateTr(result);
+ });
+ }
+ }
+ private handleEITValidateTr(result) {
+ let data: any = { eitRequest: {}, updated: [] };
+ if (this.cs.validResponse(result)) {
+ // public static SHARED_DATA = 'login-request';
+ this.cs.sharedService.setSharedData(
+ this.eitRequest,
+ EitRequest.SHARED_DATA
+ );
+ if (this.getPassdirfromNotifiPage) {
+ let data: any = { eitRequest: {}, updated: [] };
+ data.eitRequest = this.eitRequest;
+ data.updated = this.updatedValues;
+ // this.viewCtrl.dismiss(data);
+ this.modalController.dismiss(data);
+ // this.closemodal();
+ } else {
+ this.cs.openConfirmAddAddress();
+ //this.submitEit();
+ // this.navCtrl.push("ConfirmAddEitPage");
+ // data = { eitRequest: {}, updated: [] };
+ // data.eitRequest = this.eitRequest;
+ // data.updated = this.updatedValues;
+ // this.viewCtrl.dismiss(data);
+ }
+ } else {
+ this.updatedValues = [];
+ data = { eitRequest: {}, updated: [] };
+ }
+ }
+ getCountires() {
+
+ this.profileService.getCountries({}).subscribe((result) => {
+ console.log(result);
+ this.countries = result['GetCountriesList'];
+ })
+ }
+ fillAbsStructure() {
+ for (let i = 0; i < this.submitAbsObjList.length; i++) {
+ let val: any;
+ if (this.submitAbsObjList[i].VARCHAR2_VALUE)
+ val = this.submitAbsObjList[i].VARCHAR2_VALUE;
+ else if (this.submitAbsObjList[i].DATE_VALUE)
+ val = this.submitAbsObjList[i].DATE_VALUE;
+ else if (this.submitAbsObjList[i].NUMBER_VALUE)
+ val = this.submitAbsObjList[i].NUMBER_VALUE;
+ const elem = document.getElementById(
+ this.submitAbsObjList[i].APPLICATION_COLUMN_NAME
+ ) as HTMLInputElement;
+ //obj.transactionNo=this.submitAbsObjList[i].TRANSACTION_NUMBER;
+ if (elem) {
+ if (val) {
+ let feldDetails = this.eitResponse.find(
+ x =>
+ x.APPLICATION_COLUMN_NAME ==
+ this.submitAbsObjList[i].APPLICATION_COLUMN_NAME
+ );
+ if (feldDetails) {
+ let isStandardDate = this.isStandardDateVal(feldDetails);
+ let isStandardDateTime = this.isStandardDateTimeVal(feldDetails);
+ let isStandardTime = this.isStandardTimeVal(feldDetails);
+ if (isStandardDate) {
+ //elem.value = this.common.reverseFormatDate(val);
+ } else if (isStandardDateTime) {
+ // elem.innerHTML = this.common.reverseFormatStandardDate(val);
+ // elem.dataset.dtvalue = this.common.reverseFormatStandardDate(val);
+ } else if (isStandardTime) {
+ elem.innerHTML = val;
+ elem.dataset.dtvalue = val;
+ } else {
+ elem.value = val;
+ elem.setAttribute("value", elem.value);
+ }
+ if (
+ feldDetails.DISPLAY_FLAG == "N" ||
+ (feldDetails.VALIDATION_TYPE != "N" &&
+ feldDetails.READ_ONLY == "Y")
+ ) {
+ elem.dataset.colmText = val;
+ elem.value = this.submitAbsObjList[i].SEGMENT_VALUE_DSP;
+ elem.setAttribute("value", elem.value);
+ }
+ }
+ elem.dataset.hiddenval = val; //hide the value to set it after calling get value set
+ if (
+ feldDetails.CHILD_SEGMENTS_VS_Splited &&
+ feldDetails.CHILD_SEGMENTS_VS_Splited.length > 0
+ ) {
+ let listArray: any = feldDetails.CHILD_SEGMENTS_VS_Splited;
+ listArray.forEach(element => {
+ this.getValueSet(element);
+ });
+ }
+ //var event = new Event('change');
+ //elem.dispatchEvent(event);
+ }
+ } else {
+ }
+ }
+ //this.ExtraObj=obj;
+ }
+
+}
diff --git a/Mohem/src/app/profile/add-basic-details/add-basic-details.component.html b/Mohem/src/app/profile/add-basic-details/add-basic-details.component.html
new file mode 100644
index 00000000..ce1335e8
--- /dev/null
+++ b/Mohem/src/app/profile/add-basic-details/add-basic-details.component.html
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+ Effective Date
+ {{showEffectiveDate}}
+
+
+
+
+
+
+
+ {{'vacation-rule, next-label' | translate}}
+
+
\ No newline at end of file
diff --git a/Mohem/src/app/profile/add-basic-details/add-basic-details.component.scss b/Mohem/src/app/profile/add-basic-details/add-basic-details.component.scss
new file mode 100644
index 00000000..a6dbf815
--- /dev/null
+++ b/Mohem/src/app/profile/add-basic-details/add-basic-details.component.scss
@@ -0,0 +1,45 @@
+.footer-button {
+ border-radius: 2px;
+ padding: 0 1.1em;
+ min-height: 45px;
+ min-width: 200px;
+ }
+
+ ion-label {
+ color: var(--customnavy) !important;
+ }
+
+ .daynamicForm-Label {
+ font-size: 16px;
+ color: #a2a5a6 !important;
+ display: block;
+ overflow: hidden;
+ -webkit-flex: 1;
+ flex: 1;
+ font-size: inherit;
+ white-space: normal;
+ padding: 5px 0px;
+ margin: 10px auto;
+ padding-left: 10px;
+ }
+
+
+ .header-toolbar-new{
+ --background: #269DB8;
+ }
+ .addEitOkButton{
+ white-space: normal !important;
+ text-transform: capitalize !important;
+ min-height: 45px !important;
+ min-width: 5px !important;
+ margin: 8px !important;
+ background-color: #269DB8;
+ width: 80% !important;
+ color: white!important;
+ border-radius: 16px !important;
+ }
+
+ .country{
+ margin-top: 10px;
+ padding: 10px;
+ }
\ No newline at end of file
diff --git a/Mohem/src/app/profile/add-basic-details/add-basic-details.component.spec.ts b/Mohem/src/app/profile/add-basic-details/add-basic-details.component.spec.ts
new file mode 100644
index 00000000..746ee2f6
--- /dev/null
+++ b/Mohem/src/app/profile/add-basic-details/add-basic-details.component.spec.ts
@@ -0,0 +1,27 @@
+import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { AddBasicDetailsComponent } from './add-basic-details.component';
+
+describe('AddBasicDetailsComponent', () => {
+ let component: AddBasicDetailsComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ AddBasicDetailsComponent ],
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(AddBasicDetailsComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/Mohem/src/app/profile/add-basic-details/add-basic-details.component.ts b/Mohem/src/app/profile/add-basic-details/add-basic-details.component.ts
new file mode 100644
index 00000000..2e1f8ea0
--- /dev/null
+++ b/Mohem/src/app/profile/add-basic-details/add-basic-details.component.ts
@@ -0,0 +1,1773 @@
+import { CommonService } from "src/app/hmg-common/services/common/common.service";
+import { Component, OnInit, ViewChild, ElementRef } from "@angular/core";
+import { MenuEntry } from "src/app/hmg-common/services/menu/models/menu.entry";
+import { MenuResponse } from "src/app/hmg-common/services/menu/models/menu-response";
+import { BasicRequest } from "../models/basic.request";
+import { ModalController } from "@ionic/angular";
+import { TranslatorService } from "src/app/hmg-common/services/translator/translator.service";
+import { EITTransactionsRequest } from "../models/EITTransactionsReq";
+import { ProfileService } from "../service/profile.service";
+import { TextAreaInput } from "src/app/uI-elements/text-area.input";
+import { NumberInput } from "src/app/uI-elements/number.input";
+import { TextInput } from "src/app/uI-elements/text.input";
+import { SelectInput } from "src/app/uI-elements/select.input";
+import { DateInput } from "src/app/uI-elements/date.input";
+import { TimeInput } from "src/app/uI-elements/time.input";
+import { DateTimeInput } from "src/app/uI-elements/date-time.input";
+import { ButtonInput } from "src/app/uI-elements/button.input";
+import { HiddenInput } from "src/app/uI-elements/hidden.input";
+import * as moment from "moment";
+import { DatePicker } from "@ionic-native/date-picker/ngx";
+import { EIT_ACTION } from "../models/submit.eit.action";
+import { AddEitResponse } from "../models/add.eit.response";
+import { element } from '@angular/core/src/render3';
+import { EITNotificatonBodyResponse } from "../models/EITNotificationBodyRes";
+import { ActivatedRoute } from '@angular/router';
+
+@Component({
+ selector: 'app-add-basic-details',
+ templateUrl: './add-basic-details.component.html',
+ styleUrls: ['./add-basic-details.component.scss'],
+})
+export class AddBasicDetailsComponent implements OnInit {
+ @ViewChild("containerDiv") containerDiv: ElementRef;
+ @ViewChild("containerDivTwo") containerDivTwo: ElementRef;
+
+
+ getPassNotificationDetails: any;
+ getPassdirfromNotifiPage: boolean = false;
+ functionName: string = "";
+ menuType: any;
+ private textArea: TextAreaInput;
+ private numberInput: NumberInput;
+ private textInput: TextInput;
+ private selectInput: SelectInput;
+ private dateInput: DateInput;
+ private timeInput: TimeInput;
+ private datetimeInput: DateTimeInput;
+ private buttonInput: ButtonInput;
+ private hiddenInput: HiddenInput;
+ private eitResponse: any;
+ private eitColResponse: any;
+
+ private eitVALSettoCall: any = [];
+ private comtransNo: number = 0;
+ getPassMnuEntryObj: MenuEntry;
+ selMenu: MenuResponse;
+ eitSubmitAction: number = 0; //not submit
+ private basicRequest: BasicRequest;
+ private validateEitObj: any = [];
+ private ExtraObj: any = {};
+ private arrValues: any = [];
+ selEmp: string;
+ respID: number;
+ headerTitle: string = "";
+ isResubmit: boolean = false;
+ private updatedValues: any = [];
+ addEITData: any;
+ direction:string;
+ public targetValue: any;
+ public employeeBasicDetails: any = [];
+ public mutualBasicDetailsArray: any = [];
+ public effectiveDate: string;
+ public showEffectiveDate: string;
+
+
+ constructor(
+ public modalController: ModalController,
+ public cs: CommonService,
+ private ts: TranslatorService,
+ private profileService: ProfileService,
+ public datePicker: DatePicker,
+ public router: ActivatedRoute
+ ) {
+
+ this.router.queryParams.subscribe(params => {
+ this.targetValue = params.targetValue;
+ console.log(this.targetValue);
+ });
+
+ this.employeeBasicDetails = this.cs.sharedService.getSharedData('employeeDetails', false);
+ console.log(this.employeeBasicDetails);
+
+ this.direction = TranslatorService.getCurrentLanguageName();
+ this.selEmp = this.cs.sharedService.getSharedData(
+ MenuResponse.SHARED_SEL_EMP,
+ false
+ );
+ this.respID = this.cs.sharedService.getSharedData(
+ MenuResponse.SHARED_SEL_RESP_ID,
+ false
+ );
+ this.selMenu = new MenuResponse();
+ this.selMenu = this.cs.sharedService.getSharedData(
+ MenuResponse.SHARED_DATA,
+ false
+ );
+ this.addEITData = this.cs.sharedService.getSharedData("AddEITData", false);
+ console.log("addEITData: " + this.addEITData);
+
+ this.basicRequest = new BasicRequest();
+
+ ////*new add*/////
+ /**********resubmit************ */
+ this.getPassNotificationDetails = this.cs.sharedService.getSharedData(EITNotificatonBodyResponse.NOT_WORKLIST, false);//WARINING
+ this.getPassdirfromNotifiPage = this.addEITData.dirfromNotificationPage;
+ if (this.getPassdirfromNotifiPage) {
+ this.functionName = this.getPassNotificationDetails.FUNCTION_NAME; //;this.getPassNotificationDetails.NOTIFICATION_NAME;
+ this.menuType = "E";
+ this.selEmp = this.getPassNotificationDetails.SELECTED_EMPLOYEE_NUMBER;
+ this.respID = -999;
+ this.validateEitObj = this.addEITData.submitEITObjList;
+ let msg: string = "";
+ msg = this.ts.trPK("eit", "update-title");
+ this.headerTitle = msg;
+ } else {
+ this.getPassMnuEntryObj = this.selMenu.GetMenuEntriesList;
+ this.comtransNo = this.addEITData.transNo;
+ this.functionName = this.getPassMnuEntryObj.FUNCTION_NAME;
+ this.menuType = this.selMenu.List_Menu.MENU_TYPE;
+ this.validateEitObj = this.addEITData.submitEITObjList;
+ this.headerTitle = this.selMenu.GetMenuEntriesList.PROMPT;
+ this.eitSubmitAction = this.cs.sharedService.getSharedData(
+ EITTransactionsRequest.SUBMIT_EIT_ACTION
+ );
+ }
+ }
+
+ ngOnInit() {}
+
+ ngAfterViewInit() {
+ this.getEitDffStructure();
+ }
+
+ public getColumnStructure() {
+ const body = {
+ P_FUNCTION_NAME: this.functionName,
+ P_SELECTED_EMPLOYEE_NUMBER: this.selEmp
+ };
+ this.profileService.getColumnStructure(body).subscribe((result: any) => {
+ this.handleBasicColStructureResult(result);
+ });
+ }
+
+ private getEitDffStructure() {
+ const body = {
+ P_FUNCTION_NAME: this.functionName,
+ P_SELECTED_EMPLOYEE_NUMBER: this.selEmp,
+ P_MENU_TYPE: this.menuType,
+ P_SELECTED_RESP_ID: this.respID,
+ P_REQUEST_TYPE: this.getPassMnuEntryObj.REQUEST_TYPE
+ };
+ this.profileService.getBasicDFFStrutre(body).subscribe((result: any) => {
+ this.handleBasicDffStructureResult(result);
+ });
+ }
+
+
+ public handleBasicColStructureResult(result) {
+ if (result.GetBasicDetColsStructureList != null) {
+ this.eitColResponse = result.GetBasicDetColsStructureList;
+ this.drawEitFieldsStatic(result.GetBasicDetColsStructureList);
+ }
+ }
+
+ public handleBasicDffStructureResult(result) {
+ if (result.GetBasicDetDffStructureList != null) {
+ this.getColumnStructure();
+ this.eitResponse = result.GetBasicDetDffStructureList;
+ this.drawEitFields(result.GetBasicDetDffStructureList);
+ }
+ }
+
+ private drawEitFieldsStatic(feildsList) {
+ const containerId = "containerDivTwo";
+ this.eitVALSettoCall = [];
+ for (let i = 0; i < feildsList.length; i++) {
+ let defaultVal: string = "";
+ let defaultValText: string = "";
+
+ if (feildsList[i].DISPLAY_FLAG != "N") {
+ //text , date , time
+ if (feildsList[i].DATATYPE == "VARCHAR2" && feildsList[i].ObjectValuesList === null) {
+ // character
+ this.textInput = new TextInput(
+ feildsList[i].SEGMENT_PROMPT,
+ feildsList[i].APPLICATION_COLUMN_NAME,
+ defaultVal,
+ containerId,
+ defaultValText,
+ feildsList[i].MOBILE_ENABLED,
+ feildsList[i].DISPLAY_FLAG,
+ feildsList[i].REQUIRED_FLAG
+ );
+ } else if (feildsList[i].DATATYPE == "VARCHAR2" && feildsList[i].ObjectValuesList !== null) {
+ this.selectInput = new SelectInput(
+ feildsList[i].SEGMENT_PROMPT,
+ feildsList[i].APPLICATION_COLUMN_NAME,
+ defaultVal,
+ containerId,
+ feildsList[i].MOBILE_ENABLED,
+ feildsList[i].DISPLAY_FLAG,
+ feildsList[i].REQUIRED_FLAG
+ );
+ this.fillStaticDropdownList(
+ feildsList[i].SEGMENT_NAME,
+ feildsList[i].ObjectValuesList,
+ feildsList[i].APPLICATION_COLUMN_NAME
+ );
+ } else if (feildsList[i].DATATYPE == "NUMBER") {
+ this.numberInput = new NumberInput(
+ feildsList[i].SEGMENT_PROMPT,
+ feildsList[i].APPLICATION_COLUMN_NAME,
+ defaultVal,
+ containerId,
+ feildsList[i].MOBILE_ENABLED,
+ feildsList[i].DISPLAY_FLAG,
+ feildsList[i].REQUIRED_FLAG
+ );
+ } else if (feildsList[i].DATATYPE == "DATE" && this.targetValue === 'new') {
+ this.dateInput = new DateInput(
+ feildsList[i].SEGMENT_PROMPT,
+ feildsList[i].APPLICATION_COLUMN_NAME,
+ "",
+ containerId,
+ feildsList[i].MOBILE_ENABLED,
+ feildsList[i].DISPLAY_FLAG,
+ feildsList[i].REQUIRED_FLAG,
+ this.direction
+ );
+
+ }
+ }
+ }
+ this.fillBasicDetailsStructure();
+ }
+
+ public getElementsStaticValues(): any {
+ this.updatedValues = []; //fill updated list
+ let valuseArr: any = [];
+ let varcharValue: any = null;
+ let numbervalue: any = 0;
+ let dateValue: any = null;
+ let transNo: number = 1;
+ let textValue : any;
+
+ for (let i = 0; i < this.eitColResponse.length; i++) {
+ varcharValue = null;
+ numbervalue = null;
+ dateValue = null;
+
+ if (this.eitColResponse[i].DISPLAY_FLAG != "N") {
+ if (this.eitColResponse[i].ObjectValuesList === null) {
+ let elem = document.getElementById( this.eitColResponse[i].APPLICATION_COLUMN_NAME) as HTMLInputElement;
+ let elemVal = elem !== null ? (document.getElementById( this.eitColResponse[i].APPLICATION_COLUMN_NAME ) as HTMLInputElement).value : '';
+ textValue = elemVal;
+
+ if (this.eitColResponse[i].DATATYPE == "VARCHAR2" || this.eitColResponse[i].DATATYPE == "NUMBER") {
+ elemVal = elemVal;
+ } else if (this.eitColResponse[i].DATATYPE == "DATE" && this.targetValue === 'new') {
+ // date
+ elemVal = this.cs.formatDate(elemVal);
+ } else if (this.eitColResponse[i].DATATYPE == "DATE" && this.targetValue === 'correct') {
+ // date
+ elemVal = this.customiseDate(this.effectiveDate);
+ }
+
+ if (this.targetValue === 'new') {
+ if (this.eitColResponse[i].REQUIRED_FLAG == "Y" && !elemVal) {
+ elem.classList.add("requiredClassElm");
+ return false;
+ } else {
+ elem.classList.remove("requiredClassElm");
+ }
+ }
+
+ if (this.eitColResponse[i].DATATYPE == "DATE") {
+ dateValue = elemVal;
+ } else if (this.eitColResponse[i].DATATYPE == "NUMBER") {
+ numbervalue = elemVal;
+ } else {
+ varcharValue = elemVal;
+ }
+
+ valuseArr.push({
+ TRANSACTION_NUMBER: transNo,
+ NAME: this.eitColResponse[i].APPLICATION_COLUMN_NAME,
+ VARCHAR2_VALUE: varcharValue,
+ NUMBER_VALUE: numbervalue,
+ DATE_VALUE: dateValue
+ });
+ } else {
+ let x = document.getElementById(this.eitColResponse[i].APPLICATION_COLUMN_NAME) as HTMLSelectElement;
+
+ let val = x.options[x.selectedIndex] ? x.options[x.selectedIndex].value : null;
+ let txt = x.options[x.selectedIndex] ? x.options[x.selectedIndex].text : null;
+ varcharValue = val;
+ textValue = txt;
+
+ if (x !== null) {
+ if (this.eitColResponse[i].REQUIRED_FLAG == "Y" && !varcharValue) {
+ x.classList.add("requiredClassElm");
+ return false;
+ } else {
+ x.classList.remove("requiredClassElm");
+ }
+ }
+
+ valuseArr.push({
+ TRANSACTION_NUMBER: transNo,
+ NAME: this.eitColResponse[i].APPLICATION_COLUMN_NAME,
+ VARCHAR2_VALUE: varcharValue,
+ NUMBER_VALUE: numbervalue,
+ DATE_VALUE: dateValue
+ });
+ }
+ } else {
+ let x = document.getElementById(this.eitColResponse[i].APPLICATION_COLUMN_NAME) as HTMLSelectElement;
+ let val = x !== null ? x.dataset.colmText : '';
+ textValue = x !== null ? x.value : '';
+
+ if (x !== null) {
+ if (this.eitResponse[i].REQUIRED_FLAG == "Y" && !val) {
+ x.classList.add("requiredClassElm");
+ return false;
+ } else {
+ x.classList.remove("requiredClassElm");
+ }
+ }
+
+ let staticValueBasicDetail = this.employeeBasicDetails.find(
+ x =>
+ x.APPLICATION_COLUMN_NAME ==
+ this.eitColResponse[i].APPLICATION_COLUMN_NAME
+ );
+
+ if (staticValueBasicDetail) {
+ if (this.eitColResponse[i].DATATYPE === 'VARCHAR2') {
+ varcharValue = staticValueBasicDetail.VARCHAR2_VALUE;
+ } else if (this.eitColResponse[i].DATATYPE === 'DATE') {
+ dateValue = staticValueBasicDetail.DATE_VALUE;
+ } else if (this.eitColResponse[i].DATATYPE === 'NUMBER') {
+ numbervalue = staticValueBasicDetail.NUMBER_VALUE;
+ } else {
+ varcharValue = val;
+ }
+ } else {
+ varcharValue = val;
+ }
+
+
+
+ valuseArr.push({
+ TRANSACTION_NUMBER: transNo,
+ NAME: this.eitColResponse[i].APPLICATION_COLUMN_NAME,
+ VARCHAR2_VALUE: varcharValue,
+ NUMBER_VALUE: numbervalue,
+ DATE_VALUE: dateValue
+ });
+ }
+ }
+ return valuseArr;
+ }
+
+ private drawEitFields(feildsList) {
+ const containerId = "containerDiv";
+ this.eitVALSettoCall = [];
+ for (let i = 0; i < feildsList.length; i++) {
+ let defaultVal: string = "";
+ let defaultValText: string = "";
+ // defaultVal = feildsList[i].E_SERVICES_DV.P_ID_COLUMN_NAME
+ // ? feildsList[i].E_SERVICES_DV.P_ID_COLUMN_NAME
+ // : "";
+ // defaultValText = feildsList[i].E_SERVICES_DV.P_VALUE_COLUMN_NAME
+ // ? feildsList[i].E_SERVICES_DV.P_VALUE_COLUMN_NAME
+ // : "";
+
+ if (feildsList[i].DISPLAY_FLAG != "N") {
+ //check if the field should be displayed
+ if (feildsList[i].VALIDATION_TYPE == "N") {
+ //text , date , time
+ if (feildsList[i].FORMAT_TYPE == "C") {
+ // character
+ this.textInput = new TextInput(
+ feildsList[i].SEGMENT_PROMPT,
+ feildsList[i].APPLICATION_COLUMN_NAME,
+ defaultVal,
+ containerId,
+ defaultValText,
+ feildsList[i].MOBILE_ENABLED,
+ feildsList[i].DISPLAY_FLAG,
+ feildsList[i].REQUIRED_FLAG
+ );
+ } else if (feildsList[i].FORMAT_TYPE == "N") {
+ this.numberInput = new NumberInput(
+ feildsList[i].SEGMENT_PROMPT,
+ feildsList[i].APPLICATION_COLUMN_NAME,
+ defaultVal,
+ containerId,
+ feildsList[i].MOBILE_ENABLED,
+ feildsList[i].DISPLAY_FLAG,
+ feildsList[i].REQUIRED_FLAG
+ );
+ } else if (feildsList[i].FORMAT_TYPE == "X") {
+ // standard date
+ if (
+ feildsList[i].DEFAULT_TYPE == "C" ||
+ feildsList[i].DEFAULT_TYPE == "D" ||
+ feildsList[i].DEFAULT_TYPE == "P" ||
+ feildsList[i].DEFAULT_TYPE == "S"
+ ) {
+ //constant
+ this.dateInput = new DateInput(
+ feildsList[i].SEGMENT_PROMPT,
+ feildsList[i].APPLICATION_COLUMN_NAME,
+ this.cs.reverseFormatDate(defaultVal),
+ containerId,
+ feildsList[i].MOBILE_ENABLED,
+ feildsList[i].DISPLAY_FLAG,
+ feildsList[i].REQUIRED_FLAG,
+ this.direction
+ );
+ } else {
+ this.dateInput = new DateInput(
+ feildsList[i].SEGMENT_PROMPT,
+ feildsList[i].APPLICATION_COLUMN_NAME,
+ "",
+ containerId,
+ feildsList[i].MOBILE_ENABLED,
+ feildsList[i].DISPLAY_FLAG,
+ feildsList[i].REQUIRED_FLAG,
+ this.direction
+ );
+ }
+ } else if (feildsList[i].FORMAT_TYPE == "Y") {
+ // standard date time
+ if (
+ feildsList[i].DEFAULT_TYPE == "C" ||
+ feildsList[i].DEFAULT_TYPE == "D" ||
+ feildsList[i].DEFAULT_TYPE == "P" ||
+ feildsList[i].DEFAULT_TYPE == "S"
+ ) {
+ this.datetimeInput = new DateTimeInput(
+ feildsList[i].SEGMENT_PROMPT,
+ feildsList[i].APPLICATION_COLUMN_NAME,
+ this.cs.reverseFormatStandardDate(defaultVal),
+ containerId,
+ feildsList[i].MOBILE_ENABLED,
+ feildsList[i].DISPLAY_FLAG,
+ feildsList[i].REQUIRED_FLAG,
+ this.direction
+ );
+ } else {
+ this.datetimeInput = new DateTimeInput(
+ feildsList[i].SEGMENT_PROMPT,
+ feildsList[i].APPLICATION_COLUMN_NAME,
+ "",
+ containerId,
+ feildsList[i].MOBILE_ENABLED,
+ feildsList[i].DISPLAY_FLAG,
+ feildsList[i].REQUIRED_FLAG,
+ this.direction
+ );
+ }
+ const elem = document.getElementById(
+ feildsList[i].APPLICATION_COLUMN_NAME
+ );
+ } else if (feildsList[i].FORMAT_TYPE == "I") {
+ //time
+ if (
+ feildsList[i].DEFAULT_TYPE == "C" ||
+ feildsList[i].DEFAULT_TYPE == "D" ||
+ feildsList[i].DEFAULT_TYPE == "P" ||
+ feildsList[i].DEFAULT_TYPE == "S"
+ ) {
+ this.timeInput = new TimeInput(
+ feildsList[i].SEGMENT_PROMPT,
+ feildsList[i].APPLICATION_COLUMN_NAME,
+ "",
+ containerId,
+ feildsList[i].MOBILE_ENABLED,
+ feildsList[i].DISPLAY_FLAG,
+ feildsList[i].REQUIRED_FLAG,
+ this.direction
+ );
+ } else {
+ this.timeInput = new TimeInput(
+ feildsList[i].SEGMENT_PROMPT,
+ feildsList[i].APPLICATION_COLUMN_NAME,
+ "",
+ containerId,
+ feildsList[i].MOBILE_ENABLED,
+ feildsList[i].DISPLAY_FLAG,
+ feildsList[i].REQUIRED_FLAG,
+ this.direction
+ );
+ }
+ }
+ } else {
+ if (feildsList[i].READ_ONLY == "Y") {
+ this.textInput = new TextInput(
+ feildsList[i].SEGMENT_PROMPT,
+ feildsList[i].APPLICATION_COLUMN_NAME,
+ defaultVal,
+ containerId,
+ defaultValText,
+ feildsList[i].MOBILE_ENABLED,
+ feildsList[i].DISPLAY_FLAG,
+ feildsList[i].REQUIRED_FLAG
+ );
+ } else {
+ this.selectInput = new SelectInput(
+ feildsList[i].SEGMENT_PROMPT,
+ feildsList[i].APPLICATION_COLUMN_NAME,
+ defaultVal,
+ containerId,
+ feildsList[i].MOBILE_ENABLED,
+ feildsList[i].DISPLAY_FLAG,
+ feildsList[i].REQUIRED_FLAG
+ );
+ this.fillDropdownList(
+ feildsList[i].SEGMENT_NAME,
+ feildsList[i].E_SERVICES_VS,
+ feildsList[i].E_SERVICES_DV
+ );
+ }
+ }
+ this.bindHtmlElemEvents(
+ feildsList[i].APPLICATION_COLUMN_NAME,
+ feildsList[i]
+ );
+ } else {
+ this.hiddenInput = new HiddenInput(
+ defaultVal,
+ feildsList[i].APPLICATION_COLUMN_NAME,
+ defaultValText,
+ containerId
+ );
+ this.bindHtmlElemEvents(
+ feildsList[i].APPLICATION_COLUMN_NAME,
+ feildsList[i]
+ );
+ }
+ }
+ if (this.validateEitObj && this.validateEitObj.length > 0) {
+ this.fillEITStructure();
+ }
+ }
+
+ addFieldToDOM(
+ fieldObject: any,
+ fieldId: any,
+ clickListenerEvent: any,
+ hasClickListener: boolean
+ ) {
+ console.log("AddFieldToDOM");
+ const elemDiv = document.createElement("div");
+ elemDiv.className = "";
+ elemDiv.innerHTML = fieldObject.getTemplate();
+ console.log(this.containerDiv.nativeElement);
+
+ this.containerDiv.nativeElement.appendChild(elemDiv);
+ // document.getElementById('containerDiv').appendChild(elemDiv);
+
+ if (hasClickListener) {
+ let elem = document.getElementById(fieldId);
+ elem.addEventListener("click", e => {
+ clickListenerEvent(e);
+ e.stopImmediatePropagation();
+ });
+ }
+ }
+
+ closeModal() {
+ this.updatedValues = [];
+ this.modalController.dismiss();
+ }
+
+ public showDateTimePicker(elemID, maxSize) {
+ let elem = document.getElementById(elemID) as HTMLDivElement;
+ let date: any;
+ let value = elem.innerHTML;
+ if (value) date = moment(value, "YYYY/MM/DD HH:mm:ss").toDate();
+ else date = new Date();
+ this.datePicker
+ .show({
+ date: date,
+ is24Hour: true,
+ mode: "datetime"
+ })
+ .then(
+ date => {
+ let dateString: string = moment(date).format("YYYY/MM/DD HH:mm:ss");
+ //remove seconds if the maximum size is 17
+ if (maxSize == 17) {
+ elem.innerHTML = dateString.substring(0, 16);
+ elem.dataset.dtvalue = dateString.substring(0, 16);
+ } else {
+ elem.innerHTML = dateString;
+ elem.dataset.dtvalue = dateString;
+ }
+ },
+ err => console.log("Error occurred while getting date: ", err)
+ );
+ }
+
+ public showTimePicker(elemID, maxSize) {
+ let elem = document.getElementById(elemID) as HTMLDivElement;
+ let date: any;
+ let value = elem.innerHTML;
+ if (value) {
+ let nowDate = moment().format("YYYY/MM/DD") + " " + value;
+ date = moment(nowDate, "YYYY/MM/DD HH:mm:ss").toDate();
+ } else {
+ date = new Date();
+ }
+ this.datePicker
+ .show({
+ date: date,
+ is24Hour: true,
+ mode: "time"
+ })
+ .then(
+ date => {
+ let dateString: string = moment(date).format("HH:mm:ss");
+ //remove seconds if the maximum size is 5
+ if (maxSize == 5) {
+ elem.innerHTML = dateString.substring(0, 5);
+ elem.dataset.dtvalue = dateString.substring(0, 5);
+ } else {
+ elem.innerHTML = dateString;
+ elem.dataset.dtvalue = dateString;
+ }
+ },
+ err => console.log("Error occurred while getting date: ", err)
+ );
+ }
+
+ fillDropdownList(segmentName, optionList: any = [], DV: any = "") {
+ let elemID: any = "";
+ let eitObj: any;
+ if (optionList.length > 0) {
+ for (let i = 0; i < this.eitResponse.length; i++) {
+ if (this.eitResponse[i].SEGMENT_NAME == segmentName) {
+ eitObj = this.eitResponse[i];
+ if (
+ this.eitResponse[i].READ_ONLY == "Y" ||
+ this.eitResponse[i].DISPLAY_FLAG == "N"
+ ) {
+ return false;
+ }
+ elemID = this.eitResponse[i].APPLICATION_COLUMN_NAME;
+ break;
+ }
+ }
+ let select = document.getElementById(elemID) as HTMLSelectElement;
+ document.getElementById(elemID).innerHTML = "";
+
+ if (eitObj.IsEmptyOption && eitObj.REQUIRED_FLAG == "N") {
+ var firstoption = document.createElement("option");
+ firstoption.text = this.ts.trPK("general", "choose");
+ firstoption.value = "";
+ select.add(firstoption);
+ }
+ for (let i = 0; i < optionList.length; i++) {
+ var option = document.createElement("option");
+ option.text = optionList[i].VALUE_COLUMN_NAME;
+ option.value = optionList[i].ID_COLUMN_NAME;
+ select.add(option);
+ }
+ if (select.dataset.hiddenval) {
+ select.value = select.dataset.hiddenval;
+ } else {
+ select.value = DV.P_ID_COLUMN_NAME;
+ }
+ select.disabled = false;
+ }
+ }
+
+ public fillStaticDropdownList(segmentName, optionList: any = [], elemID: string) {
+ let eitObj: any;
+ if (optionList.length > 0) {
+ let select = document.getElementById(elemID) as HTMLSelectElement;
+ document.getElementById(elemID).innerHTML = "";
+
+ for (let i = 0; i < optionList.length; i++) {
+ var option = document.createElement("option");
+ option.text = optionList[i].MEANING;
+ option.value = optionList[i].CODE;
+ select.add(option);
+ }
+ }
+ }
+
+ bindHtmlElemEvents(id, obj) {
+ const elem = document.getElementById(id);
+ console.log(elem);
+ console.log(obj);
+ const elemType = elem.tagName;
+ let changeEvent = "ionChange";
+
+ if (elemType == "SELECT") changeEvent = "change";
+
+ try {
+ elem.addEventListener(changeEvent, e => {
+ elem.classList.remove("requiredClassElm");
+ if (
+ obj.CHILD_SEGMENTS_VS_Splited &&
+ obj.CHILD_SEGMENTS_VS_Splited.length > 0
+ ) {
+ let listArray: any = obj.CHILD_SEGMENTS_VS_Splited;
+ listArray.forEach(element => {
+ this.emptyChildElement(element);
+ this.getValueSet(element);
+ });
+ }
+ if (
+ obj.CHILD_SEGMENTS_DV_Splited &&
+ obj.CHILD_SEGMENTS_DV_Splited.length > 0
+ ) {
+ let listArray: any = obj.CHILD_SEGMENTS_DV_Splited;
+ listArray.forEach(element => {
+ this.emptyChildElement(element);
+ for (let i = 0; i < this.eitResponse.length; i++) {
+ if (this.eitResponse[i].SEGMENT_NAME == element) {
+ this.getDefaultValue(
+ this.eitResponse[i],
+ this.eitResponse[i].DESC_FLEX_NAME,
+ this.eitResponse[i].DESC_FLEX_CONTEXT_CODE,
+ this.eitResponse[i].SEGMENT_NAME,
+ this.eitResponse[i].PARENT_SEGMENTS_VS_SplitedVS,
+ this.eitResponse[i].PARENT_SEGMENTS_DV_Splited
+ );
+ }
+ }
+ });
+ }
+ return false;
+ });
+ } catch (e) {
+ console.log(e.status);
+ }
+ }
+
+ public getDefaultValue(
+ obj,
+ descFlexName,
+ descFlexContextCode,
+ segmentName,
+ parentValue,
+ ParentsList
+ ) {
+ let dependenciesList: any = [];
+ let parentVal: any = null;
+ let isStandardDate: boolean = false;
+ let isStandardTimeDate: boolean = false;
+ let isStandardTime: boolean = false;
+ let isHidden: boolean = false;
+ let isReadOnlyList: boolean = false;
+ let isSelectElement: boolean = false;
+ isStandardDate = this.isStandardDate(obj);
+ isStandardTimeDate = this.isStandardDateTime(obj);
+ isStandardTime = this.isStandardTime(obj);
+ if (obj.DISPLAY_FLAG == "N") isHidden = true;
+ if (obj.VALIDATION_TYPE != "N" && obj.READ_ONLY == "Y") {
+ isReadOnlyList = true;
+ }
+ if (obj.VALIDATION_TYPE != "N" && obj.READ_ONLY == "N") {
+ isSelectElement = true;
+ }
+
+ if (
+ parentValue != "" &&
+ (obj.VALIDATION_TYPE == "D" || obj.VALIDATION_TYPE == "Y")
+ ) {
+ let parvalue = this.getDependenciesParams(parentValue);
+ if (parvalue && parvalue[0]) parentVal = parvalue[0].ID_COLUMN_NAME;
+ else {
+ parentVal = null;
+ }
+ if (!parentVal) {
+ return false;
+ }
+ }
+ if (ParentsList != "") {
+ if (parentValue) ParentsList.concat(parentValue);
+ dependenciesList = this.getDependenciesParams(ParentsList);
+ if (!dependenciesList) {
+ return false;
+ }
+ }
+
+ const body = {
+ P_SELECTED_EMPLOYEE_NUMBER: this.selEmp,
+ P_MENU_TYPE: this.menuType,
+ P_SELECTED_RESP_ID: this.respID, //-999,
+ P_DESC_FLEX_NAME: descFlexName,
+ P_DESC_FLEX_CONTEXT_CODE: descFlexContextCode,
+ P_SEGMENT_NAME: segmentName,
+ P_PARENT_VALUE: parentVal,
+ GetValueSetValuesTBL: dependenciesList
+ };
+
+ this.profileService.getDefaultValue(body).subscribe((result: any) => {
+ let elem = this.getElementByName(segmentName);
+ let obj = this.handleDefaultValueResult(result);
+ let val = obj.value;
+ let text = obj.text;
+ if (val==null){val="";}
+ if (text==null){text="";}
+ if (isStandardDate) {
+ console.log("isStandardDate");
+ elem.value = this.cs.reverseFormatDate(val);
+ } else if (isStandardTimeDate) {
+ console.log("isStandardTimeDate");
+ if (val) {
+ elem.dataset.dtvalue = this.cs.reverseFormatStandardDate(val);
+ elem.innerHTML = this.cs.reverseFormatStandardDate(val);
+ } else {
+ elem.dataset.dtvalue = "";
+ elem.innerHTML = "";
+ }
+ } else if (isStandardTime) {
+ console.log("isStandardTime");
+ if (val) {
+ elem.dataset.dtvalue = val;
+ elem.innerHTML = val;
+ elem.value=val;
+ } else {
+ elem.dataset.dtvalue = "";
+ elem.innerHTML = "";
+ }
+ } else {
+ if (isSelectElement) {
+ let elem = this.getSelectElementByName(segmentName);
+ elem = document.getElementById(elem),
+ elem.value = val;
+ } else {
+ elem.value = val;
+ elem.innerText = text;
+ elem.setAttribute("value", val);
+ }
+ }
+ if (isHidden || isReadOnlyList) {
+ if (val) elem.dataset.colmText = val;
+ else elem.dataset.colmText = "";
+ elem.value = text;
+ }
+ var event = new Event("ionChange");
+ elem.dispatchEvent(event);
+ });
+ }
+
+ handleDefaultValueResult(result) {
+ let data = {
+ text: result.GetDefaultValueList.P_VALUE_COLUMN_NAME,
+ value: result.GetDefaultValueList.P_ID_COLUMN_NAME
+ };
+ return data;
+ }
+
+ callValueSet() {
+ for (var i = 0; i < this.eitVALSettoCall.length; i++) {
+ this.getValueSet(this.eitVALSettoCall[i].SEGMENT_NAME);
+ }
+ }
+
+ getParentValue(parentValue) {
+ if (parentValue.length == 0) {
+ for (let i = 0; i < this.eitResponse.length; i++) {
+ if (this.eitResponse[i].SEGMENT_NAME == parentValue[0].Name) {
+ if (this.eitResponse[i].VALIDATION_TYPE == "N") {
+ let val = (document.getElementById(
+ this.eitResponse[i].APPLICATION_COLUMN_NAME
+ ) as HTMLInputElement).value;
+ return val;
+ } else {
+ let x = document.getElementById(
+ this.eitResponse[i].APPLICATION_COLUMN_NAME
+ ) as HTMLSelectElement;
+ if (x.options.length > 0) {
+ let val = x.options[x.selectedIndex]
+ ? x.options[x.selectedIndex].value
+ : null;
+ return val;
+ } else {
+ return "";
+ }
+ }
+ }
+ }
+ } else {
+ return "";
+ }
+ }
+
+ public getValueSet(segmentName) {
+ let descFlexName: any = "";
+ let descFlexContextCode: any = "";
+ let parentValue: any = [];
+ let ParentsList: any = [];
+ let parentVal: any = null;
+ let dependenciesList: any = [];
+ let validationType: string = "";
+
+ for (let i = 0; i < this.eitResponse.length; i++) {
+ if (this.eitResponse[i].SEGMENT_NAME == segmentName) {
+ descFlexName = this.eitResponse[i].DESC_FLEX_NAME;
+ descFlexContextCode = this.eitResponse[i].DESC_FLEX_CONTEXT_CODE;
+ parentValue = this.eitResponse[i].PARENT_SEGMENTS_VS_SplitedVS;
+ ParentsList = this.eitResponse[i].PARENT_SEGMENTS_VS_SplitedVS;
+ validationType = this.eitResponse[i].VALIDATION_TYPE;
+ break;
+ }
+ }
+ if (parentValue != "" && (validationType == "D" || validationType == "Y")) {
+ let parvalue = this.getDependenciesParams(parentValue);
+ if (parvalue && parvalue[0]) parentVal = parvalue[0].ID_COLUMN_NAME;
+ else {
+ parentVal = null;
+ }
+ if (!parentVal) {
+ return false;
+ }
+ }
+ if (ParentsList != "") {
+ dependenciesList = this.getDependenciesParams(ParentsList);
+ if (!dependenciesList) {
+ return false;
+ }
+ }
+ const body = {
+ P_SELECTED_EMPLOYEE_NUMBER: this.selEmp,
+ P_MENU_TYPE: this.menuType,
+ P_SELECTED_RESP_ID: this.respID, //-999,
+ P_DESC_FLEX_NAME: descFlexName,
+ P_DESC_FLEX_CONTEXT_CODE: descFlexContextCode,
+ P_SEGMENT_NAME: segmentName,
+ P_PARENT_VALUE: parentVal,
+ GetValueSetValuesTBL: dependenciesList,
+ P_PAGE_NUM: 1,
+ P_PAGE_LIMIT: 1000
+ };
+
+ this.profileService.getSetValue(body).subscribe((result: any) => {
+ if (result.GetValueSetValuesList != null) {
+ this.fillDropdownList(segmentName, result.GetValueSetValuesList);
+ }
+ });
+ let arr: any = [];
+ return arr;
+ }
+
+ getDependenciesParams(parentsList) {
+ let parentArr: any = [];
+ for (let i = 0; i < parentsList.length; i++) {
+ for (let j = 0; j < this.eitResponse.length; j++) {
+ if (this.eitResponse[j].SEGMENT_NAME == parentsList[i].Name) {
+ if (this.eitResponse[j].DISPLAY_FLAG != "N") {
+ if (this.eitResponse[j].VALIDATION_TYPE == "N") {
+ let idColName: string;
+ let val: any;
+ if (
+ this.eitResponse[j].FORMAT_TYPE == "Y" ||
+ this.eitResponse[j].FORMAT_TYPE == "I"
+ ) {
+ //standard date time or //time
+ let elem = document.getElementById(
+ this.eitResponse[j].APPLICATION_COLUMN_NAME
+ ) as HTMLDivElement;
+ val = elem.dataset.dtvalue;
+ if (
+ (val == undefined || val == "") &&
+ parentsList[i].IsRequired == "REQUIRED"
+ ) {
+ //alert(parentsList[i].Name +" Is required");
+ return false;
+ }
+ idColName = val;
+ if (this.eitResponse[j].FORMAT_TYPE == "Y")
+ idColName = this.cs.formatStandardDate(val);
+ } else {
+ val = (document.getElementById(
+ this.eitResponse[j].APPLICATION_COLUMN_NAME
+ ) as HTMLInputElement).value;
+ if (
+ (val == undefined || val == "") &&
+ parentsList[i].IsRequired == "REQUIRED"
+ ) {
+ //alert(parentsList[i].Name +" Is required");
+ return false;
+ }
+ idColName = val;
+ if (this.eitResponse[j].FORMAT_TYPE == "X") {
+ //date
+ // idColName = this.cs.formatDate(val);
+ idColName = this.cs.formatDateNew(val);
+ }
+ }
+ parentArr.push({
+ SEGMENT_NAME: this.eitResponse[j].SEGMENT_NAME,
+ VALUE_COLUMN_NAME: val,
+ DESCRIPTION: "",
+ ID_COLUMN_NAME: idColName,
+ FLEX_VALUE_SET_NAME: this.eitResponse[j].FLEX_VALUE_SET_NAME
+ });
+ break;
+ } else {
+ if (this.eitResponse[j].READ_ONLY != "Y") {
+ let x = document.getElementById(
+ this.eitResponse[j].APPLICATION_COLUMN_NAME
+ ) as HTMLSelectElement;
+ let text = x.options[x.selectedIndex]
+ ? x.options[x.selectedIndex].text
+ : "";
+ let val = x.options[x.selectedIndex]
+ ? x.options[x.selectedIndex].value
+ : undefined;
+ if (
+ (val == undefined || val == "") &&
+ parentsList[i].IsRequired == "REQUIRED"
+ ) {
+ //alert(parentsList[i].Name +" Is required");
+ return false;
+ } else {
+ }
+ if (text == undefined) {
+ text = "";
+ }
+ parentArr.push({
+ SEGMENT_NAME: this.eitResponse[j].SEGMENT_NAME,
+ VALUE_COLUMN_NAME: text,
+ DESCRIPTION: "",
+ ID_COLUMN_NAME: val,
+ FLEX_VALUE_SET_NAME: this.eitResponse[j].FLEX_VALUE_SET_NAME
+ });
+ break;
+ } else {
+ let x = document.getElementById(
+ this.eitResponse[j].APPLICATION_COLUMN_NAME
+ ) as HTMLInputElement;
+ let text = x.value;
+ let val = x.dataset.colmText;
+ if (
+ (val == undefined || val == "") &&
+ parentsList[i].IsRequired == "REQUIRED"
+ ) {
+ //alert(parentsList[i].Name +" Is required");
+ return false;
+ } else {
+ }
+ if (text == undefined) {
+ text = "";
+ }
+ parentArr.push({
+ SEGMENT_NAME: this.eitResponse[j].SEGMENT_NAME,
+ VALUE_COLUMN_NAME: text,
+ DESCRIPTION: "",
+ ID_COLUMN_NAME: val,
+ FLEX_VALUE_SET_NAME: this.eitResponse[j].FLEX_VALUE_SET_NAME
+ });
+ break;
+ }
+ }
+ } else {
+ let x = document.getElementById(
+ this.eitResponse[j].APPLICATION_COLUMN_NAME
+ ) as HTMLInputElement;
+ let text = x.value;
+ let val = x.dataset.colmText;
+ if (
+ (val == undefined || val == "") &&
+ parentsList[i].IsRequired == "REQUIRED"
+ ) {
+ //alert(parentsList[i].Name +" Is required");
+ return false;
+ } else {
+ }
+ if (text == undefined) {
+ text = "";
+ }
+ parentArr.push({
+ SEGMENT_NAME: this.eitResponse[j].SEGMENT_NAME,
+ VALUE_COLUMN_NAME: text,
+ DESCRIPTION: "",
+ ID_COLUMN_NAME: val,
+ FLEX_VALUE_SET_NAME: this.eitResponse[j].FLEX_VALUE_SET_NAME
+ });
+ break;
+ }
+ }
+ }
+ }
+ return parentArr;
+ }
+
+ emptyChildElement(segmentName) {
+ let elem = this.getElementByName(segmentName);
+ elem.value = null;
+ elem.innerHTML = "";
+ if ("dtvalue" in elem.dataset) {
+ elem.dataset.dtvalue = "";
+ }
+ if ("colmText" in elem.dataset) {
+ elem.dataset.colmText = "";
+ }
+ var event = new Event("change");
+ elem.dispatchEvent(event);
+ elem.classList.remove("requiredClassElm");
+ }
+
+ getRequiredFilds() {
+ for (let i = 0; i < this.eitResponse.length; i++) {
+ if (this.eitResponse[i].REQUIRED_FLAG == "Y") {
+ let elemVal = (document.getElementById(
+ this.eitResponse[i].APPLICATION_COLUMN_NAME
+ ) as HTMLInputElement).value;
+ if (elemVal == "") {
+ //alert(this.eitResponse[i].SEGMENT_NAME+" is required");
+ break;
+ }
+ }
+ }
+ }
+
+ getElementByName(segmentName) {
+ let elemID: any = "";
+ for (let i = 0; i < this.eitResponse.length; i++) {
+ if (this.eitResponse[i].SEGMENT_NAME == segmentName) {
+ elemID = this.eitResponse[i].APPLICATION_COLUMN_NAME;
+ break;
+ }
+ }
+ return document.getElementById(elemID) as HTMLInputElement;
+ }
+
+ getSelectElementByName(segmentName) {
+ let elemID: any = "";
+ for (let i = 0; i < this.eitResponse.length; i++) {
+ if (this.eitResponse[i].SEGMENT_NAME == segmentName) {
+ elemID = this.eitResponse[i].APPLICATION_COLUMN_NAME;
+ break;
+ }
+ }
+ return elemID;
+ }
+
+ isStandardDate(obj: any): boolean {
+ let isSt: boolean = false;
+ if (obj.FORMAT_TYPE == "X") {
+ // standard date
+ if (
+ obj.DEFAULT_TYPE == "C" ||
+ obj.DEFAULT_TYPE == "D" ||
+ obj.DEFAULT_TYPE == "P" ||
+ obj.DEFAULT_TYPE == "S"
+ ) {
+ //constant
+ isSt = true;
+ }
+ }
+ return isSt;
+ }
+
+ isStandardDateTime(obj: any): boolean {
+ let isSt: boolean = false;
+ if (obj.FORMAT_TYPE == "Y") {
+ // standard date time
+ if (
+ obj.DEFAULT_TYPE == "C" ||
+ obj.DEFAULT_TYPE == "D" ||
+ obj.DEFAULT_TYPE == "P" ||
+ obj.DEFAULT_TYPE == "S"
+ ) {
+ //constant
+ isSt = true;
+ }
+ }
+ return isSt;
+ }
+
+ isStandardTime(obj: any): boolean {
+ let isSt: boolean = false;
+ if (obj.FORMAT_TYPE == "I") {
+ // standard date time
+ if (
+ obj.DEFAULT_TYPE == "C" ||
+ obj.DEFAULT_TYPE == "D" ||
+ obj.DEFAULT_TYPE == "P" ||
+ obj.DEFAULT_TYPE == "S"
+ ) {
+ //constant
+ isSt = true;
+ }
+ }
+ return isSt;
+ }
+
+ isStandardDateVal(obj: any): boolean {
+ let isSt: boolean = false;
+ if (obj.FORMAT_TYPE == "X") {
+ // standard date
+ isSt = true;
+ // }
+ }
+ return isSt;
+ }
+
+ isStandardDateTimeVal(obj: any): boolean {
+ let isSt: boolean = false;
+ if (obj.FORMAT_TYPE == "Y") {
+ // standard date time
+ isSt = true;
+ }
+ return isSt;
+ }
+
+ isStandardTimeVal(obj: any): boolean {
+ let isSt: boolean = false;
+ if (obj.FORMAT_TYPE == "I") {
+ // standard time
+ isSt = true;
+ }
+ return isSt;
+ }
+
+ public customiseDate(date: any) {
+ let formatedDate = date.slice(0,9);
+ let newDate = formatedDate.split("/").reverse();
+ const tmp = newDate[2];
+ newDate[2] = newDate[1];
+ newDate[1] = tmp;
+ newDate = newDate.join("/");
+ newDate = newDate + ' 00:00:00';
+ return newDate;
+ }
+
+
+ public fillBasicDetailsStructure() {
+
+ this.mutualBasicDetailsArray = this.mutualBasicDetailsArray.concat(this.eitResponse, this.eitColResponse);
+
+ for (let i = 0; i < this.employeeBasicDetails.length; i++) {
+ let val: any;
+ if (this.employeeBasicDetails[i].VARCHAR2_VALUE) {
+ val = this.employeeBasicDetails[i].VARCHAR2_VALUE;
+ } else if (this.employeeBasicDetails[i].DATE_VALUE) {
+ val = this.customiseDate(this.employeeBasicDetails[i].DATE_VALUE);
+ if (this.employeeBasicDetails[i].APPLICATION_COLUMN_NAME === 'EFFECTIVE_DATE') {
+ this.effectiveDate = this.employeeBasicDetails[i].DATE_VALUE;
+ this.showEffectiveDate = this.employeeBasicDetails[i].SEGMENT_VALUE_DSP;
+ }
+ } else if (this.employeeBasicDetails[i].NUMBER_VALUE) {
+ val = this.employeeBasicDetails[i].NUMBER_VALUE;
+ }
+ const elem = document.getElementById( this.employeeBasicDetails[i].APPLICATION_COLUMN_NAME ) as HTMLInputElement;
+ if (elem) {
+ if (val) {
+ let feldDetails = this.mutualBasicDetailsArray.find(
+ x =>
+ x.APPLICATION_COLUMN_NAME ==
+ this.employeeBasicDetails[i].APPLICATION_COLUMN_NAME
+ );
+ if (feldDetails) {
+ let isStandardTime = this.isStandardTimeVal(feldDetails);
+ if (isStandardTime) {
+ elem.innerHTML = val;
+ elem.dataset.dtvalue = val;
+ } else {
+ elem.value = val;
+ elem.setAttribute("value", elem.value);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ fillEITStructure() {
+ var obj = { peiObjVer: null, peiExtraInfoID: null };
+ for (let i = 0; i < this.validateEitObj.length; i++) {
+ let val: any;
+ if (this.validateEitObj[i].VARCHAR2_VALUE)
+ val = this.validateEitObj[i].VARCHAR2_VALUE;
+ else if (this.validateEitObj[i].DATE_VALUE)
+ val = this.validateEitObj[i].DATE_VALUE;
+ else if (this.validateEitObj[i].NUMBER_VALUE)
+ val = this.validateEitObj[i].NUMBER_VALUE;
+ const elem = document.getElementById(
+ this.validateEitObj[i].APPLICATION_COLUMN_NAME
+ ) as HTMLInputElement;
+ //obj.transactionNo=this.validateEitObj[i].TRANSACTION_NUMBER;
+ if (elem) {
+ if (val) {
+ let feldDetails = this.eitResponse.find(
+ x =>
+ x.APPLICATION_COLUMN_NAME ==
+ this.validateEitObj[i].APPLICATION_COLUMN_NAME
+ );
+ if (feldDetails) {
+ let isStandardDate = this.isStandardDateVal(feldDetails);
+ let isStandardDateTime = this.isStandardDateTimeVal(feldDetails);
+ let isStandardTime = this.isStandardTimeVal(feldDetails);
+ if (isStandardDate) {
+ elem.value = this.cs.reverseFormatDate(val);
+ } else if (isStandardDateTime) {
+ elem.innerHTML = this.cs.reverseFormatStandardDate(val);
+ elem.dataset.dtvalue = this.cs.reverseFormatStandardDate(val);
+ } else if (isStandardTime) {
+ elem.innerHTML = val;
+ elem.dataset.dtvalue = val;
+ } else {
+ elem.value = val;
+ elem.setAttribute("value", elem.value);
+ }
+ if (
+ feldDetails.DISPLAY_FLAG == "N" ||
+ (feldDetails.VALIDATION_TYPE != "N" &&
+ feldDetails.READ_ONLY == "Y")
+ ) {
+ elem.dataset.colmText = val;
+ elem.value = this.validateEitObj[i].SEGMENT_VALUE_DSP;
+ elem.setAttribute("value", elem.value);
+ }
+ }
+ elem.dataset.hiddenval = val; //hide the value to set it after calling get value set
+ if (
+ feldDetails.CHILD_SEGMENTS_VS_Splited &&
+ feldDetails.CHILD_SEGMENTS_VS_Splited.length > 0
+ ) {
+ let listArray: any = feldDetails.CHILD_SEGMENTS_VS_Splited;
+ listArray.forEach(element => {
+ this.getValueSet(element);
+ });
+ }
+ // var event = new Event('change');
+ // elem.dispatchEvent(event);
+ }
+ } else {
+ if (
+ this.validateEitObj[i].APPLICATION_COLUMN_NAME ==
+ "PEI_OBJECT_VERSION_NUMBER"
+ )
+ obj.peiObjVer = this.validateEitObj[i].NUMBER_VALUE;
+ else if (
+ this.validateEitObj[i].APPLICATION_COLUMN_NAME == "PEI_EXTRA_INFO_ID"
+ )
+ obj.peiExtraInfoID = this.validateEitObj[i].NUMBER_VALUE;
+ }
+ }
+ this.ExtraObj = obj;
+ }
+
+ public getElementsValues(): any {
+ this.updatedValues = []; //fill updated list
+ let valuseArr: any = [];
+ let varcharValue: any = null;
+ let numbervalue: any = 0;
+ let dateValue: any = null;
+ let transNo: number = 1;
+ let textValue : any;
+ // if(this.ExtraObj.transactionNo)
+ // transNo=this.ExtraObj.transactionNo;
+ for (let i = 0; i < this.eitResponse.length; i++) {
+ varcharValue = null;
+ numbervalue = null;
+ dateValue = null;
+ /*********set transaction No of the updated object ********/
+ if (this.getPassdirfromNotifiPage) {
+ let updatedObj = this.validateEitObj.find(
+ x =>
+ x.APPLICATION_COLUMN_NAME ==
+ this.eitResponse[i].APPLICATION_COLUMN_NAME
+ );
+ let y = updatedObj;
+ transNo = y.TRANSACTION_NUMBER; // set the transaction number for all items in the updated loop
+ }
+ if (this.eitResponse[i].DISPLAY_FLAG != "N") {
+ if (this.eitResponse[i].VALIDATION_TYPE == "N") {
+ let elem = document.getElementById(
+ this.eitResponse[i].APPLICATION_COLUMN_NAME
+ ) as HTMLInputElement;
+ let elemVal = (document.getElementById(
+ this.eitResponse[i].APPLICATION_COLUMN_NAME
+ ) as HTMLInputElement).value;
+ textValue = elemVal;
+ //let elemVal= (document.getElementById(this.eitResponse[i].APPLICATION_COLUMN_NAME)).value;
+ if (
+ this.eitResponse[i].FORMAT_TYPE == "X" &&
+ this.eitResponse[i].DISPLAY_FLAG != "N"
+ ) {
+ //date
+ elemVal = this.cs.formatDate(elemVal);
+ } else if (
+ this.eitResponse[i].FORMAT_TYPE == "Y" &&
+ this.eitResponse[i].DISPLAY_FLAG != "N"
+ ) {
+ //standard date time
+ // elemVal = elem.dataset.dtvalue;
+ // elemVal = this.cs.formatStandardDate(elemVal);
+ elemVal = this.cs.formatDate(elemVal);
+ } else if (
+ this.eitResponse[i].FORMAT_TYPE == "I" &&
+ this.eitResponse[i].DISPLAY_FLAG != "N"
+ ) {
+ //time
+ if(elemVal.length>5){
+ elemVal = elemVal.substring(11, 16);
+ }else{
+ elemVal = elemVal;
+ }
+ }
+ if (this.eitResponse[i].REQUIRED_FLAG == "Y" && !elemVal) {
+ elem.classList.add("requiredClassElm");
+ //this.common.showRequiredMsg();
+ return false;
+ } else {
+ elem.classList.remove("requiredClassElm");
+ }
+ // if (elemVal != 'null'){
+ varcharValue = elemVal;
+ //} else{
+ // elemVal = null;
+ // }
+ valuseArr.push({
+ TRANSACTION_NUMBER: transNo,
+ NAME: this.eitResponse[i].APPLICATION_COLUMN_NAME,
+ VARCHAR2_VALUE: varcharValue,
+ NUMBER_VALUE: numbervalue,
+ DATE_VALUE: dateValue
+ });
+ } else {
+ let x = document.getElementById(
+ this.eitResponse[i].APPLICATION_COLUMN_NAME
+ ) as HTMLSelectElement;
+ if (this.eitResponse[i].READ_ONLY == "Y") {
+ let text = x.value;
+ let val = x.dataset.colmText;
+ varcharValue = val;
+ textValue = text;
+ } else {
+ let val = x.options[x.selectedIndex]
+ ? x.options[x.selectedIndex].value
+ : null;
+ let txt = x.options[x.selectedIndex]
+ ? x.options[x.selectedIndex].text
+ : null;
+ varcharValue = val;
+ textValue = txt;
+ }
+ if (this.eitResponse[i].REQUIRED_FLAG == "Y" && !varcharValue) {
+ x.classList.add("requiredClassElm");
+ //this.common.showRequiredMsg();
+ return false;
+ } else {
+ x.classList.remove("requiredClassElm");
+ }
+
+ valuseArr.push({
+ TRANSACTION_NUMBER: transNo,
+ NAME: this.eitResponse[i].APPLICATION_COLUMN_NAME,
+ VARCHAR2_VALUE: varcharValue,
+ NUMBER_VALUE: numbervalue,
+ DATE_VALUE: dateValue
+ });
+ } //end else
+ } else {
+ let x = document.getElementById(
+ this.eitResponse[i].APPLICATION_COLUMN_NAME
+ ) as HTMLSelectElement;
+ let val = x.dataset.colmText;
+ textValue = x.value;
+ if (this.eitResponse[i].REQUIRED_FLAG == "Y" && !val) {
+ x.classList.add("requiredClassElm");
+ //this.common.showRequiredMsg();
+ return false;
+ } else {
+ x.classList.remove("requiredClassElm");
+ }
+
+ let staticValueBasicDetail = this.employeeBasicDetails.find(
+ x =>
+ x.APPLICATION_COLUMN_NAME ==
+ this.eitResponse[i].APPLICATION_COLUMN_NAME
+ );
+
+ if (staticValueBasicDetail) {
+ if (staticValueBasicDetail.DATATYPE === 'VARCHAR2') {
+ varcharValue = staticValueBasicDetail.VARCHAR2_VALUE;
+ } else if (staticValueBasicDetail.DATATYPE === 'DATE') {
+ dateValue = staticValueBasicDetail.DATE_VALUE;
+ } else if (staticValueBasicDetail.DATATYPE === 'NUMBER') {
+ numbervalue = staticValueBasicDetail.NUMBER_VALUE;
+ } else {
+ if (val) varcharValue = val;
+ }
+ } else {
+ if (val) varcharValue = val;
+ }
+
+
+ valuseArr.push({
+ TRANSACTION_NUMBER: transNo,
+ NAME: this.eitResponse[i].APPLICATION_COLUMN_NAME,
+ VARCHAR2_VALUE: varcharValue,
+ NUMBER_VALUE: numbervalue,
+ DATE_VALUE: dateValue
+ });
+ }
+
+ if (this.getPassdirfromNotifiPage) {
+ let updatedObj = this.validateEitObj.find(
+ x =>
+ x.APPLICATION_COLUMN_NAME ==
+ this.eitResponse[i].APPLICATION_COLUMN_NAME
+ );
+ let y = updatedObj;
+ y.VARCHAR2_VALUE = varcharValue;
+ y.NUMBER_VALUE = numbervalue;
+ y.DATE_VALUE = dateValue;
+ y.SEGMENT_VALUE_DSP = textValue;
+ transNo = y.TRANSACTION_NUMBER; // set the transaction number for all items in the updated loop
+ this.updatedValues.push(y);
+ } else {
+ if (this.validateEitObj && this.eitSubmitAction == EIT_ACTION.UPDATE) {
+ let updatedObj = this.validateEitObj.find(
+ x =>
+ x.APPLICATION_COLUMN_NAME ==
+ this.eitResponse[i].APPLICATION_COLUMN_NAME
+ );
+ let y = updatedObj;
+ y.VARCHAR2_VALUE = varcharValue;
+ y.NUMBER_VALUE = numbervalue;
+ y.DATE_VALUE = dateValue;
+ y.SEGMENT_VALUE_DSP = textValue;
+ transNo = transNo; // set the transaction number for all items in the updated loop
+ this.updatedValues.push(y);
+ } else {
+ let y = {
+ TRANSACTION_NUMBER: transNo,
+ VARCHAR2_VALUE: varcharValue,
+ NUMBER_VALUE: numbervalue,
+ DATE_VALUE: dateValue,
+ SEGMENT_VALUE_DSP: textValue,
+ APPLICATION_COLUMN_NAME: this.eitResponse[i]
+ .APPLICATION_COLUMN_NAME,
+ DATATYPE: this.eitResponse[i].DATATYPE,
+ DESC_FLEX_CONTEXT_CODE: this.eitResponse[i].DESC_FLEX_CONTEXT_CODE,
+ DESC_FLEX_NAME: this.eitResponse[i].DESC_FLEX_NAME,
+ DISPLAY_FLAG: this.eitResponse[i].DISPLAY_FLAG,
+ SEGMENT_NAME: this.eitResponse[i].SEGMENT_NAME,
+ SEGMENT_PROMPT: this.eitResponse[i].SEGMENT_PROMPT
+ };
+ transNo = transNo; // set the transaction number for all items in the updated loop
+ this.updatedValues.push(y);
+ }
+ }
+ } // end for
+
+ if (this.getPassdirfromNotifiPage) {
+ let updatedObj1 = this.validateEitObj.find(
+ x => x.APPLICATION_COLUMN_NAME === "PEI_ACTION"
+ );
+ let updatedObj2 = this.validateEitObj.find(
+ x => x.APPLICATION_COLUMN_NAME === "PEI_EXTRA_INFO_ID"
+ );
+ let updatedObj3 = this.validateEitObj.find(
+ x => x.APPLICATION_COLUMN_NAME === "PEI_OBJECT_VERSION_NUMBER"
+ );
+ this.updatedValues.push(updatedObj1);
+ this.updatedValues.push(updatedObj2);
+ this.updatedValues.push(updatedObj3);
+ valuseArr = this.fillExtraInformation(
+ valuseArr,
+ updatedObj1.VARCHAR2_VALUE,
+ updatedObj2.NUMBER_VALUE,
+ updatedObj3.NUMBER_VALUE,
+ transNo
+ );
+ } else {
+ if (this.eitSubmitAction == EIT_ACTION.ADD) {
+ this.updatedValues = this.fillExtraValuesUpdated(
+ this.updatedValues,
+ "NEW_ROW",
+ -1,
+ 0,
+ transNo
+ );
+ valuseArr = this.fillExtraInformation(
+ valuseArr,
+ "NEW_ROW",
+ -1,
+ 0,
+ transNo
+ );
+ } else if (this.eitSubmitAction == EIT_ACTION.UPDATE) {
+ valuseArr = this.fillExtraInformation(
+ valuseArr,
+ "UPDATE_ROW",
+ this.ExtraObj.peiExtraInfoID,
+ this.ExtraObj.peiObjVer,
+ transNo
+ );
+ } else if (this.eitSubmitAction == EIT_ACTION.DELETE) {
+ valuseArr = this.fillExtraInformation(
+ valuseArr,
+ "DELETE_ROW",
+ this.ExtraObj.peiExtraInfoID,
+ this.ExtraObj.peiObjVer,
+ transNo
+ );
+ }
+ }
+ return valuseArr;
+ } // end getElementsValues
+
+ fillExtraValuesUpdated(
+ values: any,
+ peiAction: string,
+ peiExtraInfoID: number,
+ peiObjVer: number,
+ transNo: number
+ ): any {
+ let obj1 = {
+ TRANSACTION_NUMBER: transNo,
+ VARCHAR2_VALUE: peiAction,
+ NUMBER_VALUE: null,
+ DATE_VALUE: null,
+ SEGMENT_VALUE_DSP: "",
+ APPLICATION_COLUMN_NAME: "PEI_ACTION",
+ DATATYPE: "VARCHAR2",
+ DESC_FLEX_CONTEXT_CODE: "",
+ DESC_FLEX_NAME: "",
+ DISPLAY_FLAG: "N",
+ SEGMENT_NAME: "",
+ SEGMENT_PROMPT: ""
+ };
+ let obj2 = {
+ TRANSACTION_NUMBER: 1,
+ APPLICATION_COLUMN_NAME: "PEI_OBJECT_VERSION_NUMBER",
+ VARCHAR2_VALUE: null,
+ NUMBER_VALUE: peiObjVer,
+ DATATYPE: "NUMBER",
+ SEGMENT_VALUE_DSP: "",
+ DATE_VALUE: null,
+ DESC_FLEX_CONTEXT_CODE: "",
+ DESC_FLEX_NAME: "",
+ DISPLAY_FLAG: "N",
+ SEGMENT_NAME: "",
+ SEGMENT_PROMPT: ""
+ };
+ let obj3 = {
+ APPLICATION_COLUMN_NAME: "PEI_EXTRA_INFO_ID",
+ DATATYPE: "NUMBER",
+ DATE_VALUE: null,
+ DESC_FLEX_CONTEXT_CODE: "",
+ DESC_FLEX_NAME: "",
+ DISPLAY_FLAG: "N",
+ NUMBER_VALUE: peiExtraInfoID,
+ SEGMENT_NAME: "",
+ SEGMENT_PROMPT: "",
+ SEGMENT_VALUE_DSP: "",
+ TRANSACTION_NUMBER: transNo,
+ VARCHAR2_VALUE: null
+ };
+ values.push(obj1);
+ values.push(obj2);
+ values.push(obj3);
+ return values;
+ }
+
+ fillExtraInformation(
+ values: any,
+ peiAction: string,
+ peiExtraInfoID: number,
+ peiObjVer: number,
+ transNo: number
+ ): any {
+ values.push({
+ TRANSACTION_NUMBER: transNo,
+ NAME: "PEI_ACTION",
+ VARCHAR2_VALUE: peiAction,
+ NUMBER_VALUE: null,
+ DATE_VALUE: null
+ });
+ values.push({
+ TRANSACTION_NUMBER: transNo,
+ NAME: "PEI_EXTRA_INFO_ID",
+ VARCHAR2_VALUE: null,
+ NUMBER_VALUE: peiExtraInfoID,
+ DATE_VALUE: null
+ });
+ values.push({
+ TRANSACTION_NUMBER: transNo,
+ NAME: "PEI_OBJECT_VERSION_NUMBER",
+ VARCHAR2_VALUE: null,
+ NUMBER_VALUE: peiObjVer,
+ DATE_VALUE: null
+ });
+ return values;
+ }
+
+ fixTransactionNo(transactionTBL: any): any[] {
+ let list: any = [];
+ let newIndex: number = 1;
+ let length: number = transactionTBL.length;
+ if (length > 0) {
+ for (let i = 0; i < length; i++) {
+ // let item :any={};
+ const item = Object.assign({}, transactionTBL[i]);
+ let transNo: number = item.TRANSACTION_NUMBER;
+ let obj: any = item;
+ if (i == 0) {
+ obj.TRANSACTION_NUMBER = newIndex;
+ list.push(obj);
+ } else {
+ let prevEl: any = transactionTBL[i - 1].TRANSACTION_NUMBER;
+ if (transNo == prevEl) {
+ obj.TRANSACTION_NUMBER = newIndex;
+ list.push(obj);
+ } else {
+ newIndex++;
+ obj.TRANSACTION_NUMBER = newIndex;
+ list.push(obj);
+ }
+ }
+ }
+ }
+ return list;
+ }
+
+ public handleBasicdetailsResult(result) {
+ if (this.cs.validResponse(result)) {
+ this.cs.sharedService.setSharedData(this.basicRequest, BasicRequest.SHARED_DATA);
+ this.cs.sharedService.setSharedData(result.SubmitBasicDetTransactionList, 'basic-details-response');
+ // this.cs.sharedService.setSharedData({ isResubmit: false },"confirmAddEITData");
+ this.cs.openConfirmBasicDetailsPage();
+ }
+ }
+
+ public submitBasicDetailsTransaction() {
+ this.arrValues = this.getElementsValues();
+ let staticValues = this.getElementsStaticValues();
+ let allStatisDynamicValues = this.arrValues.concat(staticValues);
+
+ if (allStatisDynamicValues) {
+ this.basicRequest = {
+ P_SELECTED_EMPLOYEE_NUMBER: this.selEmp,
+ P_MENU_TYPE: this.selMenu.List_Menu.MENU_TYPE,
+ P_SELECTED_RESP_ID: this.respID,
+ P_FUNCTION_NAME: this.selMenu.GetMenuEntriesList.FUNCTION_NAME,
+ EITTransactionTBL: allStatisDynamicValues,
+ P_ACTION_TYPE: this.targetValue === 'correct' ? 'CORRECT' : 'CHANGE'
+ };
+ console.log(this.basicRequest);
+
+ this.profileService.submitBasicDetailsTransaction(this.basicRequest).subscribe((result: any) => {
+ this.handleBasicdetailsResult(result);
+ });
+ }
+ }
+
+}
+
diff --git a/Mohem/src/app/profile/confirm-address/confirm-address.component.html b/Mohem/src/app/profile/confirm-address/confirm-address.component.html
new file mode 100644
index 00000000..a3a64748
--- /dev/null
+++ b/Mohem/src/app/profile/confirm-address/confirm-address.component.html
@@ -0,0 +1,267 @@
+
+
+
+
+
+
+
+
+
+
+ {{'general, addAttach' | translate}}
+
+
+
+
+
+
+
+
+
+
+
+ {{ 'general, notAttch' | translate}}
+
+
+
+ 0">
+
+
+
+
+ {{attachList.AttachmentID +1 }} .
+
+
+
+
+ {{attachList.P_FILE_NAME }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0">
+
+
+
+
+
+
+ {{attachRes.FILE_NAME }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{'confirmAddEit, comment' | translate}}
+
+
+
+
+
+
+
+ {{'confirmAddEit, approverList' | translate}}
+
+
{{ 'general, empty' | translate}}
+
+ 0">
+
+
+
+
+
+
+
+
+
+
+
+ {{employee.APPROVER}}
+
+
+ {{employee.POSITION_TITLE}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ (isDelete ? 'general, delete' : 'general, submit') | translate }}
+
+
\ No newline at end of file
diff --git a/Mohem/src/app/profile/confirm-address/confirm-address.component.scss b/Mohem/src/app/profile/confirm-address/confirm-address.component.scss
new file mode 100644
index 00000000..2ed98379
--- /dev/null
+++ b/Mohem/src/app/profile/confirm-address/confirm-address.component.scss
@@ -0,0 +1,263 @@
+.footer-button {
+ border-radius: 2px;
+ padding: 0 1.1em;
+ min-height: 45px;
+ min-width: 200px;
+ }
+
+ .imgSize {
+ width: 22px;
+ height: 22px;
+ }
+
+ .Header {
+ font-weight: bold;
+ color: #1a586d !important;
+ font-size: 10px;
+ }
+
+ .tbData {
+ font-size: 10px;
+ }
+
+ .btnBack {
+ background: transparent;
+ float: right;
+ }
+
+ .attachmentDiv{
+ background: #ffffff;
+ height: auto;
+ text-align: center;
+ padding-top: 1px;
+ margin: 10px;
+ border-radius: 15px;
+ border: 1px solid grey;
+ }
+
+ .noDataDiv{
+ background: #ffffff;
+ height: 11%;
+ text-align: center;
+ padding-top: 1px;
+ border-radius: 10px;
+ margin: 10px;
+ border-radius: 5px;
+ }
+ .submitNote{
+ background: #ffffff;
+ height: 80px;
+ padding-top: 1px;
+ margin: 10px;
+ border-radius: 15px;
+ border: 1px solid grey;
+ }
+
+ .approvalList{
+ --background: #f0efef;
+ height: auto;
+ text-align: center;
+ padding-top: 1px;
+ border-radius: 10px;
+ 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;
+ }
+
+ .note-modal {
+ // width: 90%;
+ // height: 50%;
+ // top: 20%;
+ // left: 5%;
+ // right: 5%;
+ // bottom: 5%;
+ background: rgba(0, 0, 0, 0.5) !important;
+ padding: 30% 10% !important;
+ --height: 12cm !important;
+ // --width: 80% !important;
+ --border-radius:20px;
+
+ }
+ .header-toolbar-new{
+ --background: #269DB8;
+ }
+ .title{
+ margin-top: -37px;
+ margin-left: 85px;
+ }
+ .title-ar{
+ margin-top: -37px;
+ margin-right: 101px;
+ }
+ .confirmEitOkButton{
+ white-space: normal !important;
+ text-transform: capitalize !important;
+ min-height: 45px !important;
+ min-width: 5px !important;
+ margin: 8px !important;
+ background-color: #269DB8;
+ width: 80% !important;
+ color: white!important;
+ border-radius: 16px !important;
+ }
+
+ .approvalTitle-ar{
+ font-weight: bold;
+ font-size: 16px;
+ text-align: right;
+
+ }
+ .approvalTitle{
+ font-weight: bold;
+ font-size: 16px;
+ text-align: left;
+ }
+
\ No newline at end of file
diff --git a/Mohem/src/app/profile/confirm-address/confirm-address.component.spec.ts b/Mohem/src/app/profile/confirm-address/confirm-address.component.spec.ts
new file mode 100644
index 00000000..1dd47b56
--- /dev/null
+++ b/Mohem/src/app/profile/confirm-address/confirm-address.component.spec.ts
@@ -0,0 +1,27 @@
+import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { ConfirmAddressComponent } from './confirm-address.component';
+
+describe('ConfirmAddressComponent', () => {
+ let component: ConfirmAddressComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ ConfirmAddressComponent ],
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(ConfirmAddressComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/Mohem/src/app/profile/confirm-address/confirm-address.component.ts b/Mohem/src/app/profile/confirm-address/confirm-address.component.ts
new file mode 100644
index 00000000..20b0a474
--- /dev/null
+++ b/Mohem/src/app/profile/confirm-address/confirm-address.component.ts
@@ -0,0 +1,570 @@
+import { Component, OnInit } from '@angular/core';
+import { ModalController } from '@ionic/angular';
+import { FileUploader } from 'ng2-file-upload';
+import { AddAttachComponent } from 'src/app/eit/add-attach/add-attach.component';
+import { AddEitResponse } from 'src/app/eit/models/add.eit.response';
+import { EitRequest } from 'src/app/eit/models/eit.request';
+import { NotificationGetAttachResponse } from 'src/app/eit/models/NotificationGetAttachRes';
+import { EitService } from 'src/app/eit/services/eit.service';
+import { SubmitEitModalComponent } from 'src/app/eit/submit-eit-modal/submit-eit-modal.component';
+import { CommonService } from 'src/app/hmg-common/services/common/common.service';
+import { MenuResponse } from 'src/app/hmg-common/services/menu/models/menu-response';
+import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
+import { EITNotificatonBodyResponse } from 'src/app/notification/models/EITNotificationBodyRes';
+import { WorkListButtonRequest } from 'src/app/notification/models/NotificationButtonReq';
+import { WorkListAttachViewComponent } from 'src/app/notification/work-list-attach-view/work-list-attach-view.component';
+import { ProfileService } from '../service/profile.service';
+import { SubmitAddressModalComponent } from '../submit-eit-modal/submit-address-modal.component';
+
+@Component({
+ selector: 'app-confirm-address',
+ templateUrl: './confirm-address.component.html',
+ styleUrls: ['./confirm-address.component.scss'],
+})
+export class ConfirmAddressComponent implements OnInit {
+
+ private P_TransactionID: number;
+ private eitRequest: EitRequest;
+ approversList = [];
+ addrespList: any;//EitRespModel;
+ eitComments: string = "";
+ menuType: string = "";
+ selEmp: string = "";
+ respID: number;
+ selMenu: MenuResponse;
+ getAttachList: any;
+ attachListDisplay: any = [];
+ headerTitle: string = "";
+ isTrue: any = 0;
+ attachItems: any;
+ public isResubmitEIT: boolean = false;
+ private itemKey: string = "";
+ private pActionMode: string = "SUBMIT";
+ attachReqObj: WorkListButtonRequest = new WorkListButtonRequest();
+ attachmentRes: any;
+ objIndex1: any;
+ attachListOver: any = [];
+ index: any = 0;
+ getPassNotificationDetails: any;
+ 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'];
+ direction: string;
+
+
+ constructor(public modalController: ModalController, public cs: CommonService, private ts: TranslatorService, private eitService: EitService, public profileService: ProfileService) {
+ this.direction = TranslatorService.getCurrentLanguageName()
+ this.isSubmitBtnClicked = false;
+ this.eitRequest = new EitRequest();
+ }
+
+ ngOnInit() {
+ // console.log('ionViewDidLoad ConfirmAddEitPage');
+ // let selMenu:MenuResponse=new MenuResponse();
+ this.selMenu = this.cs.sharedService.getSharedData(MenuResponse.SHARED_DATA, 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.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, false); //WARINING **
+ // // console.log("this.getPassNotificationDetails: " + this.getPassNotificationDetails);
+ // this.P_TransactionID = this.cs.sharedService.getSharedData("TransactionIDResubmit", true);
+ // // let notification = this.cs.sharedService.getSharedData(EITNotificatonBodyResponse.NOT_WORKLIST, true);
+
+ // this.itemKey = this.getPassNotificationDetails.ITEM_KEY;
+ // this.pActionMode = "RESUBMIT";
+ // this.menuType = "E";
+ // this.respID = -999;
+ this.selEmp = this.eitRequest.P_SELECTED_EMPLOYEE_NUMBER;
+ // this.getApproversList();
+ // this.getAttachment(this.getPassNotificationDetails.NOTIFICATION_ID);
+ // let msg: string = "";
+ // msg = this.ts.trPK("eit", "update-title");
+ // this.headerTitle = msg;
+ // } else {
+ this.menuType = this.selMenu.List_Menu.MENU_TYPE;
+ this.headerTitle = this.selMenu.GetMenuEntriesList.PROMPT;
+ this.addrespList = this.cs.sharedService.getSharedData(AddEitResponse.SHARED_DATA, false);
+ this.itemKey = this.addrespList.SubmitAddressTransactionList.P_ITEM_KEY;
+ this.P_TransactionID = this.addrespList.SubmitAddressTransactionList.P_TRANSACTION_ID;
+ this.isDelete = this.isResubmitEIT = this.cs.sharedService.getSharedData('confirmAddEITData', false).isDelete;
+
+
+ this.getApproversList();
+ // this.confirmAddEit.submitEit(this.eitRequest).subscribe((result: AddEitResponse) => {
+ // this.handleSubmitEitResult(result);
+ // });
+ //}
+ }
+
+ getApproversList() {
+ let body: any = {
+ P_TRANSACTION_ID: this.P_TransactionID,
+ P_AME_TRANSACTION_TYPE: "SSHRMS",
+ P_PAGE_NUM: 1,
+ P_PAGE_LIMIT: 1000
+ }
+ this.eitService.getApproversList(
+ body).
+ subscribe((result: any) => {
+ this.handleApproversResult(result);
+ });
+ }
+
+ handleApproversResult(result) {
+ if (this.cs.validResponse(result)) {
+ this.approversList = result.GetApprovesList;
+ // console.log("approvers List" + this.approversList);
+ }
+ }
+
+ startEitApproval() {
+ //first call add attach inside success call submit
+ // if(this.isResubmitEIT){
+ // this.startEITApprovalProcess();
+ // }else{
+ // let listToAdd:any=[];
+ if (this.attachListOver) {
+ // this.attachListOver.forEach(element => {
+ // if(element.toAdd==true)
+ // listToAdd.push(element);
+ // });
+
+ let request = {
+ AddAttachmentList: this.attachListOver
+ }
+
+ this.eitService.addAttachment(
+ request).
+ subscribe((result: any) => {
+ this.handleAddAttachmentResults(result);
+ });
+ } else {
+ this.startEITApprovalProcess();
+ }
+ // }
+ }
+
+
+ handleAddAttachmentResults(result) {
+
+ if (this.cs.validResponse(result)) {
+ //this.isUpload=true;
+ this.isTrue = 0;
+ for (let i = 0; i < result.AddAttSuccessList.length; i++) {
+ if (!result.AddAttSuccessList[i].AddSuccess) {
+ this.attachListOver[i].isSuccess = false;
+ //this.attachItems[i].isSuccess = false;
+ // if false display cancel button with waring icon or design
+ }// end if
+ else {
+ // if true remove cancel and set isSuccess = true
+ // this.attachItems[i].isSuccess = true;
+ this.attachListOver[i].isSuccess = true;
+ this.isTrue = this.isTrue + 1; //count flag of attach status
+ } // end else
+ } // end for
+
+ if (this.isTrue == result.AddAttSuccessList.length) {
+ this.startEITApprovalProcess();
+ }
+ else {
+ //stope
+ let filtered = this.attachListOver.filter(function (el) { return el.isSuccess == true; });
+ this.attachListOver = filtered;
+ let msg: string = "";
+ msg = this.ts.trPK("eit", "attach-errorMsg");
+ this.cs.presentAlert(msg);
+ // this.cs.presentAlert("fail to upload some attach file");
+ }
+ }
+ }
+
+ startEITApprovalProcess() {
+ let request: any = {};
+ request.P_SELECTED_EMPLOYEE_NUMBER = this.selEmp;
+ request.P_MENU_TYPE = this.menuType;
+ request.P_SELECTED_RESP_ID = this.respID;
+ request.P_TRANSACTION_ID = this.P_TransactionID;
+ request.P_ITEM_KEY = this.itemKey;
+ request.P_ACTION_MODE = this.pActionMode;
+ request.P_COMMENTS = this.eitComments;
+ this.profileService.startEitApprovalProcess(
+ request).
+ subscribe((result: any) => {
+ this.handleResults(result);
+ });
+ }
+ cancelEitProcess() {
+ let body: any = {
+ P_TRANSACTION_ID: this.P_TransactionID
+ }
+ this.eitService.cancelHRTransaction(
+ body).
+ subscribe((result: any) => {
+ this.handleCancelResults(result);
+ });
+
+ }
+ handleCancelResults(result) {
+ if (this.cs.validResponse(result)) {
+ this.isSubmitBtnClicked = false;
+ // this.navCtrl.popToRoot();
+ }
+ }
+ handleResults(result) {
+ if (this.cs.validResponse(result)) {
+ this.isSubmitBtnClicked = true;
+ //if(this.isResubmitEIT==false){
+ let msg: string = this.ts.trPK("eit", "approval-message-success");
+ this.cs.presentAlert(msg);
+ // }
+ // this.navCtrl.popToRoot();
+
+ // this.cs.openHome();
+ this.cs.openNotificationPage();
+ }
+ }
+
+ // addAttachment(){
+ // this.navCtrl.push('AddAttachPage');
+
+
+ // }
+
+ async addAttachment(str: boolean, attachItems: any) {
+ // console.log("inside attach modal");
+ //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
+ });
+
+ modal.onDidDismiss()
+ .then((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 {
+ console.log(data);
+ this.attachListDisplay = data.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.attachListOver = this.attachListDisplay;
+ }
+ // this.attachListDisplay=data;
+
+ // this.attachItems = this.attachListDisplay.map(function(el) {
+ // var o = Object.assign({}, el);
+ // o.isSuccess = false;
+ // return o;
+ // })
+ }
+ });
+
+ return await modal.present();
+ }
+
+ /*****submit modal********/
+ async openSubmitModal() {
+ this.cs.sharedService.setSharedData(this.attachListOver, 'submitAttachmentList');
+ this.cs.sharedService.setSharedData(this.eitComments, 'eitComments');
+ const modal = await this.modalController.create({
+ component: SubmitAddressModalComponent,
+ backdropDismiss: false,
+
+ });
+ modal.cssClass = 'note-modal';
+
+ modal.onDidDismiss()
+ .then((data) => {
+ console.log(data.data);
+
+ if (data.data == "cancel" || data.data == undefined) {
+ return;
+ } else {
+ this.startEitApproval();
+ }
+ });
+
+ return await modal.present();
+
+
+
+
+ }
+
+
+
+ removeFile(objectitem) {
+
+
+ // if (this.attachItems) {
+ // let index1 = this.attachItems.findIndex(item => item == objectitem);
+ // if (index1 > -1) {
+
+ // this.attachItems.splice(index1, 1);
+ // }
+ // this.attachListDisplay =this.attachListDisplay.filter(item => item.AttachmentID !== objectitem.AttachmentID);
+ // }
+ if (this.attachListOver) {
+ let index2 = this.attachListOver.findIndex(item => item == objectitem);
+ if (index2 > -1) {
+ this.attachListOver.splice(index2, 1);
+ }
+ //this.attachListOver =this.attachListOver.filter(item => item.AttachmentID !== objectitem.AttachmentID);
+ }
+ if (this.attachmentRes) {
+
+ let index3 = this.attachmentRes.findIndex(item => item == objectitem);
+ if (index3 > -1) {
+
+ this.attachmentRes.splice(index3, 1);
+ }
+ }
+
+ }
+
+
+ getAttachment(NotificationID) {
+
+ this.attachReqObj.P_NOTIFICATION_ID = NotificationID;
+
+ this.eitService.getAttach(this.attachReqObj).
+ subscribe((result: NotificationGetAttachResponse) => {
+ this.handleWorkListAttachResult(result);
+ });
+ }
+
+ handleWorkListAttachResult(result) {
+ if (this.cs.validResponse(result)) {
+ // this.sharedData.setSharedData(result, WorKListResponse.SHARED_DATA);
+ if (result.GetAttachementList != null) {
+ this.attachmentRes = result.GetAttachementList;
+ } // if result == null
+ } // valid it
+
+ }
+
+ async OpenAttachFiles(value, Type) {
+ // let modal: Modal = this.modalCtrl.create('WorkListAttachViewPage', { displayData: value, TypeData: Type });
+ // modal.present();
+
+ this.cs.sharedService.setSharedData({ displayData: value, TypeData: Type }, 'WorkListAttachViewPage');
+ const modal = await this.modalController.create({
+ component: WorkListAttachViewComponent
+ });
+
+ modal.onDidDismiss()
+ .then((data) => {
+ });
+
+ return await modal.present();
+ }
+
+
+ delelteFile(attach) {
+ // let alert = this.cs.confirmAlertDialog(this.translate.translate('general.deletePerm'));
+
+ this.cs.confirmAlertDialog((data) => {
+ if (data == true) {
+ this.continueDelete(attach);
+ }
+ }, this.ts.trPK('general', 'ok'), () => {
+
+ }, this.ts.trPK('general', 'cancel'), this.ts.trPK('general', 'alert'), this.ts.trPK('eit', 'delete-perm'));
+
+ // alert.onDidDismiss((data) => {
+ // if (data == true) {
+ // this.continueDelete(attach);
+ // }
+ // });
+
+
+ }
+ continueDelete(attach) {
+ // console.log("trst" + attach.ATTACHED_DOCUMENT_ID);
+ let req = {
+ P_ATTACHED_DOCUMENT_ID: attach.ATTACHED_DOCUMENT_ID
+ }
+ this.eitService.deleteAttach(req).
+ subscribe((result: any) => {
+ if (this.cs.validResponse(result)) {
+ if (result.DeleteAttachmentList.P_RETURN_STATUS === "S") {
+ this.getAttachment(this.getPassNotificationDetails.NOTIFICATION_ID);
+ let msg: string = "";
+ msg = this.ts.trPK("eit", "deleteAttach");
+ this.cs.presentAlert(msg);
+ //this.cs.presentAlert("Success" );
+ }
+ }
+ });
+ }
+
+ updateFile(attachList, attachDocID) {
+ //console.log("updateFile" + attachDocID.ATTACHED_DOCUMENT_ID);
+ let req = {
+ P_ATTACHED_DOCUMENT_ID: attachDocID,
+ P_FILE_DATA: attachList[0].P_FILE_DATA,
+ P_FILE_NAME: attachList[0].P_FILE_NAME,
+ P_FILE_CONTENT_TYPE: attachList[0].P_FILE_CONTENT_TYPE
+ }
+ this.eitService.updateAttach(req).
+ subscribe((result: any) => {
+ if (this.cs.validResponse(result)) {
+ if (result.MessageStatus == 1) {
+ let msg: string = "";
+ msg = this.ts.trPK("eit", "attachUpdate");
+ this.cs.presentAlert(msg);
+ // this.cs.presentAlert("updated attach successfully" );
+
+ //flag to disable update and enable remove
+ // this.removeFile(attachList);
+ this.getAttachment(this.getPassNotificationDetails.NOTIFICATION_ID);
+ }
+ } // val
+ });
+ }
+
+
+ ionViewWillLeave() {
+ if (this.P_TransactionID && this.isSubmitBtnClicked == false)
+ 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()
+ });
+ });
+ }
+ });
+
+
+ onFileSelectedclick(event) {
+ event.target.value = '';
+ }
+
+
+
+ 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.P_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/profile/confirm-basic-details/confirm-basic-details.component.html b/Mohem/src/app/profile/confirm-basic-details/confirm-basic-details.component.html
new file mode 100644
index 00000000..0505227b
--- /dev/null
+++ b/Mohem/src/app/profile/confirm-basic-details/confirm-basic-details.component.html
@@ -0,0 +1,128 @@
+
+
+
+
+
+
+
+
+
+
+ {{'general, addAttach' | translate}}
+
+
+
+
+
+
+
+
+
+
+
+ {{ 'general, notAttch' | translate}}
+
+
+
+ 0">
+
+
+
+
+ {{attachList.AttachmentID +1 }} .
+
+
+
+
+ {{attachList.P_FILE_NAME }}
+
+
+
+
+
+
+
+
+
+
+
+
+ 0">
+
+
+
+
+
+
+ {{attachRes.FILE_NAME }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{'confirmAddEit, comment' | translate}}
+
+
+
+
+
+
+ {{'confirmAddEit, approverList' | translate}}
+
+
{{ 'general, empty' | translate}}
+
+ 0">
+
+
+
+
+
+
+
+
+
+
+
+ {{employee.APPROVER}}
+
+
+ {{employee.POSITION_TITLE}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ 'general, submit' | translate }}
+
+
\ No newline at end of file
diff --git a/Mohem/src/app/profile/confirm-basic-details/confirm-basic-details.component.scss b/Mohem/src/app/profile/confirm-basic-details/confirm-basic-details.component.scss
new file mode 100644
index 00000000..2ed98379
--- /dev/null
+++ b/Mohem/src/app/profile/confirm-basic-details/confirm-basic-details.component.scss
@@ -0,0 +1,263 @@
+.footer-button {
+ border-radius: 2px;
+ padding: 0 1.1em;
+ min-height: 45px;
+ min-width: 200px;
+ }
+
+ .imgSize {
+ width: 22px;
+ height: 22px;
+ }
+
+ .Header {
+ font-weight: bold;
+ color: #1a586d !important;
+ font-size: 10px;
+ }
+
+ .tbData {
+ font-size: 10px;
+ }
+
+ .btnBack {
+ background: transparent;
+ float: right;
+ }
+
+ .attachmentDiv{
+ background: #ffffff;
+ height: auto;
+ text-align: center;
+ padding-top: 1px;
+ margin: 10px;
+ border-radius: 15px;
+ border: 1px solid grey;
+ }
+
+ .noDataDiv{
+ background: #ffffff;
+ height: 11%;
+ text-align: center;
+ padding-top: 1px;
+ border-radius: 10px;
+ margin: 10px;
+ border-radius: 5px;
+ }
+ .submitNote{
+ background: #ffffff;
+ height: 80px;
+ padding-top: 1px;
+ margin: 10px;
+ border-radius: 15px;
+ border: 1px solid grey;
+ }
+
+ .approvalList{
+ --background: #f0efef;
+ height: auto;
+ text-align: center;
+ padding-top: 1px;
+ border-radius: 10px;
+ 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;
+ }
+
+ .note-modal {
+ // width: 90%;
+ // height: 50%;
+ // top: 20%;
+ // left: 5%;
+ // right: 5%;
+ // bottom: 5%;
+ background: rgba(0, 0, 0, 0.5) !important;
+ padding: 30% 10% !important;
+ --height: 12cm !important;
+ // --width: 80% !important;
+ --border-radius:20px;
+
+ }
+ .header-toolbar-new{
+ --background: #269DB8;
+ }
+ .title{
+ margin-top: -37px;
+ margin-left: 85px;
+ }
+ .title-ar{
+ margin-top: -37px;
+ margin-right: 101px;
+ }
+ .confirmEitOkButton{
+ white-space: normal !important;
+ text-transform: capitalize !important;
+ min-height: 45px !important;
+ min-width: 5px !important;
+ margin: 8px !important;
+ background-color: #269DB8;
+ width: 80% !important;
+ color: white!important;
+ border-radius: 16px !important;
+ }
+
+ .approvalTitle-ar{
+ font-weight: bold;
+ font-size: 16px;
+ text-align: right;
+
+ }
+ .approvalTitle{
+ font-weight: bold;
+ font-size: 16px;
+ text-align: left;
+ }
+
\ No newline at end of file
diff --git a/Mohem/src/app/profile/confirm-basic-details/confirm-basic-details.component.spec.ts b/Mohem/src/app/profile/confirm-basic-details/confirm-basic-details.component.spec.ts
new file mode 100644
index 00000000..5b29d37e
--- /dev/null
+++ b/Mohem/src/app/profile/confirm-basic-details/confirm-basic-details.component.spec.ts
@@ -0,0 +1,27 @@
+import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { ConfirmBasicDetailsComponent } from './confirm-basic-details.component';
+
+describe('ConfirmBasicDetailsComponent', () => {
+ let component: ConfirmBasicDetailsComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ ConfirmBasicDetailsComponent ],
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(ConfirmBasicDetailsComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/Mohem/src/app/profile/confirm-basic-details/confirm-basic-details.component.ts b/Mohem/src/app/profile/confirm-basic-details/confirm-basic-details.component.ts
new file mode 100644
index 00000000..ef49d9e4
--- /dev/null
+++ b/Mohem/src/app/profile/confirm-basic-details/confirm-basic-details.component.ts
@@ -0,0 +1,435 @@
+import { Component, OnInit } from '@angular/core';
+import { ModalController } from '@ionic/angular';
+import { FileUploader } from 'ng2-file-upload';
+import { AddAttachComponent } from 'src/app/eit/add-attach/add-attach.component';
+import { AddEitResponse } from 'src/app/eit/models/add.eit.response';
+import { BasicRequest } from "../models/basic.request";
+import { NotificationGetAttachResponse } from 'src/app/eit/models/NotificationGetAttachRes';
+import { EitService } from 'src/app/eit/services/eit.service';
+import { SubmitEitModalComponent } from 'src/app/eit/submit-eit-modal/submit-eit-modal.component';
+import { CommonService } from 'src/app/hmg-common/services/common/common.service';
+import { MenuResponse } from 'src/app/hmg-common/services/menu/models/menu-response';
+import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
+import { EITNotificatonBodyResponse } from 'src/app/notification/models/EITNotificationBodyRes';
+import { WorkListButtonRequest } from 'src/app/notification/models/NotificationButtonReq';
+import { WorkListAttachViewComponent } from 'src/app/notification/work-list-attach-view/work-list-attach-view.component';
+import { ProfileService } from '../service/profile.service';
+import { SubmitAddressModalComponent } from '../submit-eit-modal/submit-address-modal.component';
+
+@Component({
+ selector: 'app-confirm-basic-details',
+ templateUrl: './confirm-basic-details.component.html',
+ styleUrls: ['./confirm-basic-details.component.scss'],
+})
+export class ConfirmBasicDetailsComponent implements OnInit {
+
+ private P_TransactionID: number;
+ private basicRequest: BasicRequest;
+ approversList = [];
+ basicResponseList: any;
+ eitComments: string = "";
+ menuType: string = "";
+ selEmp: string = "";
+ respID: number;
+ selMenu: MenuResponse;
+ getAttachList: any;
+ attachListDisplay: any = [];
+ headerTitle: string = "";
+ isTrue: any = 0;
+ attachItems: any;
+ public isResubmitEIT: boolean = false;
+ private itemKey: string = "";
+ private pActionMode: string = "SUBMIT";
+ attachReqObj: WorkListButtonRequest = new WorkListButtonRequest();
+ attachmentRes: any;
+ objIndex1: any;
+ attachListOver: any = [];
+ index: any = 0;
+ getPassNotificationDetails: any;
+ 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'];
+ direction: string;
+
+
+ constructor(public modalController: ModalController, public cs: CommonService, private ts: TranslatorService, private eitService: EitService, public profileService: ProfileService) {
+ this.direction = TranslatorService.getCurrentLanguageName()
+ this.isSubmitBtnClicked = false;
+ this.basicRequest = new BasicRequest();
+ }
+
+ ngOnInit() {
+ this.selMenu = this.cs.sharedService.getSharedData(MenuResponse.SHARED_DATA, 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.basicRequest = this.cs.sharedService.getSharedData(BasicRequest.SHARED_DATA, false);
+
+ this.selEmp = this.basicRequest.P_SELECTED_EMPLOYEE_NUMBER;
+
+ this.menuType = this.selMenu.List_Menu.MENU_TYPE;
+ this.headerTitle = this.selMenu.GetMenuEntriesList.PROMPT;
+ this.basicResponseList = this.cs.sharedService.getSharedData('basic-details-response', false);
+ console.log(this.basicResponseList);
+ this.itemKey = this.basicResponseList.P_ITEM_KEY;
+ this.P_TransactionID = this.basicResponseList.P_TRANSACTION_ID;
+ // this.isDelete = this.isResubmitEIT = this.cs.sharedService.getSharedData('confirmAddEITData', false).isDelete;
+
+ this.getApproversList();
+
+ }
+
+ getApproversList() {
+ let body: any = {
+ P_TRANSACTION_ID: this.P_TransactionID,
+ P_AME_TRANSACTION_TYPE: "SSHRMS",
+ P_PAGE_NUM: 1,
+ P_PAGE_LIMIT: 1000
+ }
+ this.eitService.getApproversList(body).subscribe((result: any) => {
+ this.handleApproversResult(result);
+ });
+ }
+
+ handleApproversResult(result) {
+ if (this.cs.validResponse(result)) {
+ this.approversList = result.GetApprovesList;
+ }
+ }
+
+ startEitApproval() {
+ if (this.attachListOver) {
+ let request = {
+ AddAttachmentList: this.attachListOver
+ }
+
+ this.eitService.addAttachment(
+ request).
+ subscribe((result: any) => {
+ this.handleAddAttachmentResults(result);
+ });
+ } else {
+ this.startBasicDetailsApprovalProcess();
+ }
+ }
+
+
+ handleAddAttachmentResults(result) {
+
+ if (this.cs.validResponse(result)) {
+ this.isTrue = 0;
+ for (let i = 0; i < result.AddAttSuccessList.length; i++) {
+ if (!result.AddAttSuccessList[i].AddSuccess) {
+ this.attachListOver[i].isSuccess = false;
+ //this.attachItems[i].isSuccess = false;
+ // if false display cancel button with waring icon or design
+ }// end if
+ else {
+ // if true remove cancel and set isSuccess = true
+ // this.attachItems[i].isSuccess = true;
+ this.attachListOver[i].isSuccess = true;
+ this.isTrue = this.isTrue + 1; //count flag of attach status
+ } // end else
+ } // end for
+
+ if (this.isTrue == result.AddAttSuccessList.length) {
+ this.startBasicDetailsApprovalProcess();
+ }
+ else {
+ //stope
+ let filtered = this.attachListOver.filter(function (el) { return el.isSuccess == true; });
+ this.attachListOver = filtered;
+ let msg: string = "";
+ msg = this.ts.trPK("eit", "attach-errorMsg");
+ this.cs.presentAlert(msg);
+ }
+ }
+ }
+
+ startBasicDetailsApprovalProcess() {
+ let request: any = {};
+ request.P_SELECTED_EMPLOYEE_NUMBER = this.selEmp;
+ request.P_MENU_TYPE = this.menuType;
+ request.P_SELECTED_RESP_ID = this.respID;
+ request.P_TRANSACTION_ID = this.P_TransactionID;
+ request.P_ITEM_KEY = this.itemKey;
+ request.P_ACTION_MODE = this.pActionMode;
+ request.P_COMMENTS = this.eitComments;
+ this.profileService.startBasicDetailsApprovalProcess(
+ request).
+ subscribe((result: any) => {
+ this.handleResults(result);
+ });
+ }
+ cancelEitProcess() {
+ let body: any = {
+ P_TRANSACTION_ID: this.P_TransactionID
+ }
+ this.eitService.cancelHRTransaction(
+ body).
+ subscribe((result: any) => {
+ this.handleCancelResults(result);
+ });
+
+ }
+ handleCancelResults(result) {
+ if (this.cs.validResponse(result)) {
+ this.isSubmitBtnClicked = false;
+ }
+ }
+ handleResults(result) {
+ if (this.cs.validResponse(result)) {
+ this.isSubmitBtnClicked = true;
+ let msg: string = this.ts.trPK("eit", "approval-message-success");
+ this.cs.presentAlert(msg);
+ this.cs.openNotificationPage();
+ }
+ }
+
+ async addAttachment(str: boolean, attachItems: any) {
+ //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
+ });
+
+ modal.onDidDismiss()
+ .then((data) => {
+ if (data == "cancel" || data == "undefined") {
+ return;
+ } else {
+ if (!str) {
+ this.updateFile(data, attachDocID);
+ } else {
+ console.log(data);
+ this.attachListDisplay = data.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;
+ }
+ }
+ });
+
+ return await modal.present();
+ }
+
+ /*****submit modal********/
+ async openSubmitModal() {
+ this.cs.sharedService.setSharedData(this.attachListOver, 'submitAttachmentList');
+ this.cs.sharedService.setSharedData(this.eitComments, 'eitComments');
+ const modal = await this.modalController.create({
+ component: SubmitAddressModalComponent,
+ backdropDismiss: false,
+
+ });
+ modal.cssClass = 'note-modal';
+
+ modal.onDidDismiss()
+ .then((data) => {
+ console.log(data.data);
+
+ if (data.data == "cancel" || data.data == undefined) {
+ return;
+ } else {
+ this.startEitApproval();
+ }
+ });
+
+ return await modal.present();
+ }
+
+
+
+ removeFile(objectitem) {
+ if (this.attachListOver) {
+ let index2 = this.attachListOver.findIndex(item => item == objectitem);
+ if (index2 > -1) {
+ this.attachListOver.splice(index2, 1);
+ }
+ }
+ if (this.attachmentRes) {
+ let index3 = this.attachmentRes.findIndex(item => item == objectitem);
+ if (index3 > -1) {
+ this.attachmentRes.splice(index3, 1);
+ }
+ }
+
+ }
+
+
+ getAttachment(NotificationID) {
+ this.attachReqObj.P_NOTIFICATION_ID = NotificationID;
+ this.eitService.getAttach(this.attachReqObj).
+ subscribe((result: NotificationGetAttachResponse) => {
+ this.handleWorkListAttachResult(result);
+ });
+ }
+
+ handleWorkListAttachResult(result) {
+ if (this.cs.validResponse(result)) {
+ if (result.GetAttachementList != null) {
+ this.attachmentRes = result.GetAttachementList;
+ } // if result == null
+ } // valid it
+
+ }
+
+ async OpenAttachFiles(value, Type) {
+ this.cs.sharedService.setSharedData({ displayData: value, TypeData: Type }, 'WorkListAttachViewPage');
+ const modal = await this.modalController.create({
+ component: WorkListAttachViewComponent
+ });
+
+ modal.onDidDismiss()
+ .then((data) => {
+ });
+ return await modal.present();
+ }
+
+
+ delelteFile(attach) {
+ this.cs.confirmAlertDialog((data) => {
+ if (data == true) {
+ this.continueDelete(attach);
+ }
+ }, this.ts.trPK('general', 'ok'), () => {
+
+ }, this.ts.trPK('general', 'cancel'), this.ts.trPK('general', 'alert'), this.ts.trPK('eit', 'delete-perm'));
+ }
+
+ continueDelete(attach) {
+ let req = {
+ P_ATTACHED_DOCUMENT_ID: attach.ATTACHED_DOCUMENT_ID
+ }
+ this.eitService.deleteAttach(req).
+ subscribe((result: any) => {
+ if (this.cs.validResponse(result)) {
+ if (result.DeleteAttachmentList.P_RETURN_STATUS === "S") {
+ this.getAttachment(this.getPassNotificationDetails.NOTIFICATION_ID);
+ let msg: string = "";
+ msg = this.ts.trPK("eit", "deleteAttach");
+ this.cs.presentAlert(msg);
+ }
+ }
+ });
+ }
+
+ updateFile(attachList, attachDocID) {
+ let req = {
+ P_ATTACHED_DOCUMENT_ID: attachDocID,
+ P_FILE_DATA: attachList[0].P_FILE_DATA,
+ P_FILE_NAME: attachList[0].P_FILE_NAME,
+ P_FILE_CONTENT_TYPE: attachList[0].P_FILE_CONTENT_TYPE
+ }
+ this.eitService.updateAttach(req).
+ subscribe((result: any) => {
+ if (this.cs.validResponse(result)) {
+ if (result.MessageStatus == 1) {
+ let msg: string = "";
+ msg = this.ts.trPK("eit", "attachUpdate");
+ this.cs.presentAlert(msg);
+ this.getAttachment(this.getPassNotificationDetails.NOTIFICATION_ID);
+ }
+ }
+ });
+ }
+
+
+ ionViewWillLeave() {
+ if (this.P_TransactionID && this.isSubmitBtnClicked == false)
+ 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()
+ });
+ });
+ }
+ });
+
+
+ onFileSelectedclick(event) {
+ event.target.value = '';
+ }
+
+
+
+ onFileSelected(input) {
+
+ 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];
+ 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);
+ 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.P_TransactionID
+ })
+
+ } catch (e) {
+ }
+ }
+
+}
+
diff --git a/Mohem/src/app/profile/edit-profile/edit-profile.component.html b/Mohem/src/app/profile/edit-profile/edit-profile.component.html
index 32b4dd9d..86ee5a08 100644
--- a/Mohem/src/app/profile/edit-profile/edit-profile.component.html
+++ b/Mohem/src/app/profile/edit-profile/edit-profile.component.html
@@ -1,121 +1,153 @@
+ [headerText]="'userProfile, title' | translate">