parent
0a2b69f11a
commit
cd2e772c56
@ -0,0 +1,92 @@ |
||||
<!-- 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="objectName"/> |
||||
</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="objectType"/>--> |
||||
<!-- </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="approveSerialNo"/> |
||||
</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> |
||||
<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="120px">审核流水号</th> |
||||
<th nzWidth="80px">审核对象名称</th> |
||||
<th nzWidth="80px">审核类型</th> |
||||
<th nzWidth="100px">提交人员</th> |
||||
<th nzWidth="100px">创建时间</th> |
||||
<th nzWidth="80px">状态</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.approveSerialNo}}</td> |
||||
<td>{{data.objectName}}</td> |
||||
<td>{{data.objectType | auditType}}</td> |
||||
<td>{{data.submitOperatorName}}</td> |
||||
<td>{{data.createTime | date: 'yyyy-MM-dd HH:mm'}}</td> |
||||
<td>{{data.status | auditStatus}}</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> |
||||
</td> |
||||
</tbody> |
||||
</nz-table> |
||||
</div> |
||||
|
||||
|
||||
|
@ -0,0 +1,84 @@ |
||||
import {Component, OnInit} from '@angular/core'; |
||||
import {FormBuilder, FormGroup} from '@angular/forms'; |
||||
import {IconService} from '../../../services/icon.service'; |
||||
import {NzMessageService} from 'ng-zorro-antd'; |
||||
import {ActivatedRoute, Router} from '@angular/router'; |
||||
import {AuditService} from '../../../services/audit.service'; |
||||
|
||||
@Component({ |
||||
selector: 'app-audit-coupon', |
||||
templateUrl: './audit-coupon.component.html', |
||||
styleUrls: ['./audit-coupon.component.scss'] |
||||
}) |
||||
export class AuditCouponComponent implements OnInit { |
||||
|
||||
searchForm: FormGroup; // 搜索框
|
||||
requestData = []; // 列表数据
|
||||
total: number; // 页码
|
||||
pageNum = 1; // 页码
|
||||
pageSize = 10; // 条码
|
||||
loading = true; |
||||
|
||||
constructor( |
||||
private form: FormBuilder, |
||||
private audit: AuditService, |
||||
private iconService: IconService, |
||||
private message: NzMessageService, |
||||
private router: Router, |
||||
private activatedRoute: ActivatedRoute, |
||||
) { |
||||
} |
||||
|
||||
ngOnInit(): void { |
||||
this.init(); |
||||
|
||||
} |
||||
|
||||
public init(): void { |
||||
this.searchForm = this.form.group({ |
||||
objectType: [null], |
||||
objectName: [null], |
||||
approveSerialNo: [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.audit.getApproveList(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 getDetail(id: number): void { |
||||
this.audit.getApproveDetail(id, data => { |
||||
console.log(data); |
||||
}); |
||||
// this.router.navigate(['/admin/merchantStore/store-detail'], {
|
||||
// queryParams: {
|
||||
// storeId: id
|
||||
// }
|
||||
// }).then(r => console.log(r));
|
||||
} |
||||
|
||||
} |
@ -0,0 +1,14 @@ |
||||
import { NgModule } from '@angular/core'; |
||||
import { Routes, RouterModule } from '@angular/router'; |
||||
import {AuditCouponComponent} from './audit-coupon/audit-coupon.component'; |
||||
|
||||
|
||||
const routes: Routes = [ |
||||
{ path: 'coupon-audit', component: AuditCouponComponent }, |
||||
]; |
||||
|
||||
@NgModule({ |
||||
imports: [RouterModule.forChild(routes)], |
||||
exports: [RouterModule] |
||||
}) |
||||
export class AuditRoutingModule { } |
@ -0,0 +1,26 @@ |
||||
import { NgModule } from '@angular/core'; |
||||
import { CommonModule } from '@angular/common'; |
||||
|
||||
import { AuditRoutingModule } from './audit-routing.module'; |
||||
import { AuditCouponComponent } from './audit-coupon/audit-coupon.component'; |
||||
import {NgZorroAntdModule} from 'ng-zorro-antd'; |
||||
import {SeparateModule} from '../../common/separate/separate.module'; |
||||
import {FormsModule, ReactiveFormsModule} from '@angular/forms'; |
||||
import {BreadcrumbModule} from '../../common/breadcrumb/breadcrumb.module'; |
||||
import {AppCommonModule} from '../../app-common.module'; |
||||
|
||||
|
||||
@NgModule({ |
||||
declarations: [AuditCouponComponent], |
||||
imports: [ |
||||
CommonModule, |
||||
AuditRoutingModule, |
||||
NgZorroAntdModule, |
||||
SeparateModule, |
||||
ReactiveFormsModule, |
||||
FormsModule, |
||||
BreadcrumbModule, |
||||
AppCommonModule |
||||
] |
||||
}) |
||||
export class AuditModule { } |
@ -1,25 +0,0 @@ |
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; |
||||
|
||||
import { CouponDetailComponent } from './coupon-detail.component'; |
||||
|
||||
describe('CouponDetailComponent', () => { |
||||
let component: CouponDetailComponent; |
||||
let fixture: ComponentFixture<CouponDetailComponent>; |
||||
|
||||
beforeEach(async(() => { |
||||
TestBed.configureTestingModule({ |
||||
declarations: [ CouponDetailComponent ] |
||||
}) |
||||
.compileComponents(); |
||||
})); |
||||
|
||||
beforeEach(() => { |
||||
fixture = TestBed.createComponent(CouponDetailComponent); |
||||
component = fixture.componentInstance; |
||||
fixture.detectChanges(); |
||||
}); |
||||
|
||||
it('should create', () => { |
||||
expect(component).toBeTruthy(); |
||||
}); |
||||
}); |
@ -0,0 +1,19 @@ |
||||
import { Pipe, PipeTransform } from '@angular/core'; |
||||
|
||||
@Pipe({ |
||||
name: 'auditStatus' |
||||
}) |
||||
export class AuditStatusPipe implements PipeTransform { |
||||
|
||||
transform(value: number): string { |
||||
switch (value) { |
||||
case 1: |
||||
return '待审批'; |
||||
case 2: |
||||
return '驳回'; |
||||
case 3: |
||||
return '通过'; |
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,14 @@ |
||||
import { Pipe, PipeTransform } from '@angular/core'; |
||||
|
||||
@Pipe({ |
||||
name: 'auditType' |
||||
}) |
||||
export class AuditTypePipe implements PipeTransform { |
||||
|
||||
transform(value: number): string { |
||||
switch (value) { |
||||
case 1: |
||||
return '卡券上架审批'; |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,40 @@ |
||||
import { Injectable } from '@angular/core'; |
||||
import {HttpClient} from '@angular/common/http'; |
||||
import {CommonsService} from './commons.service'; |
||||
import {environment} from '../../environments/environment'; |
||||
|
||||
@Injectable({ |
||||
providedIn: 'root' |
||||
}) |
||||
export class AuditService { |
||||
|
||||
constructor( |
||||
private http: HttpClient, |
||||
private common: CommonsService |
||||
) { } |
||||
|
||||
/** |
||||
* 查询审核列表列表 |
||||
* |
||||
* @param paramsObject 对象 |
||||
* @param callBack 回调 |
||||
*/ |
||||
public getApproveList(paramsObject: object, callBack) { |
||||
this.http.get(environment.baseUrl + 'audit/getApproveList?' + this.common.getWhereCondition(paramsObject)).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 根据id查询审核详情 |
||||
* |
||||
* @param approveId 审核id |
||||
* @param callBack 回调 |
||||
*/ |
||||
public getApproveDetail(approveId: number, callBack) { |
||||
this.http.get(environment.baseUrl + 'audit/getApproveDetail?approveId=' + approveId).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
|
||||
} |
Loading…
Reference in new issue