stock supplier : ps
This commit is contained in:
parent
4b99096f81
commit
be8421fb07
File diff suppressed because one or more lines are too long
@ -79,8 +79,14 @@
|
|||||||
<div formArrayName="main_raw_materials">
|
<div formArrayName="main_raw_materials">
|
||||||
<div *ngFor="let items of item.controls.main_raw_materials['controls']; let l=index;let last =last"
|
<div *ngFor="let items of item.controls.main_raw_materials['controls']; let l=index;let last =last"
|
||||||
[formGroupName]="l">
|
[formGroupName]="l">
|
||||||
|
<ion-row>
|
||||||
|
<div style="width: 85%;">
|
||||||
<mat-card-subtitle>Manufacturing Product #{{l+1}}</mat-card-subtitle>
|
<mat-card-subtitle>Manufacturing Product #{{l+1}}</mat-card-subtitle>
|
||||||
|
</div>
|
||||||
|
<div style="width: 10%;">
|
||||||
<button mini ion-fab color="optblue" slot="fixed" (click)="captureTheClientPics('Manufacturing Product',l,items.get('manufacturing_client_name').value)"><ion-icon name="md-camera" style="font-size: 24px"></ion-icon></button>
|
<button mini ion-fab color="optblue" slot="fixed" (click)="captureTheClientPics('Manufacturing Product',l,items.get('manufacturing_client_name').value)"><ion-icon name="md-camera" style="font-size: 24px"></ion-icon></button>
|
||||||
|
</div>
|
||||||
|
</ion-row>
|
||||||
<mat-card-content>
|
<mat-card-content>
|
||||||
<div fxLayout="row nowrap" fxLayoutGap="2px" fxLayoutAlign="start none">
|
<div fxLayout="row nowrap" fxLayoutGap="2px" fxLayoutAlign="start none">
|
||||||
<mat-form-field style="width:100%">
|
<mat-form-field style="width:100%">
|
||||||
@ -199,8 +205,14 @@
|
|||||||
<div formArrayName="trading_products">
|
<div formArrayName="trading_products">
|
||||||
<div *ngFor="let items of item.controls.trading_products['controls']; let l=index;let last =last"
|
<div *ngFor="let items of item.controls.trading_products['controls']; let l=index;let last =last"
|
||||||
[formGroupName]="l">
|
[formGroupName]="l">
|
||||||
|
<ion-row>
|
||||||
|
<div style="width: 85%;">
|
||||||
<mat-card-subtitle>Trading Product #{{l+1}}</mat-card-subtitle>
|
<mat-card-subtitle>Trading Product #{{l+1}}</mat-card-subtitle>
|
||||||
|
</div>
|
||||||
|
<div style="width: 10%;">
|
||||||
<button mini ion-fab color="optblue" slot="fixed" (click)="captureTheClientPics('Trading Product',l,items.get('trade_client_name').value)"><ion-icon name="md-camera" style="font-size: 24px"></ion-icon></button>
|
<button mini ion-fab color="optblue" slot="fixed" (click)="captureTheClientPics('Trading Product',l,items.get('trade_client_name').value)"><ion-icon name="md-camera" style="font-size: 24px"></ion-icon></button>
|
||||||
|
</div>
|
||||||
|
</ion-row>
|
||||||
<mat-card-content>
|
<mat-card-content>
|
||||||
<div fxLayout="row nowrap" fxLayoutGap="2px" fxLayoutAlign="start none">
|
<div fxLayout="row nowrap" fxLayoutGap="2px" fxLayoutAlign="start none">
|
||||||
<mat-form-field style="width: 100%">
|
<mat-form-field style="width: 100%">
|
||||||
@ -325,8 +337,14 @@
|
|||||||
<div formArrayName="service_products">
|
<div formArrayName="service_products">
|
||||||
<div *ngFor="let items of item.controls.service_products['controls']; let l=index;let last =last"
|
<div *ngFor="let items of item.controls.service_products['controls']; let l=index;let last =last"
|
||||||
[formGroupName]="l">
|
[formGroupName]="l">
|
||||||
|
<ion-row>
|
||||||
|
<div style="width: 85%;">
|
||||||
<mat-card-subtitle>Service Provider #{{l+1}}</mat-card-subtitle>
|
<mat-card-subtitle>Service Provider #{{l+1}}</mat-card-subtitle>
|
||||||
|
</div>
|
||||||
|
<div style="width: 10%;">
|
||||||
<button mini ion-fab color="optblue" slot="fixed" (click)="captureTheClientPics('Service Provider',l,items.get('service_provider_client_name').value)"><ion-icon name="md-camera" style="font-size: 24px"></ion-icon></button>
|
<button mini ion-fab color="optblue" slot="fixed" (click)="captureTheClientPics('Service Provider',l,items.get('service_provider_client_name').value)"><ion-icon name="md-camera" style="font-size: 24px"></ion-icon></button>
|
||||||
|
</div>
|
||||||
|
</ion-row>
|
||||||
<mat-card-content>
|
<mat-card-content>
|
||||||
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
|
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
|
||||||
<mat-form-field style="width: 100%">
|
<mat-form-field style="width: 100%">
|
||||||
|
|||||||
@ -431,42 +431,39 @@
|
|||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</div>
|
||||||
</mat-card>
|
</mat-card>
|
||||||
<!-- <mat-card *ngIf="servicingForm || SPCommentCard">
|
<mat-card *ngIf="servicingForm || SPCommentCard">
|
||||||
<div *ngIf="servicingForm">
|
<div *ngIf="servicingForm">
|
||||||
<mat-card-title><h5>Service Provider Details</h5></mat-card-title>
|
<mat-card-title><h5>Service Provider Details</h5></mat-card-title>
|
||||||
<div formArrayName="servicing_details">
|
<div formArrayName="servicing_details">
|
||||||
<div *ngFor="let spd of stockForms.controls.servicing_details['controls']; let k=index"
|
<div *ngFor="let dtl of stockForm.controls.servicing_details['controls']; let par=index" [formGroupName]="par">
|
||||||
[formGroupName]="k">
|
|
||||||
<div formArrayName="service_provider">
|
<div formArrayName="service_provider">
|
||||||
<div *ngFor="let sp of spd.controls.service_provider['controls']; let g=index;let last = last"
|
<div *ngFor="let serv of dtl.controls.service_provider['controls']; let chd=index;let last = last" [formGroupName]="chd">
|
||||||
[formGroupName]="g">
|
<mat-card-subtitle>Service Provider #{{chd+1}}</mat-card-subtitle>
|
||||||
<mat-card-subtitle>Service Provider #{{g+1}}</mat-card-subtitle>
|
|
||||||
<mat-card-content class="matcard">
|
<mat-card-content class="matcard">
|
||||||
<mat-form-field style="width:100%">
|
<mat-form-field style="width:100%">
|
||||||
<input matInput autocomplete="off" placeholder="Name" formControlName="service_provider_name">
|
<input matInput autocomplete="off" placeholder="Name" formControlName="service_provider_name">
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field style="width:100%">
|
<mat-form-field style="width:100%">
|
||||||
<mat-select placeholder="Stock" formControlName="service_provider_observed"
|
<mat-select placeholder="Stock" formControlName="service_provider_observed"
|
||||||
(selectionChange)="checkComments($event.value,5,g)" required>
|
(selectionChange)="checkComments($event.value,5,chd)">
|
||||||
<mat-option>Select</mat-option>
|
<mat-option>Select</mat-option>
|
||||||
<mat-option value="yes">Add Stock Details</mat-option>
|
<mat-option value="yes">Add Stock Details</mat-option>
|
||||||
<mat-option value="no">No stock observed</mat-option>
|
<mat-option value="no">No stock observed</mat-option>
|
||||||
|
|
||||||
</mat-select>
|
</mat-select>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
<span *ngIf="tradetg.get('traded_goods_observed').value == 'yes'">
|
<span *ngIf="serv.get('service_provider_observed').value == 'yes'">
|
||||||
<mat-form-field style="width:100%">
|
<mat-form-field style="width:100%">
|
||||||
<input matInput autocomplete="off" placeholder="Estimated Quantity"
|
<input matInput autocomplete="off" placeholder="Estimated Quantity"
|
||||||
formControlName="traded_goods_quantity" type="number">
|
formControlName="service_provider_quantity" type="number">
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field style="width:100%">
|
<mat-form-field style="width:100%">
|
||||||
<mat-select placeholder="Unit of Mearsurement" formControlName="traded_goods_uom">
|
<mat-select placeholder="Unit of Mearsurement" formControlName="service_provider_uom">
|
||||||
<mat-option>Select</mat-option>
|
<mat-option>Select</mat-option>
|
||||||
<mat-option>
|
<mat-option>
|
||||||
<ngx-mat-select-search formControlName="uomSearch"
|
<ngx-mat-select-search formControlName="uomSearch"
|
||||||
[placeholderLabel]="'Search Unit'"
|
[placeholderLabel]="'Search Unit'"
|
||||||
[noEntriesFoundLabel]="'No Matching Result'" (keyup)="searchFun(tradetg,a)">
|
[noEntriesFoundLabel]="'No Matching Result'" (keyup)="searchFun(serv,a)">
|
||||||
<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>
|
||||||
@ -474,28 +471,28 @@
|
|||||||
<mat-option value="{{uom.uom_id}}" *ngFor="let uom of uomDataValue">{{uom.name}}</mat-option>
|
<mat-option value="{{uom.uom_id}}" *ngFor="let uom of uomDataValue">{{uom.name}}</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field *ngIf="tradetg.get('traded_goods_uom').value == 1" style="width:100%">
|
<mat-form-field *ngIf="serv.get('service_provider_uom').value == 1" style="width:100%">
|
||||||
<input matInput autocomplete="off" placeholder="Specify UOM"
|
<input matInput autocomplete="off" placeholder="Specify UOM"
|
||||||
formControlName="traded_goods_other_uom">
|
formControlName="service_provider_other_uom">
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field style="width:100%">
|
<mat-form-field style="width:100%">
|
||||||
<input matInput autocomplete="off" placeholder="Estimated Value of Stock Observed"
|
<input matInput autocomplete="off" placeholder="Estimated Value of Stock Observed"
|
||||||
formControlName="estimated_traded_goods_value" type="number"
|
formControlName="estimated_service_provider_value" type="number"
|
||||||
(keyup)="inWords($event.target.value,4,g)">
|
(keyup)="inWords($event.target.value,5,chd)">
|
||||||
<mat-hint align="start" style="font-size:70%" *ngIf="tradetg.get('estimated_traded_goods_value').value != ''">{{"₹"}}
|
<mat-hint align="start" style="font-size:70%" *ngIf="serv.get('estimated_service_provider_value').value != ''">{{"₹"}}
|
||||||
{{T_tradedGoodsValueInWords[g]}} Only</mat-hint>
|
{{S_GoodsValueInWords[g]}} Only</mat-hint>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</span>
|
</span>
|
||||||
</mat-card-content>
|
</mat-card-content>
|
||||||
<mat-card-actions>
|
<mat-card-actions>
|
||||||
<ion-buttons end>
|
<ion-buttons end>
|
||||||
<ion-col col-3 offset-3>
|
<ion-col col-3 offset-3>
|
||||||
<a (click)="deleteTradedGoods(g,2)" *ngIf="td.controls.trading_traded_goods.controls.length>1">
|
<a (click)="deleteTradedGoods(chd,3)" *ngIf="dtl.controls.service_provider.controls.length>1">
|
||||||
<ion-icon name="md-trash" color="optblue" style="font-size: 22px;"></ion-icon>
|
<ion-icon name="md-trash" color="optblue" style="font-size: 22px;"></ion-icon>
|
||||||
</a>
|
</a>
|
||||||
</ion-col>
|
</ion-col>
|
||||||
<ion-col col-2 offset-1>
|
<ion-col col-2 offset-1>
|
||||||
<a (click)="addTradedGoods(2)" *ngIf="last">
|
<a (click)="addTradedGoods(3)" *ngIf="last">
|
||||||
<ion-icon name="add-circle" color="optblue" style="font-size: 24px;"></ion-icon>
|
<ion-icon name="add-circle" color="optblue" style="font-size: 24px;"></ion-icon>
|
||||||
</a>
|
</a>
|
||||||
</ion-col>
|
</ion-col>
|
||||||
@ -506,27 +503,28 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="TGCommentCard">
|
<div *ngIf="SPCommentCard">
|
||||||
<br>
|
<br>
|
||||||
<mat-form-field style="width:100%">
|
<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-placeholder>Is the stock of finished / goods observed, sufficient considering the size of operations</mat-placeholder><br/>
|
||||||
<mat-select formControlName="is_sufficiant_finished_and_traded_goods">
|
<mat-select formControlName="is_sufficiant_service_goods">
|
||||||
<mat-option>Select</mat-option>
|
<mat-option>Select</mat-option>
|
||||||
<mat-option *ngFor="let val of TGsufficientList" [value]="val.value" [disabled]="val.isdisabled">
|
<mat-option *ngFor="let val of SPsufficientList" [value]="val.value" [disabled]="val.isdisabled">
|
||||||
{{val.isdisplayvalue}}
|
{{val.isdisplayvalue}}
|
||||||
</mat-option>
|
</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field appearance="outline" style="width: 100%" *ngIf="this.stockForm.controls.is_sufficiant_finished_and_traded_goods.value == 'no'">
|
<mat-form-field appearance="outline" style="width: 100%" *ngIf="this.stockForms.controls.is_sufficiant_service_goods.value == 'no'">
|
||||||
<mat-label> <i>Please comment on the stock level observed?</i> </mat-label>
|
<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>
|
<textarea matInput autocomplete="off" placeholder="Please comment on the stock level observed"
|
||||||
</mat-form-field>
|
formControlName="service_goods_remarks"></textarea>
|
||||||
|
</mat-form-field>
|
||||||
</div>
|
</div>
|
||||||
</mat-card> -->
|
</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>
|
||||||
</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>
|
||||||
|
|||||||
@ -38,22 +38,28 @@ export class PdQuestionStockInfoPage {
|
|||||||
M_goodsValueInWords: any = [];
|
M_goodsValueInWords: any = [];
|
||||||
R_tradedGoodsValueInWords: any = [];
|
R_tradedGoodsValueInWords: any = [];
|
||||||
T_tradedGoodsValueInWords: any = [];
|
T_tradedGoodsValueInWords: any = [];
|
||||||
|
S_GoodsValueInWords: any = [];
|
||||||
mrmCommentFlag: any = [];
|
mrmCommentFlag: any = [];
|
||||||
mfgCommentFlag: any = [];
|
mfgCommentFlag: any = [];
|
||||||
rtrdCommentFlag: any = [];
|
rtrdCommentFlag: any = [];
|
||||||
wtrdCommentFlag: any = [];
|
wtrdCommentFlag: any = [];
|
||||||
serviceProviderForm: Boolean = false;
|
spdCommentFlag: any = [];
|
||||||
|
|
||||||
|
// serviceProviderForm: Boolean = false;
|
||||||
suppliers_raw_materials: any = [];
|
suppliers_raw_materials: any = [];
|
||||||
suppliers_retail_trade_details: any = [];
|
suppliers_retail_trade_details: any = [];
|
||||||
suppliers_wholesale_trade_details: any = [];
|
suppliers_wholesale_trade_details: any = [];
|
||||||
suppliers_finished_goods: any = [];
|
suppliers_finished_goods: any = [];
|
||||||
|
suppliers_service_providers : any = [];
|
||||||
|
|
||||||
protected _onDestroy = new Subject<void>();
|
protected _onDestroy = new Subject<void>();
|
||||||
|
|
||||||
RMCommentCard: boolean = false;
|
RMCommentCard: boolean = false;
|
||||||
TGCommentCard: boolean = false
|
TGCommentCard: boolean = false;
|
||||||
|
SPCommentCard: boolean = false;
|
||||||
public RMsufficientList: any = [{value:"yes",isdisplayvalue:"Yes",disabled:false},{value:"no",isdisplayvalue:"No",disabled:false},{value:"not applicable",isdisplayvalue:"Stock not required to be maintained",disabled:false}];
|
public RMsufficientList: any = [{value:"yes",isdisplayvalue:"Yes",disabled:false},{value:"no",isdisplayvalue:"No",disabled:false},{value:"not applicable",isdisplayvalue:"Stock not required to be maintained",disabled:false}];
|
||||||
public TGsufficientList: any = [{value:"yes",isdisplayvalue:"Yes",isdisabled:false},{value:"no",isdisplayvalue:"No",isdisabled:false},{value:"not applicable",isdisplayvalue:"Stock not required to be maintained",isdisabled:false}];
|
public TGsufficientList: any = [{value:"yes",isdisplayvalue:"Yes",isdisabled:false},{value:"no",isdisplayvalue:"No",isdisabled:false},{value:"not applicable",isdisplayvalue:"Stock not required to be maintained",isdisabled:false}];
|
||||||
|
public SPsufficientList: any = [{value:"yes",isdisplayvalue:"Yes",isdisabled:false},{value:"no",isdisplayvalue:"No",isdisabled:false},{value:"not applicable",isdisplayvalue:"Stock not required to be maintained",isdisabled:false}];
|
||||||
imageDisplay: any[];
|
imageDisplay: any[];
|
||||||
imageBucket: any=[];
|
imageBucket: any=[];
|
||||||
tab: string='0';
|
tab: string='0';
|
||||||
@ -111,6 +117,9 @@ this.complete_status = this.pdDetails.pd_status == 'COMPLETED' ? true : false;
|
|||||||
let type3length = type3[0].hasOwnProperty("products") ? type3[0].products.length : 0;
|
let type3length = type3[0].hasOwnProperty("products") ? type3[0].products.length : 0;
|
||||||
let type4 = record.from_business.filter(data => data.type_of_activity_id == 4);
|
let type4 = record.from_business.filter(data => data.type_of_activity_id == 4);
|
||||||
let type4length = type4[0].hasOwnProperty("products") ? type4[0].products.length : 0;
|
let type4length = type4[0].hasOwnProperty("products") ? type4[0].products.length : 0;
|
||||||
|
let type5 = record.from_business.filter(data => data.type_of_activity_id == 5);
|
||||||
|
let type5length = type5[0].hasOwnProperty("products") ? type5[0].products.length : 0;
|
||||||
|
console.log('type5length',type5,type5length);
|
||||||
|
|
||||||
|
|
||||||
let rm_api = record.from_supplier.hasOwnProperty("raw_material") ? record.from_supplier.raw_material : [];
|
let rm_api = record.from_supplier.hasOwnProperty("raw_material") ? record.from_supplier.raw_material : [];
|
||||||
@ -148,6 +157,9 @@ this.complete_status = this.pdDetails.pd_status == 'COMPLETED' ? true : false;
|
|||||||
manufacturing_details: this.fb.array([this.manufacturingFormCreation(record,type2length)]),
|
manufacturing_details: this.fb.array([this.manufacturingFormCreation(record,type2length)]),
|
||||||
retail_details: this.fb.array([this.retailFormCreation(type3length)]),
|
retail_details: this.fb.array([this.retailFormCreation(type3length)]),
|
||||||
trade_details: this.fb.array([this.tradingFormCreation(type4length)]),
|
trade_details: this.fb.array([this.tradingFormCreation(type4length)]),
|
||||||
|
servicing_details: this.fb.array([this.servicingFormCreation(type5length)]),
|
||||||
|
is_sufficiant_service_goods: [dataForm.hasOwnProperty('is_sufficiant_service_goods') ? dataForm.is_sufficiant_service_goods : ''],
|
||||||
|
service_goods_remarks: [dataForm.hasOwnProperty('service_goods_remarks') ? dataForm.service_goods_remarks : '' ]
|
||||||
});
|
});
|
||||||
if (api.length > 0) {
|
if (api.length > 0) {
|
||||||
api.forEach(val => {
|
api.forEach(val => {
|
||||||
@ -182,9 +194,18 @@ this.complete_status = this.pdDetails.pd_status == 'COMPLETED' ? true : false;
|
|||||||
}
|
}
|
||||||
if (val.type_of_activity_id == 5) {
|
if (val.type_of_activity_id == 5) {
|
||||||
if (val.products) {
|
if (val.products) {
|
||||||
this.serviceProviderForm = true;
|
// this.serviceProviderForm = true;
|
||||||
}
|
let servicing_temparr = [];
|
||||||
|
if(dataForm.hasOwnProperty('service_provider')){
|
||||||
|
servicing_temparr['service_provider'] = dataForm.servicing_details[0].service_provider;
|
||||||
|
this.initServicingDetails(servicing_temparr);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
this.suppliers_service_providers = val.products;
|
||||||
|
this.initServicingDetails(null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
this.noRecordsFound = true;
|
this.noRecordsFound = true;
|
||||||
}
|
}
|
||||||
@ -204,6 +225,9 @@ this.complete_status = this.pdDetails.pd_status == 'COMPLETED' ? true : false;
|
|||||||
manufacturing_details: this.fb.array([this.manufacturingFormCreation(record,type2length)]),
|
manufacturing_details: this.fb.array([this.manufacturingFormCreation(record,type2length)]),
|
||||||
retail_details: this.fb.array([this.retailFormCreation(type3length)]),
|
retail_details: this.fb.array([this.retailFormCreation(type3length)]),
|
||||||
trade_details: this.fb.array([this.tradingFormCreation(type4length)]),
|
trade_details: this.fb.array([this.tradingFormCreation(type4length)]),
|
||||||
|
servicing_details: this.fb.array([this.servicingFormCreation(type5length)]),
|
||||||
|
is_sufficiant_service_goods: [''],
|
||||||
|
service_goods_remarks: ['']
|
||||||
});
|
});
|
||||||
if (api.length > 0) {
|
if (api.length > 0) {
|
||||||
api.forEach(val => {
|
api.forEach(val => {
|
||||||
@ -232,8 +256,10 @@ this.complete_status = this.pdDetails.pd_status == 'COMPLETED' ? true : false;
|
|||||||
}
|
}
|
||||||
if (val.type_of_activity_id == 5) {
|
if (val.type_of_activity_id == 5) {
|
||||||
if (val.products) {
|
if (val.products) {
|
||||||
// this.suppliers_service_product = val.products;
|
|
||||||
this.serviceProviderForm = true;
|
this.suppliers_service_providers = val.products;
|
||||||
|
this.initServicingDetails(null);
|
||||||
|
// this.serviceProviderForm = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -260,6 +286,10 @@ this.complete_status = this.pdDetails.pd_status == 'COMPLETED' ? true : false;
|
|||||||
retail_details: this.fb.array([this.retailFormCreation(type3length)]),
|
retail_details: this.fb.array([this.retailFormCreation(type3length)]),
|
||||||
|
|
||||||
trade_details: this.fb.array([this.tradingFormCreation(type4length)]),
|
trade_details: this.fb.array([this.tradingFormCreation(type4length)]),
|
||||||
|
servicing_details: this.fb.array([this.servicingFormCreation(type5length)]),
|
||||||
|
|
||||||
|
is_sufficiant_service_goods: [''],
|
||||||
|
service_goods_remarks: ['']
|
||||||
});
|
});
|
||||||
if (api.length > 0) {
|
if (api.length > 0) {
|
||||||
api.forEach(val => {
|
api.forEach(val => {
|
||||||
@ -289,8 +319,9 @@ this.complete_status = this.pdDetails.pd_status == 'COMPLETED' ? true : false;
|
|||||||
}
|
}
|
||||||
if (val.type_of_activity_id == 5) {
|
if (val.type_of_activity_id == 5) {
|
||||||
if (val.products) {
|
if (val.products) {
|
||||||
// this.suppliers_service_product = val.products;
|
this.suppliers_service_providers = val.products;
|
||||||
this.serviceProviderForm = true;
|
this.initServicingDetails(null);
|
||||||
|
// this.serviceProviderForm = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -391,6 +422,26 @@ this.complete_status = this.pdDetails.pd_status == 'COMPLETED' ? true : false;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
servicingForm: Boolean = false;
|
||||||
|
servicingFormCreation(val) {
|
||||||
|
console.log('inside servicingFormCreation',val);
|
||||||
|
let arr = val
|
||||||
|
// let arr = val.filter(data => data.type_of_activity_id == 4);
|
||||||
|
if (arr > 0){
|
||||||
|
console.log('IF');
|
||||||
|
this.servicingForm = true;
|
||||||
|
return this.fb.group({
|
||||||
|
service_provider: this.fb.array([])
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
console.log('Else');
|
||||||
|
return this.fb.group({
|
||||||
|
service_provider: this.fb.array([])
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
initManufacturingDetails(datas) {
|
initManufacturingDetails(datas) {
|
||||||
const rawMaterial = <FormArray>this.stockForm.controls['manufacturing_details']['controls'][0].controls['manufacturing_raw_materials'];
|
const rawMaterial = <FormArray>this.stockForm.controls['manufacturing_details']['controls'][0].controls['manufacturing_raw_materials'];
|
||||||
const finishedGoods = <FormArray>this.stockForm.controls['manufacturing_details']['controls'][0].controls['manufacturing_finished_goods'];
|
const finishedGoods = <FormArray>this.stockForm.controls['manufacturing_details']['controls'][0].controls['manufacturing_finished_goods'];
|
||||||
@ -405,8 +456,8 @@ this.complete_status = this.pdDetails.pd_status == 'COMPLETED' ? true : false;
|
|||||||
'raw_uom': '',
|
'raw_uom': '',
|
||||||
'other_uom': '',
|
'other_uom': '',
|
||||||
'raw_value': '',
|
'raw_value': '',
|
||||||
'is_sufficiant_raw': '',
|
// 'is_sufficiant_raw': '',
|
||||||
'rawmaterial_remarks': ''
|
// 'rawmaterial_remarks': ''
|
||||||
};
|
};
|
||||||
rawMaterial.push(this.createRawmaterial(Ref_RawMaterials));
|
rawMaterial.push(this.createRawmaterial(Ref_RawMaterials));
|
||||||
});
|
});
|
||||||
@ -423,8 +474,8 @@ this.complete_status = this.pdDetails.pd_status == 'COMPLETED' ? true : false;
|
|||||||
'goods_uom': '',
|
'goods_uom': '',
|
||||||
'goods_other_uom': '',
|
'goods_other_uom': '',
|
||||||
'goods_value': '',
|
'goods_value': '',
|
||||||
'is_sufficiant_goods': '',
|
// 'is_sufficiant_goods': '',
|
||||||
'finishedgoods_remarks': ''
|
// 'finishedgoods_remarks': ''
|
||||||
};
|
};
|
||||||
finishedGoods.push(this.createGoods(Ref_Finished_Goods));
|
finishedGoods.push(this.createGoods(Ref_Finished_Goods));
|
||||||
});
|
});
|
||||||
@ -473,8 +524,8 @@ this.complete_status = this.pdDetails.pd_status == 'COMPLETED' ? true : false;
|
|||||||
uomSearch:[null],
|
uomSearch:[null],
|
||||||
other_uom: [''],
|
other_uom: [''],
|
||||||
raw_value: [''],
|
raw_value: [''],
|
||||||
is_sufficiant_raw: [''],
|
// is_sufficiant_raw: [''],
|
||||||
rawmaterial_remarks: ['']
|
// rawmaterial_remarks: ['']
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
return this.fb.group({
|
return this.fb.group({
|
||||||
@ -485,8 +536,8 @@ this.complete_status = this.pdDetails.pd_status == 'COMPLETED' ? true : false;
|
|||||||
uomSearch:[null],
|
uomSearch:[null],
|
||||||
other_uom: [records.other_uom],
|
other_uom: [records.other_uom],
|
||||||
raw_value: [records.raw_value],
|
raw_value: [records.raw_value],
|
||||||
is_sufficiant_raw: [records.is_sufficiant_raw],
|
// is_sufficiant_raw: [records.is_sufficiant_raw],
|
||||||
rawmaterial_remarks: [records.rawmaterial_remarks]
|
// rawmaterial_remarks: [records.rawmaterial_remarks]
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -504,8 +555,8 @@ this.complete_status = this.pdDetails.pd_status == 'COMPLETED' ? true : false;
|
|||||||
'traded_goods_uom': '',
|
'traded_goods_uom': '',
|
||||||
'traded_goods_other_uom': '',
|
'traded_goods_other_uom': '',
|
||||||
'estimated_traded_goods_value': '',
|
'estimated_traded_goods_value': '',
|
||||||
'is_sufficiant_traded_goods': '',
|
// 'is_sufficiant_traded_goods': '',
|
||||||
'traded_goods_remarks': ''
|
// 'traded_goods_remarks': ''
|
||||||
};
|
};
|
||||||
tradedGoods.push(this.createTradedGoods(Ref_Trade_Goods));
|
tradedGoods.push(this.createTradedGoods(Ref_Trade_Goods));
|
||||||
});
|
});
|
||||||
@ -541,8 +592,8 @@ this.complete_status = this.pdDetails.pd_status == 'COMPLETED' ? true : false;
|
|||||||
uomSearch:[null],
|
uomSearch:[null],
|
||||||
goods_other_uom: [''],
|
goods_other_uom: [''],
|
||||||
goods_value: [''],
|
goods_value: [''],
|
||||||
is_sufficiant_goods: [''],
|
// is_sufficiant_goods: [''],
|
||||||
finishedgoods_remarks: ['']
|
// finishedgoods_remarks: ['']
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -554,8 +605,8 @@ this.complete_status = this.pdDetails.pd_status == 'COMPLETED' ? true : false;
|
|||||||
uomSearch:[null],
|
uomSearch:[null],
|
||||||
goods_other_uom: [records.goods_other_uom],
|
goods_other_uom: [records.goods_other_uom],
|
||||||
goods_value: [records.goods_value],
|
goods_value: [records.goods_value],
|
||||||
is_sufficiant_goods: [records.is_sufficiant_goods],
|
// is_sufficiant_goods: [records.is_sufficiant_goods],
|
||||||
finishedgoods_remarks: [records.finishedgoods_remarks]
|
// finishedgoods_remarks: [records.finishedgoods_remarks]
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -572,8 +623,8 @@ this.complete_status = this.pdDetails.pd_status == 'COMPLETED' ? true : false;
|
|||||||
'traded_goods_uom': '',
|
'traded_goods_uom': '',
|
||||||
'traded_goods_other_uom': '',
|
'traded_goods_other_uom': '',
|
||||||
'estimated_traded_goods_value': '',
|
'estimated_traded_goods_value': '',
|
||||||
'is_sufficiant_traded_goods': '',
|
// 'is_sufficiant_traded_goods': '',
|
||||||
'traded_goods_remarks': ''
|
// 'traded_goods_remarks': ''
|
||||||
};
|
};
|
||||||
tradedGoods.push(this.createTradedGoods(Ref_Trade_Goods));
|
tradedGoods.push(this.createTradedGoods(Ref_Trade_Goods));
|
||||||
});
|
});
|
||||||
@ -609,8 +660,8 @@ this.complete_status = this.pdDetails.pd_status == 'COMPLETED' ? true : false;
|
|||||||
uomSearch:[null],
|
uomSearch:[null],
|
||||||
traded_goods_other_uom: [''],
|
traded_goods_other_uom: [''],
|
||||||
estimated_traded_goods_value: [''],
|
estimated_traded_goods_value: [''],
|
||||||
is_sufficiant_traded_goods: [''],
|
// is_sufficiant_traded_goods: [''],
|
||||||
traded_goods_remarks: ['']
|
// traded_goods_remarks: ['']
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -622,8 +673,78 @@ this.complete_status = this.pdDetails.pd_status == 'COMPLETED' ? true : false;
|
|||||||
uomSearch:[null],
|
uomSearch:[null],
|
||||||
traded_goods_other_uom: [records.traded_goods_other_uom],
|
traded_goods_other_uom: [records.traded_goods_other_uom],
|
||||||
estimated_traded_goods_value: [records.estimated_traded_goods_value],
|
estimated_traded_goods_value: [records.estimated_traded_goods_value],
|
||||||
is_sufficiant_traded_goods: [records.is_sufficiant_traded_goods],
|
// is_sufficiant_traded_goods: [records.is_sufficiant_traded_goods],
|
||||||
traded_goods_remarks: [records.traded_goods_remarks]
|
// traded_goods_remarks: [records.traded_goods_remarks]
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
initServicingDetails(datas) {
|
||||||
|
const service = <FormArray>this.stockForm.controls['servicing_details']['controls'][0].controls['service_provider'];
|
||||||
|
if (datas === null) {
|
||||||
|
|
||||||
|
if (this.suppliers_service_providers.length > 0) {
|
||||||
|
this.suppliers_service_providers.forEach(val => {
|
||||||
|
let Serv_Prov_Goods: any = {
|
||||||
|
'service_provider_name': val,
|
||||||
|
'service_provider_observed': '',
|
||||||
|
'service_provider_quantity': '',
|
||||||
|
'service_provider_uom': '',
|
||||||
|
'service_provider_other_uom': '',
|
||||||
|
'estimated_service_provider_value': ''
|
||||||
|
}
|
||||||
|
|
||||||
|
service.push(this.createServiceProvider(Serv_Prov_Goods));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
service.push(this.createServiceProvider(null));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (datas.service_provider !== undefined) {
|
||||||
|
datas.service_provider.forEach((val, index) => {
|
||||||
|
if (val.estimated_service_provider_value) {
|
||||||
|
this.inWords(val.estimated_service_provider_value, 5, index);
|
||||||
|
}
|
||||||
|
this.checkComments(val.service_provider_observed, 5, index);
|
||||||
|
service.push(this.createServiceProvider(val));
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
service.push(this.createServiceProvider(null));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
createServiceProvider(records) {
|
||||||
|
|
||||||
|
if (records === null) {
|
||||||
|
|
||||||
|
return this.fb.group({
|
||||||
|
service_provider_name: [''],
|
||||||
|
service_provider_observed: [''],
|
||||||
|
service_provider_quantity: [''],
|
||||||
|
service_provider_uom: [''],
|
||||||
|
uomSearch:[null],
|
||||||
|
service_provider_other_uom: [''],
|
||||||
|
estimated_service_provider_value: [''],
|
||||||
|
// traded_goods_value: [''],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
|
||||||
|
return this.fb.group({
|
||||||
|
service_provider_name: [records.service_provider_name],
|
||||||
|
service_provider_observed: [records.service_provider_observed],
|
||||||
|
service_provider_quantity: [records.service_provider_quantity],
|
||||||
|
service_provider_uom: [records.service_provider_uom],
|
||||||
|
uomSearch:[null],
|
||||||
|
service_provider_other_uom: [records.service_provider_other_uom],
|
||||||
|
estimated_service_provider_value: [records.estimated_service_provider_value],
|
||||||
|
// traded_goods_value: [records.traded_goods_value],
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -676,6 +797,11 @@ this.complete_status = this.pdDetails.pd_status == 'COMPLETED' ? true : false;
|
|||||||
control.push(this.createTradedGoods(null));
|
control.push(this.createTradedGoods(null));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case 3: {
|
||||||
|
const control = <FormArray>this.stockForm.controls['servicing_details']['controls'][0].controls['service_provider'];
|
||||||
|
control.push(this.createServiceProvider(null));
|
||||||
|
break;
|
||||||
|
}
|
||||||
default: {
|
default: {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -698,6 +824,11 @@ this.complete_status = this.pdDetails.pd_status == 'COMPLETED' ? true : false;
|
|||||||
control.removeAt(index);
|
control.removeAt(index);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case 3: {
|
||||||
|
const control = <FormArray>this.stockForm.controls['servicing_details']['controls'][0].controls['service_provider'];
|
||||||
|
control.removeAt(index);
|
||||||
|
break;
|
||||||
|
}
|
||||||
default: {
|
default: {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -711,14 +842,18 @@ this.complete_status = this.pdDetails.pd_status == 'COMPLETED' ? true : false;
|
|||||||
FinishedCounterArray: any = [];
|
FinishedCounterArray: any = [];
|
||||||
RetailCounterArray: any = [];
|
RetailCounterArray: any = [];
|
||||||
WholeSaleCounterArray: any = [];
|
WholeSaleCounterArray: any = [];
|
||||||
|
ServiceCounterArray: any = [];
|
||||||
|
|
||||||
not_stock_of_rm: any = [];
|
not_stock_of_rm: any = [];
|
||||||
not_stock_of_fg: any = [];
|
not_stock_of_fg: any = [];
|
||||||
not_stock_of_tg: any = [];
|
not_stock_of_tg: any = [];
|
||||||
not_stock_of_ws: any = [];
|
not_stock_of_ws: any = [];
|
||||||
|
not_stock_of_sp: any = [];
|
||||||
|
|
||||||
checkComments(value, flag, index) {
|
checkComments(value, flag, index) {
|
||||||
|
|
||||||
console.log(value, flag, index);
|
console.log(value, flag, index);
|
||||||
|
return;
|
||||||
if (flag == 1) {
|
if (flag == 1) {
|
||||||
|
|
||||||
this.ManufacturingCounterArray[index] = value != "" ? 1 : 0;
|
this.ManufacturingCounterArray[index] = value != "" ? 1 : 0;
|
||||||
@ -757,6 +892,30 @@ this.complete_status = this.pdDetails.pd_status == 'COMPLETED' ? true : false;
|
|||||||
this.WholeSaleCounterArray[index] = value != "" ? 1 : 0
|
this.WholeSaleCounterArray[index] = value != "" ? 1 : 0
|
||||||
this.not_stock_of_ws[index] = value == "yes" ? 1 : 0;
|
this.not_stock_of_ws[index] = value == "yes" ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
if (flag == 5) {
|
||||||
|
console.log('adf');
|
||||||
|
this.ServiceCounterArray[index] = value != "" ? 1 : 0
|
||||||
|
this.not_stock_of_sp[index] = value == "yes" ? 1 : 0;
|
||||||
|
|
||||||
|
let SPOverallCount = this.ServiceCounterArray.reduce((sum, val) => sum + +val, 0);
|
||||||
|
this.SPCommentCard = SPOverallCount > 0 ? true : false;
|
||||||
|
|
||||||
|
let not_stock3 = this.not_stock_of_rm.reduce((sum, val) => sum + +val, 0);
|
||||||
|
|
||||||
|
if(not_stock3 > 0){
|
||||||
|
|
||||||
|
this.SPsufficientList[0].disabled = false;
|
||||||
|
this.SPsufficientList[2].disabled = true;
|
||||||
|
|
||||||
|
}
|
||||||
|
else if(not_stock3 == 0){
|
||||||
|
|
||||||
|
this.SPsufficientList[0].disabled = true;
|
||||||
|
this.SPsufficientList[2].disabled = false;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
let FGOverallCount = this.FinishedCounterArray.reduce((sum, val) => sum + +val, 0);
|
let FGOverallCount = this.FinishedCounterArray.reduce((sum, val) => sum + +val, 0);
|
||||||
let RTGOverallCount = this.RetailCounterArray.reduce((sum, val) => sum + +val, 0);
|
let RTGOverallCount = this.RetailCounterArray.reduce((sum, val) => sum + +val, 0);
|
||||||
let WTGOverallCount = this.WholeSaleCounterArray.reduce((sum, val) => sum + +val, 0);
|
let WTGOverallCount = this.WholeSaleCounterArray.reduce((sum, val) => sum + +val, 0);
|
||||||
@ -833,6 +992,10 @@ this.complete_status = this.pdDetails.pd_status == 'COMPLETED' ? true : false;
|
|||||||
case 4:
|
case 4:
|
||||||
this.T_tradedGoodsValueInWords[i] = this.constant.convertNumberToWords(e);
|
this.T_tradedGoodsValueInWords[i] = this.constant.convertNumberToWords(e);
|
||||||
break;
|
break;
|
||||||
|
case 5:
|
||||||
|
this.S_GoodsValueInWords[i] = this.constant.convertNumberToWords(e);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -80,8 +80,14 @@
|
|||||||
<div formArrayName="main_raw_materials">
|
<div formArrayName="main_raw_materials">
|
||||||
<div *ngFor="let items of item.controls.main_raw_materials['controls']; let l=index let last =last"
|
<div *ngFor="let items of item.controls.main_raw_materials['controls']; let l=index let last =last"
|
||||||
[formGroupName]="l">
|
[formGroupName]="l">
|
||||||
|
<ion-row>
|
||||||
|
<div style="width: 85%;">
|
||||||
<mat-card-subtitle>Raw Material #{{l+1}}</mat-card-subtitle>
|
<mat-card-subtitle>Raw Material #{{l+1}}</mat-card-subtitle>
|
||||||
|
</div>
|
||||||
|
<div style="width: 10%;">
|
||||||
<button mini ion-fab color="optblue" slot="fixed" (click)="captureTheSupplierPics('Raw Material',l,items.get('manufacturing_supplier_name').value)"><ion-icon name="md-camera" style="font-size: 24px"></ion-icon></button>
|
<button mini ion-fab color="optblue" slot="fixed" (click)="captureTheSupplierPics('Raw Material',l,items.get('manufacturing_supplier_name').value)"><ion-icon name="md-camera" style="font-size: 24px"></ion-icon></button>
|
||||||
|
</div>
|
||||||
|
</ion-row>
|
||||||
<mat-card-content>
|
<mat-card-content>
|
||||||
<div fxLayout="row nowrap" fxLayoutGap="2px" fxLayoutAlign="start none">
|
<div fxLayout="row nowrap" fxLayoutGap="2px" fxLayoutAlign="start none">
|
||||||
<mat-form-field style="width: 100%">
|
<mat-form-field style="width: 100%">
|
||||||
@ -191,8 +197,15 @@
|
|||||||
<div formArrayName="trading_products">
|
<div formArrayName="trading_products">
|
||||||
<div *ngFor="let items of item.controls.trading_products['controls']; let l=index; let last = last"
|
<div *ngFor="let items of item.controls.trading_products['controls']; let l=index; let last = last"
|
||||||
[formGroupName]="l">
|
[formGroupName]="l">
|
||||||
|
<ion-row>
|
||||||
|
<div style="width: 85%;">
|
||||||
<mat-card-subtitle>Trading Product #{{l+1}}</mat-card-subtitle>
|
<mat-card-subtitle>Trading Product #{{l+1}}</mat-card-subtitle>
|
||||||
|
</div>
|
||||||
|
<div style="width: 10%;">
|
||||||
<button mini ion-fab color="optblue" slot="fixed" (click)="captureTheSupplierPics('Trading Product',l,items.get('trade_supplier_name').value)"><ion-icon name="md-camera" style="font-size: 24px"></ion-icon></button>
|
<button mini ion-fab color="optblue" slot="fixed" (click)="captureTheSupplierPics('Trading Product',l,items.get('trade_supplier_name').value)"><ion-icon name="md-camera" style="font-size: 24px"></ion-icon></button>
|
||||||
|
</div>
|
||||||
|
</ion-row>
|
||||||
|
|
||||||
<mat-card-content>
|
<mat-card-content>
|
||||||
<div fxLayout="row nowrap" fxLayoutGap="2px" fxLayoutAlign="start none">
|
<div fxLayout="row nowrap" fxLayoutGap="2px" fxLayoutAlign="start none">
|
||||||
<mat-form-field style="width: 100%">
|
<mat-form-field style="width: 100%">
|
||||||
@ -295,6 +308,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</mat-card>
|
</mat-card>
|
||||||
|
|
||||||
<mat-card *ngIf="servicingForm">
|
<mat-card *ngIf="servicingForm">
|
||||||
|
|
||||||
<mat-card-title>
|
<mat-card-title>
|
||||||
@ -302,19 +316,27 @@
|
|||||||
</mat-card-title>
|
</mat-card-title>
|
||||||
|
|
||||||
<div formArrayName="servicing_details">
|
<div formArrayName="servicing_details">
|
||||||
<div *ngFor="let serv of supplierInfoForm.controls.servicing_details['controls']; let i=index" [formGroupName]="i">
|
<div *ngFor="let item of supplierInfoForm.controls.servicing_details['controls']; let i=index" [formGroupName]="i">
|
||||||
<div formArrayName="service_providers">
|
<div formArrayName="service_providers">
|
||||||
<div *ngFor="let ser of serv.controls.service_providers['controls']; let s=index; let last = last"
|
<div *ngFor="let items of item.controls.service_providers['controls']; let l=index; let last = last"
|
||||||
[formGroupName]="s">
|
[formGroupName]="l">
|
||||||
<mat-card-subtitle>Service Provider #{{s+1}}</mat-card-subtitle>
|
<ion-row>
|
||||||
|
<div style="width: 85%;">
|
||||||
|
<mat-card-subtitle>Service Provider #{{l+1}}</mat-card-subtitle>
|
||||||
|
</div>
|
||||||
|
<div style="width: 10%;">
|
||||||
|
<button mini ion-fab color="optblue" slot="fixed" (click)="captureTheSupplierPics('Service Provider',l,items.get('service_provider_supplier_name').value)"><ion-icon name="md-camera" style="font-size: 24px"></ion-icon></button>
|
||||||
|
</div>
|
||||||
|
</ion-row>
|
||||||
<mat-card-content>
|
<mat-card-content>
|
||||||
<div fxLayout="row nowrap" fxLayoutGap="2px" fxLayoutAlign="start none">
|
<div fxLayout="row nowrap" fxLayoutGap="2px" fxLayoutAlign="start none">
|
||||||
<mat-form-field style="width: 100%">
|
<mat-form-field style="width: 100%">
|
||||||
<mat-select placeholder="Service Provide Name" formControlName="service_provider_name">
|
|
||||||
<mat-option>Select</mat-option>
|
<mat-select placeholder="Trading Product Name" formControlName="service_provider_name">
|
||||||
<mat-option *ngFor="let sp of business_serviceProvider" [value]="sp.name">{{sp.name }}</mat-option>
|
<mat-option>Select</mat-option>
|
||||||
</mat-select>
|
<mat-option *ngFor="let tp of business_serviceProvider" [value]="tp.name">{{ tp.name }}</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field style="width: 100%">
|
<mat-form-field style="width: 100%">
|
||||||
<input matInput placeholder="Supplier Name" formControlName="service_provider_supplier_name">
|
<input matInput placeholder="Supplier Name" formControlName="service_provider_supplier_name">
|
||||||
@ -333,7 +355,7 @@
|
|||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field style="width: 100%">
|
<mat-form-field style="width: 100%">
|
||||||
<mat-select placeholder="Contact Person Designation" formControlName="person_designation"
|
<mat-select placeholder="Contact Person Designation" formControlName="person_designation"
|
||||||
(selectionChange)="selectedPersonDesignation(ser,$event.value,3)">
|
(selectionChange)="selectedPersonDesignation(items,$event.value,3)">
|
||||||
<mat-option>Select</mat-option>
|
<mat-option>Select</mat-option>
|
||||||
<mat-option *ngFor="let comrelShip of m_companyRelationShipList" [value]="comrelShip.company_relationship_id">
|
<mat-option *ngFor="let comrelShip of m_companyRelationShipList" [value]="comrelShip.company_relationship_id">
|
||||||
{{comrelShip.name}}
|
{{comrelShip.name}}
|
||||||
@ -341,7 +363,7 @@
|
|||||||
<!-- <mat-option value="1" > Not Applicable </mat-option> -->
|
<!-- <mat-option value="1" > Not Applicable </mat-option> -->
|
||||||
</mat-select>
|
</mat-select>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field style="width: 100%" *ngIf="ser.get('person_designation').value == 1">
|
<mat-form-field style="width: 100%" *ngIf="items.get('person_designation').value == 1">
|
||||||
<input matInput placeholder="Specify Person Designation" formControlName="other_person_designation">
|
<input matInput placeholder="Specify Person Designation" formControlName="other_person_designation">
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field style="width: 100%">
|
<mat-form-field style="width: 100%">
|
||||||
@ -362,7 +384,7 @@
|
|||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field style="width: 100%">
|
<mat-form-field style="width: 100%">
|
||||||
<mat-select placeholder="Payment Terms" formControlName="service_provider_payment_type"
|
<mat-select placeholder="Payment Terms" formControlName="service_provider_payment_type"
|
||||||
(selectionChange)="selectedPaymentTerms(ser,$event.value,3);checkCard($event.value,3,s);">
|
(selectionChange)="selectedPaymentTerms(items,$event.value,3);checkCard($event.value,3,l);">
|
||||||
<mat-option>Select</mat-option>
|
<mat-option>Select</mat-option>
|
||||||
<mat-option *ngFor="let pm of m_paymentList" [value]="pm.id">{{ pm.name }}</mat-option>
|
<mat-option *ngFor="let pm of m_paymentList" [value]="pm.id">{{ pm.name }}</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
@ -376,7 +398,7 @@
|
|||||||
<mat-option value="Payment made through Cash and Banking channels.">Payment made through Cash and 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-select>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<span *ngIf="items.get('trade_product_payment_type').value == 3">
|
<span *ngIf="items.get('service_provider_payment_type').value == 3">
|
||||||
<mat-label>No.of days of Credit Provided by Supplier </mat-label>
|
<mat-label>No.of days of Credit Provided by Supplier </mat-label>
|
||||||
<mat-form-field style="width: 100%">
|
<mat-form-field style="width: 100%">
|
||||||
<input matInput placeholder="Days From" formControlName="service_provider_credit_days_from" type="number">
|
<input matInput placeholder="Days From" formControlName="service_provider_credit_days_from" type="number">
|
||||||
@ -389,8 +411,7 @@
|
|||||||
</mat-card-content>
|
</mat-card-content>
|
||||||
<ion-buttons end>
|
<ion-buttons end>
|
||||||
<ion-col col-3 offset-3>
|
<ion-col col-3 offset-3>
|
||||||
<a (click)="removeServiceProvider(s)"
|
<a (click)="removeServiceProvider(l)" *ngIf="item.controls.service_providers.controls.length > 1">
|
||||||
*ngIf="serv.controls.service_providers.controls.length > 1">
|
|
||||||
<ion-icon name="md-trash" color="optblue" style="font-size: 22px;"></ion-icon>
|
<ion-icon name="md-trash" color="optblue" style="font-size: 22px;"></ion-icon>
|
||||||
</a>
|
</a>
|
||||||
</ion-col>
|
</ion-col>
|
||||||
|
|||||||
@ -57,39 +57,46 @@ export class PdQuestionSupplierInfoPage {
|
|||||||
|
|
||||||
|
|
||||||
this.qustCat.getTypeofActivityForSuppliedInfoForm(this.pdDetails.pd_id, this.company_id).subscribe(data => {
|
this.qustCat.getTypeofActivityForSuppliedInfoForm(this.pdDetails.pd_id, this.company_id).subscribe(data => {
|
||||||
|
|
||||||
|
if(data.dataStatus){
|
||||||
|
|
||||||
|
let datas = data.records;
|
||||||
|
console.log('datas',datas);
|
||||||
|
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_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) {
|
||||||
|
return datas.type_of_activity[key];
|
||||||
|
});
|
||||||
|
|
||||||
if (data.dataStatus) {
|
if(api.length > 0){
|
||||||
|
api.forEach(val => {
|
||||||
|
if (val.type_of_activity_id == 3) {
|
||||||
|
if(val.prodcuts){
|
||||||
|
this.business_tradingProducts.push(val.prodcuts);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let datas = data.records;
|
if (val.type_of_activity_id == 4) {
|
||||||
this.initFormLoadDetails(datas.type_of_activity);
|
if(val.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.push(val.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]);
|
}
|
||||||
|
if (val.type_of_activity_id == 5) {
|
||||||
let api = Object.keys(datas.type_of_activity).map(function (key) {
|
if(val.prodcuts){
|
||||||
return datas.type_of_activity[key];
|
this.business_serviceProvider.push(val.prodcuts);
|
||||||
});
|
console.log(this.business_serviceProvider);
|
||||||
|
}
|
||||||
if (api.length > 0) {
|
}
|
||||||
api.forEach(val => {
|
});
|
||||||
if (val.type_of_activity_id == 3) {
|
|
||||||
if (val.prodcuts) {
|
|
||||||
this.business_tradingProducts.push(val.prodcuts);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (val.type_of_activity_id == 4) {
|
this.business_tradingProducts = [].concat.apply([], this.business_tradingProducts);
|
||||||
if (val.prodcuts) {
|
|
||||||
this.business_tradingProducts.push(val.prodcuts);
|
|
||||||
}
|
}else {
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
this.business_tradingProducts = [].concat.apply([], this.business_tradingProducts);
|
|
||||||
|
|
||||||
} else {
|
|
||||||
this.toast.pdTriggerappmessage('No Category Records Found.!');
|
this.toast.pdTriggerappmessage('No Category Records Found.!');
|
||||||
this.noRecordsFound = false;
|
this.noRecordsFound = false;
|
||||||
this.errorMessage = data.msg;
|
this.errorMessage = data.msg;
|
||||||
@ -102,14 +109,13 @@ export class PdQuestionSupplierInfoPage {
|
|||||||
this.getdropList();
|
this.getdropList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ionViewDidLoad() {
|
ionViewDidLoad() {
|
||||||
console.log('ionViewDidLoad PdQuestionSupplierInfoPage');
|
console.log('ionViewDidLoad PdQuestionSupplierInfoPage');
|
||||||
this.getPDImages();
|
this.getPDImages();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
serviceProviderForm: Boolean = false;
|
// serviceProviderForm: Boolean = false;
|
||||||
initFormLoadDetails(record) {
|
initFormLoadDetails(record) {
|
||||||
let params: any = {};
|
let params: any = {};
|
||||||
params.parent_pdid = this.pdDetails.parent_pd_id
|
params.parent_pdid = this.pdDetails.parent_pd_id
|
||||||
@ -120,6 +126,7 @@ export class PdQuestionSupplierInfoPage {
|
|||||||
this.qustCat.retiverForm(params).subscribe(
|
this.qustCat.retiverForm(params).subscribe(
|
||||||
data => {
|
data => {
|
||||||
if (data['dataStatus'] == true) {
|
if (data['dataStatus'] == true) {
|
||||||
|
|
||||||
let dataForm = data['records'];
|
let dataForm = data['records'];
|
||||||
if (dataForm !== undefined) {
|
if (dataForm !== undefined) {
|
||||||
this.supplierInfoForm = this.fb.group({
|
this.supplierInfoForm = this.fb.group({
|
||||||
@ -168,9 +175,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;
|
||||||
if (dataForm.trade_details[0] != null) {
|
if (dataForm.servicing_details[0] != null) {
|
||||||
let api_service_provider = dataForm.servicing_details[0].service_provider;
|
let api_service_providers = dataForm.servicing_details[0].service_providers;
|
||||||
this.initServiceProvidersDetails(api_service_provider);
|
this.initServiceProvidersDetails(api_service_providers);
|
||||||
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.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 {
|
else {
|
||||||
@ -180,6 +187,7 @@ export class PdQuestionSupplierInfoPage {
|
|||||||
}
|
}
|
||||||
this.noRecordsFound = true;
|
this.noRecordsFound = true;
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
this.supplierInfoForm = this.fb.group({
|
this.supplierInfoForm = this.fb.group({
|
||||||
parent_pdid: [this.pdDetails.parent_pd_id],
|
parent_pdid: [this.pdDetails.parent_pd_id],
|
||||||
pdid: [this.pdDetails.pd_id],
|
pdid: [this.pdDetails.pd_id],
|
||||||
@ -210,6 +218,7 @@ export class PdQuestionSupplierInfoPage {
|
|||||||
this.noRecordsFound = true;
|
this.noRecordsFound = true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
console.log(' data in else part');
|
||||||
this.supplierInfoForm = this.fb.group({
|
this.supplierInfoForm = this.fb.group({
|
||||||
parent_pdid: [this.pdDetails.parent_pd_id],
|
parent_pdid: [this.pdDetails.parent_pd_id],
|
||||||
pdid: [this.pdDetails.pd_id],
|
pdid: [this.pdDetails.pd_id],
|
||||||
@ -234,7 +243,6 @@ 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.initServiceProvidersDetails(null);
|
this.initServiceProvidersDetails(null);
|
||||||
this.supplierInfoForm.controls['servicing_details']['controls'][0].controls['service_providers_total_payments_percent_on_credit'].setValue(null);
|
this.supplierInfoForm.controls['servicing_details']['controls'][0].controls['service_providers_total_payments_percent_on_credit'].setValue(null);
|
||||||
}
|
}
|
||||||
@ -277,14 +285,18 @@ export class PdQuestionSupplierInfoPage {
|
|||||||
|
|
||||||
servicingForm: Boolean = false;
|
servicingForm: Boolean = false;
|
||||||
servicingFormCreation(val) {
|
servicingFormCreation(val) {
|
||||||
|
|
||||||
let arr = val.filter(data => data.type_of_activity_id == 5);
|
let arr = val.filter(data => data.type_of_activity_id == 5);
|
||||||
|
console.log(arr,arr.length);
|
||||||
if (arr.length > 0) {
|
if (arr.length > 0) {
|
||||||
|
console.log('IF');
|
||||||
this.servicingForm = true;
|
this.servicingForm = true;
|
||||||
return this.fb.group({
|
return this.fb.group({
|
||||||
service_providers: this.fb.array([]),
|
service_providers: this.fb.array([]),
|
||||||
service_providers_total_payments_percent_on_credit: []
|
service_providers_total_payments_percent_on_credit: []
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
console.log('ELSE');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -404,11 +416,14 @@ export class PdQuestionSupplierInfoPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
initServiceProvidersDetails(datas) {
|
initServiceProvidersDetails(datas) {
|
||||||
|
console.log('datas',datas);
|
||||||
const control = <FormArray>this.supplierInfoForm.controls['servicing_details']['controls'][0].controls['service_providers'];
|
const control = <FormArray>this.supplierInfoForm.controls['servicing_details']['controls'][0].controls['service_providers'];
|
||||||
|
|
||||||
if (datas === null) {
|
if (datas === null) {
|
||||||
|
console.log('initServiceProvidersDetails if null');
|
||||||
control.push(this.initServiceProviders(null));
|
control.push(this.initServiceProviders(null));
|
||||||
} else {
|
} else {
|
||||||
|
console.log('else not null');
|
||||||
datas.forEach((val, inx) => {
|
datas.forEach((val, inx) => {
|
||||||
this.checkCard(val.service_provider_payment_type, 3, inx);
|
this.checkCard(val.service_provider_payment_type, 3, inx);
|
||||||
control.push(this.initServiceProviders(val));
|
control.push(this.initServiceProviders(val));
|
||||||
@ -417,7 +432,9 @@ export class PdQuestionSupplierInfoPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
initServiceProviders(records) {
|
initServiceProviders(records) {
|
||||||
|
console.log('initServiceProviders',records);
|
||||||
if (records === null) {
|
if (records === null) {
|
||||||
|
console.log('if');
|
||||||
return this.fb.group({
|
return this.fb.group({
|
||||||
service_provider_name: [''],
|
service_provider_name: [''],
|
||||||
service_provider_supplier_name: [''],
|
service_provider_supplier_name: [''],
|
||||||
@ -435,6 +452,7 @@ export class PdQuestionSupplierInfoPage {
|
|||||||
service_provider_credit_days_to: [''],
|
service_provider_credit_days_to: [''],
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
|
console.log('else');
|
||||||
return this.fb.group({
|
return this.fb.group({
|
||||||
service_provider_name: [records.service_provider_name],
|
service_provider_name: [records.service_provider_name],
|
||||||
person_title_name: [records.person_title_name],
|
person_title_name: [records.person_title_name],
|
||||||
@ -686,8 +704,8 @@ export class PdQuestionSupplierInfoPage {
|
|||||||
|
|
||||||
|
|
||||||
captureTheSupplierPics(materialName, index, supplierName) {
|
captureTheSupplierPics(materialName, index, supplierName) {
|
||||||
console.log('ds');
|
|
||||||
// alert('dsa');
|
|
||||||
if (supplierName != '') {
|
if (supplierName != '') {
|
||||||
// 'Raw Material','l',items.get('manufacturing_supplier_name').value
|
// 'Raw Material','l',items.get('manufacturing_supplier_name').value
|
||||||
this.cameraProvider.getpicture().then(res => {
|
this.cameraProvider.getpicture().then(res => {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user