提交代码

pull/1/head
胡锐 3 years ago
parent 8cfbe6cf2b
commit 7106b88c6b
  1. 37
      src/app/admin/index/index/index.component.html
  2. 20
      src/app/admin/index/index/index.component.ts
  3. 19
      src/app/admin/merchant/merchant-list/merchant-list.component.html
  4. 57
      src/app/admin/merchant/merchant-list/merchant-list.component.ts
  5. 4
      src/app/admin/order/oil-station-order/oil-station-order.component.html
  6. 3
      src/app/admin/order/oil-station-order/oil-station-order.component.ts
  7. 14
      src/app/services/gas.service.ts
  8. 13
      src/app/services/index.service.ts
  9. 28
      src/app/services/mer-amount.service.ts

@ -8,7 +8,7 @@
<!--条件搜索-->
<div class="inner-content" *ngIf="adminInfoObject['merchantStore'] != null && adminInfoObject['merchantStore']['type'] == 1">
<div *ngIf="adminInfoObject['merchantStore']['prestoreType'] == 1" style="width: 100%;text-align: center;">
<!--<div *ngIf="adminInfoObject['merchantStore']['prestoreType'] == 1" style="width: 100%;text-align: center;">
<nz-row [nzGutter]="16">
<nz-col [nzSpan]="24">
<nz-statistic [nzValue]="'' + balanceData['amounts']" [nzTitle]="'预存账户余额'" [nzSuffix]="suffixTpl"></nz-statistic>
@ -16,7 +16,7 @@
</nz-col>
</nz-row>
</div>
<br/><br/><br/>
<br/><br/><br/>-->
<nz-card nzTitle="历史加油订单">
<nz-row [nzGutter]="16">
<nz-col [nzSpan]="4">
@ -64,6 +64,39 @@
</nz-card>
</div>
<!--条件搜索-->
<div class="inner-content" *ngIf="roleType == 2">
<div style="width: 100%;text-align: center;">
<nz-row [nzGutter]="16">
<nz-col [nzSpan]="24">
<nz-statistic [nzValue]="'' + merGasCount['amount']" [nzTitle]="'预存账户余额'"></nz-statistic>
</nz-col>
</nz-row>
</div>
<br/><br/><br/>
<nz-card nzTitle="油站加油金额">
<nz-table #basicTable [nzData]="merGasCount.storeList" [nzHideOnSinglePage]="true">
<thead>
<tr>
<th>序号</th>
<th>油站名称</th>
<th>油站地址</th>
<th>油站加油总额</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of basicTable.data;let i = index;">
<td>{{ i + 1 }}</td>
<td>{{ data.store_name }}</td>
<td>{{ data.address }}</td>
<td>{{ '¥' + data.countPrice }}</td>
</tr>
</tbody>
</nz-table>
</nz-card>
</div>
<!--渠道公司-->
<div class="inner-content" *ngIf="roleType == 7">
<div nz-row >

