Fairoj : DI Changes

This commit is contained in:
saravanakumarkandasami 2019-03-25 20:02:17 +05:30
parent bea0ce373f
commit 5649709432
54 changed files with 1339 additions and 308 deletions

File diff suppressed because one or more lines are too long

View File

@ -101,4 +101,4 @@
"android" "android"
] ]
} }
} }

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
#Mon Mar 18 20:06:56 IST 2019 #Sat Mar 23 18:56:32 IST 2019
base.0=S\:\\pd_office\\pd_officer\\platforms\\android\\app\\build\\intermediates\\transforms\\dexMerger\\debug\\0 base.0=S\:\\pd_office\\pd_officer\\platforms\\android\\app\\build\\intermediates\\transforms\\dexMerger\\debug\\0
path.0=classes.dex path.0=classes.dex
renamed.0=classes.dex renamed.0=classes.dex

View File

@ -1,5 +1,5 @@
#Internal package file, do not edit. #Internal package file, do not edit.
#Mon Mar 18 20:06:57 IST 2019 #Sat Mar 23 18:56:33 IST 2019
60.set=ASSET 60.set=ASSET
52.set=ASSET 52.set=ASSET
53.base=S\:\\pd_office\\pd_officer\\platforms\\android\\app\\build\\intermediates\\assets\\debug 53.base=S\:\\pd_office\\pd_officer\\platforms\\android\\app\\build\\intermediates\\assets\\debug

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -26,31 +26,48 @@
</div> </div>
<!-- --> <!-- -->
<mat-form-field style="width: 100%"> <mat-form-field style="width: 100%">
<mat-select placeholder="State" formControlName="state" (selectionChange)="getCityAndPincodeDetails($event.value,i)"> <mat-select placeholder="State" formControlName="state" (selectionChange)="getCityAndPincodeDetails($event.value,i,'')">
<mat-option>Select</mat-option> <mat-option>
<mat-option *ngFor="let SL of stateData" [value]="SL.state_id">{{SL.name}}</mat-option> <ngx-mat-select-search formControlName="stateSearch" (keyup)="searchFun(item,i,'state')"
[placeholderLabel]="'Find State'" [noEntriesFoundLabel]="'No Matching Result'">
<ion-icon name="md-close" ngxMatSelectSearchClear></ion-icon>
</ngx-mat-select-search>
</mat-option>
<mat-option>Select</mat-option>
<mat-option *ngFor="let SL of filteredState | async" [value]="SL.state_id">{{SL.name}}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 100%"> <mat-form-field style="width: 100%">
<mat-select placeholder="City" formControlName="city"> <mat-select placeholder="City" formControlName="city">
<mat-option> <mat-option>
<ngx-mat-select-search formControlName="citySearch" (keyup)="searchFun(item,i)" <ngx-mat-select-search formControlName="citySearch" (keyup)="searchFun(item,i,'city')"
[placeholderLabel]="'Find City'" [placeholderLabel]="'Find City'"
[noEntriesFoundLabel]="'No Matching Result'"> [noEntriesFoundLabel]="'No Matching Result'">
<ion-icon name="md-close" ngxMatSelectSearchClear></ion-icon> <ion-icon name="md-close" ngxMatSelectSearchClear></ion-icon>
</ngx-mat-select-search> </ngx-mat-select-search>
</mat-option> </mat-option>
<mat-option>Select</mat-option> <mat-option>Select</mat-option>
<mat-option *ngFor="let CL of filteredCity | async" [value]="CL.city_id">{{CL.city_name}}</mat-option> <mat-option *ngFor="let CL of cityDataValue[i]" [value]="CL.city_id">{{CL.city_name}}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 100%"> <mat-form-field style="width: 100%">
<mat-select placeholder="Pincode" formControlName="pincode"> <mat-select placeholder="Pincode" formControlName="pincode">
<mat-option>
<ngx-mat-select-search formControlName="pinSearch" (keyup)="searchFun(item,i,'pin')"
[placeholderLabel]="'Search Pincode'"
[noEntriesFoundLabel]="'No Matching Result'">
<ion-icon name="md-close" ngxMatSelectSearchClear></ion-icon>
</ngx-mat-select-search>
</mat-option>
<mat-option>Select</mat-option> <mat-option>Select</mat-option>
<mat-option *ngFor="let PL of pincodeData[i]" [value]="PL.pincode_id">{{PL.pincode}}</mat-option> <mat-option *ngFor="let PL of pincodeDataValue[i]" [value]="PL.pincode_id">{{PL.pincode}}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<!-- <mat-form-field style="width:100%">
<input matInput type="number" formControlName="pincode">
</mat-form-field> -->
<mat-form-field *ngIf="item.get('pincode').value == 1" style="width: 100%"> <mat-form-field *ngIf="item.get('pincode').value == 1" style="width: 100%">
<input matInput type="number" autocomplete="off" placeholder="Specify Pincode " <input matInput type="number" autocomplete="off" placeholder="Specify Pincode "
formControlName="pincode_others" > formControlName="pincode_others" >
@ -317,18 +334,20 @@
</mat-form-field> </mat-form-field>
</mat-card> </mat-card>
<ion-row>
<!-- <ion-buttons >
<ion-button color="optblue" full[disabled]="!pdforms.valid" mat-raised-button style="width:100%" (click)="savepdDetails(pdforms.value)">Save <ion-icon name="md-disc"></ion-icon></ion-button> -->
<button ion-button full color="optblue" (click)="savepdQuestion(pdQuestionAddress.value)"> Save</button>
<!-- </ion-buttons> -->
</ion-row>
</form> </form>
<!-- Bank multi --> <!-- Bank multi -->
</ion-content> </ion-content>
<ion-footer>
<!-- <ion-buttons >
<ion-button color="optblue" full[disabled]="!pdforms.valid" mat-raised-button style="width:100%" (click)="savepdDetails(pdforms.value)">Save <ion-icon name="md-disc"></ion-icon></ion-button> -->
<button ion-button full color="optblue" (click)="savepdQuestion(pdQuestionAddress.value)"> Save</button>
<!-- </ion-buttons> -->
</ion-footer>

View File

