pull/1/head
袁野 4 years ago
parent 95349eef2e
commit 254bc7bf86
  1. 9
      src/app/admin/audit/audit-coupon/audit-coupon.component.html
  2. 10
      src/app/admin/coupon/coupon-list/coupon-list.component.html
  3. 5
      src/app/admin/coupon/sales-code-list/sales-code-list.component.ts
  4. 2
      src/app/admin/merchant-store/store-list/store-list.component.html
  5. 6
      src/app/admin/merchant/merchant-edit/merchant-edit.component.ts
  6. 3
      src/app/admin/merchant/merchant-list/merchant-list.component.ts
  7. 113
      src/app/admin/price/price-list/price-list.component.html
  8. 4
      src/app/admin/price/price-list/price-list.component.scss
  9. 122
      src/app/admin/price/price-list/price-list.component.ts
  10. 2
      src/app/pipes/system.pipe.ts

@ -85,6 +85,10 @@
<td>{{data.status | auditStatus}}</td> <td>{{data.status | auditStatus}}</td>
<td nzRight="0px" class="table-td-operation"> <td nzRight="0px" class="table-td-operation">
<a (click)="getDetail(data.id)"><i nz-icon [nzIconfont]="'icon-xiangqing'" nz-tooltip="审核详情"></i></a> <a (click)="getDetail(data.id)"><i nz-icon [nzIconfont]="'icon-xiangqing'" nz-tooltip="审核详情"></i></a>
<nz-divider *ngIf="data['status'] === 1" nzType="vertical"></nz-divider>
<a (click)="approveProcessed(3)" *ngIf="data['status'] === 1"><i nz-icon nzType="check-circle" nzTheme="outline" nz-tooltip="通过"></i></a>
<nz-divider *ngIf="data['status'] === 1" nzType="vertical"></nz-divider>
<a (click)="approveProcessed(2)" *ngIf="data['status'] === 1"><i nz-icon nzType="stop" nz-tooltip="驳回" nzTheme="outline"></i></a>
</td> </td>
</tbody> </tbody>
</nz-table> </nz-table>
@ -110,8 +114,9 @@
</nz-descriptions> </nz-descriptions>
</ng-container> </ng-container>
<div *nzModalFooter> <div *nzModalFooter>
<button nz-button nzType="default" (click)="approveProcessed(2)">审核驳回</button> <button *ngIf="data['approve']['status'] !== 1" nz-button nzType="default" (click)="handleCancel()">关闭</button>
<button nz-button nzType="primary" (click)="approveProcessed(3)">审核通过</button> <button *ngIf="data['approve']['status'] === 1" nz-button nzType="default" (click)="approveProcessed(2)">审核驳回</button>
<button *ngIf="data['approve']['status'] === 1" nz-button nzType="primary" (click)="approveProcessed(3)">审核通过</button>
</div> </div>
</nz-modal> </nz-modal>

@ -99,15 +99,15 @@
<thead nzSingleSort> <thead nzSingleSort>
<tr> <tr>
<th nzWidth="50px">编号</th> <th nzWidth="50px">编号</th>
<th nzWidth="80px">卡券编号</th> <th nzWidth="150px">卡券编号</th>
<th nzWidth="80px">卡券名称</th> <th nzWidth="160px">卡券名称</th>
<th nzWidth="100px">卡券面值</th> <th nzWidth="100px">卡券面值</th>
<th nzWidth="100px">销售价格</th> <th nzWidth="100px">销售价格</th>
<th nzWidth="100px">有效库存</th> <th nzWidth="100px">有效库存</th>
<th nzWidth="100px">卡券类型</th> <th nzWidth="100px">卡券类型</th>
<th nzWidth="100px">卡券状态</th> <th nzWidth="120px">卡券状态</th>
<th nzWidth="120px">销售截止时间</th> <th nzWidth="150px">销售截止时间</th>
<th nzWidth="120px">创建时间</th> <th nzWidth="150px">创建时间</th>
<th nzWidth="150px" nzRight="0px">操作</th> <th nzWidth="150px" nzRight="0px">操作</th>
</tr> </tr>
</thead> </thead>

