redo supplier stock : ps
This commit is contained in:
parent
53f586de63
commit
57833e3466
File diff suppressed because one or more lines are too long
@ -437,15 +437,14 @@
|
||||
<div formArrayName="servicing_details">
|
||||
<div *ngFor="let dtl of stockForm.controls.servicing_details['controls']; let par=index" [formGroupName]="par">
|
||||
<div formArrayName="service_provider">
|
||||
<div *ngFor="let serv of dtl.controls.service_provider['controls']; let chd=index;let last = last" [formGroupName]="chd">
|
||||
<mat-card-subtitle>Service Provider #{{chd+1}}</mat-card-subtitle>
|
||||
<div *ngFor="let serv of dtl.controls.service_provider['controls']; let c=index;let last = last" [formGroupName]="c">
|
||||
<mat-card-subtitle>Service Provider #{{c+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"
|
||||
>
|
||||
<mat-select placeholder="Stock" formControlName="service_provider_observed">
|
||||
<mat-option>Select</mat-option>
|
||||
<mat-option value="yes">Add Stock Details</mat-option>
|
||||
<mat-option value="no">No stock observed</mat-option>
|
||||
@ -478,16 +477,16 @@
|
||||
<mat-form-field style="width:100%">
|
||||
<input matInput autocomplete="off" placeholder="Estimated Value of Stock Observed"
|
||||
formControlName="estimated_service_provider_value" type="number"
|
||||
(keyup)="inWords($event.target.value,5,chd)">
|
||||
(keyup)="inWords($event.target.value,5,c)">
|
||||
<mat-hint align="start" style="font-size:70%" *ngIf="serv.get('estimated_service_provider_value').value != ''">{{"₹"}}
|
||||
{{S_GoodsValueInWords[g]}} Only</mat-hint>
|
||||
{{S_GoodsValueInWords[c]}} 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(chd,3)" *ngIf="dtl.controls.service_provider.controls.length>1">
|
||||
<a (click)="deleteTradedGoods(c,3)" *ngIf="dtl.controls.service_provider.controls.length>1">
|
||||
<ion-icon name="md-trash" color="optblue" style="font-size: 22px;"></ion-icon>
|
||||
</a>
|
||||
</ion-col>
|
||||
|
||||
@ -707,7 +707,7 @@ this.complete_status = this.pdDetails.pd_status == 'COMPLETED' ? true : false;
|
||||
if (val.estimated_service_provider_value) {
|
||||
this.inWords(val.estimated_service_provider_value, 5, index);
|
||||
}
|
||||
this.checkComments(val.service_provider_observed, 5, index);
|
||||
this.checkSPComment(val.service_provider_observed, 5, index);
|
||||
service.push(this.createServiceProvider(val));
|
||||
|
||||
});
|
||||
@ -850,8 +850,37 @@ this.complete_status = this.pdDetails.pd_status == 'COMPLETED' ? true : false;
|
||||
not_stock_of_ws: any = [];
|
||||
not_stock_of_sp: any = [];
|
||||
|
||||
checkSPComment(value, flag, index) {
|
||||
|
||||
if (flag == 5) {
|
||||
|
||||
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;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
checkComments(value, flag, index) {
|
||||
|
||||
console.log(value, flag, index);
|
||||
|
||||
if (flag == 1) {
|
||||
|
||||
this.ManufacturingCounterArray[index] = value != "" ? 1 : 0;
|
||||
@ -890,30 +919,6 @@ this.complete_status = this.pdDetails.pd_status == 'COMPLETED' ? true : false;
|
||||
this.WholeSaleCounterArray[index] = value != "" ? 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 RTGOverallCount = this.RetailCounterArray.reduce((sum, val) => sum + +val, 0);
|
||||
let WTGOverallCount = this.WholeSaleCounterArray.reduce((sum, val) => sum + +val, 0);
|
||||
|
||||
@ -331,12 +331,10 @@
|
||||
<mat-card-content>
|
||||
<div fxLayout="row nowrap" fxLayoutGap="2px" fxLayoutAlign="start none">
|
||||
<mat-form-field style="width: 100%">
|
||||
|
||||
<mat-select placeholder="Trading Product Name" formControlName="service_provider_name">
|
||||
<mat-select placeholder="service provider Name" formControlName="service_provider_name">
|
||||
<mat-option>Select</mat-option>
|
||||
<mat-option *ngFor="let tp of business_serviceProvider" [value]="tp.name">{{ tp.name }}</mat-option>
|
||||
<mat-option *ngFor="let msp of m_serviceProvider" [value]="msp.name">{{ msp.name }}</mat-option>
|
||||
</mat-select>
|
||||
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 100%">
|
||||
<input matInput placeholder="Supplier Name" formControlName="service_provider_supplier_name">
|
||||
|
||||
@ -30,7 +30,7 @@ export class PdQuestionSupplierInfoPage {
|
||||
|
||||
business_manufacturingProducts: any = [];
|
||||
business_tradingProducts: any = [];
|
||||
business_serviceProvider: any = [];
|
||||
m_serviceProvider: any = [];
|
||||
|
||||
m_titleList: any = [];
|
||||
m_paymentList: any = [];
|
||||
@ -65,8 +65,7 @@ export class PdQuestionSupplierInfoPage {
|
||||
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]);
|
||||
|
||||
this.m_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];
|
||||
});
|
||||
@ -84,17 +83,13 @@ export class PdQuestionSupplierInfoPage {
|
||||
this.business_tradingProducts.push(val.prodcuts);
|
||||
}
|
||||
}
|
||||
if (val.type_of_activity_id == 5) {
|
||||
if(val.prodcuts){
|
||||
this.business_serviceProvider.push(val.prodcuts);
|
||||
console.log(this.business_serviceProvider);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
this.business_tradingProducts = [].concat.apply([], this.business_tradingProducts);
|
||||
|
||||
|
||||
|
||||
}else {
|
||||
this.toast.pdTriggerappmessage('No Category Records Found.!');
|
||||
|
||||
@ -5,6 +5,15 @@
|
||||
</button>
|
||||
<ion-title *ngIf="!viewchange">{{FormId.form_name}}</ion-title>
|
||||
<ion-buttons end>
|
||||
<a (click)="capture()">
|
||||
<span style="padding: 0px;margin-right: 14px;color:white;font-size:25px;"><ion-icon name="md-camera"></ion-icon></span>
|
||||
</a>
|
||||
<a (click)="submitCurrentloan(currentLoans.value)" *ngIf="!complete_status">
|
||||
<span style="padding: 0px;margin-right: 14px;color:white;font-size:20px;"><ion-icon name="fn-save"></ion-icon></span>
|
||||
</a>
|
||||
</ion-buttons>
|
||||
|
||||
|
||||
<!-- <a (click)="capture()">
|
||||
<span style="padding: 0px;margin-right: 14px;color:white;font-size:25px;"><ion-icon name="md-camera"></ion-icon></span>
|
||||
</a>
|
||||
@ -12,8 +21,6 @@
|
||||
<span style="padding: 0px;margin-right: 14px;color:white;font-size:20px;"><ion-icon name="fn-save"></ion-icon></span>
|
||||
</a> -->
|
||||
|
||||
</ion-buttons>
|
||||
|
||||
</ion-navbar>
|
||||
<ion-segment [(ngModel)]="tab" color="optblue">
|
||||
<ion-segment-button value="0">
|
||||
@ -34,7 +41,9 @@
|
||||
<button color="primary" class="fab_exp" ion-fab><ion-icon name="fn-save"></ion-icon></button>
|
||||
</ion-fab-list>
|
||||
</ion-fab> -->
|
||||
<ion-fab bottom right >
|
||||
|
||||
|
||||
<!-- <ion-fab bottom right >
|
||||
<button ion-fab mini color="optblue"><ion-icon name="arrow-dropup"></ion-icon></button>
|
||||
<ion-fab-list side="top">
|
||||
<button ion-fab class="fab_exp">
|
||||
@ -46,7 +55,9 @@
|
||||
<ion-label>Save</ion-label>
|
||||
</button>
|
||||
</ion-fab-list>
|
||||
</ion-fab>
|
||||
</ion-fab> -->
|
||||
|
||||
|
||||
<div [ngSwitch]="tab">
|
||||
<mat-card *ngSwitchCase="'1'" #picContent>
|
||||
|
||||
|
||||
@ -128,9 +128,7 @@
|
||||
<ion-row>
|
||||
<ion-col end>
|
||||
<div class="btn">
|
||||
<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> -->
|
||||
</button>
|
||||
<button *ngIf="!buttonClick" float-right ion-button color="optblue" (click)="addRec(1)">Add Applicant</button>
|
||||
<button *ngIf="buttonClick" float-right ion-button large color="optblue" icon-left clear (click)="addRec(1)">Close
|
||||
<ion-icon name="md-close"></ion-icon></button>
|
||||
</div>
|
||||
|
||||
@ -1,6 +1,9 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" dir="ltr">
|
||||
<head>
|
||||
<script data-ionic="inject">
|
||||
(function(w){var i=w.Ionic=w.Ionic||{};i.version='3.9.2';i.angular='^5.0.3';i.staticDir='build/';})(window);
|
||||
</script>
|
||||
<meta charset="UTF-8">
|
||||
<title>Ionic App</title>
|
||||
<meta name="viewport" content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user