@ -63,10 +63,14 @@ export class PdQuestionAddressPage {
stateData: any=[]; stateData: any=[];
uomData: any=[]; uomData: any=[];
addressesList: any; addressesList: any;
pincodeValue:any=[]
cityDataValue:any=[]
// counts:number = 1; // counts:number = 1;
private search:searchValue[] private search:searchValue[]
protected _onDestroy = new Subject<void>(); protected _onDestroy = new Subject<void>();
public filteredCity: ReplaySubject<searchValue[]> = new ReplaySubject<searchValue[]>(1); public filteredCity: ReplaySubject<searchValue[]> = new ReplaySubject<searchValue[]>(1);
public filteredState:ReplaySubject<searchValue[]>=new ReplaySubject<searchValue[]>(1)
pincodeDataValue: any=[];
constructor(public navCtrl: NavController, public navParams: NavParams,public fb:FormBuilder,public qustCat:QuestionCategoryProvider,public aws:AwsServiceProvider,public toast:ToastProvider,public alerCtrl:AlertController,public constant:ConstantsProvider) { constructor(public navCtrl: NavController, public navParams: NavParams,public fb:FormBuilder,public qustCat:QuestionCategoryProvider,public aws:AwsServiceProvider,public toast:ToastProvider,public alerCtrl:AlertController,public constant:ConstantsProvider) {
@ -112,7 +116,7 @@ export class PdQuestionAddressPage {
// additional_address_units: this.fb.array([]), // additional_address_units: this.fb.array([]),
}); });
this.getaddressForm();
//this.loadPD() //this.loadPD()
// let con=this.pdQuestionAddress.controls['addresses']['controls'] // let con=this.pdQuestionAddress.controls['addresses']['controls']
@ -128,30 +132,85 @@ export class PdQuestionAddressPage {
ionViewDidLoad() { ionViewDidLoad() {
//this.addUnits(); //this.addUnits();
console.log("ionViewDidLoad PdQuestionAddressPage") console.log("ionViewDidLoad PdQuestionAddressPage")
this.getaddressForm();
} }
searchFun(control:any,i:number){ searchFun(control:any,i:number,option){
// console.log(control,i) // console.log(control,i)
control.controls['citySearch'].valueChanges if (option == 'city') {
control.controls['citySearch'].valueChanges
.pipe(takeUntil(this._onDestroy))
.subscribe(() => {
this.SearchCity(control.controls['citySearch'].value, i);
})
}
if (option == 'state') {
console.log("state")
control.controls['stateSearch'].valueChanges
.pipe(takeUntil(this._onDestroy)) .pipe(takeUntil(this._onDestroy))
.subscribe(()=>{ .subscribe(()=>{
this.SearchCity(control.controls['citySearch'].value,i); this.searchState(control.controls['stateSearch'].value)
}) })
}
if (option == 'pin') {
console.log("Pin")
control.controls['pinSearch'].valueChanges
.pipe(takeUntil(this._onDestroy))
.subscribe(()=>{
this.searchPin(control.controls['pinSearch'].value,i)
})
}
} }
SearchCity(val:any,i:number){ searchPin(val:any,index:number){
if(!this.cityData[i]){ if(!this.pincodeData[index]){
return return
} }
let searchValue=val let searchValue=val
if(!searchValue){ if(!searchValue){
this.filteredCity.next(this.cityData[i].slice()) this.pincodeDataValue[index]=this.pincodeData[index].slice()
return return
}else{ }else{
searchValue=searchValue.toLowerCase()} searchValue=searchValue.toLowerCase()
this.filteredCity.next( }
this.cityData[i].filter(value=>value.city_name.toLowerCase().indexOf(searchValue)>-1) this.pincodeDataValue[index]=this.pincodeData[index].filter(value=>value.pincode.toLowerCase().indexOf(searchValue) > -1)
}
SearchCity(val: any, i: number) {
if (!this.cityData[i]) {
return
}
let searchValue = val
if (!searchValue) {
// this.filteredCity.next(this.cityData[i].slice())
this.cityDataValue[i]=this.cityData[i].slice()
return
} else {
searchValue = searchValue.toLowerCase()
}
this.cityDataValue[i]=this.cityData[i].filter(value => value.city_name.toLowerCase().indexOf(searchValue) > -1)
// this.filteredCity.next(
// this.cityData[i].filter(value => value.city_name.toLowerCase().indexOf(searchValue) > -1)
// )
}
searchState(val: any) {
console.log("statedata")
if (!this.stateData) {
return
}
let searchVal = val
if (!searchVal) {
this.filteredState.next(this.stateData.slice())
return
}
else {
searchVal = searchVal.toLowerCase()
}
this.filteredState.next(
this.stateData.filter(res => res.name.toLowerCase().indexOf(searchVal) > -1)
) )
} }
ionViewWillLeave() ionViewWillLeave()
{ {
@ -185,7 +244,7 @@ control.controls['citySearch'].valueChanges
/** To Get City And Pincode Data For Address Form /** To Get City And Pincode Data For Address Form
* Param 'stateID' -> selected StateId * Param 'stateID' -> selected StateId
*/ */
getCityAndPincodeDetails(stateID: string,i) { getCityAndPincodeDetails(stateID: string,i,pincode) {
// console.log(this.pdQuestionAddress.controls['addresses']['controls'][0].controls['citySearch']) // console.log(this.pdQuestionAddress.controls['addresses']['controls'][0].controls['citySearch'])
console.log(this.pdQuestionAddress) console.log(this.pdQuestionAddress)
//this.pdQuestionAddress.controls['addresses']['controls'].controls //this.pdQuestionAddress.controls['addresses']['controls'].controls
@ -194,9 +253,22 @@ control.controls['citySearch'].valueChanges
this.cityData[i] = data.records.cities; this.cityData[i] = data.records.cities;
this.search=this.cityData[i] this.search=this.cityData[i]
console.log("Slice",this.cityData[i].slice); console.log("Slice",this.cityData[i].slice);
this.filteredCity.next(this.cityData[i].slice()) //this.filteredCity.next(this.cityData[i].slice())
this.cityDataValue[i]=this.cityData[i].slice()
this.pincodeData[i] = data.records.pincode; this.pincodeData[i] = data.records.pincode;
this.pincodeDataValue[i]=this.pincodeData[i].slice()
} }
//FOR PINCODE FREE TEXT
// let pin
// if(pincode != ''){
// if(pincode != 1){
// this.pincodeValue[i]=this.pincodeData[i].filter(res=>res.pincode_id == pincode).map(val=>val.pincode)[0]
// //this.pincodeValue[i]=[].concat.apply([],this.pincodeValue[i])
// console.log(this.pincodeValue[i])
// console.log(this.pdQuestionAddress)
// }
// }
}); });
} }
@ -275,6 +347,8 @@ control.controls['citySearch'].valueChanges
}) })
this.qustCat.getcommondrop('STATE').subscribe(res=>{ this.qustCat.getcommondrop('STATE').subscribe(res=>{
this.stateData=res['records'].filter(val=>val.isactive == 1); this.stateData=res['records'].filter(val=>val.isactive == 1);
this.filteredState.next(this.stateData.slice())
}) })
this.qustCat.getcommondrop('UOM').subscribe(res=>{ this.qustCat.getcommondrop('UOM').subscribe(res=>{
this.uomData=res['records'].filter(val=>val.isactive == 1 && val.is_land_uom != 0) this.uomData=res['records'].filter(val=>val.isactive == 1 && val.is_land_uom != 0)
@ -354,6 +428,7 @@ control.controls['citySearch'].valueChanges
} }
initAddress(AddressDetails){ initAddress(AddressDetails){
console.log("pin init", this.pincodeValue[0])
if(AddressDetails != null){ if(AddressDetails != null){
return this.fb.group({ return this.fb.group({
address: [AddressDetails.address, Validators.compose([Validators.required])], address: [AddressDetails.address, Validators.compose([Validators.required])],
@ -362,6 +437,8 @@ control.controls['citySearch'].valueChanges
state: [AddressDetails.state], state: [AddressDetails.state],
city: [AddressDetails.city], city: [AddressDetails.city],
citySearch:[''], citySearch:[''],
stateSearch:[''],
pinSearch:[''],
pincode: [AddressDetails.pincode],/** ,Validators.compose([Validators.minLength(6),Validators.maxLength(6)]) */ pincode: [AddressDetails.pincode],/** ,Validators.compose([Validators.minLength(6),Validators.maxLength(6)]) */
pincode_others: [AddressDetails.pincode_others, Validators.compose([Validators.minLength(6), Validators.maxLength(6)])], pincode_others: [AddressDetails.pincode_others, Validators.compose([Validators.minLength(6), Validators.maxLength(6)])],
locality: [AddressDetails.locality, Validators.compose([Validators.required])], locality: [AddressDetails.locality, Validators.compose([Validators.required])],
@ -382,6 +459,8 @@ control.controls['citySearch'].valueChanges
state: [''], state: [''],
city: [''], city: [''],
citySearch:[''], citySearch:[''],
stateSearch:[''],
pinSearch:[''],
pincode: [''], pincode: [''],
pincode_others: ['', Validators.compose([Validators.minLength(6), Validators.maxLength(6)])], pincode_others: ['', Validators.compose([Validators.minLength(6), Validators.maxLength(6)])],
locality: ['', Validators.compose([Validators.required])], locality: ['', Validators.compose([Validators.required])],
@ -455,8 +534,15 @@ control.controls['citySearch'].valueChanges
// this.pdQuestionAddress.controls.uom_others.value : ''; // this.pdQuestionAddress.controls.uom_others.value : '';
// records.customer_behaviour = answerData.customer_behaviour; // records.customer_behaviour = answerData.customer_behaviour;
// records.neighbourhood = answerData.neighbourhood; // records.neighbourhood = answerData.neighbourhood;
// answerData.addresses.forEach(element=>{
// let temp=element.pincode
// element.pincode=1
// element.pincode_others=temp
// })
console.log("Answer DAta",answerData) console.log("Answer DAta",answerData)
records.addresses=answerData.addresses records.addresses=answerData.addresses
// records.addressess
records.address_form_remark=answerData.address_form_remark records.address_form_remark=answerData.address_form_remark
records.pdid = this.pdDetails.pd_id; records.pdid = this.pdDetails.pd_id;
records.formid = this.FormId.form_id; records.formid = this.FormId.form_id;
@ -517,15 +603,20 @@ control.controls['citySearch'].valueChanges
} }
else{ else{
this.getaddressDetails.forEach((datas,index)=>{ this.getaddressDetails.forEach((datas,index)=>{
this.getCityAndPincodeDetails(datas.state,index,datas.pincode)
if(datas.pincode == 1){
this.pincodeValue[index]=datas.pincode_others
}//if(val==true){
console.log( "Pin" ,this.pincodeValue[index]);
let val={ let val={
'address': datas.address, 'address': datas.address,
'address_type': datas.address_type, 'address_type': datas.address_type,
'address_type_others': datas.address_type_others, 'address_type_others': datas.address_type_others,
'state': datas.state, 'state': datas.state,
'city': datas.city, 'city': datas.city,
'pincode': datas.pincode, 'pincode':datas.pincode,
'pincode_others': datas.pincode_others, 'pincode_others':datas.pincode_others,
'locality': datas.locality, 'locality': datas.locality,
'locality_others': datas.locality_others, 'locality_others': datas.locality_others,
'locality_mixuse': datas.locality_mixuse, 'locality_mixuse': datas.locality_mixuse,
@ -535,7 +626,7 @@ control.controls['citySearch'].valueChanges
'uom': datas.uom, 'uom': datas.uom,
'uom_others': datas.uom_others 'uom_others': datas.uom_others
} }
this.getCityAndPincodeDetails(datas.state,index)
let selectedAddressType = this.addressTypes.filter(element => element.address_type_id == datas.address_type)[0]; let selectedAddressType = this.addressTypes.filter(element => element.address_type_id == datas.address_type)[0];
this.selectedAddressType(selectedAddressType.address_type,index); this.selectedAddressType(selectedAddressType.address_type,index);
if (datas.address_type == 1) { if (datas.address_type == 1) {
@ -660,13 +751,15 @@ control.controls['citySearch'].valueChanges
console.log('this.addressesList',this.addressesList); console.log('this.addressesList',this.addressesList);
if(this.addressesList.length > 0){ if(this.addressesList.length > 0){
this.addressesList.forEach((datas,index)=>{ this.addressesList.forEach((datas,index)=>{
this.getCityAndPincodeDetails(datas.fk_state,index,datas.pincode)
let obj ={ let obj ={
'address': datas.addressline1, 'address': datas.addressline1,
'address_type': '', 'address_type': '',
'address_type_others': '', 'address_type_others': '',
'state': datas.fk_state, 'state': datas.fk_state,
'city': datas.fk_city, 'city': datas.fk_city,
'pincode': datas.pincode_id, 'pincode':datas.pincode_id,
'pincode_others': datas.other_pincode, 'pincode_others': datas.other_pincode,
'locality': '', 'locality': '',
'locality_others': '', 'locality_others': '',
@ -677,7 +770,7 @@ control.controls['citySearch'].valueChanges
'uom': '', 'uom': '',
'uom_others': '' 'uom_others': ''
} }
this.getCityAndPincodeDetails(datas.fk_state,index)
control.push(this.initAddress(obj)) control.push(this.initAddress(obj))
}) })
} }

View File

@ -21,21 +21,13 @@
<mat-form-field style="width: 100%"> <mat-form-field style="width: 100%">
<input matInput type="text" placeholder="Product / Service" formControlName="sales_item" name="sales_item"> <input matInput type="text" placeholder="Product / Service" formControlName="sales_item" name="sales_item">
</mat-form-field> </mat-form-field>
<div *ngIf="margin_calculation_status"> <mat-radio-group class="example-radio-group" formControlName="sales_type" (change)="changeOptions(sale_i,$event)">
<mat-form-field style="width: 100%"> <mat-radio-button class="example-radio-button" color="primary" [value]="types.type_id" *ngFor="let types of check_type; let t = index">{{types.type_name}}</mat-radio-button>
<input matInput type="text" placeholder="Magin Percetage %" formControlName="margin_per" name="margin_per" (keyup)="salesCalculation(sale_i,item.value)"> </mat-radio-group>
</mat-form-field>
<mat-form-field style="width: 100%"> <div [ngSwitch]="item.value.sales_type">
<input matInput type="text" placeholder="Margin Value" formControlName="margin_value" name="margin_value" readonly> <!--Case 1-->
<mat-hint align="end" style="font-size:12px" *ngIf="item.get('margin_value').value != ''">{{"&#8377;"}} {{marginAmtInwords[sale_i]}} Only</mat-hint> <div *ngSwitchCase="1">
</mat-form-field>
</div>
<mat-form-field style="width: 100%">
<textarea matInput autocomplete="off" placeholder="Remarks" formControlName="comments"></textarea>
</mat-form-field>
</mat-card>
<mat-card>
<mat-card-header><h2>{{item.get('sales_item').value | titlecase}}</h2></mat-card-header> <mat-card-header><h2>{{item.get('sales_item').value | titlecase}}</h2></mat-card-header>
<div formArrayName="child"> <div formArrayName="child">
<div *ngFor="let tenants of item['controls'].child['controls']; let i =index;let dailylast = last" [formGroupName]="i"> <div *ngFor="let tenants of item['controls'].child['controls']; let i =index;let dailylast = last" [formGroupName]="i">
@ -43,7 +35,7 @@
<input matInput type="date" max="maxDate" placeholder="Sales Date" (dateChange)="salesCalculation(sale_i,item.value)" formControlName="sales_date" name="sales_date"> <input matInput type="date" max="maxDate" placeholder="Sales Date" (dateChange)="salesCalculation(sale_i,item.value)" formControlName="sales_date" name="sales_date">
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 100%"> <mat-form-field style="width: 100%">
<input matInput type="number" (blur)="getSalesCalc(tenants,item,sale_i)" placeholder="Value" (keyup)="salesCalculation(sale_i,item.value,item.value.child);inWords($event.target.value,i,1)" formControlName="sales_value" name="sales_value"> <input matInput type="number" (blur)="salesCalculation(sale_i,item.value)" placeholder="Bill Value" (keyup)="salesCalculation(sale_i,item.value);inWords($event.target.value,i,1)" formControlName="sales_value" name="sales_value">
<mat-hint align="end" style="font-size:12px" *ngIf="tenants.get('sales_value').value != ''">{{"&#8377;"}} {{Value[i]}} Only</mat-hint> <mat-hint align="end" style="font-size:12px" *ngIf="tenants.get('sales_value').value != ''">{{"&#8377;"}} {{Value[i]}} Only</mat-hint>
</mat-form-field> </mat-form-field>
<ion-buttons> <ion-buttons>
@ -62,7 +54,27 @@
</ion-buttons> </ion-buttons>
</div> </div>
</div> </div>
</div>
<!--Case 2-->
<div *ngSwitchCase="2" formArrayName="child">
<div *ngFor="let tenants of item['controls'].child['controls']; let i =index;let dailylast = last" [formGroupName]="i">
<mat-form-field style="width:100%">
<mat-select formControlName="fk_frequency_id" placeholder="Frequency" (selectionChange)="salesCalculation(sale_i,item.value)" required>
<mat-option *ngFor="let frq of frequencyData" [value]="frq.frequency_id">{{frq.name}}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:100%">
<input matInput placeholder="Value" formControlName="frequency_value" (keyup)="salesCalculation(sale_i,item.value);inWords($event.target.value,i,3)">
<mat-hint align="end" style="font-size:12px" *ngIf="tenants.value.frequency_value != ''">{{"&#8377;"}} {{freqAmtInwords[i]}} Only</mat-hint>
</mat-form-field>
<mat-form-field style="width: 100%">
<input OnlyNumber type="text" matInput placeholder="Annual Value" (keyup)="salesCalculation(sale_i,item.value)" formControlName="sales_value" readonly required>
<mat-hint align="end" style="font-size:12px" *ngIf="tenants.get('sales_value').value != ''">{{"&#8377;"}} {{Value[i]}} Only</mat-hint>
</mat-form-field>
</div>
</div>
</div>
<br/> <br/>
<ion-row> <ion-row>
<ion-col col-6> <ion-col col-6>
@ -78,9 +90,28 @@
<button ion-button (click)="deletedailySalesProduct(sale_i)" color="primary">Remove</button> <button ion-button (click)="deletedailySalesProduct(sale_i)" color="primary">Remove</button>
</ion-col> </ion-col>
</ion-row> </ion-row>
</mat-card>
<mat-card>
<mat-card-content>
<div *ngIf="margin_calculation_status">
<mat-form-field style="width: 100%">
<input matInput type="text" placeholder="Magin Percetage %" formControlName="margin_per" name="margin_per" (keyup)="salesCalculation(sale_i,item.value)">
</mat-form-field>
<mat-form-field style="width: 100%">
<input matInput type="text" placeholder="Margin Value" formControlName="margin_value" name="margin_value" readonly>
<mat-hint align="end" style="font-size:12px" *ngIf="item.get('margin_value').value != ''">{{"&#8377;"}} {{marginAmtInwords[sale_i]}} Only</mat-hint>
</mat-form-field>
</div>
<mat-form-field style="width: 100%">
<textarea matInput autocomplete="off" placeholder="Remarks" formControlName="comments"></textarea>
</mat-form-field>
</mat-card-content>
</mat-card> </mat-card>
</div> </div>
</div> </div>
<ion-row> <ion-row>

View File

@ -1,3 +1,20 @@
page-pd-question-assessed-daily-sales { page-pd-question-assessed-daily-sales {
.input-cover{position: static;} .input-cover{position: static;}
.mat-card{
margin-bottom: 15px;
border-radius: 10px !important;
box-shadow: 0 16px 38px -12px rgba(0, 0, 0, 0.56), 0 4px 25px 0 rgba(0, 0, 0, 0.12), 0 8px 10px -5px rgba(0, 0, 0, 0.2) !important;
}
.mat-card-content{
margin-bottom: 0px !important;
}
.scroll-content{
background-color: #eee;
}
mat-radio-button{
width:100%;
padding-top:10px;
padding-bottom: 10px;
}
} }

View File

@ -32,6 +32,9 @@ export class PdQuestionAssessedDailySalesPage {
margin_calculation_status:any margin_calculation_status:any
Value: any=[]; Value: any=[];
marginAmtInwords: any=[]; marginAmtInwords: any=[];
frequencyData: any=[];
freqAmtInwords: any=[];
check_type:any=[{'type_id':"1",'type_name':'Date Information'},{'type_id':"2",'type_name':'Frequency Information'}]
constructor(public navCtrl: NavController, public navParams: NavParams, public aws: AwsServiceProvider, public qustCat: QuestionCategoryProvider, public toast: ToastProvider, public fb: FormBuilder,public constant:ConstantsProvider) { constructor(public navCtrl: NavController, public navParams: NavParams, public aws: AwsServiceProvider, public qustCat: QuestionCategoryProvider, public toast: ToastProvider, public fb: FormBuilder,public constant:ConstantsProvider) {
this.pdDetails = this.navParams.get('pdDetails'); this.pdDetails = this.navParams.get('pdDetails');
this.FormId = this.navParams.get('FormId'); this.FormId = this.navParams.get('FormId');
@ -51,17 +54,77 @@ export class PdQuestionAssessedDailySalesPage {
this.adddailySalaesProduct(); this.adddailySalaesProduct();
} }
this.getDropDown()
} }
ionViewDidLoad() { ionViewDidLoad() {
console.log('ionViewDidLoad PdQuestionAssessedDailySalesPage'); console.log('ionViewDidLoad PdQuestionAssessedDailySalesPage');
} }
getDropDown(){
this.qustCat.getcommondrop('FREQUENCY').subscribe(data=>{
this.frequencyData=data['records'].filter(val=>val.isactive == 1)
})
}
// change options for either Date/Frequency Information
changeOptions(indexVal: any,event: any): void{
let control: any = <FormArray>this.salesDailyForm.controls['sales_product'];
console.log("control",control)
let innercontrol: any = control.controls[indexVal].get('child') as FormArray;
if(event.value=="1"){
for (let i = 0; i < innercontrol.value.length-1; i++) {
innercontrol.removeAt(i);
}
innercontrol.controls[innercontrol.value.length-1].controls['sales_date'].setValidators([Validators.required]);
innercontrol.controls[innercontrol.value.length-1].controls['sales_date'].updateValueAndValidity();
innercontrol.controls[innercontrol.value.length-1].controls['fk_frequency_id'].setValue("");
innercontrol.controls[innercontrol.value.length-1].controls['fk_frequency_id'].clearValidators();
innercontrol.controls[innercontrol.value.length-1].controls['fk_frequency_id'].updateValueAndValidity();
innercontrol.controls[innercontrol.value.length-1].controls['frequency_value'].setValue("");
innercontrol.controls[innercontrol.value.length-1].controls['frequency_value'].clearValidators();
innercontrol.controls[innercontrol.value.length-1].controls['frequency_value'].updateValueAndValidity();
innercontrol.controls[innercontrol.value.length-1].controls['sales_value'].setValue("");
control.controls[indexVal].controls['comments'].setValue("");
// control.controls[indexVal].controls['comments'].clearValidators();
//control.controls[indexVal].controls['comments'].updateValueAndValidity();
}
else if(event.value=="2"){
for (let i = 0; i < innercontrol.value.length-1; i++) {
innercontrol.removeAt(i);
}
innercontrol.controls[innercontrol.value.length-1].controls['sales_date'].setValue("");
innercontrol.controls[innercontrol.value.length-1].controls['sales_date'].clearValidators();
innercontrol.controls[innercontrol.value.length-1].controls['sales_date'].updateValueAndValidity();
innercontrol.controls[innercontrol.value.length-1].controls['fk_frequency_id'].setValue("");
innercontrol.controls[innercontrol.value.length-1].controls['fk_frequency_id'].setValidators([Validators.required]);
innercontrol.controls[innercontrol.value.length-1].controls['fk_frequency_id'].updateValueAndValidity();
innercontrol.controls[innercontrol.value.length-1].controls['frequency_value'].setValue("");
innercontrol.controls[innercontrol.value.length-1].controls['frequency_value'].setValidators([Validators.required]);
innercontrol.controls[innercontrol.value.length-1].controls['frequency_value'].updateValueAndValidity();
innercontrol.controls[innercontrol.value.length-1].controls['sales_value'].setValue("");
control.controls[indexVal].controls['comments'].setValue("");
// control.controls[indexVal].controls['comments'].setValidators([Validators.required]);
// control.controls[indexVal].controls['comments'].updateValueAndValidity();
}
control.controls[indexVal].controls['margin_per'].setValue("");
control.controls[indexVal].controls['margin_value'].setValue("");
}
createdailysalesProduct() { createdailysalesProduct() {
return this.fb.group( return this.fb.group(
{ {
sim_id: [null], sim_id: [null],
sales_item: [null, Validators.compose([Validators.required])], sales_item: [null, Validators.compose([Validators.required])],
sales_type:[null,Validators.compose([Validators.required])],
child: this.fb.array([]), child: this.fb.array([]),
fk_pd_id: [this.pdDetails.pd_id], fk_pd_id: [this.pdDetails.pd_id],
margin_per: [null], margin_per: [null],
@ -77,6 +140,8 @@ export class PdQuestionAssessedDailySalesPage {
fk_sim_id: [null], fk_sim_id: [null],
sales_date: [null, Validators.compose([Validators.required])], sales_date: [null, Validators.compose([Validators.required])],
sales_value: [null, Validators.compose([Validators.required])], sales_value: [null, Validators.compose([Validators.required])],
fk_frequency_id:[null,Validators.compose([Validators.required])],
frequency_value:[null,Validators.compose([Validators.required])],
isactive: ['1'], isactive: ['1'],
}) })
} }
@ -133,13 +198,11 @@ export class PdQuestionAssessedDailySalesPage {
} }
salesCalculation(indexVal: number,values: any): void { salesCalculation(indexVal: number,values: any): void {
console.log("Date check",values) if(this.margin_calculation_status===true && values.sales_type=="1"){
if(this.margin_calculation_status===true){
let control:any = <FormArray>this.salesDailyForm.controls['sales_product']; let control:any = <FormArray>this.salesDailyForm.controls['sales_product'];
if(values.child.length>0 && values.margin_per!=''){ if(values.child.length>0 && values.margin_per!='' && values.margin_per!=null){
let transformData = values.child.filter(val=>val.sales_date!='' && val.sales_date!=null && val.sales_date!=undefined && val.sales_value!='' && val.isactive===true).map(mval=>{ let transformData = values.child.filter(val=>val.sales_date!='' && val.sales_date!=null && val.sales_date!=undefined && val.sales_value!='' && val.isactive===true).map(mval=>{
mval.custum_date = this.pipe.transform(mval.sales_date, 'yyyy-MM'); mval.custum_date = this.pipe.transform(mval.sales_date, 'yyyy-MM');
console.log(mval);
return mval; return mval;
}); });
if(transformData.length>0) { if(transformData.length>0) {
@ -150,12 +213,10 @@ export class PdQuestionAssessedDailySalesPage {
let getTotalValueCounts = transformData.map(val=>val.sales_value) let getTotalValueCounts = transformData.map(val=>val.sales_value)
.reduce((sum, curr) => parseInt(sum) + parseInt(curr)); .reduce((sum, curr) => parseInt(sum) + parseInt(curr));
control.controls[indexVal].controls['margin_value'].setValue(parseInt(getTotalValueCounts) * (parseInt(values.margin_per)/100) * (12 / parseInt(getUniqueMonthCounts.length))); control.controls[indexVal].controls['margin_value'].setValue(parseInt(getTotalValueCounts) * (parseInt(values.margin_per)/100) * (12 / parseInt(getUniqueMonthCounts.length)));
this.inWords(parseInt(getTotalValueCounts) * (parseInt(values.margin_per)/100) * (12 / parseInt(getUniqueMonthCounts.length)),indexVal,2); this.inWords(parseInt(getTotalValueCounts) * (parseInt(values.margin_per)/100) * (12 / parseInt(getUniqueMonthCounts.length)),indexVal,2)
} }
else{ else{
control.controls[indexVal].controls['margin_value'].setValue("");
control.controls[indexVal].controls['margin_value'].setValue('');
} }
} }
@ -164,6 +225,38 @@ export class PdQuestionAssessedDailySalesPage {
} }
} }
else if(this.margin_calculation_status===true && values.sales_type=="2"){
let control:any = <FormArray>this.salesDailyForm.controls['sales_product'];
let innercontrol: any = control.controls[indexVal].get('child') as FormArray;
if(values.child[values.child.length-1].fk_frequency_id!='' && values.child[values.child.length-1].frequency_value!='' && values.child[values.child.length-1].fk_frequency_id!=null && values.child[values.child.length-1].frequency_value!=null){
let filterFrequencyValue: any = this.frequencyData.filter(val =>val.frequency_id==values.child[values.child.length-1].fk_frequency_id);
innercontrol.controls[innercontrol.value.length-1].controls['sales_value'].setValue(parseInt(filterFrequencyValue[0].mutiple_factor) * parseInt(values.child[values.child.length-1].frequency_value));
this.inWords(parseInt(filterFrequencyValue[0].mutiple_factor) * parseInt(values.child[values.child.length-1].frequency_value),innercontrol.value.length-1,1)
let getTotalValueCounts =parseInt(filterFrequencyValue[0].mutiple_factor) * parseInt(values.child[values.child.length-1].frequency_value)
values.margin_per!='' ? control.controls[indexVal].controls['margin_value'].setValue( getTotalValueCounts * (parseInt(values.margin_per)/100)) : '';
values.margin_per!='' ? this.inWords(getTotalValueCounts * (parseInt(values.margin_per)/100),indexVal,2) : ''
}
else {
innercontrol.controls[innercontrol.value.length-1].controls['sales_value'].setValue("");
control.controls[indexVal].controls['margin_value'].setValue("");
}
}
else if(this.margin_calculation_status===false && values.sales_type=="2"){
let control:any = <FormArray>this.salesDailyForm.controls['sales_product'];
let innercontrol: any = control.controls[indexVal].get('child') as FormArray;
if(values.child[values.child.length-1].fk_frequency_id!='' && values.child[values.child.length-1].frequency_value!='' && values.child[values.child.length-1].fk_frequency_id!=null && values.child[values.child.length-1].frequency_value!=null){
let filterFrequencyValue: any = this.frequencyData.filter(val =>val.frequency_id==values.child[values.child.length-1].fk_frequency_id);
innercontrol.controls[innercontrol.value.length-1].controls['sales_value'].setValue(parseInt(filterFrequencyValue[0].mutiple_factor) * parseInt(values.child[values.child.length-1].frequency_value));
this.inWords(parseInt(filterFrequencyValue[0].mutiple_factor) * parseInt(values.child[values.child.length-1].frequency_value),innercontrol.value.length-1,1)
}
else {
innercontrol.controls[innercontrol.value.length-1].controls['sales_value'].setValue("");
}
}
} }
inWords(e,c,flag){ inWords(e,c,flag){
@ -174,6 +267,8 @@ export class PdQuestionAssessedDailySalesPage {
case 2 : case 2 :
this.marginAmtInwords[c] = this.constant.convertNumberToWords(e); this.marginAmtInwords[c] = this.constant.convertNumberToWords(e);
break; break;
case 3:
this.freqAmtInwords[c]=this.constant.convertNumberToWords(e)
default : break; default : break;
} }
} }
@ -217,9 +312,20 @@ export class PdQuestionAssessedDailySalesPage {
} }
} }
saveData(answerData) { saveData(answerData) {
answerData.sales_product.forEach(parVal=>{
parVal.child.forEach(childVal=>{
if(childVal['custum_date']){
delete childVal['custum_date'];
}
if(childVal['sales_date'])
childVal['sales_date']=this.pipe.transform(childVal['sales_date'], 'yyyy-MM-dd');
});
});
if (this.salesDailyForm.valid) { if (this.salesDailyForm.valid) {
let records = { 'records': answerData.sales_product }; let records = { 'records': answerData.sales_product };
this.qustCat.saveassessedForms('saveAssessedIncomeMonthwiseItems', records).subscribe(res => { console.log("answer Data",answerData.sales_product)
this.qustCat.saveassessedForms('saveAssessedIncomeMonthwiseItems', answerData.sales_product).subscribe(res => {
if (res['dataStatus'] == true) { if (res['dataStatus'] == true) {
this.toast.pdTriggerappmessage('Record Saved Successfully.!'); this.toast.pdTriggerappmessage('Record Saved Successfully.!');
@ -276,6 +382,7 @@ export class PdQuestionAssessedDailySalesPage {
{ {
sim_id: [data.sim_id], sim_id: [data.sim_id],
sales_item: [data.sales_item, Validators.compose([Validators.required])], sales_item: [data.sales_item, Validators.compose([Validators.required])],
sales_type:[data.sales_type,Validators.compose([Validators.required])],
child: this.fb.array([]), child: this.fb.array([]),
fk_pd_id: [this.pdDetails.pd_id], fk_pd_id: [this.pdDetails.pd_id],
fk_createdby: [this.users], fk_createdby: [this.users],
@ -295,6 +402,8 @@ export class PdQuestionAssessedDailySalesPage {
sales_date: [data.sales_date, Validators.compose([Validators.required])], sales_date: [data.sales_date, Validators.compose([Validators.required])],
// sales_date: [new Date(this.pipe.transform(data.sales_date, 'dd-MM-yyyy')), Validators.compose([Validators.required])], // sales_date: [new Date(this.pipe.transform(data.sales_date, 'dd-MM-yyyy')), Validators.compose([Validators.required])],
sales_value: [data.sales_value, Validators.compose([Validators.required])], sales_value: [data.sales_value, Validators.compose([Validators.required])],
fk_frequency_id:[data.fk_frequency_id,Validators.compose([Validators.required])],
frequency_value:[data.frequency_value,Validators.compose([Validators.required])],
isactive: ['1'], isactive: ['1'],
}) })

View File

@ -19,10 +19,14 @@
<mat-card> <mat-card>
<!-- <h3>Itemwise</h3> --> <!-- <h3>Itemwise</h3> -->
<mat-form-field style="width: 100%"> <mat-form-field style="width: 100%">
<input type="text" matInput placeholder="Product/Services" formControlName="sales_item" (keyup)="salecalculat(i,item.value)" name="sales_item"> <input type="text" matInput placeholder="Product/Services" formControlName="sales_item" (keyup)="salesCalculation(i,item.value)" name="sales_item">
</mat-form-field> </mat-form-field>
<mat-radio-group formControlName="sales_type" class="example-radio-group" (change)="changeOptions(i,$event)">
<mat-radio-button class="example-radio-button" color="primary" [value]="types.type_id" *ngFor="let types of check_type; let t = index">{{types.type_name}}</mat-radio-button>
</mat-radio-group>
<div *ngIf="item.value.sales_type == '1'">
<mat-form-field style="width: 100%"> <mat-form-field style="width: 100%">
<input type="number" matInput placeholder="Sale Quantity" (keyup)="salecalculat(i,item.value)" formControlName="sales_qty" name="sales_qty"> <input type="number" matInput placeholder="Sale Quantity" (keyup)="salesCalculation(i,item.value)" formControlName="sales_qty" name="sales_qty">
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 100%"> <mat-form-field style="width: 100%">
<mat-select placeholder="UOM" name="fk_uom_id" formControlName="fk_uom_id" > <mat-select placeholder="UOM" name="fk_uom_id" formControlName="fk_uom_id" >
@ -30,12 +34,20 @@
<mat-option *ngFor="let uom of UOM" [value]="uom.uom_id">{{uom.name}}</mat-option> <mat-option *ngFor="let uom of UOM" [value]="uom.uom_id">{{uom.name}}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 100%" *ngIf="item.controls['fk_uom_id'].value == 1">
<input matInput type="text" autocomplete="off" formControlName="uom_other" placeholder="Other UOM">
</mat-form-field>
</div>
<!-- switch case for swap the frequency and value field -->
<div [ngSwitch]="item.value.sales_type">
<!--Case 1-->
<div *ngSwitchCase="1">
<mat-form-field style="width: 100%"> <mat-form-field style="width: 100%">
<input type="number" matInput placeholder="Rate/unit of sale" formControlName="rate_per_unit" name="rate_per_unit" (keyup)="inWords($event.target.value,i,4)"> <input type="number" matInput placeholder="Rate/unit of sale" formControlName="rate_per_unit" name="rate_per_unit" (keyup)="inWords($event.target.value,i,4)">
</mat-form-field> </mat-form-field>
<mat-label align="end" style="font-size: 12px" *ngIf="item.get('rate_per_unit').value != null">{{"&#8377;"}} {{ratePerUnitAmtInwords[i]}} Only</mat-label> <mat-label align="end" style="font-size: 12px" *ngIf="item.get('rate_per_unit').value != null">{{"&#8377;"}} {{ratePerUnitAmtInwords[i]}} Only</mat-label>
<mat-form-field style="width: 100%"> <mat-form-field style="width: 100%">
<mat-select placeholder="Frequency" formControlName="fk_frequency_id" (selectionChange)="salecalculat(i,item.value)"> <mat-select placeholder="Frequency" formControlName="fk_frequency_id" (selectionChange)="salesCalculation(i,item.value)">
<mat-option>Select</mat-option> <mat-option>Select</mat-option>
<mat-option *ngFor="let frq of m_freqOfPurchase" [value]="frq.frequency_id <mat-option *ngFor="let frq of m_freqOfPurchase" [value]="frq.frequency_id
@ -46,6 +58,28 @@
<input matInput type="number" placeholder="Annual Sales" formControlName="annual_sale_value" name="annual_sale_value" readonly> <input matInput type="number" placeholder="Annual Sales" formControlName="annual_sale_value" name="annual_sale_value" readonly>
<mat-hint align="end" style="font-size: 12px" *ngIf="item.get('rate_per_unit').value != null">{{"&#8377;"}} {{annualSaleAmtInwords[i]}} Only</mat-hint> <mat-hint align="end" style="font-size: 12px" *ngIf="item.get('rate_per_unit').value != null">{{"&#8377;"}} {{annualSaleAmtInwords[i]}} Only</mat-hint>
</mat-form-field> </mat-form-field>
</div>
<!--Case 2-->
<div *ngSwitchCase="2">
<mat-form-field style="width: 100%">
<mat-select placeholder="Frequency" formControlName="fk_frequency_id" (selectionChange)="salesCalculation(i,item.value)">
<mat-option>Select</mat-option>
<mat-option *ngFor="let frq of m_freqOfPurchase" [value]="frq.frequency_id
">{{frq.name}}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 100%">
<input OnlyNumber type="number" matInput [placeholder]="item.value.fk_frequency_id=='1' ? 'Other Sale' : item.value.fk_frequency_id=='2' ? 'Yearly Sale' : item.value.fk_frequency_id=='3' ? 'Half Yearly Sale' : item.value.fk_frequency_id=='4' ? 'Fortnightly Sale' : item.value.fk_frequency_id=='5' ? 'Daily Sale' : item.value.fk_frequency_id=='6' ? 'Quarterly Sale' : item.value.fk_frequency_id=='7' ? 'Monthly Sale' : ''" formControlName="rate_per_unit" (keyup)="salesCalculation(i,item.value)" required>
<mat-label align="end" style="font-size: 12px" *ngIf="item.get('rate_per_unit').value != null">{{"&#8377;"}} {{ratePerUnitAmtInwords[i]}} Only</mat-label>
</mat-form-field>
<mat-form-field style="width: 100%">
<input matInput type="number" placeholder="Annual Sales" formControlName="annual_sale_value" name="annual_sale_value" readonly>
<mat-hint align="end" style="font-size: 12px" *ngIf="item.get('rate_per_unit').value != null">{{"&#8377;"}} {{annualSaleAmtInwords[i]}} Only</mat-hint>
</mat-form-field>
</div>
</div>
<div *ngIf="margin_calculation_status===true"> <div *ngIf="margin_calculation_status===true">
<mat-form-field style="width: 100%"> <mat-form-field style="width: 100%">
<input matInput type="number" placeholder="Margin percentage %" (keyup)="salesMarginPerCalculation(i,item.value)" formControlName="margin_per" name="margin_per" > <input matInput type="number" placeholder="Margin percentage %" (keyup)="salesMarginPerCalculation(i,item.value)" formControlName="margin_per" name="margin_per" >

View File

@ -1,3 +1,18 @@
page-pd-question-assessed-sales { page-pd-question-assessed-sales {
mat-radio-button{
padding-top:10px;
padding-bottom:10px;
}
.mat-card{
margin-bottom: 15px;
border-radius: 10px !important;
box-shadow: 0 16px 38px -12px rgba(0, 0, 0, 0.56), 0 4px 25px 0 rgba(0, 0, 0, 0.12), 0 8px 10px -5px rgba(0, 0, 0, 0.2) !important;
}
.mat-card-content{
margin-bottom: 0px !important;
}
.scroll-content{
background-color: #eee;
}
} }

View File

@ -35,6 +35,7 @@ export class PdQuestionAssessedSalesPage {
marginFinalAmtInwords:any =[]; marginFinalAmtInwords:any =[];
ratePerUnitAmtInwords: any=[]; ratePerUnitAmtInwords: any=[];
margin_calculation_status:any=[] margin_calculation_status:any=[]
check_type:any=[{'type_id':"1",'type_name':'Quantity and Rate Information'},{'type_id':"2",'type_name':'Value Information'}]
constructor(public navCtrl: NavController, public navParams: NavParams,public aws:AwsServiceProvider,public fb:FormBuilder,public qustCat:QuestionCategoryProvider,public toast:ToastProvider,public cons:ConstantsProvider) { constructor(public navCtrl: NavController, public navParams: NavParams,public aws:AwsServiceProvider,public fb:FormBuilder,public qustCat:QuestionCategoryProvider,public toast:ToastProvider,public cons:ConstantsProvider) {
this.pdDetails = this.navParams.get('pdDetails'); this.pdDetails = this.navParams.get('pdDetails');
this.FormId = this.navParams.get('FormId'); this.FormId = this.navParams.get('FormId');
@ -88,7 +89,9 @@ export class PdQuestionAssessedSalesPage {
sales_item:[null,Validators.compose([Validators.required])], sales_item:[null,Validators.compose([Validators.required])],
sales_qty:[null,Validators.compose([Validators.required])], sales_qty:[null,Validators.compose([Validators.required])],
sales_type:[null,Validators.compose([Validators.required])],
fk_uom_id:[null,Validators.compose([Validators.required])], fk_uom_id:[null,Validators.compose([Validators.required])],
uom_other:[null,Validators.compose([Validators.required])],
rate_per_unit:[null,Validators.compose([Validators.required])], rate_per_unit:[null,Validators.compose([Validators.required])],
fk_frequency_id:[null,Validators.compose([Validators.required])], fk_frequency_id:[null,Validators.compose([Validators.required])],
annual_sale_value:[null], annual_sale_value:[null],
@ -213,6 +216,26 @@ export class PdQuestionAssessedSalesPage {
values.margin_per_uom=='' && values.margin_per!='' ? this.salesMarginPerCalculation(indexVal,this.assessedForm.value.salesCalItemwise[indexVal]): values.margin_per_uom!='' && values.margin_per=='' ? this.salesMarginAmtCalculation(indexVal,this.assessedForm.value.salesCalItemwise[indexVal]) : values.margin_per_uom!='' && values.margin_per!='' ? this.salesMarginAmtCalculation(indexVal,this.assessedForm.value.salesCalItemwise[indexVal]) :this.salesMarginAmtCalculation(indexVal,this.assessedForm.value.salesCalItemwise[indexVal]); values.margin_per_uom=='' && values.margin_per!='' ? this.salesMarginPerCalculation(indexVal,this.assessedForm.value.salesCalItemwise[indexVal]): values.margin_per_uom!='' && values.margin_per=='' ? this.salesMarginAmtCalculation(indexVal,this.assessedForm.value.salesCalItemwise[indexVal]) : values.margin_per_uom!='' && values.margin_per!='' ? this.salesMarginAmtCalculation(indexVal,this.assessedForm.value.salesCalItemwise[indexVal]) :this.salesMarginAmtCalculation(indexVal,this.assessedForm.value.salesCalItemwise[indexVal]);
} }
} }
salesCalculation(indexVal: number,values: any): void {
let control:any = <FormArray>this.assessedForm.controls['salesCalItemwise'];
if(values.sales_type=="1" && values.sales_qty!='' && values.rate_per_unit!='' && values.fk_frequency_id!='' && values.fk_frequency_id != null) {
let filterFrequencyValue: any = this.m_freqOfPurchase.filter(val =>val.frequency_id==values.fk_frequency_id);
control.controls[indexVal].controls['annual_sale_value'].setValue(parseInt(values.sales_qty) * parseInt(values.rate_per_unit) * parseInt(filterFrequencyValue[0].mutiple_factor));
this.inWords(parseInt(values.sales_qty) * parseInt(values.rate_per_unit) * parseInt(filterFrequencyValue[0].mutiple_factor),indexVal,1)
}
else if(values.sales_type=="2" && values.rate_per_unit!='' && values.fk_frequency_id!='' && values.fk_frequency_id != null) {
let filterFrequencyValue: any = this.m_freqOfPurchase.filter(val =>val.frequency_id==values.fk_frequency_id);
control.controls[indexVal].controls['annual_sale_value'].setValue(parseInt(values.rate_per_unit) * parseInt(filterFrequencyValue[0].mutiple_factor));
this.inWords(parseInt(values.rate_per_unit) * parseInt(filterFrequencyValue[0].mutiple_factor),indexVal,1)
}
else {
control.controls[indexVal].controls['annual_sale_value'].setValue('');
}
if(this.margin_calculation_status===true) {
values.margin_per_uom=='' && values.margin_per!='' ? this.salesMarginPerCalculation(indexVal,this.assessedForm.value.salesCalItemwise[indexVal]): values.margin_per_uom!='' && values.margin_per=='' ? this.salesMarginAmtCalculation(indexVal,this.assessedForm.value.salesCalItemwise[indexVal]) : values.margin_per_uom!='' && values.margin_per!='' ? this.salesMarginAmtCalculation(indexVal,this.assessedForm.value.salesCalItemwise[indexVal]) :this.salesMarginAmtCalculation(indexVal,this.assessedForm.value.salesCalItemwise[indexVal]);
}
}
salesMarginPerCalculation(indexVal: number,values: any): void { salesMarginPerCalculation(indexVal: number,values: any): void {
let control:any = <FormArray>this.assessedForm.controls['salesCalItemwise']; let control:any = <FormArray>this.assessedForm.controls['salesCalItemwise'];
control.controls[indexVal].controls['margin_per_uom'].setValue(''); control.controls[indexVal].controls['margin_per_uom'].setValue('');
@ -337,6 +360,31 @@ else{
// console.log(control); // console.log(control);
this.grandTotal = this.annual.reduce((a,b)=> a+b,0); this.grandTotal = this.annual.reduce((a,b)=> a+b,0);
} }
changeOptions(indexVal: any,event: any): void{
let control: any = <FormArray>this.assessedForm.controls['salesCalItemwise'];
if(event.value=="1"){
control.controls[indexVal].controls['sales_qty'].setValidators([Validators.required]);
control.controls[indexVal].controls['sales_qty'].updateValueAndValidity();
control.controls[indexVal].controls['fk_uom_id'].setValidators([Validators.required]);
control.controls[indexVal].controls['fk_uom_id'].updateValueAndValidity();
this.salesCalculation(indexVal,control.controls[indexVal].value);
}
else if(event.value=="2"){
control.controls[indexVal].controls['sales_qty'].setValue("");
control.controls[indexVal].controls['sales_qty'].clearValidators();
control.controls[indexVal].controls['sales_qty'].updateValueAndValidity();
control.controls[indexVal].controls['fk_uom_id'].setValue("");
control.controls[indexVal].controls['fk_uom_id'].clearValidators();
control.controls[indexVal].controls['fk_uom_id'].updateValueAndValidity();
control.controls[indexVal].controls['margin_per_uom'].setValue("");
this.salesCalculation(indexVal,control.controls[indexVal].value);
}
}
createSaleswithData(data) createSaleswithData(data)
{ {
@ -345,8 +393,10 @@ else{
sci_id:[data.sci_id], sci_id:[data.sci_id],
fk_pd_id:[this.pdDetails.pd_id], fk_pd_id:[this.pdDetails.pd_id],
sales_item:[data.sales_item,Validators.compose([Validators.required])], sales_item:[data.sales_item,Validators.compose([Validators.required])],
sales_type:[data.sales_type,Validators.compose([Validators.required])],
sales_qty:[data.sales_qty,Validators.compose([Validators.required])], sales_qty:[data.sales_qty,Validators.compose([Validators.required])],
fk_uom_id:[data.fk_uom_id,Validators.compose([Validators.required])], fk_uom_id:[data.fk_uom_id,Validators.compose([Validators.required])],
uom_other:[data.uom_other,Validators.compose([Validators.required])],
rate_per_unit:[data.rate_per_unit,Validators.compose([Validators.required])], rate_per_unit:[data.rate_per_unit,Validators.compose([Validators.required])],
fk_frequency_id:[data.fk_frequency_id,Validators.compose([Validators.required])], fk_frequency_id:[data.fk_frequency_id,Validators.compose([Validators.required])],
annual_sale_value:[data.annual_sale_value], annual_sale_value:[data.annual_sale_value],

View File

@ -223,7 +223,7 @@
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none"> <div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<div *ngIf="sup.get('assets_mode').value == 2 || sup.get('assets_mode').value == 5"> <div *ngIf="sup.get('assets_mode').value == 1 || sup.get('assets_mode').value == 2 || sup.get('assets_mode').value == 3 || sup.get('assets_mode').value == 4 || sup.get('assets_mode').value == 5">
<div fxFlex="33"> <div fxFlex="33">
<mat-form-field style="width:100%"> <mat-form-field style="width:100%">
<input type="number" matInput placeholder="Approximate Market Value" formControlName="approximate_market_value" (keyup)="inWords($event.target.value,i,4)"> <input type="number" matInput placeholder="Approximate Market Value" formControlName="approximate_market_value" (keyup)="inWords($event.target.value,i,4)">
@ -296,7 +296,7 @@
<mat-list> <mat-list>
<p>Is there a loan?</p> <p>Is there a Loan Existing Against this Assets?</p>
<mat-radio-group formControlName="emi"> <mat-radio-group formControlName="emi">
<mat-radio-button value="yes">YES</mat-radio-button> <mat-radio-button value="yes">YES</mat-radio-button>
@ -363,9 +363,12 @@
<!-- <ion-buttons > <!-- <ion-buttons >
<ion-button color="optblue" full[disabled]="!pdforms.valid" mat-raised-button style="width:100%" (click)="savepdDetails(pdforms.value)">Save <ion-icon name="md-disc"></ion-icon></ion-button> --> <ion-button color="optblue" full[disabled]="!pdforms.valid" mat-raised-button style="width:100%" (click)="savepdDetails(pdforms.value)">Save <ion-icon name="md-disc"></ion-icon></ion-button> -->
<button ion-button full color="optblue" (click)="saveAssetDetails(AssetsDetailsForm.value)"> Save</button>
<!-- </ion-buttons> --> <!-- </ion-buttons> -->
</ion-row> </ion-row>
</form> </form>
</ion-content> </ion-content>
<ion-footer>
<button ion-button full color="optblue" (click)="saveAssetDetails(AssetsDetailsForm.value)"> Save</button>
</ion-footer>

View File

@ -129,9 +129,12 @@
<!-- <ion-buttons > <!-- <ion-buttons >
<ion-button color="optblue" full[disabled]="!pdforms.valid" mat-raised-button style="width:100%" (click)="savepdDetails(pdforms.value)">Save <ion-icon name="md-disc"></ion-icon></ion-button> --> <ion-button color="optblue" full[disabled]="!pdforms.valid" mat-raised-button style="width:100%" (click)="savepdDetails(pdforms.value)">Save <ion-icon name="md-disc"></ion-icon></ion-button> -->
<button ion-button full color="optblue" (click)="savepdBank(bankDetails.value)"> Save</button>
<!-- </ion-buttons> --> <!-- </ion-buttons> -->
</ion-row> </ion-row>
</form> </form>
</ion-content> </ion-content>
<ion-footer>
<button ion-button full color="optblue" (click)="savepdBank(bankDetails.value)"> Save</button>
</ion-footer>

View File

@ -17,6 +17,7 @@
<ion-content padding> <ion-content padding>
<form *ngIf="apiLoadFinish && loadDetails" [formGroup]="_businessAssetsQuesFrom"> <form *ngIf="apiLoadFinish && loadDetails" [formGroup]="_businessAssetsQuesFrom">
<div formArrayName="business_assets_for_address"> <div formArrayName="business_assets_for_address">
<div <div
@ -57,7 +58,7 @@
<mat-form-field> <mat-form-field>
<mat-select <mat-select
[placeholder]="placeholderName[i] ? placeholderName[i] :'Was any business activity seen at the Address Type during PD visit?'" [placeholder]="placeholderName[i] ? placeholderName[i] :'Was any business activity seen at the Address Type during PD visit?'"
formControlName="business_is_pd_visited"> formControlName="business_is_pd_visited" (selectionChange)="setRequiredValidation($event.value,'',11,i)">
<mat-option value="yes">Yes</mat-option> <mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option> <mat-option value="no">No</mat-option>
</mat-select> </mat-select>
@ -65,9 +66,10 @@
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf="itemrow.get('business_is_pd_visited').value != ''"> <mat-form-field *ngIf="itemrow.get('business_is_pd_visited').value != ''" >
<input matInput autocomplete="off" placeholder="Remarks" formControlName="business_pd_visited_remark"> <input matInput autocomplete="off" placeholder="Remarks" #remarksFocus formControlName="business_pd_visited_remark" required>
<!-- <mat-error *ngIf="!_businessAssetsQuesFrom.controls['business_pd_visited_remark'].value.valid">Remarks Required</mat-error> --> <!-- <mat-error *ngIf="!_businessAssetsQuesFrom.controls['business_pd_visited_remark'].valid">Remarks Required</mat-error> -->
<mat-error style="color:red;font-size:12px;margin:0;padding:0;font-weight: normal;float:right" *ngIf="itemrow.controls['business_pd_visited_remark'].errors?.required || itemrow.controls['business_pd_visited_remark'].touched">Remark is Required</mat-error>
</mat-form-field> </mat-form-field>
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none" <div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none"
@ -367,9 +369,10 @@
<textarea matInput formControlName="business_assets_form_remark"></textarea> <textarea matInput formControlName="business_assets_form_remark"></textarea>
</mat-form-field> </mat-form-field>
</mat-card> </mat-card>
<ion-row>
<button ion-button full color="optblue" (click)="onSubmit()"> Save</button>
</ion-row>
</form> </form>
</ion-content> </ion-content>
<ion-footer>
<button ion-button full color="optblue" (click)="onSubmit()"> Save</button>
</ion-footer>

View File

@ -1,4 +1,4 @@
import { Component } from '@angular/core'; import { Component, ViewChild, ElementRef } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular'; import { IonicPage, NavController, NavParams } from 'ionic-angular';
import { AwsServiceProvider } from '../../../../providers/aws-service/aws-service' import { AwsServiceProvider } from '../../../../providers/aws-service/aws-service'
import { FormGroup,FormBuilder,FormArray, Validators} from '@angular/forms'; import { FormGroup,FormBuilder,FormArray, Validators} from '@angular/forms';
@ -61,6 +61,7 @@ export class PdQuestionBusinessAssetsPage {
cityArr: any=[]; cityArr: any=[];
pinArr: any=[]; pinArr: any=[];
m_state_for_address: any=[]; m_state_for_address: any=[];
@ViewChild('remarksFocus') focusRemark:ElementRef
constructor(public navCtrl: NavController, public navParams: NavParams,public aws:AwsServiceProvider,public fb:FormBuilder,public qustcat:QuestionCategoryProvider,public cons:ConstantsProvider,public toast:ToastProvider) { constructor(public navCtrl: NavController, public navParams: NavParams,public aws:AwsServiceProvider,public fb:FormBuilder,public qustcat:QuestionCategoryProvider,public cons:ConstantsProvider,public toast:ToastProvider) {
@ -458,7 +459,7 @@ createBusinessAssetsForAddress(): FormGroup {
loadDetails:boolean loadDetails:boolean
addBusinessAssetsForAddress(data) { addBusinessAssetsForAddress(data) {
console.log("add business")
var result = Object.keys(data).map(function (key) { var result = Object.keys(data).map(function (key) {
return data[key]; return data[key];
}); });
@ -518,6 +519,7 @@ createBusinessAssetsForAddress(): FormGroup {
}) })
if(result.length>0){ if(result.length>0){
console.log("length >0")
result.forEach((datas,index)=>{ result.forEach((datas,index)=>{
this.appxMarketAmtInwords[index]=this.cons.convertNumberToWords(+datas.business_approximate_market_value) this.appxMarketAmtInwords[index]=this.cons.convertNumberToWords(+datas.business_approximate_market_value)
this.RentAmtInwords[index]=this.cons.convertNumberToWords(+datas.business_monthly_rented_amt); this.RentAmtInwords[index]=this.cons.convertNumberToWords(+datas.business_monthly_rented_amt);
@ -667,7 +669,14 @@ createBusinessAssetsForAddress(): FormGroup {
onSubmit(){ onSubmit(){
if(!this._businessAssetsQuesFrom.valid){
this.toast.pdTriggerappmessage("Please Fill the Required Field")
this.focusRemark.nativeElement.focus();
return;
}
var answerData=this._businessAssetsQuesFrom.value; var answerData=this._businessAssetsQuesFrom.value;
//To Remove The "Null" With Key also //To Remove The "Null" With Key also
Object.keys(answerData).forEach((key) => (answerData[key] == null) && delete answerData[key]); Object.keys(answerData).forEach((key) => (answerData[key] == null) && delete answerData[key]);
@ -726,7 +735,15 @@ createBusinessAssetsForAddress(): FormGroup {
setRequiredValidation(value, item, flag,i) { setRequiredValidation(value, item, flag,i) {
if(flag== 11){
if(value == 'yes'){
this._businessAssetsQuesFrom.controls['business_assets_for_address']['controls'][i].controls.business_pd_visited_remark.clearValidators();
}
else if(value == 'no'){
this._businessAssetsQuesFrom.controls['business_assets_for_address']['controls'][i].controls.business_pd_visited_remark.setValidators([Validators.required]);
}
this._businessAssetsQuesFrom.controls['business_assets_for_address']['controls'][i].controls.business_pd_visited_remark.updateValueAndValidity();
}
if (flag == 1) { if (flag == 1) {
if (value == 'yes') { if (value == 'yes') {
console.log("bu",this._businessAssetsQuesFrom.controls); console.log("bu",this._businessAssetsQuesFrom.controls);
@ -829,29 +846,29 @@ createBusinessAssetsForAddress(): FormGroup {
item.controls.business_monthly_rented_amt.updateValueAndValidity(); item.controls.business_monthly_rented_amt.updateValueAndValidity();
item.controls.business_name_of_the_owner.updateValueAndValidity(); item.controls.business_name_of_the_owner.updateValueAndValidity();
} }
if(flag == 8){ // if(flag == 8){
let Avaliablity = 1; // let Avaliablity = 1;
value.forEach(option => { // value.forEach(option => {
if(option.id == 0 && option.group_id == 2){ // if(option.id == 0 && option.group_id == 2){
Avaliablity = option.id; // Avaliablity = option.id;
} // }
}); // });
// isOtherOwner: boolean = false; // this.isOtherOwner = false;
if(Avaliablity == 0){ // if(Avaliablity == 0){
item.controls.business_name_of_the_other_owner.setValidators([Validators.required]); // item.controls.business_name_of_the_other_owner.setValidators([Validators.required]);
this.isOtherOwnerForAddress = true; // this.isOtherOwnerForAddress = true;
}else{ // }else{
item.controls.business_name_of_the_other_owner.setValue(''); // item.controls.business_name_of_the_other_owner.setValue('');
item.controls.business_name_of_the_other_owner.clearValidators(); // item.controls.business_name_of_the_other_owner.clearValidators();
this.isOtherOwnerForAddress = false; // this.isOtherOwnerForAddress = false;
} // }
item.controls.business_name_of_the_other_owner.updateValueAndValidity(); // item.controls.business_name_of_the_other_owner.updateValueAndValidity();
} // }
} }
/** To Convert Month into Year */ /** To Convert Month into Year */

View File

@ -139,9 +139,12 @@
<!-- <ion-buttons > <!-- <ion-buttons >
<ion-button color="optblue" full[disabled]="!pdforms.valid" mat-raised-button style="width:100%" (click)="savepdDetails(pdforms.value)">Save <ion-icon name="md-disc"></ion-icon></ion-button> --> <ion-button color="optblue" full[disabled]="!pdforms.valid" mat-raised-button style="width:100%" (click)="savepdDetails(pdforms.value)">Save <ion-icon name="md-disc"></ion-icon></ion-button> -->
<button ion-button full color="optblue" (click)="savepdBank(bankingForm.value)"> Save</button>
<!-- </ion-buttons> --> <!-- </ion-buttons> -->
</ion-row> </ion-row>
</form> </form>
</ion-content> </ion-content>
<ion-footer>
<button ion-button full color="optblue" (click)="savepdBank(bankingForm.value)"> Save</button>
</ion-footer>

View File

@ -132,7 +132,7 @@
<mat-card> <mat-card>
<mat-card-header>Type of Business Activity</mat-card-header> <mat-card-header>Type of Business Activity</mat-card-header>
<mat-card-content formArrayName="select_business_activity_type"> <mat-card-content formArrayName="select_business_activity_type">
<div *ngFor="let entityType of businessForm.controls.select_business_activity_type['controls']; let i=index" [formGroupName]="i"> <div class ="checkbo" *ngFor="let entityType of businessForm.controls.select_business_activity_type['controls']; let i=index" [formGroupName]="i">
<mat-checkbox color="primary" formControlName="exist_status" (click)="changeBusinessActivity(entityType)" >{{entityType.controls.name.value | titlecase}}</mat-checkbox> <mat-checkbox color="primary" formControlName="exist_status" (click)="changeBusinessActivity(entityType)" >{{entityType.controls.name.value | titlecase}}</mat-checkbox>
@ -162,22 +162,43 @@
</mat-form-field> </mat-form-field>
<ng-container *ngIf="manufacturing.value.india_where_sale_done !=undefined && manufacturing.value.countries_where_export_done ==undefined"> <ng-container *ngIf="manufacturing.value.india_where_sale_done !=undefined && manufacturing.value.countries_where_export_done ==undefined">
<div formArrayName="india_where_sale_done"> <div formArrayName="india_where_sale_done">
<div *ngFor="let saleList of manufacturing.get('india_where_sale_done').controls; let s=index" [formGroupName]="s"> <div *ngFor="let saleList of manufacturing.get('india_where_sale_done').controls; let s=index; let l=last" [formGroupName]="s">
<div *ngIf="manufacturing.value.pan_india_options == 'No'"> <div *ngIf="manufacturing.value.pan_india_options == 'No'">
<mat-form-field> <mat-form-field>
<mat-select placeholder="State" formControlName="state_name"> <mat-select placeholder="State" formControlName="state_name" (selectionChange)="filterCityData(stateList,saleList.value.state_name,s)">
<mat-option *ngFor="let SL of stateList" [value]="SL.state_id">{{SL.state_name}}</mat-option> <mat-option>
<ngx-mat-select-search formControlName="stateSearch" (keyup)="searchFun(saleList,s,'state')"
[placeholderLabel]="'Find State'" [noEntriesFoundLabel]="'No Matching Result'">
<ion-icon name="md-close" ngxMatSelectSearchClear></ion-icon>
</ngx-mat-select-search>
</mat-option>
<mat-option *ngFor="let SL of filteredState | async" [value]="SL.state_id">{{SL.state_name}}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field > <mat-form-field >
<mat-select multiple formControlName="city_name" placeholder="City" required> <mat-select multiple formControlName="city_name" placeholder="City" required >
<mat-option *ngFor="let CL of filterCity(stateList,saleList.value.state_name)" [value]="CL.city_id">{{CL.city_name}}</mat-option> <mat-option>
<ngx-mat-select-search formControlName="citySearch" (keyup)="searchFun(saleList,s,'city')"
[placeholderLabel]="'Find City'"
[noEntriesFoundLabel]="'No Matching Result'">
<ion-icon name="md-close" ngxMatSelectSearchClear></ion-icon>
</ngx-mat-select-search>
</mat-option>
<!-- <mat-option *ngFor="let CL of filterCity(stateList,saleList.value.state_name,'')" [value]="CL.city_id">{{CL.city_name}}</mat-option> -->
<mat-option *ngFor="let Cl of cityDataValue[s] " [value]="Cl.city_id">{{Cl.city_name}}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<button *ngIf="s>0" float-right ion-button clear (click)="removeState(i,s,'1')" ><ion-icon style="font-size:22px" color="optblue" name="md-trash"></ion-icon></button><br/> <ion-buttons end>
<ion-col col-3 offset-3 *ngIf="s>0">
<button ion-button clear (click)="removeState(i,s,'1')" ><ion-icon style="font-size:22px" color="optblue" name="md-trash"></ion-icon></button>
</ion-col>
<ion-col col-2 offset-1 *ngIf="l">
<button *ngIf="manufacturing.value.pan_india_options == 'No'" ion-button color="optblue" (click)="addMoreState(i,1)">Add More State</button>
</ion-col>
</ion-buttons>
</div> </div>
</div> </div>
<br/> <button *ngIf="manufacturing.value.pan_india_options == 'No'" float-right ion-button color="optblue" (click)="addMoreState(i,1)">Add More State</button>
</div> </div>
<div *ngIf="manufacturing.value.max_sale_state_name !=undefined" formArrayName="max_sale_state_name"> <div *ngIf="manufacturing.value.max_sale_state_name !=undefined" formArrayName="max_sale_state_name">
<div *ngFor="let maxStateList of manufacturing.get('max_sale_state_name').controls; let mx = index" [formGroupName]="mx"> <div *ngFor="let maxStateList of manufacturing.get('max_sale_state_name').controls; let mx = index" [formGroupName]="mx">
@ -202,7 +223,7 @@
</ng-container> </ng-container>
<ng-container *ngIf="manufacturing.value.countries_where_export_done !=undefined && manufacturing.value.india_where_sale_done ==undefined"> <ng-container *ngIf="manufacturing.value.countries_where_export_done !=undefined && manufacturing.value.india_where_sale_done ==undefined">
<div formArrayName="countries_where_export_done"> <div formArrayName="countries_where_export_done">
<div *ngFor="let countryList of manufacturing.get('countries_where_export_done').controls; let c = index" [formGroupName]="c"> <div *ngFor="let countryList of manufacturing.get('countries_where_export_done').controls; let c = index; let l=last" [formGroupName]="c">
<mat-form-field> <mat-form-field>
<mat-label>Countries Where The Export Is Being Done for {{manufacturing.value.main_products}}</mat-label> <mat-label>Countries Where The Export Is Being Done for {{manufacturing.value.main_products}}</mat-label>
@ -216,9 +237,16 @@
<input type="number" matInput [placeholder]="countryList.get('country_name').value == '' ? 'Out of Total Export Sales what % of Sales is done in' : getPlaceHolderName(countryList.get('country_name').value)" <input type="number" matInput [placeholder]="countryList.get('country_name').value == '' ? 'Out of Total Export Sales what % of Sales is done in' : getPlaceHolderName(countryList.get('country_name').value)"
formControlName="approx_sale" required> formControlName="approx_sale" required>
</mat-form-field> </mat-form-field>
<button *ngIf="c>0" float-right ion-button clear (click)="removeState(i,c,'2')" ><ion-icon style="font-size:22px" color="optblue" name="md-trash"></ion-icon></button> <ion-buttons end>
<ion-col col-3 offset-3>
<button *ngIf="c>0" ion-button clear (click)="removeState(i,c,'2')" ><ion-icon style="font-size:22px" color="optblue" name="md-trash"></ion-icon></button>
</ion-col>
<ion-col col-2 offset-1 *ngIf="l">
<button ion-button color="optblue" (click)="addMoreState(i,2)">Add More</button>
</ion-col>
</ion-buttons>
</div> </div>
<button float-right ion-button color="optblue" (click)="addMoreState(i,2)">Add More Country</button>
</div> </div>
</ng-container> </ng-container>
<ng-container *ngIf="manufacturing.value.countries_where_export_done !=undefined && manufacturing.value.india_where_sale_done !=undefined"> <ng-container *ngIf="manufacturing.value.countries_where_export_done !=undefined && manufacturing.value.india_where_sale_done !=undefined">
@ -232,25 +260,46 @@
</mat-form-field> </mat-form-field>
</div> </div>
<div formArrayName="india_where_sale_done"> <div formArrayName="india_where_sale_done">
<div *ngFor="let saleList of manufacturing.get('india_where_sale_done').controls; let s = index" [formGroupName]="s"> <div *ngFor="let saleList of manufacturing.get('india_where_sale_done').controls; let s = index;let l=last" [formGroupName]="s">
<mat-form-field style="width:34%;"> <mat-form-field style="width:34%;">
<mat-select placeholder="State" formControlName="state_name" required> <mat-select placeholder="State" formControlName="state_name" required (selectionChange)="filterCityData(stateList,saleList.value.state_name,s)">
<mat-option *ngFor="let SL of stateList" [value]="SL.state_id"> <mat-option>
<ngx-mat-select-search formControlName="stateSearch" (keyup)="searchFun(saleList,s,'state')"
[placeholderLabel]="'Find State'" [noEntriesFoundLabel]="'No Matching Result'">
<ion-icon name="md-close" ngxMatSelectSearchClear></ion-icon>
</ngx-mat-select-search>
</mat-option>
<mat-option *ngFor="let SL of filteredState | async" [value]="SL.state_id">
{{SL.state_name}} {{SL.state_name}}
</mat-option> </mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field style="width:45%;"> <mat-form-field style="width:45%;">
<mat-select multiple formControlName="city_name" placeholder="City" required> <mat-select multiple formControlName="city_name" placeholder="City" required>
<mat-option *ngFor="let CL of filterCity(stateList,saleList.value.state_name)" [value]="CL.city_id">{{CL.city_name}}</mat-option> <mat-option>
<ngx-mat-select-search formControlName="citySearch" (keyup)="searchFun(saleList,s,'city')"
[placeholderLabel]="'Find City'"
[noEntriesFoundLabel]="'No Matching Result'">
<ion-icon name="md-close" ngxMatSelectSearchClear></ion-icon>
</ngx-mat-select-search>
</mat-option>
<!-- <mat-option *ngFor="let CL of filterCity(stateList,saleList.value.state_name)" [value]="CL.city_id">{{CL.city_name}}</mat-option> -->
<mat-option *ngFor="let CL of cityDataValue[s]" [value]="CL.city_id">{{CL.city_name}}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<button float-right ion-button clear (click)="removeState(i,s,'1')" ><ion-icon style="font-size:22px" color="optblue" name="md-trash"></ion-icon></button> <ion-buttons end>
<ion-col col-3 offset-3 *ngIf="s>0">
<button ion-button clear (click)="removeState(i,s,'1')" ><ion-icon style="font-size:22px" color="optblue" name="md-trash"></ion-icon></button>
</ion-col>
<ion-col col-2 offset-1 *ngIf="l">
<button *ngIf="manufacturing.get('india_where_sale_done').value.length>0" ion-button color="optblue" (click)="addMoreState(i,1)">Add More State</button>
</ion-col>
</ion-buttons>
</div> </div>
<div *ngIf="manufacturing.get('india_where_sale_done').value.length>0">
<button float-right ion-button color="optblue" (click)="addMoreState(i,1)">Add More State</button>
</div>
</div> </div>
@ -278,7 +327,7 @@
</div> </div>
<p>Export</p> <p>Export</p>
<div formArrayName="countries_where_export_done"> <div formArrayName="countries_where_export_done">
<div *ngFor="let countryList of manufacturing.get('countries_where_export_done').controls; let c = index" [formGroupName]="c"> <div *ngFor="let countryList of manufacturing.get('countries_where_export_done').controls; let c = index; let l=last" [formGroupName]="c">
<mat-form-field > <mat-form-field >
<mat-label>Countries Where The Export Is Being Done for {{manufacturing.value.main_products}}</mat-label> <mat-label>Countries Where The Export Is Being Done for {{manufacturing.value.main_products}}</mat-label>
<mat-select placeholder="Countries" formControlName="country_name"> <mat-select placeholder="Countries" formControlName="country_name">
@ -291,17 +340,19 @@
<input matInput [placeholder]="countryList.get('country_name').value == '' ? 'Out of Total Export Sales what % of Sales is done in' : getPlaceHolderName(countryList.get('country_name').value)" <input matInput [placeholder]="countryList.get('country_name').value == '' ? 'Out of Total Export Sales what % of Sales is done in' : getPlaceHolderName(countryList.get('country_name').value)"
formControlName="approx_sale" required> formControlName="approx_sale" required>
</mat-form-field> </mat-form-field>
<ion-buttons end>
<ion-col col-3 offset-3 *ngIf="c>0">
<button float-right ion-button clear (click)="removeState(i,mx,'2')" ><ion-icon style="font-size:22px" color="optblue" name="md-trash"></ion-icon></button> <button ion-button clear (click)="removeState(i,mx,'2')" ><ion-icon style="font-size:22px" color="optblue" name="md-trash"></ion-icon></button>
</ion-col>
<ion-col col-2 offset-1 *ngIf="l">
<button ion-button color="optblue" (click)="addMoreState(i,2)">Add More</button>
</ion-col>
</ion-buttons>
</div> </div>
</div> </div>
<div fxLayout="row" class="tab_class"> <!-- <div fxLayout="row" class="tab_class">
<button float-right ion-button color="optblue" (click)="addMoreState(i,2)">Add More Country</button>
</div> </div> -->
</ng-container> </ng-container>
@ -310,11 +361,12 @@
<textarea matInput placeholder="Description" formControlName="description"></textarea> <textarea matInput placeholder="Description" formControlName="description"></textarea>
</mat-form-field> </mat-form-field>
<ion-buttons end> <ion-buttons end>
<ion-col col-3 offset-3> <ion-col col-3 offset-3 >
<button ion-button clear color="optblue" (click)="removeManufacturing(i)"><ion-icon style="font-size: 22px;" name="md-trash"></ion-icon></button> <button ion-button clear color="optblue" (click)="removeManufacturing(i)"><ion-icon style="font-size: 22px;" name="md-trash"></ion-icon></button>
</ion-col> </ion-col>
<ion-col *ngIf="l" col-2 offset-1> <ion-col col-2 offset-1 *ngIf="l" >
<button float-right ion-button clear (click)="addMoreManufacturing()" ><ion-icon style="font-size:24px" color="optblue" name="add-circle"></ion-icon></button><br/> <!-- <button float-right ion-button clear (click)="addMoreManufacturing()" ><ion-icon style="font-size:24px" color="optblue" name="add-circle"></ion-icon></button><br/> -->
<button ion-button color="optblue" round (click)="addMoreManufacturing()">Add Material</button>
</ion-col> </ion-col>
</ion-buttons> </ion-buttons>
@ -354,28 +406,47 @@
<ng-container *ngIf="retail.value.india_where_sale_done !=undefined && retail.value.countries_where_export_done ==undefined"> <ng-container *ngIf="retail.value.india_where_sale_done !=undefined && retail.value.countries_where_export_done ==undefined">
<div formArrayName="india_where_sale_done"> <div formArrayName="india_where_sale_done">
<div class="state-margin" *ngFor="let saleList of retail.get('india_where_sale_done').controls; let s = index" [formGroupName]="s"> <div class="state-margin" *ngFor="let saleList of retail.get('india_where_sale_done').controls; let s = index; let l= last" [formGroupName]="s">
<mat-form-field > <mat-form-field >
<mat-select placeholder="State" formControlName="state_name" required> <mat-select placeholder="State" formControlName="state_name" required (selectionChange)="filterCityData(stateList,saleList.value.state_name,s)">
<mat-option *ngFor="let SL of stateList" [value]="SL.state_id"> <mat-option>
<ngx-mat-select-search formControlName="stateSearch" (keyup)="searchFun(saleList,s,'state')"
[placeholderLabel]="'Find state'"
[noEntriesFoundLabel]="'No Matching Result'" >
<ion-icon name="md-close" ngxMatSelectSearchClear></ion-icon>
</ngx-mat-select-search>
</mat-option>
<mat-option *ngFor="let SL of filteredState | async" [value]="SL.state_id">
{{SL.state_name}} {{SL.state_name}}
</mat-option> </mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field>
<mat-select multiple formControlName="city_name" placeholder="City" required> <mat-select multiple formControlName="city_name" placeholder="City" required>
<mat-option *ngFor="let CL of filterCity(stateList,saleList.value.state_name)" [value]="CL.city_id">{{CL.city_name}}</mat-option> <mat-option>
<ngx-mat-select-search formControlName="citySearch" (keyup)="searchFun(saleList,s,'city')"
[placeholderLabel]="'Find City'"
[noEntriesFoundLabel]="'No Matching Result'">
<ion-icon name="md-close" ngxMatSelectSearchClear></ion-icon>
</ngx-mat-select-search>
</mat-option>
<mat-option *ngFor="let CL of cityDataValue[s]" [value]="CL.city_id">{{CL.city_name}}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<ion-buttons end>
<ion-col col-3 offset-3 *ngIf="s>0">
<button ion-button color="optblue" (click)="removeRetailState(r,s,'1')" ><ion-icon name="md-trash"></ion-icon></button>
<button ion-button float-right color="optblue" (click)="removeRetailState(r,s,'1')" *ngIf="s>0"><ion-icon name="md-trash"></ion-icon></button> </ion-col>
</div> <ion-col col-2 offset-1 *ngIf="retail.value.pan_india_options=='No' && l">
<div class="tab_class" *ngIf="retail.value.pan_india_options=='No'"> <button ion-button color="optblue" (click)="addRetailMoreState(r,'1')">Add More</button>
<button ion-button float-right color="optblue" (click)="addRetailMoreState(r,'1')">Add More Country</button> </ion-col>
</div> </ion-buttons>
</div>
<!-- <div class="tab_class" *ngIf="retail.value.pan_india_options=='No'">
</div> -->
</div> </div>
<div *ngIf="retail.value.max_sale_state_name !=undefined" formArrayName="max_sale_state_name"> <div *ngIf="retail.value.max_sale_state_name !=undefined" formArrayName="max_sale_state_name">
<div class="tab_class" *ngFor="let maxStateList of retail.get('max_sale_state_name').controls; let mx = index" [formGroupName]="mx"> <div class="tab_class" *ngFor="let maxStateList of retail.get('max_sale_state_name').controls; let mx = index" [formGroupName]="mx">
@ -402,7 +473,7 @@
</ng-container> </ng-container>
<ng-container *ngIf="retail.value.india_where_sale_done ==undefined && retail.value.countries_where_export_done !=undefined"> <ng-container *ngIf="retail.value.india_where_sale_done ==undefined && retail.value.countries_where_export_done !=undefined">
<div formArrayName="countries_where_export_done"> <div formArrayName="countries_where_export_done">
<div fxLayout="row nowrap" *ngFor="let countryList of retail.get('countries_where_export_done').controls; let c = index" [formGroupName]="c"> <div fxLayout="row nowrap" *ngFor="let countryList of retail.get('countries_where_export_done').controls; let c = index let l=last" [formGroupName]="c">
<mat-form-field > <mat-form-field >
<mat-label>Countries Where Export Is Being Done for {{retail.value.main_products}}</mat-label> <mat-label>Countries Where Export Is Being Done for {{retail.value.main_products}}</mat-label>
@ -418,10 +489,16 @@
<input matInput [placeholder]="countryList.get('country_name').value == '' ? 'Out of Total Export Sales what % of Sales is done in' : getPlaceHolderName(countryList.get('country_name').value)" <input matInput [placeholder]="countryList.get('country_name').value == '' ? 'Out of Total Export Sales what % of Sales is done in' : getPlaceHolderName(countryList.get('country_name').value)"
formControlName="approx_sale" required> formControlName="approx_sale" required>
</mat-form-field> </mat-form-field>
<ion-buttons end>
<button ion-button float-right color="optblue" (click)="removeRetailState(r,c,'2')" *ngIf="c>0"><ion-icon name="md-trash"></ion-icon></button> <ion-col col-3 offset-3 *ngIf="c>0">
<button ion-button color="optblue" (click)="removeRetailState(r,c,'2')"><ion-icon name="md-trash"></ion-icon></button>
</ion-col>
<ion-col *ngIf="l">
<button ion-button color="optblue" (click)="addRetailMoreState(r,'2')">Add More</button>
</ion-col>
</ion-buttons>
</div> </div>
<button ion-button float-right color="optblue" (click)="addRetailMoreState(r,'2')">Add More Country</button>
</div> </div>
</ng-container> </ng-container>
@ -437,26 +514,45 @@
</mat-form-field> </mat-form-field>
</div> </div>
<div formArrayName="india_where_sale_done"> <div formArrayName="india_where_sale_done">
<div class="state-margin" *ngFor="let saleList of retail.get('india_where_sale_done').controls; let s = index" [formGroupName]="s"> <div class="state-margin" *ngFor="let saleList of retail.get('india_where_sale_done').controls; let s = index;let l= last" [formGroupName]="s">
<mat-form-field > <mat-form-field >
<mat-select placeholder="State" formControlName="state_name" required> <mat-select placeholder="State" formControlName="state_name" required (selectionChange)="filterCityData(stateList,saleList.value.state_name,s)">
<mat-option *ngFor="let SL of stateList" [value]="SL.state_id"> <mat-option>
<ngx-mat-select-search formControlName="stateSearch" (keyup)="searchFun(saleList,s,'state')"
[placeholderLabel]="'Find City'"
[noEntriesFoundLabel]="'No Matching Result'" >
<ion-icon name="md-close" ngxMatSelectSearchClear></ion-icon>
</ngx-mat-select-search>
</mat-option>
<mat-option *ngFor="let SL of filteredState | async" [value]="SL.state_id">
{{SL.state_name}} {{SL.state_name}}
</mat-option> </mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field > <mat-form-field >
<mat-select multiple formControlName="city_name" placeholder="City" required> <mat-select multiple formControlName="city_name" placeholder="City" required>
<mat-option *ngFor="let CL of filterCity(stateList,saleList.value.state_name)" [value]="CL.city_id">{{CL.city_name}}</mat-option> <mat-option>
<ngx-mat-select-search formControlName="citySearch" (keyup)="searchFun(saleList,s,'city')"
[placeholderLabel]="'Find City'"
[noEntriesFoundLabel]="'No Matching Result'">
<ion-icon name="md-close" ngxMatSelectSearchClear></ion-icon>
</ngx-mat-select-search>
</mat-option>
<mat-option *ngFor="let CL of cityDataValue[s]" [value]="CL.city_id">{{CL.city_name}}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<ion-buttons end>
<ion-col col-3 offset-3 *ngIf="s>0">
<button float-right ion-button clear color="optblue" (click)="removeRetailState(r,s,'1')" *ngIf="s>0"><ion-icon name="md-trash"></ion-icon></button> <button ion-button clear color="optblue" (click)="removeRetailState(r,s,'1')" ><ion-icon name="md-trash"></ion-icon></button>
</ion-col>
<ion-col col-2 offset-1 *ngIf="l">
<button ion-button color="optblue" (click)="addRetailMoreState(r,'1')">Add More State</button>
</ion-col>
</ion-buttons>
</div> </div>
<div *ngIf="retail.get('india_where_sale_done').value.length>0"> <div *ngIf="retail.get('india_where_sale_done').value.length>0">
<button float-right ion-button color="optblue" (click)="addRetailMoreState(r,'1')">Add More State</button>
</div> </div>
</div> </div>
<div formArrayName="max_sale_state_name"> <div formArrayName="max_sale_state_name">
@ -482,7 +578,7 @@
</div> </div>
<p>Export</p> <p>Export</p>
<div formArrayName="countries_where_export_done"> <div formArrayName="countries_where_export_done">
<div *ngFor="let countryList of retail.get('countries_where_export_done').controls; let c = index" [formGroupName]="c"> <div *ngFor="let countryList of retail.get('countries_where_export_done').controls; let c = index; let l=last" [formGroupName]="c">
<mat-form-field > <mat-form-field >
<mat-label>Countries Where The Export Is Being Done for {{retail.value.main_products}}</mat-label> <mat-label>Countries Where The Export Is Being Done for {{retail.value.main_products}}</mat-label>
@ -496,15 +592,21 @@
<input matInput [placeholder]="countryList.get('country_name').value == '' ? 'Out of Total Export Sales what % of Sales is done in' : getPlaceHolderName(countryList.get('country_name').value)" <input matInput [placeholder]="countryList.get('country_name').value == '' ? 'Out of Total Export Sales what % of Sales is done in' : getPlaceHolderName(countryList.get('country_name').value)"
formControlName="approx_sale" required> formControlName="approx_sale" required>
</mat-form-field> </mat-form-field>
<ion-buttons end>
<ion-col col-3 offset-3 *ngIf="c>0">
<button float-right ion-button clear (click)="removeRetailState(r,c,'2')" *ngIf="c>0"><ion-icon name="md-trash"></ion-icon></button> <button ion-button clear (click)="removeRetailState(r,c,'2')" ><ion-icon name="md-trash"></ion-icon></button>
</ion-col>
<ion-col col-2 offset-1 *ngIf="l">
<button ion-button color="optblue" (click)="addRetailMoreState(r,'2')">Add More</button>
</ion-col>
</ion-buttons>
</div> </div>
</div> </div>
<button float-right ion-button color="optblue" (click)="addRetailMoreState(r,'2')">Add More Country </button>
</ng-container> </ng-container>
<mat-form-field > <mat-form-field >
@ -517,7 +619,8 @@
<button ion-button clear color="optblue" (click)="removeRetail(r)"><ion-icon style="font-size: 22px;" name="md-trash"></ion-icon></button> <button ion-button clear color="optblue" (click)="removeRetail(r)"><ion-icon style="font-size: 22px;" name="md-trash"></ion-icon></button>
</ion-col> </ion-col>
<ion-col *ngIf="l" col-2 offset-1> <ion-col *ngIf="l" col-2 offset-1>
<button float-right ion-button clear (click)="addMoreRetail()" ><ion-icon style="font-size:24px" color="optblue" name="add-circle"></ion-icon></button><br/> <!-- <button float-right ion-button clear (click)="addMoreRetail()" ><ion-icon style="font-size:24px" color="optblue" name="add-circle"></ion-icon></button><br/> -->
<button ion-button color="optblue" round (click)="addMoreRetail()">Add Product</button>
</ion-col> </ion-col>
</ion-buttons> </ion-buttons>
@ -556,27 +659,46 @@
</mat-form-field> </mat-form-field>
<ng-container *ngIf="wholesale.value.india_where_sale_done !=undefined && wholesale.value.countries_where_export_done ==undefined"> <ng-container *ngIf="wholesale.value.india_where_sale_done !=undefined && wholesale.value.countries_where_export_done ==undefined">
<div formArrayName="india_where_sale_done"> <div formArrayName="india_where_sale_done">
<div class="state-margin" fxLayout="row nowrap" *ngFor="let saleList of wholesale.get('india_where_sale_done').controls; let s = index" [formGroupName]="s"> <div class="state-margin" fxLayout="row nowrap" *ngFor="let saleList of wholesale.get('india_where_sale_done').controls; let s = index; let l=last" [formGroupName]="s">
<mat-form-field > <mat-form-field >
<mat-select placeholder="State" formControlName="state_name" required> <mat-select placeholder="State" formControlName="state_name" required (selectionChange)="filterCityData(stateList,saleList.value.state_name,s)">
<mat-option *ngFor="let SL of stateList" [value]="SL.state_id"> <mat-option>
<ngx-mat-select-search formControlName="stateSearch" (keyup)="searchFun(saleList,s,'state')"
[placeholderLabel]="'Find City'"
[noEntriesFoundLabel]="'No Matching Result'" >
<ion-icon name="md-close" ngxMatSelectSearchClear></ion-icon>
</ngx-mat-select-search>
</mat-option>
<mat-option *ngFor="let SL of filteredState | async" [value]="SL.state_id">
{{SL.state_name}} {{SL.state_name}}
</mat-option> </mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field > <mat-form-field >
<mat-select multiple formControlName="city_name" placeholder="City" required> <mat-select multiple formControlName="city_name" placeholder="City" required>
<mat-option *ngFor="let CL of filterCity(stateList,saleList.value.state_name)" [value]="CL.city_id">{{CL.city_name}}</mat-option> <mat-option>
<ngx-mat-select-search formControlName="citySearch" (keyup)="searchFun(saleList,s,'city')"
[placeholderLabel]="'Find City'"
[noEntriesFoundLabel]="'No Matching Result'">
<ion-icon name="md-close" ngxMatSelectSearchClear></ion-icon>
</ngx-mat-select-search>
</mat-option>
<mat-option *ngFor="let CL of cityDataValue[s]" [value]="CL.city_id">{{CL.city_name}}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<ion-buttons end>
<ion-col col-3 offset-3 *ngIf="s>0">
<button ion-button float-right color="optblue" clear (click)="removeWholesaleState(w,s,'1')" *ngIf="s>0"><ion-icon name="md-trash"></ion-icon></button> <button ion-button color="optblue" clear (click)="removeWholesaleState(w,s,'1')" ><ion-icon name="md-trash"></ion-icon></button>
</ion-col>
<ion-col col-2 offset-1 *ngIf="l">
<button ion-button color="optblue" (click)="addWholesaleMoreState(w,'1')" >Add More State</button>
</ion-col>
</ion-buttons>
</div> </div>
<div fxLayout="row" *ngIf="wholesale.value.pan_india_options=='No'"> <div fxLayout="row" *ngIf="wholesale.value.pan_india_options=='No'">
<button ion-button float-right color="optblue" (click)="addWholesaleMoreState(w,'1')" >Add More State</button>
</div> </div>
</div> </div>
<div *ngIf="wholesale.value.max_sale_state_name !=undefined" formArrayName="max_sale_state_name"> <div *ngIf="wholesale.value.max_sale_state_name !=undefined" formArrayName="max_sale_state_name">
@ -605,7 +727,7 @@
<ng-container *ngIf="wholesale.value.india_where_sale_done ==undefined && wholesale.value.countries_where_export_done !=undefined"> <ng-container *ngIf="wholesale.value.india_where_sale_done ==undefined && wholesale.value.countries_where_export_done !=undefined">
<div formArrayName="countries_where_export_done"> <div formArrayName="countries_where_export_done">
<div fxLayout="row nowrap" *ngFor="let countryList of wholesale.get('countries_where_export_done').controls; let c = index" [formGroupName]="c"> <div fxLayout="row nowrap" *ngFor="let countryList of wholesale.get('countries_where_export_done').controls; let c = index; let l=last" [formGroupName]="c">
<mat-form-field > <mat-form-field >
<mat-label>Countries Where The Export Is Being Done for {{wholesale.value.main_products}}</mat-label> <mat-label>Countries Where The Export Is Being Done for {{wholesale.value.main_products}}</mat-label>
@ -619,11 +741,18 @@
<input matInput [placeholder]="countryList.get('country_name').value == '' ? 'Out of Total Export Sales what % of Sales is done in' : getPlaceHolderName(countryList.get('country_name').value)" <input matInput [placeholder]="countryList.get('country_name').value == '' ? 'Out of Total Export Sales what % of Sales is done in' : getPlaceHolderName(countryList.get('country_name').value)"
formControlName="approx_sale" required> formControlName="approx_sale" required>
</mat-form-field> </mat-form-field>
<ion-buttons end>
<button ion-button float-right color="optblue" clear (click)="removeWholesaleState(w,c,'2')" *ngIf="c>0"><ion-icon name="md-trash"></ion-icon></button> <ion-col col-3 offset-3 *ngIf="c>0">
<button ion-button color="optblue" clear (click)="removeWholesaleState(w,c,'2')" ><ion-icon name="md-trash"></ion-icon></button>
</ion-col>
<ion-col col-2 offset-1 *ngIf="l">
<button ion-button color="optblue" (click)="addWholesaleMoreState(w,'2')" >Add More</button>
</ion-col>
</ion-buttons>
</div> </div>
<button ion-button float-right color="optblue" (click)="addWholesaleMoreState(w,'2')" >Add More Country</button>
</div> </div>
</ng-container> </ng-container>
@ -640,15 +769,29 @@
<div formArrayName="india_where_sale_done"> <div formArrayName="india_where_sale_done">
<div fxLayout="row nowrap" class="state-margin" *ngFor="let saleList of wholesale.get('india_where_sale_done').controls; let s = index" [formGroupName]="s"> <div fxLayout="row nowrap" class="state-margin" *ngFor="let saleList of wholesale.get('india_where_sale_done').controls; let s = index" [formGroupName]="s">
<mat-form-field> <mat-form-field>
<mat-select placeholder="State" formControlName="state_name" required> <mat-select placeholder="State" formControlName="state_name" required (selectionChange)="filterCityData(stateList,saleList.value.state_name,s)">
<mat-option *ngFor="let SL of stateList" [value]="SL.state_id"> <mat-option>
<ngx-mat-select-search formControlName="stateSearch" (keyup)="searchFun(saleList,s,'state')"
[placeholderLabel]="'Find State'"
[noEntriesFoundLabel]="'No Matching Result'" >
<ion-icon name="md-close" ngxMatSelectSearchClear></ion-icon>
</ngx-mat-select-search>
</mat-option>
<mat-option *ngFor="let SL of filteredState | async" [value]="SL.state_id">
{{SL.state_name}} {{SL.state_name}}
</mat-option> </mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field style="width:85%;"> <mat-form-field style="width:85%;">
<mat-select multiple formControlName="city_name" placeholder="City" required> <mat-select multiple formControlName="city_name" placeholder="City" required >
<mat-option *ngFor="let CL of filterCity(stateList,saleList.value.state_name)" [value]="CL.city_id">{{CL.city_name}}</mat-option> <mat-option>
<ngx-mat-select-search formControlName="citySearch" (keyup)="searchFun(saleList,s,'city')"
[placeholderLabel]="'Find City'"
[noEntriesFoundLabel]="'No Matching Result'">
<ion-icon name="md-close" ngxMatSelectSearchClear></ion-icon>
</ngx-mat-select-search>
</mat-option>
<mat-option *ngFor="let CL of cityDataValue[s]" [value]="CL.city_id">{{CL.city_name}}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
@ -724,7 +867,8 @@
<button ion-button clear color="optblue" (click)="removeWholesale(w)"><ion-icon style="font-size: 22px;" name="md-trash"></ion-icon></button> <button ion-button clear color="optblue" (click)="removeWholesale(w)"><ion-icon style="font-size: 22px;" name="md-trash"></ion-icon></button>
</ion-col> </ion-col>
<ion-col *ngIf="l" col-2 offset-1> <ion-col *ngIf="l" col-2 offset-1>
<button float-right ion-button clear (click)="addMoreWholesale()" ><ion-icon style="font-size:24px" color="optblue" name="add-circle"></ion-icon></button><br/> <!-- <button float-right ion-button clear (click)="addMoreWholesale()" ><ion-icon style="font-size:24px" color="optblue" name="add-circle"></ion-icon></button><br/> -->
<button ion-button color="optblue" round (click)="addMoreWholesale()">Add Product</button>
</ion-col> </ion-col>
</ion-buttons> </ion-buttons>
@ -762,25 +906,46 @@
<ng-container *ngIf="serviceprovider.value.india_where_sale_done !=undefined && serviceprovider.value.countries_where_export_done ==undefined"> <ng-container *ngIf="serviceprovider.value.india_where_sale_done !=undefined && serviceprovider.value.countries_where_export_done ==undefined">
<div formArrayName="india_where_sale_done"> <div formArrayName="india_where_sale_done">
<div class="state-margin" *ngFor="let saleList of serviceprovider.get('india_where_sale_done').controls; let s = index" [formGroupName]="s"> <div class="state-margin" *ngFor="let saleList of serviceprovider.get('india_where_sale_done').controls; let s = index; let l=last" [formGroupName]="s">
<mat-form-field > <mat-form-field >
<mat-select placeholder="Where, In India, Is The Service Provided" formControlName="state_name" required> <mat-select placeholder="Where, In India, Is The Service Provided" formControlName="state_name" required (selectionChange)="filterCityData(stateList,saleList.value.state_name,s)">
<mat-option *ngFor="let SL of stateList" [value]="SL.state_id"> <mat-option>
<ngx-mat-select-search formControlName="stateSearch" (keyup)="searchFun(saleList,s,'state')"
[placeholderLabel]="'Find State'"
[noEntriesFoundLabel]="'No Matching Result'" >
<ion-icon name="md-close" ngxMatSelectSearchClear></ion-icon>
</ngx-mat-select-search>
</mat-option>
<mat-option *ngFor="let SL of filteredState | async" [value]="SL.state_id">
{{SL.state_name}} {{SL.state_name}}
</mat-option> </mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field > <mat-form-field >
<mat-select multiple formControlName="city_name" placeholder="City" required> <mat-select multiple formControlName="city_name" placeholder="City" required>
<mat-option *ngFor="let CL of filterCity(stateList,saleList.value.state_name)" [value]="CL.city_id">{{CL.city_name}}</mat-option> <mat-option>
<ngx-mat-select-search formControlName="citySearch" (keyup)="searchFun(saleList,s,'city')"
[placeholderLabel]="'Find City'"
[noEntriesFoundLabel]="'No Matching Result'">
<ion-icon name="md-close" ngxMatSelectSearchClear></ion-icon>
</ngx-mat-select-search>
</mat-option>
<mat-option *ngFor="let CL of cityDataValue[s]" [value]="CL.city_id">{{CL.city_name}}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<button ion-button clear float-right color="optblue" (click)="removeServiceState(sp,s,'1')" *ngIf="s>0"><ion-icon name="md-trash"></ion-icon></button> <ion-buttons end>
<ion-col col-3 offset-3 *ngIf="s>0">
<button ion-button clear color="optblue" (click)="removeServiceState(sp,s,'1')" ><ion-icon name="md-trash"></ion-icon></button>
</ion-col>
<ion-col col-2 offset-1 *ngIf="serviceprovider.value.pan_india_options=='No' && l">
<button ion-button color="optblue" (click)="addServiceMoreState(sp,1)">Add More State</button>
</ion-col>
</ion-buttons>
</div> </div>
<div fxLayout="row" *ngIf="serviceprovider.value.pan_india_options=='No'"> <div fxLayout="row" >
<button ion-button color="optblue" float-right (click)="addServiceMoreState(sp,1)">Add More State</button>
</div> </div>
</div> </div>
<div *ngIf="serviceprovider.value.max_sale_state_name !=undefined" formArrayName="max_sale_state_name"> <div *ngIf="serviceprovider.value.max_sale_state_name !=undefined" formArrayName="max_sale_state_name">
@ -809,7 +974,7 @@
<ng-container *ngIf="serviceprovider.value.countries_where_export_done !=undefined && serviceprovider.value.india_where_sale_done ==undefined"> <ng-container *ngIf="serviceprovider.value.countries_where_export_done !=undefined && serviceprovider.value.india_where_sale_done ==undefined">
<div formArrayName="countries_where_export_done"> <div formArrayName="countries_where_export_done">
<div fxLayout="row nowrap" *ngFor="let countryList of serviceprovider.get('countries_where_export_done').controls; let c = index" [formGroupName]="c"> <div fxLayout="row nowrap" *ngFor="let countryList of serviceprovider.get('countries_where_export_done').controls; let c = index; let l=last" [formGroupName]="c">
<mat-form-field style="width:55%;"> <mat-form-field style="width:55%;">
<mat-label>Countries Where The Export Is Being Done for {{serviceprovider.value.main_products}}</mat-label> <mat-label>Countries Where The Export Is Being Done for {{serviceprovider.value.main_products}}</mat-label>
@ -823,13 +988,19 @@
<input matInput [placeholder]="countryList.get('country_name').value == '' ? 'Out of Total Export Sales what % of Sales is done in' : getPlaceHolderName(countryList.get('country_name').value)" <input matInput [placeholder]="countryList.get('country_name').value == '' ? 'Out of Total Export Sales what % of Sales is done in' : getPlaceHolderName(countryList.get('country_name').value)"
formControlName="approx_sale" required> formControlName="approx_sale" required>
</mat-form-field> </mat-form-field>
<ion-buttons end>
<button ion-button color="optblue" float-right clear (click)="removeServiceState(sp,c,'2')" *ngIf="c>0"><ion-icon name="md-trash"></ion-icon></button> <ion-col col-3 offset-3 *ngIf="c>0">
<button ion-button color="optblue" clear (click)="removeServiceState(sp,c,'2')" ><ion-icon name="md-trash"></ion-icon></button>
</ion-col>
<ion-col col-2 offset-1 *ngIf="l">
<button ion-button color="optblue" (click)="addServiceMoreState(sp,'2')">Add More</button>
</ion-col>
</ion-buttons>
</div> </div>
</div> </div>
<div fxLayout="row" class="tab_class"> <div fxLayout="row" class="tab_class">
<button ion-button color="optblue" float-right (click)="addServiceMoreState(sp,'2')">Add More Country</button>
</div> </div>
</ng-container> </ng-container>
@ -845,25 +1016,46 @@
</mat-form-field> </mat-form-field>
</div> </div>
<div formArrayName="india_where_sale_done"> <div formArrayName="india_where_sale_done">
<div fxLayout="row nowrap" class="state-margin" *ngFor="let saleList of serviceprovider.get('india_where_sale_done').controls; let s = index" [formGroupName]="s"> <div fxLayout="row nowrap" class="state-margin" *ngFor="let saleList of serviceprovider.get('india_where_sale_done').controls; let s = index; let l=last" [formGroupName]="s">
<mat-form-field > <mat-form-field >
<mat-select placeholder="Where, In India, Is The Service Provided" formControlName="state_name" required> <mat-select placeholder="Where, In India, Is The Service Provided" formControlName="state_name" required (selectionChange)="filterCityData(stateList,saleList.value.state_name,s)">
<mat-option *ngFor="let SL of stateList" [value]="SL.state_id"> <mat-option>
<ngx-mat-select-search formControlName="stateSearch" (keyup)="searchFun(saleList,s,'state')"
[placeholderLabel]="'Find State'"
[noEntriesFoundLabel]="'No Matching Result'" >
<ion-icon name="md-close" ngxMatSelectSearchClear></ion-icon>
</ngx-mat-select-search>
</mat-option>
<mat-option *ngFor="let SL of filteredState | async" [value]="SL.state_id">
{{SL.state_name}} {{SL.state_name}}
</mat-option> </mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field>
<mat-select multiple formControlName="city_name" placeholder="City" required> <mat-select multiple formControlName="city_name" placeholder="City" required>
<mat-option *ngFor="let CL of filterCity(stateList,saleList.value.state_name)" [value]="CL.city_id">{{CL.city_name}}</mat-option> <mat-option>
<ngx-mat-select-search formControlName="citySearch" (keyup)="searchFun(saleList,s,'city')"
[placeholderLabel]="'Find City'"
[noEntriesFoundLabel]="'No Matching Result'">
<ion-icon name="md-close" ngxMatSelectSearchClear></ion-icon>
</ngx-mat-select-search>
</mat-option>
<mat-option *ngFor="let CL of cityDataValue[s]" [value]="CL.city_id">{{CL.city_name}}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<ion-buttons end>
<button ion-button float-right color="optblue" clear (click)="removeServiceState(sp,s,'1')" *ngIf="s>0"><ion-icon name="md-trash"></ion-icon></button> <ion-col col-3 offset-3 *ngIf="s>0">
<button ion-button color="optblue" clear (click)="removeServiceState(sp,s,'1')" ><ion-icon name="md-trash"></ion-icon></button>
</ion-col>
<ion-col col-2 offset-1 *ngIf="serviceprovider.get('india_where_sale_done').value.length>0 && l">
<button ion-button color="optblue" (click)="addServiceMoreState(sp,'1')">Add More State</button>
</ion-col>
</ion-buttons>
</div> </div>
<div fxLayout="row" class="tab_class" *ngIf="serviceprovider.get('india_where_sale_done').value.length>0"> <div fxLayout="row" class="tab_class">
<button ion-button float-right color="optblue" (click)="addServiceMoreState(sp,'1')">Add More State</button>
</div> </div>
</div> </div>
@ -891,7 +1083,7 @@
</div> </div>
<p>Export</p> <p>Export</p>
<div formArrayName="countries_where_export_done"> <div formArrayName="countries_where_export_done">
<div class="tab_class state-margin" *ngFor="let countryList of serviceprovider.get('countries_where_export_done').controls; let c = index" [formGroupName]="c"> <div class="tab_class state-margin" *ngFor="let countryList of serviceprovider.get('countries_where_export_done').controls; let c = index; let l=last" [formGroupName]="c">
<mat-form-field > <mat-form-field >
<mat-label>Countries Where The Export Is Being Done for {{serviceprovider.value.main_products}}</mat-label> <mat-label>Countries Where The Export Is Being Done for {{serviceprovider.value.main_products}}</mat-label>
<mat-select placeholder="Countries" formControlName="country_name"> <mat-select placeholder="Countries" formControlName="country_name">
@ -905,11 +1097,17 @@
formControlName="approx_sale" required> formControlName="approx_sale" required>
</mat-form-field> </mat-form-field>
<ion-buttons end>
<button ion-button clear float-right color="optblue" (click)="removeServiceState(sp,c,'2')" *ngIf="c>0"><ion-icon name="md-trash"></ion-icon></button> <ion-col col-3 offset-3 *ngIf="c>0">
</div> <button ion-button clear color="optblue" (click)="removeServiceState(sp,c,'2')" ><ion-icon name="md-trash"></ion-icon></button>
<div fxLayout="row" class="tab_class"> </ion-col>
<button ion-button float-right color="optblue" (click)="addServiceMoreState(sp,'2')">Add More Country</button> <ion-col col-2 offset-1 *ngIf="l">
<button ion-button color="optblue" (click)="addServiceMoreState(sp,'2')">Add More</button>
</ion-col>
</ion-buttons>
<!-- </div>
<div fxLayout="row" class="tab_class"> -->
</div> </div>
</div> </div>
@ -929,7 +1127,8 @@
<button ion-button clear color="optblue" (click)="removeServiceProvider(sp)"><ion-icon style="font-size: 22px;" name="md-trash"></ion-icon></button> <button ion-button clear color="optblue" (click)="removeServiceProvider(sp)"><ion-icon style="font-size: 22px;" name="md-trash"></ion-icon></button>
</ion-col> </ion-col>
<ion-col *ngIf="l" col-2 offset-1> <ion-col *ngIf="l" col-2 offset-1>
<button float-right ion-button clear (click)="addMoreServiceprovider()" ><ion-icon style="font-size:24px" color="optblue" name="add-circle"></ion-icon></button><br/> <!-- <button float-right ion-button clear (click)="addMoreServiceprovider()" ><ion-icon style="font-size:24px" color="optblue" name="add-circle"></ion-icon></button><br/> -->
<button ion-button color="optblue" round (click)="addMoreServiceprovider()">Add Services</button>
</ion-col> </ion-col>
</ion-buttons> </ion-buttons>
@ -1246,9 +1445,13 @@
</mat-form-field> </mat-form-field>
</mat-card> </mat-card>
<ion-row> <ion-row>
<button ion-button full color="optblue" (click)="submitDetails()">Save</button>
</ion-row> </ion-row>
</form> </form>
</ion-content> </ion-content>
<ion-footer>
<button ion-button full color="optblue" (click)="submitDetails()">Save</button>
</ion-footer>

View File

@ -53,4 +53,7 @@ page-pd-question-business-info {
margin-top : 8px ; margin-top : 8px ;
} }
.checkbo{
margin:15px;
}
} }

View File

@ -5,8 +5,10 @@ import { ToastProvider } from '../../../../providers/common-provider/toast';
import { QuestionCategoryProvider } from '../../../../providers/question-category/question-category'; import { QuestionCategoryProvider } from '../../../../providers/question-category/question-category';
import { FormBuilder, FormGroup,FormArray, Validators, FormControl } from '@angular/forms'; import { FormBuilder, FormGroup,FormArray, Validators, FormControl } from '@angular/forms';
import { createPipe } from '@angular/compiler/src/core'; import { createPipe } from '@angular/compiler/src/core';
import { elementAt } from 'rxjs/operators'; import { elementAt, takeUntil } from 'rxjs/operators';
import { ConstantsProvider } from '../../../../providers/constants/constants' import { ConstantsProvider } from '../../../../providers/constants/constants'
import { Subject, ReplaySubject } from 'rxjs';
import {searchValue} from '../../search'
/** /**
* Generated class for the PdQuestionBusinessInfoPage page. * Generated class for the PdQuestionBusinessInfoPage page.
@ -68,9 +70,17 @@ export class PdQuestionBusinessInfoPage {
monthErrorMessage: any = []; monthErrorMessage: any = [];
errorMessageForExistTotalWorkExperience : any = []; errorMessageForExistTotalWorkExperience : any = [];
@ViewChild('shareholding') share_focus:ElementRef @ViewChild('shareholding') share_focus:ElementRef
private search:searchValue[]
protected _onDestroy = new Subject<void>();
public filteredCity: ReplaySubject<searchValue[]> = new ReplaySubject<searchValue[]>(1);
//public filterCity=new Rx.Subject()
public filteredState:ReplaySubject<searchValue[]>=new ReplaySubject<searchValue[]>(1)
cityData:any=[]
cityDataValue:any=[]
constructor(public navCtrl: NavController, public navParams: NavParams,public aws:AwsServiceProvider,public toast:ToastProvider,public qustCat:QuestionCategoryProvider,public fb:FormBuilder,public cons:ConstantsProvider) { constructor(public navCtrl: NavController, public navParams: NavParams,public aws:AwsServiceProvider,public toast:ToastProvider,public qustCat:QuestionCategoryProvider,public fb:FormBuilder,public cons:ConstantsProvider) {
this.getStateCityDet(); this.getStateCityDet();
console.log(typeof this.filteredCity)
this.pdDetails = this.navParams.get('pdDetails'); this.pdDetails = this.navParams.get('pdDetails');
this.pdid=this.pdDetails.pd_id this.pdid=this.pdDetails.pd_id
@ -215,6 +225,7 @@ this.qustCat.getStateCityDetails().subscribe(data=>{
this.stateList=data.records this.stateList=data.records
this.filteredState.next(this.stateList.slice())
this.getDetails(); this.getDetails();
}); });
@ -386,15 +397,18 @@ changeOfStartedBusiness(members,i,e){
this.CheckExport(element.area_of_sale,'MActivity',index) this.CheckExport(element.area_of_sale,'MActivity',index)
manufacture_details.push(this.manufactureDetails()) manufacture_details.push(this.manufactureDetails())
if(element.area_of_sale=='Within India'){ if(element.area_of_sale=='Within India'){
manufacture_details.controls[index].addControl('india_where_sale_done',this.fb.array([])) manufacture_details.controls[index].addControl('india_where_sale_done',this.fb.array([]))
manufacture_details.controls[index].addControl('pan_india_options',new FormControl('', Validators.required)); manufacture_details.controls[index].addControl('pan_india_options',new FormControl('', Validators.required));
element.india_where_sale_done.forEach((innerElement,innerIndex) => { element.india_where_sale_done.forEach((innerElement,innerIndex) => {
this.filterCityData(this.stateList,innerElement.state_name,innerIndex);
let innercontrol:any = manufacture_details.controls[index].get('india_where_sale_done') as FormArray; let innercontrol:any = manufacture_details.controls[index].get('india_where_sale_done') as FormArray;
innercontrol.push(this.indiaSalesDone()) innercontrol.push(this.indiaSalesDone())
}); });
manufacture_details.controls[index].addControl('max_sale_state_name',this.fb.array([])); manufacture_details.controls[index].addControl('max_sale_state_name',this.fb.array([]));
element.max_sale_state_name.forEach((innerElement,innerIndex) => { element.max_sale_state_name.forEach((innerElement,innerIndex) => {
this.filterCityData(this.stateList,innerElement.state_name,innerIndex);
let innercontrol:any = manufacture_details.controls[index].get('max_sale_state_name') as FormArray; let innercontrol:any = manufacture_details.controls[index].get('max_sale_state_name') as FormArray;
innercontrol.push(this.maxSaleState()) innercontrol.push(this.maxSaleState())
}) })
@ -412,10 +426,12 @@ changeOfStartedBusiness(members,i,e){
manufacture_details.controls[index].addControl('max_sale_state_name',this.fb.array([])); manufacture_details.controls[index].addControl('max_sale_state_name',this.fb.array([]));
element.india_where_sale_done.forEach((innerElement,innerIndex) => { element.india_where_sale_done.forEach((innerElement,innerIndex) => {
this.filterCityData(this.stateList,innerElement.state_name,innerIndex);
let innercontrol:any = manufacture_details.controls[index].get('india_where_sale_done') as FormArray; let innercontrol:any = manufacture_details.controls[index].get('india_where_sale_done') as FormArray;
innercontrol.push(this.indiaSalesDone()) innercontrol.push(this.indiaSalesDone())
}); });
element.max_sale_state_name.forEach((innerElement,innerIndex) => { element.max_sale_state_name.forEach((innerElement,innerIndex) => {
this.filterCityData(this.stateList,innerElement.state_name,innerIndex);
let innercontrol:any = manufacture_details.controls[index].get('max_sale_state_name') as FormArray; let innercontrol:any = manufacture_details.controls[index].get('max_sale_state_name') as FormArray;
innercontrol.push(this.maxSaleState()) innercontrol.push(this.maxSaleState())
}); });
@ -460,12 +476,14 @@ changeOfStartedBusiness(members,i,e){
retailControl.controls[index].addControl('india_where_sale_done', this.fb.array([])); retailControl.controls[index].addControl('india_where_sale_done', this.fb.array([]));
retailControl.controls[index].addControl('pan_india_options',new FormControl('', Validators.required)); retailControl.controls[index].addControl('pan_india_options',new FormControl('', Validators.required));
element.india_where_sale_done.forEach((innerElement,innerIndex) => { element.india_where_sale_done.forEach((innerElement,innerIndex) => {
this.filterCityData(this.stateList,innerElement.state_name,innerIndex);
let innercontrol:any = retailControl.controls[index].get('india_where_sale_done') as FormArray; let innercontrol:any = retailControl.controls[index].get('india_where_sale_done') as FormArray;
innercontrol.push(this.indiaSalesDone()) innercontrol.push(this.indiaSalesDone())
}); });
retailControl.controls[index].addControl('max_sale_state_name',this.fb.array([])); retailControl.controls[index].addControl('max_sale_state_name',this.fb.array([]));
element.max_sale_state_name.forEach((innerElement,innerIndex) => { element.max_sale_state_name.forEach((innerElement,innerIndex) => {
this.filterCityData(this.stateList,innerElement.state_name,innerIndex);
let innercontrol:any = retailControl.controls[index].get('max_sale_state_name') as FormArray; let innercontrol:any = retailControl.controls[index].get('max_sale_state_name') as FormArray;
innercontrol.push(this.maxSaleState()) innercontrol.push(this.maxSaleState())
}); });
@ -482,10 +500,12 @@ changeOfStartedBusiness(members,i,e){
retailControl.controls[index].addControl('pan_india_options',new FormControl('', Validators.required)); retailControl.controls[index].addControl('pan_india_options',new FormControl('', Validators.required));
retailControl.controls[index].addControl('max_sale_state_name',this.fb.array([])); retailControl.controls[index].addControl('max_sale_state_name',this.fb.array([]));
element.india_where_sale_done.forEach((innerElement,innerIndex) => { element.india_where_sale_done.forEach((innerElement,innerIndex) => {
this.filterCityData(this.stateList,innerElement.state_name,innerIndex);
let innercontrol:any = retailControl.controls[index].get('india_where_sale_done') as FormArray; let innercontrol:any = retailControl.controls[index].get('india_where_sale_done') as FormArray;
innercontrol.push(this.indiaSalesDone()) innercontrol.push(this.indiaSalesDone())
}); });
element.max_sale_state_name.forEach((innerElement,innerIndex) => { element.max_sale_state_name.forEach((innerElement,innerIndex) => {
this.filterCityData(this.stateList,innerElement.state_name,innerIndex);
let innercontrol:any = retailControl.controls[index].get('max_sale_state_name') as FormArray; let innercontrol:any = retailControl.controls[index].get('max_sale_state_name') as FormArray;
innercontrol.push(this.maxSaleState()) innercontrol.push(this.maxSaleState())
}); });
@ -525,12 +545,14 @@ changeOfStartedBusiness(members,i,e){
wholesaleControl.controls[index].addControl('india_where_sale_done', this.fb.array([])); wholesaleControl.controls[index].addControl('india_where_sale_done', this.fb.array([]));
wholesaleControl.controls[index].addControl('pan_india_options',new FormControl('', Validators.required)); wholesaleControl.controls[index].addControl('pan_india_options',new FormControl('', Validators.required));
element.india_where_sale_done.forEach((innerElement,innerIndex) => { element.india_where_sale_done.forEach((innerElement,innerIndex) => {
this.filterCityData(this.stateList,innerElement.state_name,innerIndex);
let innercontrol:any = wholesaleControl.controls[index].get('india_where_sale_done') as FormArray; let innercontrol:any = wholesaleControl.controls[index].get('india_where_sale_done') as FormArray;
innercontrol.push(this.indiaSalesDone()) innercontrol.push(this.indiaSalesDone())
}); });
wholesaleControl.controls[index].addControl('max_sale_state_name',this.fb.array([])); wholesaleControl.controls[index].addControl('max_sale_state_name',this.fb.array([]));
element.max_sale_state_name.forEach((innerElement,innerIndex) => { element.max_sale_state_name.forEach((innerElement,innerIndex) => {
this.filterCityData(this.stateList,innerElement.state_name,innerIndex);
let innercontrol:any = wholesaleControl.controls[index].get('max_sale_state_name') as FormArray; let innercontrol:any = wholesaleControl.controls[index].get('max_sale_state_name') as FormArray;
innercontrol.push(this.maxSaleState()) innercontrol.push(this.maxSaleState())
}); });
@ -547,10 +569,12 @@ changeOfStartedBusiness(members,i,e){
wholesaleControl.controls[index].addControl('pan_india_options',new FormControl('', Validators.required)); wholesaleControl.controls[index].addControl('pan_india_options',new FormControl('', Validators.required));
wholesaleControl.controls[index].addControl('max_sale_state_name',this.fb.array([])); wholesaleControl.controls[index].addControl('max_sale_state_name',this.fb.array([]));
element.india_where_sale_done.forEach((innerElement,innerIndex) => { element.india_where_sale_done.forEach((innerElement,innerIndex) => {
this.filterCityData(this.stateList,innerElement.state_name,innerIndex);
let innercontrol:any = wholesaleControl.controls[index].get('india_where_sale_done') as FormArray; let innercontrol:any = wholesaleControl.controls[index].get('india_where_sale_done') as FormArray;
innercontrol.push(this.indiaSalesDone()) innercontrol.push(this.indiaSalesDone())
}); });
element.max_sale_state_name.forEach((innerElement,innerIndex) => { element.max_sale_state_name.forEach((innerElement,innerIndex) => {
this.filterCityData(this.stateList,innerElement.state_name,innerIndex);
let innercontrol:any = wholesaleControl.controls[index].get('max_sale_state_name') as FormArray; let innercontrol:any = wholesaleControl.controls[index].get('max_sale_state_name') as FormArray;
innercontrol.push(this.maxSaleState()) innercontrol.push(this.maxSaleState())
}); });
@ -593,12 +617,14 @@ changeOfStartedBusiness(members,i,e){
serviceProviderControl.controls[index].addControl('india_where_sale_done', this.fb.array([])); serviceProviderControl.controls[index].addControl('india_where_sale_done', this.fb.array([]));
serviceProviderControl.controls[index].addControl('pan_india_options',new FormControl('', Validators.required)); serviceProviderControl.controls[index].addControl('pan_india_options',new FormControl('', Validators.required));
element.india_where_sale_done.forEach((innerElement,innerIndex) => { element.india_where_sale_done.forEach((innerElement,innerIndex) => {
this.filterCityData(this.stateList,innerElement.state_name,innerIndex);
let innercontrol:any = serviceProviderControl.controls[index].get('india_where_sale_done') as FormArray; let innercontrol:any = serviceProviderControl.controls[index].get('india_where_sale_done') as FormArray;
innercontrol.push(this.indiaSalesDone()) innercontrol.push(this.indiaSalesDone())
}); });
serviceProviderControl.controls[index].addControl('max_sale_state_name',this.fb.array([])); serviceProviderControl.controls[index].addControl('max_sale_state_name',this.fb.array([]));
element.max_sale_state_name.forEach((innerElement,innerIndex) => { element.max_sale_state_name.forEach((innerElement,innerIndex) => {
this.filterCityData(this.stateList,innerElement.state_name,innerIndex);
let innercontrol:any = serviceProviderControl.controls[index].get('max_sale_state_name') as FormArray; let innercontrol:any = serviceProviderControl.controls[index].get('max_sale_state_name') as FormArray;
innercontrol.push(this.maxSaleState()) innercontrol.push(this.maxSaleState())
}); });
@ -606,6 +632,7 @@ changeOfStartedBusiness(members,i,e){
else if(element.area_of_sale=='Export'){ else if(element.area_of_sale=='Export'){
serviceProviderControl.controls[index].addControl('countries_where_export_done', this.fb.array([])); serviceProviderControl.controls[index].addControl('countries_where_export_done', this.fb.array([]));
element.countries_where_export_done.forEach((innerElement,innerIndex) => { element.countries_where_export_done.forEach((innerElement,innerIndex) => {
let innercontrol:any = serviceProviderControl.controls[index].get('countries_where_export_done') as FormArray; let innercontrol:any = serviceProviderControl.controls[index].get('countries_where_export_done') as FormArray;
innercontrol.push(this.createCountrySale()) innercontrol.push(this.createCountrySale())
}); });
@ -615,11 +642,13 @@ changeOfStartedBusiness(members,i,e){
serviceProviderControl.controls[index].addControl('pan_india_options',new FormControl('', Validators.required)); serviceProviderControl.controls[index].addControl('pan_india_options',new FormControl('', Validators.required));
serviceProviderControl.controls[index].addControl('max_sale_state_name',this.fb.array([])); serviceProviderControl.controls[index].addControl('max_sale_state_name',this.fb.array([]));
element.india_where_sale_done.forEach((innerElement,innerIndex) => { element.india_where_sale_done.forEach((innerElement,innerIndex) => {
this.filterCityData(this.stateList,innerElement.state_name,innerIndex);
let innercontrol:any = serviceProviderControl.controls[index].get('india_where_sale_done') as FormArray; let innercontrol:any = serviceProviderControl.controls[index].get('india_where_sale_done') as FormArray;
innercontrol.push(this.indiaSalesDone()) innercontrol.push(this.indiaSalesDone())
}); });
element.max_sale_state_name.forEach((innerElement,innerIndex) => { element.max_sale_state_name.forEach((innerElement,innerIndex) => {
this.filterCityData(this.stateList,innerElement.state_name,innerIndex);
let innercontrol:any = serviceProviderControl.controls[index].get('max_sale_state_name') as FormArray; let innercontrol:any = serviceProviderControl.controls[index].get('max_sale_state_name') as FormArray;
innercontrol.push(this.maxSaleState()) innercontrol.push(this.maxSaleState())
}); });
@ -720,13 +749,31 @@ changeOfStartedBusiness(members,i,e){
} }
filterCity(datasource: any,filterid:number) { filterCity(datasource: any,filterid:number) {
// if(val){
// console.log("val",val)
// return val
// }
if(filterid){ if(filterid){
console.log("val filter",filterid)
let filter = this.stateList.filter(x=>x.state_id==filterid); let filter = this.stateList.filter(x=>x.state_id==filterid);
return filter.length > 0 ? filter[0].cities : []; return filter.length > 0 ? filter[0].cities : [];
} }
} }
filterCityData(datasource: any,filterid:number,index) {
console.log("test")
console.log(filterid,index)
if(filterid){
let filter = this.stateList.filter(x=>x.state_id==filterid);
this.cityData[index] = filter.length > 0 ? filter[0].cities : [];
// this.filteredCity.next(this.cityData[index].slice())
this.cityDataValue[index]=this.cityData[index].slice()
console.log("filter ",this.cityDataValue[index])
}
// console.log("City value",this.cityData[index])
}
// filter max sale options // filter max sale options
filterMaxSaleState(datasource: any,filterValues:any){ filterMaxSaleState(datasource: any,filterValues:any){
@ -742,38 +789,86 @@ changeOfStartedBusiness(members,i,e){
return setStateFilter.length > 0 ? setStateFilter : []; return setStateFilter.length > 0 ? setStateFilter : [];
} }
} }
filterMaxSaleCities(datasource: any,filterValues:any,selectedCites: any) { filterMaxSaleCities(datasource: any, filterValues: any, selectedCites: any) {
console.log(selectedCites) if (filterValues) {
let existCities: any = selectedCites.filter(cfVal=>cfVal.city_name!='').map(mcVal=>mcVal.city_name); let setCityValues: any=[];
existCities = [].concat.apply([], existCities); let getOriginalStateList = datasource.map(dval => dval.state_id);
if(filterValues){ filterValues.forEach((stateElement,statePos) => {
let getOriginalStateList = datasource.map(dval => dval.state_id); selectedCites.forEach((existElement,existPos) => {
console.log("Original map",getOriginalStateList) if(stateElement==existElement.state_name && existElement.city_name.length>0){
let setCityFilter = filterValues.map(x => { let findIndex = getOriginalStateList.indexOf(stateElement);
let findIndex = getOriginalStateList.indexOf(x); findIndex = datasource[findIndex].cities;
findIndex = datasource[findIndex].cities;
return findIndex; let getAllCities: any = existElement.city_name.filter(cVal=>cVal=="1");
}); // this is for throuh out states city
console.log("findindex",setCityFilter) if(getAllCities.length>0){
setCityValues= setCityValues.concat.apply(setCityValues, findIndex);
let merged = [].concat.apply([], setCityFilter); console.log("First",setCityValues)
}
if(merged.length>0){ // this is for seleted states city
let check: any = merged.filter(function(fVal){ else{
return existCities.some(function(sVal){ let check: any = findIndex.filter(function (fVal) {
return fVal.city_id==sVal; return existElement.city_name.some(function (sVal) {
}); return fVal.city_id == sVal;
}) });
return check; });
setCityValues= setCityValues.concat.apply(setCityValues, check);
console.log("second",setCityValues)
}
}
});
});
return setCityValues.length>0 ? setCityValues.filter(fVal=>fVal.city_id!="1") : [];
} }
else { else {
return []; return [];
} }
}
else {
return [];
}
} }
// filterMaxSaleCities(datasource: any,filterValues:any,selectedCites: any) {
// console.log(selectedCites)
// let existCities: any = selectedCites.filter(cfVal=>cfVal.city_name!='').map(mcVal=>mcVal.city_name);
// console.log("selectd",existCities)
// existCities = [].concat.apply([], existCities);
// existCities.forEach(element=>{
// if(element== 1){
// }
// })
// console.log("concat",existCities)
// if(filterValues){
// let getOriginalStateList = datasource.map(dval => dval.state_id);
// console.log("Original map",getOriginalStateList)
// let setCityFilter = filterValues.map(x => {
// let findIndex = getOriginalStateList.indexOf(x);
// findIndex = datasource[findIndex].cities;
// return findIndex;
// });
// console.log("findindex",setCityFilter)
// let merged = [].concat.apply([], setCityFilter);
// console.log("merge",merged)
// if(merged.length>0){
// let check: any = merged.filter(function(fVal){
// return existCities.some(function(sVal){
// return fVal.city_id==sVal;
// });
// })
// console.log(check);
// return check;
// }
// else {
// return [];
// }
// }
// else {
// return [];
// }
// }
checkTotalEmployee(FormData){ checkTotalEmployee(FormData){
@ -1211,13 +1306,17 @@ manufactureDetails():FormGroup{
indiaSalesDone():FormGroup{ indiaSalesDone():FormGroup{
return this.fb.group({ return this.fb.group({
state_name:[''], state_name:[''],
city_name:[''] city_name:[''],
stateSearch:[''],
citySearch:['']
}) })
} }
maxSaleState():FormGroup{ maxSaleState():FormGroup{
return this.fb.group({ return this.fb.group({
state_name:[''], state_name:[''],
city_name:[''] city_name:[''],
stateSearch:[''],
citySearch:['']
}) })
} }
createDocument() { createDocument() {
@ -1545,7 +1644,13 @@ submitDetails() {
// } // }
} }
let control: any = this.businessForm.get('manufacturing_activity_details') as FormArray;
console.log("manufacture",control);
// control.controls.forEach(element=>{
// if(element.controls['india_where_sale_done']){
// element.controls
// }
// })
let family: any = []; let family: any = [];
@ -1892,6 +1997,67 @@ toGetPOSMachinesDetails(e,flag){
} }
} }
} }
searchFun(control:any,i:number,option){
console.log("control",control)
if (option == 'city') {
// this.cityData[i]=this.filterCity(this.stateList,control.value.state_name)
control.controls['citySearch'].valueChanges
.pipe(takeUntil(this._onDestroy))
.subscribe(() => {
this.SearchCity(control.controls['citySearch'].value, i);
})
}
if (option == 'state') {
console.log("state")
control.controls['stateSearch'].valueChanges
.pipe(takeUntil(this._onDestroy))
.subscribe(()=>{
this.searchState(control.controls['stateSearch'].value)
})
}
}
SearchCity(val: any, i: number) {
// let cityData=
console.log(this.cityData[i])
if (!this.cityData[i]) {
return
}
let searchValue = val
if (!searchValue) {
this.cityDataValue[i]=this.cityData[i].slice()
return
} else {
searchValue = searchValue.toLowerCase()
}
this.cityDataValue[i]=
this.cityData[i].filter(val=>val.city_name.toLowerCase().indexOf(searchValue)> -1)
console.log("City Data value",this.cityDataValue[i])
// this.filterCity('',1,this.cityData[i])
// this.filteredCity.next(
// this.cityData[i].filter(value => value.city_name.toLowerCase().indexOf(searchValue) > -1)
// )
}
searchState(val: any) {
console.log("statedata")
if (!this.stateList) {
return
}
let searchVal = val
if (!searchVal) {
this.filteredState.next(this.stateList.slice())
return
}
else {
searchVal = searchVal.toLowerCase()
}
this.filteredState.next(
this.stateList.filter(res => res.state_name.toLowerCase().indexOf(searchVal) > -1)
)
}
} }

View File

@ -375,7 +375,7 @@
<div style="text-align: center; margin: 12px;">Retail Trading Details Not applicable here !!</div> <div style="text-align: center; margin: 12px;">Retail Trading Details Not applicable here !!</div>
</mat-card> --> </mat-card> -->
<ion-row> <ion-row>
<button ion-button full color="optblue" (click)="saveClientInfo(clientInfoForm.value)"> Save</button>
</ion-row> </ion-row>
</div> </div>
@ -388,4 +388,7 @@
</div> </div>
</mat-card> </mat-card>
</div> </div>
</ion-content> </ion-content>
<ion-footer>
<button ion-button full color="optblue" (click)="saveClientInfo(clientInfoForm.value)"> Save</button>
</ion-footer>

View File

@ -335,7 +335,10 @@
</mat-form-field> </mat-form-field>
</mat-card> </mat-card>
<ion-row> <ion-row>
<button ion-button full color="optblue" (click)="submitDetails()">Save</button>
</ion-row> </ion-row>
</form> </form>
</ion-content> </ion-content>
<ion-footer>
<button ion-button full color="optblue" (click)="submitDetails()"> Save</button>
</ion-footer>

View File

@ -337,7 +337,7 @@
</mat-card> </mat-card>
<mat-dialog-actions> <mat-dialog-actions>
<ion-row> <ion-row>
<button ion-button full color="optblue" (click)="saveStockInfo(stockForm.value)"> Save</button>
</ion-row> </ion-row>
</mat-dialog-actions> </mat-dialog-actions>
</div> </div>
@ -350,4 +350,7 @@
</div> </div>
</mat-card> </mat-card>
</div> </div>
</ion-content> </ion-content>
<ion-footer>
<button ion-button full color="optblue" (click)="saveStockInfo(stockForm.value)"> Save</button>
</ion-footer>

View File

@ -239,7 +239,7 @@
</mat-form-field> </mat-form-field>
</mat-card> </mat-card>
<ion-row> <ion-row>
<button ion-button full color="optblue" (click)="saveSupplierInfo(supplierInfoForm.value)"> Save</button>
</ion-row> </ion-row>
</div> </div>
</form> </form>
@ -251,4 +251,7 @@
</div> </div>
</mat-card> </mat-card>
</div> </div>
</ion-content> </ion-content>
<ion-footer>
<button ion-button full color="optblue" (click)="saveSupplierInfo(supplierInfoForm.value)"> Save</button>
</ion-footer>

View File

@ -2,7 +2,7 @@
<ion-navbar color="optblue"> <ion-navbar color="optblue">
<button ion-button menuToggle> <button ion-button menuToggle>
<ion-icon name="menu"></ion-icon> <ion-icon name="menu">{{FormId.form_name}}</ion-icon>
</button> </button>
@ -68,7 +68,7 @@
<input matInput autocomplete="off" placeholder="Specify Borrower" formControlName="others_loan_taken"> <input matInput autocomplete="off" placeholder="Specify Borrower" formControlName="others_loan_taken">
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 100%"> <mat-form-field style="width: 100%">
<mat-select (selectionChange)="selectedfrequency($event.value,i)" placeholder="Frequency" <mat-select (selectionChange)="selectedfrequency($event.value,i)" placeholder="Instalment Frequency"
formControlName="frequency" required> formControlName="frequency" required>
<mat-option>Select</mat-option> <mat-option>Select</mat-option>
<mat-option *ngFor="let freq of frequencyData" value="{{freq.frequency_id}}">{{freq.name}}</mat-option> <mat-option *ngFor="let freq of frequencyData" value="{{freq.frequency_id}}">{{freq.name}}</mat-option>
@ -92,7 +92,8 @@
<input type="number" matInput placeholder="Original Tenure in Months" formControlName="original_tenure" (change)="checkTenure(details);calculateTenure(details)"> <input type="number" matInput placeholder="Original Tenure in Months" formControlName="original_tenure" (change)="checkTenure(details);calculateTenure(details)">
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 100%"> <mat-form-field style="width: 100%">
<input type="number" matInput placeholder="Current Balance Tenure in Months" formControlName="current_balance_tenure" (change)="calculateTenure(details)"> <input type="number" matInput placeholder="Current Balance Tenure in Months" formControlName="current_balance_tenure" #balanceTenure (change)="calculateTenure(details)">
<mat-error style="font-size: 12px" *ngIf="tentureErrorFlag == true">Oringinal Tenure Less than Current Balance Tenure</mat-error>
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field>
<input type="number" matInput placeholder="Elapsed Tenure in Months" formControlName="elapsed_tenure" autocomplete="off"> <input type="number" matInput placeholder="Elapsed Tenure in Months" formControlName="elapsed_tenure" autocomplete="off">
@ -123,8 +124,11 @@
<!-- <ion-buttons > <!-- <ion-buttons >
<ion-button color="optblue" <ion-button color="optblue"
full[disabled]="!pdforms.valid" mat-raised-button style="width:100%" (click)="savepdDetails(pdforms.value)">Save <ion-icon name="md-disc"></ion-icon></ion-button> --> full[disabled]="!pdforms.valid" mat-raised-button style="width:100%" (click)="savepdDetails(pdforms.value)">Save <ion-icon name="md-disc"></ion-icon></ion-button> -->
<button ion-button full color="optblue" (click)="submitCurrentloan(currentLoans.value)" > Save</button>
<!-- </ion-buttons> --> <!-- </ion-buttons> -->
</ion-row> </ion-row>
</form> </form>
</ion-content> </ion-content>
<ion-footer>
<button ion-button full color="optblue" (click)="submitCurrentloan(currentLoans.value)" > Save</button>
</ion-footer>

View File

@ -1,4 +1,4 @@
import { Component, ApplicationInitStatus } from '@angular/core'; import { Component, ApplicationInitStatus, ViewChild, ElementRef } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular'; import { IonicPage, NavController, NavParams } from 'ionic-angular';
import { FormGroup,FormArray,FormBuilder,Validators } from '@angular/forms'; import { FormGroup,FormArray,FormBuilder,Validators } from '@angular/forms';
import { QuestionCategoryProvider } from '../../../providers/question-category/question-category'; import { QuestionCategoryProvider } from '../../../providers/question-category/question-category';
@ -39,6 +39,8 @@ applicants: any;
investmentTypeData: any=[]; investmentTypeData: any=[];
addressTypeData: any; addressTypeData: any;
propertyTypeData: any; propertyTypeData: any;
tentureErrorFlag:boolean=false
@ViewChild('balanceTenure') TenureFocus : ElementRef
constructor(public navCtrl: NavController, public navParams: NavParams,public fb:FormBuilder,public qustCat:QuestionCategoryProvider,public toast:ToastProvider, public aws:AwsServiceProvider,public constant:ConstantsProvider) { constructor(public navCtrl: NavController, public navParams: NavParams,public fb:FormBuilder,public qustCat:QuestionCategoryProvider,public toast:ToastProvider, public aws:AwsServiceProvider,public constant:ConstantsProvider) {
@ -184,8 +186,18 @@ checkOthers(values){
checkTenure(details){ checkTenure(details){
let originalTenure = details.value.original_tenure; let originalTenure = details.value.original_tenure;
// alert(originalTenure); // alert(originalTenure);
details.controls.current_balance_tenure.setValidators([Validators.required, Validators.max(+originalTenure)]); // if(originalTenure>=details.value.current_balance_tenure){
// this.tentureErrorFlag=true
details.controls.current_balance_tenure.setValidators([Validators.required, Validators.max(+originalTenure)]);
details.controls.current_balance_tenure.updateValueAndValidity(); details.controls.current_balance_tenure.updateValueAndValidity();
//details.controls.current_balance_tenure.setValue
// }
// else{
// this.toast.pdTriggerappmessage("Current Tenure ")
// details.controls.current_balance_tenure.setValidators([Validators.max(+originalTenure)]); // details.controls.current_balance_tenure.setValidators([Validators.max(+originalTenure)]);
// details.controls.current_balance_tenure.updateValueAndValidity(); // details.controls.current_balance_tenure.updateValueAndValidity();
// let BalanceTenure = details.value.current_balance_tenure; // let BalanceTenure = details.value.current_balance_tenure;
@ -202,11 +214,25 @@ checkTenure(details){
calculateTenure(details) calculateTenure(details)
{ {
let ElapsedValues; let ElapsedValues;
console.log(details)
if(details.value.original_tenure != null && details.value.original_tenure != '' && details.value.current_balance_tenure != null && details.value.current_balance_tenure != ''){ if(details.value.original_tenure != null && details.value.original_tenure != '' && details.value.current_balance_tenure != null && details.value.current_balance_tenure != '' ){
console.log("not null")
if(details.value.current_balance_tenure <= details.value.original_tenure){
console.log("validate")
this.tentureErrorFlag=false
ElapsedValues = details.value.original_tenure - details.value.current_balance_tenure ; ElapsedValues = details.value.original_tenure - details.value.current_balance_tenure ;
details.controls['elapsed_tenure'].setValue(ElapsedValues); details.controls['elapsed_tenure'].setValue(ElapsedValues);
} }
else{
//this.toast.pdTriggerappmessage("Oringinal Tenure Less than Current Balance Tenure")
this.tentureErrorFlag=true
this.TenureFocus.nativeElement.focus();
}
}
else{
this.tentureErrorFlag=false
}
} }
keyPress(event: any) { keyPress(event: any) {
@ -247,6 +273,26 @@ selectedfrequency(e,i){
} }
submitCurrentloan(answerData) { submitCurrentloan(answerData) {
console.log(answerData)
console.log("true",this.tentureErrorFlag);
let inde=[]
// answerData.loan_details.forEach((element,index)=>{
// if(element.current_balance_tenure > element.original_tenure){
// this.toast.pdTriggerappmessage("Oringinal Tenure Less than Current Balance Tenure")
// inde=index
// }
// })
// console.log("index",inde);
// if(inde){
// return
// }
if(this.tentureErrorFlag == true){
this.toast.pdTriggerappmessage("Original Tenure Less than Current Balance Tenure");
this.TenureFocus.nativeElement.focus();
return
}
let records: any = {}; let records: any = {};
records.pdid = this.pdDetails.pd_id; records.pdid = this.pdDetails.pd_id;
@ -257,8 +303,6 @@ submitCurrentloan(answerData) {
records.currentloan_remarks = answerData.currentloan_remarks; records.currentloan_remarks = answerData.currentloan_remarks;
this.qustCat.saveForm(records).subscribe(data => { this.qustCat.saveForm(records).subscribe(data => {
if(data['dataStatus']==true) if(data['dataStatus']==true)
{ {
@ -296,8 +340,10 @@ submitCurrentloan(answerData) {
control.push(this.createLoanDetail(null)); control.push(this.createLoanDetail(null));
}else }else
{ {
result.forEach((datas,index)=> result.forEach((datas,index)=>
{ {
//this.calculateTenure(res['records'])
control.push(this.createLoanDetail(null)); control.push(this.createLoanDetail(null));
this.selectedfrequency(datas.frequency,index); this.selectedfrequency(datas.frequency,index);
if(datas.loan_amount!=''){ if(datas.loan_amount!=''){

View File

@ -32,34 +32,34 @@
</div> </div>
<mat-label>How many yrs with this emp</mat-label> <mat-label>Since how long working with this employer?</mat-label>
<div fxLayout="column" fxLayoutAlign="start stretch"> <div fxLayout="column" fxLayoutAlign="start stretch">
<mat-form-field style="width: 45%"> <mat-form-field style="width: 45%">
<input matInput type="text" formControlName="how_long_year" autocomplete="off" placeholder="Year" min='0'> <input matInput type="number" formControlName="how_long_year" autocomplete="off" placeholder="Year" min='0'>
</mat-form-field> </mat-form-field>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
<mat-form-field style="width: 45%"> <mat-form-field style="width: 45%">
<input matInput type="text" placeholder="Month" formControlName="how_long_month" min='0' (change)="ConvertMonthintoYear($event.target.value)"> <input matInput type="number" placeholder="Month" formControlName="how_long_month" min='0' (change)="ConvertMonthintoYear($event.target.value)">
</mat-form-field> </mat-form-field>
</div> </div>
<div fxLayout="column" fxLayoutAlign="start stretch"> <div fxLayout="column" fxLayoutAlign="start stretch">
<mat-form-field style="width:100%"> <mat-form-field style="width:100%">
<input matInput placeholder="Total Work Experience" formControlName="total_business_experience" <input matInput placeholder="Total Work Experience" formControlName="total_business_experience" type="number" #workExp
OnlyNumber autocomplete="off" (change)="checkWorkingExperiences()"> OnlyNumber autocomplete="off" (change)="checkWorkingExperiences()">
<mat-hint style="color: red;" *ngIf="employmentForm.controls.total_business_experience.value !=undefined && this.workExperienceErrorFlag"> <mat-hint style="color: red;" *ngIf="employmentForm.controls.total_business_experience.value !=undefined && this.workExperienceErrorFlag">
Total working Experience is Lower Total working Experience is Lower
</mat-hint> </mat-hint>
</mat-form-field> </mat-form-field>
</div> </div>
<div fxLayout="column" fxLayoutAlign="start stretch" *ngIf="workExperienceFlag"> <div fxLayout="column" fxLayoutAlign="start stretch" *ngIf="workExperienceFlag" >
<mat-form-field style="width:100%"> <mat-form-field style="width:100%">
<input matInput placeholder="Previous Work Experience Details" formControlName="total_business_previous_experience"> <input matInput placeholder="Previous Work Experience Details" formControlName="total_business_previous_experience" (change)="checkWorkingExperiences()">
</mat-form-field> </mat-form-field>
</div> </div>
<div *ngIf="pd_cus_segment!='SAL-CHQ'"> <div *ngIf="pd_cus_segment!='SAL-CHQ'">
<p>Emp Met</p> <p>Was the Employer Met</p>
<mat-radio-group name="was_met" formControlName="was_met"><!-- //(change)="checkotherDetails($event.value)" --> <mat-radio-group name="was_met" formControlName="was_met"><!-- //(change)="checkotherDetails($event.value)" -->
<mat-radio-button value="yes">YES</mat-radio-button> <mat-radio-button value="yes">YES</mat-radio-button>
<mat-radio-button value="no">NO</mat-radio-button> <mat-radio-button value="no">NO</mat-radio-button>
@ -90,7 +90,7 @@
</div> </div>
<div *ngIf="pd_cus_segment!='SAL-CHQ'"> <div *ngIf="pd_cus_segment!='SAL-CHQ'">
<p>Salary amt confirmed</p> <p>Salary amount confirmed ?</p>
<mat-radio-group formControlName="confirm_salary"> <mat-radio-group formControlName="confirm_salary">
<mat-radio-button value="yes">YES</mat-radio-button> <mat-radio-button value="yes">YES</mat-radio-button>
<mat-radio-button value="no">NO</mat-radio-button> <mat-radio-button value="no">NO</mat-radio-button>
@ -100,7 +100,7 @@
<div *ngIf="employmentForm.controls.confirm_salary.value == 'yes'"> <div *ngIf="employmentForm.controls.confirm_salary.value == 'yes'">
<div fxLayout="column" fxLayoutAlign="start stretch"> <div fxLayout="column" fxLayoutAlign="start stretch">
<mat-form-field style="width: 100%"> <mat-form-field style="width: 100%">
<input matInput placeholder="What is the salary amount confirmed?" formControlName="confirm_salary_amount" <input matInput placeholder="What is the salary amount confirmed?" formControlName="confirm_salary_amount" type="number"
OnlyNumber (keyup)="inWords($event.target.value,1)"> OnlyNumber (keyup)="inWords($event.target.value,1)">
<mat-hint align="end" *ngIf="employmentForm.controls.confirm_salary_amount.value != ''">{{"&#8377;"}} {{mthlySlryAmtInWords}} Only</mat-hint> <mat-hint align="end" *ngIf="employmentForm.controls.confirm_salary_amount.value != ''">{{"&#8377;"}} {{mthlySlryAmtInWords}} Only</mat-hint>
</mat-form-field> </mat-form-field>
@ -109,7 +109,7 @@
</div> </div>
<div *ngIf="pd_cus_segment!='SAL-CHQ'"> <div *ngIf="pd_cus_segment!='SAL-CHQ'">
<p>Attendance Register seen</p> <p>Attendance register seen ?</p>
<mat-radio-group name="attendance_seen" formControlName="attendance_seen"> <mat-radio-group name="attendance_seen" formControlName="attendance_seen">
<mat-radio-button value="yes">YES</mat-radio-button> <mat-radio-button value="yes">YES</mat-radio-button>
<mat-radio-button value="no">NO</mat-radio-button> <mat-radio-button value="no">NO</mat-radio-button>
@ -117,7 +117,7 @@
</div> </div>
<div *ngIf="pd_cus_segment!='SAL-CHQ'"> <div *ngIf="pd_cus_segment!='SAL-CHQ'">
<P >Salary register seen</P> <P >Salary register seen ?</P>
<mat-radio-group name="sal_reg_seen" formControlName="sal_reg_seen"> <mat-radio-group name="sal_reg_seen" formControlName="sal_reg_seen">
<mat-radio-button value="yes">YES</mat-radio-button> <mat-radio-button value="yes">YES</mat-radio-button>
<mat-radio-button value="no">NO</mat-radio-button> <mat-radio-button value="no">NO</mat-radio-button>
@ -152,14 +152,14 @@
<div fxLayout="column" fxLayoutAlign="start stretch"> <div fxLayout="column" fxLayoutAlign="start stretch">
<mat-form-field style="width: 100%"> <mat-form-field style="width: 100%">
<input matInput placeholder="Gross Monthly Salary" formControlName="gross_monthly_salary" <input matInput placeholder="Gross Monthly Salary" formControlName="gross_monthly_salary" type="number"
OnlyNumber required (keyup)="inWords($event.target.value,2)"> OnlyNumber required (keyup)="inWords($event.target.value,2)">
<mat-hint align="end" *ngIf="employmentForm.controls.gross_monthly_salary.value != ''">{{"&#8377;"}} {{grossMthlySlryAmtInWords}} Only</mat-hint> <mat-hint align="end" *ngIf="employmentForm.controls.gross_monthly_salary.value != ''">{{"&#8377;"}} {{grossMthlySlryAmtInWords}} Only</mat-hint>
</mat-form-field> </mat-form-field>
</div> </div>
<div fxLayout="column" fxLayoutAlign="start stretch"> <div fxLayout="column" fxLayoutAlign="start stretch">
<mat-form-field style="width: 100%"> <mat-form-field style="width: 100%">
<input matInput placeholder="Net Monthly Salary" formControlName="net_monthly_salary" <input matInput placeholder="Net Monthly Salary" formControlName="net_monthly_salary" type="number"
OnlyNumber required (keyup)="inWords($event.target.value,3)"> OnlyNumber required (keyup)="inWords($event.target.value,3)">
<mat-hint align="end" *ngIf="employmentForm.controls.net_monthly_salary.value != ''">{{"&#8377;"}} {{netMthlySlryAmtInWords}} Only</mat-hint> <mat-hint align="end" *ngIf="employmentForm.controls.net_monthly_salary.value != ''">{{"&#8377;"}} {{netMthlySlryAmtInWords}} Only</mat-hint>
</mat-form-field> </mat-form-field>
@ -168,7 +168,7 @@
<div fxLayout="column" fxLayoutAlign="start stretch"> <div fxLayout="column" fxLayoutAlign="start stretch">
<mat-form-field style="width: 100%"> <mat-form-field style="width: 100%">
<input matInput placeholder="Amount paid in Cash" <input matInput placeholder="Amount paid in Cash"
formControlName="amount_paid_in_cash" OnlyNumber OnlyNumber type="text" autocomplete="off" (keyup)="inWords($event.target.value,5)"> formControlName="amount_paid_in_cash" OnlyNumber type="number" autocomplete="off" (keyup)="inWords($event.target.value,6)">
<mat-hint align="end" *ngIf="employmentForm.controls.amount_paid_in_cash.value != ''">{{"&#8377;"}} {{cashAmtInWords}} Only</mat-hint> <mat-hint align="end" *ngIf="employmentForm.controls.amount_paid_in_cash.value != ''">{{"&#8377;"}} {{cashAmtInWords}} Only</mat-hint>
</mat-form-field> </mat-form-field>
</div> </div>
@ -176,7 +176,7 @@
<div fxLayout="column" fxLayoutAlign="start stretch"> <div fxLayout="column" fxLayoutAlign="start stretch">
<mat-form-field style="width: 100%"> <mat-form-field style="width: 100%">
<input matInput placeholder="Amount paid through Bank" <input matInput placeholder="Amount paid through Bank"
formControlName="amount_paid_through_bank" OnlyNumber type="text" autocomplete="off" (keyup)="inWords($event.target.value,6)"> formControlName="amount_paid_through_bank" OnlyNumber type="number" autocomplete="off" (keyup)="inWords($event.target.value,5)">
<mat-hint align="end" *ngIf="employmentForm.controls.amount_paid_through_bank.value != ''">{{"&#8377;"}} {{bankAmtInWords}} Only</mat-hint> <mat-hint align="end" *ngIf="employmentForm.controls.amount_paid_through_bank.value != ''">{{"&#8377;"}} {{bankAmtInWords}} Only</mat-hint>
</mat-form-field> </mat-form-field>
</div> </div>
@ -209,7 +209,7 @@
<div fxLayout="column" fxLayoutAlign="start stretch"> <div fxLayout="column" fxLayoutAlign="start stretch">
<mat-form-field style="width: 100%"> <mat-form-field style="width: 100%">
<input matInput placeholder="Bonus or Incentive" formControlName="bonus_incentive" <input matInput placeholder="Bonus or Incentive" formControlName="bonus_incentive" type="number"
OnlyNumber required (keyup)="inWords($event.target.value,4)"> OnlyNumber required (keyup)="inWords($event.target.value,4)">
<mat-hint align="end" *ngIf="employmentForm.controls.bonus_incentive.value != ''">{{"&#8377;"}} {{bonusIncentiveAmtInWords}} Only</mat-hint> <mat-hint align="end" *ngIf="employmentForm.controls.bonus_incentive.value != ''">{{"&#8377;"}} {{bonusIncentiveAmtInWords}} Only</mat-hint>
</mat-form-field> </mat-form-field>
@ -264,8 +264,11 @@
</mat-card> </mat-card>
<ion-row> <ion-row>
<button ion-button full color="optblue" (click)="saveEmpInfo()"> Save</button>
</ion-row> </ion-row>
</form> </form>
</ion-content> </ion-content>
<ion-footer>
<button ion-button full color="optblue" (click)="saveEmpInfo()"> Save</button>
</ion-footer>

View File

@ -1,4 +1,4 @@
import { Component } from '@angular/core'; import { Component, ViewChild, ElementRef } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular'; import { IonicPage, NavController, NavParams } from 'ionic-angular';
import {FormBuilder,FormControl,FormArray, FormGroup} from '@angular/forms'; import {FormBuilder,FormControl,FormArray, FormGroup} from '@angular/forms';
import { QuestionCategoryProvider } from '../../../providers/question-category/question-category'; import { QuestionCategoryProvider } from '../../../providers/question-category/question-category';
@ -45,6 +45,7 @@ export class PdQuestionEmpInfoPage {
public dateonly: any = [{date:1,isdisabled:false},{date:2,isdisabled:false},{date:3,isdisabled:false},{date:4,isdisabled:false},{date:5,isdisabled:false},{date:6,isdisabled:false},{date:7,isdisabled:false},{date:8,isdisabled:false},{date:9,isdisabled:false},{date:10,isdisabled:false},{date:11,isdisabled:false},{date:12,isdisabled:false},{date:13,isdisabled:false},{date:14,isdisabled:false},{date:15,isdisabled:false},{date:16,isdisabled:false},{date:17,isdisabled:false},{date:18,isdisabled:false},{date:19,isdisabled:false},{date:20,isdisabled:false},{date:21,isdisabled:false},{date:22,isdisabled:false},{date:23,isdisabled:false},{date:24,isdisabled:false},{date:25,isdisabled:false},{date:26,isdisabled:false},{date:27,isdisabled:false},{date:28,isdisabled:false},{date:29,isdisabled:false},{date:30,isdisabled:false},{date:31,isdisabled:false}]; public dateonly: any = [{date:1,isdisabled:false},{date:2,isdisabled:false},{date:3,isdisabled:false},{date:4,isdisabled:false},{date:5,isdisabled:false},{date:6,isdisabled:false},{date:7,isdisabled:false},{date:8,isdisabled:false},{date:9,isdisabled:false},{date:10,isdisabled:false},{date:11,isdisabled:false},{date:12,isdisabled:false},{date:13,isdisabled:false},{date:14,isdisabled:false},{date:15,isdisabled:false},{date:16,isdisabled:false},{date:17,isdisabled:false},{date:18,isdisabled:false},{date:19,isdisabled:false},{date:20,isdisabled:false},{date:21,isdisabled:false},{date:22,isdisabled:false},{date:23,isdisabled:false},{date:24,isdisabled:false},{date:25,isdisabled:false},{date:26,isdisabled:false},{date:27,isdisabled:false},{date:28,isdisabled:false},{date:29,isdisabled:false},{date:30,isdisabled:false},{date:31,isdisabled:false}];
public todate: any[] = this.dateonly; public todate: any[] = this.dateonly;
@ViewChild('workExp') expFocus: ElementRef
constructor(public navCtrl: NavController, public navParams: NavParams,public fb:FormBuilder,public qustCat:QuestionCategoryProvider,public aws: AwsServiceProvider, public toast: ToastProvider,public constant:ConstantsProvider) { constructor(public navCtrl: NavController, public navParams: NavParams,public fb:FormBuilder,public qustCat:QuestionCategoryProvider,public aws: AwsServiceProvider, public toast: ToastProvider,public constant:ConstantsProvider) {
this.FormId = this.navParams.get('FormId'); this.FormId = this.navParams.get('FormId');
@ -145,6 +146,11 @@ export class PdQuestionEmpInfoPage {
this.toast.pdTriggerappmessage('Form Invalid Try Again.!'); this.toast.pdTriggerappmessage('Form Invalid Try Again.!');
return; return;
} }
if(this.workExperienceErrorFlag == true){
this.toast.pdTriggerappmessage('Total working Experience is Lower');
this.expFocus.nativeElement.focus();
return
}
let records: any = {}; let records: any = {};
records.pdid = this.pdDetails.pd_id; records.pdid = this.pdDetails.pd_id;
@ -256,6 +262,7 @@ checkWorkingExperiences(){
console.log(+this.employmentForm.controls.total_business_experience.value , +this.employmentForm.controls.how_long_year.value); console.log(+this.employmentForm.controls.total_business_experience.value , +this.employmentForm.controls.how_long_year.value);
this.workExperienceFlag = false; this.workExperienceFlag = false;
this.workExperienceErrorFlag = true; this.workExperienceErrorFlag = true;
this.expFocus.nativeElement.focus();
} }
else{ else{
this.workExperienceFlag = true; this.workExperienceFlag = true;
@ -301,6 +308,9 @@ inWords(val,flag:number){
this.employmentForm.controls['was_met'].setValue(Emp.was_met); this.employmentForm.controls['was_met'].setValue(Emp.was_met);
this.employmentForm.controls['total_business_experience'].setValue(Emp.total_business_experience); this.employmentForm.controls['total_business_experience'].setValue(Emp.total_business_experience);
this.employmentForm.controls['total_business_previous_experience'].setValue(Emp.total_business_previous_experience); this.employmentForm.controls['total_business_previous_experience'].setValue(Emp.total_business_previous_experience);
if(this.employmentForm.controls['total_business_experience'] != null && this.employmentForm.controls['total_business_previous_experience'] != null){
//this.checkWorkingExperiences();
}
if (Emp.name_person_met) { if (Emp.name_person_met) {
this.employmentForm.controls['name_person_met'].setValue(Emp.name_person_met); this.employmentForm.controls['name_person_met'].setValue(Emp.name_person_met);

View File

@ -44,16 +44,29 @@
<h5>Residence Details of {{FamilyMemberAsLabel[i]}}</h5> <h5>Residence Details of {{FamilyMemberAsLabel[i]}}</h5>
<mat-form-field> <mat-form-field>
<mat-select matInput placeholder="State" formControlName="residence_state" required (selectionChange)="getCity($event.value,i)" > <mat-select matInput placeholder="State" formControlName="residence_state" required (selectionChange)="getCity($event.value,i)" >
<mat-option>
<ngx-mat-select-search formControlName="stateSearch" (keyup)="searchFun(tech,i,'state')"
[placeholderLabel]="'Find State'" [noEntriesFoundLabel]="'No Matching Result'">
<ion-icon name="md-close" ngxMatSelectSearchClear></ion-icon>
</ngx-mat-select-search>
</mat-option>
<mat-option>Select</mat-option> <mat-option>Select</mat-option>
<mat-option [value]="s.state_id" *ngFor="let s of stateData"> <mat-option [value]="s.state_id" *ngFor="let s of stateDataValue">
{{s.name}} {{s.name}}
</mat-option> </mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field>
<mat-select matInput placeholder="City" formControlName="residence_city" required> <mat-select matInput placeholder="City" formControlName="residence_city" required>
<mat-option>
<ngx-mat-select-search formControlName="citySearch" (keyup)="searchFun(tech,i,'city')"
[placeholderLabel]="'Find City'"
[noEntriesFoundLabel]="'No Matching Result'">
<ion-icon name="md-close" ngxMatSelectSearchClear></ion-icon>
</ngx-mat-select-search>
</mat-option>
<mat-option>Select</mat-option> <mat-option>Select</mat-option>
<mat-option *ngFor="let c of cityData[i]" [value]="c.city_id" > <mat-option *ngFor="let c of cityDataValue[i]" [value]="c.city_id" >
{{c.city_name}} {{c.city_name}}
</mat-option> </mat-option>
</mat-select> </mat-select>
@ -63,8 +76,15 @@
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field>
<mat-select matInput placeholder="Pin" formControlName="residence_pin" required> <mat-select matInput placeholder="Pin" formControlName="residence_pin" required>
<mat-option>
<ngx-mat-select-search formControlName="pinSearch" (keyup)="searchFun(tech,i,'pin')"
[placeholderLabel]="'Search Pincode'"
[noEntriesFoundLabel]="'No Matching Result'">
<ion-icon name="md-close" ngxMatSelectSearchClear></ion-icon>
</ngx-mat-select-search>
</mat-option>
<mat-option>Select</mat-option> <mat-option>Select</mat-option>
<mat-option *ngFor="let p of pincodeData[i]" [value]="p.pincode_id"> <mat-option *ngFor="let p of pincodeDataValue[i]" [value]="p.pincode_id">
{{p.pincode}} {{p.pincode}}
</mat-option> </mat-option>
</mat-select> </mat-select>
@ -360,6 +380,7 @@
</mat-card-content> </mat-card-content>
</mat-card> </mat-card>
<br/>--> <br/>-->
<button ion-button full round color="primary" (click)="add()"><ion-icon name="person-add"></ion-icon>&nbsp;&nbsp; Other Applicant</button><br/>
<mat-card> <mat-card>
<mat-form-field style="width: 100%"> <mat-form-field style="width: 100%">
<textarea matInput placeholder="Remarks" <textarea matInput placeholder="Remarks"
@ -372,14 +393,17 @@
</ion-row> </ion-row>
<!-- <ion-buttons > <!-- <ion-buttons >
<ion-button color="optblue" full[disabled]="!pdforms.valid" mat-raised-button style="width:100%" (click)="savepdDetails(pdforms.value)">Save <ion-icon name="md-disc"></ion-icon></ion-button> --> <ion-button color="optblue" full[disabled]="!pdforms.valid" mat-raised-button style="width:100%" (click)="savepdDetails(pdforms.value)">Save <ion-icon name="md-disc"></ion-icon></ion-button> -->
<button ion-button strong color="optblue" block round (click)="savepdfamily(familyForm.value)"> Save</button>
<!-- </ion-buttons> --> <!-- </ion-buttons> -->
</ion-row> </ion-row>
</form> </form>
<ion-fab right bottom mini> <!-- <ion-fab right bottom mini>
<button mini ion-fab color="optblue" (click)="add()"><ion-icon name="add" style="font-size: 24px"></ion-icon></button></ion-fab> <button mini ion-fab color="optblue" (click)="add()"><ion-icon name="add" style="font-size: 24px"></ion-icon></button></ion-fab> -->
</ion-content> </ion-content>
<ion-footer>
<button ion-button strong color="optblue" block (click)="savepdfamily(familyForm.value)"> Save</button>
</ion-footer>

View File

@ -6,6 +6,8 @@ import { AwsServiceProvider } from '../../../providers/aws-service/aws-service';
import { ToastProvider } from '../../../providers/common-provider/toast'; import { ToastProvider } from '../../../providers/common-provider/toast';
import { controlNameBinding } from '@angular/forms/src/directives/reactive_directives/form_control_name'; import { controlNameBinding } from '@angular/forms/src/directives/reactive_directives/form_control_name';
import { ConstantsProvider } from '../../../providers/constants/constants' import { ConstantsProvider } from '../../../providers/constants/constants'
import { takeUntil } from 'rxjs/operators';
import { Subject } from 'rxjs';
/** /**
* Generated class for the PdQuestionFamilyPage page. * Generated class for the PdQuestionFamilyPage page.
@ -57,6 +59,10 @@ data:any;
RentAmount: any=[]; RentAmount: any=[];
IncomePerMonth: any=[]; IncomePerMonth: any=[];
// cons: any; // cons: any;
cityDataValue:any=[]
stateDataValue:any=[]
protected _onDestroy = new Subject<void>();
pincodeDataValue: any=[];
constructor(public navCtrl: NavController, public navParams: NavParams,public fb:FormBuilder, constructor(public navCtrl: NavController, public navParams: NavParams,public fb:FormBuilder,
public qustCat:QuestionCategoryProvider,public aws:AwsServiceProvider,public toast:ToastProvider,public cons:ConstantsProvider) { public qustCat:QuestionCategoryProvider,public aws:AwsServiceProvider,public toast:ToastProvider,public cons:ConstantsProvider) {
@ -94,7 +100,10 @@ data:any;
selected_person: ['', Validators.compose([Validators.required])], selected_person: ['', Validators.compose([Validators.required])],
residence_place: ['', Validators.compose([])], residence_place: ['', Validators.compose([])],
residence_city: ['', Validators.compose([])], residence_city: ['', Validators.compose([])],
citySearch:[''],
residence_state: ['', Validators.compose([])], residence_state: ['', Validators.compose([])],
stateSearch:[''],
pinSearch:[''],
residence_pin: ['', Validators.compose([])], residence_pin: ['', Validators.compose([])],
residence_other_pincode:['',Validators.compose([])], residence_other_pincode:['',Validators.compose([])],
residence_No_of_years: ['', Validators.compose([])], residence_No_of_years: ['', Validators.compose([])],
@ -119,7 +128,10 @@ data:any;
selected_person:[val.selected_person], selected_person:[val.selected_person],
residence_place:[val.residence_place], residence_place:[val.residence_place],
residence_city:[val.residence_city], residence_city:[val.residence_city],
citySearch:[''],
residence_state:[val.residence_state], residence_state:[val.residence_state],
stateSearch:[''],
pinSearch:[''],
residence_pin:[val.residence_pin], residence_pin:[val.residence_pin],
residence_other_pincode:[val.residence_other_pincode], residence_other_pincode:[val.residence_other_pincode],
residence_No_of_years: [val.residence_No_of_years,Validators.compose([])], residence_No_of_years: [val.residence_No_of_years,Validators.compose([])],
@ -347,6 +359,7 @@ data:any;
{ {
if(res['dataStatus']==true){ if(res['dataStatus']==true){
this.stateData=res['records'].filter(item=>item.isactive==1); this.stateData=res['records'].filter(item=>item.isactive==1);
this.stateDataValue=this.stateData.slice();
} }
}) })
@ -357,7 +370,9 @@ getCity(e,i){
this.qustCat.getStateWiseCities(e).subscribe(data=>{ this.qustCat.getStateWiseCities(e).subscribe(data=>{
if (data['dataStatus'] == true) { if (data['dataStatus'] == true) {
this.cityData[i] = data.records.cities; this.cityData[i] = data.records.cities;
this.cityDataValue[i]=this.cityData[i].slice();
this.pincodeData[i] = data.records.pincode; this.pincodeData[i] = data.records.pincode;
this.pincodeDataValue[i]=this.pincodeData[i].slice()
} }
}); });
} }
@ -800,4 +815,87 @@ resValue:any;
}) })
} }
} }
}
searchFun(control:any,i:number,option){
console.log("control",control)
if (option == 'city') {
// this.cityData[i]=this.filterCity(this.stateList,control.value.state_name)
control.controls['citySearch'].valueChanges
.pipe(takeUntil(this._onDestroy))
.subscribe(() => {
this.SearchCity(control.controls['citySearch'].value, i);
})
}
if (option == 'state') {
console.log("state")
control.controls['stateSearch'].valueChanges
.pipe(takeUntil(this._onDestroy))
.subscribe(()=>{
this.searchState(control.controls['stateSearch'].value)
})
}
if (option == 'pin') {
console.log("pin")
control.controls['pinSearch'].valueChanges
.pipe(takeUntil(this._onDestroy))
.subscribe(()=>{
this.searchPin(control.controls['pinSearch'].value,i)
})
}
}
searchPin(val:any,index:number){
if(!this.pincodeData[index]){
return
}
let searchValue=val
if(!searchValue){
this.pincodeDataValue[index]=this.pincodeData[index].slice()
return
}else{
searchValue=searchValue.toLowerCase()
}
this.pincodeDataValue[index]=this.pincodeData[index].filter(value=>value.pincode.toLowerCase().indexOf(searchValue) > -1)
}
SearchCity(val: any, i: number) {
// let cityData=
console.log(this.cityData[i])
if (!this.cityData[i]) {
return
}
let searchValue = val
if (!searchValue) {
this.cityDataValue[i]=this.cityData[i].slice()
return
} else {
searchValue = searchValue.toLowerCase()
}
this.cityDataValue[i]=
this.cityData[i].filter(val=>val.city_name.toLowerCase().indexOf(searchValue)> -1)
console.log("City Data value",this.cityDataValue[i])
// this.filteredCity.next(
// this.cityData[i].filter(value => value.city_name.toLowerCase().indexOf(searchValue) > -1)
// )
}
searchState(val: any) {
console.log("statedata")
if (!this.stateData) {
return
}
let searchVal = val
if (!searchVal) {
// this.filteredState.next(this.stateList.slice())
this.stateDataValue=this.stateData.slice()
return
}
else {
searchVal = searchVal.toLowerCase()
}
this.stateDataValue=this.stateData.filter(res => res.name.toLowerCase().indexOf(searchVal) > -1)
// this.filteredState.next(
// this.stateList.filter(res => res.state_name.toLowerCase().indexOf(searchVal) > -1)
// )
}
}

View File

@ -23,7 +23,7 @@
<mat-form-field> <mat-form-field>
<mat-select placeholder="Customer Behaviour" formControlName="final_custormer_remark_type"> <mat-select placeholder="Customer Behaviour" formControlName="final_custormer_remark_type">
<mat-option>Select</mat-option> <mat-option>Select</mat-option>
<mat-option *ngFor="let pm of m_remarkTypeCustomerBehaviour" [value]="pm.customer_behaviour_id">{{pm.description}}</mat-option> <mat-option *ngFor="let pm of m_remarkTypeCustomerBehaviour" [value]="pm.customer_behaviour_id">{{pm.customer_behaviour_id == 1 ? 'Other Negative Behaviour': pm.description }}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf="_finalRemarkForm.controls['final_custormer_remark_type'].value == 1"> <mat-form-field *ngIf="_finalRemarkForm.controls['final_custormer_remark_type'].value == 1">
@ -42,8 +42,8 @@
formControlName="is_service_provided" required> formControlName="is_service_provided" required>
<mat-option>Select</mat-option> <mat-option>Select</mat-option>
<mat-option>Select</mat-option>
<mat-option value="well_suited.">Well Suited.</mat-option> <mat-option value="well_suited">Well Suited</mat-option>
<mat-option value="fairly_suited">Fairly Suited</mat-option> <mat-option value="fairly_suited">Fairly Suited</mat-option>
<mat-option value="not_suited">Not Suited</mat-option> <mat-option value="not_suited">Not Suited</mat-option>
</mat-select> </mat-select>
@ -127,12 +127,15 @@
</mat-card> </mat-card>
<mat-card> <mat-card>
<mat-form-field appearance="outline"> <mat-form-field appearance="outline">
<mat-label>Remarks</mat-label> <mat-label>Other Remarks</mat-label>
<textarea matInput autocomplete="off" placeholder="Other Remarks" formControlName="final_form_remarks" ></textarea> <textarea matInput autocomplete="off" placeholder="Other Remarks" formControlName="final_form_remarks" ></textarea>
</mat-form-field> </mat-form-field>
</mat-card> </mat-card>
<ion-row> <ion-row>
<button ion-button full color="optblue" type="submit" (click)="saveFinalRemark()"> Save</button>
</ion-row> </ion-row>
</form> </form>
</ion-content> </ion-content>
<ion-footer>
<button ion-button full color="optblue" type="submit" (click)="saveFinalRemark()"> Save</button>
</ion-footer>

View File

@ -362,7 +362,7 @@
<!-- <ion-buttons > <!-- <ion-buttons >
<ion-button color="optblue" full[disabled]="!pdforms.valid" mat-raised-button style="width:100%" (click)="savepdDetails(pdforms.value)">Save <ion-icon name="md-disc"></ion-icon></ion-button> --> <ion-button color="optblue" full[disabled]="!pdforms.valid" mat-raised-button style="width:100%" (click)="savepdDetails(pdforms.value)">Save <ion-icon name="md-disc"></ion-icon></ion-button> -->
<button ion-button full color="optblue" (click)="submitData(generalForm.value)"> Save</button>
<!-- </ion-buttons> --> <!-- </ion-buttons> -->
</ion-row> </ion-row>
@ -421,3 +421,6 @@
</div> </div>
</mat-card>--> </mat-card>-->
</ion-content> </ion-content>
<ion-footer>
<button ion-button full color="optblue" (click)="submitData(generalForm.value)"> Save</button>
</ion-footer>

View File

@ -412,6 +412,7 @@ export class PdQuestionGeneralInfoPage {
} }
initCompanyRelationShip(value):void{ initCompanyRelationShip(value):void{
console.log(value)
if(value=='') if(value=='')
{ {
let formData:FormGroup=this.fb.group({ let formData:FormGroup=this.fb.group({
@ -423,6 +424,7 @@ export class PdQuestionGeneralInfoPage {
control.push(formData); control.push(formData);
} }
else{ else{
console.log("data",value);
for(let val of value){ for(let val of value){
let formData:FormGroup=this.fb.group({ let formData:FormGroup=this.fb.group({
applicant_name:[val.applicant_name], applicant_name:[val.applicant_name],
@ -988,13 +990,15 @@ console.log('1)',this.temp);
exist_company_with_relationship=Object.keys(res['records'].company_with_relationships).map(function(key){ exist_company_with_relationship=Object.keys(res['records'].company_with_relationships).map(function(key){
return res['records'].company_with_relationships[key]; return res['records'].company_with_relationships[key];
}) })
console.log("Customer Segment",this.customer_segment_abbr)
if(this.customer_segment_abbr !='SE-RI') if(this.customer_segment_abbr !='SE-RI')
{ {
if(exist_company_with_relationship.length>0){ if(exist_company_with_relationship.length>0){
exist_company_with_relationship.forEach(key=>{ // exist_company_with_relationship.forEach(key=>{
this.initCompanyRelationShip(key) // console.log("company relation",key)
}) // this.initCompanyRelationShip(key)
// })
this.initCompanyRelationShip(exist_company_with_relationship);
} }
else if(exist_company_with_relationship.length==0){ else if(exist_company_with_relationship.length==0){
this.initCompanyRelationShip(''); this.initCompanyRelationShip('');

View File

@ -207,8 +207,11 @@
<ion-row> <ion-row>
<!-- <ion-buttons > <!-- <ion-buttons >
<ion-button color="optblue" full[disabled]="!pdforms.valid" mat-raised-button style="width:100%" (click)="savepdDetails(pdforms.value)">Save <ion-icon name="md-disc"></ion-icon></ion-button> --> <ion-button color="optblue" full[disabled]="!pdforms.valid" mat-raised-button style="width:100%" (click)="savepdDetails(pdforms.value)">Save <ion-icon name="md-disc"></ion-icon></ion-button> -->
<button ion-button full color="optblue" (click)="submitLoanDetails()"> Save</button>
<!-- </ion-buttons> --> <!-- </ion-buttons> -->
</ion-row> </ion-row>
</form> </form>
</ion-content> </ion-content>
<ion-footer>
<button ion-button full color="optblue" (click)="submitLoanDetails()"> Save</button>
</ion-footer>

View File

@ -102,6 +102,7 @@
<mat-option>Select</mat-option> <mat-option>Select</mat-option>
<mat-option value="Positive">Positive</mat-option> <mat-option value="Positive">Positive</mat-option>
<mat-option value="Negative">Negative</mat-option> <mat-option value="Negative">Negative</mat-option>
<mat-option value="Could not verify" >Could not verify</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
</div> </div>
@ -202,8 +203,11 @@
</mat-card> </mat-card>
<ion-row> <ion-row>
<button ion-button full color="optblue" (click)="submitData(neighbourhoodForm.value)"> Save</button>
<!-- </ion-buttons> --> <!-- </ion-buttons> -->
</ion-row> </ion-row>
</form> </form>
</ion-content> </ion-content>
<ion-footer>
<button ion-button full color="optblue" (click)="submitData(neighbourhoodForm.value)"> Save</button>
</ion-footer>

View File

@ -104,8 +104,11 @@
<!-- <ion-buttons > <!-- <ion-buttons >
<ion-button color="optblue" <ion-button color="optblue"
full[disabled]="!pdforms.valid" mat-raised-button style="width:100%" (click)="savepdDetails(pdforms.value)">Save <ion-icon name="md-disc"></ion-icon></ion-button> --> full[disabled]="!pdforms.valid" mat-raised-button style="width:100%" (click)="savepdDetails(pdforms.value)">Save <ion-icon name="md-disc"></ion-icon></ion-button> -->
<button ion-button full color="optblue" (click)="submitOtherIncome(otherIncomeForm.value)" > Save</button>
<!-- </ion-buttons> --> <!-- </ion-buttons> -->
</ion-row> </ion-row>
</form> </form>
</ion-content> </ion-content>
<ion-footer>
<button ion-button full color="optblue" (click)="submitOtherIncome(otherIncomeForm.value)" > Save</button>
</ion-footer>

View File

@ -42,7 +42,7 @@ export class PdQuestionOtherIncomePage {
this.pdDetails = this.navParams.get('pdDetails'); this.pdDetails = this.navParams.get('pdDetails');
this.pdid=this.pdDetails.pd_id; this.pdid=this.pdDetails.pd_id;
this.FormId = this.navParams.get('FormId'); this.FormId = this.navParams.get('FormId');
this.applicants=this.pdDetails.applicat_details this.applicants=this.pdDetails.applicat_details.filter(val=>val.pd_co_applicant_id != 0)
this.applicants.push({'pd_co_applicant_id': 0,'applicant_name': "Others"}) this.applicants.push({'pd_co_applicant_id': 0,'applicant_name': "Others"})
this.getFrequency(); this.getFrequency();
this.users = this.aws.getlocale(); this.users = this.aws.getlocale();

View File

@ -19,7 +19,7 @@ public commonimage = "http://ssa.sineedge.com/sparqapi/logo/avatar.jpg";
let testapiurl = 'http://ssa.sineedge.com/sparqtest/api/'; let testapiurl = 'http://ssa.sineedge.com/sparqtest/api/';
let devapiurl = 'http://ssa.sineedge.com/sparqapi/api/'; let devapiurl = 'http://ssa.sineedge.com/sparqapi/api/';
let localapiurl = 'http://192.168.0.9/sparqapi/api/'; let localapiurl = 'http://192.168.0.9/sparqapi/api/';
return testapiurl; return devapiurl;
} }
getcurrentDate() getcurrentDate()

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -29051,6 +29051,27 @@ page-pd-question-assessed-daily-sales .input-cover {
position: static; position: static;
} }
page-pd-question-assessed-daily-sales .mat-card {
margin-bottom: 15px;
border-radius: 10px !important;
-webkit-box-shadow: 0 16px 38px -12px rgba(0, 0, 0, 0.56), 0 4px 25px 0 rgba(0, 0, 0, 0.12), 0 8px 10px -5px rgba(0, 0, 0, 0.2) !important;
box-shadow: 0 16px 38px -12px rgba(0, 0, 0, 0.56), 0 4px 25px 0 rgba(0, 0, 0, 0.12), 0 8px 10px -5px rgba(0, 0, 0, 0.2) !important;
}
page-pd-question-assessed-daily-sales .mat-card-content {
margin-bottom: 0px !important;
}
page-pd-question-assessed-daily-sales .scroll-content {
background-color: #eee;
}
page-pd-question-assessed-daily-sales mat-radio-button {
width: 100%;
padding-top: 10px;
padding-bottom: 10px;
}
page-pd-question-assessed-dash .mat-card { page-pd-question-assessed-dash .mat-card {
border-radius: 10px; border-radius: 10px;
-webkit-box-shadow: 0 16px 38px -12px rgba(0, 0, 0, 0.56), 0 4px 25px 0 rgba(0, 0, 0, 0.12), 0 8px 10px -5px rgba(0, 0, 0, 0.2) !important; -webkit-box-shadow: 0 16px 38px -12px rgba(0, 0, 0, 0.56), 0 4px 25px 0 rgba(0, 0, 0, 0.12), 0 8px 10px -5px rgba(0, 0, 0, 0.2) !important;
@ -29179,6 +29200,26 @@ page-pd-question-assessed-info input {
height: 30px; height: 30px;
} }
page-pd-question-assessed-sales mat-radio-button {
padding-top: 10px;
padding-bottom: 10px;
}
page-pd-question-assessed-sales .mat-card {
margin-bottom: 15px;
border-radius: 10px !important;
-webkit-box-shadow: 0 16px 38px -12px rgba(0, 0, 0, 0.56), 0 4px 25px 0 rgba(0, 0, 0, 0.12), 0 8px 10px -5px rgba(0, 0, 0, 0.2) !important;
box-shadow: 0 16px 38px -12px rgba(0, 0, 0, 0.56), 0 4px 25px 0 rgba(0, 0, 0, 0.12), 0 8px 10px -5px rgba(0, 0, 0, 0.2) !important;
}
page-pd-question-assessed-sales .mat-card-content {
margin-bottom: 0px !important;
}
page-pd-question-assessed-sales .scroll-content {
background-color: #eee;
}
page-pd-question-assessed-summary .val { page-pd-question-assessed-summary .val {
font-weight: bold; font-weight: bold;
} }
@ -29474,6 +29515,10 @@ page-pd-question-business-info mat-select {
margin-top: 8px; margin-top: 8px;
} }
page-pd-question-business-info .checkbo {
margin: 15px;
}
page-pd-question-client-info mat-hint { page-pd-question-client-info mat-hint {
font-size: 12px; font-size: 12px;
} }