@ -118,13 +118,10 @@ export class SalesCodeListComponent implements OnInit {
} }
handleChange(info: NzUploadChangeParam): void { handleChange(info: NzUploadChangeParam): void {
if (info.file.status !== 'uploading') {
console.log(info.file, info.fileList);
}
if (info.file.status === 'done') { if (info.file.status === 'done') {
if (info.file.response.return_code === '000000') { if (info.file.response.return_code === '000000') {
this.loading = false; 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.message.success('导入成功');
this.getRequest(true, this.searchForm.value); this.getRequest(true, this.searchForm.value);
} else { } else {

@ -41,7 +41,7 @@
商戶名称: 商戶名称:
<span style="font-weight: bold; font-size: 20px">{{name}}</span> <span style="font-weight: bold; font-size: 20px">{{name}}</span>
</span> </span>
<div class="operating-button"> <div class="operating-button" *ngIf="id == null" >
<button nz-button nzType="primary" class="right-btn" [routerLink]="['/admin/merchantStore/store-edit']" ><i nz-icon nzType="plus" nzTheme="outline"></i>添加</button> <button nz-button nzType="primary" class="right-btn" [routerLink]="['/admin/merchantStore/store-edit']" ><i nz-icon nzType="plus" nzTheme="outline"></i>添加</button>
</div> </div>
<nz-table <nz-table

@ -75,7 +75,7 @@ export class MerchantEditComponent implements OnInit {
this.validateForm.reset(); this.validateForm.reset();
} }
// 课程保存 // 保存
public getSave(): void { public getSave(): void {
// tslint:disable-next-line:forin // tslint:disable-next-line:forin
for (const i in this.validateForm.controls) { for (const i in this.validateForm.controls) {
@ -104,7 +104,7 @@ export class MerchantEditComponent implements OnInit {
this.getBack(); this.getBack();
this.message.success('修改成功'); this.message.success('修改成功');
} else { } else {
this.message.create('error', '修改失败'); this.message.create('error', data['return_msg']);
} }
}); });
} else { } else {
@ -115,7 +115,7 @@ export class MerchantEditComponent implements OnInit {
this.getBack(); this.getBack();
this.message.success('添加成功'); this.message.success('添加成功');
} else { } else {
this.message.create('error', '保存失败'); this.message.create('error', data['return_msg']);
} }
}); });
} }

