提交代码

dev
胡锐 6 days ago
parent 54f895b577
commit e1ad1bb533
  1. 6
      package-lock.json
  2. 1
      package.json
  3. 129
      src/app/pages/device/device-list/device-list.component.html
  4. 6
      src/app/pages/device/device-list/device-list.component.less
  5. 232
      src/app/pages/device/device-list/device-list.component.ts
  6. 1
      src/app/pages/mer-oil-price/oil-discount/oil-discount.component.html
  7. 0
      src/app/pages/mer-oil-price/oil-discount/oil-discount.component.less
  8. 12
      src/app/pages/mer-oil-price/oil-discount/oil-discount.component.ts
  9. 185
      src/app/pages/mer-oil-price/oil-task/oil-task.component.html
  10. 9
      src/app/pages/mer-oil-price/oil-task/oil-task.component.less
  11. 242
      src/app/pages/mer-oil-price/oil-task/oil-task.component.ts
  12. 186
      src/app/pages/merchant/mer-add/mer-add.component.html
  13. 4
      src/app/pages/merchant/mer-add/mer-add.component.less
  14. 172
      src/app/pages/merchant/mer-add/mer-add.component.ts
  15. 150
      src/app/pages/merchant/mer-chain-brand-amount/mer-chain-brand-amount.component.html
  16. 6
      src/app/pages/merchant/mer-chain-brand-amount/mer-chain-brand-amount.component.less
  17. 247
      src/app/pages/merchant/mer-chain-brand-amount/mer-chain-brand-amount.component.ts
  18. 95
      src/app/pages/merchant/mer-chain-brand-list/mer-chain-brand-list.component.html
  19. 0
      src/app/pages/merchant/mer-chain-brand-list/mer-chain-brand-list.component.less
  20. 197
      src/app/pages/merchant/mer-chain-brand-list/mer-chain-brand-list.component.ts
  21. 231
      src/app/pages/merchant/mer-list/mer-list.component.html
  22. 3
      src/app/pages/merchant/mer-list/mer-list.component.less
  23. 365
      src/app/pages/merchant/mer-list/mer-list.component.ts
  24. 158
      src/app/pages/merchant/merchant-amount-list/merchant-amount-list.component.html
  25. 6
      src/app/pages/merchant/merchant-amount-list/merchant-amount-list.component.less
  26. 247
      src/app/pages/merchant/merchant-amount-list/merchant-amount-list.component.ts
  27. 16
      src/app/pages/merchant/merchant.routes.ts
  28. 1
      src/app/pages/trade/order-oil-list/order-oil-list.component.ts
  29. 73
      src/app/services/device/device.service.ts
  30. 48
      src/app/services/mer-oil-price/oil-discount.service.ts
  31. 49
      src/app/services/mer-oil-price/oil-task.service.ts
  32. 49
      src/app/services/merchant/mer-chain-brand-amount.service.ts
  33. 36
      src/app/services/merchant/mer-chain-brand.service.ts
  34. 73
      src/app/services/merchant/mer.service.ts
  35. 63
      src/app/services/merchant/merchant-account.service.ts
  36. 13266
      src/assets/data/region.json
  37. 1
      src/index.html

6
package-lock.json generated

@ -20,6 +20,7 @@
"@angular/ssr": "^17.0.7",
"express": "^4.18.2",
"ng-zorro-antd": "^17.1.0",
"qqmap": "^1.0.1",
"rxjs": "~7.8.0",
"tslib": "^2.3.0",
"zone.js": "~0.14.2"
@ -9963,6 +9964,11 @@
"node": ">=0.9"
}
},
"node_modules/qqmap": {
"version": "1.0.1",
"resolved": "https://registry.npmmirror.com/qqmap/-/qqmap-1.0.1.tgz",
"integrity": "sha512-fg9WrQj+sB5+gHt4i0TTg9ySB4PxZX8MCX5CRpuNpWBwRuPS58gZP3WkvVrOql2vz2JpYjlxV+52T3H7WLRMOQ=="
},
"node_modules/qs": {
"version": "6.11.0",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz",

@ -23,6 +23,7 @@
"@angular/ssr": "^17.0.7",
"express": "^4.18.2",
"ng-zorro-antd": "^17.1.0",
"qqmap": "^1.0.1",
"rxjs": "~7.8.0",
"tslib": "^2.3.0",
"zone.js": "~0.14.2"

@ -0,0 +1,129 @@
<form nz-form [formGroup]="searchForm" class="search_form" [nzLayout]="'vertical'">
<div nz-row [nzGutter]="24">
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label>设备类型</nz-form-label>
<nz-form-control>
<nz-select formControlName="type" nzAllowClear [nzPlaceHolder]="'请选择'">
<nz-option *ngFor="let item of typeArray" nzValue="{{item.codeValue}}" nzLabel="{{item.codeName}}"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label>设备编号</nz-form-label>
<nz-form-control>
<input nz-input formControlName="deviceSn" placeholder="请输入" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="6" *ngIf="accountType == 1">
<nz-form-item>
<nz-form-label>油站编号</nz-form-label>
<nz-form-control>
<input nz-input formControlName="merNo" placeholder="请输入" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="6" *ngIf="accountType == 1">
<nz-form-item>
<nz-form-label>油站名称</nz-form-label>
<nz-form-control>
<input nz-input formControlName="merName" placeholder="请输入" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label *ngIf="accountType != 1"></nz-form-label>
<nz-form-control>
<button nz-button style="margin-right: 8px" [nzType]="'primary'" (click)="searchFormSubmit()">查询</button>
<button nz-button style="margin-right: 8px" (click)="searchFormReset()">重置</button>
<button nz-button style="margin-right: 8px" [nzType]="'primary'" (click)="showEditDeviceModal(null)">绑定设备</button>
</nz-form-control>
</nz-form-item>
</div>
</div>
</form>
<nz-table #basicTable
[nzScroll]="{ x: '1200px' }"
[nzBordered]="true"
[nzFrontPagination]="false"
[nzShowQuickJumper]="true"
[nzShowTotal]="totalTemplate"
[(nzPageIndex)]="tablePageNum"
(nzPageIndexChange)="queryData()"
nzShowSizeChanger
(nzPageSizeChange)="this.tablePageSize = $event;queryData()"
[nzPageSizeOptions]="[ 10, 20, 30, 50, 100 ]"
[nzTotal]="tableData.total"
[nzData]="tableData.list" >
<thead>
<tr>
<th nzWidth="100px">设备类型</th>
<th nzWidth="100px">设备编号</th>
<th nzWidth="100px">设备key</th>
<th nzWidth="100px">使用油站编号</th>
<th nzWidth="100px">使用油站名称</th>
<th nzWidth="100px">创建时间</th>
<th nzRight nzWidth="70px">操作</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of basicTable.data">
<td>{{data.type | dictionary: 'DEVICE_TYPE'}}</td>
<td>{{data.deviceSn}}</td>
<td>{{data.deviceKey}}</td>
<td>{{data.merNo}}</td>
<td>{{data.merName}}</td>
<td>{{data.createTime | date : 'yyyy-MM-dd HH:mm'}}</td>
<td nzRight>
<a (click)="showEditDeviceModal(data)">修改</a>
<nz-divider nzType="vertical"></nz-divider>
<a (click)="delDevice(data.id)">删除</a>
</td>
</tr>
</tbody>
<ng-template #totalTemplate let-total>总计 {{ total }} 条</ng-template>
</nz-table>
<nz-modal [(nzVisible)]="editDeviceModal"
[nzWidth]="700"
nzTitle="{{this.editDeviceForm.controls['id'].value!=null?'修改':'增加'}}"
[nzFooter]="null"
(nzOnCancel)="closeEditDeviceModal()">
<ng-container *nzModalContent>
<form nz-form [formGroup]="editDeviceForm">
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>设备类型</nz-form-label>
<nz-form-control [nzSm]="14" [nzXs]="24">
<nz-select formControlName="type" nzAllowClear [nzPlaceHolder]="'请选择'">
<nz-option *ngFor="let item of typeArray" nzValue="{{item.codeValue}}" nzLabel="{{item.codeName}}"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>设备编号</nz-form-label>
<nz-form-control [nzSm]="14" [nzXs]="24">
<input nz-input formControlName="deviceSn" placeholder="请输入设备SN号 / 机器码" />
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>设备秘钥</nz-form-label>
<nz-form-control [nzSm]="14" [nzXs]="24">
<input nz-input formControlName="deviceKey" placeholder="请输入设备KEY / 校验码" />
</nz-form-control>
</nz-form-item>
<div nz-flex style="margin-top: 15px" [nzJustify]="'center'">
<button nz-button nzType="primary" (click)="submitData()" class="submit-btn">保存</button>
</div>
</form>
</ng-container>
</nz-modal>

@ -0,0 +1,6 @@
nz-input-number {
width: 100%;
}
.submit-btn {
width: 150px;
}

@ -0,0 +1,232 @@
import { Component } from '@angular/core';
import {DatePipe, NgForOf, NgIf} from "@angular/common";
import {DictionaryPipe} from "../../../pipes/common/dictionary.pipe";
import {FormGroup, FormsModule, NonNullableFormBuilder, ReactiveFormsModule, Validators} from "@angular/forms";
import {NzButtonComponent} from "ng-zorro-antd/button";
import {
NzCellFixedDirective,
NzTableCellDirective,
NzTableComponent, NzTableModule,
NzTbodyComponent, NzTheadComponent,
NzThMeasureDirective, NzTrDirective
} from "ng-zorro-antd/table";
import {NzColDirective, NzRowDirective} from "ng-zorro-antd/grid";
import {NzDividerComponent} from "ng-zorro-antd/divider";
import {NzDropDownADirective, NzDropDownDirective, NzDropdownMenuComponent} from "ng-zorro-antd/dropdown";
import {NzFlexDirective} from "ng-zorro-antd/flex";
import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form";
import {NzIconDirective} from "ng-zorro-antd/icon";
import {NzInputDirective} from "ng-zorro-antd/input";
import {NzInputNumberModule} from "ng-zorro-antd/input-number";
import {NzMenuDirective, NzMenuItemComponent} from "ng-zorro-antd/menu";
import {NzModalModule, NzModalService} from "ng-zorro-antd/modal";
import {DeviceService} from "../../../services/device/device.service";
import {NzMessageService} from "ng-zorro-antd/message";
import {NzOptionComponent, NzSelectComponent} from "ng-zorro-antd/select";
import {NzDescriptionsModule} from "ng-zorro-antd/descriptions";
import {NzUploadComponent} from "ng-zorro-antd/upload";
import {NzAvatarModule} from "ng-zorro-antd/avatar";
import {NzImageModule} from "ng-zorro-antd/image";
import {NzSwitchComponent} from "ng-zorro-antd/switch";
import {NzDatePickerComponent} from "ng-zorro-antd/date-picker";
import {DATA} from "../../../data/login/localStorage.namespace";
import {BrowserStorageService} from "../../../utils/localStorage.service";
@Component({
selector: 'app-device-list',
standalone: true,
imports: [
DatePipe,
DictionaryPipe,
FormsModule,
NgForOf,
NgIf,
NzButtonComponent,
NzCellFixedDirective,
NzColDirective,
NzDividerComponent,
NzDropDownADirective,
NzDropDownDirective,
NzDropdownMenuComponent,
NzFormControlComponent,
NzFormDirective,
NzFormItemComponent,
NzFormLabelComponent,
NzIconDirective,
NzInputDirective,
NzMenuDirective,
NzMenuItemComponent,
NzOptionComponent,
NzRowDirective,
NzSelectComponent,
NzTableCellDirective,
NzTableComponent,
NzTbodyComponent,
NzThMeasureDirective,
NzTheadComponent,
NzTrDirective,
ReactiveFormsModule,
NzTableModule,
NzModalModule,
NzFlexDirective,
NzDescriptionsModule,
NzUploadComponent,
NzAvatarModule,
NzImageModule,
NzSwitchComponent,
NzDatePickerComponent,
NzInputNumberModule
],
templateUrl: './device-list.component.html',
styleUrl: './device-list.component.less'
})
export class DeviceListComponent {
// 表单页数
tablePageNum = 1;
// 每页数量
tablePageSize = 10;
// 表单数据
tableData: any = {
total: 0,
list: [],
};
accountType = null;
// 搜索表单
searchForm: FormGroup;
// 编辑设备表单
editDeviceForm: FormGroup;
// 编辑设备模态框
editDeviceModal = false;
// 油站来源
typeArray = new DictionaryPipe().getDictionaryList('DEVICE_TYPE');
constructor(private fb: NonNullableFormBuilder,
private message: NzMessageService,
private storage: BrowserStorageService,
private deviceService: DeviceService,
private modal: NzModalService) {
this.accountType = this.storage.get(DATA)['account']['objectType'];
// 初始化搜索框
this.searchForm = this.fb.group({
type: [''],
merNo: [''],
merName: [''],
deviceSn: [''],
});
this.editDeviceForm = this.fb.group({
id: [null],
type: [null, [Validators.required]],
merNo: [null],
deviceSn: [null, [Validators.required]],
deviceKey: [null, [Validators.required]],
});
// 查询数据
this.queryData();
}
/**
*
*/
queryData() {
this.searchForm.value.pageNum = this.tablePageNum;
this.searchForm.value.pageSize = this.tablePageSize;
this.searchForm.value.time = new Date().getTime();
this.deviceService.getDeviceList(this.searchForm.value, (data: any) => {
if (data['return_code'] == '000000') {
this.tableData = data['return_data'];
}
});
}
/**
*
*/
searchFormSubmit(): void {
this.tablePageNum = 1;
this.queryData();
}
/**
*
*/
searchFormReset(): void {
this.searchForm.reset();
}
/**
*
* @param deviceId
*/
delDevice(deviceId: number) {
this.modal.confirm({
nzTitle: '提示',
nzContent: '确定删除设备吗?',
nzOnOk: () =>
this.deviceService.delDevice({deviceId: deviceId}, (data: any) => {
if (data['return_code'] == '000000') {
// 刷新数据
this.queryData();
this.message.create('success', '操作成功');
} else {
this.message.create('error', data['return_msg']);
}
})
});
}
/**
*
* @param data
*/
showEditDeviceModal(data: any) {
if (data != null) {
data['type'] = ''+data['type'];
this.editDeviceForm.patchValue(data);
}
this.editDeviceModal = true;
}
/**
*
*/
submitData() {
if (this.accountType != 2) {
this.message.create('error', '只有油站角色才能绑定设备');
return;
}
if (this.editDeviceForm.controls['merNo'].value == null) {
this.editDeviceForm.controls['merNo'].setValue(this.storage.get(DATA)['merchant']['merNo']);
}
if (this.editDeviceForm.valid) {
let param = this.editDeviceForm.value;
this.deviceService.editDevice(param, (data: any) => {
if (data['return_code'] == '000000') {
this.message.create('success', '操作成功');
// 查询数据
this.queryData();
// 关闭弹窗
this.closeEditDeviceModal();
} else {
this.message.create('error', data['return_msg']);
}
});
} else {
Object.values(this.editDeviceForm.controls).forEach(control => {
if (control.invalid) {
control.markAsDirty();
control.updateValueAndValidity({ onlySelf: true });
}
});
}
}
/**
*
*/
closeEditDeviceModal() {
this.editDeviceForm.reset();
this.editDeviceModal = false;
}
}

@ -0,0 +1,12 @@
import { Component } from '@angular/core';
@Component({
selector: 'app-oil-discount',
standalone: true,
imports: [],
templateUrl: './oil-discount.component.html',
styleUrl: './oil-discount.component.less'
})
export class OilDiscountComponent {
}

@ -0,0 +1,185 @@
<form nz-form [formGroup]="searchForm" class="search_form" [nzLayout]="'vertical'">
<div nz-row [nzGutter]="24">
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label>区域名称</nz-form-label>
<nz-form-control>
<nz-select formControlName="regionId" nzAllowClear [nzPlaceHolder]="'请选择'">
<nz-option *ngFor="let item of regionArray" nzValue="{{item.regionId}}" nzLabel="{{item.regionName}}"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label>油号</nz-form-label>
<nz-form-control>
<nz-select formControlName="oilNo" nzAllowClear [nzPlaceHolder]="'请选择'">
<nz-option *ngFor="let item of oilNoArray" nzValue="{{item.codeValue}}" nzLabel="{{item.codeName}}"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label>执行方式</nz-form-label>
<nz-form-control>
<nz-select formControlName="executionType" nzAllowClear [nzPlaceHolder]="'请选择'">
<nz-option *ngFor="let item of oilTaskExecutionTypeArray" nzValue="{{item.codeValue}}" nzLabel="{{item.codeName}}"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label>状态</nz-form-label>
<nz-form-control>
<nz-select formControlName="status" nzAllowClear [nzPlaceHolder]="'请选择'">
<nz-option *ngFor="let item of oilTaskStatusArray" nzValue="{{item.codeValue}}" nzLabel="{{item.codeName}}"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-control>
<button nz-button style="margin-right: 8px" [nzType]="'primary'" (click)="searchFormSubmit()">查询</button>
<button nz-button style="margin-right: 8px" (click)="searchFormReset()">重置</button>
<button nz-button style="margin-right: 8px" (click)="showEditTaskModal()" [nzType]="'primary'" >新增任务</button>
</nz-form-control>
</nz-form-item>
</div>
</div>
</form>
<nz-table #basicTable
[nzScroll]="{ x: '2400' }"
[nzBordered]="true"
[nzFrontPagination]="false"
[nzShowQuickJumper]="true"
[nzShowTotal]="totalTemplate"
[(nzPageIndex)]="tablePageNum"
(nzPageIndexChange)="queryData()"
nzShowSizeChanger
(nzPageSizeChange)="this.tablePageSize = $event;queryData()"
[nzPageSizeOptions]="[ 10, 20, 30, 50, 100 ]"
[nzTotal]="tableData.total"
[nzData]="tableData.list" >
<thead>
<tr>
<th nzWidth="100px">区域名称</th>
<th nzWidth="100px">区域价区</th>
<th nzWidth="100px">油站编号</th>
<th nzWidth="200px">油站名称</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="200px">创建时间</th>
<th nzWidth="200px">执行时间</th>
<th nzRight nzWidth="80px">操作</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of basicTable.data">
<td>{{data.regionName?data.regionName:'无'}}</td>
<td>{{data.oilPriceZoneName?data.oilPriceZoneName:'无'}}</td>
<td>{{data.merNo?data.merNo:'无'}}</td>
<td>{{data.merName?data.merName:'无'}}</td>
<td>{{data.oilTypeName}}</td>
<td>{{data.oilNo}}</td>
<td>{{data.priceType | dictionary: 'GAS_OIL_TASK_PRICE_TYPE'}}</td>
<td>¥{{data.price}}</td>
<td>{{data.executionType | dictionary : 'GAS_OIL_TASK_EXECUTION_TYPE'}}</td>
<td>{{data.status | dictionary : 'GAS_OIL_TASK_STATUS'}}</td>
<td>{{data.createTime | date : 'yyyy-MM-dd HH:mm:ss'}}</td>
<td>{{data.startTime | date : 'yyyy-MM-dd HH:mm:ss'}}</td>
<td nzRight>
<!-- <button nz-button nzType="link" (click)="showDetail(data)" [nzSize]="'small'">详情</button>
<nz-divider nzType="vertical"></nz-divider>-->
<button nz-button nzType="link" (click)="delTask(data.id)" [nzSize]="'small'" disabled="{{data.status==1?false:true}}">删除</button>
</td>
</tr>
</tbody>
<ng-template #totalTemplate let-total>总计 {{ total }} 条</ng-template>x
</nz-table>
<nz-modal [(nzVisible)]="editTaskModal"
[nzWidth]="500"
nzTitle="新增任务"
[nzFooter]="null"
(nzOnCancel)="closeEditTaskModal()">
<ng-container *nzModalContent>
<form nz-form [formGroup]="editTaskForm">
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>价格类型</nz-form-label>
<nz-form-control [nzSm]="14" [nzXs]="24">
<nz-select formControlName="priceType" [nzPlaceHolder]="'请选择'">
<nz-option *ngFor="let item of oilTaskPriceTypeArray" nzValue="{{item.codeValue}}" nzLabel="{{item.codeName}}"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>区域</nz-form-label>
<nz-form-control [nzSm]="14" [nzXs]="24">
<nz-select formControlName="regionId" nzAllowClear [nzPlaceHolder]="'请选择'">
<nz-option *ngFor="let item of regionArray" nzValue="{{item.regionId}}" nzLabel="{{item.regionName}}"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24">价区</nz-form-label>
<nz-form-control [nzSm]="14" [nzXs]="24">
<nz-select formControlName="oilPriceZoneId" nzAllowClear [nzPlaceHolder]="'请选择'">
<nz-option *ngFor="let item of oilPriceZoneArray" nzValue="{{item.codeValue}}" nzLabel="{{item.codeName}}"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>油品</nz-form-label>
<nz-form-control [nzSm]="14" [nzXs]="24">
<nz-select formControlName="oilNo" nzAllowClear [nzPlaceHolder]="'请选择'">
<nz-option *ngFor="let item of oilNoArray" nzValue="{{item.codeValue}}" nzLabel="{{item.codeName}}"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>执行价格</nz-form-label>
<nz-form-control [nzSm]="14" [nzXs]="24">
<nz-input-number formControlName="price" [nzMin]="1" [nzMax]="10" [nzStep]="1" [nzPrecision]="2" [nzPlaceHolder]="'执行价格'"></nz-input-number>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>执行方式</nz-form-label>
<nz-form-control [nzSm]="14" [nzXs]="24">
<nz-select formControlName="executionType" nzAllowClear [nzPlaceHolder]="'请选择'">
<nz-option *ngFor="let item of oilTaskExecutionTypeArray" nzValue="{{item.codeValue}}" nzLabel="{{item.codeName}}"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
<nz-form-item *ngIf="this.editTaskForm.controls['executionType'].value == 2">
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>执行时间</nz-form-label>
<nz-form-control [nzSm]="14" [nzXs]="24">
<nz-date-picker formControlName="startTime" nzShowTime nzFormat="yyyy-MM-dd HH:mm:ss"></nz-date-picker>
</nz-form-control>
</nz-form-item>
<div nz-flex style="margin-top: 15px" [nzJustify]="'center'">
<button nz-button nzType="primary" (click)="submitData()" class="submit-btn">保存</button>
</div>
</form>
</ng-container>
</nz-modal>

@ -0,0 +1,9 @@
nz-input-number {
width: 100%;
}
nz-date-picker {
width: 100%;
}
.submit-btn {
width: 150px;
}

@ -0,0 +1,242 @@
import { Component } from '@angular/core';
import {DatePipe, NgForOf, NgIf} from "@angular/common";
import {DictionaryPipe} from "../../../pipes/common/dictionary.pipe";
import {NzButtonComponent} from "ng-zorro-antd/button";
import {
NzCellFixedDirective,
NzTableCellDirective,
NzTableComponent, NzTableModule,
NzTbodyComponent, NzTheadComponent,
NzThMeasureDirective, NzTrDirective
} from "ng-zorro-antd/table";
import {NzColDirective, NzRowDirective} from "ng-zorro-antd/grid";
import {NzDividerComponent} from "ng-zorro-antd/divider";
import {NzFlexDirective} from "ng-zorro-antd/flex";
import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form";
import {NzInputDirective} from "ng-zorro-antd/input";
import {NzModalComponent, NzModalModule, NzModalService} from "ng-zorro-antd/modal";
import {NzOptionComponent, NzSelectComponent} from "ng-zorro-antd/select";
import {FormGroup, FormsModule, NonNullableFormBuilder, ReactiveFormsModule, Validators} from "@angular/forms";
import {BrowserStorageService} from "../../../utils/localStorage.service";
import {NzMessageService} from "ng-zorro-antd/message";
import {DATA} from "../../../data/login/localStorage.namespace";
import {OilTaskService} from "../../../services/mer-oil-price/oil-task.service";
import {NzDropDownADirective, NzDropDownDirective, NzDropdownMenuComponent} from "ng-zorro-antd/dropdown";
import {NzIconDirective} from "ng-zorro-antd/icon";
import {NzMenuDirective, NzMenuItemComponent} from "ng-zorro-antd/menu";
import {NzDescriptionsModule} from "ng-zorro-antd/descriptions";
import {NzUploadComponent} from "ng-zorro-antd/upload";
import {NzAvatarModule} from "ng-zorro-antd/avatar";
import {NzImageModule} from "ng-zorro-antd/image";
import {NzSwitchComponent} from "ng-zorro-antd/switch";
import {NzDatePickerComponent} from "ng-zorro-antd/date-picker";
import {NzInputNumberModule} from "ng-zorro-antd/input-number";
import {CommonService} from "../../../services/common/common.service";
@Component({
selector: 'app-oil-task',
standalone: true,
imports: [
DatePipe,
DictionaryPipe,
FormsModule,
NgForOf,
NgIf,
NzButtonComponent,
NzCellFixedDirective,
NzColDirective,
NzDividerComponent,
NzDropDownADirective,
NzDropDownDirective,
NzDropdownMenuComponent,
NzFormControlComponent,
NzFormDirective,
NzFormItemComponent,
NzFormLabelComponent,
NzIconDirective,
NzInputDirective,
NzMenuDirective,
NzMenuItemComponent,
NzOptionComponent,
NzRowDirective,
NzSelectComponent,
NzTableCellDirective,
NzTableComponent,
NzTbodyComponent,
NzThMeasureDirective,
NzTheadComponent,
NzTrDirective,
ReactiveFormsModule,
NzTableModule,
NzModalModule,
NzFlexDirective,
NzDescriptionsModule,
NzUploadComponent,
NzAvatarModule,
NzImageModule,
NzSwitchComponent,
NzDatePickerComponent,
NzInputNumberModule
],
templateUrl: './oil-task.component.html',
styleUrl: './oil-task.component.less'
})
export class OilTaskComponent {
// 表单页数
tablePageNum = 1;
// 每页数量
tablePageSize = 10;
// 表单数据
tableData: any = {
total: 0,
list: [],
};
accountType = null;
// 搜索表单
searchForm: FormGroup;
// 地区
regionArray: any = [];
// 油号
oilNoArray = new DictionaryPipe().getDictionaryList('OIL_NO');
// 价格类型
oilTaskPriceTypeArray = new DictionaryPipe().getDictionaryList('GAS_OIL_TASK_PRICE_TYPE');
// 执行方式
oilTaskExecutionTypeArray = new DictionaryPipe().getDictionaryList('GAS_OIL_TASK_EXECUTION_TYPE');
// 执行状态
oilTaskStatusArray = new DictionaryPipe().getDictionaryList('GAS_OIL_TASK_STATUS');
// 价区
oilPriceZoneArray = new DictionaryPipe().getDictionaryList('OIL_PRICE_ZONE');
// 编辑任务表单
editTaskForm: FormGroup;
editTaskModal = false;
constructor(private fb: NonNullableFormBuilder,
private message: NzMessageService,
private storage: BrowserStorageService,
private oilTaskService: OilTaskService,
private commonService: CommonService,
private modal: NzModalService) {
this.accountType = this.storage.get(DATA)['account']['objectType'];
// 获取地区
this.commonService.getRegion('',(data: any) => {
if (data['return_code'] == '000000') {
this.regionArray = data['return_data'];
}
});
// 初始化搜索框
this.searchForm = this.fb.group({
oilNo: [null],
executionType: [null],
regionId: [null],
merNo: [null],
merName: [null],
status: [null],
});
this.editTaskForm = this.fb.group({
priceType: ['1', [Validators.required]],
regionId: [''],
oilPriceZoneId: [''],
oilNo: ['',[Validators.required]],
price: ['',[Validators.required]],
executionType: ['',[Validators.required]],
startTime: [''],
});
// 查询数据
this.queryData();
}
/**
*
*/
queryData() {
this.searchForm.value.pageNum = this.tablePageNum;
this.searchForm.value.pageSize = this.tablePageSize;
this.searchForm.value.time = new Date().getTime();
this.oilTaskService.getTaskList(this.searchForm.value, (data: any) => {
if (data['return_code'] == '000000') {
this.tableData = data['return_data'];
}
});
}
/**
*
*/
searchFormSubmit(): void {
this.tablePageNum = 1;
this.queryData();
}
/**
*
*/
searchFormReset(): void {
this.searchForm.reset();
}
/**
*
*/
delTask(id: number) {
this.modal.confirm({
nzTitle: '提示',
nzContent: '确定删除任务吗?',
nzOnOk: () =>
this.oilTaskService.delTask({taskId: id}, (data: any) => {
if (data['return_code'] == '000000') {
// 刷新数据
this.queryData();
this.message.create('success', '操作成功');
} else {
this.message.create('error', data['return_msg']);
}
})
});
}
/**
*
*/
showEditTaskModal() {
this.editTaskModal = true;
}
/**
*
*/
submitData() {
if (this.editTaskForm.valid) {
let param = [];
param.push(this.editTaskForm.value);
this.oilTaskService.batchAddTask(param, (data: any) => {
if (data['return_code'] == '000000') {
this.message.create('success', '操作成功');
// 刷新数据
this.queryData();
// 关闭弹窗
this.closeEditTaskModal();
// 表单重置
this.editTaskForm.reset();
this.editTaskForm.controls['priceType'].setValue('1');
} else {
this.message.create('error', data['return_msg']);
}
});
} else {
Object.values(this.editTaskForm.controls).forEach(control => {
if (control.invalid) {
control.markAsDirty();
control.updateValueAndValidity({ onlySelf: true });
}
});
}
}
/**
*
*/
closeEditTaskModal() {
this.editTaskModal = false;
}
}

@ -1,7 +1,6 @@
<form nz-form [formGroup]="form" (ngSubmit)="submitForm()">
<form nz-form [formGroup]="form" [nzLayout]="'vertical'">
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24">商家标志</nz-form-label>
<nz-form-label [nzSm]="6" [nzXs]="24">油站照片</nz-form-label>
<nz-form-control [nzSm]="14" [nzXs]="24">
<nz-upload
class="logo-uploader"
@ -21,59 +20,150 @@
</nz-form-control>
</nz-form-item>
<nz-form-item>
<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="loginName"/>
</nz-form-control>
</nz-form-item>
<div nz-row [nzGutter]="24">
<div nz-col [nzSpan]="8">
<nz-form-item>
<nz-form-label nzRequired>所在地区</nz-form-label>
<nz-form-control>
<nz-cascader formControlName="region" [nzOptions]="regionData" [nzAllowClear]="false" [nzPlaceHolder]="'请选择油站所在地区'"></nz-cascader>
</nz-form-control>
</nz-form-item>
</div>
<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 formControlName="roleId">
<nz-option *ngFor="let item of roleData" nzValue="{{item.id}}" nzLabel="{{item.roleName}}"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
<div nz-col [nzSpan]="8">
<nz-form-item>
<nz-form-label >油价价区</nz-form-label>
<nz-form-control>
<nz-select formControlName="oilPriceZoneId" nzAllowClear nzPlaceHolder="请输入油价价区">
<nz-option *ngFor="let item of oilPriceZoneArray" nzLabel="{{item.codeName}}" nzValue="{{item.codeValue}}"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>商户名称</nz-form-label>
<nz-form-control [nzSm]="14" [nzXs]="24">
<input nz-input nzSize="large" formControlName="merName"/>
</nz-form-control>
</nz-form-item>
<div nz-col [nzSpan]="8">
<nz-form-item>
<nz-form-label nzRequired>油站名称</nz-form-label>
<nz-form-control>
<input nz-input formControlName="merName" placeholder="请输入油站名称" />
</nz-form-control>
</nz-form-item>
</div>
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>商户地址</nz-form-label>
<nz-form-control [nzSm]="14" [nzXs]="24">
<input nzSize="large" nz-input formControlName="address"/>
</nz-form-control>
</nz-form-item>
<div nz-col [nzSpan]="8">
<nz-form-item>
<nz-form-label nzRequired>油站联系人</nz-form-label>
<nz-form-control>
<input nz-input formControlName="contactsName" placeholder="请输入油站联系人" />
</nz-form-control>
</nz-form-item>
</div>
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>负责人</nz-form-label>
<nz-form-control [nzSm]="14" [nzXs]="24">
<input nzSize="large" nz-input formControlName="directorName"/>
</nz-form-control>
</nz-form-item>
<div nz-col [nzSpan]="8">
<nz-form-item>
<nz-form-label nzRequired>油站联系电话</nz-form-label>
<nz-form-control>
<input nz-input formControlName="contactsTel" placeholder="请输入油站联系电话" />
</nz-form-control>
</nz-form-item>
</div>
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>联系电话</nz-form-label>
<nz-form-control [nzSm]="14" [nzXs]="24">
<input nzSize="large" nz-input formControlName="directorTel"/>
</nz-form-control>
</nz-form-item>
<div nz-col [nzSpan]="8">
<nz-form-item>
<nz-form-label nzRequired>油站客服电话</nz-form-label>
<nz-form-control>
<input nz-input formControlName="customerServiceTel" placeholder="请输入油站名称" />
</nz-form-control>
</nz-form-item>
</div>
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24">客服电话</nz-form-label>
<nz-form-control [nzSm]="14" [nzXs]="24">
<input nzSize="large" nz-input formControlName="customerServiceTel"/>
</nz-form-control>
</nz-form-item>
<div nz-col [nzSpan]="8">
<nz-form-item>
<nz-form-label nzRequired>油站地址</nz-form-label>
<nz-form-control>
<nz-input-group nzSearch nzSize="large" [nzAddOnAfter]="positioningAfter">
<input nz-input formControlName="address" placeholder="请输入或定位油站地址" />
</nz-input-group>
<ng-template #positioningAfter>
<button nz-button nzType="primary" nzSize="large" (click)="showPositioning()">点击定位</button>
</ng-template>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="8">
<nz-form-item>
<nz-form-label nzRequired>地址经度</nz-form-label>
<nz-form-control>
<input nz-input formControlName="longitude" placeholder="请选择地址或输入商户地址经度" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="8">
<nz-form-item>
<nz-form-label nzRequired>地址纬度</nz-form-label>
<nz-form-control>
<input nz-input formControlName="latitude" placeholder="请选择地址或输入商户地址纬度" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="8">
<nz-form-item>
<nz-form-label>连锁品牌</nz-form-label>
<nz-form-control>
<nz-select formControlName="chainBrandId" nzAllowClear nzPlaceHolder="油站连锁品牌">
<nz-option *ngFor="let item of merChainBrandData" nzLabel="{{item.name}}" nzValue="{{item.id}}"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="8" *ngIf="this.form.controls['chainBrandId'].value != null">
<nz-form-item>
<nz-form-label>连锁结算方式</nz-form-label>
<nz-form-control>
<nz-select formControlName="chainBrandSettleType" nzAllowClear nzPlaceHolder="结算方式">
<nz-option *ngFor="let item of merChainBrandSettleTypeArray" nzLabel="{{item.codeName}}" nzValue="{{item.codeValue}}"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="8">
<nz-form-item>
<nz-form-label>油站标签</nz-form-label>
<nz-form-control>
<nz-select formControlName="merLabel" nzMode="tags" [nzTokenSeparators]="[',']" nzPlaceHolder="油站标签,可自定义输入,“ , ”分词">
<nz-option nzLabel="24小时营业" nzValue="24小时营业"></nz-option>
<nz-option nzLabel="可开发票" nzValue="可开发票"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
</div>
<div nz-flex [nzJustify]="'center'">
<button nz-button nzType="primary" class="submit-btn">保存</button>
<button nz-button nzType="primary" class="submit-btn" (click)="submitForm()">保存</button>
</div>
</form>
<nz-modal [(nzVisible)]="positioningModal"
[nzWidth]="1000"
nzTitle="油站地址定位"
[nzFooter]="null"
(nzOnCancel)="positioningModal = !positioningModal">
<ng-container *nzModalContent>
<iframe
width="100%"
height="800px"
src="https://apis.map.qq.com/tools/locpicker?search=1&type=1&key=7UMBZ-HFEHX-HSD4Q-Z3QY6-OQKN7-2QBDB&referer=pc">
</iframe>
<div nz-flex style="margin-top: 15px" [nzJustify]="'center'">
<button nz-button nzType="primary" class="submit-btn" (click)="submitAddress()">确认选择</button>
</div>
</ng-container>
</nz-modal>

@ -1,6 +1,4 @@
form {
width: 500px;
}
.logo-uploader {
text-align: left;
}

@ -1,4 +1,4 @@
import { Component } from '@angular/core';
import {Component} from '@angular/core';
import {NzModalModule, NzModalService} from "ng-zorro-antd/modal";
import {FormGroup, FormsModule, NonNullableFormBuilder, ReactiveFormsModule, Validators} from "@angular/forms";
import {NgForOf, NgIf} from "@angular/common";
@ -12,8 +12,8 @@ import {
NzFormLabelComponent,
NzFormModule
} from "ng-zorro-antd/form";
import {NzInputDirective} from "ng-zorro-antd/input";
import {NzOptionComponent, NzSelectComponent} from "ng-zorro-antd/select";
import {NzInputDirective, NzInputGroupComponent} from "ng-zorro-antd/input";
import {NzOptionComponent, NzSelectComponent, NzSelectModule} from "ng-zorro-antd/select";
import {NzUploadFile, NzUploadModule} from "ng-zorro-antd/upload";
import {NzIconDirective} from "ng-zorro-antd/icon";
import {Observable, Observer} from "rxjs";
@ -21,7 +21,14 @@ import {NzMessageService} from "ng-zorro-antd/message";
import {environment} from "../../../../environments/environment";
import {MerService} from "../../../services/merchant/mer.service";
import {RoleService} from "../../../services/role/role.service";
import {NzInputNumberComponent} from "ng-zorro-antd/input-number";
import {DomSanitizer} from "@angular/platform-browser";
import {DictionaryPipe} from "../../../pipes/common/dictionary.pipe";
import {CommonService} from "../../../services/common/common.service";
import {ActivatedRoute} from "@angular/router";
import {NzCascaderModule} from "ng-zorro-antd/cascader";
import {HttpClient} from "@angular/common/http";
import {MerChainBrandService} from "../../../services/merchant/mer-chain-brand.service";
@Component({
selector: 'app-mer-add',
standalone: true,
@ -43,13 +50,18 @@ import {RoleService} from "../../../services/role/role.service";
NzFormModule,
NzUploadModule,
NzIconDirective,
NgIf
NgIf,
NzInputGroupComponent,
NzInputNumberComponent,
NzCascaderModule
],
templateUrl: './mer-add.component.html',
styleUrl: './mer-add.component.less'
})
export class MerAddComponent {
BASE_URL = environment.baseUrl;
FILE_URL = environment.imageUrl;
loading = false;
logoUrl?: string;
@ -57,41 +69,152 @@ export class MerAddComponent {
// 角色数据
roleData: any = [];
// 油价价区
oilPriceZoneArray = new DictionaryPipe().getDictionaryList('OIL_PRICE_ZONE');
// 商户连锁品牌结算类型
merChainBrandSettleTypeArray = new DictionaryPipe().getDictionaryList('MER_CHAIN_BRAND_SETTLE_TYPE');
// 地区数据
regionData: any = [];
// 商户连锁品牌数据
merChainBrandData: any = [];
// 商户来源
merSourceType = 1;
positioningModal = false;
positioningObj: any = {};
constructor(private fb: NonNullableFormBuilder,
private merService: MerService,
private merChainBrandService: MerChainBrandService,
private roleService: RoleService,
private message: NzMessageService,
private modal: NzModalService) {
private activatedRoute: ActivatedRoute,
private http: HttpClient) {
// 初始化表单
this.form = this.fb.group({
loginName: ['', [Validators.required]],
roleId: ['', [Validators.required]],
merLogo: [''],
merName: [''],
directorName: [''],
directorTel: [''],
customerServiceTel: [''],
address: [''],
merNo: [null],
areaCode: [null],
chainBrandId: [null],
chainBrandSettleType: [null],
merLogo: ['', [Validators.required]],
region: [[], [Validators.required]],
oilPriceZoneId: [''],
merName: ['', [Validators.required]],
contactsName: ['', [Validators.required]],
contactsTel: ['', [Validators.required]],
customerServiceTel: ['', [Validators.required]],
address: ['', [Validators.required]],
longitude: ['', [Validators.required]],
latitude: ['', [Validators.required]],
merLabel: [''],
});
this.activatedRoute.queryParams.subscribe(queryParams => {
// 接收到路由参数
if (queryParams['merNo'] != null) {
// 查询详情
this.merService.queryMer(queryParams['merNo'], (data: any) => {
if (data['return_code'] == '000000') {
this.form.controls['chainBrandId'].disable();
this.form.controls['chainBrandSettleType'].disable();
const merchant = data['return_data']['merchant'];
// 处理油站图片
if (merchant['merLogo'] != null && merchant['merLogo'] != '') {
this.merSourceType = merchant['sourceType'];
if (merchant['sourceType'] == 1) {
this.logoUrl = this.FILE_URL + String(merchant['merLogo']);
} else {
this.logoUrl = String(merchant['merLogo']);
}
}
// 处理油站价区
merchant['region'] = [merchant['provinceCode'],merchant['cityCode'],merchant['areaCode']];
// 处理油站价区
if (merchant['oilPriceZoneId'] != null) {
merchant['oilPriceZoneId'] = String(merchant['oilPriceZoneId']);
}
// 处理油站价区
if (merchant['chainBrandId'] != null) {
merchant['chainBrandId'] = String(merchant['chainBrandId']);
}
// 处理油站价区
if (merchant['chainBrandSettleType'] != null) {
merchant['chainBrandSettleType'] = String(merchant['chainBrandSettleType']);
}
// 处理油站标签
if (merchant['merLabel'] != null && merchant['merLabel'] != '') {
merchant['merLabel'] = String(merchant['merLabel']).split(',');
}
this.form.patchValue(merchant);
}
});
}
});
// 获取地区数据
this.http.get('assets/data/region.json').subscribe((data: any) => {
this.regionData = data;
});
// 获取连锁品牌
this.merChainBrandService.getList({pageNum:1,pageSize: 9999}, (data:any) =>{
this.merChainBrandData = data['return_data']['list'];
});
// 获取角色数据
this.roleService.queryAllRole((data: any) => {
this.roleData = data['return_data'];
});
// 监听地址定位
addEventListener('message', (event: any) => {
// 接收位置信息,用户选择确认位置点后选点组件会触发该事件,回传用户的位置信息
var loc = event.data;
if (loc && loc.module == 'locationPicker') { // 防止其他应用也会向该页面post信息,需判断module是否为'locationPicker'
this.positioningObj = loc;
console.log(this.positioningObj);
}
}, false);
}
/**
*
*/
showPositioning() {
this.positioningModal = true;
}
/**
*
*/
submitAddress() {
this.form.controls['address'].setValue(this.positioningObj.poiaddress);
this.form.controls['longitude'].setValue(this.positioningObj.latlng.lng);
this.form.controls['latitude'].setValue(this.positioningObj.latlng.lat);
this.positioningModal = false;
}
submitForm() {
console.log(this.logoUrl);
if (this.form.valid) {
this.merService.create(this.form.value, (data: any) => {
if (data['return_code'] == '000000') {
const param = this.form.value;
if (param['merLabel'] != null && param['merLabel'].length > 0) {
param['merLabel'] = param['merLabel'].join(',');
}
param['areaCode'] = param['region'][2];
this.form.controls['chainBrandId'].enable();
this.form.controls['chainBrandSettleType'].enable();
this.merService.editMerchant(param, (data: any) => {
if (data['return_code'] == '000000') {
this.message.create('success', '操作成功');
// 清空表单
this.form.reset();
this.logoUrl = '';
if (param['merNo'] == null) {
// 清空表单
this.form.reset();
this.logoUrl = '';
}
} else {
this.form.controls['chainBrandId'].disable();
this.form.controls['chainBrandSettleType'].disable();
this.message.create('error', data['return_msg']);
}
});
@ -122,7 +245,12 @@ export class MerAddComponent {
this.loading = false;
this.logoUrl = img;
});
this.form.patchValue({ merLogo: info.file.response['return_data'][0]});
// 不是自建站,拼接绝对路径访问链接
if (this.merSourceType != 1) {
this.form.patchValue({ merLogo: this.FILE_URL + info.file.response['return_data'][0]});
} else {
this.form.patchValue({ merLogo: info.file.response['return_data'][0]});
}
break;
case 'error':
this.message.error('网络错误!');

@ -0,0 +1,150 @@
<!--<form nz-form [formGroup]="searchForm" class="search_form" [nzLayout]="'vertical'">
<div nz-row [nzGutter]="24">
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label>油站编号</nz-form-label>
<nz-form-control>
<input nz-input formControlName="merNo" placeholder="请输入" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label>油站名称</nz-form-label>
<nz-form-control>
<input nz-input formControlName="merName" placeholder="请输入" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label></nz-form-label>
<nz-form-control>
<button nz-button style="margin-right: 8px" [nzType]="'primary'" (click)="searchFormSubmit()">查询</button>
<button nz-button style="margin-right: 8px" (click)="searchFormReset()">重置</button>
</nz-form-control>
</nz-form-item>
</div>
</div>
</form>-->
<nz-table #basicTable
[nzScroll]="{ x: '1200px' }"
[nzBordered]="true"
[nzFrontPagination]="false"
[nzShowQuickJumper]="true"
[nzShowTotal]="totalTemplate"
[(nzPageIndex)]="tablePageNum"
(nzPageIndexChange)="queryData()"
nzShowSizeChanger
(nzPageSizeChange)="this.tablePageSize = $event;queryData()"
[nzPageSizeOptions]="[ 10, 20, 30, 50, 100 ]"
[nzTotal]="tableData.total"
[nzData]="tableData.list" >
<thead>
<tr>
<th nzWidth="100px">连锁名称</th>
<th nzWidth="100px">余额</th>
<th nzWidth="120px">创建时间</th>
<th nzRight nzWidth="50px">操作</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of basicTable.data">
<td>{{data.name}}</td>
<td>{{data.amount}}</td>
<td>{{data.createTime | date: 'yyyy-MM-dd HH:mm:ss'}}</td>
<td nzRight>
<a (click)="showRechargeModal(data)">充值</a>
<nz-divider nzType="vertical"></nz-divider>
<a nz-dropdown [nzDropdownMenu]="menu">
更多
<span nz-icon nzType="down"></span>
</a>
<nz-dropdown-menu #menu="nzDropdownMenu">
<ul nz-menu nzSelectable>
<li nz-menu-item (click)="showRecordModal(data.id)"><a >动账记录</a></li>
</ul>
</nz-dropdown-menu>
</tr>
</tbody>
<ng-template #totalTemplate let-total>总计 {{ total }} 条</ng-template>
</nz-table>
<nz-modal [(nzVisible)]="rechargeModal"
[nzWidth]="500"
nzTitle="充值"
[nzFooter]="null"
(nzOnCancel)="closeRechargeModal()">
<ng-container *nzModalContent>
<form nz-form [formGroup]="rechargeForm">
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>连锁名称</nz-form-label>
<nz-form-control [nzSm]="14" [nzXs]="24">
<input nz-input formControlName="name"/>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>充值金额</nz-form-label>
<nz-form-control [nzSm]="14" [nzXs]="24">
<nz-input-number formControlName="amount" [nzMin]="1" [nzMax]="10" [nzStep]="1" [nzPrecision]="2" [nzPlaceHolder]="'充值金额'"></nz-input-number>
</nz-form-control>
</nz-form-item>
<div nz-flex style="margin-top: 15px" [nzJustify]="'center'">
<button nz-button nzType="primary" class="submit-btn" (click)="rechargeConfirm()">确定</button>
</div>
</form>
</ng-container>
</nz-modal>
<nz-modal [(nzVisible)]="recordModal"
[nzWidth]="1000"
nzTitle="动账记录"
[nzFooter]="null"
(nzOnCancel)="recordModal = !recordModal">
<ng-container *nzModalContent>
<nz-table #recordTable
nzSize="middle"
[nzScroll]="{ x: '1000px' }"
[nzBordered]="true"
[nzFrontPagination]="false"
[nzShowQuickJumper]="true"
[nzShowTotal]="totalTemplate"
[(nzPageIndex)]="recordTablePageNum"
(nzPageIndexChange)="queryRecord()"
[nzTotal]="recordData.total"
[nzData]="recordData.list" >
<thead>
<tr>
<th nzWidth="90px">交易前金额</th>
<th nzWidth="80px">交易金额</th>
<th nzWidth="90px">交易后金额</th>
<th nzWidth="50px">交易类型</th>
<th nzWidth="100px">交易时间</th>
<th nzWidth="120px">交易来源</th>
<th nzWidth="120px">操作油站</th>
<!-- <th nzRight nzWidth="50px">操作</th>-->
</tr>
</thead>
<tbody>
<tr *ngFor="let data of recordTable.data">
<td>{{data.beforeAmount}}</td>
<td>{{data.transactionAmount}}</td>
<td>{{data.afterAmount}}</td>
<td>{{data.type==1?'入账':'出账'}}</td>
<td>{{data.createTime | date: 'yyyy-MM-dd HH:mm:ss'}}</td>
<td>{{data.sourceType | dictionary: 'MER_ACCOUNT_RECORD_SOURCE_TYPE'}}</td>
<td>{{data.merNo!=null?'【'+data.merNo+'】'+data.merName:''}}</td>
<!-- <td nzRight>
<a >详情</a>
</td>-->
</tr>
</tbody>
<ng-template #totalTemplate let-total>总计 {{ total }} 条</ng-template>
</nz-table>
</ng-container>
</nz-modal>

@ -0,0 +1,6 @@
nz-input-number {
width: 100%;
}
.submit-btn {
width: 150px;
}

@ -0,0 +1,247 @@
import { Component } from '@angular/core';
import {FormGroup, FormsModule, NonNullableFormBuilder, ReactiveFormsModule, Validators} from "@angular/forms";
import {NzMessageService} from "ng-zorro-antd/message";
import { NzModalModule, NzModalService} from "ng-zorro-antd/modal";
import {DatePipe, NgForOf, NgIf} from "@angular/common";
import {DictionaryPipe} from "../../../pipes/common/dictionary.pipe";
import {NzButtonComponent} from "ng-zorro-antd/button";
import {
NzCellFixedDirective,
NzTableCellDirective,
NzTableComponent, NzTableModule,
NzTbodyComponent, NzTheadComponent,
NzThMeasureDirective, NzTrDirective
} from "ng-zorro-antd/table";
import {NzColDirective, NzRowDirective} from "ng-zorro-antd/grid";
import {NzDividerComponent} from "ng-zorro-antd/divider";
import {NzDropDownADirective, NzDropDownDirective, NzDropdownMenuComponent} from "ng-zorro-antd/dropdown";
import {NzFlexDirective} from "ng-zorro-antd/flex";
import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form";
import {NzIconDirective} from "ng-zorro-antd/icon";
import {NzInputDirective} from "ng-zorro-antd/input";
import {NzInputNumberComponent, NzInputNumberModule} from "ng-zorro-antd/input-number";
import {NzMenuDirective, NzMenuItemComponent} from "ng-zorro-antd/menu";
import {NzOptionComponent, NzSelectComponent} from "ng-zorro-antd/select";
import {NzDescriptionsModule} from "ng-zorro-antd/descriptions";
import {NzUploadComponent} from "ng-zorro-antd/upload";
import {NzAvatarModule} from "ng-zorro-antd/avatar";
import {NzImageModule} from "ng-zorro-antd/image";
import {NzSwitchComponent} from "ng-zorro-antd/switch";
import {NzDatePickerComponent} from "ng-zorro-antd/date-picker";
import {MerChainBrandAmountService} from "../../../services/merchant/mer-chain-brand-amount.service";
import {MerChainBrandService} from "../../../services/merchant/mer-chain-brand.service";
@Component({
selector: 'app-mer-chain-brand-amount',
standalone: true,
imports: [
DatePipe,
DictionaryPipe,
FormsModule,
NgForOf,
NgIf,
NzButtonComponent,
NzCellFixedDirective,
NzColDirective,
NzDividerComponent,
NzDropDownADirective,
NzDropDownDirective,
NzDropdownMenuComponent,
NzFormControlComponent,
NzFormDirective,
NzFormItemComponent,
NzFormLabelComponent,
NzIconDirective,
NzInputDirective,
NzMenuDirective,
NzMenuItemComponent,
NzOptionComponent,
NzRowDirective,
NzSelectComponent,
NzTableCellDirective,
NzTableComponent,
NzTbodyComponent,
NzThMeasureDirective,
NzTheadComponent,
NzTrDirective,
ReactiveFormsModule,
NzTableModule,
NzModalModule,
NzFlexDirective,
NzDescriptionsModule,
NzUploadComponent,
NzAvatarModule,
NzImageModule,
NzSwitchComponent,
NzDatePickerComponent,
NzInputNumberModule
],
templateUrl: './mer-chain-brand-amount.component.html',
styleUrl: './mer-chain-brand-amount.component.less'
})
export class MerChainBrandAmountComponent {
// 表单页数
tablePageNum = 1;
// 每页数量
tablePageSize = 10;
// 表单数据
tableData: any = {
total: 0,
list: [],
};
// 搜索表单
searchForm: FormGroup;
// 充值表单
rechargeForm: FormGroup;
rechargeModal = false;
// 记录模态框
recordModal = false;
recordChainBrandId: any = null;
// 表单页数
recordTablePageNum = 1;
// 每页数量
recordTablePageSize = 10;
recordData: any = {
total: 0,
list: [],
};
constructor(private fb: NonNullableFormBuilder,
private message: NzMessageService,
private merChainBrandService: MerChainBrandService,
private merChainBrandAmountService: MerChainBrandAmountService,
private modalService: NzModalService) {
// 初始化搜索框
this.searchForm = this.fb.group({
merNo: [''],
merName: [''],
});
// 初始化搜索框
this.rechargeForm = this.fb.group({
id: [null, [Validators.required]],
name: [null],
amount: [null, [Validators.required]],
});
this.queryData();
}
/**
*
*/
queryData() {
this.searchForm.value.pageNum = this.tablePageNum;
this.searchForm.value.pageSize = this.tablePageSize;
this.searchForm.value.time = new Date().getTime();
this.merChainBrandService.getList(this.searchForm.value, (data: any) => {
if (data['return_code'] == '000000') {
this.tableData = data['return_data'];
}
});
}
/**
*
*/
searchFormSubmit(): void {
this.tablePageNum = 1;
this.queryData();
}
/**
*
*/
searchFormReset(): void {
this.searchForm.reset();
}
/**
*
* @param data
*/
showRechargeModal(data: any) {
this.rechargeForm.patchValue(data);
this.rechargeForm.controls['amount'].setValue(0);
this.rechargeForm.controls['id'].disable();
this.rechargeForm.controls['name'].disable();
this.rechargeModal = true;
}
/**
*
*/
rechargeConfirm() {
if (this.rechargeForm.valid) {
this.modalService.confirm({
nzTitle: '充值提醒',
nzContent: '确认为【' + this.rechargeForm.controls['name'].value + '】连锁余额充值:' +this.rechargeForm.controls['amount'].value + '元吗?',
nzOnOk: () => this.submitRecharge()
});
} else {
Object.values(this.rechargeForm.controls).forEach(control => {
if (control.invalid) {
control.markAsDirty();
control.updateValueAndValidity({ onlySelf: true });
}
});
}
}
/**
*
*/
submitRecharge() {
let param = this.rechargeForm.value;
param['chainBrandId'] = this.rechargeForm.controls['id'].value;
this.merChainBrandAmountService.recharge(param, (data: any) => {
if (data['return_code'] == '000000') {
this.message.create('success', '操作成功');
this.queryData();
// 关闭弹窗
this.closeRechargeModal();
} else {
this.message.create('error', data['return_msg']);
}
});
}
/**
*
*/
closeRechargeModal() {
this.rechargeForm.reset();
this.rechargeModal = false;
}
/**
*
* @param merNo
*/
showRecordModal(recordChainBrandId: number) {
if (this.recordChainBrandId != recordChainBrandId) {
this.recordChainBrandId = recordChainBrandId;
// 查询数据
this.queryRecord();
}
this.recordModal = true;
}
/**
*
*/
queryRecord() {
const param = {
chainBrandId: this.recordChainBrandId,
pageNum: this.recordTablePageNum,
pageSize: this.recordTablePageSize,
time: this.tablePageSize,
};
this.merChainBrandAmountService.getRecordList(param, (data: any) => {
if (data['return_code'] == '000000') {
this.recordData = data['return_data'];
}
});
}
}

@ -0,0 +1,95 @@
<form nz-form [formGroup]="searchForm" class="search_form" [nzLayout]="'vertical'">
<div nz-row [nzGutter]="24">
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label>连锁名称</nz-form-label>
<nz-form-control>
<input nz-input formControlName="name" placeholder="请输入" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label></nz-form-label>
<nz-form-control>
<button nz-button style="margin-right: 8px" [nzType]="'primary'" (click)="searchFormSubmit()">查询</button>
<button nz-button style="margin-right: 8px" (click)="searchFormReset()">重置</button>
<button nz-button (click)="showChainBrandModel(null)" [nzType]="'primary'">新增连锁</button>
</nz-form-control>
</nz-form-item>
</div>
</div>
</form>
<nz-table #basicTable
[nzScroll]="{ x: '1200px' }"
[nzBordered]="true"
[nzFrontPagination]="false"
[nzShowQuickJumper]="true"
[nzShowTotal]="totalTemplate"
[(nzPageIndex)]="tablePageNum"
(nzPageIndexChange)="queryData()"
nzShowSizeChanger
(nzPageSizeChange)="this.tablePageSize = $event;queryData()"
[nzPageSizeOptions]="[ 10, 20, 30, 50, 100 ]"
[nzTotal]="tableData.total"
[nzData]="tableData.list" >
<thead>
<tr>
<th nzWidth="150px">连锁名称</th>
<th nzWidth="120px">负责人名称</th>
<th nzWidth="100px">负责人电话</th>
<th nzWidth="100px">创建时间</th>
<th nzRight nzWidth="50px">操作</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of basicTable.data">
<td>{{data.name}}</td>
<td>{{data.contactsName}}</td>
<td>{{data.contactsTelephone}}</td>
<td>{{data.createTime | date : "yyyy-MM-dd HH:mm"}}</td>
<td nzRight>
<a (click)="showChainBrandModel(data)">修改</a>
</tr>
</tbody>
<ng-template #totalTemplate let-total>总计 {{ total }} 条</ng-template>
</nz-table>
<nz-modal [(nzVisible)]="editChainBrandModel"
[nzWidth]="700"
nzTitle="{{this.editChainBrandForm.controls['id']==null?'新增':'修改'}}"
[nzFooter]="null"
(nzOnCancel)="closeChainBrandModel()">
<ng-container *nzModalContent>
<form nz-form [formGroup]="editChainBrandForm">
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>连锁名称</nz-form-label>
<nz-form-control [nzSm]="14" [nzXs]="24">
<input nz-input formControlName="name" placeholder="请输入连锁名称"/>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>负责人名称</nz-form-label>
<nz-form-control [nzSm]="14" [nzXs]="24">
<input nz-input formControlName="contactsName" placeholder="请输入负责人名称"/>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>负责人电话</nz-form-label>
<nz-form-control [nzSm]="14" [nzXs]="24">
<input nz-input formControlName="contactsTelephone" placeholder="请输入负责人电话,用于登录账户"/>
</nz-form-control>
</nz-form-item>
<div nz-flex style="margin-top: 15px" [nzJustify]="'center'">
<button nz-button nzType="primary" (click)="submitChainBrandModel()" class="submit-btn">保存</button>
</div>
</form>
</ng-container>
</nz-modal>

@ -0,0 +1,197 @@
import { Component } from '@angular/core';
import {FormGroup, FormsModule, NonNullableFormBuilder, ReactiveFormsModule, Validators} from "@angular/forms";
import {MerChainBrandService} from "../../../services/merchant/mer-chain-brand.service";
import {DatePipe, NgForOf, NgIf} from "@angular/common";
import {DictionaryPipe} from "../../../pipes/common/dictionary.pipe";
import {NzButtonComponent} from "ng-zorro-antd/button";
import {
NzCellFixedDirective,
NzTableCellDirective,
NzTableComponent, NzTableModule,
NzTbodyComponent, NzTheadComponent,
NzThMeasureDirective, NzTrDirective
} from "ng-zorro-antd/table";
import {NzColDirective, NzRowDirective} from "ng-zorro-antd/grid";
import {NzDividerComponent} from "ng-zorro-antd/divider";
import {NzDropDownADirective, NzDropDownDirective, NzDropdownMenuComponent} from "ng-zorro-antd/dropdown";
import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form";
import {NzIconDirective} from "ng-zorro-antd/icon";
import {NzInputDirective} from "ng-zorro-antd/input";
import {NzMenuDirective, NzMenuItemComponent} from "ng-zorro-antd/menu";
import {NzOptionComponent, NzSelectComponent} from "ng-zorro-antd/select";
import {NzModalModule} from "ng-zorro-antd/modal";
import {NzFlexDirective} from "ng-zorro-antd/flex";
import {NzDescriptionsModule} from "ng-zorro-antd/descriptions";
import {NzUploadComponent} from "ng-zorro-antd/upload";
import {NzAvatarModule} from "ng-zorro-antd/avatar";
import {NzImageModule} from "ng-zorro-antd/image";
import {NzSwitchComponent} from "ng-zorro-antd/switch";
import {NzDatePickerComponent, NzRangePickerComponent} from "ng-zorro-antd/date-picker";
import {NzRadioButtonDirective, NzRadioComponent, NzRadioGroupComponent} from "ng-zorro-antd/radio";
import {NzToolTipModule} from "ng-zorro-antd/tooltip";
import {NzTabsModule} from "ng-zorro-antd/tabs";
import {NzTagModule} from "ng-zorro-antd/tag";
import {NzCardModule} from "ng-zorro-antd/card";
import {NzInputNumberModule} from "ng-zorro-antd/input-number";
import {NzQRCodeModule} from "ng-zorro-antd/qr-code";
import {RouterLink} from "@angular/router";
import {NzMessageService} from "ng-zorro-antd/message";
@Component({
selector: 'app-mer-chain-brand-list',
standalone: true,
imports: [
DatePipe,
DictionaryPipe,
FormsModule,
NgForOf,
NgIf,
NzButtonComponent,
NzCellFixedDirective,
NzColDirective,
NzDividerComponent,
NzDropDownADirective,
NzDropDownDirective,
NzDropdownMenuComponent,
NzFormControlComponent,
NzFormDirective,
NzFormItemComponent,
NzFormLabelComponent,
NzIconDirective,
NzInputDirective,
NzMenuDirective,
NzMenuItemComponent,
NzOptionComponent,
NzRowDirective,
NzSelectComponent,
NzTableCellDirective,
NzTableComponent,
NzTbodyComponent,
NzThMeasureDirective,
NzTheadComponent,
NzTrDirective,
ReactiveFormsModule,
NzTableModule,
NzModalModule,
NzFlexDirective,
NzDescriptionsModule,
NzUploadComponent,
NzAvatarModule,
NzImageModule,
NzSwitchComponent,
NzDatePickerComponent,
],
templateUrl: './mer-chain-brand-list.component.html',
styleUrl: './mer-chain-brand-list.component.less'
})
export class MerChainBrandListComponent {
// 表单页数
tablePageNum = 1;
// 每页数量
tablePageSize = 10;
// 表单数据
tableData: any = {
total: 0,
list: [],
};
// 搜索表单
searchForm: FormGroup;
// 更多搜索条件
isCollapse = false;
// 编辑品牌表单
editChainBrandForm: FormGroup;
editChainBrandModel = false;
constructor(private fb: NonNullableFormBuilder,
private message: NzMessageService,
private merChainBrandService: MerChainBrandService) {
// 初始化搜索框
this.searchForm = this.fb.group({
name: [''],
contactsName: [''],
contactsTelephone: [''],
});
// 初始化表单
this.editChainBrandForm = this.fb.group({
id: [null],
name: [null, [Validators.required]],
contactsName: [null, [Validators.required]],
contactsTelephone: [null, [Validators.required]],
});
this.queryData();
}
/**
*
*/
queryData() {
this.searchForm.value.pageNum = this.tablePageNum;
this.searchForm.value.pageSize = this.tablePageSize;
this.searchForm.value.time = new Date().getTime();
this.merChainBrandService.getList(this.searchForm.value, (data: any) => {
if (data['return_code'] == '000000') {
this.tableData = data['return_data'];
}
});
}
/**
*
*/
searchFormSubmit(): void {
this.tablePageNum = 1;
this.queryData();
}
/**
*
*/
searchFormReset(): void {
this.searchForm.reset();
}
/**
*
* @param data
*/
showChainBrandModel(data: any) {
this.editChainBrandForm.patchValue(data);
this.editChainBrandModel = true;
}
/**
*
*/
submitChainBrandModel() {
if (this.editChainBrandForm.valid) {
let param = this.editChainBrandForm.value;
this.merChainBrandService.editChainBrand(param, (data: any) => {
if (data['return_code'] == '000000') {
this.message.create('success', '操作成功');
this.queryData();
// 关闭弹窗
this.closeChainBrandModel();
} else {
this.message.create('error', data['return_msg']);
}
});
} else {
Object.values(this.editChainBrandForm.controls).forEach(control => {
if (control.invalid) {
control.markAsDirty();
control.updateValueAndValidity({ onlySelf: true });
}
});
}
}
/**
*
*/
closeChainBrandModel() {
this.editChainBrandForm.reset();
this.editChainBrandModel = false;
}
}

@ -46,16 +46,6 @@
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="6" [hidden]="!isCollapse">
<nz-form-item>
<nz-form-label>来源渠道</nz-form-label>
<nz-form-control>
<nz-select formControlName="sourceType" nzAllowClear [nzPlaceHolder]="'请选择'">
<nz-option *ngFor="let item of merSourceTypeArray" nzValue="{{item.codeValue}}" nzLabel="{{item.codeName}}"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="24" class="search-area">
<button nz-button [nzType]="'primary'" (click)="searchFormSubmit()">查询</button>
<button nz-button (click)="searchFormReset()">重置</button>
@ -94,7 +84,7 @@
</thead>
<tbody>
<tr *ngFor="let data of basicTable.data">
<td><nz-switch [(ngModel)]="data.listShow" (ngModelChange)="listShowChange($event)"></nz-switch></td>
<td><nz-switch [(ngModel)]="data.listShow" (ngModelChange)="listShowChange(data.merNo)"></nz-switch></td>
<td>{{data.sourceType | dictionary: "MER_SOURCE_TYPE"}}</td>
<td>{{data.chainBrandName?data.chainBrandName:'无'}}</td>
<td>{{data.merNo}}</td>
@ -110,7 +100,12 @@
</a>
<nz-dropdown-menu #menu="nzDropdownMenu">
<ul nz-menu nzSelectable>
<li nz-menu-item><a [routerLink]="['/admin/merchant/mer-edit']" [queryParams]="{ title: '修改油站', merNo: data.merNo}">修改资料</a></li>
<li nz-menu-item><a (click)="showResetPwd(data.merNo)">密码重置</a></li>
<li nz-menu-item *ngIf="data.sourceType == 1"><a (click)="showPayConfigModal(data.merNo)">支付配置</a></li>
<li nz-menu-item><a (click)="showMerQrCode(data.merNo)">油站二维码</a></li>
<li nz-menu-item *ngIf="data.status == 1"><a (click)="showDisable(data.merNo)">禁用油站</a></li>
<li nz-menu-item *ngIf="data.status == 2"><a (click)="showEnable(data.merNo)">启用油站</a></li>
</ul>
</nz-dropdown-menu>
</td>
@ -119,102 +114,196 @@
<ng-template #totalTemplate let-total>总计 {{ total }} 条</ng-template>
</nz-table>
<nz-modal [(nzVisible)]="merDetailVisible" [nzWidth]="1000" nzTitle="商户详情" [nzFooter]="null" (nzOnCancel)="closeMerDetail()">
<nz-modal [(nzVisible)]="merDetailVisible"
[nzWidth]="1000"
nzTitle="油站详情"
[nzFooter]="null"
(nzOnCancel)="closeMerDetail()"
[nzBodyStyle]="{ padding: '0px 10px 10px 10px'}">
<ng-container *nzModalContent>
<nz-descriptions nzBordered [nzColumn]="{ xxl: 2, xl: 2, lg: 2, md: 2, sm: 2, xs: 1 }">
<nz-descriptions-item nzSpan="2" nzTitle="商户标志">
<span *ngIf="merDetailObject.merLogo == null || merDetailObject.merLogo == ''" >未上传</span>
<img *ngIf="merDetailObject.merLogo != null && merDetailObject.merLogo != ''" nz-image width="64px" height="64px" nzSrc="{{IMAGE_URL+merDetailObject.merLogo}}" alt="">
</nz-descriptions-item>
<nz-descriptions-item nzTitle="登录账号">{{merDetailObject.loginName}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="账户角色">{{merDetailObject.roleName}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="商户号">{{merDetailObject.merNo}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="商户名称">{{merDetailObject.merName}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="负责人">{{merDetailObject.directorName}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="联系电话">{{merDetailObject.directorTel}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="客服电话">{{merDetailObject.customerServiceTel}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="详情地址">{{merDetailObject.address}}</nz-descriptions-item>
</nz-descriptions>
<nz-tabset>
<nz-tab nzTitle="基本信息">
<nz-descriptions nzBordered [nzColumn]="{ xxl: 2, xl: 2, lg: 2, md: 2, sm: 2, xs: 1 }">
<nz-descriptions-item nzSpan="2" nzTitle="油站图片">
<span *ngIf="merDetailObject.merchant.merLogo == null || merDetailObject.merchant.merLogo == ''" >未上传</span>
<img *ngIf="merDetailObject.merchant.merLogo != null && merDetailObject.merchant.merLogo != ''" nz-image width="64px" height="64px" style="object-fit: contain;" nzSrc="{{(merDetailObject.merchant.sourceType==1?IMAGE_URL:'')+merDetailObject.merchant.merLogo}}" alt="">
</nz-descriptions-item>
<nz-descriptions-item nzTitle="油站编号">{{merDetailObject.merchant.merNo}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="油站名称">{{merDetailObject.merchant.merName}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="来源渠道">{{merDetailObject.merchant.sourceType | dictionary: "MER_SOURCE_TYPE"}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="油价价区">{{merDetailObject.merchant.oilPriceZoneName}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="所在地区">{{merDetailObject.merchant.provinceName+"/"+merDetailObject.merchant.cityName+"/"+merDetailObject.merchant.areaName}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="详情地址">{{merDetailObject.merchant.address}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="连锁品牌">{{merDetailObject.merchant.chainBrandName?merDetailObject.merchant.chainBrandName:'无'}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="连锁结算方式">
<span *ngIf="merDetailObject.merchant.chainBrandSettleType == null"></span>
<span *ngIf="merDetailObject.merchant.chainBrandSettleType != null">{{merDetailObject.merchant.chainBrandSettleType | dictionary: "MER_CHAIN_BRAND_SETTLE_TYPE"}}</span>
</nz-descriptions-item>
<nz-descriptions-item nzTitle="客户电话">{{merDetailObject.merchant.customerServiceTel}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="油站标签">
<div *ngIf="merDetailObject.merchant.merLabel != null && merDetailObject.merchant.merLabel != ''">
<nz-tag *ngFor="let label of (merDetailObject.merchant.merLabel.split(','))">{{label}}</nz-tag>
</div>
</nz-descriptions-item>
<nz-descriptions-item nzTitle="创建时间">{{merDetailObject.merchant.createTime | date : "yyyy-mm-dd HH:mm"}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="最近更新时间">{{merDetailObject.merchant.updateTime | date: "yyyy-mm-dd HH:mm"}}</nz-descriptions-item>
</nz-descriptions>
</nz-tab>
<nz-tab nzTitle="油价/抢号">
<nz-table #oilsList nzBordered [nzData]="merDetailObject.oils" [nzShowPagination]="false">
<thead>
<tr>
<th>油号</th>
<th>国标价</th>
<th>油枪价</th>
<th>优惠价</th>
<th>枪号</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of oilsList.data">
<td>{{ data.oilNoName }}</td>
<td>{{ data.priceOfficial }}</td>
<td>{{ data.priceGun }}</td>
<td>{{ data.priceVip }}</td>
<td>{{ data.gunNoListStr?data.gunNoListStr+"号枪":""}}</td>
</tbody>
</nz-table>
</nz-tab>
</nz-tabset>
</ng-container>
</nz-modal>
<nz-modal [(nzVisible)]="updateMerVisible" [nzWidth]="500" nzTitle="修改商户资料" [nzFooter]="null" (nzOnCancel)="closeUpdateMer()">
<nz-modal [(nzVisible)]="merQrCodeVisible"
[nzWidth]="700"
nzTitle="油站二维码"
[nzFooter]="null"
(nzOnCancel)="closeMerQrCode()"
[nzBodyStyle]="{ padding: '0px 10px 10px 10px'}">
<ng-container *nzModalContent>
<form nz-form [formGroup]="updateMerForm" (ngSubmit)="submitUpdateMerForm()">
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24">商家标志</nz-form-label>
<nz-form-control [nzSm]="14" [nzXs]="24">
<nz-upload
class="logo-uploader"
nzAction="{{BASE_URL}}fileUpload/uploadfile"
nzName="avatar"
nzListType="picture-card"
[nzShowUploadList]="false"
[nzBeforeUpload]="beforeUpload"
(nzChange)="handleChange($event)"
>
<ng-container *ngIf="!updateMerForm.controls['merLogo'].value">
<i class="upload-icon" nz-icon [nzType]="uploadLoading ? 'loading' : 'plus'"></i>
<div class="ant-upload-text">上传</div>
</ng-container>
<img *ngIf="updateMerForm.controls['merLogo'].value" [src]="IMAGE_URL + updateMerForm.controls['merLogo'].value" style="width: 100%" />
</nz-upload>
</nz-form-control>
</nz-form-item>
<nz-tabset>
<nz-tab *ngFor="let item of merQrCodeData" nzTitle="{{item.codeType | dictionary:'MERCHANT_QR_CODE_TYPE'}}">
<div nz-row style="margin-bottom: 10px;" [nzGutter]="16">
<div nz-col [nzSpan]="10">
<nz-card id="downloadH5" nzHoverable nzTitle="H5端" [nzExtra]="extraTemplateH5">
<nz-qrcode [nzPadding]="20" nzValue="{{item.codeContent}}"></nz-qrcode>
</nz-card>
<ng-template #extraTemplateH5>
<a #download></a>
<a (click)="downloadMerQrCode(1)">点击下载</a>
</ng-template>
</div>
<div nz-col [nzSpan]="10">
<nz-card id="downloadWx" nzHoverable nzTitle="微信小程序" [nzExtra]="extraTemplateWx">
<nz-qrcode [nzPadding]="20" nzValue="{{'https://oil.dctpay.com/gas?merNo='+item.merchantNo}}"></nz-qrcode>
</nz-card>
<ng-template #extraTemplateWx>
<a #download></a>
<a (click)="downloadMerQrCode(2)">点击下载</a>
</ng-template>
</div>
</div>
</nz-tab>
</nz-tabset>
</ng-container>
</nz-modal>
<nz-form-item>
<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="loginName"/>
</nz-form-control>
</nz-form-item>
<nz-modal [(nzVisible)]="payConfigModal"
[nzWidth]="700"
nzTitle="油站支付配置"
[nzFooter]="null"
(nzOnCancel)="closePayConfigModal()">
<ng-container *nzModalContent>
<form nz-form [formGroup]="payConfigForm">
<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 formControlName="roleId">
<nz-option *ngFor="let item of roleData" nzValue="{{item.id}}" nzLabel="{{item.roleName}}"></nz-option>
</nz-select>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>收款商户号</nz-form-label>
<nz-form-control [nzSm]="14" [nzXs]="24">
<input nz-input formControlName="channelMerNo" placeholder="收款商户号"/>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>商户名称</nz-form-label>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>收款商户秘钥</nz-form-label>
<nz-form-control [nzSm]="14" [nzXs]="24">
<input nzSize="large" nz-input formControlName="merName"/>
<input nz-input formControlName="channelMerKey" placeholder="收款商户秘钥"/>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>负责人</nz-form-label>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>是否分账</nz-form-label>
<nz-form-control [nzSm]="14" [nzXs]="24">
<input nzSize="large" nz-input formControlName="directorName"/>
<nz-switch nzCheckedChildren="是" nzUnCheckedChildren="否" formControlName="ledgerAccountFlag"></nz-switch>
</nz-form-control>
</nz-form-item>
<div *ngIf="payConfigForm.controls['ledgerAccountFlag'].value == true">
<button nz-button [nzType]="'primary'" (click)="showLedgerData(-1,null)">增加接收方</button>
<nz-table #smallTable
[nzShowPagination]="false"
nzSize="small"
[nzData]="payConfigForm.controls['ledgerAccountData'].value">
<thead>
<tr>
<th>接收方商户号</th>
<th>接收方商户名称</th>
<th>分账比例</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of smallTable.data;let i = index">
<td>{{data.receiverMerNo}}</td>
<td>{{data.receiverMerName}}</td>
<td>{{data.receiverRatio}}%</td>
<td>
<a (click)="showLedgerData(i,data)">修改</a>
<nz-divider nzType="vertical"></nz-divider>
<a (click)="delLedgerData(i)">删除</a>
</td>
</tr>
</tbody>
</nz-table>
</div>
<div nz-flex style="margin-top: 15px" [nzJustify]="'center'">
<button nz-button nzType="primary" (click)="submitPayConfig()" class="submit-btn">保存</button>
</div>
</form>
</ng-container>
</nz-modal>
<nz-modal [(nzVisible)]="ledgerDataModal"
[nzWidth]="500"
nzTitle="接收方配置"
[nzFooter]="null"
(nzOnCancel)="closeLedgerData()">
<ng-container *nzModalContent>
<form nz-form [formGroup]="ledgerDataForm" (ngSubmit)="submitLedgerData()">
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>联系电话</nz-form-label>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>接收商户号</nz-form-label>
<nz-form-control [nzSm]="14" [nzXs]="24">
<input nzSize="large" nz-input formControlName="directorTel"/>
<input nz-input formControlName="receiverMerNo" placeholder="接收商户号"/>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24">商户地址</nz-form-label>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>接收商户名称</nz-form-label>
<nz-form-control [nzSm]="14" [nzXs]="24">
<input nzSize="large" nz-input formControlName="address"/>
<input nz-input formControlName="receiverMerName" placeholder="接收商户名称"/>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24">客服电话</nz-form-label>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>分账比例</nz-form-label>
<nz-form-control [nzSm]="14" [nzXs]="24">
<input nzSize="large" nz-input formControlName="customerServiceTel"/>
<nz-input-number formControlName="receiverRatio" [nzPrecision]="2" [nzMin]="0" [nzMax]="30" [nzStep]="1"></nz-input-number>
</nz-form-control>
</nz-form-item>
<div nz-flex [nzJustify]="'center'">
<div nz-flex style="margin-top: 15px" [nzJustify]="'center'">
<button nz-button nzType="primary" class="submit-btn">保存</button>
</div>

@ -28,3 +28,6 @@
font-size: 20px;
color: #1890ff;
}
nz-input-number {
width: 100%;
}

@ -1,4 +1,4 @@
import { Component } from '@angular/core';
import {Component, ElementRef, ViewChild} from '@angular/core';
import {DatePipe, NgForOf, NgIf} from "@angular/common";
import {DictionaryPipe} from "../../../pipes/common/dictionary.pipe";
import {FormGroup, FormsModule, NonNullableFormBuilder, ReactiveFormsModule, Validators} from "@angular/forms";
@ -30,11 +30,16 @@ import {MerService} from "../../../services/merchant/mer.service";
import {RoleService} from "../../../services/role/role.service";
import {NzImageModule} from "ng-zorro-antd/image";
import {NzSwitchComponent} from "ng-zorro-antd/switch";
import {DateSelectType} from "../../../utils/dateUtils.service";
import {NzDatePickerComponent, NzRangePickerComponent} from "ng-zorro-antd/date-picker";
import {NzRadioButtonDirective, NzRadioComponent, NzRadioGroupComponent} from "ng-zorro-antd/radio";
import {CommonService} from "../../../services/common/common.service";
import { NzToolTipModule } from 'ng-zorro-antd/tooltip';
import {NzTabsModule} from "ng-zorro-antd/tabs";
import {NzTagModule} from "ng-zorro-antd/tag";
import {NzQRCodeModule} from "ng-zorro-antd/qr-code";
import {NzCardModule} from "ng-zorro-antd/card";
import {NzInputNumberModule} from "ng-zorro-antd/input-number";
import {RouterLink} from "@angular/router";
@Component({
selector: 'app-mer-list',
standalone: true,
@ -82,13 +87,18 @@ import { NzToolTipModule } from 'ng-zorro-antd/tooltip';
NzRadioComponent,
NzRadioGroupComponent,
NzRangePickerComponent,
NzToolTipModule
NzToolTipModule,
NzTabsModule,
NzTagModule,
NzCardModule,
NzInputNumberModule,
NzQRCodeModule,
RouterLink
],
templateUrl: './mer-list.component.html',
styleUrl: './mer-list.component.less'
})
export class MerListComponent {
BASE_URL = environment.baseUrl;
IMAGE_URL = environment.imageUrl;
// 表单页数
tablePageNum = 1;
@ -109,15 +119,22 @@ export class MerListComponent {
merSourceTypeArray = new DictionaryPipe().getDictionaryList('MER_SOURCE_TYPE');
// 地区数据
regionData: any = []
roleData: any = []
merDetailVisible = false;
merDetailObject: any = {};
merDetailObject: any = {
merchant: {},
oils: [],
};
merQrCodeVisible = false;
merQrCodeData: any = [];
// 支付配置表单
payConfigForm: FormGroup;
payConfigModal = false;
merLogo = '';
uploadLoading = false;
updateMerVisible = false;
updateMerForm: FormGroup;
ledgerDataForm: FormGroup;
ledgerDataModal = false;
constructor(private fb: NonNullableFormBuilder,
private merService: MerService,
@ -134,22 +151,22 @@ export class MerListComponent {
status: [''],
});
this.updateMerForm = this.fb.group({
loginName: [{ value: '', disabled: true}, [Validators.required]],
roleId: ['', [Validators.required]],
merLogo: [''],
merNo: [''],
merName: ['', [Validators.required]],
directorName: ['',[Validators.required]],
directorTel: ['',[Validators.required]],
customerServiceTel: [''],
address: [''],
// 初始化表单
this.payConfigForm = this.fb.group({
merNo: ['', [Validators.required]],
channelMerNo: ['', [Validators.required]],
channelMerKey: ['', [Validators.required]],
ledgerAccountFlag: [0, [Validators.required]],
ledgerAccountData: [[]],
});
// 获取角色数据
this.roleService.queryAllRole((data: any) => {
this.roleData = data['return_data'];
this.ledgerDataForm = this.fb.group({
index: ['', [Validators.required]],
receiverMerNo: ['', [Validators.required]],
receiverMerName: ['', [Validators.required]],
receiverRatio: [0, [Validators.required]],
});
// 获取地区
this.commonService.getRegion("", (data: any) => {
this.regionData = data['return_data'];
@ -195,6 +212,10 @@ export class MerListComponent {
this.merService.queryMer(merNo, (data: any) => {
if (data['return_code'] == '000000') {
this.merDetailObject = data['return_data'];
for (let item of this.merDetailObject.oils) {
item['gunNoListStr'] = (item['gunNoList'].map((item: any) => item['gunNo']).join('号枪,'));
}
} else {
this.message.error(data['return_msg']);
}
@ -206,56 +227,174 @@ export class MerListComponent {
*
*/
closeMerDetail() {
this.merDetailObject = {};
this.merDetailObject = {
merchant: {},
oils: [],
};
this.merDetailVisible = false;
}
/**
*
*
* @param merNo
*/
showMerQrCode(merNo: string) {
this.merService.queryQrCodeList(merNo, (data: any) => {
if (data['return_code'] == '000000') {
this.merQrCodeData = data['return_data'];
} else {
this.message.error(data['return_msg']);
}
});
this.merQrCodeVisible = true;
}
/**
*
*/
listShowChange(data: boolean) {
console.log(data);
closeMerQrCode() {
this.merQrCodeVisible = false;
}
/**
*
* @param merData
*
*/
showUpdateMer(merNo: string) {
this.merService.queryMer(merNo, (data: any) => {
listShowChange(merNo: string) {
this.merService.listShow({merNo: merNo}, (data: any) => {
if (data['return_code'] == '000000') {
data['return_data']['roleId'] = String(data['return_data']['roleId']);
this.updateMerForm.patchValue(data['return_data']);
console.log(this.updateMerForm.controls['merLogo'].value);
this.message.success("操作成功");
} else {
this.message.error(data['return_msg']);
}
});
this.updateMerVisible = true;
}
/**
*
*
*/
submitUpdateMerForm() {
if (this.updateMerForm.valid) {
this.merService.update(this.updateMerForm.value, (data: any) => {
if (data['return_code'] == '000000') {
showResetPwd(merNo: string) {
this.modal.confirm({
nzTitle: '提示',
nzContent: '确定重置油站账户登录密码吗?',
nzOnOk: () =>
this.merService.resetPwd({merNo: merNo}, (data: any) => {
if (data['return_code'] == '000000') {
// 刷新数据
this.queryData();
this.modal.success({
nzTitle: '提示',
nzContent: '密码重置成功,新密码:123654'
});
} else {
this.message.create('error', data['return_msg']);
}
})
});
}
this.message.create('success', '操作成功');
/**
*
*/
showDisable(merNo: string) {
this.modal.confirm({
nzTitle: '提示',
nzContent: '确定禁用油站吗?禁用后无法交易',
nzOnOk: () =>
this.merService.disableMer({merNo: merNo}, (data: any) => {
if (data['return_code'] == '000000') {
// 刷新数据
this.queryData();
this.modal.success({
nzTitle: '提示',
nzContent: '操作成功'
});
} else {
this.message.create('error', data['return_msg']);
}
})
});
}
// 关闭弹窗
this.closeUpdateMer();
// 刷新列表
this.queryData();
/**
*
*/
showEnable(merNo: string) {
this.modal.confirm({
nzTitle: '提示',
nzContent: '确定启用油站吗?',
nzOnOk: () =>
this.merService.restoreMer({merNo: merNo}, (data: any) => {
if (data['return_code'] == '000000') {
// 刷新数据
this.queryData();
this.modal.success({
nzTitle: '提示',
nzContent: '操作成功'
});
} else {
this.message.create('error', data['return_msg']);
}
})
});
}
} else {
this.message.create('error', data['return_msg']);
}
});
/**
*
* @param type
*/
@ViewChild('download', { static: false }) download!: ElementRef;
downloadMerQrCode(type: number) {
const canvas = document.getElementById('download'+(type==1?'H5':'Wx'))?.querySelector<HTMLCanvasElement>('canvas');
if (canvas) {
this.download.nativeElement.href = canvas.toDataURL('image/png');
this.download.nativeElement.download = new Date().getTime();
const event = new MouseEvent('click');
this.download.nativeElement.dispatchEvent(event);
}
}
/**
*
* @param merNo
*/
showPayConfigModal(merNo: string) {
this.merService.queryConfig(merNo, (data : any) => {
let returnData = data['return_data'];
if (returnData == null) {
returnData = {
merNo: merNo
};
returnData['ledgerAccountFlag'] = false;
} else {
returnData['ledgerAccountFlag'] = returnData['ledgerAccountFlag']?true:false;
}
if (returnData['ledgerAccountFlag'] == true) {
returnData['ledgerAccountData'] = JSON.parse(returnData['ledgerAccountData']);
}
this.payConfigForm.patchValue(returnData);
});
this.payConfigModal = true;
}
/**
*
*/
submitPayConfig() {
if (this.payConfigForm.valid) {
let param = this.payConfigForm.value;
param['ledgerAccountData'] = JSON.stringify(param['ledgerAccountData']);
this.merService.editPayConfig(param, (data: any) => {
if (data['return_code'] == '000000') {
this.message.create('success', '操作成功');
// 关闭弹窗
this.closePayConfigModal();
} else {
this.message.create('error', data['return_msg']);
}
});
} else {
Object.values(this.updateMerForm.controls).forEach(control => {
Object.values(this.payConfigForm.controls).forEach(control => {
if (control.invalid) {
control.markAsDirty();
control.updateValueAndValidity({ onlySelf: true });
@ -265,89 +404,71 @@ export class MerListComponent {
}
/**
*
*
*/
closeUpdateMer() {
this.updateMerForm.reset();
this.updateMerVisible = false;
closePayConfigModal() {
this.payConfigForm.reset();
this.payConfigModal = false;
}
/**
*
*
* @param arrayIndex
* @param data
*/
showResetPwd(merNo: string) {
this.modal.confirm({
nzTitle: '提示',
nzContent: '确定重置商户账户登录密码吗?',
nzOnOk: () => this.resetPwd(merNo)
});
showLedgerData(arrayIndex: number, data: any) {
if (arrayIndex == -1) {
data = {};
}
data.index = arrayIndex;
this.ledgerDataForm.reset(data);
this.ledgerDataModal = true;
}
/**
*
*
* @param arrayIndex
*/
resetPwd(merNo: string) {
const param = {
merNo: merNo
}
this.merService.resetPwd(param, (data: any) => {
if (data['return_code'] == '000000') {
// 刷新数据
this.queryData();
this.modal.success({
nzTitle: '提示',
nzContent: '密码重置成功,新密码:123456'
});
} else {
this.message.create('error', data['return_msg']);
}
});
}
private getBase64(img: File, callback: (img: string) => void): void {
const reader = new FileReader();
reader.addEventListener('load', () => callback(reader.result!.toString()));
reader.readAsDataURL(img);
delLedgerData(arrayIndex: number) {
let ledgerAccountArr = [...this.payConfigForm.controls['ledgerAccountData'].value];
ledgerAccountArr.splice(arrayIndex,1);
// 数据重新赋值
this.payConfigForm.controls['ledgerAccountData'].setValue(ledgerAccountArr);
}
handleChange(info: { file: NzUploadFile }): void {
switch (info.file.status) {
case 'uploading':
this.uploadLoading = true;
break;
case 'done':
// Get this url from response in real world.
this.getBase64(info.file!.originFileObj!, (img: string) => {
this.uploadLoading = false;
this.merLogo = img;
});
this.updateMerForm.patchValue({ merLogo: info.file.response['return_data'][0]});
break;
case 'error':
this.message.error('网络错误!');
this.uploadLoading = false;
break;
/**
*
*/
submitLedgerData() {
if (this.ledgerDataForm.valid) {
let ledgerAccountArr = [...this.payConfigForm.controls['ledgerAccountData'].value];
if (this.ledgerDataForm.controls['index'].value == -1) {
// 增加数据
this.ledgerDataForm.controls['index'].setValue(ledgerAccountArr.length + 1);
ledgerAccountArr.push(this.ledgerDataForm.value);
} else {
// 更新数据
ledgerAccountArr[this.ledgerDataForm.controls['index'].value] = this.ledgerDataForm.value;
}
// 数据重新赋值
this.payConfigForm.controls['ledgerAccountData'].setValue(ledgerAccountArr);
// 关闭弹窗
this.closeLedgerData();
} else {
Object.values(this.ledgerDataForm.controls).forEach(control => {
if (control.invalid) {
control.markAsDirty();
control.updateValueAndValidity({ onlySelf: true });
}
});
}
}
beforeUpload = (file: NzUploadFile, _fileList: NzUploadFile[]) => {
return new Observable((observer: Observer<boolean>) => {
const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png';
if (!isJpgOrPng) {
this.message.error('只能上传JPG文件!');
observer.complete();
return;
}
const isLt2M = file.size! / 1024 / 1024 < 2;
if (!isLt2M) {
this.message.error('图片必须小于2MB!');
observer.complete();
return;
}
observer.next(isJpgOrPng && isLt2M);
observer.complete();
});
};
protected readonly DateSelectType = DateSelectType;
/**
*
*/
closeLedgerData() {
this.ledgerDataForm.reset();
this.ledgerDataModal = false;
}
}

@ -0,0 +1,158 @@
<form nz-form [formGroup]="searchForm" class="search_form" [nzLayout]="'vertical'">
<div nz-row [nzGutter]="24">
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label>油站编号</nz-form-label>
<nz-form-control>
<input nz-input formControlName="merNo" placeholder="请输入" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label>油站名称</nz-form-label>
<nz-form-control>
<input nz-input formControlName="merName" placeholder="请输入" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label></nz-form-label>
<nz-form-control>
<button nz-button style="margin-right: 8px" [nzType]="'primary'" (click)="searchFormSubmit()">查询</button>
<button nz-button style="margin-right: 8px" (click)="searchFormReset()">重置</button>
</nz-form-control>
</nz-form-item>
</div>
</div>
</form>
<nz-table #basicTable
[nzScroll]="{ x: '1200px' }"
[nzBordered]="true"
[nzFrontPagination]="false"
[nzShowQuickJumper]="true"
[nzShowTotal]="totalTemplate"
[(nzPageIndex)]="tablePageNum"
(nzPageIndexChange)="queryData()"
nzShowSizeChanger
(nzPageSizeChange)="this.tablePageSize = $event;queryData()"
[nzPageSizeOptions]="[ 10, 20, 30, 50, 100 ]"
[nzTotal]="tableData.total"
[nzData]="tableData.list" >
<thead>
<tr>
<th nzWidth="80px">油站编号</th>
<th nzWidth="100px">油站名称</th>
<th nzWidth="120px">油站地址</th>
<th nzWidth="100px">余额</th>
<th nzRight nzWidth="50px">操作</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of basicTable.data">
<td>{{data.merNo}}</td>
<td>{{data.merName}}</td>
<td>{{data.address}}</td>
<td>{{data.amount}} 元</td>
<td nzRight>
<a (click)="showRechargeModal(data)">充值</a>
<nz-divider nzType="vertical"></nz-divider>
<a nz-dropdown [nzDropdownMenu]="menu">
更多
<span nz-icon nzType="down"></span>
</a>
<nz-dropdown-menu #menu="nzDropdownMenu">
<ul nz-menu nzSelectable>
<li nz-menu-item (click)="showRecordModal(data.merNo)"><a >动账记录</a></li>
</ul>
</nz-dropdown-menu>
</tr>
</tbody>
<ng-template #totalTemplate let-total>总计 {{ total }} 条</ng-template>
</nz-table>
<nz-modal [(nzVisible)]="rechargeModal"
[nzWidth]="500"
nzTitle="充值"
[nzFooter]="null"
(nzOnCancel)="closeRechargeModal()">
<ng-container *nzModalContent>
<form nz-form [formGroup]="rechargeForm">
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>油站编号</nz-form-label>
<nz-form-control [nzSm]="14" [nzXs]="24">
<input nz-input formControlName="merNo"/>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>油站名称</nz-form-label>
<nz-form-control [nzSm]="14" [nzXs]="24">
<input nz-input formControlName="merName"/>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>充值金额</nz-form-label>
<nz-form-control [nzSm]="14" [nzXs]="24">
<nz-input-number formControlName="amount" [nzMin]="1" [nzMax]="10" [nzStep]="1" [nzPrecision]="2" [nzPlaceHolder]="'充值金额'"></nz-input-number>
</nz-form-control>
</nz-form-item>
<div nz-flex style="margin-top: 15px" [nzJustify]="'center'">
<button nz-button nzType="primary" class="submit-btn" (click)="rechargeConfirm()">确定</button>
</div>
</form>
</ng-container>
</nz-modal>
<nz-modal [(nzVisible)]="recordModal"
[nzWidth]="1000"
nzTitle="动账记录"
[nzFooter]="null"
(nzOnCancel)="recordModal = !recordModal">
<ng-container *nzModalContent>
<nz-table #recordTable
nzSize="middle"
[nzScroll]="{ x: '1000px' }"
[nzBordered]="true"
[nzFrontPagination]="false"
[nzShowQuickJumper]="true"
[nzShowTotal]="totalTemplate"
[(nzPageIndex)]="recordTablePageNum"
(nzPageIndexChange)="queryRecord()"
[nzTotal]="recordData.total"
[nzData]="recordData.list" >
<thead>
<tr>
<th nzWidth="90px">交易前金额</th>
<th nzWidth="80px">交易金额</th>
<th nzWidth="90px">交易后金额</th>
<th nzWidth="50px">交易类型</th>
<th nzWidth="100px">交易时间</th>
<th nzWidth="120px">交易来源</th>
<!-- <th nzRight nzWidth="50px">操作</th>-->
</tr>
</thead>
<tbody>
<tr *ngFor="let data of recordTable.data">
<td>{{data.beforeAmount}}</td>
<td>{{data.transactionAmount}}</td>
<td>{{data.afterAmount}}</td>
<td>{{data.type==1?'入账':'出账'}}</td>
<td>{{data.createTime | date: 'yyyy-MM-dd HH:mm:ss'}}</td>
<td>{{data.sourceType | dictionary: 'MER_ACCOUNT_RECORD_SOURCE_TYPE'}}</td>
<!-- <td nzRight>
<a >详情</a>
</td>-->
</tr>
</tbody>
<ng-template #totalTemplate let-total>总计 {{ total }} 条</ng-template>
</nz-table>
</ng-container>
</nz-modal>

@ -0,0 +1,6 @@
nz-input-number {
width: 100%;
}
.submit-btn {
width: 150px;
}

@ -0,0 +1,247 @@
import { Component } from '@angular/core';
import {FormGroup, FormsModule, NonNullableFormBuilder, ReactiveFormsModule, Validators} from "@angular/forms";
import {NzMessageService} from "ng-zorro-antd/message";
import {MerChainBrandService} from "../../../services/merchant/mer-chain-brand.service";
import {DatePipe, NgForOf, NgIf} from "@angular/common";
import {DictionaryPipe} from "../../../pipes/common/dictionary.pipe";
import {NzButtonComponent} from "ng-zorro-antd/button";
import {
NzCellFixedDirective,
NzTableCellDirective,
NzTableComponent, NzTableModule,
NzTbodyComponent, NzTheadComponent,
NzThMeasureDirective, NzTrDirective
} from "ng-zorro-antd/table";
import {NzColDirective, NzRowDirective} from "ng-zorro-antd/grid";
import {NzDividerComponent} from "ng-zorro-antd/divider";
import {NzDropDownADirective, NzDropDownDirective, NzDropdownMenuComponent} from "ng-zorro-antd/dropdown";
import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form";
import {NzIconDirective} from "ng-zorro-antd/icon";
import {NzInputDirective} from "ng-zorro-antd/input";
import {NzMenuDirective, NzMenuItemComponent} from "ng-zorro-antd/menu";
import {NzOptionComponent, NzSelectComponent} from "ng-zorro-antd/select";
import {NzModalModule, NzModalService} from "ng-zorro-antd/modal";
import {NzFlexDirective} from "ng-zorro-antd/flex";
import {NzDescriptionsModule} from "ng-zorro-antd/descriptions";
import {NzUploadComponent} from "ng-zorro-antd/upload";
import {NzAvatarModule} from "ng-zorro-antd/avatar";
import {NzImageModule} from "ng-zorro-antd/image";
import {NzSwitchComponent} from "ng-zorro-antd/switch";
import {NzDatePickerComponent} from "ng-zorro-antd/date-picker";
import {MerchantAccountService} from "../../../services/merchant/merchant-account.service";
import {NzInputNumberModule} from "ng-zorro-antd/input-number";
@Component({
selector: 'app-merchant-amount-list',
standalone: true,
imports: [
DatePipe,
DictionaryPipe,
FormsModule,
NgForOf,
NgIf,
NzButtonComponent,
NzCellFixedDirective,
NzColDirective,
NzDividerComponent,
NzDropDownADirective,
NzDropDownDirective,
NzDropdownMenuComponent,
NzFormControlComponent,
NzFormDirective,
NzFormItemComponent,
NzFormLabelComponent,
NzIconDirective,
NzInputDirective,
NzMenuDirective,
NzMenuItemComponent,
NzOptionComponent,
NzRowDirective,
NzSelectComponent,
NzTableCellDirective,
NzTableComponent,
NzTbodyComponent,
NzThMeasureDirective,
NzTheadComponent,
NzTrDirective,
ReactiveFormsModule,
NzTableModule,
NzModalModule,
NzFlexDirective,
NzDescriptionsModule,
NzUploadComponent,
NzAvatarModule,
NzImageModule,
NzSwitchComponent,
NzDatePickerComponent,
NzInputNumberModule
],
templateUrl: './merchant-amount-list.component.html',
styleUrl: './merchant-amount-list.component.less'
})
export class MerchantAmountListComponent {
// 表单页数
tablePageNum = 1;
// 每页数量
tablePageSize = 10;
// 表单数据
tableData: any = {
total: 0,
list: [],
};
// 搜索表单
searchForm: FormGroup;
// 充值表单
rechargeForm: FormGroup;
rechargeModal = false;
// 记录模态框
recordModal = false;
recordMerNo = '';
// 表单页数
recordTablePageNum = 1;
// 每页数量
recordTablePageSize = 10;
recordData: any = {
total: 0,
list: [],
};
constructor(private fb: NonNullableFormBuilder,
private message: NzMessageService,
private merchantAccountService: MerchantAccountService,
private modalService: NzModalService) {
// 初始化搜索框
this.searchForm = this.fb.group({
merNo: [''],
merName: [''],
});
// 初始化搜索框
this.rechargeForm = this.fb.group({
merNo: [null, [Validators.required]],
merName: [null],
amount: [null, [Validators.required]],
});
this.queryData();
}
/**
*
*/
queryData() {
this.searchForm.value.pageNum = this.tablePageNum;
this.searchForm.value.pageSize = this.tablePageSize;
this.searchForm.value.time = new Date().getTime();
this.merchantAccountService.getMerList(this.searchForm.value, (data: any) => {
if (data['return_code'] == '000000') {
this.tableData = data['return_data'];
}
});
}
/**
*
*/
searchFormSubmit(): void {
this.tablePageNum = 1;
this.queryData();
}
/**
*
*/
searchFormReset(): void {
this.searchForm.reset();
}
/**
*
* @param data
*/
showRechargeModal(data: any) {
this.rechargeForm.patchValue(data);
this.rechargeForm.controls['amount'].setValue(0);
this.rechargeForm.controls['merName'].disable();
this.rechargeForm.controls['merNo'].disable();
this.rechargeModal = true;
}
/**
*
*/
rechargeConfirm() {
if (this.rechargeForm.valid) {
this.modalService.confirm({
nzTitle: '充值提醒',
nzContent: '确认为【' + this.rechargeForm.controls['merName'].value + '】油站余额充值:' +this.rechargeForm.controls['amount'].value + '元吗?',
nzOnOk: () => this.submitRecharge()
});
} else {
Object.values(this.rechargeForm.controls).forEach(control => {
if (control.invalid) {
control.markAsDirty();
control.updateValueAndValidity({ onlySelf: true });
}
});
}
}
/**
*
*/
submitRecharge() {
let param = this.rechargeForm.value;
param['merNo'] = this.rechargeForm.controls['merNo'].value;
this.merchantAccountService.recharge(param, (data: any) => {
if (data['return_code'] == '000000') {
this.message.create('success', '操作成功');
this.queryData();
// 关闭弹窗
this.closeRechargeModal();
} else {
this.message.create('error', data['return_msg']);
}
});
}
/**
*
*/
closeRechargeModal() {
this.rechargeForm.reset();
this.rechargeModal = false;
}
/**
*
* @param merNo
*/
showRecordModal(merNo: string) {
if (this.recordMerNo != merNo) {
this.recordMerNo = merNo;
// 查询数据
this.queryRecord();
}
this.recordModal = true;
}
/**
*
*/
queryRecord() {
const param = {
merNo: this.recordMerNo,
pageNum: this.recordTablePageNum,
pageSize: this.recordTablePageSize,
time: this.tablePageSize,
};
this.merchantAccountService.getRecordList(param, (data: any) => {
if (data['return_code'] == '000000') {
this.recordData = data['return_data'];
}
});
}
}

@ -1,8 +1,22 @@
import { Routes } from '@angular/router';
import {MerAddComponent} from "./mer-add/mer-add.component";
import {MerListComponent} from "./mer-list/mer-list.component";
import {MerChainBrandListComponent} from "./mer-chain-brand-list/mer-chain-brand-list.component";
import {MerchantAccountService} from "../../services/merchant/merchant-account.service";
import {MerchantAmountListComponent} from "./merchant-amount-list/merchant-amount-list.component";
import {MerChainBrandAmountService} from "../../services/merchant/mer-chain-brand-amount.service";
import {MerChainBrandAmountComponent} from "./mer-chain-brand-amount/mer-chain-brand-amount.component";
import {DeviceListComponent} from "../device/device-list/device-list.component";
import {OilTaskComponent} from "../mer-oil-price/oil-task/oil-task.component";
import {OilDiscountComponent} from "../mer-oil-price/oil-discount/oil-discount.component";
export const MERCHANT_ROUTES: Routes = [
{ path: 'mer-list', component: MerListComponent },
{ path: 'mer-add', component: MerAddComponent }
{ path: 'mer-edit', component: MerAddComponent },
{ path: 'mer-chain-brand-list', component: MerChainBrandListComponent },
{ path: 'mer-chain-brand-account', component: MerChainBrandAmountComponent },
{ path: 'mer-account', component: MerchantAmountListComponent },
{ path: 'device-list', component: DeviceListComponent },
{ path: 'oil-task-list', component: OilTaskComponent },
{ path: 'oil-discount-list', component: OilDiscountComponent },
];

@ -158,7 +158,6 @@ export class OrderOilListComponent {
private message: NzMessageService,
private modal: NzModalService) {
this.accountType = this.storage.get(DATA)['account']['objectType'];
console.log(this.GAS_REFUND_BTN);
// 退款提示模态框
this.refundForm = this.fb.group({

@ -0,0 +1,73 @@
import { Injectable } from '@angular/core';
import {HttpClient} from "@angular/common/http";
import {environment} from "../../../environments/environment";
import {ObjectData} from "../../utils/objectData.service";
@Injectable({
providedIn: 'root'
})
export class DeviceService {
constructor(private http: HttpClient) { }
/**
*
* @param params
* @param callBack
*/
public editDevice(params: any, callBack:any) {
params.time = new Date().getTime();
this.http.post(environment.baseUrl + 'device/editDevice', params).subscribe(data => {
callBack(data);
});
}
/**
*
* @param params
* @param callBack
*/
public delDevice(params: any, callBack:any) {
params.time = new Date().getTime();
this.http.post(environment.baseUrl + 'device/delDevice', params).subscribe(data => {
callBack(data);
});
}
/**
*
* @param params
* @param callBack
*/
public getDeviceList(params: any, callBack:any) {
params.time = new Date().getTime();
this.http.get(environment.baseUrl + 'device/getDeviceList?'+ObjectData.objectByString(params)).subscribe(data => {
callBack(data);
});
}
/**
*
* @param params
* @param callBack
*/
public getSettingReceipt(params: any, callBack:any) {
params.time = new Date().getTime();
this.http.get(environment.baseUrl + 'device/getSettingReceipt?'+ObjectData.objectByString(params)).subscribe(data => {
callBack(data);
});
}
/**
*
* @param params
* @param callBack
*/
public settingReceipt(params: any, callBack:any) {
params.time = new Date().getTime();
this.http.get(environment.baseUrl + 'device/settingReceipt', params).subscribe(data => {
callBack(data);
});
}
}

@ -0,0 +1,48 @@
import { Injectable } from '@angular/core';
import {HttpClient} from "@angular/common/http";
import {environment} from "../../../environments/environment";
import {ObjectData} from "../../utils/objectData.service";
@Injectable({
providedIn: 'root'
})
export class OilDiscountService {
constructor(private http: HttpClient) { }
/**
*
* @param params
* @param callBack
*/
public batchAddTask(params: any, callBack:any) {
params.time = new Date().getTime();
this.http.post(environment.baseUrl + 'gasOilPriceTask/batchAddTask', params).subscribe(data => {
callBack(data);
});
}
/**
*
* @param params
* @param callBack
*/
public delTask(params: any, callBack:any) {
params.time = new Date().getTime();
this.http.post(environment.baseUrl + 'gasOilPriceTask/delTask', params).subscribe(data => {
callBack(data);
});
}
/**
*
* @param params
* @param callBack
*/
public getTaskList(params: any, callBack:any) {
params.time = new Date().getTime();
this.http.get(environment.baseUrl + 'gasOilPriceTask/getTaskList?'+ObjectData.objectByString(params)).subscribe(data => {
callBack(data);
});
}
}

@ -0,0 +1,49 @@
import { Injectable } from '@angular/core';
import {HttpClient} from "@angular/common/http";
import {environment} from "../../../environments/environment";
import {ObjectData} from "../../utils/objectData.service";
@Injectable({
providedIn: 'root'
})
export class OilTaskService {
constructor(private http: HttpClient) { }
/**
*
* @param params
* @param callBack
*/
public batchAddTask(params: any, callBack:any) {
params.time = new Date().getTime();
this.http.post(environment.baseUrl + 'gasOilPriceTask/batchAddTask', params).subscribe(data => {
callBack(data);
});
}
/**
*
* @param params
* @param callBack
*/
public delTask(params: any, callBack:any) {
params.time = new Date().getTime();
this.http.post(environment.baseUrl + 'gasOilPriceTask/delTask', params).subscribe(data => {
callBack(data);
});
}
/**
*
* @param params
* @param callBack
*/
public getTaskList(params: any, callBack:any) {
params.time = new Date().getTime();
this.http.get(environment.baseUrl + 'gasOilPriceTask/getTaskList?'+ObjectData.objectByString(params)).subscribe(data => {
callBack(data);
});
}
}

@ -0,0 +1,49 @@
import { Injectable } from '@angular/core';
import {HttpClient} from "@angular/common/http";
import {environment} from "../../../environments/environment";
import {ObjectData} from "../../utils/objectData.service";
@Injectable({
providedIn: 'root'
})
export class MerChainBrandAmountService {
constructor(private http: HttpClient) { }
/**
*
* @param params
* @param callBack
*/
public recharge(params: any, callBack:any) {
params.time = new Date().getTime();
this.http.post(environment.baseUrl + 'merchantChainBrandAccount/recharge', params).subscribe(data => {
callBack(data);
});
}
/**
*
* @param params
* @param callBack
*/
public getAccount(params: any, callBack:any) {
params.time = new Date().getTime();
this.http.get(environment.baseUrl + 'merchantChainBrandAccount/getAccount?'+ObjectData.objectByString(params)).subscribe(data => {
callBack(data);
});
}
/**
*
* @param params
* @param callBack
*/
public getRecordList(params: any, callBack:any) {
params.time = new Date().getTime();
this.http.get(environment.baseUrl + 'merchantChainBrandAccount/getRecordList?'+ObjectData.objectByString(params)).subscribe(data => {
callBack(data);
});
}
}

@ -0,0 +1,36 @@
import { Injectable } from '@angular/core';
import {HttpClient} from "@angular/common/http";
import {environment} from "../../../environments/environment";
import {ObjectData} from "../../utils/objectData.service";
@Injectable({
providedIn: 'root'
})
export class MerChainBrandService {
constructor(private http: HttpClient) { }
/**
*
* @param params
* @param callBack
*/
public editChainBrand(params: any, callBack:any) {
params.time = new Date().getTime();
this.http.post(environment.baseUrl + 'merchantChainBrand/editChainBrand', params).subscribe(data => {
callBack(data);
});
}
/**
*
* @param params
* @param callBack
*/
public getList(params: any, callBack:any) {
params.time = new Date().getTime();
this.http.get(environment.baseUrl + 'merchantChainBrand/getList?' + ObjectData.objectByString(params)).subscribe(data => {
callBack(data);
});
}
}

@ -11,25 +11,25 @@ export class MerService {
constructor(private http: HttpClient) { }
/**
*
*
* @param params
* @param callBack
*/
public create(params: any, callBack:any) {
public editMerchant(params: any, callBack:any) {
params.time = new Date().getTime();
this.http.post(environment.baseUrl + 'mer/create', params).subscribe(data => {
this.http.post(environment.baseUrl + 'merchant/editMerchant', params).subscribe(data => {
callBack(data);
});
}
/**
*
*
* @param params
* @param callBack
*/
public update(params: any, callBack:any) {
public listShow(params: any, callBack:any) {
params.time = new Date().getTime();
this.http.post(environment.baseUrl + 'mer/update', params).subscribe(data => {
this.http.post(environment.baseUrl + 'merchant/listShow', params).subscribe(data => {
callBack(data);
});
}
@ -41,7 +41,31 @@ export class MerService {
*/
public resetPwd(params: any, callBack:any) {
params.time = new Date().getTime();
this.http.post(environment.baseUrl + 'mer/resetPwd', params).subscribe(data => {
this.http.post(environment.baseUrl + 'merchant/resetMerPwd', params).subscribe(data => {
callBack(data);
});
}
/**
*
* @param params
* @param callBack
*/
public restoreMer(params: any, callBack:any) {
params.time = new Date().getTime();
this.http.post(environment.baseUrl + 'merchant/restoreMer', params).subscribe(data => {
callBack(data);
});
}
/**
*
* @param params
* @param callBack
*/
public disableMer(params: any, callBack:any) {
params.time = new Date().getTime();
this.http.post(environment.baseUrl + 'merchant/disableMer', params).subscribe(data => {
callBack(data);
});
}
@ -52,7 +76,7 @@ export class MerService {
* @param callBack
*/
public queryMer(merNo: string, callBack:any) {
this.http.get(environment.baseUrl + 'mer/queryMer?merNo=' + merNo + '&dt=' + new Date().getTime()).subscribe(data => {
this.http.get(environment.baseUrl + 'merchant/queryMerDetail?merNo=' + merNo + '&dt=' + new Date().getTime()).subscribe(data => {
callBack(data);
});
}
@ -68,4 +92,37 @@ export class MerService {
callBack(data);
});
}
/**
*
* @param merNo
* @param callBack
*/
public queryQrCodeList(merNo: any, callBack:any) {
this.http.get(environment.baseUrl + 'merchantQrCode/queryQrCodeList?merNo='+merNo).subscribe(data => {
callBack(data);
});
}
/**
*
* @param merNo
* @param callBack
*/
public editPayConfig(param: any, callBack:any) {
this.http.post(environment.baseUrl + 'merchantPayConfig/editConfig', param).subscribe(data => {
callBack(data);
});
}
/**
*
* @param merNo
* @param callBack
*/
public queryConfig(merNo: any, callBack:any) {
this.http.get(environment.baseUrl + 'merchantPayConfig/queryConfig?merNo='+merNo+'&dt'+new Date().getTime()).subscribe(data => {
callBack(data);
});
}
}

@ -0,0 +1,63 @@
import { Injectable } from '@angular/core';
import {HttpClient} from "@angular/common/http";
import {environment} from "../../../environments/environment";
import {ObjectData} from "../../utils/objectData.service";
@Injectable({
providedIn: 'root'
})
export class MerchantAccountService {
constructor(private http: HttpClient) { }
/**
*
* @param params
* @param callBack
*/
public recharge(params: any, callBack:any) {
params.time = new Date().getTime();
this.http.post(environment.baseUrl + 'merchantAccount/recharge', params).subscribe(data => {
callBack(data);
});
}
/**
*
* @param params
* @param callBack
*/
public getMerList(params: any, callBack:any) {
params.time = new Date().getTime();
this.http.get(environment.baseUrl + 'merchantAccount/getMerList?'+ObjectData.objectByString(params)).subscribe(data => {
callBack(data);
});
}
/**
*
* @param params
* @param callBack
*/
public getAccount(params: any, callBack:any) {
params.time = new Date().getTime();
this.http.get(environment.baseUrl + 'merchantAccount/getAccount?'+ObjectData.objectByString(params)).subscribe(data => {
callBack(data);
});
}
/**
*
* @param params
* @param callBack
*/
public getRecordList(params: any, callBack:any) {
params.time = new Date().getTime();
this.http.get(environment.baseUrl + 'merchantAccount/getRecordList?'+ObjectData.objectByString(params)).subscribe(data => {
callBack(data);
});
}
}

File diff suppressed because it is too large Load Diff

@ -6,6 +6,7 @@
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
<script src="https://map.qq.com/api/js?v=2.exp&key=7UMBZ-HFEHX-HSD4Q-Z3QY6-OQKN7-2QBDB"></script>
</head>
<body>
<app-root></app-root>

Loading…
Cancel
Save