Sales PD Section List Indication implemented for saved section
This commit is contained in:
parent
e092021e51
commit
5487037927
@ -1,5 +1,5 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<widget id="com.sineedge.pdglender" version="0.0.16" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
|
||||
<widget id="com.sineedge.pdglender" version="0.0.18" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
|
||||
<name>PD Genie</name>
|
||||
<description>info@pdgenie.com</description>
|
||||
<author email="info@pdgenie.com" href="https://pdgenie.com">PD Genie</author>
|
||||
|
||||
@ -17,14 +17,17 @@
|
||||
|
||||
|
||||
<ion-content padding>
|
||||
<mat-card class="card-class" [ngClass]="{'border-enable': sales_pd_id == null && sec.is_disabled}" *ngFor="let sec of section_template" (click)="goto(sec.order_id)">
|
||||
<mat-card class="card-class"
|
||||
[ngClass]="{'border-disabled': sales_pd_id == null && sec.is_disabled,
|
||||
'border-saved': sales_pd_id != null && sec.hasOwnProperty('status') &&
|
||||
sec.status == '1'}" *ngFor="let sec of section_template" (click)="goto(sec.order_id)">
|
||||
<ion-row>
|
||||
<ion-col col-12>
|
||||
<ion-col col-11>
|
||||
<h6>{{sec.section_name}}</h6>
|
||||
</ion-col>
|
||||
<!-- <ion-col col-1>
|
||||
<ion-col col-1 *ngIf="sec.hasOwnProperty('status') && sec.status == '1'">
|
||||
<ion-icon name="checkmark-circle-outline"></ion-icon>
|
||||
</ion-col> -->
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
</mat-card>
|
||||
</ion-content>
|
||||
|
||||
@ -11,7 +11,7 @@ page-section-list {
|
||||
/* font-size: 12px; */
|
||||
// box-shadow: 0px;
|
||||
box-shadow: 0 4px 4px -10px rgba(0, 0, 0, 0.56), 0 5px 16px 0 rgba(0, 0, 0, 0.12), 0 8px 10px -5px rgba(0, 0, 0, 0.2) !important;
|
||||
border-left: 1px solid blue !important;
|
||||
border-left: 2px solid blue !important;
|
||||
border:1px solid lavender;
|
||||
// border: 1px solid #32db64;
|
||||
// 2px solid #e1383863
|
||||
@ -25,12 +25,20 @@ page-section-list {
|
||||
.card-class:active {
|
||||
padding: 20px;
|
||||
}
|
||||
.border-enable{
|
||||
border-left: 1px solid #000000a8 !important;
|
||||
.border-disabled{
|
||||
border-left: 2px solid #00000075 !important;
|
||||
h6{
|
||||
margin: 0px !important;
|
||||
color: darkgray;
|
||||
}
|
||||
}
|
||||
.border-saved{
|
||||
border-left: 2px solid #008828 !important;
|
||||
h6{
|
||||
margin: 0px !important;
|
||||
color:#00611d;
|
||||
}
|
||||
// #009b2e
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -31,18 +31,47 @@ export class SectionListPage {
|
||||
|
||||
ionViewDidLoad() {
|
||||
console.log('ionViewDidLoad SectionListPage');
|
||||
// this.getSectionData()
|
||||
this.getTemplate()
|
||||
}
|
||||
ionViewDidEnter(){
|
||||
this.SalesPDService.getData_fromLocal('sales_pd_id_PRIMARYKEY').then((key_value)=>{
|
||||
if(key_value && key_value != null && key_value != '' && key_value != undefined){
|
||||
this.sales_pd_id=key_value
|
||||
let params={sales_pd_id:this.sales_pd_id,section_id:'all'}
|
||||
this.SalesPDService.getSalesPDSectionData(params).subscribe(res=>{
|
||||
// console.log(this.section_template,res);
|
||||
if(this.section_template.length > 0)
|
||||
{
|
||||
console.log("if part")
|
||||
this.merge_saved_status(res);
|
||||
}
|
||||
else{
|
||||
setTimeout(()=>{
|
||||
console.log("Else part")
|
||||
if(this.section_template.length > 0)
|
||||
{
|
||||
this.merge_saved_status(res);
|
||||
}
|
||||
},500)
|
||||
}
|
||||
})
|
||||
}
|
||||
else{
|
||||
this.sales_pd_id=null
|
||||
}
|
||||
})
|
||||
}
|
||||
merge_saved_status(res){
|
||||
let saved_sections=res['records'].map(val=>{return {'section_id':val.section_id , 'status':val.status}});
|
||||
console.log("saved",saved_sections);
|
||||
const mergeById = (a1, a2) =>
|
||||
a1.map(itm => ({
|
||||
...a2.find((item) => (item.section_id === itm.section_id) && item),
|
||||
...itm
|
||||
}));
|
||||
this.section_template = mergeById(this.section_template,saved_sections);
|
||||
}
|
||||
getTemplate(){
|
||||
|
||||
this.SalesPDService.getData(this.product_id).subscribe(result=>{
|
||||
|
||||
@ -25,7 +25,7 @@ export class ConstantsProvider {
|
||||
// let production='https://pdgenie.com/sparqprod/api/'
|
||||
|
||||
let production={
|
||||
url:'https://pdgenie.com/sparqprod/api/',
|
||||
url:'https://api.pdgenie.com/sparqprod/api/',
|
||||
authorization:'TnAwuc64pVpcB9xf',
|
||||
|
||||
|
||||
@ -35,7 +35,7 @@ export class ConstantsProvider {
|
||||
}
|
||||
|
||||
let development={
|
||||
url:'https://apitest.pdgenie.com/sparqapi/api/',
|
||||
url:'http://localhost/sineEdge/sparqapi/api/',
|
||||
authorization:'sparqvenba2018',
|
||||
|
||||
lenIdentityPoolId:"ap-south-1:ca22dabc-db59-4af5-9bb8-265f7ec95907",
|
||||
@ -51,7 +51,7 @@ export class ConstantsProvider {
|
||||
lenUserPoolId: "ap-south-1_hFiGyr1Gw", // Username
|
||||
lenClientId: "38v9rpp1495v60e1gd14mj6rjr", // ClientName for Mobile
|
||||
}
|
||||
return testing;
|
||||
return production;
|
||||
|
||||
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user