@ -1,6 +1,5 @@
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 {UserService} from '../../../services/user.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 {CommonsService} from '../../../services/commons.service'; import {CommonsService} from '../../../services/commons.service';
@ -14,7 +13,7 @@ import {environment} from '../../../../environments/environment';
styleUrls: ['./merchant-list.component.scss'] styleUrls: ['./merchant-list.component.scss']
}) })
export class MerchantListComponent implements OnInit { export class MerchantListComponent implements OnInit {
WEB_SERVE_URL = environment.baseUrl; WEB_SERVE_URL = environment.imageUrl;
searchForm: FormGroup; // 搜索框 searchForm: FormGroup; // 搜索框
requestData = []; // 列表数据 requestData = []; // 列表数据
total: number; // 页码 total: number; // 页码

@ -1 +1,112 @@
<p>price-list works!</p> <!-- start 面包屑 -->
<app-breadcrumb></app-breadcrumb>
<!-- end 面包屑 -->
<!--条件搜索-->
<div class="inner-content">
<form nz-form [formGroup]="searchForm" (ngSubmit)="getRequest(true , searchForm.value)">
<div nz-row>
<div nz-col nzSpan="6">
<nz-form-item>
<nz-form-label [nzSpan]="6">商户编号</nz-form-label>
<nz-form-control [nzSpan]="16">
<input nz-input formControlName="merchantKey"/>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="6">
<nz-form-item>
<nz-form-label [nzSpan]="6">商户名称</nz-form-label>
<nz-form-control [nzSpan]="16">
<input nz-input formControlName="merchantName"/>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="6">
<nz-form-item>
<nz-form-label [nzSpan]="6">商户电话</nz-form-label>
<nz-form-control [nzSpan]="16">
<input nz-input formControlName="telephone"/>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="6">
<nz-form-item>
<nz-form-label [nzSpan]="6">商户状态</nz-form-label>
<nz-form-control [nzSpan]="16">
<nz-select nzShowSearch nzAllowClear formControlName="status" nzPlaceHolder="请选择状态">
<nz-option nzLabel="禁用" nzValue="0"></nz-option>
<nz-option nzLabel="正常" nzValue="1"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
</div>
<div nz-row>
<div nz-col nzSpan="24" class="search-button">
<button nz-button nzType="primary"><i nz-icon nzType="search" nzTheme="outline"></i>搜索</button>
<button nz-button nzType="default" (click)="resetForm()"><i nz-icon nzType="reload" nzTheme="outline"></i>重置</button>
</div>
</div>
</form>
</div>
<div class="inner-content">
<span>共计 {{total}} 条数据</span>
<div class="operating-button">
<button nz-button nzType="primary" class="right-btn" [routerLink]="['/admin/merchant/merchant-edit']" ><i nz-icon nzType="plus" nzTheme="outline"></i>添加</button>
</div>
<nz-table
class="table"
#ajaxTable
nzShowSizeChanger
[nzFrontPagination]="false"
[nzData]="requestData"
[nzLoading]="loading"
[nzTotal]="total"
[(nzPageIndex)]="pageNum"
[(nzPageSize)]="pageSize"
[nzScroll]="{ x: '1200px' }"
(nzPageIndexChange)="getRequest(false , searchForm.value)"
(nzPageSizeChange)="getRequest(false , searchForm.value)">
<thead nzSingleSort>
<tr>
<th nzWidth="50px">编号</th>
<th nzWidth="80px">商户编号</th>
<th nzWidth="80px">商户名称</th>
<th nzWidth="70px">商户LOGO</th>
<th nzWidth="100px">商户电话</th>
<th nzWidth="100px">创建时间</th>
<th nzWidth="50px">状态</th>
<th nzWidth="80px" nzRight="0px">操作</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of ajaxTable.data; let i = index">
<td>{{i+1}}</td>
<td>{{data.merchantKey}}</td>
<td>{{data.merchantName}}</td>
<td>
<img class="head_img" src="{{WEB_SERVE_URL + data.merchantLogo}}" onerror="this.src='../../../../assets/admin/navigation/icon.png'" alt="">
</td>
<td>{{data.telephone}}</td>
<td>{{data.createTime | date: 'yyyy-MM-dd HH:mm'}}</td>
<td>{{data.status ===1 ? '正常' : '禁用'}}</td>
<td nzRight="0px" class="table-td-operation">
<a (click)="getEdit(data.id)"><i nz-icon nzType="form" nzTheme="outline" nz-tooltip="编辑"></i></a>
<nz-divider nzType="vertical"></nz-divider>
<a (click)="getDetail(data.id)"><i nz-icon [nzIconfont]="'icon-xiangqing'" nz-tooltip="商户详情"></i></a>
<nz-divider nzType="vertical"></nz-divider>
<a (click)="getList(data.id , data.merchantName)"><i nz-icon nzType="unordered-list" nzTheme="outline" nz-tooltip="门店列表"></i></a>
<nz-divider nzType="vertical"></nz-divider>
<a *ngIf="data.status === 1" (click)='disableMerchant(data.id)'><i nz-icon nzType="stop" nzTheme="outline" nz-tooltip="禁用"></i></a>
<a *ngIf="data.status !== 1" (click)='enableMerchant(data.id)'><i nz-icon nzType="check-circle" nzTheme="outline" nz-tooltip="启用"></i></a>
</td>
</tbody>
</nz-table>
</div>

@ -0,0 +1,4 @@
.head_img {
height: 60px;
width: 60px;
}

@ -1,4 +1,11 @@
import { Component, OnInit } from '@angular/core'; 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({ @Component({
selector: 'app-price-list', selector: 'app-price-list',
@ -7,9 +14,122 @@ import { Component, OnInit } from '@angular/core';
}) })
export class PriceListComponent implements OnInit { 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 { 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));
}
} }

@ -15,6 +15,8 @@ export class SystemPipe implements PipeTransform {
return '商户账号'; return '商户账号';
case 3: case 3:
return '门店账号'; return '门店账号';
case 4:
return '代理商账号';
} }
} }

Loading…
Cancel
Save