supplier form changes : ps

This commit is contained in:
venbatechnologies@gmail.com 2019-07-04 20:08:25 +05:30
parent 54d868b0d8
commit 5c3a90de96
19 changed files with 1557 additions and 1287 deletions

View File

@ -1 +1 @@
{"version":3,"sources":["../../@angular/common/http (ignored)"],"names":[],"mappings":";;;;;AAAA,e","file":"0.js","sourcesContent":["/* (ignored) */\n\n\n//////////////////\n// WEBPACK FOOTER\n// @angular/common/http (ignored)\n// module id = 713\n// module chunks = 0"],"sourceRoot":""} {"version":3,"sources":["../../@angular/common/http (ignored)"],"names":[],"mappings":";;;;;AAAA,e","file":"0.js","sourcesContent":["/* (ignored) */\n\n\n//////////////////\n// WEBPACK FOOTER\n// @angular/common/http (ignored)\n// module id = 712\n// module chunks = 0"],"sourceRoot":""}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2004
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -111,7 +111,6 @@ import { PdQuestionGeneralOtherApplicantPage } from '../pages/pd-question/pd-que
import { PdQuestionNeighbourHoodPage } from '../pages/pd-question/pd-question-neighbour-hood/pd-question-neighbour-hood'; import { PdQuestionNeighbourHoodPage } from '../pages/pd-question/pd-question-neighbour-hood/pd-question-neighbour-hood';
import { PdQuestionFinalRemarkPage } from '../pages/pd-question/pd-question-final-remark/pd-question-final-remark'; import { PdQuestionFinalRemarkPage } from '../pages/pd-question/pd-question-final-remark/pd-question-final-remark';
import { PdQuestionFuturePlansAndBusinessEnvironmentPage } from '../pages/pd-question/pd-question-business-group/pd-question-future-plans-and-business-environment/pd-question-future-plans-and-business-environment'; import { PdQuestionFuturePlansAndBusinessEnvironmentPage } from '../pages/pd-question/pd-question-business-group/pd-question-future-plans-and-business-environment/pd-question-future-plans-and-business-environment';
import { PdQuestionBusinessPage } from '../pages/pd-question/pd-question-business/pd-question-business'
import { PdQuestionBusinessGroupPage } from '../pages/pd-question/pd-question-business-group/pd-question-business-group' import { PdQuestionBusinessGroupPage } from '../pages/pd-question/pd-question-business-group/pd-question-business-group'
import { PdQuestionBusinessAssetsPage } from '../pages/pd-question/pd-question-business-group/pd-question-business-assets/pd-question-business-assets' import { PdQuestionBusinessAssetsPage } from '../pages/pd-question/pd-question-business-group/pd-question-business-assets/pd-question-business-assets'
import {PdQuestionBusinessBankingPage} from '../pages/pd-question/pd-question-business-group/pd-question-business-banking/pd-question-business-banking' import {PdQuestionBusinessBankingPage} from '../pages/pd-question/pd-question-business-group/pd-question-business-banking/pd-question-business-banking'
@ -183,7 +182,6 @@ import {Push} from '@ionic-native/push'
PdQuestionNeighbourHoodPage, PdQuestionNeighbourHoodPage,
PdQuestionFinalRemarkPage, PdQuestionFinalRemarkPage,
PdQuestionFuturePlansAndBusinessEnvironmentPage, PdQuestionFuturePlansAndBusinessEnvironmentPage,
PdQuestionBusinessPage,
PdQuestionBusinessGroupPage, PdQuestionBusinessGroupPage,
PdQuestionBusinessAssetsPage, PdQuestionBusinessAssetsPage,
PdQuestionBusinessBankingPage, PdQuestionBusinessBankingPage,
@ -284,7 +282,6 @@ import {Push} from '@ionic-native/push'
PdQuestionNeighbourHoodPage, PdQuestionNeighbourHoodPage,
PdQuestionFinalRemarkPage, PdQuestionFinalRemarkPage,
PdQuestionFuturePlansAndBusinessEnvironmentPage, PdQuestionFuturePlansAndBusinessEnvironmentPage,
PdQuestionBusinessPage,
PdQuestionBusinessGroupPage, PdQuestionBusinessGroupPage,
PdQuestionBusinessAssetsPage, PdQuestionBusinessAssetsPage,
PdQuestionBusinessBankingPage, PdQuestionBusinessBankingPage,

View File

