GWM:mixedgasIssue-gstNoColumn-orderMenu

This commit is contained in:
bitbucket 2024-03-23 16:33:56 +05:30
parent d0c8738019
commit 9586d0fd0b
11 changed files with 167 additions and 136 deletions

View File

@ -25,27 +25,28 @@
</nb-form-field>
</div>
<div class="col-md-4 col-sm-12">
<nb-form-field >
<label for="subject">Password:</label>
<input formControlName="password" nbInput id="password" type="text" [status]="userForm.get('password').invalid && userForm.get('password').touched? 'danger' : 'basic'">
<nb-form-field >
<label for="subject">Password:</label>
<input formControlName="password" nbInput id="password" type="text" [status]="userForm.get('password').invalid && userForm.get('password').touched? 'danger' : 'basic'">
<ng-container nbInputErrorMessage>
<ng-container nbInputErrorMessage>
<div style="color:#7c0e0e;font-size:small" *ngIf="!userForm.get('password')?.errors?.required && (userForm.get('password')?.errors?.pattern)">
Password length must be greater than or equal to 8
</div>
<!-- <div style="color:#7c0e0e" *ngIf="!userForm.get('password')?.errors?.required">
Password length must be greater than or equal to 8 and password must contain one or more uppercase , lowercase , numeric and special characters
</div> -->
<div style="color:#7c0e0e" *ngIf="userForm.get('password')?.invalid && (userForm.get('password')?.dirty || userForm.get('password')?.touched) && userForm.get('password')?.errors?.required">
Password is required
<div style="color:#7c0e0e;font-size:small" *ngIf="!userForm.get('password')?.errors?.required && (userForm.get('password')?.errors?.pattern)">
Password length must be greater than or equal to 8
</div>
</ng-container>
</nb-form-field>
</div>
<!-- <div style="color:#7c0e0e" *ngIf="!userForm.get('password')?.errors?.required">
Password length must be greater than or equal to 8 and password must contain one or more uppercase , lowercase , numeric and special characters
</div> -->
<div style="color:#7c0e0e" *ngIf="userForm.get('password')?.invalid && (userForm.get('password')?.dirty || userForm.get('password')?.touched) && userForm.get('password')?.errors?.required">
Password is required
</div>
</ng-container>
</nb-form-field>
</div>
</div>
<div class="row show-grid">
<div class="col-md-4 col-sm-12">
<nb-form-field>
@ -81,7 +82,7 @@
</div>
<div class="row show-grid" >
<div class="col-md-4 col-sm-12">
<div class="col-md-3 col-sm-12">
<nb-form-field>
<label for="subject">City:</label>
<input formControlName="city" nbInput id="city" type="text" [status]="userForm.get('city').invalid && userForm.get('city').touched? 'danger' : 'basic'">
@ -90,7 +91,7 @@
</ng-container>
</nb-form-field>
</div>
<div class="col-md-4 col-sm-12">
<div class="col-md-3 col-sm-12">
<nb-form-field>
<label for="subject">Pincode:</label>
<input formControlName="pincode" nbInput id="pincode" type="text" [status]="userForm.get('pincode').invalid && userForm.get('pincode').touched? 'danger' : 'basic'">
@ -100,28 +101,40 @@
</ng-container>
</nb-form-field>
</div>
<div class="col-md-4 col-sm-12">
<nb-form-field>
<label for="subject">Customer Type:</label> <br />
<nb-select selected="Medical" formControlName="cusType" style="width: 100% !important;" [status]="userForm.get('cusType').invalid && userForm.get('cusType').touched? 'danger' : 'basic'">
<nb-option value="Medical">Medical</nb-option>
<nb-option value="Industrial">Industrial</nb-option>
</nb-select>
<ng-container nbInputErrorMessage>
<div style="color:#7c0e0e" *ngIf="userForm.get('cusType').hasError('required') && userForm.get('cusType').touched">Customer Type is required.</div>
<div class="col-md-3 col-sm-12">
<nb-form-field>
<label for="subject">Customer Type:</label> <br />
<nb-select selected="Medical" formControlName="cusType" style="width: 100% !important;" [status]="userForm.get('cusType').invalid && userForm.get('cusType').touched? 'danger' : 'basic'">
<nb-option value="Medical">Medical</nb-option>
<nb-option value="Industrial">Industrial</nb-option>
</nb-select>
<ng-container nbInputErrorMessage>
<div style="color:#7c0e0e" *ngIf="userForm.get('cusType').hasError('required') && userForm.get('cusType').touched">Customer Type is required.</div>
</ng-container>
</nb-form-field>
<!-- <nb-form-field>
</ng-container>
</nb-form-field>
<!-- <nb-form-field>
</nb-form-field> -->
</div>
</div>
<nb-card-footer>
<button class="cancel" nbButton status="danger" type="button" (click)="cancel()">Cancel</button>
<button nbButton status="success" [disabled]="!userForm.valid" type="submit">Submit</button>
</nb-card-footer>
</nb-form-field> -->
</div>
<div class="col-md-3 col-sm-12">
<nb-form-field>
<label for="subject">GST:</label>
<input formControlName="gst" nbInput id="gst" type="text" >
</nb-form-field>
</div>
</div>
<nb-card-footer >
<div class="row">
<div class="col-md-12" style="text-align: end;">
<button class="cancel" nbButton status="danger" type="button" (click)="cancel()">Cancel</button>
<button nbButton status="success" [disabled]="!userForm.valid" type="submit">Submit</button>
</div>
</div>
</nb-card-footer>
</form>
</nb-card-body>

