提交修改

pull/1/head
袁野 4 years ago
parent 0a2b69f11a
commit cd2e772c56
  1. 92
      src/app/admin/audit/audit-coupon/audit-coupon.component.html
  2. 0
      src/app/admin/audit/audit-coupon/audit-coupon.component.scss
  3. 84
      src/app/admin/audit/audit-coupon/audit-coupon.component.ts
  4. 14
      src/app/admin/audit/audit-routing.module.ts
  5. 26
      src/app/admin/audit/audit.module.ts
  6. 25
      src/app/admin/coupon/coupon-detail/coupon-detail.component.spec.ts
  7. 4
      src/app/admin/coupon/coupon-list/coupon-list.component.html
  8. 11
      src/app/admin/merchant-store/store-edit/store-edit.component.ts
  9. 2
      src/app/admin/merchant-store/store-list/store-list.component.html
  10. 1
      src/app/admin/merchant-store/store-list/store-list.component.ts
  11. 19
      src/app/app-common.module.ts
  12. 5
      src/app/app-routing.module.ts
  13. 19
      src/app/pipes/audit-status.pipe.ts
  14. 14
      src/app/pipes/audit-type.pipe.ts
  15. 2
      src/app/pipes/index.ts
  16. 40
      src/app/services/audit.service.ts
  17. 2
      src/app/services/icon.service.ts

@ -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();
});
});

@ -103,11 +103,12 @@
<th nzWidth="80px">卡券名称</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="120px" nzRight="0px">操作</th>
<th nzWidth="150px" nzRight="0px">操作</th>
</tr>
</thead>
<tbody>
@ -117,6 +118,7 @@
<td>{{data.couponName}}</td>
<td>¥{{data.couponPrice}}</td>
<td>¥{{data.salesPrice}}</td>
<td>{{data.stockCount}}</td>
<td>{{data.couponType === 1 ? '内部卷' : '外部卷'}}</td>
<td>{{data.status | couponStatus}}</td>
<td>{{data.salesEndTime | date: 'yyyy-MM-dd HH:mm'}}</td>

@ -1,4 +1,4 @@
import { Component, OnInit } from '@angular/core';
import {Component, OnInit} from '@angular/core';
import {FormBuilder, FormGroup, Validators} from '@angular/forms';
import {environment} from '../../../../environments/environment';
import {MerchantService} from '../../../services/merchant.service';
@ -25,6 +25,7 @@ export class StoreEditComponent implements OnInit {
logoFile = [];
WEB_SERVE_URL = environment.baseUrl;
previewVisible = false;
constructor(
private fb: FormBuilder,
private merchantStore: MerchantStoreService,
@ -40,7 +41,7 @@ export class StoreEditComponent implements OnInit {
this.id = queryParams.storeId;
this.getDetails(queryParams.storeId);
} else {
this.getMap ();
this.getMap();
}
});
this.validateForm = this.fb.group({
@ -53,6 +54,7 @@ export class StoreEditComponent implements OnInit {
longitude: [106.565428, [Validators.required]],
status: [null],
companyId: [null],
regionId: [null],
merchantId: [null],
createTime: [null],
secUser: {},
@ -120,7 +122,7 @@ export class StoreEditComponent implements OnInit {
data['return_data'].telephone = data['return_data'].secUser.loginName;
data['return_data'].password = data['return_data'].secUser.password;
this.validateForm.patchValue(data['return_data']);
this.getMap ();
this.getMap();
} else {
this.message.create('error', data['return_msg']);
}
@ -155,13 +157,16 @@ export class StoreEditComponent implements OnInit {
placeSearch.setCity(e.poi.adcode);
placeSearch.search(e.poi.name); // 关键字查询查询
}
const positionPicker = new PositionPicker({
mode: 'dragMap',
map: map
});
positionPicker.on('success', positionResult => {
console.log(positionResult);
positionResult['latitude'] = positionResult.position.lat;
positionResult['longitude'] = positionResult.position.lng;
positionResult['regionId'] = positionResult.regeocode.addressComponent.adcode;
this.validateForm.patchValue(positionResult);
});
positionPicker.on('fail', positionResult => {

@ -60,6 +60,7 @@
<thead nzSingleSort>
<tr>
<th nzWidth="50px">编号</th>
<th nzWidth="80px">所属地区</th>
<th nzWidth="80px">门店编号</th>
<th nzWidth="80px">门店名称</th>
<th nzWidth="100px">门店电话</th>
@ -70,6 +71,7 @@
<tbody>
<tr *ngFor="let data of ajaxTable.data; let i = index">
<td>{{i+1}}</td>
<td>{{data.regionName}}</td>
<td>{{data.storeKey}}</td>
<td>{{data.storeName}}</td>
<td>{{data.telephone}}</td>

@ -1,6 +1,5 @@
import { Component, OnInit } from '@angular/core';
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 {ActivatedRoute, Router} from '@angular/router';

@ -9,13 +9,15 @@ import {NgZorroAntdModule} from 'ng-zorro-antd';
import {NgxNeditorModule} from '@notadd/ngx-neditor';
// 管道
import {TimesPipe , TextareaPipe} from './pipes';
import { SystemPipe } from './pipes/system.pipe';
import { CouponStatusPipe } from './pipes/coupon-status.pipe';
import { CouponCodePipe } from './pipes/coupon-code.pipe';
import {
TimesPipe,
TextareaPipe,
SystemPipe,
CouponStatusPipe,
CouponCodePipe,
AuditTypePipe,
AuditStatusPipe
} from './pipes';
const PIPES = [
TimesPipe,
@ -23,7 +25,8 @@ const PIPES = [
SystemPipe,
CouponStatusPipe,
CouponCodePipe,
AuditTypePipe,
AuditStatusPipe,
];

@ -46,6 +46,11 @@ const routes: Routes = [
loadChildren: () => import('./admin/company/company.module').then(m => m.CompanyModule),
canActivate: [InitGuardService]
},
{
path: 'audit',
loadChildren: () => import('./admin/audit/audit.module').then(m => m.AuditModule),
canActivate: [InitGuardService]
},
{
path: 'system',
loadChildren: () => import('./admin/system/system.module').then(m => m.SystemModule),

@ -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 '卡券上架审批';
}
}
}

@ -3,3 +3,5 @@ export * from './commons/textarea.pipe';
export * from './system.pipe';
export * from './coupon-status.pipe';
export * from './coupon-code.pipe';
export * from './audit-status.pipe';
export * from './audit-type.pipe';

@ -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);
});
}
}

@ -12,7 +12,7 @@ export class IconService {
constructor(private iconService: NzIconService) {
this.iconService.fetchFromIconfont({
scriptUrl: 'https://at.alicdn.com/t/font_2424521_2fwfzlplp0d.js'
scriptUrl: 'https://at.alicdn.com/t/font_2424521_5v9iqxejc8h.js'
});
}
}

Loading…
Cancel
Save