@ -30,7 +30,6 @@ import { PdQuestionLenderRepresentativePage } from '../pd-question/pd-question-l
import { PdQuestionGeneralInfoPage } from '../pd-question/pd-question-general-info/pd-question-general-info'; import { PdQuestionGeneralInfoPage } from '../pd-question/pd-question-general-info/pd-question-general-info';
import { PdQuestionNeighbourHoodPage } from '../pd-question/pd-question-neighbour-hood/pd-question-neighbour-hood'; import { PdQuestionNeighbourHoodPage } from '../pd-question/pd-question-neighbour-hood/pd-question-neighbour-hood';
import { PdQuestionFinalRemarkPage } from '../pd-question/pd-question-final-remark/pd-question-final-remark'; import { PdQuestionFinalRemarkPage } from '../pd-question/pd-question-final-remark/pd-question-final-remark';
import { PdQuestionBusinessPage } from '../pd-question/pd-question-business/pd-question-business'
import { PdQuestionBusinessGroupPage } from '../pd-question/pd-question-business-group/pd-question-business-group' import { PdQuestionBusinessGroupPage } from '../pd-question/pd-question-business-group/pd-question-business-group'
import {PdQuestionRentalDashPage} from '../pd-question/pd-question-rental-info/pd-question-rental-dash/pd-question-rental-dash' import {PdQuestionRentalDashPage} from '../pd-question/pd-question-rental-info/pd-question-rental-dash/pd-question-rental-dash'
import { PdQuestionFuturePlansAndBusinessEnvironmentPage } from '../pd-question/pd-question-business-group/pd-question-future-plans-and-business-environment/pd-question-future-plans-and-business-environment' import { PdQuestionFuturePlansAndBusinessEnvironmentPage } from '../pd-question/pd-question-business-group/pd-question-future-plans-and-business-environment/pd-question-future-plans-and-business-environment'

View File

