袁野 6 months ago
parent 9564cccf31
commit 48e44cf44f
  1. 70
      src/app/pages/index/index/index.component.html
  2. 7
      src/app/pages/index/index/index.component.ts
  3. 89
      src/app/pages/merchant/mer-list/mer-list.component.html
  4. 124
      src/app/pages/merchant/mer-list/mer-list.component.ts
  5. 22
      src/app/pipes/mer/payPlatform.pipe.ts
  6. 26
      src/app/services/merchant/mer.service.ts
  7. BIN
      src/assets/home/home.png
  8. 16
      src/environments/environment.ts

@ -1,64 +1,6 @@
<p>首页</p> <nz-result
<p>首页</p> [nzIcon]="'smile-twotone'"
<p>首页</p> nzTitle="欢迎使用普惠GO管理后台!"
<p>首页</p> >
<p>首页</p>
<p>首页</p> </nz-result>
<p>首页</p>
<p>首页</p>
<p>首页</p>
<p>首页</p>
<p>首页</p>
<p>首页</p>
<p>首页</p>
<p>首页</p>
<p>首页</p>
<p>首页</p>
<p>首页</p>
<p>首页</p>
<p>首页</p>
<p>首页</p>
<p>首页</p>
<p>首页</p>
<p>首页</p>
<p>首页</p>
<p>首页</p>
<p>首页</p>
<p>首页</p>
<p>首页</p>
<p>首页</p>
<p>首页</p>
<p>首页</p>
<p>首页</p>
<p>首页</p>
<p>首页</p>
<p>首页</p>
<p>首页</p>
<p>首页</p>
<p>首页</p>
<p>首页</p>
<p>首页</p>
<p>首页</p>
<p>首页</p>
<p>首页</p>
<p>首页</p>
<p>首页</p>
<p>首页</p>
<p>首页</p>
<p>首页</p>
<p>首页</p>
<p>首页</p>
<p>首页</p>
<p>首页</p>
<p>首页</p>
<p>首页</p>
<p>首页</p>
<p>首页</p>
<p>首页</p>
<p>首页</p>
<p>首页</p>
<p>首页</p>
<p>首页</p>
<p>首页</p>
<p>首页</p>
<p>首页</p>

@ -1,6 +1,7 @@
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import {NzTabComponent, NzTabSetComponent} from "ng-zorro-antd/tabs"; import {NzTabComponent, NzTabSetComponent} from "ng-zorro-antd/tabs";
import {NgForOf} from "@angular/common"; import {NgForOf, NgOptimizedImage} from "@angular/common";
import {NzResultComponent} from "ng-zorro-antd/result";
@Component({ @Component({
selector: 'app-index', selector: 'app-index',
@ -8,7 +9,9 @@ import {NgForOf} from "@angular/common";
imports: [ imports: [
NzTabSetComponent, NzTabSetComponent,
NzTabComponent, NzTabComponent,
NgForOf NgForOf,
NgOptimizedImage,
NzResultComponent
], ],
templateUrl: './index.component.html', templateUrl: './index.component.html',
styleUrl: './index.component.less' styleUrl: './index.component.less'

@ -84,6 +84,7 @@
<nz-dropdown-menu #menu="nzDropdownMenu"> <nz-dropdown-menu #menu="nzDropdownMenu">
<ul nz-menu nzSelectable> <ul nz-menu nzSelectable>
<li nz-menu-item><a (click)="showResetPwd(data.merNo)">密码重置</a></li> <li nz-menu-item><a (click)="showResetPwd(data.merNo)">密码重置</a></li>
<li nz-menu-item><a (click)="showPayList(data)">支付参数列表</a></li>
</ul> </ul>
</nz-dropdown-menu> </nz-dropdown-menu>
</td> </td>
@ -194,3 +195,91 @@
</form> </form>
</ng-container> </ng-container>
</nz-modal> </nz-modal>
<nz-modal [nzWidth]="1400" [(nzVisible)]="isVisiblePay" nzTitle="{{merPayConfig?.merName}}-规格列表" [nzFooter]="null" (nzOnCancel)="isVisiblePay= false">
<!--列表-->
<ng-container *nzModalContent>
<button nz-button (click)="showEdit()" nzType="primary">创建</button>
<button nz-button [nzType]="'default'" (click)="getPayList()">查询</button>
<br />
<br />
<nz-table [nzBordered]="true" #basicTable [nzData]="nodesPayConfig">
<thead>
<tr>
<th>支付平台</th>
<th>支付参数</th>
<th>创建时间</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of basicTable.data">
<td>{{data.payPlatform | payPlatform}}</td>
<td>
<span *ngIf="data.payPlatform == 1" nz-typography>
<p nz-typography nzCopyable nzCopyText="{{ data.payMerNo }}">惠支付商户号:{{ data.payMerNo }}</p>
<p nz-typography nzCopyable nzCopyText="{{ data.payMerKey }}">惠支付商户key:{{ data.payMerKey }}</p>
</span>
<span *ngIf="data.payPlatform == 2" nz-typography>
<p nz-typography nzCopyable nzCopyText="{{ data.hltInstCode }}">汇联通终端号:{{ data.hltInstCode }}</p>
<p nz-typography nzCopyable nzCopyText="{{ data.hltMerNo }}">汇联通商户号:{{ data.hltMerNo }}</p>
</span>
</td>
<td>{{ data.createTime | date: 'yyyy-MM-dd HH:mm'}}</td>
<td>
<a (click)="showEdit(data)">修改</a>
<nz-divider nzType="vertical"></nz-divider>
<a nz-popconfirm nzPopconfirmTitle="是否确认删除?" (nzOnConfirm)="delete(data.id)">删除</a>
</td>
</tr>
</tbody>
</nz-table>
</ng-container>
</nz-modal>
<!--添加弹出框-->
<nz-modal [(nzVisible)]="isVisibleEdit" [nzMaskClosable] = false nzTitle="编辑支付参数" (nzOnCancel)="isVisibleEdit = false" (nzOnOk)="handleEdit()">
<ng-container *nzModalContent>
<form nz-form [formGroup]="editPayForm">
<nz-form-item >
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>类型</nz-form-label>
<nz-form-control [nzSm]="14" [nzXs]="24" nzErrorTip="请选择类型!">
<nz-select nzSize="large" nzShowSearch nzAllowClear nzPlaceHolder="请选择" formControlName="payPlatform" (ngModelChange)="payTypeChange($event)">
<nz-option nzLabel="惠支付" nzValue="1"></nz-option>
<nz-option nzLabel="工会卡" nzValue="2"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
<nz-form-item *ngIf="editPayForm.value['payPlatform'] == '1'">
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>惠支付商户号</nz-form-label>
<nz-form-control [nzSm]="14" [nzXs]="24" nzErrorTip="请输入!">
<input nzSize="large" nz-input formControlName="payMerNo" placeholder="请输入" />
</nz-form-control>
</nz-form-item>
<nz-form-item *ngIf="editPayForm.value['payPlatform'] == '1'">
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>惠支付商户key</nz-form-label>
<nz-form-control [nzSm]="14" [nzXs]="24" nzErrorTip="请输入!">
<input nzSize="large" nz-input formControlName="payMerKey" placeholder="请输入" />
</nz-form-control>
</nz-form-item>
<nz-form-item *ngIf="editPayForm.value['payPlatform'] == '2'">
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>汇联通终端号</nz-form-label>
<nz-form-control [nzSm]="14" [nzXs]="24" nzErrorTip="请输入!">
<input nzSize="large" nz-input formControlName="hltInstCode" placeholder="请输入" />
</nz-form-control>
</nz-form-item>
<nz-form-item *ngIf="editPayForm.value['payPlatform'] == '2'">
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>汇联通商户号</nz-form-label>
<nz-form-control [nzSm]="14" [nzXs]="24" nzErrorTip="请输入!">
<input nzSize="large" nz-input formControlName="hltMerNo" placeholder="请输入" />
</nz-form-control>
</nz-form-item>
</form>
</ng-container>
</nz-modal>

@ -29,6 +29,10 @@ import {NzAvatarModule} from "ng-zorro-antd/avatar";
import {MerService} from "../../../services/merchant/mer.service"; import {MerService} from "../../../services/merchant/mer.service";
import {RoleService} from "../../../services/role/role.service"; import {RoleService} from "../../../services/role/role.service";
import {NzImageModule} from "ng-zorro-antd/image"; import {NzImageModule} from "ng-zorro-antd/image";
import {GoodsTypeData} from "../../../model/goods.interface";
import {NzPopconfirmDirective} from "ng-zorro-antd/popconfirm";
import {NzTypographyComponent} from "ng-zorro-antd/typography";
import {payPlatform} from "../../../pipes/mer/payPlatform.pipe";
@Component({ @Component({
selector: 'app-mer-list', selector: 'app-mer-list',
@ -70,7 +74,10 @@ import {NzImageModule} from "ng-zorro-antd/image";
NzDescriptionsModule, NzDescriptionsModule,
NzUploadComponent, NzUploadComponent,
NzAvatarModule, NzAvatarModule,
NzImageModule NzImageModule,
NzPopconfirmDirective,
NzTypographyComponent,
payPlatform
], ],
templateUrl: './mer-list.component.html', templateUrl: './mer-list.component.html',
styleUrl: './mer-list.component.less' styleUrl: './mer-list.component.less'
@ -97,6 +104,13 @@ export class MerListComponent {
uploadLoading = false; uploadLoading = false;
updateMerVisible = false; updateMerVisible = false;
updateMerForm: FormGroup; updateMerForm: FormGroup;
merPayConfig:any
// 编辑商品规格弹出框
isVisiblePay = false;
nodesPayConfig: any;
editPayForm: FormGroup;
// 编辑弹出框
isVisibleEdit = false;
constructor(private fb: NonNullableFormBuilder, constructor(private fb: NonNullableFormBuilder,
private merService: MerService, private merService: MerService,
@ -123,6 +137,17 @@ export class MerListComponent {
address: [''], address: [''],
}); });
// 初始化
this.editPayForm = this.fb.group({
merId: [''],
payPlatform: ['' , [Validators.required]],
payMerNo: [''],
payMerKey: [''],
hltInstCode: [''],
hltMerNo: [''],
id: [null],
});
// 获取角色数据 // 获取角色数据
this.roleService.queryAllRole((data: any) => { this.roleService.queryAllRole((data: any) => {
this.roleData = data['return_data']; this.roleData = data['return_data'];
@ -315,4 +340,101 @@ export class MerListComponent {
}); });
}; };
// 弹出
showPayList(data: any): void {
console.log(data);
this.merPayConfig = data;
this.isVisiblePay = true;
this.getPayList();
}
// 查询规格列表
getPayList(): void {
let params = {
merNo: this.merPayConfig?.merNo,
time: new Date().getTime()
}
this.merService.queryMerPayConfig(params , (data: any) => {
if (data['return_code'] == '000000') {
this.nodesPayConfig = data['return_data'];
}
});
}
// 唤醒编辑表单
showEdit(item?: GoodsTypeData) {
if (item != null) {
this.editPayForm.patchValue(item);
} else {
this.editPayForm.reset();
}
this.isVisibleEdit = true;
}
// 编辑表单提交
handleEdit(): void {
if (this.editPayForm.valid) {
this.editPayForm.value.merId = this.merPayConfig.id;
this.merService.editPayConfig(this.editPayForm.value , (data: any) => {
if (data['return_code'] === '000000') {
this.message.success("成功!");
this.isVisibleEdit = false;
this.getPayList();
} else {
this.message.error(data['return_msg']);
}
});
} else {
Object.values(this.editPayForm.controls).forEach(control => {
if (control.invalid) {
console.log("control" , control)
control.markAsDirty();
control.updateValueAndValidity({ onlySelf: true });
}
});
}
}
// 删除
delete(id: number): void {
this.merService.delete(id , (data: any) => {
if (data['return_code'] === '000000') {
this.message.success("成功!");
this.getPayList();
} else {
this.message.error(data['return_msg']);
}
});
}
payTypeChange(type: string): void {
// 清除必填
this.editPayForm.controls['payMerNo'].clearValidators();
this.editPayForm.controls['payMerKey'].clearValidators();
this.editPayForm.controls['hltInstCode'].clearValidators();
this.editPayForm.controls['hltMerNo'].clearValidators();
if (type == "1") {
// 增加必填
this.editPayForm.controls['payMerNo'].setValidators(Validators.required);
this.editPayForm.controls['payMerKey'].setValidators(Validators.required);
} else if (type == "2") {
// 增加必填
this.editPayForm.controls['hltInstCode'].setValidators(Validators.required);
this.editPayForm.controls['hltMerNo'].setValidators(Validators.required);
}
this.editPayForm.controls['hltInstCode'].updateValueAndValidity();
this.editPayForm.controls['hltMerNo'].updateValueAndValidity();
this.editPayForm.controls['payMerNo'].updateValueAndValidity();
this.editPayForm.controls['payMerKey'].updateValueAndValidity();
}
} }

@ -0,0 +1,22 @@
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: 'payPlatform',
standalone: true
})
export class payPlatform implements PipeTransform {
transform(value: number): any {
switch (value) {
case 1:
return '惠支付';
case 2:
return '工会卡';
default:
return '未知支付类型'
}
}
}

@ -68,4 +68,30 @@ export class MerService {
callBack(data); callBack(data);
}); });
} }
/**
*
* @param params
* @param callBack
*/
public queryMerPayConfig(params: any, callBack:any) {
params.time = new Date().getTime();
this.http.get(environment.baseUrl + 'mer/queryMerPayConfig?' + ObjectData.objectByString(params)).subscribe(data => {
callBack(data);
});
}
public editPayConfig(params: any, callBack:any) {
params.time = new Date().getTime();
this.http.post(environment.baseUrl + 'mer/editPayConfig', params).subscribe(data => {
callBack(data);
});
}
public delete(id: number, callBack:any) {
this.http.get(environment.baseUrl + 'mer/delete?id=' + id ).subscribe(data => {
callBack(data);
});
}
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 KiB