@ -34,6 +34,10 @@ export class IndexComponent implements OnInit {
history: {},
today: {},
};
merGasCount: any = {
amount: 0,
storeList: []
};
recordList = [];
tyBalance;
webSocket: WebSocket;
@ -72,6 +76,10 @@ export class IndexComponent implements OnInit {
this.getGasAccount();
}
}
if (this.store.get(ADMIN_INFO_OBJECT)['secUser']['objectType'] === 2) {
this.getMerGasStatistical();
}
}
// 查询余额
@ -272,6 +280,18 @@ export class IndexComponent implements OnInit {
});
}
// 查询加油站统计
public getMerGasStatistical(): void {
this.index.getMerGasStatistical(data => {
if (data['return_code'] === '000000') {
this.merGasCount = data['return_data'];
this.loading = false;
} else {
this.message.error(data['return_msg']);
}
});
}
// 查询预存账户油站记录
public getGasAccountRecord(): void {
const paramsObject = {

@ -80,7 +80,7 @@
<th nzWidth="100px">商户电话</th>
<th nzWidth="100px">创建时间</th>
<th nzWidth="50px">状态</th>
<th nzWidth="80px" nzRight="0px">操作</th>
<th nzWidth="100px" nzRight="0px">操作</th>
</tr>
</thead>
<tbody>
@ -103,10 +103,27 @@
<nz-divider nzType="vertical"></nz-divider>
<a *ngIf="data.status === 1" (click)='disableMerchant(data.id)'><i nz-icon nzType="stop" nzTheme="outline" nz-tooltip="禁用"></i></a>
<a *ngIf="data.status !== 1" (click)='enableMerchant(data.id)'><i nz-icon nzType="check-circle" nzTheme="outline" nz-tooltip="启用"></i></a>
<nz-divider nzType="vertical"></nz-divider>
<a (click)='showRechargeModal(data.id)'><i nz-icon nzType="dollar" nzTheme="outline" nz-tooltip="余额充值"></i></a>
</td>
</tbody>
</nz-table>
</div>
<nz-modal [(nzVisible)]="rechargeModal" nzTitle="余额充值" (nzOnCancel)="closeRechargeModal()" nzWidth="500px" [nzFooter]="null">
<form nz-form [formGroup]="rechargeForm">
<nz-form-item>
<nz-form-label [nzSpan]="6" nzRequired >充值金额</nz-form-label>
<nz-form-control [nzSpan]="14">
<nz-input-number style="width: 100%" formControlName="amount" [nzMin]="0.01" [nzMax]="1000" [nzStep]="1" [nzPrecision]="2"></nz-input-number>
</nz-form-control>
</nz-form-item>
<div style="text-align: center;">
<button nz-button nzType="primary" style="width: 150px;" (click)="submitRecharge()">确定</button>
</div>
</form>
</nz-modal>

@ -1,11 +1,12 @@
import { Component, OnInit } from '@angular/core';
import {FormBuilder, FormGroup} from '@angular/forms';
import {FormBuilder, FormGroup, Validators} from '@angular/forms';
import {IconService} from '../../../services/icon.service';
import {NzMessageService} from 'ng-zorro-antd';
import {NzMessageService, NzModalService} from 'ng-zorro-antd';
import {CommonsService} from '../../../services/commons.service';
import {MerchantService} from '../../../services/merchant.service';
import {Router} from '@angular/router';
import {environment} from '../../../../environments/environment';
import {MerAmountService} from "../../../services/mer-amount.service";
@Component({
selector: 'app-merchant-list',
@ -21,13 +22,18 @@ export class MerchantListComponent implements OnInit {
pageSize = 10; // 条码
loading = true;
rechargeModal = false;
rechargeForm: FormGroup; // 充值模态框
constructor(
private form: FormBuilder,
private merchant: MerchantService,
private iconService: IconService,
private message: NzMessageService,
private merAmountService: MerAmountService,
private router: Router,
private common: CommonsService
private common: CommonsService,
private modal: NzModalService,
) {
}
@ -42,6 +48,11 @@ export class MerchantListComponent implements OnInit {
telephone: [null],
status: [null],
});
this.rechargeForm = this.form.group({
merId: [null],
amount: [null, [Validators.required]],
});
this.getRequest(true, this.searchForm.value);
}
@ -131,5 +142,45 @@ export class MerchantListComponent implements OnInit {
}
}).then(r => console.log(r));
}
showRechargeModal(merId: number) {
this.rechargeForm.patchValue({ merId: merId});
this.rechargeModal = true;
}
closeRechargeModal() {
this.rechargeModal = false;
}
submitRecharge() {
for (const i in this.rechargeForm.controls) {
this.rechargeForm.controls[i].markAsDirty();
this.rechargeForm.controls[i].updateValueAndValidity();
}
if (this.rechargeForm.status == null || this.rechargeForm.status !== 'VALID') {
this.modal.warning({
nzTitle: '提示',
nzContent: '请填写所有必填项',
});
return;
}
this.merAmountService.recharge(this.rechargeForm.value, data => {
if (data['return_code'] === '000000') {
this.modal.success({
nzTitle: '提示',
nzContent: '充值成功',
});
this.closeRechargeModal();
} else {
this.modal.error({
nzTitle: '提示',
nzContent: data['return_msg'],
});
}
});
}
}

@ -111,8 +111,8 @@
<td nzRight>{{data.status | orderCouponStatus}}</td>
<td nzRight class="table-td-operation">
<a (click)="getDetail(data.orderNo)">详情</a>
<nz-divider *ngIf="data.status == 2 || data.status == 3 " nzType="vertical" ></nz-divider>
<a *ngIf="data.status == 2 || data.status == 3 " (click)="showModal(data.orderId)">退款</a>
<nz-divider *ngIf="(secUser['objectType'] != 8) && (data.status == 2 || data.status == 3)" nzType="vertical" ></nz-divider>
<a *ngIf="(secUser['objectType'] != 8) && (data.status == 2 || data.status == 3)" (click)="showModal(data.orderId)">退款</a>
</td>
</tbody>
</nz-table>

@ -10,6 +10,7 @@ import {MerchantService} from '../../../services/merchant.service';
import {LocalStorageService} from '../../../services/local-storage.service';
import {CommonsService} from '../../../services/commons.service';
import {WebsocketService} from '../../../services/websocket.service';
import {ADMIN_INFO_OBJECT} from "../../../services/local-storage.namespace";
@Component({
selector: 'app-oil-station-order',
@ -34,6 +35,7 @@ export class OilStationOrderComponent implements OnInit {
isVisibleDetail = false;
refundContent: string;
roleType: number;
secUser: object;
constructor(
private form: FormBuilder,
private order: OrderService,
@ -49,6 +51,7 @@ export class OilStationOrderComponent implements OnInit {
}
ngOnInit(): void {
this.secUser = this.store.get(ADMIN_INFO_OBJECT)['secUser'];
this.init();
// 接收消息
this.webSocketService.messageSubject.subscribe(

@ -1,7 +1,7 @@
import { Injectable } from '@angular/core';
import {HttpClient} from '_@angular_common@9.0.7@@angular/common/http';
import {CommonsService} from './commons.service';
import {environment} from "../../environments/environment";
import {environment} from '../../environments/environment';
@Injectable({
providedIn: 'root'
@ -13,6 +13,18 @@ export class GasService {
private common: CommonsService
) { }
/**
*
*
* @param param
* @param callBack
*/
public getMerGasStatistical(param: object, callBack) {
this.http.post(environment.baseUrl + 'highGas/getMerGasStatistical', param).subscribe(data => {
callBack(data);
});
}
/**
*
*

@ -164,6 +164,19 @@ export class IndexService {
});
}
/**
* @Author Sum1Dream
* @methodName getGasStatistical
* @Description // 查询加油站统计
* @Date 10:00 2022/5/18
* @Param
*/
public getMerGasStatistical(callBack) {
this.http.post(environment.baseUrl + 'highGas/getMerGasStatistical', null).subscribe(data => {
callBack(data);
});
}
/**
* @Author Sum1Dream
* @methodName getAccountRecordList

@ -0,0 +1,28 @@
import { Injectable } from '@angular/core';
import {HttpClient} from '_@angular_common@9.0.7@@angular/common/http';
import {CommonsService} from './commons.service';
import {environment} from '../../environments/environment';
@Injectable({
providedIn: 'root'
})
export class MerAmountService {
constructor(
private http: HttpClient,
private common: CommonsService
) { }
/**
*
*
* @param params
* @param callBack
* @return data
*/
public recharge(params: object, callBack) {
this.http.post(environment.baseUrl + 'merAccount/recharge', params).subscribe(data => {
callBack(data);
});
}
}
Loading…
Cancel
Save