parent
bfef05c788
commit
64d89bcde7
@ -1,32 +1,33 @@ |
|||||||
<!--<div class="inner-content">--> |
<!-- start 面包屑 --> |
||||||
<!-- <nz-descriptions nzBordered>--> |
<nz-breadcrumb> |
||||||
<!-- <nz-descriptions-item nzTitle="商户logo" [nzSpan]="3">--> |
<nz-breadcrumb-item> |
||||||
<!-- <img class="head_img" src="{{data.merchantLogo}}" onerror="this.src='../../../../assets/admin/navigation/icon.png'" alt="">--> |
系统管理 |
||||||
<!-- </nz-descriptions-item>--> |
</nz-breadcrumb-item> |
||||||
<!-- <nz-descriptions-item nzTitle="登录账户">{{data['secUser']['loginName']}}</nz-descriptions-item>--> |
<nz-breadcrumb-item> |
||||||
<!-- <nz-descriptions-item nzTitle="商户编号">{{data['merchantKey']}}</nz-descriptions-item>--> |
公司详情 |
||||||
<!-- <nz-descriptions-item nzTitle="商户名称">{{data.merchantName}}</nz-descriptions-item>--> |
</nz-breadcrumb-item> |
||||||
<!-- <nz-descriptions-item nzTitle="联系电话">{{data.secUser.telephone}}</nz-descriptions-item>--> |
</nz-breadcrumb> |
||||||
<!-- <nz-descriptions-item nzTitle="商户地址">{{data.address}}</nz-descriptions-item>--> |
<!-- end 面包屑 --> |
||||||
<!-- <nz-descriptions-item nzTitle="状态">{{data.status ===1 ? '正常' : '禁用'}}</nz-descriptions-item>--> |
|
||||||
<!-- <nz-descriptions-item nzTitle="银行名称">--> |
<div class="inner-content"> |
||||||
<!-- {{data.bankName == null ? '未上传' : data.bankName}}--> |
<nz-tabset> |
||||||
<!-- </nz-descriptions-item>--> |
<nz-tab nzTitle="账号信息"> |
||||||
<!-- <nz-descriptions-item nzTitle="银行账号">--> |
<nz-descriptions nzBordered> |
||||||
<!-- {{data.bankAccount == null ? '未上传' : data.bankAccount}}--> |
<nz-descriptions-item nzTitle="登录账户" [nzSpan]="1.5">{{data.user.loginName}}</nz-descriptions-item> |
||||||
<!-- </nz-descriptions-item>--> |
<nz-descriptions-item nzTitle="用户名" [nzSpan]="1.5">{{data.user.userName}}</nz-descriptions-item> |
||||||
<!-- <nz-descriptions-item nzTitle="开户人">--> |
</nz-descriptions> |
||||||
<!-- {{data.bankHolder == null ? '未上传' : data.bankHolder}}--> |
</nz-tab> |
||||||
<!-- </nz-descriptions-item>--> |
<nz-tab nzTitle="单位信息"> |
||||||
<!-- <nz-descriptions-item nzTitle="创建时间">--> |
<nz-descriptions nzBordered> |
||||||
<!-- {{data.createTime | date: 'yyyy-MM-dd'}}--> |
<nz-descriptions-item nzTitle="所属地区">{{data.company.regionName}}</nz-descriptions-item> |
||||||
<!-- </nz-descriptions-item>--> |
<nz-descriptions-item nzTitle="单位logo"> |
||||||
<!-- <nz-descriptions-item nzTitle="更新时间">--> |
<img class="head_img" src="{{FILE_URL +data.logo}}" onerror="this.src='../../../../assets/admin/navigation/icon.png'" alt=""> |
||||||
<!-- {{data.updateTime | date: 'yyyy-MM-dd'}}--> |
</nz-descriptions-item> |
||||||
<!-- </nz-descriptions-item>--> |
<nz-descriptions-item nzTitle="公司名称">{{data.company.name}}</nz-descriptions-item> |
||||||
<!-- <nz-descriptions-item nzTitle="操作人员">{{data.operatorName }}</nz-descriptions-item>--> |
<nz-descriptions-item nzTitle="联系方式">{{data.company.phone}}</nz-descriptions-item> |
||||||
<!-- <nz-descriptions-item nzTitle="简介" [nzSpan]="3">--> |
<nz-descriptions-item nzTitle="创建时间">{{data.company.createTime | date: 'yyyy-MM-dd HH:mm'}} </nz-descriptions-item> |
||||||
<!-- {{data.merchantDesc}}--> |
<nz-descriptions-item nzTitle="更新时间">{{data.company.updateTime | date: 'yyyy-MM-dd HH:mm'}} </nz-descriptions-item> |
||||||
<!-- </nz-descriptions-item>--> |
</nz-descriptions> |
||||||
<!-- </nz-descriptions>--> |
</nz-tab> |
||||||
<!--</div>--> |
</nz-tabset> |
||||||
|
</div> |
||||||
|
@ -0,0 +1,4 @@ |
|||||||
|
.head_img { |
||||||
|
height: 60px; |
||||||
|
width: 60px; |
||||||
|
} |
@ -1,128 +1,196 @@ |
|||||||
import { Component, OnInit } from '@angular/core'; |
import {Component, OnInit} from '@angular/core'; |
||||||
import {FormBuilder, FormGroup} from '@angular/forms'; |
import {FormBuilder, FormGroup} from '@angular/forms'; |
||||||
import {MerchantStoreService} from '../../../services/merchant-store.service'; |
import {MerchantStoreService} from '../../../services/merchant-store.service'; |
||||||
import {IconService} from '../../../services/icon.service'; |
import {IconService} from '../../../services/icon.service'; |
||||||
import {NzMessageService} from 'ng-zorro-antd'; |
import {NzMessageService} from 'ng-zorro-antd'; |
||||||
import {ActivatedRoute, Router} from '@angular/router'; |
import {ActivatedRoute, Router} from '@angular/router'; |
||||||
import {CommonsService} from '../../../services/commons.service'; |
import {CommonsService} from '../../../services/commons.service'; |
||||||
|
import {CouponService} from '../../../services/coupon.service'; |
||||||
|
import {MerchantService} from '../../../services/merchant.service'; |
||||||
|
|
||||||
@Component({ |
@Component({ |
||||||
selector: 'app-coupon-list', |
selector: 'app-coupon-list', |
||||||
templateUrl: './coupon-list.component.html', |
templateUrl: './coupon-list.component.html', |
||||||
styleUrls: ['./coupon-list.component.scss'] |
styleUrls: ['./coupon-list.component.scss'] |
||||||
}) |
}) |
||||||
export class CouponListComponent implements OnInit { |
export class CouponListComponent implements OnInit { |
||||||
|
|
||||||
searchForm: FormGroup; // 搜索框
|
searchForm: FormGroup; // 搜索框
|
||||||
requestData = []; // 列表数据
|
requestData = []; // 列表数据
|
||||||
total: number; // 页码
|
total: number; // 页码
|
||||||
pageNum = 1; // 页码
|
pageNum = 1; // 页码
|
||||||
pageSize = 10; // 条码
|
pageSize = 10; // 条码
|
||||||
loading = true; |
loading = true; |
||||||
id = null; |
id = null; |
||||||
name: string; |
name: string; |
||||||
constructor( |
merchantName: string; |
||||||
private form: FormBuilder, |
optionList: string[] = []; |
||||||
private merchantStore: MerchantStoreService, |
isLoading = false; |
||||||
private iconService: IconService, |
pageNumMer = 1; |
||||||
private message: NzMessageService, |
constructor( |
||||||
private router: Router, |
private form: FormBuilder, |
||||||
private activatedRoute: ActivatedRoute, |
private coupon: CouponService, |
||||||
private common: CommonsService |
private merchant: MerchantService, |
||||||
) { |
private iconService: IconService, |
||||||
} |
private message: NzMessageService, |
||||||
|
private router: Router, |
||||||
ngOnInit(): void { |
private activatedRoute: ActivatedRoute, |
||||||
this.init(); |
private common: CommonsService |
||||||
|
) { |
||||||
} |
|
||||||
|
|
||||||
public init(): void { |
|
||||||
this.activatedRoute.queryParams.subscribe(queryParams => { |
|
||||||
if (queryParams.merchantId != null) { |
|
||||||
this.id = queryParams.merchantId; |
|
||||||
this.name = queryParams.name; |
|
||||||
} |
|
||||||
}); |
|
||||||
this.searchForm = this.form.group({ |
|
||||||
storeName: [null], |
|
||||||
telephone: [null], |
|
||||||
}); |
|
||||||
this.getRequest(true, this.searchForm.value); |
|
||||||
} |
|
||||||
|
|
||||||
|
|
||||||
// 查询列表
|
|
||||||
public getRequest(reset: boolean = false, whereObject: object) { |
|
||||||
|
|
||||||
this.loading = false; |
|
||||||
if (reset) { |
|
||||||
this.pageNum = 1; |
|
||||||
} |
} |
||||||
whereObject['pageNum'] = this.pageNum; |
|
||||||
whereObject['pageSize'] = this.pageSize; |
ngOnInit(): void { |
||||||
if (this.id == null) { |
this.init(); |
||||||
this.merchantStore.getStoreListByMerchant(whereObject, data => { |
|
||||||
if (data['return_code'] === '000000') { |
} |
||||||
this.requestData = data['return_data'].list; |
|
||||||
this.total = data['return_data'].total; |
public init(): void { |
||||||
} else { |
this.activatedRoute.queryParams.subscribe(queryParams => { |
||||||
this.message.error(data['return_msg']); |
if (queryParams.merchantId != null) { |
||||||
} |
this.id = queryParams.merchantId; |
||||||
}); |
this.name = queryParams.name; |
||||||
} else { |
} |
||||||
whereObject['merchantId'] = this.id; |
}); |
||||||
this.merchantStore.getStoreListByCompany(whereObject, data => { |
this.searchForm = this.form.group({ |
||||||
if (data['return_code'] === '000000') { |
merchantId: [null], |
||||||
this.requestData = data['return_data'].list; |
couponName: [null], |
||||||
this.total = data['return_data'].total; |
couponType: [null], |
||||||
} else { |
status: [null], |
||||||
this.message.error(data['return_msg']); |
}); |
||||||
|
this.getRequest(true, this.searchForm.value); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
// 查询列表
|
||||||
|
public getRequest(reset: boolean = false, whereObject: object) { |
||||||
|
|
||||||
|
this.loading = false; |
||||||
|
if (reset) { |
||||||
|
this.pageNum = 1; |
||||||
} |
} |
||||||
}); |
whereObject['pageNum'] = this.pageNum; |
||||||
|
whereObject['pageSize'] = this.pageSize; |
||||||
|
this.coupon.getCouponList(whereObject, data => { |
||||||
|
if (data['return_code'] === '000000') { |
||||||
|
this.requestData = data['return_data'].list; |
||||||
|
this.total = data['return_data'].total; |
||||||
|
} else { |
||||||
|
this.message.error(data['return_msg']); |
||||||
|
} |
||||||
|
}); |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
// 重置
|
||||||
|
public resetForm(): void { |
||||||
|
this.searchForm.reset(); |
||||||
|
} |
||||||
|
|
||||||
|
// 删除门店
|
||||||
|
public getDelete(id): void { |
||||||
|
const message = '是否删除门店'; |
||||||
|
this.common.showConfirm(message, data => { |
||||||
|
if (data) { |
||||||
|
// this.coupon.disableMerchant(id, dataReturn => {
|
||||||
|
// if (dataReturn['return_code'] === '000000') {
|
||||||
|
// this.message.success('操作成功');
|
||||||
|
// this.getRequest(false, this.searchForm.value);
|
||||||
|
// } else {
|
||||||
|
// this.message.warning(dataReturn['return_msg']);
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
} |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
// 修改
|
||||||
|
public getEdit(id: number): void { |
||||||
|
this.router.navigate(['/admin/coupon/coupon-edit'], { |
||||||
|
queryParams: { |
||||||
|
couponId: id |
||||||
|
} |
||||||
|
}).then(r => console.log(r)); |
||||||
|
} |
||||||
|
|
||||||
|
// 查看详情
|
||||||
|
public getDetail(id: number): void { |
||||||
|
this.router.navigate(['/admin/merchantStore/store-detail'], { |
||||||
|
queryParams: { |
||||||
|
storeId: id |
||||||
|
} |
||||||
|
}).then(r => console.log(r)); |
||||||
|
} |
||||||
|
|
||||||
|
// 查询商户
|
||||||
|
loadMore(): void { |
||||||
|
this.isLoading = true; |
||||||
|
const paramsObject = { |
||||||
|
pageNum: this.pageNumMer, |
||||||
|
pageSize: 10, |
||||||
|
merchantName: this.merchantName, |
||||||
|
}; |
||||||
|
this.getMerchantList(paramsObject); |
||||||
} |
} |
||||||
|
|
||||||
|
// 搜索商户
|
||||||
|
search(e): void { |
||||||
|
this.optionList = []; |
||||||
|
this.isLoading = true; |
||||||
|
this.merchantName = e; |
||||||
|
this.pageNumMer = 1; |
||||||
|
const paramsObject = { |
||||||
|
pageNum: this.pageNumMer, |
||||||
|
pageSize: 10, |
||||||
|
merchantName: e, |
||||||
|
}; |
||||||
|
this.getMerchantList(paramsObject); |
||||||
|
} |
||||||
|
|
||||||
|
// 查询商户
|
||||||
|
public getMerchantList(paramsObject): void { |
||||||
|
this.merchant.getMerchantList(paramsObject , data => { |
||||||
|
if (data['return_code'] === '000000' && this.pageNumMer <= data['return_data'].pages ) { |
||||||
|
this.pageNumMer ++; |
||||||
|
this.isLoading = false; |
||||||
|
this.optionList = [...this.optionList, ...data['return_data'].list]; |
||||||
|
} else { |
||||||
|
this.isLoading = false; |
||||||
|
} |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
} |
// 下架卡券
|
||||||
|
public disableMerchant(id): void { |
||||||
// 重置
|
const message = '是否下架卡券'; |
||||||
public resetForm(): void { |
this.common.showConfirm(message, data => { |
||||||
this.searchForm.reset(); |
if (data) { |
||||||
} |
this.coupon.ofShelfApprove(id, dataReturn => { |
||||||
|
if (dataReturn['return_code'] === '000000') { |
||||||
// 禁用门店
|
this.message.success('操作成功'); |
||||||
public getDelete(id): void { |
this.getRequest(false , this.searchForm.value); |
||||||
const message = '是否删除门店'; |
} else { |
||||||
this.common.showConfirm(message, data => { |
this.message.warning(dataReturn['return_msg']); |
||||||
if (data) { |
} |
||||||
this.merchantStore.deleteMerchantStore(id, dataReturn => { |
}); |
||||||
if (dataReturn['return_code'] === '000000') { |
} |
||||||
this.message.success('操作成功'); |
|
||||||
this.getRequest(false , this.searchForm.value); |
|
||||||
} else { |
|
||||||
this.message.warning(dataReturn['return_msg']); |
|
||||||
} |
|
||||||
}); |
}); |
||||||
} |
} |
||||||
}); |
|
||||||
} |
// 上架
|
||||||
|
public enableMerchant(id): void { |
||||||
// 修改
|
const message = '是否上架审核卡券'; |
||||||
public getEdit(id: number): void { |
this.common.showConfirm(message, data => { |
||||||
this.router.navigate(['/admin/merchantStore/store-edit'], { |
if (data) { |
||||||
queryParams: { |
this.coupon.upShelfApprove(id, dataReturn => { |
||||||
storeId: id |
if (dataReturn['return_code'] === '000000') { |
||||||
} |
this.message.success('操作成功'); |
||||||
}).then(r => console.log(r)); |
this.getRequest(false , this.searchForm.value); |
||||||
} |
} else { |
||||||
|
this.message.warning(dataReturn['return_msg']); |
||||||
// 查看详情
|
} |
||||||
public getDetail(id: number): void { |
}); |
||||||
this.router.navigate(['/admin/merchantStore/store-detail'], { |
} |
||||||
queryParams: { |
}); |
||||||
storeId: id |
} |
||||||
} |
|
||||||
}).then(r => console.log(r)); |
|
||||||
} |
|
||||||
|
|
||||||
} |
} |
||||||
|
@ -0,0 +1,24 @@ |
|||||||
|
import { Pipe, PipeTransform } from '@angular/core'; |
||||||
|
|
||||||
|
@Pipe({ |
||||||
|
name: 'couponStatus' |
||||||
|
}) |
||||||
|
export class CouponStatusPipe implements PipeTransform { |
||||||
|
|
||||||
|
transform(value: number): string { |
||||||
|
switch (value) { |
||||||
|
case 0: |
||||||
|
return '删除'; |
||||||
|
case 1: |
||||||
|
return '编辑中'; |
||||||
|
case 2: |
||||||
|
return '已上架'; |
||||||
|
case 3: |
||||||
|
return '已下架'; |
||||||
|
case 101: |
||||||
|
return '上架审批中'; |
||||||
|
case 102: |
||||||
|
return '上架审批驳回'; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -1,3 +1,4 @@ |
|||||||
export * from './commons/times.pipe'; |
export * from './commons/times.pipe'; |
||||||
export * from './commons/textarea.pipe'; |
export * from './commons/textarea.pipe'; |
||||||
export * from './system.pipe'; |
export * from './system.pipe'; |
||||||
|
export * from './coupon-status.pipe'; |
||||||
|
Loading…
Reference in new issue