View File

@ -42,6 +42,7 @@ export class CustomerFormComponent implements OnInit {
password: new FormControl('', [Validators.required,Validators.pattern(
'^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#$%^&*_=+-]).{8,16}$'
)]),
gst: new FormControl(''),
address_1: new FormControl('', [Validators.required]),
state: new FormControl('', [Validators.required]),
city: new FormControl('', [Validators.required]),
@ -89,6 +90,7 @@ export class CustomerFormComponent implements OnInit {
city : tmp.city,
pincode:tmp.pincode,
cusType:tmp.cusType,
gst:tmp.gst,
}

View File

@ -86,6 +86,17 @@
[width]="4">
</ng-data-table-column>
<ng-data-table-column
[field]="'gst'"
[sortable]="false"
[title]="'GST No'"
[filterable]="false"
[width]="5">
</ng-data-table-column>
<ng-data-table-column
[field]="'isActive'"
[sortable]="false"
@ -114,6 +125,10 @@
</td>
</ng-template>
</ng-data-table-column>
<ng-data-table-column
[field]="'role'"
[sortable]="false"
@ -121,14 +136,7 @@
[filterable]="false"
[width]="3">
<ng-template #ngDataTableCell let-row="row">
<td >
<div class="align-center" style="display: flex; align-items: center;">

View File

@ -78,6 +78,7 @@ export class CustomerComponent {
title: 'City',
type: 'string',
},
@ -275,6 +276,7 @@ export class CustomerComponent {
customer.forEach((element:any, index) => {
element.index = index +1
element.type =element['CusDetails.cusType']
element.gst =element['CusDetails.gst']
});
this.customer = customer

View File

@ -161,11 +161,12 @@
<div class="col-6 col-md-3">
<div >
<nb-select placeholder="Select Product" [(ngModel)]="fieldGroup.id" style="width: 100% !important;margin-right: 1rem;" [disabled]="fieldTitle == 'Edit Order' ? !fieldGroup.isNew : false">
<nb-select placeholder="Select Product" [(ngModel)]="fieldGroup.id" style="width: 100% !important;margin-right: 1rem;" [disabled]="fieldTitle == 'Edit Order' ? !fieldGroup.isNew : false" (ngModelChange)="onDropdownChange($event)" >
<!-- <nb-option value="">Select Drivers</nb-option> -->
<!-- (click)="onProductSelect(user.id,user.productName)" -->
<nb-option *ngFor="let user of checkProductArray(); index as i; first as isFirst" [value]="user.id"
>{{user.productName }}({{user.skuId }} )</nb-option>
<nb-option *ngFor="let user of checkProductArray(); index as i; first as isFirst" [value]="user.id">
{{user.productName}}({{user.skuId }} )
</nb-option>
</nb-select>
@ -180,13 +181,20 @@
<input nbInput style="width: 50%;" *ngIf="fieldTitle != 'View Order'" [(ngModel)]="fieldGroup.qty" type="number">
<!-- <input nbInput type="number" min="0" [(ngModel)]="item.qty"> -->
</div>
<div>
<input nbInput style="width: 50%;" *ngIf="fieldTitle != 'View Order'" [(ngModel)]="fieldGroup.productName" type="string" hidden>
<!-- <input nbInput type="number" min="0" [(ngModel)]="item.qty"> -->
</div>
</div>
<div class="col-6 col-md-4">
<div >
<!-- <input nbInput type="text" [(ngModel)]="item.productSpec"> -->
<label for="subject" *ngIf="fieldTitle == 'View Order'" style=" font-weight: 600;">({{ fieldGroup.productSpec }})</label>
<input nbInput *ngIf="fieldTitle != 'View Order' && fieldGroup.id == 6" style=" width: 100%;" [(ngModel)]="fieldGroup.productSpec" placeholder="eg:- N2:CO2:O2 - 50:30:20" type="text">
</div>
<input nbInput *ngIf="fieldTitle != 'View Order' && fieldGroup.productName == 'Mixed Gas'" style=" width: 100%;" [(ngModel)]="fieldGroup.productSpec" placeholder="eg:- N2:CO2:O2 - 50:30:20" type="text">
<!-- fieldGroup.productName == 'Mixed Gas' -->
</div>
</div>
<div class="col-6 col-md-3">

View File

@ -53,7 +53,7 @@ fieldTitle:any ='New Order'
position: NbGlobalPosition = NbGlobalPhysicalPosition.TOP_RIGHT;
preventDuplicates = false;
status: NbComponentStatus = 'primary';
inputFieldGroups:any = [{id:'', qty: '1', productSpec: '' }];
inputFieldGroups:any = [{id:'', qty: '1', productSpec: '' , productName : '' }];
selectCustomerData :any =[];selectStatus:any =[];CancelReason:any =[];selectDriver:any =[];drivers:any =[];
invoice = new Invoice();
hiddenBtn= false;
@ -61,6 +61,7 @@ fieldTitle:any ='New Order'
delArr:any=[]
selectedProductId: number | undefined = null;
addFormBtn: any;
selectedProductName: any;
constructor(private dialogService: NbDialogService,private route :ActivatedRoute,private router: Router,public _api:PageapiService,private toastrService: NbToastrService,private service: SmartTableData ,private windowService: NbWindowService) {
this._api.orderDetails_observable$.subscribe((res) => {
@ -674,45 +675,47 @@ console.log(filteredItems)
getAnswerProduct(orderId){
console.log(orderId)
console.log(orderId)
let param={orderId:orderId}
this._api.getProductList(param).subscribe(res => {
let param={orderId:orderId}
this._api.getProductList(param).subscribe(res => {
if(res.status == 200){
let result = res.data
let result = res.data
this.ResultDisplay = result
console.log(result)
this.inputFieldGroups =[];
this.ResultDisplay = result
console.log(result)
this.inputFieldGroups =[];
// setTimeout(() => {
// setTimeout(() => {
console.log('gwm');
console.log(result);
result.forEach(element => {
result.forEach(element => {
this.inputFieldGroups.push({id:parseInt(element.productId ) , qty: element.qty, productSpec: element.productSpec , primaryId:element.id})
this.inputFieldGroups.push({id:parseInt(element.productId ) , qty: element.qty, productSpec: element.productSpec , primaryId:element.id ,
productName :element.productName });
})
// }, 1000);
console.log( this.inputFieldGroups);
})
// }, 1000);
console.log( this.inputFieldGroups);
result.forEach(element => {
console.log(element)
if(element.ProductDetails.length>0){
result.forEach(element => {
console.log(element)
if(element.ProductDetails.length>0){
// if(element.ProductDetails[0].productName =="Mixed Gas"){
// console.log("hiiii")
// element.name = element.ProductDetails[0].productName
// element.qty = parseInt(element.qty)
// element.price = this.setData['OrderDetails.CusDetails.cusType']
// this.invoice.products.push(element)
// }
// if(element.ProductDetails[0].productName =="Mixed Gas"){
// console.log("hiiii")
// element.name = element.ProductDetails[0].productName
// element.qty = parseInt(element.qty)
// element.price = this.setData['OrderDetails.CusDetails.cusType']
// this.invoice.products.push(element)
// }
}
@ -911,25 +914,41 @@ this.onCreateConfirm()
// })
}
checkProductArray() {
// console.log(this.inputFieldGroups)
const hasNullId = this.inputFieldGroups.some((group) => group.id === null);
// console.log(hasNullId)
if (!hasNullId) {
// There's an object with id = null in the inputFieldGroups array
// console.log('There is an object with id = null');
return this.product;
} else {
// There is no object with id = null in the inputFieldGroups array
// Filter products based on the condition (productName !== 'Mixed Gas' in inputFieldGroups)
const filteredProducts = this.product.filter((product) => {
const isSelected = this.inputFieldGroups.some((group) => group.id === product.id);
return product.productName === 'Mixed Gas' || !isSelected;
onDropdownChange(event: any) {
// Find the selected product in the array and get its name
const selectedProduct = this.checkProductArray().find(product => product.id === event);
if (selectedProduct) {
this.selectedProductName = selectedProduct.productName;
} else {
this.selectedProductName = ''; // If no product found, clear the selected product name
}
console.log(this.selectedProductName);
this.inputFieldGroups.forEach(element => {
if(element.id == event){
element.productName = this.selectedProductName;
}
});
return filteredProducts;
}
checkProductArray() {
// console.log(this.inputFieldGroups)
const hasNullId = this.inputFieldGroups.some((group) => group.id === null);
// console.log(hasNullId)
if (!hasNullId) {
// There's an object with id = null in the inputFieldGroups array
// console.log('There is an object with id = null');
return this.product;
} else {
// There is no object with id = null in the inputFieldGroups array
// Filter products based on the condition (productName !== 'Mixed Gas' in inputFieldGroups)
const filteredProducts = this.product.filter((product) => {
const isSelected = this.inputFieldGroups.some((group) => group.id === product.id );
return product.productName === 'Mixed Gas' || !isSelected;
});
return filteredProducts;
}
}
@ -943,7 +962,7 @@ addInputFieldGroup() {
}
// this.inputFieldGroups.push({id:null, qty: '1', productSpec: '' });
// Add a new input field group to the array
const newGroup = { id: null, qty: 1, productSpec: '', isNew: true };
const newGroup = { id: null, qty: 1, productSpec: '', isNew: true , productName : '' };
this.inputFieldGroups.push(newGroup);
console.log(this.inputFieldGroups)
//this.childButtonEvent.emit( this.inputFieldGroups);

View File

@ -2,46 +2,14 @@
<nb-card-header>
<div class="row show-grid">
<div class="col-md-2">
<div> <nb-icon icon="shopping-bag-outline"></nb-icon> Order Management</div>
<div class="col-md-5">
<div style="font-size: 20px;"> <nb-icon icon="shopping-bag-outline"></nb-icon> Order Management</div>
</div>
<div class="col-md-3">
<div style=" text-align: end;">
<!-- <button (click)="Assign()" nbButton status="primary" hero>
Assign Driver
</button> -->
<input nbInput placeholder="Pick Date Range" [nbDatepicker]="formpicker" [(ngModel)]="dateRangeValue" #dateRangeInput>
<nb-rangepicker #formpicker (rangeChange)="manipulateDate($event)"[startDate]="defaultStartDate" [endDate]="defaultEndDate" ></nb-rangepicker>
<!-- <input nbInput class="fx-date-range" type="text"
ngxDaterangepickerMd
[locale]="{applyLabel: 'okay', format: 'MM/DD/YY'}"
[drops]="'down'"
[opens]="'right'"
[ranges]="ranges"
[showCustomRangeLabel]="true"
[alwaysShowCalendars]="true"
[keepCalendarOpeningWithRange]="true"
[showCancel]="true"
autocomplete="off"
[(ngModel)]="selectedDateRange"
name="daterange" placeholder="Fliter Date Wise" (change)="dateWiseFilter()"/> -->
</div>
</div>
<div class="col-md-3">
<div style=" text-align: end;">
<!-- <button (click)="Assign()" nbButton status="primary" hero>
Assign Driver
</button> -->
<input [(ngModel)]="searchTerm" (keyup)="filterItems()" style="width: 100%;" nbInput id="mobileNo" type="text" placeholder="Search" >
</div>
</div>
<div class="col-md-4">
<div class="col-md-7">
<div style=" text-align: end;">
<button (click)="refresh()" nbTooltip="Refresh" nbTooltipPlacement="top" nbButton status="warning" hero>
<nb-icon icon="flip-outline"></nb-icon>
@ -56,6 +24,17 @@
</div>
</div>
</div>
<div class="row show-grid" style="margin-top: 1rem;">
<div class="col-md-6" style="text-align: start;">
<label style="margin-right: 10px;">Select Start & End Date </label>
<input nbInput placeholder="Pick Date Range" [nbDatepicker]="formpicker" [(ngModel)]="dateRangeValue" #dateRangeInput>
<nb-rangepicker #formpicker (rangeChange)="manipulateDate($event)"[startDate]="defaultStartDate" [endDate]="defaultEndDate" ></nb-rangepicker>
</div>
<div class="col-md-6" style="text-align: end;">
<input [(ngModel)]="searchTerm" (keyup)="filterItems()" style="width: 100%;" nbInput id="mobileNo" type="text" placeholder="Search" >
</div>
</div>
</nb-card-header>
<nb-card-body style="padding-top: 0px;">
@ -443,7 +422,7 @@
<li *ngFor="let product of row.item.productDetails; let i = index">
<div *ngIf="i+1 != 1"> | </div>
<span> {{ i+1}}. Product Name: {{ product.productName }} - {{ product.qty }} </span>
<span *ngIf="product.qty > 1"> No's </span><span *ngIf="product.qty == 1"> No </span>
<span *ngIf="product.qty > 1"> Nos </span><span *ngIf="product.qty == 1"> No </span>
<div *ngIf="product.productSpec !== null"> , Mixed Gas: {{ product.productSpec }}</div>
</li>
</ol>

View File

@ -16,12 +16,12 @@ export const MENU_ITEMS: NbMenuItem[] = [
link: '/pages/order',
},
{
title: 'Delivery Summary',
link: '/pages/summary',
title: 'Out For Delivery Sheet',
link: '/pages/delivery-sheet',
},
{
title: 'Delivery Sheet',
link: '/pages/delivery-sheet',
title: 'Delivered Summary',
link: '/pages/summary',
},
{
title: 'Return Sheet',

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB