diff --git a/src/app/admin/audit/audit-coupon/audit-coupon.component.html b/src/app/admin/audit/audit-coupon/audit-coupon.component.html index 64917a8..e1ee179 100644 --- a/src/app/admin/audit/audit-coupon/audit-coupon.component.html +++ b/src/app/admin/audit/audit-coupon/audit-coupon.component.html @@ -85,6 +85,10 @@ {{data.status | auditStatus}} + + + + @@ -110,8 +114,9 @@
- - + + +
diff --git a/src/app/admin/coupon/coupon-list/coupon-list.component.html b/src/app/admin/coupon/coupon-list/coupon-list.component.html index 5c2988f..e75d625 100644 --- a/src/app/admin/coupon/coupon-list/coupon-list.component.html +++ b/src/app/admin/coupon/coupon-list/coupon-list.component.html @@ -99,15 +99,15 @@ 编号 - 卡券编号 - 卡券名称 + 卡券编号 + 卡券名称 卡券面值 销售价格 有效库存 卡券类型 - 卡券状态 - 销售截止时间 - 创建时间 + 卡券状态 + 销售截止时间 + 创建时间 操作 diff --git a/src/app/admin/coupon/sales-code-list/sales-code-list.component.ts b/src/app/admin/coupon/sales-code-list/sales-code-list.component.ts index adb5dbb..bebdd97 100644 --- a/src/app/admin/coupon/sales-code-list/sales-code-list.component.ts +++ b/src/app/admin/coupon/sales-code-list/sales-code-list.component.ts @@ -118,13 +118,10 @@ export class SalesCodeListComponent implements OnInit { } handleChange(info: NzUploadChangeParam): void { - if (info.file.status !== 'uploading') { - console.log(info.file, info.fileList); - } if (info.file.status === 'done') { if (info.file.response.return_code === '000000') { this.loading = false; - if (info.file.response.return_data == null || info.file.response.return_data.length === 0) { + if (info.file.response.return_data == null || info.file.response.return_data.errorTotal === 0) { this.message.success('导入成功'); this.getRequest(true, this.searchForm.value); } else { diff --git a/src/app/admin/merchant-store/store-list/store-list.component.html b/src/app/admin/merchant-store/store-list/store-list.component.html index 3e6e7de..075bef1 100644 --- a/src/app/admin/merchant-store/store-list/store-list.component.html +++ b/src/app/admin/merchant-store/store-list/store-list.component.html @@ -41,7 +41,7 @@ 商戶名称: {{name}} -
+
price-list works!

+ + + + + +
+
+
+
+ + 商户编号 + + + + +
+
+ + 商户名称 + + + + +
+
+ + 商户电话 + + + + +
+
+ + 商户状态 + + + + + + + +
+
+ +
+
+ + +
+
+
+
+ + +
+ 共计 {{total}} 条数据 +
+ +
+ + + + 编号 + 商户编号 + 商户名称 + 商户LOGO + 商户电话 + 创建时间 + 状态 + 操作 + + + + + {{i+1}} + {{data.merchantKey}} + {{data.merchantName}} + + + + {{data.telephone}} + {{data.createTime | date: 'yyyy-MM-dd HH:mm'}} + {{data.status ===1 ? '正常' : '禁用'}} + + + + + + + + + + + + +
+ + + diff --git a/src/app/admin/price/price-list/price-list.component.scss b/src/app/admin/price/price-list/price-list.component.scss index e69de29..8bee3fb 100644 --- a/src/app/admin/price/price-list/price-list.component.scss +++ b/src/app/admin/price/price-list/price-list.component.scss @@ -0,0 +1,4 @@ +.head_img { + height: 60px; + width: 60px; +} diff --git a/src/app/admin/price/price-list/price-list.component.ts b/src/app/admin/price/price-list/price-list.component.ts index e576ed9..9620b52 100644 --- a/src/app/admin/price/price-list/price-list.component.ts +++ b/src/app/admin/price/price-list/price-list.component.ts @@ -1,4 +1,11 @@ import { Component, OnInit } from '@angular/core'; +import {environment} from '../../../../environments/environment'; +import {FormBuilder, FormGroup} from '@angular/forms'; +import {MerchantService} from '../../../services/merchant.service'; +import {IconService} from '../../../services/icon.service'; +import {NzMessageService} from 'ng-zorro-antd'; +import {Router} from '@angular/router'; +import {CommonsService} from '../../../services/commons.service'; @Component({ selector: 'app-price-list', @@ -7,9 +14,122 @@ import { Component, OnInit } from '@angular/core'; }) export class PriceListComponent implements OnInit { - constructor() { } + WEB_SERVE_URL = environment.imageUrl; + searchForm: FormGroup; // 搜索框 + requestData = []; // 列表数据 + total: number; // 页码 + pageNum = 1; // 页码 + pageSize = 10; // 条码 + loading = true; + + constructor( + private form: FormBuilder, + private merchant: MerchantService, + private iconService: IconService, + private message: NzMessageService, + private router: Router, + private common: CommonsService + ) { + } ngOnInit(): void { + this.init(); + } + + public init(): void { + this.searchForm = this.form.group({ + merchantKey: [null], + merchantName: [null], + telephone: [null], + status: [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; + this.merchant.getMerchantList(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 disableMerchant(id): void { + const message = '是否禁用商户'; + this.common.showConfirm(message, data => { + if (data) { + this.merchant.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 enableMerchant(id): void { + const message = '是否启用商户'; + this.common.showConfirm(message, data => { + if (data) { + this.merchant.enableMerchant(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/merchant/merchant-edit'], { + queryParams: { + merchantId: id + } + }).then(r => console.log(r)); + } + + // 查看详情 + public getDetail(id: number): void { + this.router.navigate(['/admin/merchant/merchant-detail'], { + queryParams: { + merchantId: id + } + }).then(r => console.log(r)); + } + + // 查看门店列表 + public getList(id: number , merchantName: string): void { + this.router.navigate(['/admin/merchantStore/store-list'], { + queryParams: { + merchantId: id, + name: merchantName, + } + }).then(r => console.log(r)); + } } diff --git a/src/app/pipes/system.pipe.ts b/src/app/pipes/system.pipe.ts index 9249d55..8860468 100644 --- a/src/app/pipes/system.pipe.ts +++ b/src/app/pipes/system.pipe.ts @@ -15,6 +15,8 @@ export class SystemPipe implements PipeTransform { return '商户账号'; case 3: return '门店账号'; + case 4: + return '代理商账号'; } }