提交商户管理

pull/1/head
袁野 4 years ago
parent 391576c0ec
commit e1ba3b8079
  1. 1
      src/app/admin/merchant/merchant-detail/merchant-detail.component.html
  2. 0
      src/app/admin/merchant/merchant-detail/merchant-detail.component.scss
  3. 25
      src/app/admin/merchant/merchant-detail/merchant-detail.component.spec.ts
  4. 15
      src/app/admin/merchant/merchant-detail/merchant-detail.component.ts
  5. 132
      src/app/admin/merchant/merchant-edit/merchant-edit.component.html
  6. 6
      src/app/admin/merchant/merchant-edit/merchant-edit.component.scss
  7. 133
      src/app/admin/merchant/merchant-edit/merchant-edit.component.ts
  8. 109
      src/app/admin/merchant/merchant-list/merchant-list.component.html
  9. 4
      src/app/admin/merchant/merchant-list/merchant-list.component.scss
  10. 94
      src/app/admin/merchant/merchant-list/merchant-list.component.ts
  11. 7
      src/app/admin/merchant/merchant-routing.module.ts
  12. 16
      src/app/admin/merchant/merchant.module.ts
  13. 11
      src/app/admin/user/user-list/user-list.component.html
  14. 3
      src/app/admin/user/user-list/user-list.component.ts
  15. 5
      src/app/app-routing.module.ts
  16. 53
      src/app/services/merchant.service.ts
  17. 13
      src/styles.scss

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { MerchantDetailComponent } from './merchant-detail.component';
describe('MerchantDetailComponent', () => {
let component: MerchantDetailComponent;
let fixture: ComponentFixture<MerchantDetailComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ MerchantDetailComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(MerchantDetailComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-merchant-detail',
templateUrl: './merchant-detail.component.html',
styleUrls: ['./merchant-detail.component.scss']
})
export class MerchantDetailComponent implements OnInit {
constructor() { }
ngOnInit(): void {
}
}

@ -0,0 +1,132 @@
<!-- start 面包屑 -->
<nz-breadcrumb>
<nz-breadcrumb-item>
<a (click)="getBack()">商户管理</a>
</nz-breadcrumb-item>
<nz-breadcrumb-item>
编辑商户
</nz-breadcrumb-item>
</nz-breadcrumb>
<!-- end 面包屑 -->
<nz-content class="inner-content">
<form nz-form [formGroup]="validateForm" class="ant-advanced-search-form">
<div nz-row [nzGutter]="24">
<div nz-col [nzSpan]="8">
<nz-form-item>
<nz-form-label [nzFor]="'loginTelephone'" nzRequired>登录手机号</nz-form-label>
<nz-form-control nzErrorTip="请输入登录手机号!">
<input nz-input placeholder="请输入登录手机号..." [formControlName]="'loginTelephone'" id="'loginTelephone'" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="8">
<nz-form-item>
<nz-form-label [nzFor]="'password'" nzRequired>登录密码</nz-form-label>
<nz-form-control nzErrorTip="请输入登录密码!">
<nz-input-group [nzSuffix]="suffixTemplate">
<input [type]="passwordVisible ? 'text' : 'password'" nz-input placeholder="请输入登录密码..." [formControlName]="'password'" id="'password'" />
</nz-input-group>
<ng-template #suffixTemplate>
<i nz-icon [nzType]="passwordVisible ? 'eye-invisible' : 'eye'" (click)="passwordVisible = !passwordVisible"></i>
</ng-template>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="8">
<nz-form-item>
<nz-form-label [nzFor]="'merchantKey'" nzRequired>商户编号</nz-form-label>
<nz-form-control nzErrorTip="请输入商户编号!">
<input nz-input placeholder="请输入商户编号..." [formControlName]="'merchantKey'" id="'merchantKey'" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="8">
<nz-form-item>
<nz-form-label [nzFor]="'merchantName'" nzRequired>商户名称</nz-form-label>
<nz-form-control nzErrorTip="请输入商户名称!">
<input nz-input placeholder="请输入商户名称..." [formControlName]="'merchantName'" id="'merchantName'" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="8">
<nz-form-item>
<nz-form-label [nzFor]="'telephone'" nzRequired>联系电话</nz-form-label>
<nz-form-control nzErrorTip="请输入联系电话!">
<input nz-input placeholder="请输入联系电话..." [formControlName]="'telephone'" id="'telephone'" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="8">
<nz-form-item>
<nz-form-label [nzFor]="'address'" nzRequired>商户地址</nz-form-label>
<nz-form-control nzErrorTip="请输入商户地址!">
<input nz-input placeholder="请输入商户地址..." [formControlName]="'address'" id="'address'" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="8">
<nz-form-item>
<nz-form-label [nzFor]="'bankName'" >银行名称</nz-form-label>
<nz-form-control nzErrorTip="请输入银行名称!">
<input nz-input placeholder="请输入银行名称..." [formControlName]="'bankName'" id="'bankName'" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="8">
<nz-form-item>
<nz-form-label [nzFor]="'bankAccount'" >银行账号</nz-form-label>
<nz-form-control nzErrorTip="请输入银行账号!">
<input nz-input placeholder="请输入银行账号..." [formControlName]="'bankAccount'" id="'bankAccount'" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="8">
<nz-form-item>
<nz-form-label [nzFor]="'bankHolder'" >开户人</nz-form-label>
<nz-form-control nzErrorTip="请输入开户人!">
<input nz-input placeholder="请输入开户人..." [formControlName]="'bankHolder'" id="'bankHolder'" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="16">
<nz-form-item>
<nz-form-label>商户LOGO</nz-form-label>
<nz-form-control>
<nz-upload
nzAction="{{WEB_SERVE_URL}}/fileUpload/uploadfile"
nzListType="picture-card"
[(nzFileList)]="logoFile"
[nzShowButton]="logoFile.length < 1"
[nzPreview]="handlePreview"
>
<i nz-icon nzType="plus"></i>
<div class="ant-upload-text">上传LOGO</div>
</nz-upload>
<nz-modal [nzVisible]="previewVisible" [nzContent]="modalContent" [nzFooter]="null" (nzOnCancel)="previewVisible = false">
<ng-template #modalContent>
<img [src]="previewImage" [ngStyle]="{ width: '100%' }" />
</ng-template>
</nz-modal>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="16">
<nz-form-item>
<nz-form-label>商户简介</nz-form-label>
<nz-form-control>
<textarea formControlName="merchantDesc" nz-input rows="2" placeholder="请输入商户简介"></textarea>
</nz-form-control>
</nz-form-item>
</div>
</div>
<div nz-row>
<div nz-col [nzSpan]="24" class="search-area">
<button nz-button (click)="resetForm()">重置</button>
<button nz-button [nzType]="'primary'" (click)="getSave()">提交</button>
</div>
</div>
</form>
</nz-content>

@ -0,0 +1,6 @@
button {
margin-left: 8px;
}
:host ::ng-deep .ant-upload {
background-color: #ffffff;
}

@ -0,0 +1,133 @@
import { Component, OnInit } from '@angular/core';
import {FormBuilder, FormGroup, Validators} from '@angular/forms';
import {MerchantService} from '../../../services/merchant.service';
import {NzMessageService, NzUploadFile} from 'ng-zorro-antd';
import {ActivatedRoute} from '@angular/router';
import {ValidatorsService} from '../../../services/validators.service';
import {environment} from '../../../../environments/environment';
function getBase64(file: File): Promise<string | ArrayBuffer | null> {
return new Promise((resolve, reject) => {
const reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = () => resolve(reader.result);
reader.onerror = error => reject(error);
});
}
@Component({
selector: 'app-merchant-edit',
templateUrl: './merchant-edit.component.html',
styleUrls: ['./merchant-edit.component.scss']
})
export class MerchantEditComponent implements OnInit {
validateForm!: FormGroup;
data: any;
editFlag = false;
id: number;
passwordVisible = false;
logoFile = [];
WEB_SERVE_URL = environment.baseUrl;
previewImage: string | undefined = '';
previewVisible = false;
constructor(
private fb: FormBuilder,
private merchant: MerchantService,
private message: NzMessageService, // 信息提示
private activatedRoute: ActivatedRoute,
) { }
ngOnInit(): void {
this.activatedRoute.queryParams.subscribe(queryParams => {
this.editFlag = true;
if (queryParams.merchantId != null ) {
this.id = queryParams.merchantId;
this.getDetails(queryParams.merchantId);
}
});
this.validateForm = this.fb.group({
loginTelephone: [null, [Validators.required, ValidatorsService.mobile]],
password: [null, [Validators.required, ValidatorsService.pwdLength(6 , 12)]],
merchantKey: [null, [Validators.required, ValidatorsService.maxLength(10)]],
merchantName: [null, [Validators.required, ValidatorsService.pwdLength(2 , 12)]],
telephone: [null, [Validators.required]],
address: [null, [Validators.required]],
bankName: [null],
bankAccount: [null],
bankHolder: [null],
merchantDesc: [null],
secUser: {},
});
}
// 返回
getBack() {
history.back();
}
// 重置
public resetForm(): void {
this.validateForm.reset();
}
// 课程保存
public getSave(): void {
// tslint:disable-next-line:forin
for (const i in this.validateForm.controls) {
this.validateForm.controls[i].markAsDirty();
this.validateForm.controls[i].updateValueAndValidity();
// if (this.validateForm.controls[i].errors != null) {
// this.message.error('必填项不能为空');
// return;
// }
}
this.validateForm.value['secUser']['telephone'] = this.validateForm.value.loginTelephone;
this.validateForm.value['secUser']['password'] = this.validateForm.value.password;
if (this.logoFile.length !== 0) {
this.validateForm.value.merchantLogo = this.logoFile[0]['response']['return_data'][0];
}
if (this.editFlag) {
// this.lessonsService.getUpDataLesson(this.lessonData, data => {
// if (data['return_code'] === '000000') {
// this.returnData.emit(this.lessonData);
// } else {
// this.message.create('error', '修改失败');
// }
// });
} else {
this.merchant.insertMerchant(this.validateForm.value, data => {
console.log(data);
if (data['return_code'] === '000000') {
this.getBack();
this.message.success('添加成功');
} else {
this.message.create('error', '保存失败');
}
});
}
}
// 图片查看
handlePreview = async (file: NzUploadFile) => {
if (!file.url && !file.preview) {
// tslint:disable-next-line:no-non-null-assertion
file.preview = await getBase64(file.originFileObj!);
}
this.previewImage = file.url || file.preview;
this.previewVisible = true;
}
public getDetails(id) {
this.merchant.getMerchantById(id, data => {
if (data['return_code'] === '000000') {
console.log(data);
} else {
this.message.create('error', data['return_msg']);
}
});
}
}

@ -0,0 +1,109 @@
<!-- 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="{{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 ><i nz-icon [nzIconfont]="'icon-dingdanxiangqing_icon'" nz-tooltip="商户详情"></i></a>
<nz-divider nzType="vertical"></nz-divider>
<a (click)='getForbiddenUser(data.id , data.status)'><i nz-icon nzType="{{data.status === 1 ? 'stop': 'check-circle'}}" nzTheme="outline" nz-tooltip="{{data.status === 1 ? '禁用': '启用'}}"></i></a>
</td>
</tbody>
</nz-table>
</div>

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

@ -0,0 +1,94 @@
import { Component, OnInit } from '@angular/core';
import {FormBuilder, FormGroup} from '@angular/forms';
import {UserService} from '../../../services/user.service';
import {IconService} from '../../../services/icon.service';
import {NzMessageService} from 'ng-zorro-antd';
import {CommonsService} from '../../../services/commons.service';
import {MerchantService} from '../../../services/merchant.service';
import {Router} from '@angular/router';
@Component({
selector: 'app-merchant-list',
templateUrl: './merchant-list.component.html',
styleUrls: ['./merchant-list.component.scss']
})
export class MerchantListComponent implements OnInit {
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 getForbiddenUser(id, status: any): void {
const message = (status === 1 ? '是否禁用当前用户' : '是否启用当前用户');
this.common.showConfirm(message, data => {
if (data) {
// this.user.forbiddenUser(id, dataUser => {
// this.getRequest(false , this.searchForm.value);
// });
}
});
}
// 修改
public getEdit(id: number): void {
this.router.navigate(['/admin/merchant/merchant-list'], {
queryParams: {
merchantId: id
}
}).then(r => console.log(r));
}
}

@ -1,8 +1,13 @@
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router'; import { Routes, RouterModule } from '@angular/router';
import {MerchantListComponent} from './merchant-list/merchant-list.component';
import {MerchantEditComponent} from './merchant-edit/merchant-edit.component';
const routes: Routes = []; const routes: Routes = [
{ path: 'merchant-list', component: MerchantListComponent },
{ path: 'merchant-edit', component: MerchantEditComponent },
];
@NgModule({ @NgModule({
imports: [RouterModule.forChild(routes)], imports: [RouterModule.forChild(routes)],

@ -2,13 +2,25 @@ import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
import { MerchantRoutingModule } from './merchant-routing.module'; import { MerchantRoutingModule } from './merchant-routing.module';
import { MerchantListComponent } from './merchant-list/merchant-list.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 { MerchantEditComponent } from './merchant-edit/merchant-edit.component';
import { MerchantDetailComponent } from './merchant-detail/merchant-detail.component';
@NgModule({ @NgModule({
declarations: [], declarations: [MerchantListComponent, MerchantEditComponent, MerchantDetailComponent],
imports: [ imports: [
CommonModule, CommonModule,
MerchantRoutingModule MerchantRoutingModule,
NgZorroAntdModule,
SeparateModule,
ReactiveFormsModule,
FormsModule,
BreadcrumbModule
] ]
}) })
export class MerchantModule { } export class MerchantModule { }

@ -6,7 +6,7 @@
<div class="inner-content"> <div class="inner-content">
<form nz-form [formGroup]="searchForm" (ngSubmit)="getRequest(true , searchForm.value)"> <form nz-form [formGroup]="searchForm" (ngSubmit)="getRequest(true , searchForm.value)">
<div nz-row> <div nz-row>
<div nz-col nzSpan="8"> <div nz-col nzSpan="6">
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="6">用户名称</nz-form-label> <nz-form-label [nzSpan]="6">用户名称</nz-form-label>
<nz-form-control [nzSpan]="16"> <nz-form-control [nzSpan]="16">
@ -14,7 +14,7 @@
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
</div> </div>
<div nz-col nzSpan="8"> <div nz-col nzSpan="6">
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="6">电话</nz-form-label> <nz-form-label [nzSpan]="6">电话</nz-form-label>
<nz-form-control [nzSpan]="16"> <nz-form-control [nzSpan]="16">
@ -22,7 +22,7 @@
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
</div> </div>
<div nz-col nzSpan="8"> <div nz-col nzSpan="6">
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="6">用户状态</nz-form-label> <nz-form-label [nzSpan]="6">用户状态</nz-form-label>
<nz-form-control [nzSpan]="16"> <nz-form-control [nzSpan]="16">
@ -33,7 +33,7 @@
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
</div> </div>
<div nz-col nzSpan="8"> <div nz-col nzSpan="6">
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="6">注册时间</nz-form-label> <nz-form-label [nzSpan]="6">注册时间</nz-form-label>
<nz-form-control [nzSpan]="16"> <nz-form-control [nzSpan]="16">
@ -56,6 +56,7 @@
<div class="inner-content"> <div class="inner-content">
<span>共计 {{total}} 条数据</span> <span>共计 {{total}} 条数据</span>
<nz-table <nz-table
class="table"
#ajaxTable #ajaxTable
nzShowSizeChanger nzShowSizeChanger
[nzFrontPagination]="false" [nzFrontPagination]="false"
@ -76,7 +77,7 @@
<th nzWidth="50px">性别</th> <th nzWidth="50px">性别</th>
<th nzWidth="50px">金币数量</th> <th nzWidth="50px">金币数量</th>
<th nzWidth="100px">注册时间</th> <th nzWidth="100px">注册时间</th>
<th nzWidth="50px" [nzSortFn]="true">状态</th> <th nzWidth="50px">状态</th>
<th nzWidth="80px" nzRight="0px">操作</th> <th nzWidth="80px" nzRight="0px">操作</th>
</tr> </tr>
</thead> </thead>

@ -50,6 +50,7 @@ export class UserListComponent implements OnInit {
whereObject['regTimeStart'] = whereObject['regTime'][0].getTime(); whereObject['regTimeStart'] = whereObject['regTime'][0].getTime();
whereObject['regTimeEnd'] = whereObject['regTime'][1].getTime(); whereObject['regTimeEnd'] = whereObject['regTime'][1].getTime();
} }
this.loading = false; this.loading = false;
if (reset) { if (reset) {
this.pageNum = 1; this.pageNum = 1;
@ -57,7 +58,6 @@ export class UserListComponent implements OnInit {
whereObject['pageNum'] = this.pageNum; whereObject['pageNum'] = this.pageNum;
whereObject['pageSize'] = this.pageSize; whereObject['pageSize'] = this.pageSize;
this.user.getListUser(whereObject, data => { this.user.getListUser(whereObject, data => {
console.log(data);
if (data['return_code'] === '000000') { if (data['return_code'] === '000000') {
this.requestData = data['return_data'].list; this.requestData = data['return_data'].list;
this.total = data['return_data'].total; this.total = data['return_data'].total;
@ -78,7 +78,6 @@ export class UserListComponent implements OnInit {
this.common.showConfirm(message, data => { this.common.showConfirm(message, data => {
if (data) { if (data) {
this.user.forbiddenUser(id, dataUser => { this.user.forbiddenUser(id, dataUser => {
console.log(dataUser);
this.getRequest(false , this.searchForm.value); this.getRequest(false , this.searchForm.value);
}); });
} }

@ -26,6 +26,11 @@ const routes: Routes = [
loadChildren: () => import('./admin/user/user.module').then(m => m.UserModule), loadChildren: () => import('./admin/user/user.module').then(m => m.UserModule),
canActivate: [InitGuardService] canActivate: [InitGuardService]
}, },
{
path: 'merchant',
loadChildren: () => import('./admin/merchant/merchant.module').then(m => m.MerchantModule),
canActivate: [InitGuardService]
},
{ {
path: 'system', path: 'system',
loadChildren: () => import('./admin/system/system.module').then(m => m.SystemModule), loadChildren: () => import('./admin/system/system.module').then(m => m.SystemModule),

@ -0,0 +1,53 @@
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 MerchantService {
constructor(
private http: HttpClient,
private common: CommonsService
) { }
/**
*
*
* @param paramsObject
* @param callBack
*/
public getMerchantList(paramsObject: object, callBack) {
this.http.get(environment.baseUrl + 'highMerchant/getMerchantList?' + this.common.getWhereCondition(paramsObject)).subscribe(data => {
callBack(data);
});
}
/**
*
*
* @param params
* @param callBack
* @return data
*/
public insertMerchant(params: object, callBack) {
this.http.post(environment.baseUrl + 'highMerchant/insertMerchant', params).subscribe(data => {
callBack(data);
});
}
/**
* id查询详情
*
* @param merchantId id
* @param callBack
*/
public getMerchantById(merchantId: number, callBack) {
this.http.get(environment.baseUrl + 'highMerchant/getMerchantById?id=' + merchantId).subscribe(data => {
callBack(data);
});
}
}

@ -40,3 +40,16 @@
.operating-button button { .operating-button button {
margin-bottom: 15px; margin-bottom: 15px;
} }
.table {
margin-top: 20px;
}
.search-area {
text-align: center;
}
.ant-advanced-search-form {
padding: 24px;
background: #fbfbfb;
border: 1px solid #d9d9d9;
border-radius: 6px;
}

Loading…
Cancel
Save