master details : ps
This commit is contained in:
commit
8c6aeee90f
48
ng6-seed/package-lock.json
generated
48
ng6-seed/package-lock.json
generated
@ -4273,8 +4273,7 @@
|
||||
"ansi-regex": {
|
||||
"version": "2.1.1",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
"dev": true
|
||||
},
|
||||
"aproba": {
|
||||
"version": "1.2.0",
|
||||
@ -4295,14 +4294,12 @@
|
||||
"balanced-match": {
|
||||
"version": "1.0.0",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
"dev": true
|
||||
},
|
||||
"brace-expansion": {
|
||||
"version": "1.1.11",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"balanced-match": "^1.0.0",
|
||||
"concat-map": "0.0.1"
|
||||
@ -4317,20 +4314,17 @@
|
||||
"code-point-at": {
|
||||
"version": "1.1.0",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
"dev": true
|
||||
},
|
||||
"concat-map": {
|
||||
"version": "0.0.1",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
"dev": true
|
||||
},
|
||||
"console-control-strings": {
|
||||
"version": "1.1.0",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
"dev": true
|
||||
},
|
||||
"core-util-is": {
|
||||
"version": "1.0.2",
|
||||
@ -4447,8 +4441,7 @@
|
||||
"inherits": {
|
||||
"version": "2.0.3",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
"dev": true
|
||||
},
|
||||
"ini": {
|
||||
"version": "1.3.5",
|
||||
@ -4460,7 +4453,6 @@
|
||||
"version": "1.0.0",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"number-is-nan": "^1.0.0"
|
||||
}
|
||||
@ -4475,7 +4467,6 @@
|
||||
"version": "3.0.4",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"brace-expansion": "^1.1.7"
|
||||
}
|
||||
@ -4483,14 +4474,12 @@
|
||||
"minimist": {
|
||||
"version": "0.0.8",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
"dev": true
|
||||
},
|
||||
"minipass": {
|
||||
"version": "2.2.4",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"safe-buffer": "^5.1.1",
|
||||
"yallist": "^3.0.0"
|
||||
@ -4509,7 +4498,6 @@
|
||||
"version": "0.5.1",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"minimist": "0.0.8"
|
||||
}
|
||||
@ -4590,8 +4578,7 @@
|
||||
"number-is-nan": {
|
||||
"version": "1.0.1",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
"dev": true
|
||||
},
|
||||
"object-assign": {
|
||||
"version": "4.1.1",
|
||||
@ -4603,7 +4590,6 @@
|
||||
"version": "1.4.0",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"wrappy": "1"
|
||||
}
|
||||
@ -4689,8 +4675,7 @@
|
||||
"safe-buffer": {
|
||||
"version": "5.1.1",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
"dev": true
|
||||
},
|
||||
"safer-buffer": {
|
||||
"version": "2.1.2",
|
||||
@ -4726,7 +4711,6 @@
|
||||
"version": "1.0.2",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"code-point-at": "^1.0.0",
|
||||
"is-fullwidth-code-point": "^1.0.0",
|
||||
@ -4746,7 +4730,6 @@
|
||||
"version": "3.0.1",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"ansi-regex": "^2.0.0"
|
||||
}
|
||||
@ -4790,14 +4773,12 @@
|
||||
"wrappy": {
|
||||
"version": "1.0.2",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
"dev": true
|
||||
},
|
||||
"yallist": {
|
||||
"version": "3.0.2",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -9991,6 +9972,11 @@
|
||||
"has-flag": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"sweetalert2": {
|
||||
"version": "7.28.4",
|
||||
"resolved": "https://registry.npmjs.org/sweetalert2/-/sweetalert2-7.28.4.tgz",
|
||||
"integrity": "sha512-HEAfIAPactjB8CvgsJClxT+6wv2OGh/KkgvgJ8xR28uAXtx9BUQAlws1mruaS7Jzn8gIt6esx4BEZLaZSGvBZw=="
|
||||
},
|
||||
"symbol-observable": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.2.0.tgz",
|
||||
@ -11377,4 +11363,4 @@
|
||||
"integrity": "sha512-W9Nj+UmBJG251wkCacIkETgra4QgBo/vgoEkb4a2uoLzpQG7qF9nzwoLXWU5xj3Fg2mxGvEDh47mg24vXccYjA=="
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -60,6 +60,7 @@
|
||||
"screenfull": "^3.2.2",
|
||||
"simple-line-icons": "^2.4.1",
|
||||
"sortablejs": "^1.6.0",
|
||||
"sweetalert2": "^7.28.4",
|
||||
"tether": "^1.4.0",
|
||||
"zone.js": "^0.8.26"
|
||||
},
|
||||
|
||||
@ -223,12 +223,12 @@ export class AwsService {
|
||||
let params: any;
|
||||
if (userGroup == 'ADMIN') {
|
||||
console.log(userdata);
|
||||
if (userdata.fk_entity_id == 1) {
|
||||
if (userdata.fk_entity_type_id == 1) {
|
||||
params = {
|
||||
UserPoolId: sineedgedev_poolData.UserPoolId, /* required */
|
||||
Username: awsName /* required */
|
||||
};
|
||||
} else if (userdata.fk_entity_id == 2) {
|
||||
} else if (userdata.fk_entity_type_id == 2) {
|
||||
params = {
|
||||
UserPoolId: lender_poolData.UserPoolId, /* required */
|
||||
Username: awsName /* required */
|
||||
@ -253,7 +253,7 @@ export class AwsService {
|
||||
adminenableUser(userdata, awsName) {
|
||||
let session:any = this.shared.getAccessToken() || "";
|
||||
// this.getconfig();
|
||||
|
||||
console.log(userdata);
|
||||
let config = "";
|
||||
AWS.config.region = "ap-south-1";
|
||||
AWS.config.credentials = new AWS.CognitoIdentityCredentials({
|
||||
@ -271,13 +271,13 @@ export class AwsService {
|
||||
//cognitosdata = 7;
|
||||
let params: any;
|
||||
if (userGroup == 'ADMIN') {
|
||||
console.log(userdata);
|
||||
if (userdata.fk_entity_id == 1) {
|
||||
|
||||
if (userdata.fk_entity_type_id == 1) {
|
||||
params = {
|
||||
UserPoolId: sineedgedev_poolData.UserPoolId, /* required */
|
||||
Username: awsName /* required */
|
||||
};
|
||||
} else if (userdata.fk_entity_id == 2) {
|
||||
} else if (userdata.fk_entity_type_id == 2) {
|
||||
params = {
|
||||
UserPoolId: lender_poolData.UserPoolId, /* required */
|
||||
Username: awsName /* required */
|
||||
@ -308,7 +308,7 @@ export class AwsService {
|
||||
)[0];
|
||||
// (userGroup);
|
||||
if (userGroup == "ADMIN") {
|
||||
if (userData.type.entity_type_id == 1) {
|
||||
if (userData.type.fk_entity_type_id == 1) {
|
||||
params = {
|
||||
UserPoolId: sineedgedev_poolData.UserPoolId /* required */,
|
||||
Username: userData.email /* required */,
|
||||
@ -331,7 +331,7 @@ export class AwsService {
|
||||
/* more items */
|
||||
]
|
||||
};
|
||||
} else if (userData.type.entity_type_id == 2) {
|
||||
} else if (userData.type.fk_entity_type_id == 2) {
|
||||
console.log(2);
|
||||
params = {
|
||||
UserPoolId: lender_poolData.UserPoolId /* required */,
|
||||
@ -355,7 +355,7 @@ export class AwsService {
|
||||
/* more items */
|
||||
]
|
||||
};
|
||||
}else if(userData.type.entity_type_id == 3){
|
||||
}else if(userData.type.fk_entity_type_id == 3){
|
||||
params = {
|
||||
UserPoolId: vendor_poolData.UserPoolId /* required */,
|
||||
Username: userData.email /* required */,
|
||||
@ -409,7 +409,7 @@ export class AwsService {
|
||||
//console.log(cognitodata);
|
||||
|
||||
|
||||
|
||||
console.log(userData);
|
||||
this.getconfig();
|
||||
|
||||
//let cognitodata = "539bfefa-ae42-4bee-bf79-4b15d1a2af7f";
|
||||
@ -418,13 +418,20 @@ export class AwsService {
|
||||
|
||||
let params: any;
|
||||
|
||||
|
||||
if(userData.userid === undefined){
|
||||
params = {
|
||||
GroupName: "ADMIN" /* required */,
|
||||
UserPoolId: sineedgedev_poolData.UserPoolId,//"ap-south-1_y7dt3iEaX" /* required */,
|
||||
Username: cognitodata.User.Username //'539bfefa-ae42-4bee-bf79-4b15d1a2af7f' /* required */
|
||||
};
|
||||
|
||||
}else
|
||||
{
|
||||
params = {
|
||||
GroupName: "ADMIN" /* required */,
|
||||
UserPoolId: sineedgedev_poolData.UserPoolId,//"ap-south-1_y7dt3iEaX" /* required */,
|
||||
Username: userData.aws_name //'539bfefa-ae42-4bee-bf79-4b15d1a2af7f' /* required */
|
||||
};
|
||||
}
|
||||
|
||||
//(params);
|
||||
return Observable.create(observe=>{
|
||||
@ -466,7 +473,7 @@ export class AwsService {
|
||||
//cognitosdata = 7;
|
||||
let params:any;
|
||||
if (userGroup == 'ADMIN') {
|
||||
if(user.type.entity_type_id ==1){
|
||||
if(user.type.fk_entity_type_id ==1){
|
||||
params = {
|
||||
UserAttributes: [ /* required */
|
||||
{
|
||||
@ -484,7 +491,7 @@ export class AwsService {
|
||||
UserPoolId: sineedgedev_poolData.UserPoolId, /* required */
|
||||
Username: user.email /* required */
|
||||
};
|
||||
}else if(user.type.entity_type_id ==2){
|
||||
}else if(user.type.fk_entity_type_id ==2){
|
||||
params = {
|
||||
UserAttributes: [ /* required */
|
||||
{
|
||||
@ -558,6 +565,24 @@ export class AwsService {
|
||||
UserPoolId: lender_poolData.UserPoolId /* required */,
|
||||
Username: userData.aws_name /* required */,
|
||||
|
||||
UserAttributes: [
|
||||
{
|
||||
Name: "email" /* required */,
|
||||
Value: changeusers.email
|
||||
},
|
||||
{
|
||||
Name: "phone_number" /* required */,
|
||||
Value: "+91" + changeusers.phone
|
||||
}
|
||||
/* more items */
|
||||
]
|
||||
};
|
||||
}else if(userData.fk_entity_type_id == 3)
|
||||
{
|
||||
params = {
|
||||
UserPoolId: vendor_poolData.UserPoolId /* required */,
|
||||
Username: userData.aws_name /* required */,
|
||||
|
||||
UserAttributes: [
|
||||
{
|
||||
Name: "email" /* required */,
|
||||
@ -581,34 +606,34 @@ export class AwsService {
|
||||
})
|
||||
}
|
||||
}
|
||||
adminremoveGroup(roles,users){
|
||||
console.log(roles);
|
||||
console.log(users);
|
||||
if(users !==undefined){
|
||||
// adminremoveGroup(roles,users){
|
||||
// console.log(roles);
|
||||
// console.log(users);
|
||||
// if(users !==undefined){
|
||||
|
||||
let session:any = this.shared.getAccessToken() ||"";
|
||||
this.getconfig();
|
||||
let params:any;
|
||||
if(users.fk_entity_id ==1){
|
||||
params = {
|
||||
GroupName: roles.GroupName, /* required */
|
||||
UserPoolId: sineedgedev_poolData.UserPoolId, /* required */
|
||||
Username: users.aws_name//'2c64866e-e96f-453b-903f-2b6f831688af' /* required */
|
||||
};
|
||||
}else if(users.fk_entity_id ==2){
|
||||
params = {
|
||||
GroupName: roles.GroupName, /* required */
|
||||
UserPoolId: lender_poolData.UserPoolId, /* required */
|
||||
Username: users.aws_name//'2c64866e-e96f-453b-903f-2b6f831688af' /* required */
|
||||
};
|
||||
}
|
||||
let cognitoidentityserviceprovider = new AWS.CognitoIdentityServiceProvider();
|
||||
cognitoidentityserviceprovider.adminRemoveUserFromGroup(params, function(err, data) {
|
||||
if (err) console.log(err, err.stack); // an error occurred
|
||||
else console.log(data); // successful response
|
||||
});
|
||||
}
|
||||
}
|
||||
// let session:any = this.shared.getAccessToken() ||"";
|
||||
// this.getconfig();
|
||||
// let params:any;
|
||||
// if(users.fk_entity_type_id ==1){
|
||||
// params = {
|
||||
// GroupName: roles.GroupName, /* required */
|
||||
// UserPoolId: sineedgedev_poolData.UserPoolId, /* required */
|
||||
// Username: users.aws_name//'2c64866e-e96f-453b-903f-2b6f831688af' /* required */
|
||||
// };
|
||||
// }else if(users.fk_entity_id ==2){
|
||||
// params = {
|
||||
// GroupName: roles.GroupName, /* required */
|
||||
// UserPoolId: lender_poolData.UserPoolId, /* required */
|
||||
// Username: users.aws_name//'2c64866e-e96f-453b-903f-2b6f831688af' /* required */
|
||||
// };
|
||||
// }
|
||||
// let cognitoidentityserviceprovider = new AWS.CognitoIdentityServiceProvider();
|
||||
// cognitoidentityserviceprovider.adminRemoveUserFromGroup(params, function(err, data) {
|
||||
// if (err) console.log(err, err.stack); // an error occurred
|
||||
// else console.log(data); // successful response
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
|
||||
adminresetpassword(awsuser){
|
||||
this.getconfig();
|
||||
|
||||
@ -20,8 +20,8 @@ export const AppRoutes: Routes = [{
|
||||
loadChildren:'./settings/settings.module#SettingsModule'
|
||||
}
|
||||
,{
|
||||
path:'pdtrigger',
|
||||
loadChildren:'./pd-triger/pd-triger.module#PdTrigerModule'
|
||||
path:'personal_discussion',
|
||||
loadChildren:'./personal-discussion/personal-discussion.module#PersonalDiscussionModule'
|
||||
},{
|
||||
path:'template',
|
||||
loadChildren:'./template/template.module#TemplateModule'
|
||||
|
||||
@ -1,5 +1,171 @@
|
||||
<div class="pad-wrap">
|
||||
<p>
|
||||
Dashboard!
|
||||
</p>
|
||||
<div fxLayout="row wrap">
|
||||
<div class="column" fxFlex.sm="100" fxFlex.xs="100" fxFlex.md="33.33" fxFlex.lg="33.33" fxFlex.xl="33.33" fxFlex="100">
|
||||
<mat-card>
|
||||
<div class="wheather-widget text-center grad-blue">
|
||||
<div class="wheather-today">
|
||||
<h3>PD Triggered</h3>
|
||||
</div>
|
||||
<div fxLayout="row wrap">
|
||||
<div fxFlex.gt-sm="50%" fxFlex="100" class="p-gap wheather-child">
|
||||
<p>Full PD</p>
|
||||
<h3>13</h3>
|
||||
</div>
|
||||
<div fxFlex.gt-sm="50%" fxFlex="100" class="p-gap wheather-child">
|
||||
<p>Smart PD</p>
|
||||
<h3>13</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</mat-card>
|
||||
</div>
|
||||
<div class="column" fxFlex.sm="100" fxFlex.xs="100" fxFlex.md="33.33" fxFlex.lg="33.33" fxFlex.xl="33.33" fxFlex="100">
|
||||
<mat-card>
|
||||
<div class="wheather-widget text-center grad-blue">
|
||||
<div class="wheather-today">
|
||||
<h3>PD Allocated</h3>
|
||||
</div>
|
||||
<div fxLayout="row wrap">
|
||||
<div fxFlex.gt-sm="50%" fxFlex="100" class="p-gap wheather-child">
|
||||
<p>Full PD</p>
|
||||
<h3>33</h3>
|
||||
</div>
|
||||
<div fxFlex.gt-sm="50%" fxFlex="100" class="p-gap wheather-child">
|
||||
<p>Smart PD</p>
|
||||
<h3>5</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</mat-card>
|
||||
</div>
|
||||
<div class="column" fxFlex.sm="100" fxFlex.xs="100" fxFlex.md="33.33" fxFlex.lg="33.33" fxFlex.xl="33.33" fxFlex="100">
|
||||
<mat-card>
|
||||
<div class="wheather-widget text-center grad-blue">
|
||||
<div class="wheather-today">
|
||||
<h3>PD Scheduled</h3>
|
||||
</div>
|
||||
<div fxLayout="row wrap">
|
||||
<div fxFlex.gt-sm="50%" fxFlex="100" class="p-gap wheather-child">
|
||||
<p>Full PD</p>
|
||||
<h3>20</h3>
|
||||
</div>
|
||||
<div fxFlex.gt-sm="50%" fxFlex="100" class="p-gap wheather-child">
|
||||
<p>Smart PD</p>
|
||||
<h3>6</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</mat-card>
|
||||
</div>
|
||||
</div>
|
||||
<!--Second row card's section-->
|
||||
<div fxLayout="row wrap">
|
||||
<div class="column" fxFlex.sm="100" fxFlex.xs="100" fxFlex.md="33.33" fxFlex.lg="33.33" fxFlex.xl="33.33" fxFlex="100">
|
||||
<mat-card>
|
||||
<div class="wheather-widget text-center grad-blue">
|
||||
<div class="wheather-today">
|
||||
<h3>PD Progress</h3>
|
||||
</div>
|
||||
<div fxLayout="row wrap">
|
||||
<div fxFlex.gt-sm="50%" fxFlex="100" class="p-gap wheather-child">
|
||||
<p>Full PD</p>
|
||||
<h3>34</h3>
|
||||
</div>
|
||||
<div fxFlex.gt-sm="50%" fxFlex="100" class="p-gap wheather-child">
|
||||
<p>Smart PD</p>
|
||||
<h3>9</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</mat-card>
|
||||
</div>
|
||||
<div class="column" fxFlex.sm="100" fxFlex.xs="100" fxFlex.md="33.33" fxFlex.lg="33.33" fxFlex.xl="33.33" fxFlex="100">
|
||||
<mat-card>
|
||||
<div class="wheather-widget text-center grad-blue">
|
||||
<div class="wheather-today">
|
||||
<h3>PD Completed</h3>
|
||||
</div>
|
||||
<div fxLayout="row wrap">
|
||||
<div fxFlex.gt-sm="50%" fxFlex="100" class="p-gap wheather-child">
|
||||
<p>Full PD</p>
|
||||
<h3>65</h3>
|
||||
</div>
|
||||
<div fxFlex.gt-sm="50%" fxFlex="100" class="p-gap wheather-child">
|
||||
<p>Smart PD</p>
|
||||
<h3>24</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</mat-card>
|
||||
</div>
|
||||
<div class="column" fxFlex.sm="100" fxFlex.xs="100" fxFlex.md="33.33" fxFlex.lg="33.33" fxFlex.xl="33.33" fxFlex="100">
|
||||
<mat-card>
|
||||
<div class="wheather-widget text-center grad-blue">
|
||||
<div class="wheather-today">
|
||||
<h3>QC Completed</h3>
|
||||
</div>
|
||||
<div fxLayout="row wrap">
|
||||
<div fxFlex.gt-sm="50%" fxFlex="100" class="p-gap wheather-child">
|
||||
<p>Full PD</p>
|
||||
<h3>47</h3>
|
||||
</div>
|
||||
<div fxFlex.gt-sm="50%" fxFlex="100" class="p-gap wheather-child">
|
||||
<p>Smart PD</p>
|
||||
<h3>29</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</mat-card>
|
||||
</div>
|
||||
</div>
|
||||
<!--Lender,Citywise, Same Status-->
|
||||
<div fxLayout="row wrap">
|
||||
<div fxFlex.gt-sm="33.33%" fxFlex="100" class="m-gap p-gap">
|
||||
<mat-card>
|
||||
<mat-card-title>Lender</mat-card-title>
|
||||
<mat-card-subtitle>PD Triggered Today</mat-card-subtitle>
|
||||
<hr>
|
||||
<mat-list>
|
||||
<ng-template let-item let-last="last" ngFor [ngForOf]="lenderpd">
|
||||
<mat-list-item>
|
||||
<h3 mat-line> {{item.lendername}} / {{item.billingaddr}} </h3>
|
||||
<p mat-line> Full PD -{{item.fullpd}} / Smart PD -{{item.smartpd}} </p>
|
||||
</mat-list-item>
|
||||
</ng-template>
|
||||
</mat-list>
|
||||
</mat-card>
|
||||
</div>
|
||||
<div fxFlex.gt-sm="33.33%" fxFlex="100" class="m-gap p-gap">
|
||||
<mat-card>
|
||||
<mat-card-title>Citywise</mat-card-title>
|
||||
<mat-card-subtitle>PD Triggered Today</mat-card-subtitle>
|
||||
<hr>
|
||||
<mat-list>
|
||||
<ng-template let-item let-last="last" ngFor [ngForOf]="citywisepd">
|
||||
<mat-list-item>
|
||||
<h3 mat-line> {{item.cityname}} </h3>
|
||||
<p mat-line> Full PD -{{item.fullpd}} / Smart PD -{{item.smartpd}} </p>
|
||||
</mat-list-item>
|
||||
</ng-template>
|
||||
</mat-list>
|
||||
</mat-card>
|
||||
</div>
|
||||
<div fxFlex.gt-sm="33.33%" fxFlex="100" class="m-gap p-gap">
|
||||
<mat-card>
|
||||
<mat-card-title>Information</mat-card-title>
|
||||
<mat-card-subtitle>PD In Same Status</mat-card-subtitle>
|
||||
<hr>
|
||||
<mat-list>
|
||||
<ng-template let-item let-last="last" ngFor [ngForOf]="message">
|
||||
<mat-list-item>
|
||||
<img mat-list-avatar src="{{item.photo}}" alt="">
|
||||
<h3 mat-line> {{item.applicantname}} </h3>
|
||||
<p mat-line> {{item.applicantid}}</p>
|
||||
<p mat-line> {{item.lendername}} - {{item.status}} </p>
|
||||
</mat-list-item>
|
||||
</ng-template>
|
||||
</mat-list>
|
||||
</mat-card>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -9,4 +9,57 @@ export class DashboardComponent {
|
||||
constructor() {
|
||||
|
||||
}
|
||||
//Lender wise PD Triggered
|
||||
lenderpd: Object[] = [{
|
||||
lendername:'ICICI',
|
||||
billingaddr:'Bangalore',
|
||||
fullpd:'9',
|
||||
smartpd:'6',
|
||||
}, {
|
||||
lendername:'IOB',
|
||||
billingaddr:'Chennai',
|
||||
fullpd:'10',
|
||||
smartpd:'5',
|
||||
}, {
|
||||
lendername:'SBI',
|
||||
billingaddr:'Pune',
|
||||
fullpd:'16',
|
||||
smartpd:'3',
|
||||
}, ];
|
||||
|
||||
//City Wise PD Triggered
|
||||
citywisepd: Object[] = [{
|
||||
cityname: 'Bangalore',
|
||||
fullpd:'45',
|
||||
smartpd:'17',
|
||||
}, {
|
||||
cityname: 'Chennai',
|
||||
fullpd:'33',
|
||||
smartpd:'16',
|
||||
}, {
|
||||
cityname: 'Salem',
|
||||
fullpd:'22',
|
||||
smartpd:'12',
|
||||
}, ];
|
||||
|
||||
//Same status
|
||||
message: Object[] = [{
|
||||
applicantname: 'Saravana',
|
||||
applicantid:'ICICITN0118000354',
|
||||
lendername:'ICICI',
|
||||
status:'Allocated',
|
||||
photo: 'assets/images/face3.jpg',
|
||||
}, {
|
||||
applicantname: 'Kumaran',
|
||||
applicantid:'IOBKA0418000578',
|
||||
lendername:'IOB',
|
||||
status:'Allocated',
|
||||
photo: 'assets/images/face6.jpg',
|
||||
}, {
|
||||
applicantname: 'Priya',
|
||||
applicantid:'SBIGA0118000241',
|
||||
lendername:'SBI',
|
||||
status:'Triggered',
|
||||
photo: 'assets/images/face4.jpg',
|
||||
}, ];
|
||||
}
|
||||
|
||||
@ -1,75 +0,0 @@
|
||||
<mat-card class="p-1">
|
||||
<form [formGroup]="_EditApplicantForm" (submit)="updatePdApplicant(_EditApplicantForm.value)">
|
||||
<mat-card-content>
|
||||
|
||||
<div fxLayout="row" fxLayoutWrap="wrap">
|
||||
<div class="column" fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100">
|
||||
<mat-card class="p-2">
|
||||
<h5>Main Applicant</h5>
|
||||
|
||||
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput placeholder="Name" formControlName="applicant_name" required>
|
||||
<mat-error *ngIf="pdMainApplicant.applicant_name.hasError('required')">Name is required.</mat-error>
|
||||
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput placeholder="Email" formControlName="email" type="email" required>
|
||||
<mat-error *ngIf="pdMainApplicant.email.hasError('required')">Email number is required.</mat-error>
|
||||
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput placeholder="Phone" formControlName="mobile_no" type="text" required>
|
||||
<mat-error *ngIf="pdMainApplicant.mobile_no.hasError('required')">Mobile number is required.</mat-error>
|
||||
|
||||
</mat-form-field>
|
||||
|
||||
</mat-card>
|
||||
</div>
|
||||
</div>
|
||||
<div fxLayout="row" fxLayoutWrap="wrap" formArrayName="coApplicantItems" *ngFor="let coDetails of pdCoApplicant.controls; let i = index;">
|
||||
<div class="column" fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100">
|
||||
|
||||
<mat-card class="p-2">
|
||||
<h5>{{coDetails.controls.label.value}} {{i+1}}</h5>
|
||||
|
||||
<div [formGroupName]="i">
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput placeholder="Name" formControlName="coapplicantName" type="text" required>
|
||||
<!-- <mat-error *ngIf="pdCoApplicant.coapplicantName.hasError('required')">Name is required.</mat-error> -->
|
||||
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput placeholder="Phone" formControlName="coapplicant_mobile_no" type="text">
|
||||
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput placeholder="Relation" formControlName="relationship" type="text">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</mat-card>
|
||||
</div>
|
||||
</div>
|
||||
<div fxLayout="row" fxLayoutWrap="wrap">
|
||||
|
||||
<div class="column" fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100">
|
||||
<mat-card class="p-2" style="opacity: 0.5;">
|
||||
<button _ngcontent-c39="" class="mr-1 mb-1 mat-button" type="button"><span style="opacity: 0.5;" (click)="addCoApplicant(emptyData)" class="mat-button-wrapper">Add More Co-Applicant</span><div class="mat-button-ripple mat-ripple" matripple=""></div><div class="mat-button-focus-overlay"></div></button>
|
||||
|
||||
</mat-card>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</mat-card-content>
|
||||
<mat-card-actions style="text-align: right">
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button"
|
||||
(click)="loadPdMasterCompoent()"><mat-icon>close</mat-icon></button>
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="submit"><mat-icon>save</mat-icon></button>
|
||||
</mat-card-actions>
|
||||
</form>
|
||||
</mat-card>
|
||||
<!-- <notifier-container></notifier-container> -->
|
||||
|
||||
|
||||
@ -1,122 +0,0 @@
|
||||
import { Component, OnInit,ViewEncapsulation, EventEmitter, Input, Output } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators, FormControl, FormArray } from '@angular/forms';
|
||||
import { CustomValidators } from 'ng2-validation';
|
||||
import { NotifierService } from 'angular-notifier';
|
||||
import { PdTrigerService } from '../pd-service/pd-triger.service';
|
||||
@Component({
|
||||
selector: 'app-edit-pd-applicant',
|
||||
templateUrl: './edit-pd-applicant.component.html',
|
||||
styleUrls: ['./edit-pd-applicant.component.scss'],
|
||||
encapsulation: ViewEncapsulation.None,
|
||||
})
|
||||
export class EditPdApplicantComponent implements OnInit {
|
||||
errorMessage: any;
|
||||
@Input() applicantChild: any;
|
||||
@Output() loadPdView = new EventEmitter<string>();
|
||||
public _EditApplicantForm:FormGroup;
|
||||
public notifier: NotifierService;
|
||||
mainApplicantData: any[];
|
||||
coApplicantData: any[];
|
||||
coApplicantItems:FormArray;
|
||||
emptyData:any;
|
||||
constructor(private _fb: FormBuilder,
|
||||
private _pd: PdTrigerService, notifier: NotifierService,) {
|
||||
this.notifier=notifier
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.mainApplicantData= this.applicantChild.filter(item => item.applicant_type == 1);
|
||||
this.coApplicantData= this.applicantChild.filter(item => item.applicant_type == 0);
|
||||
this.loadApplicantFormData();
|
||||
}
|
||||
loadApplicantFormData() {
|
||||
this._EditApplicantForm = this._fb.group({
|
||||
fk_applicant_primary_id: [this.mainApplicantData[0].pd_co_applicant_id],
|
||||
applicant_name: [this.mainApplicantData[0].applicant_name, Validators.compose([Validators.required])],
|
||||
mobile_no: [this.mainApplicantData[0].mobile_no, Validators.compose([Validators.required])],
|
||||
email: [this.mainApplicantData[0].email, Validators.compose([Validators.required, CustomValidators.email])],
|
||||
applicant_type: [this.mainApplicantData[0].applicant_type, Validators.compose([Validators.required])],
|
||||
coApplicantItems: this._fb.array([]),
|
||||
});
|
||||
// bind dynamic co applicant data
|
||||
if(this.coApplicantData.length > 0){
|
||||
for(let value of this.coApplicantData){
|
||||
this.addCoApplicant(value);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
createItem(listData): FormGroup {
|
||||
if(listData){
|
||||
return this._fb.group({
|
||||
label: ['Co Applicant'],
|
||||
fk_applicant_primary_id: [listData.pd_co_applicant_id],
|
||||
coapplicantName: [listData.applicant_name, Validators.compose([Validators.required])],
|
||||
coapplicant_mobile_no: [listData.mobile_no],
|
||||
relationship: [listData.relation],
|
||||
applicant_type: [listData.applicant_type, Validators.compose([Validators.required])],
|
||||
});
|
||||
}
|
||||
else{
|
||||
return this._fb.group({
|
||||
label: ['Co Applicant'],
|
||||
fk_applicant_primary_id: [null],
|
||||
coapplicantName: [null, Validators.compose([Validators.required])],
|
||||
coapplicant_mobile_no: [],
|
||||
relationship: [null],
|
||||
applicant_type: [0],
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
addCoApplicant(listData) {
|
||||
if(this._EditApplicantForm.valid){
|
||||
this.coApplicantItems = this._EditApplicantForm.get('coApplicantItems') as FormArray;
|
||||
this.coApplicantItems.push(this.createItem(listData));
|
||||
}
|
||||
}
|
||||
get pdMainApplicant() { return this._EditApplicantForm.controls; }
|
||||
get pdCoApplicant() { return this._EditApplicantForm.get('coApplicantItems') as FormArray; }
|
||||
updatePdApplicant(formValue: any) {
|
||||
if(this._EditApplicantForm.valid){
|
||||
let pd_applicant_details : any=[{
|
||||
"fk_pd_id": this.mainApplicantData[0].fk_pd_id,
|
||||
"pd_co_applicant_id": formValue.fk_applicant_primary_id,
|
||||
"applicant_name":formValue.applicant_name,
|
||||
"email":formValue.email,
|
||||
"mobile_no":formValue.mobile_no,
|
||||
"applicant_type":formValue.applicant_type,
|
||||
"relation":formValue.relationship,
|
||||
"isactive":1
|
||||
}];
|
||||
formValue.coApplicantItems.forEach((itemElement, itemIndex) => {
|
||||
let obj1 = {
|
||||
"fk_pd_id": this.mainApplicantData[0].fk_pd_id,
|
||||
"pd_co_applicant_id": itemElement.fk_applicant_primary_id,
|
||||
"applicant_name":itemElement.coapplicantName,
|
||||
"relation":itemElement.relationship,
|
||||
"email":"",
|
||||
"mobile_no":itemElement.coapplicant_mobile_no,
|
||||
"applicant_type":itemElement.applicant_type,
|
||||
"isactive":1
|
||||
}
|
||||
pd_applicant_details.push(obj1)
|
||||
});
|
||||
|
||||
this._pd.updatePdApplicant(pd_applicant_details).subscribe(result => {
|
||||
if (result.status == 200) {
|
||||
this.notifier.notify('success', 'Applicants updated..');
|
||||
this.loadPdMasterCompoent();
|
||||
}
|
||||
else {
|
||||
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
|
||||
}
|
||||
}, error => {
|
||||
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
|
||||
});
|
||||
}
|
||||
}
|
||||
loadPdMasterCompoent() {
|
||||
this.loadPdView.emit('2')
|
||||
}
|
||||
}
|
||||
@ -1,117 +0,0 @@
|
||||
<mat-card>
|
||||
<form [formGroup]="_EditPDtriggerForm" (submit)="submitPdDetails(_EditPDtriggerForm.value)">
|
||||
<mat-card-content>
|
||||
<div class="mb-2"></div>
|
||||
<div fxLayout="row" fxLayoutWrap="wrap">
|
||||
<div class="column" fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100">
|
||||
<div fxLayout="column" fxLayoutAlign="start stretch">
|
||||
<mat-form-field style="width: 100%">
|
||||
<mat-select placeholder="Lender Name" formControlName="fk_lender_id" required>
|
||||
<mat-option *ngFor="let LL of lenderList" [value]="LL.entity_id" >
|
||||
{{LL.full_name}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
<mat-error *ngIf="pdMain.fk_lender_id.hasError('required')" class="mat-text-warn">Lender name is required.</mat-error>
|
||||
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput placeholder="Lender Applicant ID" formControlName="lender_applicant_id" type="text" required>
|
||||
<mat-error *ngIf="pdMain.lender_applicant_id.hasError('required')">Applicant id is required.</mat-error>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 100%">
|
||||
<mat-select placeholder="Product Name" formControlName="fk_product_id" (selectionChange)="getSubproductList(pdMain.fk_product_id.value)" required>
|
||||
<mat-option *ngFor="let PL of productList" [value]="PL.product_id" >
|
||||
{{PL.product_name}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
<mat-error *ngIf="pdMain.fk_product_id.hasError('required')">Product is required.</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field style="width: 100%">
|
||||
|
||||
<mat-select placeholder="Sub product Name" formControlName="fk_subproduct_id" required>
|
||||
<mat-option *ngFor="let SPL of subProductList" [value]="SPL.subproduct_id" >
|
||||
{{SPL.subproduct_name}}
|
||||
</mat-option>
|
||||
|
||||
</mat-select>
|
||||
<mat-error *ngIf="pdMain.fk_subproduct_id.hasError('required')">Sub product is required.</mat-error>
|
||||
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 100%">
|
||||
<mat-select placeholder="Customer Segment" formControlName="fk_customer_segment" required>
|
||||
<mat-option *ngFor="let CSL of customerSegmentList" [value]="CSL.customer_segment_id" >
|
||||
{{CSL.customer_segment}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
<mat-error *ngIf="pdMain.fk_customer_segment.hasError('required')">Customer segment is required.</mat-error>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 100%">
|
||||
<mat-select placeholder="PD Type" formControlName="fk_pd_type" required>
|
||||
<mat-option *ngFor="let PDL of pdTypeList" [value]="PDL.pd_type_id" >
|
||||
{{PDL.type_name}}
|
||||
</mat-option>
|
||||
|
||||
</mat-select>
|
||||
<mat-error *ngIf="pdMain.fk_pd_type.hasError('required')">PD type is required.</mat-error>
|
||||
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput placeholder="Loan Amount" formControlName="loan_amount" required>
|
||||
<mat-error *ngIf="pdMain.loan_amount.hasError('required')">Amount is required.</mat-error>
|
||||
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 100%">
|
||||
<textarea matInput placeholder="Address 1" formControlName="addressline1" required></textarea>
|
||||
<mat-error *ngIf="pdMain.addressline1.hasError('required')">Address1 required.</mat-error>
|
||||
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field style="width: 100%">
|
||||
<textarea matInput placeholder="Address 2" formControlName="addressline2"></textarea>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field style="width: 100%">
|
||||
<textarea matInput placeholder="Address 3" formControlName="addressline3"></textarea>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 100%;">
|
||||
<mat-select placeholder="Select State" formControlName="fk_state" (selectionChange)="getCityList(pdMain.fk_state.value)" required>
|
||||
<mat-option *ngFor="let SL of stateList" [value]="SL.state_id">
|
||||
{{SL.state_name}}
|
||||
</mat-option>
|
||||
|
||||
</mat-select>
|
||||
<mat-error *ngIf="pdMain.fk_state.hasError('required')">State is required.</mat-error>
|
||||
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 100%;">
|
||||
<mat-select placeholder="Select City" formControlName="fk_city" required>
|
||||
` <mat-option *ngFor="let CL of cityList" [value]="CL.city_id">
|
||||
{{CL.city_name}}
|
||||
</mat-option>
|
||||
|
||||
</mat-select>
|
||||
<mat-error *ngIf="pdMain.fk_city.hasError('required')">City is required.</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
|
||||
<mat-form-field style="width: 100%;">
|
||||
<input matInput placeholder="Pincode" formControlName="pincode" required>
|
||||
<mat-error *ngIf="pdMain.pincode.hasError('required')">Pincode is required.</mat-error>
|
||||
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</mat-card-content>
|
||||
<mat-card-actions style="text-align: right">
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button"
|
||||
(click)="loadPdMasterCompoent()"><mat-icon>close</mat-icon></button>
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Save" matTooltipPosition="above" type="submit"><mat-icon>save</mat-icon></button>
|
||||
</mat-card-actions>
|
||||
</form>
|
||||
</mat-card>
|
||||
@ -1,130 +0,0 @@
|
||||
import { Component, OnInit,ViewEncapsulation, EventEmitter, Input, Output } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators, FormControl, FormArray } from '@angular/forms';
|
||||
import { CustomValidators } from 'ng2-validation';
|
||||
import { NotifierService } from 'angular-notifier';
|
||||
import { PdTrigerService } from '../pd-service/pd-triger.service';
|
||||
@Component({
|
||||
selector: 'app-edit-pd-master',
|
||||
templateUrl: './edit-pd-master.component.html',
|
||||
styleUrls: ['./edit-pd-master.component.scss'],
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
export class EditPdMasterComponent implements OnInit {
|
||||
errorMessage: any;
|
||||
productList:any;
|
||||
subProductList:any;
|
||||
lenderList:any;
|
||||
customerSegmentList:any;
|
||||
stateList:any;
|
||||
cityList:any;
|
||||
pdTypeList:any;
|
||||
@Input() masterChild: any;
|
||||
@Output() loadPdView = new EventEmitter<string>();
|
||||
public _EditPDtriggerForm:FormGroup;
|
||||
public notifier: NotifierService;
|
||||
constructor(private _fb: FormBuilder,
|
||||
private _pd: PdTrigerService, notifier: NotifierService,) {
|
||||
this.notifier=notifier
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.getLenderList();
|
||||
this.getProductsList();
|
||||
this.getCustomerSegmentList();
|
||||
this.getStateCityList();
|
||||
this.getPDTypeList();
|
||||
this.loadFormData();
|
||||
}
|
||||
|
||||
getLenderList(){
|
||||
this._pd.getLenderDetails().subscribe(
|
||||
data => {
|
||||
if (data.status == 200) {
|
||||
this.lenderList=data.records
|
||||
}
|
||||
}, error => this.errorMessage = <any> error);
|
||||
}
|
||||
getProductsList(){
|
||||
this._pd.getProductsDetails().subscribe(
|
||||
data => {
|
||||
if (data.status == 200) {
|
||||
this.productList=data.records
|
||||
this.getSubproductList(this.masterChild.fk_product_id);
|
||||
|
||||
}
|
||||
}, error => this.errorMessage = <any> error);
|
||||
}
|
||||
getCustomerSegmentList(){
|
||||
this._pd.getCustomersDetails().subscribe(
|
||||
data => {
|
||||
if (data.status == 200) {
|
||||
this.customerSegmentList=data.records
|
||||
}
|
||||
}, error => this.errorMessage = <any> error);
|
||||
}
|
||||
getStateCityList(){
|
||||
this._pd.getStateCityDetails().subscribe(
|
||||
data => {
|
||||
if (data.status == 200) {
|
||||
this.stateList=data.records
|
||||
this.getCityList(this.masterChild.fk_state);
|
||||
}
|
||||
}, error => this.errorMessage = <any> error);
|
||||
}
|
||||
getPDTypeList(){
|
||||
this._pd.getPDTypeDetails().subscribe(
|
||||
data => {
|
||||
if (data.status == 200) {
|
||||
this.pdTypeList=data.records.pd_type;
|
||||
|
||||
}
|
||||
}, error => this.errorMessage = <any> error);
|
||||
}
|
||||
|
||||
loadFormData() {
|
||||
this._EditPDtriggerForm = this._fb.group({
|
||||
fk_primary_id: [this.masterChild.pd_id],
|
||||
fk_lender_id: [this.masterChild.fk_lender_id, Validators.compose([Validators.required])],
|
||||
lender_applicant_id: [this.masterChild.lender_applicant_id, Validators.compose([Validators.required])],
|
||||
fk_product_id: [this.masterChild.fk_product_id, Validators.compose([Validators.required])],
|
||||
fk_subproduct_id: [this.masterChild.fk_subproduct_id, Validators.compose([Validators.required])],
|
||||
fk_pd_type: [this.masterChild.fk_pd_type, Validators.compose([Validators.required])],
|
||||
fk_customer_segment: [this.masterChild.fk_customer_segment, Validators.compose([Validators.required])],
|
||||
loan_amount: [this.masterChild.loan_amount, Validators.compose([Validators.required])],
|
||||
addressline1: [this.masterChild.addressline1, Validators.compose([Validators.required])],
|
||||
addressline2: [this.masterChild.addressline2],
|
||||
addressline3: [this.masterChild.addressline3],
|
||||
fk_city: [this.masterChild.fk_city, Validators.compose([Validators.required])],
|
||||
fk_state: [this.masterChild.fk_state, Validators.compose([Validators.required])],
|
||||
pincode : [this.masterChild.pincode, Validators.compose([Validators.required])],
|
||||
});
|
||||
}
|
||||
get pdMain() { return this._EditPDtriggerForm.controls; }
|
||||
|
||||
//get sub product list based on prokduct id
|
||||
getSubproductList(productID:string){
|
||||
|
||||
this.subProductList= this.productList.filter(item => item.product_id == productID);
|
||||
this.subProductList=this.subProductList[0].subproducts;
|
||||
}
|
||||
|
||||
//get city list details based on state id
|
||||
getCityList(stateID:string){
|
||||
this.cityList= this.stateList.filter(item => item.state_id == stateID);
|
||||
this.cityList=this.cityList[0].cities;
|
||||
}
|
||||
submitPdDetails(formValue: any) {
|
||||
if(this._EditPDtriggerForm.valid){
|
||||
let my_array = this._EditPDtriggerForm.value;
|
||||
Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]);
|
||||
this._pd.editPdMasterDetails(my_array).subscribe();
|
||||
}
|
||||
}
|
||||
loadPdMasterCompoent() {
|
||||
// this.notifier.notify('success', 'Your Changes Updated.!');
|
||||
|
||||
this.loadPdView.emit('1')
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -1,123 +0,0 @@
|
||||
<mat-card class="p-1">
|
||||
<form [formGroup]="_EditPDtriggerForm" (submit)="submitPdDetails(_EditPDtriggerForm.value)">
|
||||
<mat-card-content>
|
||||
<div class="mb-2"></div>
|
||||
<div fxLayout="row" fxLayoutWrap="wrap">
|
||||
<div class="column" fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100">
|
||||
<mat-card class="p-2">
|
||||
<h5>PD Details</h5>
|
||||
|
||||
<div fxLayout="column" fxLayoutAlign="start stretch">
|
||||
<mat-form-field style="width: 100%">
|
||||
<mat-select placeholder="Lender Name" formControlName="fk_lender_id" required>
|
||||
<mat-option *ngFor="let LL of lenderList" [value]="LL.entity_id" >
|
||||
{{LL.full_name}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
<mat-error *ngIf="pdMain.fk_lender_id.hasError('required')" class="mat-text-warn">Lender name is required.</mat-error>
|
||||
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput placeholder="Lender Applicant ID" formControlName="lender_applicant_id" type="text">
|
||||
<mat-error *ngIf="pdMain.lender_applicant_id.hasError('required')">Applicant id is required.</mat-error>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 100%">
|
||||
<mat-select placeholder="Product Name" formControlName="fk_product_id" (selectionChange)="getSubproductList(pdMain.fk_product_id.value.product_id)">
|
||||
<mat-option *ngFor="let PL of productList" [value]="PL" >
|
||||
{{PL.product_name}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
<mat-error *ngIf="pdMain.fk_product_id.hasError('required')">Product is required.</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field style="width: 100%">
|
||||
|
||||
<mat-select placeholder="Sub product Name" formControlName="fk_subproduct_id">
|
||||
<mat-option *ngFor="let SPL of subProductList" [value]="SPL" >
|
||||
{{SPL.subproduct_name}}
|
||||
</mat-option>
|
||||
|
||||
</mat-select>
|
||||
<mat-error *ngIf="pdMain.fk_subproduct_id.hasError('required')">Sub product is required.</mat-error>
|
||||
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 100%">
|
||||
<mat-select placeholder="Customer Segment" formControlName="fk_customer_segment">
|
||||
<mat-option *ngFor="let CSL of customerSegmentList" [value]="CSL.customer_segment_id" >
|
||||
{{CSL.customer_segment}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
<mat-error *ngIf="pdMain.fk_customer_segment.hasError('required')">Customer segment is required.</mat-error>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 100%">
|
||||
<mat-select placeholder="PD Type" formControlName="fk_pd_type">
|
||||
<mat-option *ngFor="let PDL of pdTypeList" [value]="PDL.pd_type_id" >
|
||||
{{PDL.type_name}}
|
||||
</mat-option>
|
||||
|
||||
</mat-select>
|
||||
<mat-error *ngIf="pdMain.fk_pd_type.hasError('required')">PD type is required.</mat-error>
|
||||
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput placeholder="Loan Amount" formControlName="loan_amount">
|
||||
<mat-error *ngIf="pdMain.loan_amount.hasError('required')">Amount is required.</mat-error>
|
||||
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 100%">
|
||||
<textarea matInput placeholder="Address 1" formControlName="addressline1"></textarea>
|
||||
<mat-error *ngIf="pdMain.addressline1.hasError('required')">Address1 required.</mat-error>
|
||||
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field style="width: 100%">
|
||||
<textarea matInput placeholder="Address 2" formControlName="addressline2"></textarea>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field style="width: 100%">
|
||||
<textarea matInput placeholder="Address 3" formControlName="addressline3"></textarea>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 100%;">
|
||||
<mat-select placeholder="Select State" formControlName="fk_state" >
|
||||
<mat-option *ngFor="let SL of stateList" [value]="SL">
|
||||
{{SL.state_name}}
|
||||
</mat-option>
|
||||
|
||||
</mat-select>
|
||||
<mat-error *ngIf="pdMain.fk_state.hasError('required')">State is required.</mat-error>
|
||||
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 100%;">
|
||||
<mat-select placeholder="Select City" (selectionChange)="getCityList(pdMain.fk_state.value.state_id)" formControlName="fk_city" >
|
||||
` <mat-option *ngFor="let CL of cityList" [value]="CL">
|
||||
{{CL.name}}
|
||||
</mat-option>
|
||||
|
||||
</mat-select>
|
||||
<mat-error *ngIf="pdMain.fk_city.hasError('required')">City is required.</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
|
||||
<mat-form-field style="width: 100%;">
|
||||
<input matInput placeholder="Pincode" formControlName="pincode">
|
||||
<mat-error *ngIf="pdMain.pincode.hasError('required')">Pincode is required.</mat-error>
|
||||
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
|
||||
</mat-card>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</mat-card-content>
|
||||
<hr>
|
||||
<!-- <mat-card-actions style="text-align: right">
|
||||
<button mat-button color="accent" type="button" (click)="loadPdListCompoent()">Cancel</button>
|
||||
|
||||
<button mat-button color="primary" type="submit" [disabled]="!PDtriggerForm.valid">Submit</button>
|
||||
</mat-card-actions> -->
|
||||
</form>
|
||||
</mat-card>
|
||||
|
||||
@ -1,156 +0,0 @@
|
||||
import { Component, OnInit,ViewEncapsulation, EventEmitter, Input, Output } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators, FormControl, FormArray } from '@angular/forms';
|
||||
import { CustomValidators } from 'ng2-validation';
|
||||
import { PdTrigerService } from '../pd-service/pd-triger.service';
|
||||
import { AwsService } from '../../AwsService/aws.service';
|
||||
@Component({
|
||||
selector: 'app-edit-pd',
|
||||
templateUrl: './edit-pd.component.html',
|
||||
styleUrls: ['./edit-pd.component.scss'],
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
export class EditPdComponent implements OnInit {
|
||||
errorMessage: any;
|
||||
public editData: any;
|
||||
public productList:any;
|
||||
subProductList:any;
|
||||
lenderList:any;
|
||||
customerSegmentList:any;
|
||||
public stateList:any;
|
||||
cityList:any;
|
||||
pdTypeList:any;
|
||||
@Input() childData: string;
|
||||
@Output() loadParent = new EventEmitter<string>();
|
||||
public _EditPDtriggerForm:FormGroup;
|
||||
constructor(private _fb: FormBuilder,
|
||||
private _pd: PdTrigerService, private _aws:AwsService) {
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.getLenderList();
|
||||
this.getProductsList();
|
||||
this.getCustomerSegmentList();
|
||||
this.getStateCityList();
|
||||
this.getPDTypeList();
|
||||
this.editPdDetails(this.childData);
|
||||
this.beforeLoadFormData();
|
||||
}
|
||||
editPdDetails(editID:string){
|
||||
this._pd.editPdDetails(editID).subscribe(
|
||||
data => {
|
||||
if (data.status == 200) {
|
||||
this.editData=data.records
|
||||
this.afterLoadFormData();
|
||||
}
|
||||
}, error => this.errorMessage = <any> error);
|
||||
}
|
||||
|
||||
loadPdListCompoent() {
|
||||
this.loadParent.emit('2')
|
||||
}
|
||||
getLenderList(){
|
||||
this._pd.getLenderDetails().subscribe(
|
||||
data => {
|
||||
if (data.status == 200) {
|
||||
this.lenderList=data.records
|
||||
}
|
||||
}, error => this.errorMessage = <any> error);
|
||||
}
|
||||
getProductsList(){
|
||||
this._pd.getProductsDetails().subscribe(
|
||||
data => {
|
||||
if (data.status == 200) {
|
||||
this.productList=data.records
|
||||
}
|
||||
}, error => this.errorMessage = <any> error);
|
||||
}
|
||||
getCustomerSegmentList(){
|
||||
this._pd.getCustomersDetails().subscribe(
|
||||
data => {
|
||||
if (data.status == 200) {
|
||||
this.customerSegmentList=data.records
|
||||
}
|
||||
}, error => this.errorMessage = <any> error);
|
||||
}
|
||||
getStateCityList(){
|
||||
this._pd.getStateCityDetails().subscribe(
|
||||
data => {
|
||||
if (data.status == 200) {
|
||||
this.stateList=data.records
|
||||
}
|
||||
}, error => this.errorMessage = <any> error);
|
||||
}
|
||||
getPDTypeList(){
|
||||
this._pd.getPDTypeDetails().subscribe(
|
||||
data => {
|
||||
if (data.status == 200) {
|
||||
this.pdTypeList=data.records.pd_type;
|
||||
|
||||
}
|
||||
}, error => this.errorMessage = <any> error);
|
||||
}
|
||||
|
||||
|
||||
beforeLoadFormData(){
|
||||
this._EditPDtriggerForm = this._fb.group({
|
||||
fk_lender_id: [null, Validators.compose([Validators.required])],
|
||||
lender_applicant_id: [null, Validators.compose([Validators.required])],
|
||||
fk_product_id: [null, Validators.compose([Validators.required])],
|
||||
fk_subproduct_id: [null, Validators.compose([Validators.required])],
|
||||
fk_pd_type: [null, Validators.compose([Validators.required])],
|
||||
fk_customer_segment: [null, Validators.compose([Validators.required])],
|
||||
loan_amount: [null, Validators.compose([Validators.required])],
|
||||
applicant_name: [null, Validators.compose([Validators.required])],
|
||||
mobile_no: [null, Validators.compose([Validators.required])],
|
||||
email: [null, Validators.compose([Validators.required, CustomValidators.email])],
|
||||
addressline1: [null, Validators.compose([Validators.required])],
|
||||
addressline2: [null],
|
||||
addressline3: [null],
|
||||
fk_city: [null, Validators.compose([Validators.required])],
|
||||
fk_state: [null, Validators.compose([Validators.required])],
|
||||
pincode : [null, Validators.compose([Validators.required])],
|
||||
items: this._fb.array([]),
|
||||
documents: this._fb.array([])
|
||||
});
|
||||
}
|
||||
afterLoadFormData() {
|
||||
this._EditPDtriggerForm = this._fb.group({
|
||||
fk_lender_id: [null, Validators.compose([Validators.required])],
|
||||
lender_applicant_id: [null, Validators.compose([Validators.required])],
|
||||
fk_product_id: [null, Validators.compose([Validators.required])],
|
||||
fk_subproduct_id: [null, Validators.compose([Validators.required])],
|
||||
fk_pd_type: [null, Validators.compose([Validators.required])],
|
||||
fk_customer_segment: [null, Validators.compose([Validators.required])],
|
||||
loan_amount: [null, Validators.compose([Validators.required])],
|
||||
applicant_name: [null, Validators.compose([Validators.required])],
|
||||
mobile_no: [null, Validators.compose([Validators.required])],
|
||||
email: [null, Validators.compose([Validators.required, CustomValidators.email])],
|
||||
addressline1: [null, Validators.compose([Validators.required])],
|
||||
addressline2: [null],
|
||||
addressline3: [null],
|
||||
fk_city: [null, Validators.compose([Validators.required])],
|
||||
fk_state: [null, Validators.compose([Validators.required])],
|
||||
pincode : [null, Validators.compose([Validators.required])],
|
||||
items: this._fb.array([]),
|
||||
documents: this._fb.array([])
|
||||
});
|
||||
}
|
||||
get pdMain() { return this._EditPDtriggerForm.controls; }
|
||||
|
||||
//get sub product list based on prokduct id
|
||||
getSubproductList(productID:string){
|
||||
this.subProductList= this.productList.filter(item => item.product_id == productID);
|
||||
this.subProductList=this.subProductList[0].subproducts;
|
||||
}
|
||||
|
||||
//get city list details based on state id
|
||||
getCityList(stateID:string){
|
||||
this.cityList= this.stateList.filter(item => item.state_id == stateID);
|
||||
this.cityList=this.cityList[0].city;
|
||||
}
|
||||
submitPdDetails(formValue: any) {
|
||||
if(this._EditPDtriggerForm.valid){
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,175 +0,0 @@
|
||||
import { Component, ViewChild, OnInit, ViewEncapsulation, EventEmitter, Output } from '@angular/core';
|
||||
import { PdTrigerService } from '../pd-service/pd-triger.service';
|
||||
import { MatPaginator, MatSort, MatTableDataSource, PageEvent } from '@angular/material';
|
||||
//import { MapPdViewComponent } from '../map-pd-view/map-pd-view.component';
|
||||
@Component({
|
||||
selector: 'app-list-pd',
|
||||
templateUrl: './list-pd.component.html',
|
||||
styleUrls: ['./list-pd.component.scss'],
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
export class ListPdComponent implements OnInit {
|
||||
recordStatus: boolean;
|
||||
parentEditData :string;
|
||||
parentViewData :string;
|
||||
showParentComponent:boolean;
|
||||
showAddComponent:boolean;
|
||||
showEditComponent:boolean;
|
||||
showViewComponent:boolean;
|
||||
showMapViewComponent:boolean;
|
||||
errorMessage: any;
|
||||
public paginationList: any[] = [];
|
||||
// pagination variable details
|
||||
length = 50;
|
||||
pageIndex = 0;
|
||||
pageSize = 10;
|
||||
pageEvent: PageEvent;
|
||||
|
||||
// data source variable details
|
||||
pdListData = null;
|
||||
public dataLength: number;
|
||||
public dataSource = new MatTableDataSource();
|
||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||
@ViewChild(MatSort) sort: MatSort;
|
||||
pdList:any[] = [];
|
||||
tiles: any[] = [{
|
||||
text: 'One',
|
||||
cols: 3,
|
||||
rows: 1,
|
||||
color: 'lightblue'
|
||||
}, {
|
||||
text: 'Two',
|
||||
cols: 1,
|
||||
rows: 1,
|
||||
color: 'lightgreen'
|
||||
}, {
|
||||
text: 'Three',
|
||||
cols: 1,
|
||||
rows: 1,
|
||||
color: 'lightpink'
|
||||
}, {
|
||||
text: 'Four',
|
||||
cols: 2,
|
||||
rows: 1,
|
||||
color: '#DDBDF1'
|
||||
}];
|
||||
|
||||
dogs: Object[] = [{
|
||||
name: 'Porter',
|
||||
human: 'Kara'
|
||||
}, {
|
||||
name: 'Mal',
|
||||
human: 'Jeremy'
|
||||
}, {
|
||||
name: 'Koby',
|
||||
human: 'Igor'
|
||||
}, {
|
||||
name: 'Razzle',
|
||||
human: 'Ward'
|
||||
}, {
|
||||
name: 'Molly',
|
||||
human: 'Rob'
|
||||
}, {
|
||||
name: 'Husi',
|
||||
human: 'Matias'
|
||||
}];
|
||||
|
||||
basicRowHeight = 80;
|
||||
fixedCols = 4;
|
||||
fixedRowHeight = 50;
|
||||
ratioGutter = 1;
|
||||
fitListHeight = '400px';
|
||||
ratio = '8:1';
|
||||
|
||||
addTileCols() {
|
||||
this.tiles[2].cols++;
|
||||
}
|
||||
constructor(private _pd: PdTrigerService) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.recordStatus=false
|
||||
this.showParentComponent=true
|
||||
this.showAddComponent=false
|
||||
this.showEditComponent=false
|
||||
this.showViewComponent=false
|
||||
this.showMapViewComponent=false
|
||||
this._pd.getPdDetails()
|
||||
.subscribe(
|
||||
data => {
|
||||
if (data.status == 200) {
|
||||
this.pdList = data.records;
|
||||
this.pdListData = data.records;
|
||||
this.dataLength = data.records.length;
|
||||
this.dataSource.data = this.pdListData;
|
||||
|
||||
}
|
||||
else{
|
||||
this.pdList=[];
|
||||
this.dataLength = null;
|
||||
this.recordStatus=true;
|
||||
}
|
||||
}, error => this.errorMessage = <any> error);
|
||||
}
|
||||
addPdDetails(){
|
||||
this.showParentComponent=false
|
||||
this.showEditComponent=false
|
||||
this.showViewComponent=false
|
||||
this.showAddComponent=!this.showAddComponent
|
||||
}
|
||||
|
||||
editPdDetails(editID:string){
|
||||
this.showParentComponent=false
|
||||
this.showAddComponent=false
|
||||
this.showViewComponent=false
|
||||
this.showEditComponent=!this.showEditComponent
|
||||
this.parentEditData=editID
|
||||
}
|
||||
viewPdDetails(editID:string){
|
||||
this.showParentComponent=false
|
||||
this.showAddComponent=false
|
||||
this.showEditComponent=false
|
||||
this.showViewComponent=!this.showViewComponent
|
||||
this.parentViewData=editID
|
||||
}
|
||||
viewMapPdDetails(){
|
||||
this.showParentComponent=false
|
||||
this.showAddComponent=false
|
||||
this.showEditComponent=false
|
||||
this.showMapViewComponent=!this.showMapViewComponent;
|
||||
}
|
||||
updateParentComponent(event:string) {
|
||||
this.showParentComponent=!this.showParentComponent
|
||||
if(event=='1'){
|
||||
this.showAddComponent=!this.showAddComponent
|
||||
}
|
||||
else if(event=='2'){
|
||||
this.showEditComponent=!this.showEditComponent
|
||||
}
|
||||
else if(event=='3'){
|
||||
this.showViewComponent=!this.showViewComponent
|
||||
}
|
||||
this._pd.getPdDetails()
|
||||
.subscribe(
|
||||
data => {
|
||||
if (data.status == 200) {
|
||||
this.pdList = data.records;
|
||||
this.pdListData = data.records;
|
||||
this.dataLength = data.records.length;
|
||||
this.dataSource.data = this.pdListData;
|
||||
|
||||
}
|
||||
else{
|
||||
this.pdList=[];
|
||||
this.dataLength = null;
|
||||
this.recordStatus=true;
|
||||
}
|
||||
}, error => this.errorMessage = <any> error);
|
||||
}
|
||||
|
||||
|
||||
pageChange(e) {
|
||||
console.log(e);
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,213 +0,0 @@
|
||||
<div fxLayout="row">
|
||||
<div class="column" fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100">
|
||||
<mat-card class="mb-2" >
|
||||
<mat-card-header>
|
||||
<!-- <img mat-card-avatar src="assets/images/avatar.jpg"> -->
|
||||
<mat-card-title>Search Options</mat-card-title>
|
||||
<mat-card-subtitle>Header subtitle</mat-card-subtitle>
|
||||
</mat-card-header>
|
||||
<!-- <img mat-card-image src="assets/images/coridoor.jpg"> -->
|
||||
<mat-card-content>
|
||||
<div class="column" fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="33.33" fxFlex.lg="33.33" fxFlex.xl="33.33">
|
||||
<!-- <mat-card class="mb-2" >
|
||||
<mat-card-content> -->
|
||||
<!-- <mat-list dense>
|
||||
<mat-list-item > -->
|
||||
<!-- <img mat-list-avatar src="assets/images/lime.jpg" alt=""> -->
|
||||
<!-- <h3 mat-line>Icci</h3>
|
||||
<p mat-line>9159996676</p> -->
|
||||
|
||||
<!-- <h3 mat-line>{{details.applicat_details[0].applicant_name}} </h3>
|
||||
|
||||
<p mat-line><span style="padding-right: 7%;">{{details.lender_full_name}} </span><span style="padding-right: 7%">{{details.lender_applicant_id}}</span></p>
|
||||
<p mat-line> {{details.pd_date_of_initiation}}</p> -->
|
||||
<!-- <mat-card class="mb-2" *ngFor="let details of dataSource.connect() | async">
|
||||
<mat-card-title>{{details.applicat_details[0].applicant_name}}</mat-card-title>
|
||||
<mat-card-subtitle >{{details.applicat_details[0].applicant_name}}</mat-card-subtitle>
|
||||
<mat-card-content>
|
||||
<p mat-line class="hover-icon"><i class="fa-1x fa fa-map-rupee"> </i> {{details.loan_amount}}</p>
|
||||
<p mat-line class="hover-icon"><i class="fa-1x fa fa-map-marker"> </i> {{details.city_name}}/{{details.state_name}}-{{details.pincode}}</p>
|
||||
|
||||
</mat-card-content>
|
||||
<hr>
|
||||
<mat-card-actions>
|
||||
<button mat-button color="accent">Action</button>
|
||||
<button mat-button>Cancel</button>
|
||||
</mat-card-actions>
|
||||
</mat-card> -->
|
||||
<mat-expansion-panel *ngFor="let details of dataSource.connect() | async">
|
||||
<mat-expansion-panel-header>
|
||||
<mat-panel-title>
|
||||
<b> {{details.applicat_details[0].applicant_name}} </b>
|
||||
</mat-panel-title>
|
||||
<mat-panel-description>
|
||||
{{details.product_abbr}}/{{details.subproduct_abbr}}
|
||||
</mat-panel-description>
|
||||
</mat-expansion-panel-header>
|
||||
<p mat-line>Lendor ID:{{details.lender_applicant_id}}</p>
|
||||
<p mat-line>Lendor Name:{{details.lender_full_name}}</p>
|
||||
<p mat-line>Date Of Initiation:{{details.pd_date_of_initiation}}</p>
|
||||
<p mat-line class="hover-icon"><i class="fa-1x fa fa-rupee"> </i>{{details.loan_amount}}
|
||||
</p>
|
||||
<p mat-line>
|
||||
<button mat-raised-button mat-button-sm mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="pdAllocationTo(master)"><mat-icon>directions_run</mat-icon></button>
|
||||
|
||||
</p>
|
||||
|
||||
|
||||
</mat-expansion-panel>
|
||||
<!-- <p mat-line><a style="padding-right: 7%;">{{details.product_abbr}}/{{details.subproduct_abbr}}/{{details.customer_segment_abbr}}</a><a style="padding-right: 7%;"><span class="hover-icon"><i class="fa-1x fa fa-rupee"> </i>{{details.loan_amount}}</span></a><span class="hover-icon"><i class="fa-1x fa fa-map-marker"> </i> {{details.city_name}}/{{details.state_name}}-{{details.pincode}}</span></p> -->
|
||||
|
||||
<!-- <mat-divider></mat-divider>
|
||||
</mat-list-item>
|
||||
|
||||
</mat-list> -->
|
||||
<mat-list *ngIf="recordStatus">
|
||||
<mat-list-item>
|
||||
<p mat-line>No Record Found ...</p>
|
||||
|
||||
</mat-list-item>
|
||||
</mat-list>
|
||||
<!-- </mat-card-content> -->
|
||||
<!-- <mat-card-actions *ngIf="!recordStatus"> -->
|
||||
<mat-paginator #paginator [length]="pdList.length" [pageIndex]="pageIndex" [pageSize]="pageSize"
|
||||
[pageSizeOptions]="[5, 10, 25, 100]" (page)="pageEvent = $event; pageChange($event)">
|
||||
</mat-paginator>
|
||||
<!-- </mat-card-actions>
|
||||
</mat-card> -->
|
||||
</div>
|
||||
<div class="column" fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="66.66" fxFlex.lg="66.66" fxFlex.xl="66.66">
|
||||
<mat-card class="mb-2">
|
||||
<agm-map [latitude]="lat" [longitude]="lng">
|
||||
<agm-marker [latitude]="lat" [longitude]="lng"></agm-marker>
|
||||
</agm-map>
|
||||
</mat-card>
|
||||
</div>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
</div>
|
||||
</div>
|
||||
<div fxLayout="row">
|
||||
<div align="right">
|
||||
<button mat-fab class="mr-1 mb-1" color="accent"><mat-icon>close</mat-icon></button>
|
||||
</div>
|
||||
<mat-card>
|
||||
<mat-tab-group>
|
||||
<mat-tab>
|
||||
<ng-template mat-tab-label>All</ng-template>
|
||||
<mat-card-content>
|
||||
<div class="card-comment-widget">
|
||||
<mat-list *ngIf="pdList.length > 0">
|
||||
<mat-list-item *ngFor="let details of dataSource.connect() | async">
|
||||
<img mat-list-avatar src="assets/images/lime.jpg" alt="">
|
||||
<!-- {{details.applicat_details[0].applicant_name}} -->
|
||||
<p mat-line>{{details.applicat_details[0].applicant_name}} </p>
|
||||
|
||||
<p mat-line><a style="padding-right: 7%;">{{details.lender_full_name}} </a><a style="padding-right: 7%">{{details.lender_applicant_id}}</a>{{details.pd_date_of_initiation}}</p>
|
||||
<p mat-line><a style="padding-right: 7%;">{{details.product_abbr}}/{{details.subproduct_abbr}}/{{details.customer_segment_abbr}}</a><a style="padding-right: 7%;"><span class="hover-icon"><i class="fa-1x fa fa-rupee"> </i>{{details.loan_amount}}</span></a><span class="hover-icon"><i class="fa-1x fa fa-map-marker"> </i> {{details.city_name}}/{{details.state_name}}-{{details.pincode}}</span></p>
|
||||
<!-- <span class="text-mat mat-text-muted">Chennai</span> -->
|
||||
|
||||
<!-- <div class="comment-time">
|
||||
<button mat-raised-button mat-icon-button mat-button-sm class="mr-1 mb-1" type="button" color="primary" (click)="editPdDetails(details.pd_id)"><mat-icon>edit</mat-icon></button>
|
||||
|
||||
</div> -->
|
||||
<div class="comment-time">
|
||||
|
||||
<!-- <button mat-raised-button mat-icon-button mat-button-sm class="mr-1 mb-1" color="accent" type="button" (click)="viewPdDetails(details.pd_id)"><mat-icon>visibility</mat-icon></button> -->
|
||||
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="viewPdDetails(details.pd_id)"><mat-icon>visibility</mat-icon></button>
|
||||
</div>
|
||||
|
||||
</mat-list-item>
|
||||
<hr>
|
||||
</mat-list>
|
||||
<mat-list *ngIf="recordStatus">
|
||||
<mat-list-item>
|
||||
<p mat-line>No Record Found ...</p>
|
||||
|
||||
</mat-list-item>
|
||||
</mat-list>
|
||||
</div>
|
||||
</mat-card-content>
|
||||
|
||||
<mat-card-actions *ngIf="!recordStatus">
|
||||
<mat-paginator #paginator class="mat-elevation-z1" [length]="pdList.length" [pageIndex]="pageIndex" [pageSize]="pageSize"
|
||||
[pageSizeOptions]="[5, 10, 25, 100]" (page)="pageEvent = $event; pageChange($event)">
|
||||
</mat-paginator>
|
||||
</mat-card-actions>
|
||||
</mat-tab>
|
||||
<!-- <mat-tab>
|
||||
<ng-template mat-tab-label>Confirmed PD Details</ng-template>
|
||||
<mat-card-content>
|
||||
<mat-grid-list cols="2" [rowHeight]="ratio" gutterSize="4px">
|
||||
<mat-grid-tile *ngFor="let tile of tiles" [style.background]="'lightblue'">
|
||||
{{tile.text}}
|
||||
</mat-grid-tile>
|
||||
</mat-grid-list>
|
||||
<div fxLayout="row" fxLayoutAlign="start center" class="mt-2">
|
||||
<mat-form-field>
|
||||
<input matInput placeholder="Change ratio" [(ngModel)]="ratio">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</mat-card-content>
|
||||
</mat-tab>-->
|
||||
<mat-tab>
|
||||
<ng-template mat-tab-label>In Progress </ng-template>
|
||||
<mat-card-content>
|
||||
<!--<mat-grid-list cols="2" rowHeight="fit" [gutterSize]="ratioGutter"
|
||||
[style.height]="fitListHeight">
|
||||
<mat-grid-tile *ngFor="let tile of tiles" [style.background]="'#F1EBBA'">
|
||||
{{tile.text}}
|
||||
</mat-grid-tile>
|
||||
</mat-grid-list>
|
||||
<div fxLayout="row" fxLayoutAlign="start center" class="mt-2">
|
||||
<mat-form-field>
|
||||
<input matInput placeholder="Change list height" [(ngModel)]="fitListHeight">
|
||||
</mat-form-field>
|
||||
<mat-form-field>
|
||||
<input matInput placeholder="Change gutter" type="number" [(ngModel)]="ratioGutter">
|
||||
</mat-form-field>
|
||||
</div>-->
|
||||
</mat-card-content>
|
||||
</mat-tab>
|
||||
<mat-tab>
|
||||
<ng-template mat-tab-label>Scheduled </ng-template>
|
||||
<mat-card-content>
|
||||
<!--<mat-grid-list cols="2" rowHeight="fit" [gutterSize]="ratioGutter"
|
||||
[style.height]="fitListHeight">
|
||||
<mat-grid-tile *ngFor="let tile of tiles" [style.background]="'#F1EBBA'">
|
||||
{{tile.text}}
|
||||
</mat-grid-tile>
|
||||
</mat-grid-list>
|
||||
<div fxLayout="row" fxLayoutAlign="start center" class="mt-2">
|
||||
<mat-form-field>
|
||||
<input matInput placeholder="Change list height" [(ngModel)]="fitListHeight">
|
||||
</mat-form-field>
|
||||
<mat-form-field>
|
||||
<input matInput placeholder="Change gutter" type="number" [(ngModel)]="ratioGutter">
|
||||
</mat-form-field>
|
||||
</div>-->
|
||||
</mat-card-content>
|
||||
</mat-tab>
|
||||
<mat-tab>
|
||||
<ng-template mat-tab-label>Completed </ng-template>
|
||||
<mat-card-content>
|
||||
<!--<mat-grid-list cols="2" rowHeight="fit" [gutterSize]="ratioGutter"
|
||||
[style.height]="fitListHeight">
|
||||
<mat-grid-tile *ngFor="let tile of tiles" [style.background]="'#F1EBBA'">
|
||||
{{tile.text}}
|
||||
</mat-grid-tile>
|
||||
</mat-grid-list>
|
||||
<div fxLayout="row" fxLayoutAlign="start center" class="mt-2">
|
||||
<mat-form-field>
|
||||
<input matInput placeholder="Change list height" [(ngModel)]="fitListHeight">
|
||||
</mat-form-field>
|
||||
<mat-form-field>
|
||||
<input matInput placeholder="Change gutter" type="number" [(ngModel)]="ratioGutter">
|
||||
</mat-form-field>
|
||||
</div>-->
|
||||
</mat-card-content>
|
||||
</mat-tab>
|
||||
|
||||
</mat-tab-group>
|
||||
</mat-card>
|
||||
</div>
|
||||
@ -1,54 +0,0 @@
|
||||
import { Component, ViewChild, OnInit } from '@angular/core';
|
||||
import { MatPaginator, MatSort, MatTableDataSource, PageEvent } from '@angular/material';
|
||||
|
||||
import { NotifierService } from 'angular-notifier';
|
||||
import { PdTrigerService } from '../pd-service/pd-triger.service';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-map-pd-view',
|
||||
templateUrl: './map-pd-view.component.html',
|
||||
styleUrls: ['./map-pd-view.component.scss']
|
||||
})
|
||||
export class MapPdViewComponent implements OnInit {
|
||||
lat = -34.397;
|
||||
lng = 150.644;
|
||||
recordStatus: boolean;
|
||||
errorMessage: any;
|
||||
// pagination variable details
|
||||
length = 50;
|
||||
pageIndex = 0;
|
||||
pageSize = 10;
|
||||
pageEvent: PageEvent;
|
||||
// data source variable details
|
||||
pdListData = null;
|
||||
public dataLength: number;
|
||||
public dataSource = new MatTableDataSource();
|
||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||
@ViewChild(MatSort) sort: MatSort;
|
||||
pdList:any[] = [];
|
||||
constructor(private _pd: PdTrigerService) {
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.recordStatus=false
|
||||
this._pd.getPdDetails()
|
||||
.subscribe(
|
||||
data => {
|
||||
if (data.status == 200) {
|
||||
this.pdList = data.records;
|
||||
this.pdListData = data.records;
|
||||
this.dataLength = data.records.length;
|
||||
this.dataSource.data = this.pdListData;
|
||||
|
||||
}
|
||||
else{
|
||||
this.pdList=[];
|
||||
this.dataLength = null;
|
||||
this.recordStatus=true;
|
||||
}
|
||||
}, error => this.errorMessage = <any> error);
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,19 +0,0 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
import { ListPdComponent } from './list-pd/list-pd.component';
|
||||
import { AddPdComponent } from './add-pd/add-pd.component';
|
||||
|
||||
export const PdTrigerRoutes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: ListPdComponent
|
||||
// children:
|
||||
// [{
|
||||
// path: 'pdtriggerlist',
|
||||
// component: AddPdComponent
|
||||
// }]
|
||||
}
|
||||
|
||||
];
|
||||
|
||||
|
||||
@ -1,13 +0,0 @@
|
||||
import { PdTrigerModule } from './pd-triger.module';
|
||||
|
||||
describe('PdTrigerModule', () => {
|
||||
let pdTrigerModule: PdTrigerModule;
|
||||
|
||||
beforeEach(() => {
|
||||
pdTrigerModule = new PdTrigerModule();
|
||||
});
|
||||
|
||||
it('should create an instance', () => {
|
||||
expect(pdTrigerModule).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,12 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { GetGeometricLocationService } from './get-geometric-location.service';
|
||||
|
||||
describe('GetGeometricLocationService', () => {
|
||||
beforeEach(() => TestBed.configureTestingModule({}));
|
||||
|
||||
it('should be created', () => {
|
||||
const service: GetGeometricLocationService = TestBed.get(GetGeometricLocationService);
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,24 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable } from 'rxjs';//for Datatables
|
||||
import { Http } from '@angular/http';
|
||||
|
||||
@Injectable()
|
||||
|
||||
export class GetGeometricLocationService {
|
||||
MAP_API_KEY: string;
|
||||
MAP_API_URL: string;
|
||||
constructor(private _http: Http) {
|
||||
this.MAP_API_KEY = 'AIzaSyBtdO5k6CRntAMJCF-H5uZjTCoSGX95cdk'
|
||||
this.MAP_API_URL = `https://maps.googleapis.com/maps/api/geocode/json?key=${this.MAP_API_KEY}&address=`;
|
||||
}
|
||||
findLocations(address:string, postalCode?: string,state?:string, city?: string): Observable<any> {
|
||||
let compositeAddress = [address];
|
||||
|
||||
if (postalCode) compositeAddress.push(postalCode);
|
||||
if (state) compositeAddress.push(state);
|
||||
if (city) compositeAddress.push(city);
|
||||
|
||||
let url = `${this.MAP_API_URL}${compositeAddress.join(',')}`;
|
||||
return this._http.get(url).map(response => <any> response.json());
|
||||
}
|
||||
}
|
||||
@ -1,7 +1,11 @@
|
||||
<mat-card class="p-1">
|
||||
<form [formGroup]="_PDtriggerForm" (submit)="submitPdDetails(_PDtriggerForm.value)">
|
||||
<mat-card-content>
|
||||
<div class="mb-2"></div>
|
||||
<form [formGroup]="_PDtriggerForm" (submit)="submitPdDetails(_PDtriggerForm.value,PDTriggerStatus)">
|
||||
|
||||
<mat-card-content>
|
||||
<div style="width: 100%;text-align:right;">
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Close" matTooltipPosition="above"
|
||||
(click)="loadPdListCompoent(cancelStatus)"><mat-icon>close</mat-icon></button>
|
||||
</div>
|
||||
<div fxLayout="row" fxLayoutWrap="wrap">
|
||||
<div class="column" fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100">
|
||||
<mat-card class="p-2">
|
||||
@ -11,67 +15,81 @@
|
||||
<!-- <mat-form-field style="width: 100%">
|
||||
<input matInput placeholder="First Name" type="text" name="name" required>
|
||||
</mat-form-field> -->
|
||||
|
||||
<mat-form-field style="width: 100%">
|
||||
<mat-select placeholder="Lender Name" formControlName="fk_lender_id" required>
|
||||
<mat-select placeholder="Lender Name" formControlName="fk_lender_id" (selectionChange)="getBillingDetails(pdMain.fk_lender_id.value)">
|
||||
<mat-option *ngFor="let LL of lenderList" [value]="LL.entity_id" >
|
||||
{{LL.full_name}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
<mat-error *ngIf="pdMain.fk_lender_id.hasError('required')" class="mat-text-warn">Lender name is required.</mat-error>
|
||||
<!-- <mat-error *ngIf="pdMain.fk_lender_id.hasError('required')" class="mat-text-warn">Lender Name Required.</mat-error> -->
|
||||
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput placeholder="Lender Applicant ID" formControlName="lender_applicant_id" type="text" required>
|
||||
<mat-error *ngIf="pdMain.lender_applicant_id.hasError('required')">Applicant id is required.</mat-error>
|
||||
<mat-error *ngIf="pdMain.lender_applicant_id.hasError('required')">Applicant ID Required</mat-error>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 100%">
|
||||
<mat-select placeholder="Billing Address" formControlName="lender_billing">
|
||||
<mat-option *ngFor="let billL of billingList" [value]="billL.entity_billing_id" >
|
||||
{{billL.billing_name}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
<!-- <mat-error *ngIf="pdMain.lender_billing.hasError('required')">Billing Address Required</mat-error> -->
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput placeholder="Contact Person" formControlName="lender_contact_person" type="text" required>
|
||||
<mat-error *ngIf="pdMain.lender_contact_person.hasError('required')">Contact Person Required</mat-error>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput placeholder="Contact Number" formControlName="lender_contact_mobile" type="text" required>
|
||||
<mat-error *ngIf="pdMain.lender_contact_mobile.hasError('required')">Contact Number Required</mat-error>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 100%">
|
||||
<mat-select placeholder="Product Name" formControlName="fk_product_id" (selectionChange)="getSubproductList(pdMain.fk_product_id.value)" required>
|
||||
<mat-select placeholder="Product Name" formControlName="fk_product_id" (selectionChange)="getSubproductList(pdMain.fk_product_id.value)">
|
||||
<mat-option *ngFor="let PL of productList" [value]="PL.product_id" >
|
||||
{{PL.product_name}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
<mat-error *ngIf="pdMain.fk_product_id.hasError('required')">Product is required.</mat-error>
|
||||
<!-- <mat-error *ngIf="pdMain.fk_product_id.hasError('required')">Product Required.</mat-error> -->
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field style="width: 100%">
|
||||
|
||||
<mat-select placeholder="Sub product Name" formControlName="fk_subproduct_id" required>
|
||||
<mat-select placeholder="Sub product Name" formControlName="fk_subproduct_id">
|
||||
<mat-option *ngFor="let SPL of subProductList" [value]="SPL.subproduct_id" >
|
||||
{{SPL.subproduct_name}}
|
||||
</mat-option>
|
||||
|
||||
</mat-select>
|
||||
<mat-error *ngIf="pdMain.fk_subproduct_id.hasError('required')">Sub product is required.</mat-error>
|
||||
<!-- <mat-error *ngIf="pdMain.fk_subproduct_id.hasError('required')">Sub Product Required.</mat-error> -->
|
||||
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 100%">
|
||||
<mat-select placeholder="Customer Segment" formControlName="fk_customer_segment" required>
|
||||
<mat-select placeholder="Customer Segment" formControlName="fk_customer_segment">
|
||||
<mat-option *ngFor="let CSL of customerSegmentList" [value]="CSL.customer_segment_id" >
|
||||
{{CSL.customer_segment}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
<mat-error *ngIf="pdMain.fk_customer_segment.hasError('required')">Customer segment is required.</mat-error>
|
||||
<!-- <mat-error *ngIf="pdMain.fk_customer_segment.hasError('required')">Customer Segment Required.</mat-error> -->
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 100%">
|
||||
<mat-select placeholder="PD Type" formControlName="fk_pd_type" required>
|
||||
<mat-select placeholder="PD Type" formControlName="fk_pd_type">
|
||||
<mat-option *ngFor="let PDL of pdTypeList" [value]="PDL.pd_type_id" >
|
||||
{{PDL.type_name}}
|
||||
</mat-option>
|
||||
|
||||
</mat-select>
|
||||
<mat-error *ngIf="pdMain.fk_pd_type.hasError('required')">PD type is required.</mat-error>
|
||||
<!-- <mat-error *ngIf="pdMain.fk_pd_type.hasError('required')">PD Type Required.</mat-error> -->
|
||||
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput placeholder="Loan Amount" formControlName="loan_amount" required>
|
||||
<mat-error *ngIf="pdMain.loan_amount.hasError('required')">Amount is required.</mat-error>
|
||||
|
||||
<input matInput placeholder="Loan Amount" formControlName="loan_amount">
|
||||
<!-- <mat-error *ngIf="pdMain.loan_amount.hasError('required')">Amount Required.</mat-error> -->
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 100%">
|
||||
<textarea matInput placeholder="Address 1" formControlName="addressline1" required></textarea>
|
||||
<mat-error *ngIf="pdMain.addressline1.hasError('required')">Address1 required.</mat-error>
|
||||
|
||||
<textarea matInput placeholder="Address 1" formControlName="addressline1"></textarea>
|
||||
<!-- <mat-error *ngIf="pdMain.addressline1.hasError('required')">Address1 required.</mat-error> -->
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field style="width: 100%">
|
||||
@ -82,31 +100,31 @@
|
||||
<textarea matInput placeholder="Address 3" formControlName="addressline3"></textarea>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 100%;">
|
||||
<mat-select placeholder="Select State" formControlName="fk_state" (selectionChange)="getCityList(pdMain.fk_state.value)" required>
|
||||
<mat-select placeholder="State" formControlName="fk_state" (selectionChange)="getCityList(pdMain.fk_state.value)">
|
||||
<mat-option *ngFor="let SL of stateList" [value]="SL.state_id">
|
||||
{{SL.state_name}}
|
||||
</mat-option>
|
||||
|
||||
</mat-select>
|
||||
<mat-error *ngIf="pdMain.fk_state.hasError('required')">State is required.</mat-error>
|
||||
<!-- <mat-error *ngIf="pdMain.fk_state.hasError('required')">State Required.</mat-error> -->
|
||||
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 100%;">
|
||||
<mat-select placeholder="Select City" formControlName="fk_city" required>
|
||||
<mat-select placeholder="City" formControlName="fk_city">
|
||||
` <mat-option *ngFor="let CL of cityList" [value]="CL.city_id">
|
||||
{{CL.city_name}}
|
||||
</mat-option>
|
||||
|
||||
</mat-select>
|
||||
<mat-error *ngIf="pdMain.fk_city.hasError('required')">City is required.</mat-error>
|
||||
<!-- <mat-error *ngIf="pdMain.fk_city.hasError('required')">City Required.</mat-error> -->
|
||||
</mat-form-field>
|
||||
|
||||
|
||||
<mat-form-field style="width: 100%;">
|
||||
<input matInput placeholder="Pincode" formControlName="pincode" required>
|
||||
<mat-error *ngIf="pdMain.pincode.hasError('required')">Pincode is required.</mat-error>
|
||||
<input matInput placeholder="Pincode" formControlName="pincode">
|
||||
<!-- <mat-error *ngIf="pdMain.pincode.hasError('required')">Pincode Required.</mat-error> -->
|
||||
</mat-form-field>
|
||||
<div class="ml-xs mr-xs" style="width: 100%;" fxLayout="row" >
|
||||
<!-- <div class="ml-xs mr-xs" style="width: 100%;" fxLayout="row" >
|
||||
<h4 mat-dialog-title style="width: 14%;margin-top: 0%;">Allocation</h4>
|
||||
<div style="width: 20%;"> <mat-slide-toggle formControlName="allocation_type"
|
||||
class="example-margin" id="type"
|
||||
@ -120,7 +138,7 @@
|
||||
checked="allocationTypeModel==1 ? false:allocationTypeModel==2 ? true"> {{subAllocationLabel}}
|
||||
</mat-slide-toggle>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
</div>
|
||||
</mat-card>
|
||||
@ -133,22 +151,23 @@
|
||||
|
||||
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput placeholder="Name" formControlName="applicant_name" required>
|
||||
<mat-error *ngIf="pdMain.applicant_name.hasError('required')">Name is required.</mat-error>
|
||||
<input matInput placeholder="Name" formControlName="applicant_name">
|
||||
<!-- <mat-error *ngIf="pdMain.applicant_name.hasError('required')">Name Required.</mat-error> -->
|
||||
|
||||
</mat-form-field>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput placeholder="Email" formControlName="email" type="email" required>
|
||||
<mat-error *ngIf="pdMain.email.hasError('required')">Email number is required.</mat-error>
|
||||
<input matInput placeholder="Phone" formControlName="mobile_no" type="text">
|
||||
<!-- <mat-error *ngIf="pdMain.mobile_no.hasError('required')">Mobile Required.</mat-error> -->
|
||||
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput placeholder="Email" formControlName="email" type="email">
|
||||
<!-- <mat-error *ngIf="pdMain.email.hasError('required')">Email Required.</mat-error> -->
|
||||
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput placeholder="Phone" formControlName="mobile_no" type="text" required>
|
||||
<mat-error *ngIf="pdMain.mobile_no.hasError('required')">Mobile number is required.</mat-error>
|
||||
|
||||
</mat-form-field>
|
||||
|
||||
|
||||
</mat-card>
|
||||
</div>
|
||||
</div>
|
||||
@ -169,8 +188,19 @@
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput placeholder="Relation" formControlName="relationship" type="text">
|
||||
</mat-form-field>
|
||||
|
||||
<mat-select placeholder="Relationship" formControlName="relationship">
|
||||
<mat-option *ngFor="let rel of relationShipList" [value]="rel.relationship_id" >
|
||||
{{rel.name}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
<div style="width:20%">
|
||||
<span (click)="removeCoApplicant(i)">
|
||||
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Delete" matTooltipPosition="above"><mat-icon>delete</mat-icon></button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</mat-card>
|
||||
</div>
|
||||
@ -182,7 +212,7 @@
|
||||
<h5>Co-Applicant</h5>
|
||||
<!-- <button _ngcontent-c29="" class="mr-1 mb-2 mat-fab1 mat-accent" mat-fab="" (click)="addCoApplicant(createWithLongContent)"><span class="mat-button-wrapper"><mat-icon _ngcontent-c29="" class="mat-icon material-icons" role="img" aria-hidden="true">add</mat-icon></span><div class="mat-button-ripple mat-ripple mat-button-ripple-round" matripple=""></div><div class="mat-button-focus-overlay"></div></button> -->
|
||||
<!--<button mat-fab class="mr-1 mb-1" color="primary" (click)="addCoApplicant()"><mat-icon>add</mat-icon></button>-->
|
||||
<button mat-fab class="mr-1 mb-1" color="primary" style="opacity: 0.5;" (click)="addCoApplicant()"><mat-icon>add</mat-icon><div class="mat-button-ripple mat-ripple" matripple=""></div><div class="mat-button-focus-overlay"></div></button>
|
||||
<button mat-fab class="mr-1 mb-1" color="primary" style="opacity: 0.5;" (click)="addCoApplicant()"><mat-icon>group_add</mat-icon><div class="mat-button-ripple mat-ripple" matripple=""></div><div class="mat-button-focus-overlay"></div></button>
|
||||
<!-- <button mat-raised-button mat-button-sm color="primary" (click)="addCoApplicant()" type="button">Add More Co-Applicant</button> -->
|
||||
|
||||
</mat-card>
|
||||
@ -197,7 +227,7 @@
|
||||
<mat-list>
|
||||
<mat-list-item>
|
||||
<!-- <button mat-raised-button mat-button-sm color="primary" type="button">Add Document</button> -->
|
||||
<button mat-fab class="mr-1 mb-1" color="primary" style="opacity: 0.5;" (click)="addMoreDocs()" class="mat-button-wrapper"><mat-icon>add</mat-icon><div class="mat-button-ripple mat-ripple" matripple=""></div><div class="mat-button-focus-overlay"></div></button>
|
||||
<button mat-fab class="mr-1 mb-1" color="primary" style="opacity: 0.5;" (click)="addMoreDocs()" class="mat-button-wrapper"><mat-icon>attach_file</mat-icon><div class="mat-button-ripple mat-ripple" matripple=""></div><div class="mat-button-focus-overlay"></div></button>
|
||||
|
||||
</mat-list-item>
|
||||
</mat-list>
|
||||
@ -213,7 +243,12 @@
|
||||
<input type="file" title="Browse Document" (change)="fileSelectionEvent($event,d)" formControlName="documentFile">
|
||||
</mat-list-item>
|
||||
<mat-list-item>
|
||||
<button mat-button color="accent" (click)="removeItem(d)" type="button">Remove</button>
|
||||
<!-- <button mat-button color="accent" (click)="removeItem(d)" type="button">Remove</button> -->
|
||||
<div style="width:20%">
|
||||
<span (click)="removeItem(d)">
|
||||
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Delete" matTooltipPosition="above"><mat-icon>delete</mat-icon></button>
|
||||
</span>
|
||||
</div>
|
||||
</mat-list-item>
|
||||
</mat-list>
|
||||
</mat-card>
|
||||
@ -228,10 +263,15 @@
|
||||
</mat-card-actions> -->
|
||||
|
||||
<mat-card-actions style="text-align: right">
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button"
|
||||
(click)="loadPdListCompoent()"><mat-icon>close</mat-icon></button>
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="submit"><mat-icon>save</mat-icon></button>
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Close" matTooltipPosition="above"
|
||||
(click)="loadPdListCompoent(cancelStatus)"><mat-icon>close</mat-icon></button>
|
||||
|
||||
<!-- <button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Click To Draft" matTooltipPosition="above" type="button" (click)="addCoApplicant()"><mat-icon>drafts</mat-icon></button> -->
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" (click)="submitPdDetails(_PDtriggerForm.value,draftStatus)" matTooltip="PD Draft" matTooltipPosition="above"><mat-icon>drafts</mat-icon></button>
|
||||
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="submit" matTooltip="PD Process" matTooltipPosition="above" [disabled]="!enablePDButton || !_PDtriggerForm.valid "><mat-icon>save</mat-icon></button>
|
||||
</mat-card-actions>
|
||||
</form>
|
||||
</mat-card>
|
||||
|
||||
|
||||
@ -1,17 +1,23 @@
|
||||
import { Component, OnInit, ViewEncapsulation, Output, EventEmitter } from '@angular/core';
|
||||
import { Component, OnInit, ViewEncapsulation, Output, EventEmitter, OnDestroy } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators, FormControl, FormArray } from '@angular/forms';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { CustomValidators } from 'ng2-validation';
|
||||
import { NotifierService } from 'angular-notifier';
|
||||
import { PdTrigerService } from '../pd-service/pd-triger.service';
|
||||
import { AwsService } from '../../AwsService/aws.service';
|
||||
import { PdTrigerService } from '../../../pd-service/pd-triger.service';
|
||||
import { ListPdComponent } from '../list-pd.component';
|
||||
import { AwsService } from '../../../../AwsService/aws.service';
|
||||
@Component({
|
||||
selector: 'app-add-pd',
|
||||
templateUrl: './add-pd.component.html',
|
||||
styleUrls: ['./add-pd.component.scss'],
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
export class AddPdComponent implements OnInit {
|
||||
@Output() loadParent = new EventEmitter<string>();
|
||||
export class AddPdComponent implements OnInit, OnDestroy {
|
||||
//@Output() loadParent = new EventEmitter<string>();
|
||||
cancelStatus: boolean;
|
||||
enablePDButton: boolean;
|
||||
draftStatus: boolean;
|
||||
PDTriggerStatus: boolean;
|
||||
private notifier: NotifierService;
|
||||
public _PDtriggerForm: FormGroup;
|
||||
items: FormArray;
|
||||
@ -22,53 +28,75 @@ export class AddPdComponent implements OnInit {
|
||||
stateList:any;
|
||||
cityList:any;
|
||||
pdTypeList:any;
|
||||
billingList: any;
|
||||
relationShipList: any;
|
||||
errorMessage: any;
|
||||
// Dynamic co applicant
|
||||
createWithLongContent = false;
|
||||
dynamicCoApplicant = [];
|
||||
allocationTypeModel: number;
|
||||
allocationTypeCheck: boolean;
|
||||
subAllocationTypeCheck: boolean;
|
||||
allocationLabel: string;
|
||||
subAllocationLabel: string;
|
||||
constructor(notifier: NotifierService,private _fb: FormBuilder,
|
||||
private _pd: PdTrigerService, private _aws:AwsService) {
|
||||
//allocationTypeModel: number;
|
||||
//allocationTypeCheck: boolean;
|
||||
//subAllocationTypeCheck: boolean;
|
||||
//allocationLabel: string;
|
||||
//subAllocationLabel: string;
|
||||
constructor(notifier: NotifierService,private _fb: FormBuilder,private route: ActivatedRoute,
|
||||
private router: Router,private _pd: PdTrigerService, private _aws:AwsService, private ListPdComponent: ListPdComponent) {
|
||||
this.notifier = notifier;
|
||||
}
|
||||
public totalfiles: Array<File> =[];
|
||||
public totalFileName = [];
|
||||
public lengthCheckToaddMore =0;
|
||||
ngOnInit() {
|
||||
this.draftStatus=false;
|
||||
this.PDTriggerStatus=true;
|
||||
this.enablePDButton=false;
|
||||
this.cancelStatus = false;
|
||||
this.ListPdComponent.pdListLoad(false);
|
||||
this.getLenderList();
|
||||
this.getProductsList();
|
||||
this.getCustomerSegmentList();
|
||||
this.getStateCityList();
|
||||
this.getPDTypeList();
|
||||
this.getRelationMaster();
|
||||
this._PDtriggerForm = this._fb.group({
|
||||
fk_lender_id: [null, Validators.compose([Validators.required])],
|
||||
fk_lender_id: [null],
|
||||
lender_applicant_id: [null, Validators.compose([Validators.required])],
|
||||
fk_product_id: [null, Validators.compose([Validators.required])],
|
||||
fk_subproduct_id: [null, Validators.compose([Validators.required])],
|
||||
fk_pd_type: [null, Validators.compose([Validators.required])],
|
||||
fk_customer_segment: [null, Validators.compose([Validators.required])],
|
||||
loan_amount: [null, Validators.compose([Validators.required])],
|
||||
applicant_name: [null, Validators.compose([Validators.required])],
|
||||
mobile_no: [null, Validators.compose([Validators.required])],
|
||||
email: [null, Validators.compose([Validators.required, CustomValidators.email])],
|
||||
addressline1: [null, Validators.compose([Validators.required])],
|
||||
lender_contact_person: [null, Validators.compose([Validators.required])],
|
||||
lender_contact_mobile: [null, Validators.compose([Validators.required])],
|
||||
lender_billing: [null],
|
||||
fk_product_id: [null],
|
||||
fk_subproduct_id: [null],
|
||||
fk_pd_type: [null],
|
||||
fk_customer_segment: [null],
|
||||
loan_amount: [null],
|
||||
applicant_name: [null],
|
||||
mobile_no: [null],
|
||||
email: [null],
|
||||
addressline1: [null],
|
||||
addressline2: [null],
|
||||
addressline3: [null],
|
||||
fk_city: [null, Validators.compose([Validators.required])],
|
||||
fk_state: [null, Validators.compose([Validators.required])],
|
||||
pincode : [null, Validators.compose([Validators.required])],
|
||||
allocation_type: [null],
|
||||
sub_allocation_type: [null],
|
||||
fk_city: [null],
|
||||
fk_state: [null],
|
||||
pincode : [null],
|
||||
// allocation_type: [null],
|
||||
// sub_allocation_type: [null],
|
||||
items: this._fb.array([]),
|
||||
documents: this._fb.array([])
|
||||
});
|
||||
|
||||
this.OnChanges();
|
||||
|
||||
}
|
||||
// enable pd trigger submit function
|
||||
OnChanges(): void{
|
||||
this._PDtriggerForm.valueChanges.subscribe(val => {
|
||||
if(val.fk_lender_id && val.fk_product_id && val.fk_subproduct_id && val.fk_pd_type && val.fk_customer_segment && val.loan_amount && val.applicant_name && val.mobile_no && val.addressline1 && val.fk_city && val.fk_state && val.pincode){
|
||||
this.enablePDButton=true;
|
||||
}
|
||||
else{
|
||||
this.enablePDButton=false;
|
||||
}
|
||||
});
|
||||
}
|
||||
getLenderList(){
|
||||
this._pd.getLenderDetails().subscribe(
|
||||
data => {
|
||||
@ -107,29 +135,34 @@ export class AddPdComponent implements OnInit {
|
||||
data => {
|
||||
if (data.status == 200) {
|
||||
this.pdTypeList=data.records.pd_type;
|
||||
if(data.records.pd_allocation_type){
|
||||
let getDefaultAllocation= data.records.pd_allocation_type.filter(item => item.default == 1);
|
||||
if(getDefaultAllocation[0].pd_allocation_type_id==1){
|
||||
this.allocationTypeModel=1;
|
||||
this.allocationTypeCheck=false;
|
||||
this.subAllocationTypeCheck=false;
|
||||
this.allocationLabel="Auto";
|
||||
this.subAllocationLabel="Load Balance";
|
||||
}
|
||||
else if(this.allocationTypeModel[0].pd_allocation_type_id==2){
|
||||
this.allocationTypeModel=2;
|
||||
this.allocationTypeCheck=false;
|
||||
this.subAllocationTypeCheck=true;
|
||||
this.allocationLabel="Auto";
|
||||
this.subAllocationLabel="Nearest";
|
||||
}
|
||||
else if(this.allocationTypeModel[0].pd_allocation_type_id==3){
|
||||
this.allocationTypeModel=3;
|
||||
this.allocationTypeCheck=true;
|
||||
this.allocationLabel="Manual";
|
||||
}
|
||||
|
||||
//start hide pd allocation type functinality
|
||||
|
||||
// if(data.records.pd_allocation_type){
|
||||
// let getDefaultAllocation= data.records.pd_allocation_type.filter(item => item.default == 1);
|
||||
// if(getDefaultAllocation[0].pd_allocation_type_id==1){
|
||||
// this.allocationTypeModel=1;
|
||||
// this.allocationTypeCheck=false;
|
||||
// this.subAllocationTypeCheck=false;
|
||||
// this.allocationLabel="Auto";
|
||||
// this.subAllocationLabel="Load Balance";
|
||||
// }
|
||||
// else if(this.allocationTypeModel[0].pd_allocation_type_id==2){
|
||||
// this.allocationTypeModel=2;
|
||||
// this.allocationTypeCheck=false;
|
||||
// this.subAllocationTypeCheck=true;
|
||||
// this.allocationLabel="Auto";
|
||||
// this.subAllocationLabel="Nearest";
|
||||
// }
|
||||
// else if(this.allocationTypeModel[0].pd_allocation_type_id==3){
|
||||
// this.allocationTypeModel=3;
|
||||
// this.allocationTypeCheck=true;
|
||||
// this.allocationLabel="Manual";
|
||||
// }
|
||||
|
||||
}
|
||||
// }
|
||||
|
||||
// end
|
||||
|
||||
}
|
||||
}, error => this.errorMessage = <any> error);
|
||||
@ -146,6 +179,23 @@ export class AddPdComponent implements OnInit {
|
||||
this.cityList= this.stateList.filter(item => item.state_id == stateID);
|
||||
this.cityList=this.cityList[0].cities;
|
||||
}
|
||||
|
||||
// lendor billing address
|
||||
getBillingDetails(lendorID:string){
|
||||
this.billingList= this.lenderList.filter(item => item.entity_id == lendorID);
|
||||
this.billingList=this.billingList[0].billing_address;
|
||||
}
|
||||
// get relation master details
|
||||
getRelationMaster(){
|
||||
let relation ="RELATIONSHIPS";
|
||||
this._pd.getAllMasterDatas(relation).subscribe(
|
||||
data => {
|
||||
if (data.status == 200) {
|
||||
this.relationShipList=data.records;
|
||||
|
||||
}
|
||||
}, error => this.errorMessage = <any> error);
|
||||
}
|
||||
createItem(): FormGroup {
|
||||
return this._fb.group({
|
||||
label: ['Co Applicant'],
|
||||
@ -186,10 +236,14 @@ export class AddPdComponent implements OnInit {
|
||||
get documents(): FormArray {
|
||||
return this._PDtriggerForm.get('documents') as FormArray;
|
||||
};
|
||||
get pdMain() { return this._PDtriggerForm.controls; }
|
||||
get pdMain() {
|
||||
return this._PDtriggerForm.controls; }
|
||||
get pdCoApplicant() { return this._PDtriggerForm.get('items') as FormArray; }
|
||||
|
||||
|
||||
removeCoApplicant(i: number) {
|
||||
const control = <FormArray>this._PDtriggerForm.controls['items'];
|
||||
control.removeAt(i);
|
||||
}
|
||||
removeItem(index: number) {
|
||||
this.totalfiles.splice(index,1);
|
||||
this.totalFileName.splice(index,1);
|
||||
@ -224,13 +278,16 @@ export class AddPdComponent implements OnInit {
|
||||
this.lengthCheckToaddMore=1;
|
||||
}
|
||||
}
|
||||
submitPdDetails(formValue: any) {
|
||||
submitPdDetails(formValue: any, status:boolean) {
|
||||
if(this._PDtriggerForm.valid){
|
||||
// let my_array = this.PDtriggerForm.value;
|
||||
// Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]);
|
||||
let pd_details:any={
|
||||
"fk_lender_id":formValue.fk_lender_id,
|
||||
"lender_applicant_id":formValue.lender_applicant_id,
|
||||
"lender_billing_id":formValue.lender_billing,
|
||||
"lender_contact_person":formValue.lender_contact_person,
|
||||
"lender_contact_mobile":formValue.lender_contact_mobile,
|
||||
"fk_product_id":formValue.fk_product_id,
|
||||
"fk_subproduct_id":formValue.fk_subproduct_id,
|
||||
"fk_pd_type":formValue.fk_pd_type,
|
||||
@ -242,7 +299,8 @@ export class AddPdComponent implements OnInit {
|
||||
"fk_city":formValue.fk_city,
|
||||
"fk_state":formValue.fk_state,
|
||||
"pincode":formValue.pincode ,
|
||||
"fk_pd_allocation_type":this.allocationTypeModel ,
|
||||
"pd_status": status,
|
||||
//"fk_pd_allocation_type":this.allocationTypeModel ,
|
||||
"fk_createdby" : this._aws.getlocale(),
|
||||
"createdon": new Date().toJSON().slice(0,19).replace('T',' ')
|
||||
};
|
||||
@ -291,7 +349,7 @@ export class AddPdComponent implements OnInit {
|
||||
this._pd.addPdDetails(pd_form).subscribe(result => {
|
||||
if (result.status == 200) {
|
||||
this.notifier.notify('success', 'PD Saved.');
|
||||
this.loadPdListCompoent();
|
||||
this.loadPdListCompoent(true);
|
||||
}
|
||||
else {
|
||||
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
|
||||
@ -301,30 +359,44 @@ export class AddPdComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
}
|
||||
changeAllocationType(status: boolean) {
|
||||
if(status){
|
||||
this.allocationTypeModel=3;
|
||||
this.allocationLabel="Manual";
|
||||
}
|
||||
else{
|
||||
this.allocationTypeModel=1;
|
||||
this.allocationLabel="Auto";
|
||||
this.subAllocationLabel="Load Balance";
|
||||
}
|
||||
}
|
||||
changeSubAllocationType(status: boolean){
|
||||
if(status){
|
||||
this.allocationTypeModel=2;
|
||||
this.allocationLabel="Auto";
|
||||
this.subAllocationLabel="Nearest";
|
||||
// start hide allocation type functionality
|
||||
|
||||
// changeAllocationType(status: boolean) {
|
||||
// if(status){
|
||||
// this.allocationTypeModel=3;
|
||||
// this.allocationLabel="Manual";
|
||||
// }
|
||||
// else{
|
||||
// this.allocationTypeModel=1;
|
||||
// this.allocationLabel="Auto";
|
||||
// this.subAllocationLabel="Load Balance";
|
||||
// }
|
||||
// }
|
||||
// changeSubAllocationType(status: boolean){
|
||||
// if(status){
|
||||
// this.allocationTypeModel=2;
|
||||
// this.allocationLabel="Auto";
|
||||
// this.subAllocationLabel="Nearest";
|
||||
// }
|
||||
// else{
|
||||
// this.allocationTypeModel=1;
|
||||
// this.allocationLabel="Auto";
|
||||
// this.subAllocationLabel="Load Balance";
|
||||
// }
|
||||
// }
|
||||
// end
|
||||
loadPdListCompoent(from:boolean) {
|
||||
if(from){
|
||||
this.router.navigate([ '../../' ], { relativeTo: this.route });
|
||||
this.ListPdComponent.pdListLoad(true);
|
||||
}
|
||||
else{
|
||||
this.allocationTypeModel=1;
|
||||
this.allocationLabel="Auto";
|
||||
this.subAllocationLabel="Load Balance";
|
||||
this.router.navigate([ '../../' ], { relativeTo: this.route });
|
||||
this.ListPdComponent.showListView(true);
|
||||
}
|
||||
|
||||
}
|
||||
loadPdListCompoent() {
|
||||
this.loadParent.emit('1')
|
||||
ngOnDestroy(): void {
|
||||
this.ListPdComponent.showListView(true);
|
||||
}
|
||||
}
|
||||
@ -1,8 +1,16 @@
|
||||
<div align="right" *ngIf="showParentComponent">
|
||||
<button mat-fab class="mr-1 mb-1" color="primary" (click)="addPdDetails()"><mat-icon>add</mat-icon></button>
|
||||
<button mat-fab class="mr-1 mb-1" color="accent" (click)="viewMapPdDetails()"><mat-icon>navigation</mat-icon></button>
|
||||
<div fxLayout="row" fxLayoutAlign="start center" class="filter-header">
|
||||
<div *ngIf="!noRecordFound" class="ml-xs mr-xs" style="width: 80%;">
|
||||
<mat-form-field dividerColor="primary" class="ml-xs mr-xs" style="width: 30%;">
|
||||
<input matInput (keyup)="applyFilter($event.target.value)" placeholder="Filter">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<mat-card *ngIf="showParentComponent">
|
||||
<div *ngIf="noRecordFound" class="nocontent ml-xs mr-xs" style="width: 80%;">No records found</div>
|
||||
<div class="ml-xs mr-xs" style="width: 20%;text-align:right" *ngIf="viewPdList">
|
||||
<button mat-fab color="primary" (click)="viewMapPdDetails()" class="mr-1 mb-1" matTooltip="Map List" matTooltipPosition="above"><mat-icon>map</mat-icon></button>
|
||||
<button mat-fab color="primary" (click)="addPdDetails()" class="mr-1 mb-1" matTooltip="Add PD" matTooltipPosition="above"><mat-icon>add</mat-icon></button>
|
||||
</div>
|
||||
</div>
|
||||
<mat-card *ngIf="viewPdList">
|
||||
<mat-tab-group>
|
||||
<mat-tab>
|
||||
<ng-template mat-tab-label>All</ng-template>
|
||||
@ -25,7 +33,7 @@
|
||||
<div class="comment-time">
|
||||
|
||||
<!-- <button mat-raised-button mat-icon-button mat-button-sm class="mr-1 mb-1" color="accent" type="button" (click)="viewPdDetails(details.pd_id)"><mat-icon>visibility</mat-icon></button> -->
|
||||
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="viewPdDetails(details.pd_id)"><mat-icon>visibility</mat-icon></button>
|
||||
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="viewPDDetails(details.pd_id)"><mat-icon>visibility</mat-icon></button>
|
||||
|
||||
|
||||
|
||||
@ -124,9 +132,7 @@
|
||||
|
||||
</mat-tab-group>
|
||||
</mat-card>
|
||||
|
||||
<app-edit-pd *ngIf="showEditComponent" [childData]="parentEditData" (loadParent)="updateParentComponent($event)"></app-edit-pd>
|
||||
<app-add-pd *ngIf="showAddComponent" (loadParent)="updateParentComponent($event)"></app-add-pd>
|
||||
<app-view-pd *ngIf="showViewComponent" [childData]="parentViewData" (loadParent)="updateParentComponent($event)"></app-view-pd>
|
||||
<app-map-pd-view *ngIf="showMapViewComponent"></app-map-pd-view>
|
||||
<notifier-container></notifier-container>
|
||||
<router-outlet></router-outlet>
|
||||
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
.ic-change:hover {
|
||||
transform: scale(1.1);
|
||||
color: green;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,97 @@
|
||||
import { Component,ViewChild, OnInit, ViewEncapsulation, OnDestroy } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { NotifierService } from 'angular-notifier';
|
||||
import { PdTrigerService } from '../../pd-service/pd-triger.service';
|
||||
import { MatPaginator, MatSort, MatTableDataSource, PageEvent } from '@angular/material';
|
||||
@Component({
|
||||
selector: 'app-list-pd',
|
||||
templateUrl: './list-pd.component.html',
|
||||
styleUrls: ['./list-pd.component.scss'],
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
export class ListPdComponent implements OnInit, OnDestroy {
|
||||
private notifier: NotifierService;
|
||||
recordStatus: boolean;
|
||||
viewPdList:boolean;
|
||||
viewMapPdList:boolean;
|
||||
errorMessage: any;
|
||||
// pagination variable details
|
||||
length = 50;
|
||||
pageIndex = 0;
|
||||
pageSize = 10;
|
||||
pageEvent: PageEvent;
|
||||
|
||||
// data source variable details
|
||||
pdListData = null;
|
||||
public dataLength: number;
|
||||
public dataSource = new MatTableDataSource();
|
||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||
@ViewChild(MatSort) sort: MatSort;
|
||||
pdList:any[] = [];
|
||||
constructor( notifier: NotifierService, private route: ActivatedRoute,
|
||||
private router: Router, private _pd: PdTrigerService) {
|
||||
this.notifier = notifier;
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.viewPdList = true;
|
||||
this.recordStatus=false;
|
||||
this.loadPDDetails();
|
||||
}
|
||||
//load pd details
|
||||
loadPDDetails() {
|
||||
this._pd.getPdDetails()
|
||||
.subscribe(
|
||||
data => {
|
||||
if (data.status == 200) {
|
||||
this.pdList = data.records;
|
||||
this.pdListData = data.records;
|
||||
this.dataLength = data.records.length;
|
||||
this.dataSource.data = this.pdListData;
|
||||
|
||||
}
|
||||
else{
|
||||
this.pdList=[];
|
||||
this.dataLength = null;
|
||||
this.recordStatus=true;
|
||||
}
|
||||
}, error => this.errorMessage = <any> error);
|
||||
}
|
||||
pageChange(e) {
|
||||
console.log(e);
|
||||
}
|
||||
// view pd list in map view
|
||||
viewMapPdDetails(){
|
||||
this.viewPdList = !this.viewPdList;
|
||||
this.router.navigate([ '../pdlist/pdmaplist'], { relativeTo: this.route });
|
||||
|
||||
}
|
||||
// add pd
|
||||
addPdDetails() {
|
||||
this.viewPdList = !this.viewPdList;
|
||||
this.router.navigate([ '../pdlist/addpd'], { relativeTo: this.route });
|
||||
|
||||
}
|
||||
showListView(status: boolean){
|
||||
this.viewPdList = status;
|
||||
}
|
||||
pdListLoad(status: boolean){
|
||||
this.viewPdList = status;
|
||||
this.loadPDDetails();
|
||||
}
|
||||
viewPDDetails(pdid:string){
|
||||
this.viewPdList = !this.viewPdList;
|
||||
this.router.navigate([ '../pdlist/viewpd',pdid], { relativeTo: this.route });
|
||||
|
||||
}
|
||||
//Global filter
|
||||
applyFilter(filterValue: string) {
|
||||
filterValue = filterValue.trim(); // Remove whitespace
|
||||
filterValue = filterValue.toLowerCase(); // Datasource defaults to lowercase matches
|
||||
this.dataSource.filter = filterValue;
|
||||
}
|
||||
ngOnDestroy(): void {
|
||||
this.viewPdList=false;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,73 @@
|
||||
<div fxLayout="row">
|
||||
<div class="column" fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100">
|
||||
<div align="right">
|
||||
<button mat-stroked-button color="primary" (click)="goList()" class="mr-1 mb-1"><mat-icon>arrow_back</mat-icon>List</button>
|
||||
</div>
|
||||
<mat-card class="mb-2" >
|
||||
<mat-card-header>
|
||||
<mat-card-title>Search Options</mat-card-title>
|
||||
<mat-card-subtitle>Header subtitle</mat-card-subtitle>
|
||||
</mat-card-header>
|
||||
<mat-card-content>
|
||||
<div class="column" fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="33.33" fxFlex.lg="33.33" fxFlex.xl="33.33">
|
||||
<!-- <mat-expansion-panel *ngFor="let details of dataSource.connect() | async">
|
||||
<mat-expansion-panel-header>
|
||||
<mat-panel-title>
|
||||
<b> {{details.applicat_details[0].applicant_name}} </b>
|
||||
</mat-panel-title>
|
||||
<mat-panel-description>
|
||||
{{details.product_abbr}}/{{details.subproduct_abbr}}
|
||||
</mat-panel-description>
|
||||
</mat-expansion-panel-header>
|
||||
<p mat-line>Lendor ID:{{details.lender_applicant_id}}</p>
|
||||
<p mat-line>Lendor Name:{{details.lender_full_name}}</p>
|
||||
<p mat-line>Date Of Initiation:{{details.pd_date_of_initiation}}</p>
|
||||
<p mat-line class="hover-icon"><i class="fa-1x fa fa-rupee"> </i>{{details.loan_amount}}
|
||||
</p>
|
||||
<p mat-line>
|
||||
<button mat-raised-button mat-button-sm mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="pdAllocationTo(master)"><mat-icon>directions_run</mat-icon></button>
|
||||
|
||||
</p>
|
||||
|
||||
|
||||
</mat-expansion-panel> -->
|
||||
<mat-card [style.overflow]="'auto'" [style.height.px]="'500'" *ngIf="pdList.length > 0">
|
||||
<mat-card class="mb-2" *ngFor="let details of dataSource.connect() | async">
|
||||
<mat-card-title>{{details.applicat_details[0].applicant_name}}</mat-card-title>
|
||||
<mat-card-subtitle><p class="hover-icon"><i class="fa-1x fa fa-map-marker"> </i>{{details.city_name}}/{{details.state_name}}-{{details.pincode}}</p>
|
||||
<p>{{details.lender_full_name}}({{details.lender_applicant_id}})</p>
|
||||
<p>{{details.product_abbr}}/{{details.subproduct_abbr}}/{{details.customer_segment_abbr}}</p>
|
||||
<p>{{details.pd_date_of_initiation}} <span style="padding-left: 4%;" class="hover-icon"><i class="fa-1x fa fa-rupee"> </i>{{details.loan_amount}}</span></p>
|
||||
</mat-card-subtitle>
|
||||
<mat-card-actions>
|
||||
<button mat-raised-button mat-button-sm mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="pdAllocationTo(master)"><mat-icon>directions_run</mat-icon></button>
|
||||
<!-- <button mat-button>Cancel</button> -->
|
||||
</mat-card-actions>
|
||||
</mat-card>
|
||||
</mat-card>
|
||||
<mat-list *ngIf="recordStatus">
|
||||
<mat-list-item>
|
||||
<p mat-line>No Record Found ...</p>
|
||||
|
||||
</mat-list-item>
|
||||
</mat-list>
|
||||
<!-- </mat-card-content> -->
|
||||
<!-- <mat-card-actions *ngIf="!recordStatus"> -->
|
||||
<mat-paginator #paginator [length]="pdList.length" [pageIndex]="pageIndex" [pageSize]="pageSize"
|
||||
[pageSizeOptions]="[5, 10, 25, 100]" (page)="pageEvent = $event; pageChange($event)">
|
||||
</mat-paginator>
|
||||
<!-- </mat-card-actions>
|
||||
</mat-card> -->
|
||||
</div>
|
||||
<div class="column" fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="66.66" fxFlex.lg="66.66" fxFlex.xl="66.66">
|
||||
<mat-card class="mb-2" *ngIf="pdList.length > 0">
|
||||
<agm-map [latitude]="lat" [longitude]="lng">
|
||||
<agm-marker *ngFor="let getMap of mapDetails" [latitude]="getMap.lat" [longitude]="getMap.lng"></agm-marker>
|
||||
</agm-map>
|
||||
</mat-card>
|
||||
</div>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
@import "../../../assets/styles/scss/material.variables";
|
||||
@import "../../../../../assets/styles/scss/material.variables";
|
||||
|
||||
:host {
|
||||
margin-left: -5px;
|
||||
@ -0,0 +1,94 @@
|
||||
import { Component, ViewChild, OnInit, OnDestroy } from '@angular/core';
|
||||
import { MatPaginator, MatSort, MatTableDataSource, PageEvent } from '@angular/material';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { NotifierService } from 'angular-notifier';
|
||||
import { PdTrigerService } from '../../../pd-service/pd-triger.service';
|
||||
import { GetGeometricLocationService } from '../../../location-service/get-geometric-location.service';
|
||||
import { ListPdComponent } from '../list-pd.component';
|
||||
|
||||
@Component({
|
||||
selector: 'app-map-pd-view',
|
||||
templateUrl: './map-pd-view.component.html',
|
||||
styleUrls: ['./map-pd-view.component.scss']
|
||||
})
|
||||
export class MapPdViewComponent implements OnInit, OnDestroy {
|
||||
|
||||
lat:string
|
||||
lng:string
|
||||
mapDetails:any[] = [];
|
||||
recordStatus: boolean;
|
||||
errorMessage: any;
|
||||
// pagination variable details
|
||||
length = 50;
|
||||
pageIndex = 0;
|
||||
pageSize = 10;
|
||||
pageEvent: PageEvent;
|
||||
// data source variable details
|
||||
pdListData = null;
|
||||
public dataLength: number;
|
||||
public dataSource = new MatTableDataSource();
|
||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||
@ViewChild(MatSort) sort: MatSort;
|
||||
pdList:any[] = [];
|
||||
constructor(private route: ActivatedRoute,
|
||||
private router: Router,private _pd: PdTrigerService,private _geolocation: GetGeometricLocationService, private ListPdComponent : ListPdComponent) {
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.ListPdComponent.showListView(false);
|
||||
this.recordStatus=false
|
||||
this._pd.getPdDetails()
|
||||
.subscribe(
|
||||
data => {
|
||||
if (data.status == 200) {
|
||||
this.pdList = data.records;
|
||||
this.pdListData = data.records;
|
||||
this.dataLength = data.records.length;
|
||||
this.dataSource.data = this.pdListData;
|
||||
this.getMapViewLocations(this.pdList);
|
||||
|
||||
}
|
||||
else{
|
||||
this.pdList=[];
|
||||
this.dataLength = null;
|
||||
this.recordStatus=true;
|
||||
}
|
||||
}, error => this.errorMessage = <any> error);
|
||||
}
|
||||
|
||||
|
||||
getMapViewLocations(getData:any){
|
||||
getData.forEach(element => {
|
||||
this._geolocation.findLocations(element.addressline1,element.pincode,element.state_name,element.city_name)
|
||||
.subscribe(response => {
|
||||
if (response.status == 'OK') {
|
||||
this.lat = response.results[0].geometry.location.lat;
|
||||
this.lng = response.results[0].geometry.location.lng;
|
||||
this.mapDetails.push(response.results[0].geometry.location)
|
||||
}
|
||||
// else if (response.status == 'ZERO_RESULTS') {
|
||||
// console.log('geocodingAPIService', 'ZERO_RESULTS', response.status);
|
||||
// } else {
|
||||
// console.log('geocodingAPIService', 'Other error', response.status);
|
||||
// }
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
pageChange(e) {
|
||||
console.log(e);
|
||||
}
|
||||
// go list view
|
||||
goList(){
|
||||
this.ListPdComponent.showListView(true);
|
||||
this.router.navigate([ '../../' ], { relativeTo: this.route });
|
||||
|
||||
}
|
||||
ngOnDestroy(): void {
|
||||
this.ListPdComponent.showListView(true);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -2,7 +2,7 @@ import { Component, OnInit, Inject } from '@angular/core';
|
||||
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
|
||||
import { FormBuilder, FormGroup, Validators, FormControl, FormArray } from '@angular/forms';
|
||||
import { NotifierService } from 'angular-notifier';
|
||||
import { PdTrigerService } from '../pd-service/pd-triger.service';
|
||||
import { PdTrigerService } from '../../../pd-service/pd-triger.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-pd-allocation',
|
||||
@ -1,7 +1,6 @@
|
||||
<div class="row" style="text-align:right;">
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="loadPdListCompoent()"><mat-icon>close</mat-icon></button>
|
||||
</div>
|
||||
<div *ngIf="!showEditMasterComponent">
|
||||
<mat-card *ngFor="let master of pdMasterData">
|
||||
<div class="cardEdit">
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="pdAllocationTo(master)"><mat-icon>directions_run</mat-icon></button>
|
||||
@ -26,11 +25,9 @@
|
||||
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
</div>
|
||||
<app-edit-pd-master *ngIf="showEditMasterComponent" [masterChild]="editMasterData" (loadPdView)="updateViewComponent($event)"></app-edit-pd-master>
|
||||
|
||||
<!-- applicant card -->
|
||||
<mat-card *ngIf="!showEditApplicantComponent">
|
||||
<mat-card>
|
||||
<div class="cardEdit">
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="editPdApplicant(pdApplicantData)"><mat-icon>edit</mat-icon></button>
|
||||
</div>
|
||||
@ -56,7 +53,6 @@
|
||||
</mat-card-content>
|
||||
|
||||
</mat-card>
|
||||
<app-edit-pd-applicant *ngIf="showEditApplicantComponent" [applicantChild]="editApplicantData" (loadPdView)="updateViewComponent($event)"></app-edit-pd-applicant>
|
||||
<!-- pd documents details -->
|
||||
<mat-card>
|
||||
<!-- <div class="cardEdit">
|
||||
@ -87,5 +83,5 @@
|
||||
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
<notifier-container></notifier-container>
|
||||
<!-- <notifier-container></notifier-container> -->
|
||||
|
||||
@ -1,41 +1,42 @@
|
||||
import { Component, OnInit,ViewEncapsulation, EventEmitter, Input, Output } from '@angular/core';
|
||||
import { Component, OnInit,ViewEncapsulation, EventEmitter, Input, Output, OnDestroy } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators, FormControl, FormArray } from '@angular/forms';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { MatDialog } from '@angular/material';
|
||||
import { NotifierService } from 'angular-notifier';
|
||||
import { PdTrigerService } from '../pd-service/pd-triger.service';
|
||||
import { PdTrigerService } from '../../../pd-service/pd-triger.service';
|
||||
import { PdAllocationComponent } from '../pd-allocation/pd-allocation.component';
|
||||
import { ListPdComponent } from '../list-pd.component';
|
||||
@Component({
|
||||
selector: 'app-view-pd',
|
||||
templateUrl: './view-pd.component.html',
|
||||
styleUrls: ['./view-pd.component.scss'],
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
export class ViewPdComponent implements OnInit {
|
||||
export class ViewPdComponent implements OnInit, OnDestroy {
|
||||
|
||||
private notifier:NotifierService;
|
||||
errorMessage: any;
|
||||
pdMasterData: any;
|
||||
pdApplicantData: any;
|
||||
pdDocumentsData: any;
|
||||
pdLogsData: any;
|
||||
editMasterData: any[];
|
||||
editApplicantData: any[];
|
||||
showEditMasterComponent: boolean;
|
||||
showEditApplicantComponent: boolean;
|
||||
showEditDocumentComponent: boolean;
|
||||
@Input() childData: string;
|
||||
@Output() loadParent = new EventEmitter<string>();
|
||||
viewID:string;
|
||||
viewParams:any;
|
||||
// @Input() childData: string;
|
||||
// @Output() loadParent = new EventEmitter<string>();
|
||||
public _EditPDtriggerForm:FormGroup;
|
||||
constructor(notifier:NotifierService,private dialog: MatDialog,private _fb: FormBuilder,
|
||||
private _pd: PdTrigerService) {
|
||||
private _pd: PdTrigerService,private route: ActivatedRoute,private router: Router, private ListPdComponent: ListPdComponent) {
|
||||
this.notifier=notifier
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.ListPdComponent.pdListLoad(false);
|
||||
this.route.params.subscribe(params => {
|
||||
this.viewID = params['pdid'];
|
||||
});
|
||||
|
||||
this.viewPdDetails(this.childData);
|
||||
this.showEditMasterComponent=false;
|
||||
this.showEditApplicantComponent=false;
|
||||
this.showEditDocumentComponent=false;
|
||||
this.viewPdDetails(this.viewID);
|
||||
}
|
||||
viewPdDetails(editID:string){
|
||||
this._pd.editPdDetails(editID).subscribe(
|
||||
@ -50,16 +51,15 @@ export class ViewPdComponent implements OnInit {
|
||||
}
|
||||
|
||||
loadPdListCompoent() {
|
||||
this.loadParent.emit('3')
|
||||
this.router.navigate([ '../../' ], { relativeTo: this.route });
|
||||
this.ListPdComponent.showListView(true);
|
||||
}
|
||||
|
||||
editPdMaster(masterData:any){
|
||||
this.editMasterData=masterData;
|
||||
this.showEditMasterComponent=!this.showEditMasterComponent;
|
||||
|
||||
}
|
||||
editPdApplicant(applicantData:any){
|
||||
this.editApplicantData=applicantData;
|
||||
this.showEditApplicantComponent=!this.showEditApplicantComponent;
|
||||
|
||||
}
|
||||
// pd allocation to
|
||||
// edit questions master details popup model
|
||||
@ -71,22 +71,24 @@ export class ViewPdComponent implements OnInit {
|
||||
dialogRef.afterClosed()
|
||||
.subscribe(dataresult => {
|
||||
// this.notifier.notify('success', 'Successfully allocated.!');
|
||||
this.viewPdDetails(this.childData)
|
||||
// this.viewPdDetails(this.childData)
|
||||
});
|
||||
}
|
||||
|
||||
updateViewComponent(editBack:string) {
|
||||
// updateViewComponent(editBack:string) {
|
||||
|
||||
if(editBack=='1'){
|
||||
this.showEditMasterComponent=!this.showEditMasterComponent
|
||||
}
|
||||
else if(editBack=='2'){
|
||||
this.showEditApplicantComponent=!this.showEditApplicantComponent
|
||||
}
|
||||
else if(editBack=='3'){
|
||||
this.showEditMasterComponent=!this.showEditMasterComponent
|
||||
}
|
||||
this.viewPdDetails(this.childData);
|
||||
}
|
||||
// if(editBack=='1'){
|
||||
// this.showEditMasterComponent=!this.showEditMasterComponent
|
||||
// }
|
||||
// else if(editBack=='2'){
|
||||
// this.showEditApplicantComponent=!this.showEditApplicantComponent
|
||||
// }
|
||||
// else if(editBack=='3'){
|
||||
// this.showEditMasterComponent=!this.showEditMasterComponent
|
||||
// }
|
||||
// this.viewPdDetails(this.childData);
|
||||
// }
|
||||
ngOnDestroy(): void {
|
||||
this.ListPdComponent.showListView(true); }
|
||||
|
||||
}
|
||||
@ -0,0 +1,3 @@
|
||||
<p>
|
||||
manage-pd works!
|
||||
</p>
|
||||
@ -1,20 +1,20 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { EditPdComponent } from './edit-pd.component';
|
||||
import { ManagePdComponent } from './manage-pd.component';
|
||||
|
||||
describe('EditPdComponent', () => {
|
||||
let component: EditPdComponent;
|
||||
let fixture: ComponentFixture<EditPdComponent>;
|
||||
describe('ManagePdComponent', () => {
|
||||
let component: ManagePdComponent;
|
||||
let fixture: ComponentFixture<ManagePdComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ EditPdComponent ]
|
||||
declarations: [ ManagePdComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(EditPdComponent);
|
||||
fixture = TestBed.createComponent(ManagePdComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
@ -0,0 +1,10 @@
|
||||
import { Component } from '@angular/core';
|
||||
@Component({
|
||||
template: `
|
||||
<div>
|
||||
<router-outlet></router-outlet>
|
||||
</div>
|
||||
`
|
||||
})
|
||||
export class ManagePdComponent {
|
||||
}
|
||||
@ -0,0 +1,13 @@
|
||||
import { ManagePdModule } from './manage-pd.module';
|
||||
|
||||
describe('ManagePdModule', () => {
|
||||
let managePdModule: ManagePdModule;
|
||||
|
||||
beforeEach(() => {
|
||||
managePdModule = new ManagePdModule();
|
||||
});
|
||||
|
||||
it('should create an instance', () => {
|
||||
expect(managePdModule).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -1,6 +1,5 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { RouterModule } from '@angular/router';
|
||||
import {
|
||||
MatCardModule,
|
||||
MatIconModule,
|
||||
@ -18,20 +17,19 @@ import { FlexLayoutModule } from '@angular/flex-layout';
|
||||
import { MatTooltipModule } from '@angular/material/tooltip';
|
||||
|
||||
import { NgxMatSelectSearchModule } from 'ngx-mat-select-search';
|
||||
import 'hammerjs';
|
||||
import { NotifierModule, NotifierOptions } from 'angular-notifier';
|
||||
import { AgmCoreModule } from '@agm/core';
|
||||
|
||||
import 'hammerjs';
|
||||
import { PdTrigerRoutes } from './pd-triger-routing.module';
|
||||
import { AddPdComponent } from './add-pd/add-pd.component';
|
||||
import { PdTrigerService } from './pd-service/pd-triger.service';
|
||||
import { ManagePdRoutingModule } from './manage-pd.routing';
|
||||
import { ListPdComponent } from './list-pd/list-pd.component';
|
||||
import { EditPdComponent } from './edit-pd/edit-pd.component';
|
||||
import { ViewPdComponent } from './view-pd/view-pd.component';
|
||||
import { EditPdMasterComponent } from './edit-pd-master/edit-pd-master.component';
|
||||
import { EditPdApplicantComponent } from './edit-pd-applicant/edit-pd-applicant.component';
|
||||
import { PdAllocationComponent } from './pd-allocation/pd-allocation.component';
|
||||
import { MapPdViewComponent } from './map-pd-view/map-pd-view.component';
|
||||
import { ManagePdComponent } from './manage-pd.component';
|
||||
import { MapPdViewComponent } from './list-pd/map-pd-view/map-pd-view.component';
|
||||
import { AddPdComponent } from '../manage-pd/list-pd/add-pd/add-pd.component';
|
||||
import { ViewPdComponent } from '../manage-pd/list-pd/view-pd/view-pd.component';
|
||||
import { PdAllocationComponent } from '../manage-pd/list-pd/pd-allocation/pd-allocation.component';
|
||||
import { PdTrigerService } from '../pd-service/pd-triger.service';
|
||||
import { GetGeometricLocationService } from '../location-service/get-geometric-location.service';
|
||||
|
||||
/**
|
||||
* Custom angular notifier options
|
||||
*/
|
||||
@ -78,7 +76,7 @@ const pdCustomNotifierOptions: NotifierOptions = {
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
RouterModule.forChild(PdTrigerRoutes),
|
||||
ManagePdRoutingModule,
|
||||
NotifierModule.withConfig(pdCustomNotifierOptions),
|
||||
MatCardModule,
|
||||
MatIconModule,
|
||||
@ -100,8 +98,7 @@ const pdCustomNotifierOptions: NotifierOptions = {
|
||||
NgxMatSelectSearchModule,MatTooltipModule, MatExpansionModule,
|
||||
AgmCoreModule.forRoot({apiKey: 'AIzaSyBtdO5k6CRntAMJCF-H5uZjTCoSGX95cdk'}),
|
||||
],
|
||||
declarations: [AddPdComponent, ListPdComponent, EditPdComponent, ViewPdComponent, EditPdMasterComponent, EditPdApplicantComponent, PdAllocationComponent, MapPdViewComponent],
|
||||
entryComponents:[PdAllocationComponent],
|
||||
providers: [PdTrigerService]
|
||||
declarations: [ListPdComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent, PdAllocationComponent],
|
||||
providers: [PdTrigerService, GetGeometricLocationService]
|
||||
})
|
||||
export class PdTrigerModule { }
|
||||
export class ManagePdModule { }
|
||||
@ -0,0 +1,47 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
import { ManagePdComponent } from './manage-pd.component';
|
||||
import { ListPdComponent } from './list-pd/list-pd.component';
|
||||
import { MapPdViewComponent } from './list-pd/map-pd-view/map-pd-view.component';
|
||||
import { AddPdComponent } from '../manage-pd/list-pd/add-pd/add-pd.component';
|
||||
import { ViewPdComponent } from '../manage-pd/list-pd/view-pd/view-pd.component';
|
||||
|
||||
/*
|
||||
* manage pd router
|
||||
*/
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: ManagePdComponent,
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
pathMatch: 'full',
|
||||
redirectTo: 'pdlist'
|
||||
},{
|
||||
path: 'pdlist',
|
||||
component: ListPdComponent,
|
||||
children: [
|
||||
{
|
||||
path: 'pdmaplist',
|
||||
component: MapPdViewComponent,
|
||||
},
|
||||
{
|
||||
path: 'addpd',
|
||||
component: AddPdComponent,
|
||||
},
|
||||
{
|
||||
path: 'viewpd/:pdid',
|
||||
component: ViewPdComponent,
|
||||
},
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule]
|
||||
})
|
||||
export class ManagePdRoutingModule { }
|
||||
@ -2,7 +2,7 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable } from 'rxjs';//for Datatables
|
||||
import { HttpClient,HttpParams } from '@angular/common/http';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
import { catchError, map } from 'rxjs/operators';
|
||||
import { of } from 'rxjs';
|
||||
|
||||
/** Imported Service Files Are., */
|
||||
@ -23,9 +23,13 @@ export class PdTrigerService {
|
||||
//private apiUrl = "http://ssa.sineedge.com/sparqapi/api/";
|
||||
//private apiUrl = "http://192.168.0.5:9999/AWSEC2/sparqapi/api/";
|
||||
private apiUrl = "http://ssa.sineedge.com/sparqapi/api/";
|
||||
|
||||
MAP_API_KEY: string;
|
||||
MAP_API_URL: string;
|
||||
constructor(private _http: HttpClient,
|
||||
private _aws:AwsService) { }
|
||||
private _aws:AwsService) {
|
||||
this.MAP_API_KEY = 'AIzaSyBtdO5k6CRntAMJCF-H5uZjTCoSGX95cdk'
|
||||
this.MAP_API_URL = `https://maps.googleapis.com/maps/api/geocode/json?key=${this.MAP_API_KEY}&address=`;
|
||||
}
|
||||
// get add pd master details
|
||||
getAllMasterDatas(TableName:string): Observable<any> {
|
||||
return this._http.post<any>(this.apiUrl+'getListOfMaster', { "master_name":TableName })
|
||||
@ -87,55 +91,54 @@ export class PdTrigerService {
|
||||
return this._http.get<any>(this.apiUrl+"listLessPDDetails/get")
|
||||
.pipe(
|
||||
catchError(this.handleError('operation', []))
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
// get edit row pd details
|
||||
editPdDetails(editId:string):Observable<any>{
|
||||
let httpParams = new HttpParams().set('pdid', editId);
|
||||
return this._http.post<any>(this.apiUrl+"getFullPDDetails",httpParams)
|
||||
.pipe(
|
||||
catchError(this.handleError('operation', []))
|
||||
)
|
||||
}
|
||||
// update pd master details
|
||||
editPdMasterDetails(editData:any):Observable<any>{
|
||||
editData.fk_updatedby = this._aws.getlocale();
|
||||
editData.updatedon = currentdate;
|
||||
return this._http.post<any>(this.apiUrl+"triggerNewPD",{records:editData})
|
||||
|
||||
.pipe(
|
||||
catchError(this.handleError('operation', []))
|
||||
)
|
||||
}
|
||||
// update pd applicant
|
||||
updatePdApplicant(editData:any):Observable<any>{
|
||||
// editData.fk_updatedby = this._aws.getlocale();
|
||||
// editData.updatedon = currentdate;
|
||||
return this._http.post<any>(this.apiUrl+"updatePDApplicants",{"pd_applicant_details":editData})
|
||||
|
||||
// get edit row pd details
|
||||
editPdDetails(editId:string):Observable<any>{
|
||||
let httpParams = new HttpParams().set('pdid', editId);
|
||||
return this._http.post<any>(this.apiUrl+"getFullPDDetails",httpParams)
|
||||
.pipe(
|
||||
catchError(this.handleError('operation', []))
|
||||
)
|
||||
catchError(this.handleError('operation', []))
|
||||
)
|
||||
}
|
||||
// update pd master details
|
||||
editPdMasterDetails(editData:any):Observable<any>{
|
||||
editData.fk_updatedby = this._aws.getlocale();
|
||||
editData.updatedon = currentdate;
|
||||
return this._http.post<any>(this.apiUrl+"triggerNewPD",{records:editData})
|
||||
|
||||
.pipe(
|
||||
catchError(this.handleError('operation', []))
|
||||
)
|
||||
}
|
||||
// update pd applicant
|
||||
updatePdApplicant(editData:any):Observable<any>{
|
||||
// editData.fk_updatedby = this._aws.getlocale();
|
||||
// editData.updatedon = currentdate;
|
||||
console.log(editData)
|
||||
return this._http.post<any>(this.apiUrl+"updatePDApplicants",{"pd_applicant_details":editData})
|
||||
|
||||
.pipe(
|
||||
catchError(this.handleError('operation', []))
|
||||
)
|
||||
}
|
||||
|
||||
// get pd allocation to details
|
||||
getPdOfficerList(pdID:string): Observable<any> {
|
||||
return this._http.post<any>(this.apiUrl+"getListPDOfficers",{"pdid":pdID})
|
||||
.pipe(
|
||||
catchError(this.handleError('operation', []))
|
||||
)
|
||||
}
|
||||
// update pd officer
|
||||
updatePdOfficer(updateData: any): Observable<any> {
|
||||
updateData.fk_updatedby = this._aws.getlocale();
|
||||
updateData.updatedon = currentdate;
|
||||
return this._http.post<any>(this.apiUrl+"allocatePD",{"records":updateData})
|
||||
.pipe(
|
||||
catchError(this.handleError('operation', []))
|
||||
)
|
||||
}
|
||||
|
||||
// get pd allocation to details
|
||||
getPdOfficerList(pdID:string): Observable<any> {
|
||||
return this._http.post<any>(this.apiUrl+"getListPDOfficers",{"pdid":pdID})
|
||||
.pipe(
|
||||
catchError(this.handleError('operation', []))
|
||||
)
|
||||
}
|
||||
// update pd officer
|
||||
updatePdOfficer(updateData: any): Observable<any> {
|
||||
updateData.fk_updatedby = this._aws.getlocale();
|
||||
updateData.updatedon = currentdate;
|
||||
return this._http.post<any>(this.apiUrl+"allocatePD",{"records":updateData})
|
||||
.pipe(
|
||||
catchError(this.handleError('operation', []))
|
||||
)
|
||||
}
|
||||
|
||||
private handleError<T>(operation = 'operation', result?: T) {
|
||||
return (error: any): Observable<T> => {
|
||||
@ -0,0 +1,13 @@
|
||||
import { PersonalDiscussionModule } from './personal-discussion.module';
|
||||
|
||||
describe('PersonalDiscussionModule', () => {
|
||||
let personalDiscussionModule: PersonalDiscussionModule;
|
||||
|
||||
beforeEach(() => {
|
||||
personalDiscussionModule = new PersonalDiscussionModule();
|
||||
});
|
||||
|
||||
it('should create an instance', () => {
|
||||
expect(personalDiscussionModule).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,52 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { RouterModule } from '@angular/router';
|
||||
import {
|
||||
MatCardModule,
|
||||
MatIconModule,
|
||||
MatInputModule,
|
||||
MatRadioModule,
|
||||
MatButtonModule,MatTableModule,MatPaginatorModule,
|
||||
MatProgressBarModule,MatDialogModule, MatSortModule,
|
||||
MatToolbarModule,MatSelectModule, MatListModule, MatGridListModule, MatTabsModule, MatCheckboxModule, MatBadgeModule, MatExpansionModule } from '@angular/material';
|
||||
import {MatSlideToggleModule} from '@angular/material/slide-toggle';
|
||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
import { FileUploadModule } from 'ng2-file-upload/ng2-file-upload';
|
||||
import { TreeModule } from 'angular-tree-component';
|
||||
import { NgxDatatableModule } from '@swimlane/ngx-datatable';
|
||||
import { FlexLayoutModule } from '@angular/flex-layout';
|
||||
import { MatTooltipModule } from '@angular/material/tooltip';
|
||||
|
||||
import { NgxMatSelectSearchModule } from 'ngx-mat-select-search';
|
||||
import 'hammerjs';
|
||||
import { ManagePdModule } from './manage-pd/manage-pd.module';
|
||||
|
||||
import { personalDiscussionRoutes } from './personal-discussion.routing';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
RouterModule.forChild(personalDiscussionRoutes),
|
||||
ManagePdModule,
|
||||
MatCardModule,
|
||||
MatIconModule,
|
||||
MatInputModule,
|
||||
MatRadioModule,
|
||||
MatTableModule,
|
||||
MatPaginatorModule,
|
||||
MatButtonModule,
|
||||
MatProgressBarModule,
|
||||
MatToolbarModule,
|
||||
FlexLayoutModule,
|
||||
NgxDatatableModule,
|
||||
FormsModule,MatSlideToggleModule,
|
||||
MatSelectModule, MatListModule,MatGridListModule, MatTabsModule, MatBadgeModule, MatCheckboxModule,
|
||||
ReactiveFormsModule,
|
||||
FileUploadModule,
|
||||
TreeModule,
|
||||
MatDialogModule,MatSortModule,
|
||||
NgxMatSelectSearchModule,MatTooltipModule, MatExpansionModule,
|
||||
],
|
||||
declarations: []
|
||||
})
|
||||
export class PersonalDiscussionModule { }
|
||||
@ -0,0 +1,18 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
import { ManagePdModule } from './manage-pd/manage-pd.module';
|
||||
export const personalDiscussionRoutes: Routes = [{
|
||||
path: '',
|
||||
loadChildren:'./manage-pd/manage-pd.module#ManagePdModule',
|
||||
// children:[{
|
||||
// path:'managepd',
|
||||
// loadChildren:'./manage-pd/manage-pd.module#ManagePdModule'
|
||||
// }
|
||||
// ]
|
||||
}];
|
||||
|
||||
// @NgModule({
|
||||
// imports: [RouterModule.forChild(routes)],
|
||||
// exports: [RouterModule]
|
||||
// })
|
||||
// export class PersonalDiscussionRoutingModule { }
|
||||
@ -17,11 +17,11 @@ fxLayoutAlign="center">
|
||||
<div class="ml-xs mr-xs">
|
||||
<mat-form-field>
|
||||
<!-- <ngx-select-dropdown [multiple]="false" [value]="citydatas.city_id" [options]="citydatas" ></ngx-select-dropdown> -->
|
||||
<mat-select placeholder="Pick Up City name" required [formControl]="_branchForm.controls['fk_city_id']">
|
||||
<mat-select placeholder="City Name" required [formControl]="_branchForm.controls['fk_city_id']">
|
||||
<!-- <mat-option (click)="onChangedData()" *ngFor="let masters of masterArray" [value]="masters.value" [disabled]="masters.disabled"> -->
|
||||
<mat-option *ngFor="let cd of citydatas" [value]="cd.city_id">{{ cd.name }}</mat-option>
|
||||
</mat-select>
|
||||
<mat-error *ngIf="!_branchForm.controls['fk_city_id'].valid && _branchForm.controls['fk_city_id'].touched" class="mat-text-warn">You must Pickup City Name.</mat-error>
|
||||
<mat-error *ngIf="!_branchForm.controls['fk_city_id'].valid && _branchForm.controls['fk_city_id'].touched" class="mat-text-warn">City Name Required.</mat-error>
|
||||
</mat-form-field>
|
||||
<!-- <small *ngIf="!_branchForm.controls['fk_city_id'].valid && _branchForm.controls['fk_city_id'].touched" class="mat-text-warn">You must Pickup City Name.</small> -->
|
||||
</div>
|
||||
@ -29,7 +29,7 @@ fxLayoutAlign="center">
|
||||
<div class="ml-xs mr-xs">
|
||||
<mat-form-field>
|
||||
<input matInput type="text" placeholder="Branch Name" required [formControl]="_branchForm.controls['name']">
|
||||
<mat-error *ngIf="!_branchForm.controls['name'].valid && _branchForm.controls['name'].touched">You must inculde a Branch Name</mat-error>
|
||||
<mat-error *ngIf="!_branchForm.controls['name'].valid && _branchForm.controls['name'].touched">Branch Name Required</mat-error>
|
||||
</mat-form-field>
|
||||
<!-- <small *ngIf="!_branchForm.controls['name'].valid && _branchForm.controls['name'].touched" class="mat-text-warn">You must include a Name.</small> -->
|
||||
</div>
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
<button mat-fab class="mr-1 mb-1" style="margin-top: 7px;" [color]="color" (click)="addBranch()" matTooltip="Add Branch" matTooltipPosition="above"><mat-icon>add</mat-icon></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<mat-table [dataSource]="dataSource" *ngIf="!noRecordFound" matSort>
|
||||
|
||||
<ng-container matColumnDef="serialno">
|
||||
|
||||
@ -31,17 +31,17 @@ fxLayoutAlign="center">
|
||||
|
||||
<div class="ml-xs mr-xs">
|
||||
<mat-form-field>
|
||||
<mat-select placeholder="Pick Up State Name" required [formControl]="_cityForm.controls['fk_state_id']">
|
||||
<mat-select placeholder="State Name" required [formControl]="_cityForm.controls['fk_state_id']">
|
||||
<mat-option *ngFor="let sd of stateDatas" [value]="sd.state_id">{{ sd.name }}</mat-option>
|
||||
</mat-select>
|
||||
<mat-error *ngIf="!_cityForm.controls['fk_state_id'].valid && _cityForm.controls['fk_state_id'].touched" class="mat-text-warn">You must Pickup State Name.</mat-error>
|
||||
<mat-error *ngIf="!_cityForm.controls['fk_state_id'].valid && _cityForm.controls['fk_state_id'].touched" class="mat-text-warn">State Name Required.</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
<div class="ml-xs mr-xs">
|
||||
<mat-form-field>
|
||||
<input matInput type="text" placeholder="City Name" required [formControl]="_cityForm.controls['name']">
|
||||
<mat-error *ngIf="!_cityForm.controls['name'].valid && _cityForm.controls['name'].touched" class="mat-text-warn">You must include a Name.</mat-error>
|
||||
<mat-error *ngIf="!_cityForm.controls['name'].valid && _cityForm.controls['name'].touched" class="mat-text-warn">City Name Required.</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
|
||||
@ -32,7 +32,7 @@ fxLayoutAlign="center">
|
||||
<div class="ml-xs mr-xs">
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput type="text" placeholder="Rating" required [formControl]="_CommentOnLocalityForm.controls['rating']">
|
||||
<mat-error *ngIf="!_CommentOnLocalityForm.controls['rating'].valid && _CommentOnLocalityForm.controls['rating'].touched" class="mat-text-warn">You must include a Rating.</mat-error>
|
||||
<mat-error *ngIf="!_CommentOnLocalityForm.controls['rating'].valid && _CommentOnLocalityForm.controls['rating'].touched" class="mat-text-warn">Rating Required.</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
|
||||
@ -16,38 +16,38 @@
|
||||
<div class="ml-xs mr-xs">
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput type="text" placeholder="Company Name" required [formControl]="_companyForm.controls['name']">
|
||||
<mat-error *ngIf="!_companyForm.controls['name'].valid && _companyForm.controls['name'].touched" class="mat-text-warn">You must include a Name.</mat-error>
|
||||
<mat-error *ngIf="!_companyForm.controls['name'].valid && _companyForm.controls['name'].touched" class="mat-text-warn">Company Name Required.</mat-error>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
<div class="ml-xs mr-xs">
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput type="text" placeholder="Company addressline1" required [formControl]="_companyForm.controls['addressline1']">
|
||||
<mat-error *ngIf="!_companyForm.controls['addressline1'].valid && _companyForm.controls['addressline1'].touched" class="mat-text-warn">You must include a addressline1.</mat-error>
|
||||
<input matInput type="text" placeholder="Company Address Line1" required [formControl]="_companyForm.controls['addressline1']">
|
||||
<mat-error *ngIf="!_companyForm.controls['addressline1'].valid && _companyForm.controls['addressline1'].touched" class="mat-text-warn">Company Address Line1 Required.</mat-error>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
<div class="ml-xs mr-xs">
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput type="text" placeholder="Company addressline2" required [formControl]="_companyForm.controls['addressline2']">
|
||||
<mat-error *ngIf="!_companyForm.controls['addressline2'].valid && _companyForm.controls['addressline2'].touched" class="mat-text-warn">You must include a Name.</mat-error>
|
||||
<input matInput type="text" placeholder="Company Address Line2" required [formControl]="_companyForm.controls['addressline2']">
|
||||
<mat-error *ngIf="!_companyForm.controls['addressline2'].valid && _companyForm.controls['addressline2'].touched" class="mat-text-warn">Company Address Line2 Required.</mat-error>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
<div class="ml-xs mr-xs">
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput type="text" placeholder="Company addressline3" required [formControl]="_companyForm.controls['addressline3']">
|
||||
<mat-error *ngIf="!_companyForm.controls['addressline3'].valid && _companyForm.controls['addressline3'].touched" class="mat-text-warn">You must include a Name.</mat-error>
|
||||
<input matInput type="text" placeholder="Company Address Line3" required [formControl]="_companyForm.controls['addressline3']">
|
||||
<mat-error *ngIf="!_companyForm.controls['addressline3'].valid && _companyForm.controls['addressline3'].touched" class="mat-text-warn">Company Address Line3 Required.</mat-error>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
<div class="ml-xs mr-xs">
|
||||
<mat-form-field style="width: 100%">
|
||||
<mat-select placeholder="Pick Up City name" required [formControl]="_companyForm.controls['city']">
|
||||
<mat-select placeholder="City Name" required [formControl]="_companyForm.controls['city']">
|
||||
|
||||
<mat-option *ngFor="let cd of citydatas" [value]="cd.city_id">{{ cd.name }}</mat-option>
|
||||
</mat-select>
|
||||
<mat-error *ngIf="!_companyForm.controls['city'].valid && _companyForm.controls['city'].touched" class="mat-text-warn">You must include a City.</mat-error>
|
||||
<mat-error *ngIf="!_companyForm.controls['city'].valid && _companyForm.controls['city'].touched" class="mat-text-warn">City Name Required.</mat-error>
|
||||
</mat-form-field>
|
||||
<!-- <small *ngIf="!_branchForm.controls['fk_city_id'].valid && _branchForm.controls['fk_city_id'].touched" class="mat-text-warn">You must Pickup City Name.</small> -->
|
||||
</div>
|
||||
@ -55,7 +55,7 @@
|
||||
<div class="ml-xs mr-xs">
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput type="text" placeholder="Pin code" required [formControl]="_companyForm.controls['pincode']">
|
||||
<mat-hint>pincode should be in 6 digit format</mat-hint>
|
||||
<mat-hint>Pincode should be in 6 digit format</mat-hint>
|
||||
<!-- <mat-error *ngIf="_companyForm.controls['pincode'].hasError('required') && _companyForm.controls['pincode'].touched" class="mat-text-warn">You must include phone number.</mat-error> -->
|
||||
<!-- <mat-error *ngIf="!_companyForm.controls['pincode'].valid && _companyForm.controls['pincode'].touched" class="mat-text-warn">You must include a pincode number.</mat-error> -->
|
||||
<mat-error *ngIf="_companyForm.controls['pincode'].hasError('minlength') && _companyForm.controls['pincode'].touched" class="mat-text-warn">Your pincode must be at least 5 characters long.</mat-error>
|
||||
@ -65,10 +65,10 @@
|
||||
|
||||
<div class="ml-xs mr-xs">
|
||||
<mat-form-field style="width: 100%">
|
||||
<mat-select placeholder="Pick Up State Name" required [formControl]="_companyForm.controls['state']">
|
||||
<mat-select placeholder="State Name" required [formControl]="_companyForm.controls['state']">
|
||||
<mat-option *ngFor="let sd of stateDatas" [value]="sd.state_id">{{ sd.name }}</mat-option>
|
||||
</mat-select>
|
||||
<mat-error *ngIf="!_companyForm.controls['state'].valid && _companyForm.controls['state'].touched" class="mat-text-warn">You must Pickup a State.</mat-error>
|
||||
<mat-error *ngIf="!_companyForm.controls['state'].valid && _companyForm.controls['state'].touched" class="mat-text-warn">State Name Required.</mat-error>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
|
||||
@ -34,7 +34,7 @@ fxLayoutAlign="center">
|
||||
<div class="mb-1">
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput type="text" placeholder="Description" required [formControl]="_customerBehaviourForm.controls['description']">
|
||||
<mat-error *ngIf="!_customerBehaviourForm.controls['description'].valid && _customerBehaviourForm.controls['description'].touched" class="mat-text-warn">You must include a Name.</mat-error>
|
||||
<mat-error *ngIf="!_customerBehaviourForm.controls['description'].valid && _customerBehaviourForm.controls['description'].touched" class="mat-text-warn">Description Required.</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
|
||||
@ -34,7 +34,7 @@ fxLayoutAlign="center">
|
||||
<div class="mb-1">
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput type="text" placeholder="Name" required [formControl]="_customerSegmentForm.controls['name']">
|
||||
<mat-error *ngIf="!_customerSegmentForm.controls['name'].valid && _customerSegmentForm.controls['name'].touched" class="mat-text-warn">You must include a Name.</mat-error>
|
||||
<mat-error *ngIf="!_customerSegmentForm.controls['name'].valid && _customerSegmentForm.controls['name'].touched" class="mat-text-warn">Name Required.</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
@ -42,7 +42,7 @@ fxLayoutAlign="center">
|
||||
<div class="mb-1">
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput type="text" placeholder="Abbrevation" required [formControl]="_customerSegmentForm.controls['abbr']">
|
||||
<mat-error *ngIf="!_customerSegmentForm.controls['abbr'].valid && _customerSegmentForm.controls['abbr'].touched" class="mat-text-warn">You must include a Abbrevation.</mat-error>
|
||||
<mat-error *ngIf="!_customerSegmentForm.controls['abbr'].valid && _customerSegmentForm.controls['abbr'].touched" class="mat-text-warn">Abbrevation Required.</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
|
||||
@ -32,7 +32,7 @@ fxLayoutAlign="center">
|
||||
<div class="ml-xs mr-xs">
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput type="text" placeholder="Name" required [formControl]="_designationForm.controls['name']">
|
||||
<mat-error *ngIf="!_designationForm.controls['name'].valid && _designationForm.controls['name'].touched" class="mat-text-warn">You must include a Name.</mat-error>
|
||||
<mat-error *ngIf="!_designationForm.controls['name'].valid && _designationForm.controls['name'].touched" class="mat-text-warn">Name Required.</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
@ -42,7 +42,7 @@ fxLayoutAlign="center">
|
||||
<div class="ml-xs mr-xs">
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput type="text" placeholder="Short Name" required [formControl]="_designationForm.controls['short_name']">
|
||||
<mat-error *ngIf="!_designationForm.controls['short_name'].valid && _designationForm.controls['short_name'].touched" class="mat-text-warn">You must include a Short Name.</mat-error>
|
||||
<mat-error *ngIf="!_designationForm.controls['short_name'].valid && _designationForm.controls['short_name'].touched" class="mat-text-warn">Short Name Required.</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
|
||||
@ -34,7 +34,7 @@ fxLayoutAlign="center">
|
||||
<div class="ml-xs mr-xs">
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput type="text" placeholder="Frequency Name" required [formControl]="_frequencyForm.controls['name']">
|
||||
<mat-error *ngIf="!_frequencyForm.controls['name'].valid && _frequencyForm.controls['name'].touched" class="mat-text-warn">You must include a Name.</mat-error>
|
||||
<mat-error *ngIf="!_frequencyForm.controls['name'].valid && _frequencyForm.controls['name'].touched" class="mat-text-warn">Frequency Name Required.</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
|
||||
@ -33,7 +33,7 @@ fxLayoutAlign="center">
|
||||
<div class="ml-xs mr-xs">
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput type="text" placeholder="Classification Name" required [formControl]="_IndustryClassificationForm.controls['name']">
|
||||
<mat-error *ngIf="!_IndustryClassificationForm.controls['name'].valid && _IndustryClassificationForm.controls['name'].touched" class="mat-text-warn">You must include a Classified Name.</mat-error>
|
||||
<mat-error *ngIf="!_IndustryClassificationForm.controls['name'].valid && _IndustryClassificationForm.controls['name'].touched" class="mat-text-warn">Classified Name Required.</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
|
||||
@ -32,7 +32,7 @@ fxLayoutAlign="center">
|
||||
<div class="ml-xs mr-xs">
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput type="text" placeholder="Lender Hierarchy Name" required [formControl]="_lenderHierarchyForm.controls['lender_hierarchy']">
|
||||
<mat-error *ngIf="!_lenderHierarchyForm.controls['lender_hierarchy'].valid && _lenderHierarchyForm.controls['lender_hierarchy'].touched" class="mat-text-warn">You must include a Lender Hierarchy Name.</mat-error>
|
||||
<mat-error *ngIf="!_lenderHierarchyForm.controls['lender_hierarchy'].valid && _lenderHierarchyForm.controls['lender_hierarchy'].touched" class="mat-text-warn">Lender Hierarchy Name Required.</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
|
||||
@ -32,7 +32,7 @@ fxLayout="row">
|
||||
<div class="ml-xs mr-xs">
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput type="text" placeholder="Name" required [formControl]="_occupationForm.controls['name']">
|
||||
<mat-error *ngIf="!_occupationForm.controls['name'].valid && _occupationForm.controls['name'].touched" class="mat-text-warn">You must include a Name.</mat-error>
|
||||
<mat-error *ngIf="!_occupationForm.controls['name'].valid && _occupationForm.controls['name'].touched" class="mat-text-warn">Name Required.</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
|
||||
@ -33,8 +33,8 @@ fxLayoutAlign="center">
|
||||
|
||||
<div class="ml-xs mr-xs">
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput type="text" placeholder="Name" required [formControl]="_pdLocationApproachForm.controls['description']">
|
||||
<mat-error *ngIf="!_pdLocationApproachForm.controls['description'].valid && _pdLocationApproachForm.controls['description'].touched" class="mat-text-warn">You must include a Description.</mat-error>
|
||||
<input matInput type="text" placeholder="Descriptsion" required [formControl]="_pdLocationApproachForm.controls['description']">
|
||||
<mat-error *ngIf="!_pdLocationApproachForm.controls['description'].valid && _pdLocationApproachForm.controls['description'].touched" class="mat-text-warn">Description Required.</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
|
||||
@ -33,8 +33,8 @@ fxLayoutAlign="center">
|
||||
|
||||
<div class="ml-xs mr-xs">
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput type="text" placeholder="Name" required [formControl]="_pdTypeForm.controls['type_name']">
|
||||
<mat-error *ngIf="!_pdTypeForm.controls['type_name'].valid && _pdTypeForm.controls['type_name'].touched" class="mat-text-warn">You must include a type_name.</mat-error>
|
||||
<input matInput type="text" placeholder="Type Name" required [formControl]="_pdTypeForm.controls['type_name']">
|
||||
<mat-error *ngIf="!_pdTypeForm.controls['type_name'].valid && _pdTypeForm.controls['type_name'].touched" class="mat-text-warn">Type Name Required.</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
|
||||
@ -32,7 +32,7 @@ fxLayoutAlign="center">
|
||||
<div class="ml-xs mr-xs">
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput type="text" placeholder="Product Name" required [formControl]="_productMasterForm.controls['name']">
|
||||
<mat-error *ngIf="!_productMasterForm.controls['name'].valid && _productMasterForm.controls['name'].touched" class="mat-text-warn">You must include a Product name.</mat-error>
|
||||
<mat-error *ngIf="!_productMasterForm.controls['name'].valid && _productMasterForm.controls['name'].touched" class="mat-text-warn">Product Name Required.</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
@ -41,7 +41,7 @@ fxLayoutAlign="center">
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput type="text" placeholder="Product Abbr" required [formControl]="_productMasterForm.controls['abbr']">
|
||||
</mat-form-field>
|
||||
<mat-error *ngIf="!_productMasterForm.controls['abbr'].valid && _productMasterForm.controls['abbr'].touched" class="mat-text-warn">You must include a Product abbrevation.</mat-error>
|
||||
<mat-error *ngIf="!_productMasterForm.controls['abbr'].valid && _productMasterForm.controls['abbr'].touched" class="mat-text-warn">Product Abbrevation Required.</mat-error>
|
||||
</div>
|
||||
|
||||
<div class="row" style="text-align:right;">
|
||||
|
||||
@ -16,7 +16,7 @@ fxLayoutAlign="center">
|
||||
<div class="ml-xs mr-xs">
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput type="text" placeholder="Category Name" required [formControl]="_questionCategoryForm.controls['categroy_name']">
|
||||
<mat-error *ngIf="!_questionCategoryForm.controls['categroy_name'].valid && _questionCategoryForm.controls['categroy_name'].touched" class="mat-text-warn">You must include a category name.</mat-error>
|
||||
<mat-error *ngIf="!_questionCategoryForm.controls['categroy_name'].valid && _questionCategoryForm.controls['categroy_name'].touched" class="mat-text-warn">Category Name Required.</mat-error>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
|
||||
@ -34,7 +34,7 @@ fxLayoutAlign="center">
|
||||
<div class="ml-xs mr-xs">
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput type="text" placeholder="Name" required [formControl]="_regionsForm.controls['name']">
|
||||
<mat-error *ngIf="!_regionsForm.controls['name'].valid && _regionsForm.controls['name'].touched" class="mat-text-warn">You must include a Name.</mat-error>
|
||||
<mat-error *ngIf="!_regionsForm.controls['name'].valid && _regionsForm.controls['name'].touched" class="mat-text-warn">Name Required.</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
|
||||
@ -34,7 +34,7 @@ fxLayoutAlign="center">
|
||||
<div class="ml-xs mr-xs">
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput type="text" placeholder="Name" required [formControl]="_relationShipForm.controls['name']">
|
||||
<mat-error *ngIf="!_relationShipForm.controls['name'].valid && _relationShipForm.controls['name'].touched" class="mat-text-warn">You must include a Name.</mat-error>
|
||||
<mat-error *ngIf="!_relationShipForm.controls['name'].valid && _relationShipForm.controls['name'].touched" class="mat-text-warn">Name Required.</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
|
||||
@ -32,17 +32,17 @@ fxLayoutAlign="center">
|
||||
|
||||
<div class="ml-xs mr-xs">
|
||||
<mat-form-field>
|
||||
<mat-select placeholder="Pick Up Region Name" required [formControl]="_statesForm.controls['fk_region_id']">
|
||||
<mat-select placeholder="Region Name" required [formControl]="_statesForm.controls['fk_region_id']">
|
||||
<mat-option *ngFor="let sd of regionDatas" [value]="sd.region_id">{{ sd.name }}</mat-option>
|
||||
</mat-select>
|
||||
<mat-error *ngIf="!_statesForm.controls['fk_region_id'].valid && _statesForm.controls['fk_region_id'].touched" class="mat-text-warn">You must include a Region.</mat-error>
|
||||
<mat-error *ngIf="!_statesForm.controls['fk_region_id'].valid && _statesForm.controls['fk_region_id'].touched" class="mat-text-warn">Region Name Required.</mat-error>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
<div class="ml-xs mr-xs">
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput type="text" placeholder="Name" required [formControl]="_statesForm.controls['name']">
|
||||
<mat-error *ngIf="!_statesForm.controls['name'].valid && _statesForm.controls['name'].touched" class="mat-text-warn">You must include a Name.</mat-error>
|
||||
<mat-error *ngIf="!_statesForm.controls['name'].valid && _statesForm.controls['name'].touched" class="mat-text-warn">Name Required.</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
@ -58,7 +58,7 @@ fxLayoutAlign="center">
|
||||
<div class="ml-xs mr-xs">
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput type="text" placeholder="Code" required [formControl]="_statesForm.controls['code']">
|
||||
<mat-error *ngIf="!_statesForm.controls['code'].valid && _statesForm.controls['code'].touched" class="mat-text-warn">You must include a Code.</mat-error>
|
||||
<mat-error *ngIf="!_statesForm.controls['code'].valid && _statesForm.controls['code'].touched" class="mat-text-warn">Code Required.</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
|
||||
@ -41,10 +41,10 @@ fxLayoutAlign="center">
|
||||
</mat-form-field> -->
|
||||
<div class="ml-xs mr-xs">
|
||||
<mat-form-field>
|
||||
<mat-select placeholder="Pick Up Product Name" required [formControl]="_subProductMasterForm.controls['fk_product_id']">
|
||||
<mat-select placeholder="Product Name" required [formControl]="_subProductMasterForm.controls['fk_product_id']">
|
||||
<mat-option *ngFor="let sd of productDatas" [value]="sd.product_id">{{ sd.name }}</mat-option>
|
||||
</mat-select>
|
||||
<mat-error *ngIf="!_subProductMasterForm.controls['fk_product_id'].valid && _subProductMasterForm.controls['fk_product_id'].touched" class="mat-text-warn">You must include a Product name.</mat-error>
|
||||
<mat-error *ngIf="!_subProductMasterForm.controls['fk_product_id'].valid && _subProductMasterForm.controls['fk_product_id'].touched" class="mat-text-warn">Product Name Required.</mat-error>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<!-- <mat-form-field style="width: 100%">
|
||||
@ -56,7 +56,7 @@ fxLayoutAlign="center">
|
||||
<div class="ml-xs mr-xs">
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput type="text" placeholder="Sub Product Name" required [formControl]="_subProductMasterForm.controls['name']">
|
||||
<mat-error *ngIf="!_subProductMasterForm.controls['name'].valid && _subProductMasterForm.controls['name'].touched" class="mat-text-warn">You must include a Sub Product name.</mat-error>
|
||||
<mat-error *ngIf="!_subProductMasterForm.controls['name'].valid && _subProductMasterForm.controls['name'].touched" class="mat-text-warn">Sub Product Name Required.</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
@ -65,7 +65,7 @@ fxLayoutAlign="center">
|
||||
<div class="ml-xs mr-xs">
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput type="text" placeholder="Sub Product Abbrevation" required [formControl]="_subProductMasterForm.controls['abbr']">
|
||||
<mat-error *ngIf="!_subProductMasterForm.controls['abbr'].valid && _subProductMasterForm.controls['abbr'].touched" class="mat-text-warn">You must include a Sub Product Abbrevation.</mat-error>
|
||||
<mat-error *ngIf="!_subProductMasterForm.controls['abbr'].valid && _subProductMasterForm.controls['abbr'].touched" class="mat-text-warn">Sub Product Abbrevation Requireds.</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
|
||||
@ -34,7 +34,7 @@ fxLayoutAlign="center">
|
||||
<div class="ml-xs mr-xs">
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput type="text" placeholder="Title" required [formControl]="_titleForm.controls['name']">
|
||||
<mat-error *ngIf="!_titleForm.controls['name'].valid && _titleForm.controls['name'].touched" class="mat-text-warn">You must include a Title.</mat-error>
|
||||
<mat-error *ngIf="!_titleForm.controls['name'].valid && _titleForm.controls['name'].touched" class="mat-text-warn">Title Required.</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
|
||||
@ -34,7 +34,7 @@ fxLayoutAlign="center">
|
||||
<div class="mb-1">
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput type="text" placeholder="Activity Name" required [formControl]="_activityMasterForm.controls['name']">
|
||||
<mat-error *ngIf="!_activityMasterForm.controls['name'].valid && _activityMasterForm.controls['name'].touched" class="mat-text-warn">You must include a Name.</mat-error>
|
||||
<mat-error *ngIf="!_activityMasterForm.controls['name'].valid && _activityMasterForm.controls['name'].touched" class="mat-text-warn">Activity Name Required.</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
|
||||
@ -32,7 +32,7 @@ fxLayoutAlign="center">
|
||||
<div class="mb-1">
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput type="text" placeholder="UOM Name" required [formControl]="_uomForm.controls['name']">
|
||||
<mat-error *ngIf="!_uomForm.controls['name'].valid && _uomForm.controls['name'].touched" class="mat-text-warn">You must include a Name.</mat-error>
|
||||
<mat-error *ngIf="!_uomForm.controls['name'].valid && _uomForm.controls['name'].touched" class="mat-text-warn">UOM Name Required.</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
|
||||
@ -19,7 +19,14 @@
|
||||
</div>
|
||||
<div *ngIf="noRecordFound" class="nocontent ml-xs mr-xs" style="width: 90%;">No records found</div>
|
||||
<div class="ml-xs mr-xs" style="width: 10%; text-align: right;">
|
||||
<<<<<<< HEAD
|
||||
<button mat-fab class="mr-1 mb-1" style="margin-top: 7px;" [color]="color" matTooltip="Add PD Team" matTooltipPosition="above" [routerLink]="['/setting/pdteam/addpdteam']" ><mat-icon>add</mat-icon></button>
|
||||
=======
|
||||
<button mat-fab class="mr-1 mb-1" style="margin-top: 7px;" [color]="color" (click)="managepdteam()" matTooltip="Manage PD Team" matTooltipPosition="above"><mat-icon>people</mat-icon></button>
|
||||
</div>
|
||||
<div class="ml-xs mr-xs" style="width: 10%; text-align: right;">
|
||||
<button mat-fab class="mr-1 mb-1" style="margin-top: 7px;" [color]="color" (click)="addPdTeam()" matTooltip="Add PD Team" matTooltipPosition="above"><mat-icon>add</mat-icon></button>
|
||||
>>>>>>> 3ad6314e0e602cb2c232acb142715009dca646f9
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@ -65,7 +65,10 @@ export class PdTeamListComponent implements OnInit {
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
/**To Manage Team */
|
||||
managepdteam(){
|
||||
this.router.navigate(['/setting/pdteam/pdteammanage']);
|
||||
}
|
||||
changeListView(){
|
||||
this.getPdTeam();
|
||||
this.listView = true;
|
||||
|
||||
@ -0,0 +1,53 @@
|
||||
<mat-card>
|
||||
|
||||
<div style="margin: 6px; padding: 4px;">
|
||||
<div class="p_title" style="font-size: 26px; font-style: bold;">Manage PD Team</div>
|
||||
<!--<div class="sub_title" style="font-size: 11px;">List of Entity Master Details</div>-->
|
||||
<hr>
|
||||
</div>
|
||||
<div *ngIf="loader">
|
||||
<mat-progress-bar mode="indeterminate" color="primary" class="mb-1"></mat-progress-bar>
|
||||
|
||||
</div>
|
||||
<div fxLayout="row" fxLayout.xs="column" fxLayoutWrap fxLayoutAlign="center none" *ngIf="viewpage">
|
||||
<div fxFlex="100%">
|
||||
|
||||
<div fxLayout="row wrap">
|
||||
<div fxFlex.gt-sm="30" fxFlex.gt-xs="30" fxFlex="50" *ngFor="let pdteamdetails of pdTeamManageData; let i = index;" >
|
||||
<mat-card class="mb-1">
|
||||
|
||||
<mat-card-title style="margin-bottom:0px!important;" ><span fxFlex="80">{{pdteamdetails.team_name | titlecase}}</span> <mat-icon (click)="cityinfo(pdteamdetails.pdteam_id)" color="primary" matTooltip="Click for more info" matTooltipPosition="above" fxFlex="16" style="text-align:right;">info</mat-icon></mat-card-title>
|
||||
|
||||
<br/>
|
||||
<mat-card-subtitle >{{pdteamdetails.short_name}}</mat-card-subtitle>
|
||||
|
||||
<hr>
|
||||
|
||||
<mat-list class='bag' [dragula]='"bag"' [dragulaModel]="pdteamdetails.USERPROFILE" [attr.data-id]="pdteamdetails.pdteam_id" >
|
||||
|
||||
|
||||
<mat-list-item *ngFor="let users of pdteamdetails.USERPROFILE let i=index" [attr.data-id]="users.userid" [attr.data-index]="i">
|
||||
<div #bag1 class="d-flex w-100 justify-content-between">
|
||||
{{ users.user_full_name |titlecase}}
|
||||
|
||||
<i class="fa fa-arrows-alt ml-1 mr-1"aria-hidden="true"></i></div></mat-list-item>
|
||||
|
||||
|
||||
</mat-list>
|
||||
</mat-card>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div style="width: 10%; text-align: right;">
|
||||
<button mat-fab class="mr-1 mb-1" style="margin-top: 7px;" color="primary" matTooltip="Submit" [disabled]="btnsave" (click)="getnewTeamDetails()" matTooltipPosition="above"><mat-icon>save</mat-icon></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="!viewpage" style="text-align: center">
|
||||
<span>{{pdTeamManageData}}</span>
|
||||
</div>
|
||||
</mat-card>
|
||||
|
||||
@ -0,0 +1,24 @@
|
||||
|
||||
.tooltip {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
border-bottom: 1px dotted black;
|
||||
}
|
||||
|
||||
.tooltip .tooltiptext {
|
||||
visibility: hidden;
|
||||
width: 120px;
|
||||
background-color: black;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
border-radius: 6px;
|
||||
padding: 5px 0;
|
||||
|
||||
/* Position the tooltip */
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.tooltip:hover .tooltiptext {
|
||||
visibility: visible;
|
||||
}
|
||||
@ -1,20 +1,20 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { EditPdMasterComponent } from './edit-pd-master.component';
|
||||
import { PdTeamManageComponent } from './pd-team-manage.component';
|
||||
|
||||
describe('EditPdMasterComponent', () => {
|
||||
let component: EditPdMasterComponent;
|
||||
let fixture: ComponentFixture<EditPdMasterComponent>;
|
||||
describe('PdTeamManageComponent', () => {
|
||||
let component: PdTeamManageComponent;
|
||||
let fixture: ComponentFixture<PdTeamManageComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ EditPdMasterComponent ]
|
||||
declarations: [ PdTeamManageComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(EditPdMasterComponent);
|
||||
fixture = TestBed.createComponent(PdTeamManageComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
@ -0,0 +1,120 @@
|
||||
import { Output, EventEmitter,Component, OnInit,ViewEncapsulation, Directive, ViewChild } from '@angular/core';
|
||||
import { PdTeamService } from '../../service/masters/pd-team.service';
|
||||
import { DragulaService } from 'ng2-dragula';
|
||||
|
||||
/**sweet alert */
|
||||
import Swal from 'sweetalert2'
|
||||
@Component({
|
||||
selector: 'app-pd-team-manage',
|
||||
templateUrl: './pd-team-manage.component.html',
|
||||
styleUrls: ['./pd-team-manage.component.scss']
|
||||
})
|
||||
|
||||
export class PdTeamManageComponent implements OnInit {
|
||||
saveData: any;
|
||||
viewpage:boolean = false;
|
||||
pdTeamManageData:any;
|
||||
pdTeamColor:any =[];
|
||||
pdTeamNewList:any = [];
|
||||
transferData: any;
|
||||
btnsave:boolean = true;
|
||||
teamDetails:any = [];
|
||||
loader:boolean = false;
|
||||
mapDetails:any =[];
|
||||
@ViewChild('bag1') bag1: any;
|
||||
constructor( public pdteammanage:PdTeamService,private dragulaService:DragulaService) {
|
||||
this.getPDTeamManageDetails();
|
||||
this.getpdteamchange();
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
}
|
||||
|
||||
getPDTeamManageDetails()
|
||||
{
|
||||
this.loader = true;
|
||||
this.pdteammanage.getPdTeam().subscribe(res=>{
|
||||
this.pdTeamManageData = res;
|
||||
if(this.pdTeamManageData.dataStatus == true)
|
||||
{
|
||||
this.loader = false;
|
||||
this.btnsave = true;
|
||||
this.viewpage = true;
|
||||
this.pdTeamManageData = this.pdTeamManageData.records;
|
||||
|
||||
console.log(this.pdTeamManageData);
|
||||
|
||||
}else
|
||||
{
|
||||
this.viewpage = false;
|
||||
this.pdTeamManageData = "No Records Found";
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
getpdteamchange(){
|
||||
let that = this;
|
||||
|
||||
//console.log(this.bag1);
|
||||
that.dragulaService.dropModel.subscribe((args: any) => {
|
||||
|
||||
let [bagName, el, target, source] = args;
|
||||
//console.log(el);
|
||||
console.log(this.bag1.nativeElement);
|
||||
console.log(this.bag1.nativeElement === target);
|
||||
if(this.bag1.nativeElement){ // needed since dropModel triggers for all bags, not only on the dropped bag
|
||||
console.log(this.bag1.nativeElement);
|
||||
|
||||
let transferData:any = {
|
||||
userid: el.dataset.id,
|
||||
oldTeamName: source.dataset.id,
|
||||
newTeamName: target.dataset.id,
|
||||
oldIndex: el.dataset.index
|
||||
}
|
||||
console.log(el);
|
||||
for(let i = 0; i < that.pdTeamManageData.length; i++){
|
||||
let users = that.pdTeamManageData[i].USERPROFILE;
|
||||
for(let us of users){
|
||||
if(us.userid == transferData.userid){
|
||||
transferData.newIndex = i;
|
||||
//console.log(transferData);
|
||||
this.pdTeamNewList.push(transferData);
|
||||
//console.log(that.transferData);
|
||||
console.log(this.pdTeamNewList);
|
||||
this.btnsave = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
getnewTeamDetails(){
|
||||
if(this.pdTeamNewList.length ==0)
|
||||
{
|
||||
|
||||
}else{
|
||||
|
||||
|
||||
this.pdteammanage.savePdTeamManage(this.pdTeamNewList).subscribe(res=>
|
||||
{
|
||||
this.saveData = res;
|
||||
if(this.saveData.dataStatus == true)
|
||||
{
|
||||
this.getPDTeamManageDetails();
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
cityinfo(id) {
|
||||
Swal("<h5 style='align-items:left !important';>CITY:<br/>"+this.pdTeamManageData[id].CITYMAP+'<br/>'+"PRODUCTS: "+this.pdTeamManageData[id].PRODUCTS+"<br/>"+"CS: "+this.pdTeamManageData[id].CUSTOMERSEGMENT+".. </h5 >");
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@ -3,6 +3,9 @@ import { RouterModule } from '@angular/router';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { NotifierModule, NotifierOptions } from 'angular-notifier';
|
||||
import { FlexLayoutModule } from '@angular/flex-layout';
|
||||
import { PdTeamManageComponent } from './pd-team-manage/pd-team-manage.component';
|
||||
import {MatListModule} from '@angular/material/list';
|
||||
|
||||
import {
|
||||
MatCardModule,
|
||||
MatIconModule,
|
||||
@ -30,6 +33,7 @@ import { PdTeamRoutes } from './pd-team.routing';
|
||||
|
||||
/** Service */
|
||||
import { PdTeamService } from '../service/masters/pd-team.service';
|
||||
import { DragulaModule } from 'ng2-dragula';
|
||||
|
||||
/**
|
||||
* Custom angular notifier options
|
||||
@ -97,13 +101,14 @@ const customNotifierOptions: NotifierOptions = {
|
||||
NgxDatatableModule,
|
||||
MatSortModule,
|
||||
MatSlideToggleModule,
|
||||
MatTooltipModule,
|
||||
MatTooltipModule,MatListModule,DragulaModule,
|
||||
NotifierModule.withConfig(customNotifierOptions),
|
||||
],
|
||||
declarations: [
|
||||
PdTeamListComponent,
|
||||
PdTeamAddComponent,
|
||||
PdTeamEditComponent],
|
||||
PdTeamEditComponent,
|
||||
PdTeamManageComponent],
|
||||
|
||||
providers: [PdTeamService]
|
||||
|
||||
|
||||
@ -2,6 +2,7 @@ import { Routes } from '@angular/router';
|
||||
import { PdTeamAddComponent } from '../pd-team/pd-team-add/pd-team-add.component';
|
||||
import { PdTeamEditComponent } from '../pd-team/pd-team-edit/pd-team-edit.component';
|
||||
import { PdTeamListComponent } from '../pd-team/pd-team-list/pd-team-list.component';
|
||||
import { PdTeamManageComponent } from './pd-team-manage/pd-team-manage.component';
|
||||
|
||||
|
||||
export const PdTeamRoutes: Routes = [{
|
||||
@ -16,6 +17,9 @@ export const PdTeamRoutes: Routes = [{
|
||||
},{
|
||||
path:'editpdteam',
|
||||
component:PdTeamEditComponent
|
||||
},{
|
||||
path:'pdteammanage',
|
||||
component:PdTeamManageComponent
|
||||
}]
|
||||
}];
|
||||
|
||||
|
||||
@ -23,8 +23,8 @@ export interface Master {
|
||||
export class PdTeamService {
|
||||
|
||||
|
||||
//private apiUrl = "http://ssa.sineedge.com/sparqapi/api/";
|
||||
private apiUrl = "http://localhost/sparqapi/api/";
|
||||
private apiUrl = "http://ssa.sineedge.com/sparqapi/api/";
|
||||
//private apiUrl = "http://localhost/sparqapi/api/";
|
||||
pk: { "primary_key": any; };
|
||||
|
||||
|
||||
@ -215,5 +215,31 @@ return this._http.post<any>(this.apiUrl+"savePDTeam", ArrayData)
|
||||
// catchError(this.handleError('role', []))
|
||||
// )
|
||||
// }
|
||||
/**
|
||||
* PD Team Manage
|
||||
* sriram
|
||||
*/
|
||||
getPdTeam()
|
||||
{
|
||||
return this._http.get(this.apiUrl+'getPdManage').pipe(catchError(this.handleError('role',[])));
|
||||
}
|
||||
|
||||
/**
|
||||
* Save pd Team Manage
|
||||
* sriram
|
||||
*/
|
||||
|
||||
savePdTeamManage(teamDetails:any)
|
||||
{
|
||||
let records = {records:{teamDetails,fk_updatedby:this._aws.getlocale(),updatedon :currentdate}};
|
||||
|
||||
|
||||
|
||||
// console.log(records);
|
||||
return this._http.post(this.apiUrl+'savePdTeamManage',records);
|
||||
}
|
||||
|
||||
/**
|
||||
* End of the function
|
||||
*/
|
||||
}
|
||||
@ -150,8 +150,8 @@ export class UserService {
|
||||
let pdtypeid:any;
|
||||
let pdteam:any;
|
||||
|
||||
if(users.pdteam !=null && users.pdtype !=null){
|
||||
pdtypeid = users.pdtype.pd_type_id;
|
||||
if(users.pdteam !=null){
|
||||
|
||||
|
||||
pdteam = users.pdteam.pdteam_id;
|
||||
|
||||
@ -161,7 +161,7 @@ export class UserService {
|
||||
userid = users.userid
|
||||
}
|
||||
let pdofficer = {
|
||||
'fk_pd_type_id':pdtypeid,
|
||||
|
||||
'fk_team_id':pdteam,
|
||||
'fk_user_id':userid
|
||||
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
<mat-card>
|
||||
|
||||
<mat-card-title>
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon button" (click)="back()">
|
||||
<mat-icon>chevron_left</mat-icon>
|
||||
</button> User Registrations</mat-card-title>
|
||||
USER REGISTRATION <button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above"(click)="back()"><mat-icon>close</mat-icon>
|
||||
</button> </mat-card-title>
|
||||
|
||||
<!-- <div class="profile-avatar">
|
||||
|
||||
<img fxFlexOffset="50px" [src]="'https://www.google.co.in/url?sa=i&rct=j&q=&esrc=s&source=images&cd=&ved=2ahUKEwi8qsnv7NPdAhWFWysKHZIZBDcQjRx6BAgBEAU&url=https%3A%2F%2Fwww.facebook.com%2FProfilePictures%2F&psig=AOvVaw12u0YbndUEVORSODg1OWeg&ust=1537885714967641'" style="width: 70px;height: 100px;border-radius: 50%;">
|
||||
@ -15,17 +15,17 @@
|
||||
|
||||
<div fxLayout="row" fxLayoutAlign="start center" class="mb-2">
|
||||
<mat-form-field dividerColor="primary" class="ml-xs mr-xs">
|
||||
<input matInput placeholder="First name" [formControl]="regForm.controls['firstName']" required>
|
||||
<mat-error *ngIf="regForm.controls['firstName'].hasError('required') && regForm.controls['firstName'].touched" class="mat-text-warn">You must include a first name.</mat-error>
|
||||
<mat-error *ngIf="regForm.controls['firstName'].hasError('minlength') && regForm.controls['firstName'].touched" class="mat-text-warn">Your first name must be at least 5 characters long.</mat-error>
|
||||
<mat-error *ngIf="regForm.controls['firstName'].hasError('maxlength') && regForm.controls['firstName'].touched" class="mat-text-warn">Your first name cannot exceed 10 characters.</mat-error>
|
||||
<input matInput placeholder="First Name" [formControl]="regForm.controls['firstName']" required>
|
||||
<mat-error *ngIf="regForm.controls['firstName'].hasError('required') && regForm.controls['firstName'].touched" class="mat-text-warn">First Name Required.</mat-error>
|
||||
<mat-error *ngIf="regForm.controls['firstName'].hasError('minlength') && regForm.controls['firstName'].touched" class="mat-text-warn">Atleast 5 Characters.</mat-error>
|
||||
<mat-error *ngIf="regForm.controls['firstName'].hasError('maxlength') && regForm.controls['firstName'].touched" class="mat-text-warn">Not More Than 10 Characters.</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
|
||||
|
||||
<mat-form-field dividerColor="primary" class="ml-xs mr-xs">
|
||||
<input matInput placeholder="Last name" [formControl]="regForm.controls['lastName']" required>
|
||||
<mat-error *ngIf="regForm.controls['lastName'].hasError('required') && regForm.controls['lastName'].touched" class="mat-text-warn">You must include a last name.</mat-error>
|
||||
<input matInput placeholder="Last Name" [formControl]="regForm.controls['lastName']" required>
|
||||
<mat-error *ngIf="regForm.controls['lastName'].hasError('required') && regForm.controls['lastName'].touched" class="mat-text-warn">Last Name Required.</mat-error>
|
||||
</mat-form-field>
|
||||
<!-- <mat-error *ngIf="regForm.controls['lastName'].hasError('minlength') && regForm.controls['lastName'].touched" class="mat-text-warn">Your first name must be at least 5 characters long.</mat-error>
|
||||
<mat-error *ngIf="regForm.controls['lastName'].hasError('maxlength') && regForm.controls['lastName'].touched" class="mat-text-warn">Your first name cannot exceed 10 characters.</mat-error> -->
|
||||
@ -33,27 +33,45 @@
|
||||
<input matInput placeholder="User Id" [formControl]="regForm.controls['userid']">
|
||||
</mat-form-field>
|
||||
<span dividerColor="primary" class="ml-xs mr-xs" *ngIf="profileaccess">
|
||||
<img [src]="profileurl" style="width: 17%;height: 50%;border-radius: 50%;"></span>
|
||||
<img [src]="profileurl" style="width: 10%;border-radius: 50%;"></span>
|
||||
</div>
|
||||
|
||||
<mat-card-title>Account Details</mat-card-title><hr/>
|
||||
<mat-card-title>Account Details</mat-card-title><hr/><br/>
|
||||
<div fxLayout="row" fxLayoutAlign="start center" class="mb-2">
|
||||
<mat-form-field dividerColor="primary" class="ml-xs mr-xs">
|
||||
<input matInput placeholder="Email address" [formControl]="regForm.controls['email']" type="email" required>
|
||||
<mat-error *ngIf="regForm.controls['email'].hasError('required') && regForm.controls['email'].touched" class="mat-text-warn">You must include an email address.</mat-error>
|
||||
<mat-error *ngIf="regForm.controls['email'].errors?.email && regForm.controls['email'].touched" class="mat-text-warn">You must include a valid email address.</mat-error>
|
||||
<input matInput placeholder="Email Address" [formControl]="regForm.controls['email']" type="email" required>
|
||||
<mat-error *ngIf="regForm.controls['email'].hasError('required') && regForm.controls['email'].touched" class="mat-text-warn">email Address Required.</mat-error>
|
||||
<mat-error *ngIf="regForm.controls['email'].errors?.email && regForm.controls['email'].touched" class="mat-text-warn">Invalid Email Address.</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<!-- <mat-form-field dividerColor="primary" class="ml-xs mr-xs">
|
||||
<input matInput placeholder="Alt Email address" [formControl]="regForm.controls['altemail']" type="email">
|
||||
</mat-form-field> -->
|
||||
<mat-form-field dividerColor="primary" class="ml-xs mr-xs">
|
||||
<input matInput placeholder="Phone number" [formControl]="regForm.controls['phone']" type="number" required>
|
||||
<mat-error *ngIf="regForm.controls['phone'].hasError('required') && regForm.controls['phone'].touched" class="mat-text-warn">You must include phone number.</mat-error>
|
||||
<mat-error *ngIf="regForm.controls['phone'].errors?.phone && regForm.controls['phone'].touched" class="mat-text-warn">You must include a valid phone number.</mat-error>
|
||||
<input matInput placeholder="Phone Number" [formControl]="regForm.controls['phone']" type="number" required>
|
||||
<mat-error *ngIf="regForm.controls['phone'].hasError('required') && regForm.controls['phone'].touched" class="mat-text-warn">Phone Number Required.</mat-error>
|
||||
<mat-error *ngIf="regForm.controls['phone'].errors?.phone && regForm.controls['phone'].touched" class="mat-text-warn">Invalid Phone Number.</mat-error>
|
||||
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field dividerColor="primary" class="ml-xs mr-xs" >
|
||||
<mat-select matInput placeholder="State" [formControl]="regForm.controls['state']" required (selectionChange)="getcity($event)" >
|
||||
<mat-option>--</mat-option>
|
||||
<mat-option *ngFor="let s of State" [value]="s" >
|
||||
{{s.name}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
<mat-error *ngIf="regForm.controls['state'].hasError('required') && regForm.controls['state'].touched" class="mat-text-warn">State Required.</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field dividerColor="primary" class="ml-xs mr-xs" >
|
||||
<mat-select matInput placeholder="City" [formControl]="regForm.controls['city']" required>
|
||||
<mat-option>--</mat-option>
|
||||
<mat-option *ngFor="let c of City" [value]="c">
|
||||
{{c.name}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
<mat-error *ngIf="regForm.controls['city'].hasError('required') && regForm.controls['city'].touched" class="mat-text-warn">city Required.</mat-error>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
|
||||
@ -95,7 +113,7 @@
|
||||
<input matInput placeholder="Pincode" [formControl]="regForm.controls['pincode']">
|
||||
</mat-form-field>
|
||||
</div> -->
|
||||
<div fxLayout="row" fxLayoutAlign="start center" class="mb-2">
|
||||
<!-- <div fxLayout="row" fxLayoutAlign="start center" class="mb-2">
|
||||
<mat-form-field dividerColor="primary" class="ml-xs mr-xs" style="width: 30%;">
|
||||
<mat-select matInput placeholder="State" [formControl]="regForm.controls['state']" required (selectionChange)="getcity($event)" >
|
||||
<mat-option>--</mat-option>
|
||||
@ -103,6 +121,7 @@
|
||||
{{s.name}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
<mat-error *ngIf="regForm.controls['state'].hasError('required') && regForm.controls['state'].touched" class="mat-text-warn">State Required.</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field dividerColor="primary" class="ml-xs mr-xs" style="width: 30%;">
|
||||
@ -112,57 +131,55 @@
|
||||
{{c.name}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
|
||||
<mat-error *ngIf="regForm.controls['city'].hasError('required') && regForm.controls['city'].touched" class="mat-text-warn">city Required.</mat-error>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>-->
|
||||
<mat-card-title>Role Information</mat-card-title><hr/><br/>
|
||||
<div fxLayout="row" fxLayoutAlign="start center" class="mb-2">
|
||||
<mat-form-field dividerColor="primary" class="ml-xs mr-xs" style="width: 30%;">
|
||||
<mat-select matInput placeholder="Enitity type" (selectionChange)="checktype($event.value)" [formControl]="regForm.controls['type']"
|
||||
<mat-form-field dividerColor="primary" class="ml-xs mr-xs" >
|
||||
<mat-select matInput placeholder="Enitity Type" (selectionChange)="checktype($event.value)" [formControl]="regForm.controls['type']"
|
||||
required>
|
||||
<mat-option>--</mat-option>
|
||||
<mat-option *ngFor="let types of types" [value]="types">
|
||||
{{types.name}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
<mat-error *ngIf="regForm.controls['type'].hasError('required') && regForm.controls['type'].touched" class="mat-text-warn">Select User Role</mat-error>
|
||||
<mat-error *ngIf="regForm.controls['type'].errors?.phone && regForm.controls['type'].touched" class="mat-text-warn">Select User Role</mat-error>
|
||||
<mat-error *ngIf="regForm.controls['type'].hasError('required') && regForm.controls['type'].touched" class="mat-text-warn">Enitity Type Required</mat-error>
|
||||
<mat-error *ngIf="regForm.controls['type'].errors?.phone && regForm.controls['type'].touched" class="mat-text-warn">Enitity Type Required</mat-error>
|
||||
|
||||
</mat-form-field>
|
||||
<!-- <span *ngIf="roleload"> -->
|
||||
<mat-form-field dividerColor="primary" class="ml-xs mr-xs" style="width: 30%;" *ngIf="typeValue == '2'">
|
||||
<mat-form-field dividerColor="primary" class="ml-xs mr-xs" *ngIf="typeValue == '2'">
|
||||
<mat-select matInput placeholder="Lender Name" [formControl]="regForm.controls['lenVenName']" required>
|
||||
<mat-option>--</mat-option>
|
||||
<mat-option *ngFor="let ent of entities" [value]="ent">
|
||||
{{ent.full_name}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
<mat-error *ngIf="regForm.controls['lenVenName'].hasError('required') && regForm.controls['lenVenName'].touched" class="mat-text-warn">Lender Name Required.</mat-error>
|
||||
</mat-form-field>
|
||||
<mat-form-field dividerColor="primary" class="ml-xs mr-xs" style="width: 30%;" *ngIf="typeValue == '3'">
|
||||
<mat-form-field dividerColor="primary" class="ml-xs mr-xs" *ngIf="typeValue == '3'">
|
||||
<mat-select matInput placeholder="Vendor Name" [formControl]="regForm.controls['lenVenName']" required>
|
||||
<mat-option>--</mat-option>
|
||||
<mat-option *ngFor="let ent of entities" [value]="ent">
|
||||
{{ent.full_name}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
|
||||
<mat-form-field dividerColor="primary" class="ml-xs mr-xs" style="width: 30%;">
|
||||
</mat-select><mat-error *ngIf="regForm.controls['lenVenName'].hasError('required') && regForm.controls['lenVenName'].touched" class="mat-text-warn">Vendor Name Required.</mat-error>
|
||||
</mat-form-field>
|
||||
<mat-form-field dividerColor="primary" class="ml-xs mr-xs" >
|
||||
<mat-select matInput placeholder="Role" (selectionChange)="toggleAllSelection($event,regForm.controls['type'].value)" [formControl]="regForm.controls['role']" required>
|
||||
<!-- <mat-option #allSelected (click)="toggleAllSelection()" [value]="0">ALL</mat-option> -->
|
||||
<mat-option *ngFor="let role of roles" [value]="role" >
|
||||
{{role.role_name}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
|
||||
<div *ngIf="roleload"><mat-progress-bar mode="indeterminate" color="defalut"></mat-progress-bar></div>
|
||||
<mat-error *ngIf="regForm.controls['role'].hasError('required') && regForm.controls['role'].touched" class="mat-text-warn">Select User Role</mat-error>
|
||||
<mat-error *ngIf="regForm.controls['role'].errors?.phone && regForm.controls['role'].touched" class="mat-text-warn">Select User Role</mat-error>
|
||||
<mat-error *ngIf="regForm.controls['role'].hasError('required') && regForm.controls['role'].touched" class="mat-text-warn">User Role Required</mat-error>
|
||||
<mat-error *ngIf="regForm.controls['role'].errors?.phone && regForm.controls['role'].touched" class="mat-text-warn">User Role Required</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- <div fxLayout="row" fxLayoutAlign="start center" class="mb-2" *ngIf="roleAccess">
|
||||
|
||||
<!-- <mat-form-field dividerColor="primary" class="ml-xs mr-xs" style="width: 30%;" >
|
||||
@ -185,7 +202,7 @@
|
||||
</mat-form-field>
|
||||
</div> -->
|
||||
<div fxLayout="row" fxLayoutAlign="start center" class="mb-2">
|
||||
<mat-form-field dividerColor="primary" class="ml-xs mr-xs" style="width: 30%;" *ngIf="roleAccess">
|
||||
<mat-form-field dividerColor="primary" class="ml-xs mr-xs" *ngIf="roleAccess">
|
||||
<mat-select matInput placeholder="PD Team" [formControl]="regForm.controls['pdteam']" required >
|
||||
<mat-option>--</mat-option>
|
||||
<mat-option *ngFor="let pd of pdTeam" [value]="pd" >
|
||||
@ -194,7 +211,7 @@
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field dividerColor="primary" class="ml-xs mr-xs" style="width: 30%;" *ngIf="roleAccess">
|
||||
<!-- <mat-form-field dividerColor="primary" class="ml-xs mr-xs" style="width: 30%;" *ngIf="roleAccess">
|
||||
<mat-select matInput placeholder="PD Type" [formControl]="regForm.controls['pdtype']" required>
|
||||
<mat-option>--</mat-option>
|
||||
<mat-option *ngFor="let PDT of pdType" [value]="PDT">
|
||||
@ -202,40 +219,41 @@
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
|
||||
</mat-form-field>
|
||||
</mat-form-field> -->
|
||||
</div>
|
||||
<div fxLayout="row" fxLayoutAlign="start center" class="mb-2">
|
||||
UserProfile
|
||||
<input type="file" (change)="onFileChange($event)" [formControl]="regForm.controls['userpic']" accept="image/*" />
|
||||
<br/>
|
||||
<div *ngIf="imageaccess">
|
||||
<img [src]="filename" style="width: 27%;
|
||||
height: 62%;
|
||||
border-radius: 50%;
|
||||
">
|
||||
</div>
|
||||
<span *ngIf="usersData !=''">
|
||||
{{img}}
|
||||
</span>
|
||||
<div fxLayout="row" class="mb-2" >
|
||||
<div style="width:80%">
|
||||
User Profile
|
||||
<input type="file" (change)="onFileChange($event)" [formControl]="regForm.controls['userpic']" accept="image/*" />
|
||||
<br/>
|
||||
<div *ngIf="imageaccess">
|
||||
<img [src]="filename" style="width: 14%; border-radius: 50%;">
|
||||
</div>
|
||||
<span *ngIf="usersData !=''">
|
||||
{{img}}
|
||||
</span>
|
||||
</div>
|
||||
<div style="width:20%">
|
||||
<mat-slide-toggle color="primary" [formControl]="regForm.controls['isactive']">
|
||||
Isactive
|
||||
</mat-slide-toggle>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<mat-slide-toggle color="primary" [formControl]="regForm.controls['isactive']">
|
||||
Isactive
|
||||
</mat-slide-toggle>
|
||||
</mat-card-content>
|
||||
</mat-card-content>
|
||||
<hr>
|
||||
<!-- <pre>{{regForm.controls['userid'].value | json}}</pre> -->
|
||||
|
||||
<mat-card-actions>
|
||||
|
||||
|
||||
<button mat-raised-button color="primary" type="submit">Register</button>
|
||||
|
||||
<mat-card-actions style="text-align:right;">
|
||||
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Reset" matTooltipPosition="above" type="reset"><mat-icon>settings_backup_restore</mat-icon></button>
|
||||
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Submit" matTooltipPosition="above" type="submit"><mat-icon>save</mat-icon></button>
|
||||
|
||||
</mat-card-actions>
|
||||
</form>
|
||||
<!-- <button mat-raised-button color="primary" (click)="userupdate()" >Submit</button> -->
|
||||
</mat-card>
|
||||
<div *ngIf="loader">
|
||||
<mat-progress-bar mode="indeterminate" color="accent" class="mb-1"></mat-progress-bar>
|
||||
<mat-progress-bar mode="indeterminate" color="primary" class="mb-1"></mat-progress-bar>
|
||||
|
||||
</div>
|
||||
@ -10,7 +10,7 @@ import { MatOption } from '@angular/material';
|
||||
import { UserService } from '../../service/user.service';
|
||||
import { ifStmt } from '@angular/compiler/src/output/output_ast';
|
||||
const pdoff = "PD Officer";
|
||||
|
||||
const pdexu = "PD Executive";
|
||||
@Component({
|
||||
selector: 'app-register',
|
||||
templateUrl: './register.component.html',
|
||||
@ -232,9 +232,9 @@ this.loader = true;
|
||||
// this.roleAccess = false;
|
||||
// }
|
||||
// }
|
||||
if (this.usersData != '' && this.usersData !==undefined || e.value.role_name == pdoff && enitiyid.entity_type_id == 1) {
|
||||
console.log(e);
|
||||
if(e.role_name == pdoff && enitiyid.entity_type_id == 1 || e.value.role_name == pdoff && enitiyid.entity_type_id == 1){
|
||||
if (this.usersData != '' && this.usersData !==undefined || e.value.role_name == pdoff && enitiyid.entity_type_id == 1 || e.value.role_name == pdexu && enitiyid.entity_type_id == 1) {
|
||||
|
||||
if(e.role_name == pdoff && enitiyid.entity_type_id == 1 ||e.role_name == pdexu && enitiyid.entity_type_id == 1 || e.value.role_name == pdoff && enitiyid.entity_type_id == 1 || e.value.role_name == pdexu && enitiyid.entity_type_id == 1){
|
||||
|
||||
this.roleAccess = true;
|
||||
}else{
|
||||
|
||||
@ -36,19 +36,41 @@
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Mobile No </mat-header-cell>
|
||||
<mat-cell *matCellDef="let us"> {{us.mobile_no}} </mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="Roles">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Roles </mat-header-cell>
|
||||
<mat-cell *matCellDef="let us"> {{us.role_name}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="Entity">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header>Entities </mat-header-cell>
|
||||
<mat-cell *matCellDef="let us"> {{us.entitytypename}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="IsActive">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Is Active </mat-header-cell>
|
||||
<mat-cell *matCellDef="let us"><!--{{row.isactive}}-->
|
||||
<a (click)="isactive(us.userid,us.aws_name)"><mat-icon *ngIf="us.isactive == 1;else notactive;" class="active" matTooltip="Active" matTooltipPosition="above">done</mat-icon></a>
|
||||
<a (click)="isactive(us.userid,us.aws_name)"><ng-template #notactive ><mat-icon class="deactive" matTooltip="Inactive" matTooltipPosition="above">close</mat-icon></ng-template></a>
|
||||
<mat-slide-toggle *ngIf="us.isactive == 1;else notactive;"
|
||||
class="example-margin"
|
||||
matTooltip="Active" matTooltipPosition="above"
|
||||
checked="true" [color]="color"
|
||||
(change)="isactive(us.userid,us.aws_name)"
|
||||
onclick="return confirm('Are you sure?')">
|
||||
</mat-slide-toggle>
|
||||
<ng-template #notactive >
|
||||
<mat-slide-toggle
|
||||
class="example-margin"
|
||||
matTooltip="Inactive" matTooltipPosition="above"
|
||||
checked="false" [color]="color"
|
||||
(change)="isactive(us.userid,us.aws_name)"
|
||||
onclick="return confirm('Are you sure?')">
|
||||
</mat-slide-toggle></ng-template>
|
||||
<!-- <a (click)="isactive(us.userid,us.aws_name)"><mat-icon *ngIf="us.isactive == 1;else notactive;" class="active" matTooltip="Active" matTooltipPosition="above">done</mat-icon></a>
|
||||
<a (click)="isactive(us.userid,us.aws_name)"><ng-template #notactive ><mat-icon class="deactive" matTooltip="Inactive" matTooltipPosition="above">close</mat-icon></ng-template></a> -->
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="Actions">
|
||||
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
||||
<mat-cell *matCellDef="let us">
|
||||
<a mat-icon-button class="hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editUserDetails(us.userid,us.aws_name)"><mat-icon>edit</mat-icon></a>
|
||||
<a mat-icon-button [color]="color" class="hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editUserDetails(us.userid,us.aws_name)"><mat-icon>edit</mat-icon></a>
|
||||
<!-- <a mat-icon-button class="hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="deleteuser(us)"><mat-icon>delete_forever</mat-icon></a> -->
|
||||
<!-- <a mat-icon-button class="hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="adminedituser(us)"><mat-icon>account_circle</mat-icon></a> -->
|
||||
</mat-cell>
|
||||
@ -61,6 +83,6 @@
|
||||
|
||||
<!-- <div *ngIf="dataSource.length === 0">No records found</div> -->
|
||||
|
||||
<mat-paginator [pageSizeOptions]="[5, 10, 25, 50, 100]" showFirstLastButtons></mat-paginator>
|
||||
<mat-paginator [pageSize]="pageSize" [pageSizeOptions]="[5, 10, 25, 50, 100]" showFirstLastButtons></mat-paginator>
|
||||
</div>
|
||||
</mat-card-content>
|
||||
|
||||
@ -5,6 +5,8 @@ import { MatPaginator, MatTableDataSource,MatSort } from '@angular/material';
|
||||
import { UserService } from '../../service/user.service';
|
||||
import { DataSource } from '@angular/cdk/table';
|
||||
import { CognitoService } from '../../../AwsService/cognito.service';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-user-list',
|
||||
templateUrl: './user-list.component.html',
|
||||
@ -13,11 +15,13 @@ import { CognitoService } from '../../../AwsService/cognito.service';
|
||||
export class UserListComponent implements OnInit {
|
||||
public dataLength: number;
|
||||
public dataSource = new MatTableDataSource();
|
||||
displayedColumns = ['SerialNo','FullName','Email','Mobile','Actions', 'IsActive'];
|
||||
displayedColumns = ['SerialNo','FullName','Email','Mobile','Roles','Entity','Actions', 'IsActive'];
|
||||
|
||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||
@ViewChild(MatSort) sort: MatSort;
|
||||
|
||||
color="primary";
|
||||
// pagination variable details
|
||||
pageSize = 10;
|
||||
userdata: any = [];
|
||||
loader: boolean = false;
|
||||
|
||||
@ -41,9 +45,6 @@ export class UserListComponent implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
delete this.aws.localUserId;
|
||||
|
||||
@ -72,7 +72,7 @@ const MENUITEMS : Menu[] = [
|
||||
},
|
||||
|
||||
{
|
||||
state:'pdtrigger',
|
||||
state:'personal_discussion',
|
||||
name:'Personal Discussion',
|
||||
type:'link',
|
||||
icon:'forum',
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
<div class="ml-xs mr-xs" style="width: 100%;" fxLayout="row" fxLayoutAlign="center">
|
||||
<h2 mat-dialog-title style="width: 50%;">{{pageTitle}}</h2>
|
||||
<div style="width: 20%;"></div>
|
||||
<div style="width: 30%;text-align:right;">
|
||||
<div style="width: 30%;text-align:right;"></div>
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -0,0 +1,12 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { TemplatesService } from './templates.service';
|
||||
|
||||
describe('TemplatesService', () => {
|
||||
beforeEach(() => TestBed.configureTestingModule({}));
|
||||
|
||||
it('should be created', () => {
|
||||
const service: TemplatesService = TestBed.get(TemplatesService);
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,9 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class TemplatesService {
|
||||
|
||||
constructor() { }
|
||||
}
|
||||
@ -8,7 +8,10 @@ import {
|
||||
MatRadioModule,
|
||||
MatButtonModule,MatTableModule,MatPaginatorModule,
|
||||
MatProgressBarModule,MatDialogModule, MatSortModule,
|
||||
MatToolbarModule,MatSelectModule } from '@angular/material';
|
||||
MatToolbarModule,MatSelectModule,
|
||||
MatListModule, MatMenuModule,
|
||||
MatCheckboxModule, MatStepperModule, MatTabsModule,
|
||||
MatExpansionModule } from '@angular/material';
|
||||
import {MatSlideToggleModule} from '@angular/material/slide-toggle';
|
||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
import { FileUploadModule } from 'ng2-file-upload/ng2-file-upload';
|
||||
@ -44,6 +47,9 @@ import { MastersService } from './service/masters/masters.service';
|
||||
MatButtonModule,MatTableModule,MatPaginatorModule,
|
||||
MatProgressBarModule,MatDialogModule, MatSortModule,
|
||||
MatToolbarModule,MatSelectModule,
|
||||
MatListModule, MatMenuModule,
|
||||
MatCheckboxModule, MatStepperModule, MatTabsModule,
|
||||
MatExpansionModule ,
|
||||
FormsModule,ReactiveFormsModule,
|
||||
// HttpClientModule,
|
||||
],
|
||||
|
||||
@ -0,0 +1,38 @@
|
||||
<form [formGroup]="_editTempCategoryFrom" (submit)="onSubmit()">
|
||||
<div formArrayName="temp_category" class="example-full-width">
|
||||
<mat-list role="list">
|
||||
<mat-list-item style="margin: 2px 0;" *ngFor="let answ of _editTempCategoryFrom.controls.temp_category['controls']; let i=index ; let last = last;"
|
||||
role="listitem">
|
||||
<div [formGroupName]="i">
|
||||
<div fxLayout="row" fxLayoutWrap fxLayoutGap="5%" fxLayoutAlign="start center">
|
||||
<div fxFlex="0 1 auto" class="ml-xs">
|
||||
<mat-form-field>
|
||||
<mat-select placeholder="Category" formControlName="fk_category_id">
|
||||
<mat-option *ngFor="let category of m_categoryList" [value]="category.fk_category_id">{{ category.name }}</mat-option>
|
||||
</mat-select>
|
||||
<!--<mat-error *ngIf="submitted && f.fk_category_id.hasError('required')" class="mat-text-warn">You must Select Lender Type.</mat-error>-->
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div fxFlex="0 1 auto" class="ml-xs">
|
||||
<mat-form-field style="width: 25%; text-align: center" appearance="outline">
|
||||
<input matInput formControlName="weightage">
|
||||
</mat-form-field> <span>%</span>
|
||||
</div>
|
||||
<div fxFlex="0 1 auto" class="ml-xs">
|
||||
<button *ngIf="_editTempCategoryFrom.controls.temp_category.controls.length > 1" (click)="removeLanguage(i)" mat-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Delete" matTooltipPosition="above"><mat-icon>delete</mat-icon></button>
|
||||
|
||||
</div>
|
||||
<div fxFlex="0 1 auto" class="ml-xs">
|
||||
<button *ngIf="last" mat-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Add More" matTooltipPosition="above" (click)="addLanguage($event); false"><mat-icon>add</mat-icon></button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</mat-list-item>
|
||||
</mat-list>
|
||||
</div>
|
||||
<div class="row" style="text-align:right;">
|
||||
<!--<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Reset" matTooltipPosition="above" type="reset"><mat-icon>settings_backup_restore</mat-icon></button>-->
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Save" matTooltipPosition="above" type="submit"><mat-icon>save</mat-icon></button>
|
||||
</div>
|
||||
</form>
|
||||
@ -1,20 +1,20 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { EditPdApplicantComponent } from './edit-pd-applicant.component';
|
||||
import { EditCategoryComponent } from './edit-category.component';
|
||||
|
||||
describe('EditPdApplicantComponent', () => {
|
||||
let component: EditPdApplicantComponent;
|
||||
let fixture: ComponentFixture<EditPdApplicantComponent>;
|
||||
describe('EditCategoryComponent', () => {
|
||||
let component: EditCategoryComponent;
|
||||
let fixture: ComponentFixture<EditCategoryComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ EditPdApplicantComponent ]
|
||||
declarations: [ EditCategoryComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(EditPdApplicantComponent);
|
||||
fixture = TestBed.createComponent(EditCategoryComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
@ -0,0 +1,103 @@
|
||||
import { Component, ViewChild, OnInit, OnDestroy, Input } from '@angular/core';
|
||||
import { MatPaginator, MatSort, MatTableDataSource, MatDialog, PageEvent } from '@angular/material';
|
||||
import { FormGroup, FormControl, FormBuilder, Validators , FormArray} from '@angular/forms';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { DataSource } from '@angular/cdk/table';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
@Component({
|
||||
selector: 'app-template-edit-category',
|
||||
templateUrl: './edit-category.component.html',
|
||||
styleUrls: ['./edit-category.component.scss']
|
||||
})
|
||||
export class EditCategoryComponent implements OnInit, OnDestroy {
|
||||
|
||||
@Input() questionId: number;
|
||||
|
||||
public _editTempCategoryFrom: FormGroup;
|
||||
public submitted = false;
|
||||
constructor(
|
||||
private _formBuilder: FormBuilder,
|
||||
public dialog: MatDialog) {
|
||||
}
|
||||
|
||||
|
||||
ngOnInit() {
|
||||
this.initalLoadFormData();
|
||||
if(this.categoryList.length > 0){
|
||||
for (let val of this.categoryList) {
|
||||
// alert(JSON.stringify(val));
|
||||
let vals = val;
|
||||
this.addLanguage(vals['fk_category_id'], vals['name'], vals['weightage'], null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
initalLoadFormData(){
|
||||
this._editTempCategoryFrom = this._formBuilder.group({
|
||||
temp_category: this._formBuilder.array([
|
||||
// this.initAnswers(),
|
||||
])
|
||||
})
|
||||
}
|
||||
|
||||
// convenience getter for easy access to form fields
|
||||
get f() { return this._editTempCategoryFrom.controls; }
|
||||
|
||||
public m_categoryList = [{
|
||||
fk_category_id: 1,
|
||||
name: 'Category List 1',
|
||||
weightage: 2,
|
||||
},{
|
||||
fk_category_id: 2,
|
||||
name: 'Category List 2',
|
||||
weightage: 5,
|
||||
},{
|
||||
fk_category_id: 3,
|
||||
name: 'Category List 2',
|
||||
weightage: 5,
|
||||
}];
|
||||
|
||||
public categoryList = [{
|
||||
fk_category_id: 1,
|
||||
name: 'Category List 1',
|
||||
weightage: 2,
|
||||
},{
|
||||
fk_category_id: 2,
|
||||
name: 'Category List 2',
|
||||
weightage: 5,
|
||||
}];
|
||||
|
||||
// Dynamic Form field creation Functionality : START ===>
|
||||
initAnswers(fk_cat_id, name, weightage) {
|
||||
return this._formBuilder.group({
|
||||
fk_category_id: [fk_cat_id, Validators.compose([Validators.required])],
|
||||
name: [name, Validators.compose([Validators.required])],
|
||||
weightage: [weightage, Validators.compose([Validators.required])],
|
||||
});
|
||||
}
|
||||
addLanguage(fk_cat_id, name, weightage, e) {
|
||||
const control = <FormArray>this._editTempCategoryFrom.controls['temp_category'];
|
||||
control.push(this.initAnswers(fk_cat_id, name, weightage));
|
||||
}
|
||||
removeLanguage(i: number) {
|
||||
const control = <FormArray>this._editTempCategoryFrom.controls['temp_category'];
|
||||
control.removeAt(i);
|
||||
}
|
||||
|
||||
// END ===>
|
||||
|
||||
|
||||
/** To Save/Edited Popup Data */
|
||||
onSubmit() {
|
||||
this.submitted = true;
|
||||
// stop here if form is invalid
|
||||
}
|
||||
|
||||
ngOnDestroy(): void {
|
||||
//Called once, before the instance is destroyed.
|
||||
//Add 'implements OnDestroy' to the class.
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,46 @@
|
||||
<form [formGroup]="_editTempLenderFrom" (submit)="onSubmit()">
|
||||
<div formArrayName="temp_lender" class="example-full-width">
|
||||
<div *ngFor="let answ of _editTempLenderFrom.controls.temp_lender['controls']; let i=index">
|
||||
<div [formGroupName]="i">
|
||||
<div fxLayout="row" fxLayoutWrap fxLayoutGap="0.5%" fxLayoutAlign="start center">
|
||||
<mat-form-field fxFlex="0 1 auto" class="ml-xs">
|
||||
<mat-select placeholder="Lender" formControlName="fk_lender_id">
|
||||
<mat-option *ngFor="let enti of entityOptions" [value]="enti.fk_lender_id">{{ enti.name }}</mat-option>
|
||||
</mat-select>
|
||||
<mat-error *ngIf="submitted && f.fk_lender_id.hasError('required')" class="mat-text-warn">You must Select Lender Type.</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field fxFlex="0 1 auto" class="ml-xs">
|
||||
<mat-select placeholder="Product" formControlName="fk_product_id">
|
||||
<mat-option *ngFor="let enti of entityOptions" [value]="enti.fk_product_id">{{ enti.name }}</mat-option>
|
||||
</mat-select>
|
||||
<mat-error *ngIf="submitted && f.fk_product_id.hasError('required')" class="mat-text-warn">You must Select Product.</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field fxFlex="0 1 auto" class="ml-xs">
|
||||
<mat-select placeholder="Catergory Segment" formControlName="fk_category_segment_id">
|
||||
<mat-option *ngFor="let enti of entityOptions" [value]="enti.fk_category_segment_id">{{ enti.name }}</mat-option>
|
||||
</mat-select>
|
||||
<mat-error *ngIf="submitted && f.fk_category_segment_id.hasError('required')" class="mat-text-warn">You must Select Category Segment.</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<!--<mat-form-field fxFlex="0 1 auto" class="ml-xs">
|
||||
<input matInput placeholder="Email" formControlName="contact_email">
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field fxFlex="0 1 auto" class="ml-xs">
|
||||
<input matInput placeholder="Mobile Number" formControlName="contact_mobile_no">
|
||||
</mat-form-field>-->
|
||||
<span *ngIf="_editTempLenderFrom.controls.temp_lender.controls.length > 1" (click)="removeLanguage(i)">
|
||||
<button mat-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Delete" matTooltipPosition="above"><mat-icon>delete</mat-icon></button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button mat-fab class="mr-1 mb-1" color="primary" matTooltip="Add More Contact Person" matTooltipPosition="above" (click)="addLanguage($event); false"><mat-icon>add</mat-icon></button>
|
||||
</div>
|
||||
<div class="row" style="text-align:right;">
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Reset" matTooltipPosition="above" type="reset"><mat-icon>settings_backup_restore</mat-icon></button>
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Save" matTooltipPosition="above" type="submit"><mat-icon>save</mat-icon></button>
|
||||
</div>
|
||||
</form>
|
||||
@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { EditLenderComponent } from './edit-lender.component';
|
||||
|
||||
describe('EditLenderComponent', () => {
|
||||
let component: EditLenderComponent;
|
||||
let fixture: ComponentFixture<EditLenderComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ EditLenderComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(EditLenderComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,74 @@
|
||||
import { Component, ViewChild, OnInit, OnDestroy, Input } from '@angular/core';
|
||||
import { MatPaginator, MatSort, MatTableDataSource, MatDialog, PageEvent } from '@angular/material';
|
||||
import { FormGroup, FormControl, FormBuilder, Validators , FormArray} from '@angular/forms';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { DataSource } from '@angular/cdk/table';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
@Component({
|
||||
selector: 'app-template-edit-lender',
|
||||
templateUrl: './edit-lender.component.html',
|
||||
styleUrls: ['./edit-lender.component.scss']
|
||||
})
|
||||
export class EditLenderComponent implements OnInit {
|
||||
|
||||
|
||||
@Input() questionId: number;
|
||||
|
||||
public _editTempLenderFrom: FormGroup;
|
||||
public submitted = false;
|
||||
constructor(
|
||||
private _formBuilder: FormBuilder) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this._editTempLenderFrom = this._formBuilder.group({
|
||||
temp_lender: this._formBuilder.array([
|
||||
this.initAnswers(),
|
||||
])
|
||||
})
|
||||
}
|
||||
|
||||
// convenience getter for easy access to form fields
|
||||
get f() { return this._editTempLenderFrom.controls; }
|
||||
|
||||
|
||||
public entityOptions = [{
|
||||
fk_lender_id: 1,
|
||||
name: 'Lender1'
|
||||
},{
|
||||
fk_lender_id: 2,
|
||||
name: 'Lender2'
|
||||
}];
|
||||
|
||||
// Dynamic Form field creation Functionality : START ===>
|
||||
initAnswers() {
|
||||
return this._formBuilder.group({
|
||||
fk_lender_id: ['', Validators.compose([Validators.required])],
|
||||
fk_product_id: ['', Validators.compose([Validators.required])],
|
||||
fk_category_segment_id: ['', Validators.compose([Validators.required])],
|
||||
});
|
||||
}
|
||||
addLanguage(e) {
|
||||
const control = <FormArray>this._editTempLenderFrom.controls['temp_lender'];
|
||||
control.push(this.initAnswers());
|
||||
}
|
||||
removeLanguage(i: number) {
|
||||
const control = <FormArray>this._editTempLenderFrom.controls['temp_lender'];
|
||||
control.removeAt(i);
|
||||
}
|
||||
|
||||
// END ===>
|
||||
|
||||
|
||||
/** To Save/Edited Popup Data */
|
||||
onSubmit() {
|
||||
this.submitted = true;
|
||||
// stop here if form is invalid
|
||||
}
|
||||
|
||||
ngOnDestroy(): void {
|
||||
//Called once, before the instance is destroyed.
|
||||
//Add 'implements OnDestroy' to the class.
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user