item for sale q3

sultan-q3
Sultan Khan 4 years ago
parent b3ae4c96f7
commit 918d30f04b

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 959 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.6 KiB

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.6 KiB

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 64 KiB

@ -28,7 +28,7 @@ export class ConnectorService {
public static timeOut = 120 * 1000;
public static host = 'https://uat.hmgwebservices.com/';
// public static host = 'https://hmgwebservices.com/';
//public static host = 'https://hmgwebservices.com/';
constructor(public httpClient: HttpClient,
public cs: CommonService,

@ -144,14 +144,14 @@
</div>
<ion-slides>
<ion-slide>
<ion-grid class=" gridAH" *ngIf="uploader?.queue?.length > 0">
<ion-grid class=" gridAH" *ngIf="uploader?.queue?.length > 0 || addAttachRequest.length>0">
<ion-row>
<ion-col lines="none" size="3" *ngFor="let obj of addAttachRequest">
<div class="image-container">
<div class="uploaded">
<div class="closed" (click)="deletePhoto(item)">X</div>
<img [src]="getImgContent('data:image/png;base64, ' +obj.P_FILE_DATA) " />
<div class="closed" (click)="deletePhoto(item)" *ngIf="!obj.attachmentId">X</div>
<img [src]="getImgContent('data:image/png;base64, ' +obj.Base64Data) " />
</div>
</div>
@ -190,14 +190,14 @@
<ion-slides>
<ion-slide>
<ion-grid class=" gridAH" *ngIf="uploader?.queue?.length > 0">
<ion-grid class=" gridAH" *ngIf="uploader?.queue?.length > 0 || addAttachRequest.length>0">
<ion-row>
<ion-col lines="none" size="3" *ngFor="let obj of addAttachRequest">
<div class="image-container">
<div class="uploaded">
<!-- <div class="closed" (click)="deletePhoto(item)">X</div> -->
<img [src]="getImgContent('data:image/png;base64, ' +obj.P_FILE_DATA) " />
<img [src]="getImgContent('data:image/png;base64, ' +obj.Base64Data) " />
</div>
</div>

@ -17,7 +17,7 @@ export class HomeComponent implements OnInit {
direction: string;
uploaded: any = [];
public selectedFile: any;
indexLastObj: any;
indexLastObj: any = 0;
addAttachRequest: any = [];
selectedCategory: any;
filterAllowedType: any = [
@ -122,9 +122,9 @@ export class HomeComponent implements OnInit {
this.addAttachRequest.push({
AttachmentID: this.indexLastObj,
P_FILE_CONTENT_TYPE: attachType, //type.split('/')[1],
P_FILE_DATA: fileData.split(",")[1],
P_FILE_NAME: name, //.split('.')[0],
ContentType: 'image/' + attachType, //type.split('/')[1],
Base64Data: fileData.split(",")[1],
FileName: name, //.split('.')[0],
});
} catch (e) { }
@ -146,27 +146,38 @@ export class HomeComponent implements OnInit {
var authUser = this.authService.getAuthenticatedRequest();
this.cs.startLoading();
var request = new FormData();
request.append('title', this.itemInfo);
request.append('title_Ar', this.itemInfo);
request.append('categoryID', this.selectedCategory.categoryID);
request.append('description', this.itemDescription);
request.append('description_Ar', this.itemDescription);
request.append('employeeNumber', authUser.P_USER_NAME);
request.append('quotePrice', this.itemPrice);
request.append('isActive', 'true');
request.append('regionID', this.regionID);
request.append('status', this.itemCondition);
console.log(this.selectedFile);
if (this.selectedFile && this.selectedFile !== undefined) {
request.append('fileColl', this.addAttachRequest.toString());
// var request = new FormData();
// request.append('title', this.itemInfo);
// request.append('title_Ar', this.itemInfo);
// request.append('categoryID', this.selectedCategory.categoryID);
// request.append('description', this.itemDescription);
// request.append('description_Ar', this.itemDescription);
// request.append('employeeNumber', authUser.P_USER_NAME);
// request.append('quotePrice', this.itemPrice);
// request.append('isActive', 'true');
// request.append('regionID', this.regionID);
// request.append('status', this.itemCondition);
// console.log(this.selectedFile);
// if (this.selectedFile && this.selectedFile !== undefined) {
// request.append('fileColl', this.addAttachRequest.toString());
// }
// request.append('Channel', authUser.Channel.toString());
// request.append('LogInToken', authUser.LogInTokenID);
// request.append('Token', authUser.TokenID);
// request.append('EmployeeNumber', authUser.P_USER_NAME);
// request.append('MobileNo', authUser.MobileNumber);
var request = {
"TokenID": authUser.LogInTokenID, "EmployeeNumber": authUser.P_USER_NAME, "ItgImageCollList": this.addAttachRequest,
"ItgTitle": this.itemInfo,
"ItgTitleAr": this.itemInfo,
"ItgCategoryID": this.selectedCategory.categoryID,
"ItgDescription": this.itemDescription,
"ItgDescriptionAr": this.itemDescription,
"ItgQuotePrice": this.itemPrice,
"RegionID": this.regionID,
"ItgIsActive": true,
"ItgStatus": this.itemCondition
}
request.append('Channel', authUser.Channel.toString());
request.append('LogInToken', authUser.LogInTokenID);
request.append('Token', authUser.TokenID);
request.append('EmployeeNumber', authUser.P_USER_NAME);
request.append('MobileNo', authUser.MobileNumber);
this.itemService.createItemForSale(request, () => { }, this.ts.trPK('general', 'retry')).subscribe((result: any) => {
if (this.cs.validResponse(result)) {
@ -194,13 +205,28 @@ export class HomeComponent implements OnInit {
this.itemPrice = this.editItem.quotePrice;
this.regionID = this.editItem.regionID;
this.itemCondition = this.editItem.status.toLowerCase();
this.addAttachRequest = this.getAttachment(this.editItem.itemAttachments);
}
getAttachment(itemsArray) {
let item = [];
itemsArray.forEach(element => {
item.push({
attachmentId: element.attachmentId,
ContentType: element.contentType,
Base64Data: element.content,
FileName: element.fileName,
});
});
return item;
}
updateItemForSale() {
var authUser = this.authService.getAuthenticatedRequest();
this.cs.startLoading();
var request = new FormData();
request.append('itmeSaleID', this.editItem.itemSaleID);
request.append('itemSaleID', this.editItem.itemSaleID);
request.append('title', this.itemInfo);
request.append('title_Ar', this.itemInfo);
request.append('categoryID', this.selectedCategory.categoryID);
@ -211,10 +237,10 @@ export class HomeComponent implements OnInit {
request.append('isActive', 'true');
request.append('regionID', this.regionID);
request.append('status', this.itemCondition);
console.log(this.selectedFile);
if (this.selectedFile && this.selectedFile !== undefined) {
request.append('fileColl', this.selectedFile[0], this.selectedFile[0].name);
}
// console.log(this.selectedFile);
// if (this.selectedFile && this.selectedFile !== undefined) {
// request.append('fileColl', this.selectedFile[0], this.selectedFile[0].name);
// }
request.append('Channel', authUser.Channel.toString());
request.append('LogInToken', authUser.LogInTokenID);
request.append('Token', authUser.TokenID);

@ -11,7 +11,7 @@ export class ItemForSaleService {
public static getItemForSale = 'Services/COCWS.svc/REST/Mohemm_ITG_GetItemForSale';
public static getItemForSaleByEmployee = 'Services/COCWS.svc/REST/Mohemm_ITG_GetItemForSaleByEmployee';
public static getCategories = 'Services/COCWS.svc/REST/Mohemm_ITG_GetItemSaleCategory';
public static createItemForSale = 'Services/COCWS.svc/REST/Mohemm_ITG_AddItemForSale';
public static createItemForSale = 'Services/COCWS.svc/REST/Mohemm_ITG_AddItemForSaleMobile';
public static updateItemForSale = 'Services/COCWS.svc/REST/Mohemm_ITG_UpdateItemForSale';
public static getRegion = 'Services/COCWS.svc/REST/Mohemm_ITG_GetRegion';
public static ITEMS_SELECTED = 'item-selected';
@ -66,10 +66,10 @@ export class ItemForSaleService {
const request = itemRequest;
this.authService.authenticateRequest(request);
request.employeeNumber = request.P_USER_NAME;
return this.http.post(ConnectorService.host + ItemForSaleService.createItemForSale, itemRequest, {
}
)
//return this.http.post(ConnectorService.host + ItemForSaleService.createItemForSale, itemRequest, {
return this.con.post(ItemForSaleService.createItemForSale, request, onError, errorLabel);
//}
//)
}
updateItemForSale(itemRequest: any, onError?: any, errorLabel?: string) {
const request = itemRequest;

@ -335,7 +335,7 @@
<ion-col size="2" >
<ion-icon class="add-icon-styling" name="add" (click)="allowEdit('add-update-contact')" style="right:0px"></ion-icon>
<ion-icon class="add-icon-styling" name="add" *ngIf="dependentDetails && dependentDetails.ADD_BUTTON === 'Y'" (click)="allowEdit('add-update-contact')" style="right:0px"></ion-icon>
</ion-col>
</ion-row>
</ion-grid>
@ -347,7 +347,7 @@
<ion-col size='4'>
<h2 style="font-weight: bold; font-size: 15px;margin:0">{{data.CONTACT_NAME}}</h2>
</ion-col>
<ion-col [size]='direction === "ltr" ? 5 : 8 ' [offset]='direction === "ltr" ? 3 : 0 '>
<ion-col [size]='direction === "ltr" ? 5 : 8 ' [offset]='direction === "ltr" ? 3 : 0 ' [ngClass]="dependentDetails && dependentDetails.UPDATE_BUTTON === 'Y' ? '' :'disabledButton'">
<div class='family-member-button' style="height: 32px !important;" (click)='updateFunction(data)'>
<ion-icon style="width: 20px;" name="create"></ion-icon>
<p>{{ts.trPK('userProfile','update')}}</p>
@ -359,7 +359,7 @@
<ion-label><p style="font-weight: bold; font-size: 14px;">{{data.RELATIONSHIP}}</p></ion-label>
</ion-col>
<ion-col [size]='direction === "ltr" ? 5 : 8 ' [offset]='direction === "ltr" ? 3 : 0 '>
<div class='family-member-button' style="height: 32px !important;" (click)='RemoveFunction(data)'>
<div class='family-member-button' style="height: 32px !important;" (click)='RemoveFunction(data)' [ngClass]="dependentDetails && dependentDetails.DELETE_BUTTON === 'Y' ? '' :'disabledButton'">
<ion-icon name="trash" style="width: 20px; height: 20px; color: #CA3332;"></ion-icon>
<p style="color: #CA3332;">{{ts.trPK('userProfile','remove')}}</p>
</div>

@ -1403,4 +1403,8 @@ $actionBtnSize: 36px;
margin-left: 20px;
margin-top: 5px;
font-size: 13px;
}
}
.disabledButton{
opacity:.5;
pointer-events: none;
}

@ -321,7 +321,7 @@ export class HomeComponent implements OnInit {
case "contact":
this.personalInfoSegment = false;
this.basicDetailsSegment = false;
this.addressSegment = false;
this.addressSegment = true;
this.editBasic = false;
this.editAddress = false;
this.familyMemberSegment = false;

Loading…
Cancel
Save