@ -4,14 +4,14 @@
export const environment = { export const environment = {
production: false, production: false,
baseUrl: 'https://phg.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址) // baseUrl: 'https://phg.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址)
orderUrl: 'https://phg.dctpay.com/order/', // 测试环境服务器地址(请求数据地址) // orderUrl: 'https://phg.dctpay.com/order/', // 测试环境服务器地址(请求数据地址)
userUrl: 'https://phg.dctpay.com/user/', // 测试环境服务器地址(请求数据地址) // userUrl: 'https://phg.dctpay.com/user/', // 测试环境服务器地址(请求数据地址)
imageUrl: 'https://phg.obs.cn-southwest-2.myhuaweicloud.com/', // imageUrl: 'https://phg.obs.cn-southwest-2.myhuaweicloud.com/',
// baseUrl: 'http://localhost:9702/brest/', // 测试环境服务器地址(请求数据地址) baseUrl: 'http://localhost:9702/brest/', // 测试环境服务器地址(请求数据地址)
// orderUrl: 'http://localhost:9703/order/', // 测试环境服务器地址(请求数据地址) orderUrl: 'http://localhost:9703/order/', // 测试环境服务器地址(请求数据地址)
// userUrl: 'http://localhost:9704/user/', // 测试环境服务器地址(请求数据地址) userUrl: 'http://localhost:9704/user/', // 测试环境服务器地址(请求数据地址)
// imageUrl: 'https://phgcs.dctpay.com/filesystem/', imageUrl: 'https://phgcs.dctpay.com/filesystem/',
}; };

Loading…
Cancel
Save