@ -431,6 +431,98 @@
</mat-form-field> </mat-form-field>
</div> </div>
</mat-card> </mat-card>
<!-- <mat-card *ngIf="servicingForm || SPCommentCard">
<div *ngIf="servicingForm">
<mat-card-title><h5>Service Provider Details</h5></mat-card-title>
<div formArrayName="servicing_details">
<div *ngFor="let spd of stockForms.controls.servicing_details['controls']; let k=index"
[formGroupName]="k">
<div formArrayName="service_provider">
<div *ngFor="let sp of spd.controls.service_provider['controls']; let g=index;let last = last"
[formGroupName]="g">
<mat-card-subtitle>Service Provider #{{g+1}}</mat-card-subtitle>
<mat-card-content class="matcard">
<mat-form-field style="width:100%">
<input matInput autocomplete="off" placeholder="Name" formControlName="service_provider_name">
</mat-form-field>
<mat-form-field style="width:100%">
<mat-select placeholder="Stock" formControlName="service_provider_observed"
(selectionChange)="checkComments($event.value,5,g)" required>
<mat-option>Select</mat-option>
<mat-option value="yes">Add Stock Details</mat-option>
<mat-option value="no">No stock observed</mat-option>
</mat-select>
</mat-form-field>
<span *ngIf="tradetg.get('traded_goods_observed').value == 'yes'">
<mat-form-field style="width:100%">
<input matInput autocomplete="off" placeholder="Estimated Quantity"
formControlName="traded_goods_quantity" type="number">
</mat-form-field>
<mat-form-field style="width:100%">
<mat-select placeholder="Unit of Mearsurement" formControlName="traded_goods_uom">
<mat-option>Select</mat-option>
<mat-option>
<ngx-mat-select-search formControlName="uomSearch"
[placeholderLabel]="'Search Unit'"
[noEntriesFoundLabel]="'No Matching Result'" (keyup)="searchFun(tradetg,a)">
<ion-icon name="md-close" ngxMatSelectSearchClear></ion-icon>
</ngx-mat-select-search>
</mat-option>
<mat-option> Select</mat-option>
<mat-option value="{{uom.uom_id}}" *ngFor="let uom of uomDataValue">{{uom.name}}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="tradetg.get('traded_goods_uom').value == 1" style="width:100%">
<input matInput autocomplete="off" placeholder="Specify UOM"
formControlName="traded_goods_other_uom">
</mat-form-field>
<mat-form-field style="width:100%">
<input matInput autocomplete="off" placeholder="Estimated Value of Stock Observed"
formControlName="estimated_traded_goods_value" type="number"
(keyup)="inWords($event.target.value,4,g)">
<mat-hint align="start" style="font-size:70%" *ngIf="tradetg.get('estimated_traded_goods_value').value != ''">{{"&#8377;"}}
{{T_tradedGoodsValueInWords[g]}} Only</mat-hint>
</mat-form-field>
</span>
</mat-card-content>
<mat-card-actions>
<ion-buttons end>
<ion-col col-3 offset-3>
<a (click)="deleteTradedGoods(g,2)" *ngIf="td.controls.trading_traded_goods.controls.length>1">
<ion-icon name="md-trash" color="optblue" style="font-size: 22px;"></ion-icon>
</a>
</ion-col>
<ion-col col-2 offset-1>
<a (click)="addTradedGoods(2)" *ngIf="last">
<ion-icon name="add-circle" color="optblue" style="font-size: 24px;"></ion-icon>
</a>
</ion-col>
</ion-buttons>
</mat-card-actions>
</div>
</div>
</div>
</div>
</div>
<div *ngIf="TGCommentCard">
<br>
<mat-form-field style="width:100%">
<mat-placeholder>Is the stock of finished / traded goods observed, sufficient considering the size of operations</mat-placeholder><br/>
<mat-select formControlName="is_sufficiant_finished_and_traded_goods">
<mat-option>Select</mat-option>
<mat-option *ngFor="let val of TGsufficientList" [value]="val.value" [disabled]="val.isdisabled">
{{val.isdisplayvalue}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field appearance="outline" style="width: 100%" *ngIf="this.stockForm.controls.is_sufficiant_finished_and_traded_goods.value == 'no'">
<mat-label> <i>Please comment on the stock level observed?</i> </mat-label>
<textarea matInput autocomplete="off" placeholder="Please comment on the stock level observed" formControlName="finished_and_traded_goods_remarks"></textarea>
</mat-form-field>
</div>
</mat-card> -->
<mat-card *ngIf="serviceProviderForm"> <mat-card *ngIf="serviceProviderForm">
<mat-card-title><h5>Service Provider Details</h5></mat-card-title> <mat-card-title><h5>Service Provider Details</h5></mat-card-title>
<div style="text-align: center; margin: 12px;">Service Provider Details Not applicable here !!</div> <div style="text-align: center; margin: 12px;">Service Provider Details Not applicable here !!</div>

View File

@ -295,14 +295,130 @@
</div> </div>
</div> </div>
</mat-card> </mat-card>
<mat-card *ngIf="serviceProviderForm"> <mat-card *ngIf="servicingForm">
<mat-card-title>
<h5>Service Provider Details</h5>
</mat-card-title>
<div formArrayName="servicing_details">
<div *ngFor="let serv of supplierInfoForm.controls.servicing_details['controls']; let i=index" [formGroupName]="i">
<div formArrayName="service_providers">
<div *ngFor="let ser of serv.controls.service_providers['controls']; let s=index; let last = last"
[formGroupName]="s">
<mat-card-subtitle>Service Provider #{{s+1}}</mat-card-subtitle>
<mat-card-content>
<div fxLayout="row nowrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width: 100%">
<mat-select placeholder="Service Provide Name" formControlName="service_provider_name">
<mat-option>Select</mat-option>
<mat-option *ngFor="let sp of business_serviceProvider" [value]="sp.name">{{sp.name }}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 100%">
<input matInput placeholder="Supplier Name" formControlName="service_provider_supplier_name">
</mat-form-field>
<mat-form-field style="width: 100%">
<mat-select placeholder="Title" formControlName="person_title_name">
<mat-option>Select</mat-option>
<mat-option *ngFor="let tl of m_titleList" [value]="tl.title_id">
{{tl.name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 100%">
<input matInput placeholder="Contact Person Name" formControlName="service_provider_contact_person_name"
maxlength="10">
</mat-form-field>
<mat-form-field style="width: 100%">
<mat-select placeholder="Contact Person Designation" formControlName="person_designation"
(selectionChange)="selectedPersonDesignation(ser,$event.value,3)">
<mat-option>Select</mat-option>
<mat-option *ngFor="let comrelShip of m_companyRelationShipList" [value]="comrelShip.company_relationship_id">
{{comrelShip.name}}
</mat-option>
<!-- <mat-option value="1" > Not Applicable </mat-option> -->
</mat-select>
</mat-form-field>
<mat-form-field style="width: 100%" *ngIf="ser.get('person_designation').value == 1">
<input matInput placeholder="Specify Person Designation" formControlName="other_person_designation">
</mat-form-field>
<mat-form-field style="width: 100%">
<input matInput placeholder="Contact Person Mobile Number" autocomplete="off" formControlName="service_provider_contact_person_mobile_number"
type="tel" maxlength="10" minlength="10">
<mat-error style="font-size: 12px">Enter Valid Mobile Number</mat-error>
</mat-form-field>
<mat-form-field style="width: 100%">
<input matInput autocomplete="off" placeholder="STD Code" formControlName="person_stdcode" type="tel"
minlength="3" maxlength="5">
<mat-error style="font-size: 12px">Enter Valid STD Code Number</mat-error>
</mat-form-field>
<!-- &nbsp; - &nbsp; -->
<mat-form-field style="width: 100%">
<input matInput autocomplete="off" placeholder="Contact Person Landline Number" formControlName="person_landline"
type="tel" minlength="6" maxlength="8">
<mat-error style="font-size: 12px">Enter Valid LandLine Number</mat-error>
</mat-form-field>
<mat-form-field style="width: 100%">
<mat-select placeholder="Payment Terms" formControlName="service_provider_payment_type"
(selectionChange)="selectedPaymentTerms(ser,$event.value,3);checkCard($event.value,3,s);">
<mat-option>Select</mat-option>
<mat-option *ngFor="let pm of m_paymentList" [value]="pm.id">{{ pm.name }}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 100%">
<mat-select placeholder="Payment Mode" formControlName="service_provider_payment_mode">
<mat-option>Select</mat-option>
<mat-option value="Payment made in Cash.">Payment made in Cash.</mat-option>
<mat-option value="Payment made through Banking channels.">Payment made through Banking
channels.</mat-option>
<mat-option value="Payment made through Cash and Banking channels.">Payment made through Cash and Banking Channels.</mat-option>
</mat-select>
</mat-form-field>
<span *ngIf="items.get('trade_product_payment_type').value == 3">
<mat-label>No.of days of Credit Provided by Supplier </mat-label>
<mat-form-field style="width: 100%">
<input matInput placeholder="Days From" formControlName="service_provider_credit_days_from" type="number">
</mat-form-field>
<mat-form-field style="width: 100%">
<input matInput placeholder="Days To" formControlName="service_provider_credit_days_to" type="number">
</mat-form-field>
</span>
</div>
</mat-card-content>
<ion-buttons end>
<ion-col col-3 offset-3>
<a (click)="removeServiceProvider(s)"
*ngIf="serv.controls.service_providers.controls.length > 1">
<ion-icon name="md-trash" color="optblue" style="font-size: 22px;"></ion-icon>
</a>
</ion-col>
<ion-col col-2 offset-1>
<a (click)="addMoreServiceProvider($event); false" *ngIf="last">
<ion-icon name="add-circle" color="optblue" style="font-size: 24px;"></ion-icon>
</a>
</ion-col>
</ion-buttons>
</div>
</div>
<div *ngIf="spCreditCardFlag">
<mat-form-field style="width: 100%">
<input matInput placeholder="What % of Total Purchase is done on Credit?" formControlName="service_providers_total_payments_percent_on_credit"
type="number" autocomplete="off">
</mat-form-field>
</div>
</div>
</div>
</mat-card>
<!-- <mat-card *ngIf="serviceProviderForm">
<mat-card-title> <mat-card-title>
<h5>Service Provider Product Details</h5> <h5>Service Provider Product Details</h5>
</mat-card-title> </mat-card-title>
<div style="text-align: center; margin: 12px;">Service Provider Details Not applicable here !!</div> <div style="text-align: center; margin: 12px;">Service Provider Details Not applicable here !!</div>
</mat-card> </mat-card> -->
<mat-card> <mat-card>
<mat-form-field style="width: 100%"> <mat-form-field style="width: 100%">
<mat-label>Remarks</mat-label> <mat-label>Remarks</mat-label>

View File

@ -30,6 +30,8 @@ export class PdQuestionSupplierInfoPage {
business_manufacturingProducts: any = []; business_manufacturingProducts: any = [];
business_tradingProducts: any = []; business_tradingProducts: any = [];
business_serviceProvider: any = [];
m_titleList: any = []; m_titleList: any = [];
m_paymentList: any = []; m_paymentList: any = [];
m_companyRelationShipList: any = []; m_companyRelationShipList: any = [];
@ -44,8 +46,7 @@ export class PdQuestionSupplierInfoPage {
constructor(public navCtrl: NavController, public navParams: NavParams, public fb: FormBuilder, constructor(public navCtrl: NavController, public navParams: NavParams, public fb: FormBuilder,
public aws: AwsServiceProvider, public qustCat: QuestionCategoryProvider, public aws: AwsServiceProvider, public qustCat: QuestionCategoryProvider,
public toast: ToastProvider, private cameraProvider: CameraProvider, private loading: LoadingProvider, public toast: ToastProvider, private cameraProvider: CameraProvider, private loading: LoadingProvider,
private constantProvider:ConstantsProvider) private constantProvider: ConstantsProvider) {
{
this.questionDetails = this.navParams.get('questionDetails'); this.questionDetails = this.navParams.get('questionDetails');
this.pdDetails = this.navParams.get('pdDetails'); this.pdDetails = this.navParams.get('pdDetails');
@ -63,6 +64,7 @@ export class PdQuestionSupplierInfoPage {
this.initFormLoadDetails(datas.type_of_activity); this.initFormLoadDetails(datas.type_of_activity);
this.business_manufacturingProducts = datas.type_of_activity.filter(data => { if (data.type_of_activity_id == 2) { return data } }).map(data => [...data.prodcuts]); this.business_manufacturingProducts = datas.type_of_activity.filter(data => { if (data.type_of_activity_id == 2) { return data } }).map(data => [...data.prodcuts]);
// this.business_tradingProducts = datas.type_of_activity.filter(data=>{if(data.type_of_activity_id == 3){return data}}).map(data=> [...data.prodcuts]); // this.business_tradingProducts = datas.type_of_activity.filter(data=>{if(data.type_of_activity_id == 3){return data}}).map(data=> [...data.prodcuts]);
this.business_serviceProvider = datas.type_of_activity.filter(data => { if (data.type_of_activity_id == 5) { return data } }).map(data => [...data.prodcuts]);
let api = Object.keys(datas.type_of_activity).map(function (key) { let api = Object.keys(datas.type_of_activity).map(function (key) {
return datas.type_of_activity[key]; return datas.type_of_activity[key];
@ -81,6 +83,7 @@ export class PdQuestionSupplierInfoPage {
this.business_tradingProducts.push(val.prodcuts); this.business_tradingProducts.push(val.prodcuts);
} }
} }
}); });
} }
@ -127,6 +130,7 @@ export class PdQuestionSupplierInfoPage {
fk_createdby: [this.users], fk_createdby: [this.users],
manufacturing_details: this.fb.array([this.manufacturingFormCreation(record)]), manufacturing_details: this.fb.array([this.manufacturingFormCreation(record)]),
trade_details: this.fb.array([this.tradingFormCreation(record)]), trade_details: this.fb.array([this.tradingFormCreation(record)]),
servicing_details: this.fb.array([this.servicingFormCreation(record)]),
supplier_info_form_remark: [dataForm.supplier_info_form_remark || null] supplier_info_form_remark: [dataForm.supplier_info_form_remark || null]
// wholesale_trade_details: this.fb.array([this.tradingFormCreation(record)]), // wholesale_trade_details: this.fb.array([this.tradingFormCreation(record)]),
}); });
@ -163,7 +167,16 @@ export class PdQuestionSupplierInfoPage {
} }
let arr2 = record.filter(data => data.type_of_activity_id == 5); let arr2 = record.filter(data => data.type_of_activity_id == 5);
if (arr2.length > 0) { if (arr2.length > 0) {
this.serviceProviderForm = true; // this.serviceProviderForm = true;
if (dataForm.trade_details[0] != null) {
let api_service_provider = dataForm.servicing_details[0].service_provider;
this.initServiceProvidersDetails(api_service_provider);
this.supplierInfoForm.controls['servicing_details']['controls'][0].controls['service_providers_total_payments_percent_on_credit'].setValue(dataForm.servicing_details[0].service_providers_total_payments_percent_on_credit || null);
}
else {
this.initServiceProvidersDetails(null);
this.supplierInfoForm.controls['servicing_details']['controls'][0].controls['service_providers_total_payments_percent_on_credit'].setValue(null);
}
} }
this.noRecordsFound = true; this.noRecordsFound = true;
} else { } else {
@ -175,6 +188,7 @@ export class PdQuestionSupplierInfoPage {
fk_createdby: [this.users], fk_createdby: [this.users],
manufacturing_details: this.fb.array([this.manufacturingFormCreation(record)]), manufacturing_details: this.fb.array([this.manufacturingFormCreation(record)]),
trade_details: this.fb.array([this.tradingFormCreation(record)]), trade_details: this.fb.array([this.tradingFormCreation(record)]),
servicing_details: this.fb.array([this.servicingFormCreation(record)]),
supplier_info_form_remark: [dataForm.supplier_info_form_remark || null] supplier_info_form_remark: [dataForm.supplier_info_form_remark || null]
// wholesale_trade_details: this.fb.array([this.tradingFormCreation(record)]), // wholesale_trade_details: this.fb.array([this.tradingFormCreation(record)]),
}); });
@ -188,11 +202,12 @@ export class PdQuestionSupplierInfoPage {
this.initTradingProductsDetails(null); this.initTradingProductsDetails(null);
this.supplierInfoForm.controls['trade_details']['controls'][0].controls['trading_products_total_payments_percent_on_credit'].setValue(dataForm.trading_products_total_payments_percent_on_credit || null); this.supplierInfoForm.controls['trade_details']['controls'][0].controls['trading_products_total_payments_percent_on_credit'].setValue(dataForm.trading_products_total_payments_percent_on_credit || null);
} }
this.noRecordsFound = true;
}
let arr2 = record.filter(data => data.type_of_activity_id == 5); let arr2 = record.filter(data => data.type_of_activity_id == 5);
if (arr2.length > 0) { if (arr2.length > 0) {
this.serviceProviderForm = true; this.initServiceProvidersDetails(null);
this.supplierInfoForm.controls['servicing_details']['controls'][0].controls['service_providers_total_payments_percent_on_credit'].setValue(dataForm.servicing_details[0].service_providers_total_payments_percent_on_credit || null);
}
this.noRecordsFound = true;
} }
} else { } else {
this.supplierInfoForm = this.fb.group({ this.supplierInfoForm = this.fb.group({
@ -203,6 +218,7 @@ export class PdQuestionSupplierInfoPage {
fk_createdby: [this.users], fk_createdby: [this.users],
manufacturing_details: this.fb.array([this.manufacturingFormCreation(record)]), manufacturing_details: this.fb.array([this.manufacturingFormCreation(record)]),
trade_details: this.fb.array([this.tradingFormCreation(record)]), trade_details: this.fb.array([this.tradingFormCreation(record)]),
servicing_details: this.fb.array([this.servicingFormCreation(record)]),
supplier_info_form_remark: [] supplier_info_form_remark: []
// wholesale_trade_details: this.fb.array([this.tradingFormCreation(record)]), // wholesale_trade_details: this.fb.array([this.tradingFormCreation(record)]),
}); });
@ -218,7 +234,9 @@ export class PdQuestionSupplierInfoPage {
} }
let arr2 = record.filter(data => data.type_of_activity_id == 5); let arr2 = record.filter(data => data.type_of_activity_id == 5);
if (arr2.length > 0) { if (arr2.length > 0) {
this.serviceProviderForm = true; // this.serviceProviderForm = true;
this.initServiceProvidersDetails(null);
this.supplierInfoForm.controls['servicing_details']['controls'][0].controls['service_providers_total_payments_percent_on_credit'].setValue(null);
} }
this.noRecordsFound = true; this.noRecordsFound = true;
} }
@ -257,6 +275,20 @@ export class PdQuestionSupplierInfoPage {
} }
} }
servicingForm: Boolean = false;
servicingFormCreation(val) {
let arr = val.filter(data => data.type_of_activity_id == 5);
if (arr.length > 0) {
this.servicingForm = true;
return this.fb.group({
service_providers: this.fb.array([]),
service_providers_total_payments_percent_on_credit: []
});
} else {
return;
}
}
initManufacturingProductsDetails(datas) { initManufacturingProductsDetails(datas) {
const control = <FormArray>this.supplierInfoForm.controls['manufacturing_details']['controls'][0].controls['main_raw_materials']; const control = <FormArray>this.supplierInfoForm.controls['manufacturing_details']['controls'][0].controls['main_raw_materials'];
if (datas === null) { if (datas === null) {
@ -371,6 +403,57 @@ export class PdQuestionSupplierInfoPage {
} }
} }
initServiceProvidersDetails(datas) {
const control = <FormArray>this.supplierInfoForm.controls['servicing_details']['controls'][0].controls['service_providers'];
if (datas === null) {
control.push(this.initServiceProviders(null));
} else {
datas.forEach((val, inx) => {
this.checkCard(val.service_provider_payment_type, 3, inx);
control.push(this.initServiceProviders(val));
});
}
}
initServiceProviders(records) {
if (records === null) {
return this.fb.group({
service_provider_name: [''],
service_provider_supplier_name: [''],
person_title_name: [''],
person_designation: [''],
other_person_designation: [''],
service_provider_contact_person_name: [''],
service_provider_contact_person_mobile_number: [''],
person_stdcode: [null],
person_landline: [null],
service_provider_payment_type: [''],
service_provider_payment_mode: [''],
service_provider_frequency_of_purchase: [''],
service_provider_credit_days_from: [''],
service_provider_credit_days_to: [''],
})
} else {
return this.fb.group({
service_provider_name: [records.service_provider_name],
person_title_name: [records.person_title_name],
person_designation: [records.person_designation],
other_person_designation: [records.other_person_designation],
service_provider_supplier_name: [records.service_provider_supplier_name],
service_provider_contact_person_name: [records.service_provider_contact_person_name],
service_provider_contact_person_mobile_number: [records.service_provider_contact_person_mobile_number],
person_stdcode: [records.person_stdcode],
person_landline: [records.person_landline],
service_provider_payment_type: [records.service_provider_payment_type],
service_provider_payment_mode: [records.service_provider_payment_mode],
service_provider_frequency_of_purchase: [records.service_provider_frequency_of_purchase],
service_provider_credit_days_from: [records.service_provider_credit_days_from],
service_provider_credit_days_to: [records.service_provider_credit_days_to],
})
}
}
addMoreRawMaterials(e): void { addMoreRawMaterials(e): void {
// e.stropPropagation(); // e.stropPropagation();
const control = <FormArray>this.supplierInfoForm.controls['manufacturing_details']['controls'][0].controls['main_raw_materials']; const control = <FormArray>this.supplierInfoForm.controls['manufacturing_details']['controls'][0].controls['main_raw_materials'];
@ -395,6 +478,17 @@ export class PdQuestionSupplierInfoPage {
control.removeAt(inx); control.removeAt(inx);
} }
addMoreServiceProvider(e): void {
// e.stropPropagation();
const control = <FormArray>this.supplierInfoForm.controls['servicing_details']['controls'][0].controls['service_providers'];
control.push(this.initServiceProviders(null));
}
removeServiceProvider(inx): void {
const control = <FormArray>this.supplierInfoForm.controls['servicing_details']['controls'][0].controls['service_providers'];
control.removeAt(inx);
}
getdropList() { getdropList() {
@ -470,12 +564,19 @@ export class PdQuestionSupplierInfoPage {
// :items.controls['other_person_designation'].clearValidators(),items.controls['other_person_designation'].setValue(''); // :items.controls['other_person_designation'].clearValidators(),items.controls['other_person_designation'].setValue('');
// items.controls['other_person_designation'].updateValueAndValidity(); // items.controls['other_person_designation'].updateValueAndValidity();
} }
else if (flag == 3) {
e == 1 ? '' : '';
}
} }
mfgCreditCardFlag: boolean = false; mfgCreditCardFlag: boolean = false;
trdCreditCardFlag: boolean = false; trdCreditCardFlag: boolean = false;
spCreditCardFlag: boolean = false;
mfgCounter: any = []; mfgCounter: any = [];
trdCounter: any = []; trdCounter: any = [];
spCounter: any = [];
checkCard(e, flag, index) { checkCard(e, flag, index) {
if (flag == 2 && e == 3) { if (flag == 2 && e == 3) {
this.trdCounter[index] = 1; this.trdCounter[index] = 1;
@ -494,6 +595,16 @@ export class PdQuestionSupplierInfoPage {
} }
let MFG = this.mfgCounter.reduce((sum, val) => sum + +val, 0); let MFG = this.mfgCounter.reduce((sum, val) => sum + +val, 0);
this.mfgCreditCardFlag = MFG > 0 ? true : false; this.mfgCreditCardFlag = MFG > 0 ? true : false;
if (flag == 3 && e == 3) {
this.spCounter[index] = 1;
}
else if (flag == 3 && e != 3) {
this.spCounter[index] = 0;
}
let SP = this.spCounter.reduce((sum, val) => sum + +val, 0);
this.spCreditCardFlag = SP > 0 ? true : false;
} }
selectedPaymentTerms(items, e, flag) { selectedPaymentTerms(items, e, flag) {
@ -524,6 +635,21 @@ export class PdQuestionSupplierInfoPage {
items.controls['manufacturing_credit_days_from'].updateValueAndValidity(); items.controls['manufacturing_credit_days_from'].updateValueAndValidity();
items.controls['manufacturing_credit_days_to'].updateValueAndValidity(); items.controls['manufacturing_credit_days_to'].updateValueAndValidity();
} }
if (flag == 3) {
if (e == 3) {
// items.controls['service_provider_credit_days_from'].setValidators([Validators.required]);
// items.controls['service_provider_credit_days_to'].setValidators([Validators.required]);
}
else {
// items.controls['service_provider_credit_days_from'].clearValidators();
items.controls['service_provider_credit_days_from'].setValue('');
// items.controls['service_provider_credit_days_to'].clearValidators();
items.controls['service_provider_credit_days_to'].setValue('');
}
items.controls['service_provider_credit_days_from'].updateValueAndValidity();
items.controls['service_provider_credit_days_to'].updateValueAndValidity();
}
} }
/*IMAGE SECTION*/ /*IMAGE SECTION*/

View File

@ -1,18 +0,0 @@
<!--
Generated template for the PdQuestionBusinessPage page.
See http://ionicframework.com/docs/components/#navigation for more info on
Ionic pages and navigation.
-->
<ion-header>
<ion-navbar color="optblue">
<ion-title>{{FormId.form_name}}</ion-title>
</ion-navbar>
</ion-header>
<ion-content padding>
</ion-content>

View File

@ -1,3 +0,0 @@
page-pd-question-business {
}

View File

@ -1,43 +0,0 @@
import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import { QuestionCategoryProvider } from '../../../providers/question-category/question-category'
import { AwsServiceProvider } from '../../../providers/aws-service/aws-service'
/**
* Generated class for the PdQuestionBusinessPage page.
*
* See https://ionicframework.com/docs/components/#navigation for more info on
* Ionic pages and navigation.
*/
@Component({
selector: 'page-pd-question-business',
templateUrl: 'pd-question-business.html',
})
export class PdQuestionBusinessPage {
pdDetails:any;
pdid:any;
users:any;
FormId:any;
existCompanyList:any=[]
constructor(public navCtrl: NavController, public navParams: NavParams,public qustcat:QuestionCategoryProvider,public aws:AwsServiceProvider) {
this.pdDetails=this.navParams.get('pdDetails');
this.pdid=this.pdDetails.pd_id;
this.FormId=this.navParams.get('FormId');
this.users=this.aws.getlocale
this.getDropDown();
}
ionViewDidLoad() {
console.log('ionViewDidLoad PdQuestionBusinessPage');
}
getDropDown(){
this.qustcat.getCompaniesListsForBusiness(this.pdid).subscribe(res=>{
this.existCompanyList=res['records'].filter(data=>data.is_active == true && data.is_company_applicant == true);
console.log(this.existCompanyList);
})
}
}

View File

@ -128,8 +128,8 @@
<ion-row> <ion-row>
<ion-col end> <ion-col end>
<div class="btn"> <div class="btn">
<button *ngIf="!buttonClick" float-right ion-button large color="optblue" icon-left clear (click)="addRec(1)"> <button *ngIf="!buttonClick" float-right ion-button large color="optblue" icon-left clear (click)="addRec(1)">Add Applicant
<ion-icon name="person-add"></ion-icon> <!-- <ion-icon name="person-add"></ion-icon> -->
</button> </button>
<button *ngIf="buttonClick" float-right ion-button large color="optblue" icon-left clear (click)="addRec(1)">Close <button *ngIf="buttonClick" float-right ion-button large color="optblue" icon-left clear (click)="addRec(1)">Close
&nbsp;&nbsp;<ion-icon name="md-close"></ion-icon></button> &nbsp;&nbsp;<ion-icon name="md-close"></ion-icon></button>
@ -235,7 +235,7 @@
<ion-row> <ion-row>
<ion-col end> <ion-col end>
<button *ngIf="addIndi" float-right ion-button color="optblue" (click)="addParticular(1,indi)">Add</button> <button *ngIf="addIndi" float-right ion-button color="optblue" (click)="addParticular(1,indi)">Save</button>
<button *ngIf="!addIndi" float-right ion-button color="optblue" (click)="update(1,indi)">Update</button> <button *ngIf="!addIndi" float-right ion-button color="optblue" (click)="update(1,indi)">Update</button>
</ion-col> </ion-col>
</ion-row> </ion-row>

View File

@ -64,6 +64,6 @@ export class PdtriggerProvider {
return this.http.post(this.apiurl+'getPDCompleteDetails',{'records':details}) return this.http.post(this.apiurl+'getPDCompleteDetails',{'records':details})
} }
pdFormsCompletenessCheck(pd_id){ pdFormsCompletenessCheck(pd_id){
return this.http.post(this.apiurl+'pdFormsCompletenessCheck',{'pd_id':pd_id}) return this.http.post(this.apiurl+'pdFormsCompletenessCheck',{'pd_id':pd_id,'client':'MOB'})
} }
} }

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.