Merge branch 'master' into dev

pull/1/head
胡锐 3 years ago
commit 2eb859db4d
  1. 14
      src/app/admin/api-merchants/api-merchants-routing.module.ts
  2. 29
      src/app/admin/api-merchants/api-merchants.module.ts
  3. 297
      src/app/admin/api-merchants/list/list.component.html
  4. 0
      src/app/admin/api-merchants/list/list.component.scss
  5. 465
      src/app/admin/api-merchants/list/list.component.ts
  6. 14
      src/app/admin/api-product/api-product-routing.module.ts
  7. 29
      src/app/admin/api-product/api-product.module.ts
  8. 195
      src/app/admin/api-product/list/list.component.html
  9. 0
      src/app/admin/api-product/list/list.component.scss
  10. 233
      src/app/admin/api-product/list/list.component.ts
  11. 2
      src/app/admin/index/index/index.component.ts
  12. 2
      src/app/admin/order/oil-station-order/oil-station-order.component.ts
  13. 208
      src/app/admin/order/order-h-list/order-h-list.component.html
  14. 310
      src/app/admin/order/order-h-list/order-h-list.component.ts
  15. 12
      src/app/admin/recharge-order/order-list/order-list.component.html
  16. 396
      src/app/admin/recharge-order/order-list/order-list.component.ts
  17. 4
      src/app/app-common.module.ts
  18. 270
      src/app/app-routing.module.ts
  19. 18
      src/app/pipes/apiMerchant/source-type.pipe.ts
  20. 1
      src/app/pipes/index.ts
  21. 2
      src/app/pipes/recharge-status.pipe.ts
  22. 170
      src/app/services/api-merchants.service.ts
  23. 97
      src/app/services/api-product.service.ts
  24. 14
      src/app/services/commons.service.ts
  25. 1
      src/app/services/order.service.ts
  26. 8
      src/environments/environment.ts

@ -0,0 +1,14 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import {ListComponent} from './list/list.component';
const routes: Routes = [
{ path: 'list', component: ListComponent },
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class ApiMerchantsRoutingModule { }

@ -0,0 +1,29 @@
import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {ApiMerchantsRoutingModule} from './api-merchants-routing.module';
import {ListComponent} from './list/list.component';
import {NgZorroAntdModule} from '_ng-zorro-antd@9.3.0@ng-zorro-antd';
import {SeparateModule} from '../../common/separate/separate.module';
import {FormsModule, ReactiveFormsModule} from '_@angular_forms@9.0.7@@angular/forms';
import {BreadcrumbModule} from '../../common/breadcrumb/breadcrumb.module';
import {RegionSelectorModule} from '../../common/region-selector/region-selector.module';
import {AppCommonModule} from '../../app-common.module';
@NgModule({
declarations: [ListComponent],
imports: [
CommonModule,
ApiMerchantsRoutingModule,
NgZorroAntdModule,
SeparateModule,
ReactiveFormsModule,
FormsModule,
BreadcrumbModule,
RegionSelectorModule,
AppCommonModule
]
})
export class ApiMerchantsModule {
}

@ -0,0 +1,297 @@
<!-- start 面包屑 -->
<app-breadcrumb></app-breadcrumb>
<!-- end 面包屑 -->
<!--条件搜索-->
<div class="inner-content">
<form nz-form [formGroup]="searchForm" (ngSubmit)="getRequest(true , searchForm.value)">
<div nz-row>
<div nz-col nzSpan="8">
<nz-form-item>
<nz-form-label [nzSpan]="6">商户名称</nz-form-label>
<nz-form-control [nzSpan]="16">
<input nz-input formControlName="merchantName"/>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="8">
<nz-form-item>
<nz-form-label [nzSpan]="6">商户号</nz-form-label>
<nz-form-control [nzSpan]="16">
<input nz-input formControlName="mchId"/>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="8">
<nz-form-item>
<nz-form-label [nzSpan]="6">商户电话</nz-form-label>
<nz-form-control [nzSpan]="16">
<input nz-input formControlName="phone"/>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="8">
<nz-form-item>
<nz-form-label [nzSpan]="6">状态</nz-form-label>
<nz-form-control [nzSpan]="16">
<nz-select nzShowSearch nzAllowClear formControlName="status" nzPlaceHolder="请选择状态">
<nz-option nzLabel="正常" [nzValue]="100"></nz-option>
<nz-option nzLabel="禁用" [nzValue]="101"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
</div>
<div nz-row>
<div nz-col nzSpan="24" class="search-button">
<button nz-button nzType="primary"><i nz-icon nzType="search" nzTheme="outline"></i>搜索</button>
<button nz-button nzType="default" (click)="resetForm()"><i nz-icon nzType="reload"
nzTheme="outline"></i>重置
</button>
</div>
</div>
</form>
</div>
<div class="inner-content">
<span>共计 {{total}} 条数据</span>
<div class="operating-button">
<button nz-button nzType="primary" class="right-btn" (click)="getEdit()"><i nz-icon nzType="plus" nzTheme="outline"></i>添加</button>
<button nz-button nzType="primary" class="right-btn" (click)="showRechargeModal()" ><i nz-icon nzType="plus" nzTheme="outline"></i>账户充值</button>
</div>
<nz-table
class="table"
#ajaxTable
nzShowSizeChanger
[nzFrontPagination]="false"
[nzData]="requestData"
[nzLoading]="loading"
[nzTotal]="total"
[(nzPageIndex)]="pageNum"
[(nzPageSize)]="pageSize"
[nzScroll]="{ x: '1200px' }"
(nzPageIndexChange)="getRequest(false , searchForm.value)"
(nzPageSizeChange)="getRequest(false , searchForm.value)">
<thead nzSingleSort>
<tr>
<th nzWidth="60px">编号</th>
<th nzWidth="90px">商户名称</th>
<th nzWidth="80px">联系人</th>
<th nzWidth="80px">电话</th>
<th nzWidth="90px">商户号</th>
<th nzWidth="160px">商户KEY</th>
<th nzWidth="80px">操作人员</th>
<th nzWidth="120px">创建时间</th>
<th nzRight nzWidth="100px">帐户余额</th>
<th nzRight nzWidth="60px">状态</th>
<th nzRight nzWidth="200px">操作</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of ajaxTable.data; let i = index">
<td>{{i + 1}}</td>
<td>{{data.merchantName}}</td>
<td>{{data.userName }}</td>
<td>{{data.phone }}</td>
<td>{{data.mchId }}</td>
<td>{{data.apiKey }}</td>
<td>{{data.operatorName }}</td>
<td>{{data.createTime | date: 'yyyy-MM-dd HH:mm'}}</td>
<td nzRight="">¥{{data.amounts}}</td>
<td nzRight="">{{data.status== 100? '正常':'禁用'}}</td>
<td nzRight class="table-td-operation">
<a *ngIf="data.status != 101" (click)="getEdit(data.id)">编辑</a>
<nz-divider nzType="vertical"></nz-divider>
<a nz-dropdown [nzDropdownMenu]="menu">更多操作</a>
<nz-dropdown-menu #menu="nzDropdownMenu">
<ul nz-menu nzSelectable>
<li class="li-a" nz-menu-item><a (click)="configProduct(data.id)">配置产品</a></li>
<li class="li-a" nz-menu-item><a (click)="showConfigProduct(data.id)">产品详情</a></li>
<li class="li-a" nz-menu-item><a (click)="getMerchRechargeData(data.id)">金额记录</a></li>
<li class="li-a" nz-menu-item><a (click)='getForbiddenUser(data.id , data.status)'>{{data.status === 101 ? '上线': '禁用'}}</a></li>
</ul>
</nz-dropdown-menu>
</td>
</tbody>
</nz-table>
</div>
<nz-modal [(nzVisible)]="isVisible" nzTitle="商户编辑" (nzOnCancel)="handleCancel()" (nzOnOk)="handleOk()">
<form nz-form [formGroup]="validateForm" class="login-form">
<nz-form-item>
<nz-form-label [nzSpan]="6" nzRequired>商户名称</nz-form-label>
<nz-form-control [nzSpan]="16" nzErrorTip="请输入商户名称!">
<input nz-input formControlName="merchantName" />
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSpan]="6" nzRequired>商户联系人</nz-form-label>
<nz-form-control [nzSpan]="16" nzErrorTip="请输入商户联系人!">
<input nz-input formControlName="userName" />
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSpan]="6" nzRequired>商户电话</nz-form-label>
<nz-form-control [nzSpan]="16" nzErrorTip="请输入商户电话!">
<input nz-input formControlName="phone" />
</nz-form-control>
</nz-form-item>
</form>
</nz-modal>
<nz-modal [(nzVisible)]="rechargeModal" nzTitle="账户充值" (nzOnCancel)="rechargeModal = false" 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-select nzShowSearch nzAllowClear nzPlaceHolder="请选择商户" formControlName="merchantId">
<nz-option *ngFor="let data of merchantArray" nzLabel="{{data.merchantName}}" nzValue="{{data.id}}"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
<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" [nzMax]="9999999" [nzStep]="1" [nzPrecision]="2"></nz-input-number>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSpan]="6" nzRequired >验证码</nz-form-label>
<nz-form-control [nzSpan]="14">
<nz-input-group nzSearch [nzAddOnAfter]="suffixButton">
<input nz-input formControlName="smsCode" />
</nz-input-group>
<ng-template #suffixButton>
<button nz-button nzType="primary" [disabled]="smsCodeBtnLoading" (click)="sendSmsCode()">{{smsCodeBtnName}}</button>
</ng-template>
<span *ngIf="smsCodeBtnLoading" nz-typography nzType="warning">验证码已发送!5分钟内有效</span>
</nz-form-control>
</nz-form-item>
<div style="text-align: center;">
<button nz-button nzType="primary" style="width: 150px;" [nzLoading]="submitRechargeBtnLoading" (click)="submitRecharge()">确定</button>
</div>
</form>
</nz-modal>
<nz-modal [(nzVisible)]="visible" nzTitle="商户充值记录" (nzOnCancel)="visible = false" nzWidth="1000px" [nzFooter]="null">
<nz-table #errorStudentTable [nzScroll]="{ x: '1200px' }" [nzData]="merchRechargeData">
<thead>
<tr>
<th nzWidth="100px">类型</th>
<th nzWidth="100px">交易金额</th>
<th nzWidth="120px">变更前金额</th>
<th nzWidth="120px">变更后金额</th>
<th nzWidth="100px">来源类型</th>
<th nzWidth="300px">来源内容</th>
<th nzWidth="130px">操作人</th>
<th nzWidth="200px">记录时间</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of errorStudentTable.data;let i = index">
<td>{{data.amountType | companyAmountRecordType}}</td>
<td>¥{{data.amount}}</td>
<td>¥{{data.beforeAmount}}</td>
<td>¥{{data.afterAmount}}</td>
<td>{{data.sourceType | sourceType}}</td>
<td>{{data.sourceContent}}</td>
<td>{{data.operatorName}}</td>
<td>{{data.createTime | date : 'yyyy-MM-dd HH:mm:ss'}}</td>
</tr>
</tbody>
</nz-table>
</nz-modal>
<nz-modal [(nzVisible)]="configVisible" nzTitle="产品配置" (nzOnCancel)="configVisible = false" (nzOnOk)="handleOkConfig()">
<form nz-form [formGroup]="configValidateForm" class="login-form">
<nz-form-item *ngIf="!edit">
<nz-form-label [nzSpan]="6" nzRequired>选择产品</nz-form-label>
<nz-form-control [nzSpan]="16" nzErrorTip="请选择选择产品!">
<nz-select
nzMode="multiple"
formControlName="productIds"
nzPlaceHolder="请选择充值金额"
>
<nz-option *ngFor="let item of productArray" nzValue="{{item.id}}" nzLabel="{{item.operatorType | rechargePrice}}|{{item.phoneRechargeType== 1? '快充':'慢充'}}|{{item.rechargePrice}}元"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSpan]="6" nzRequired>折扣比例</nz-form-label>
<nz-form-control [nzSpan]="16" nzErrorTip="请输入折扣比例!">
<nz-input-number
style="width: 200px"
formControlName="discount"
[nzMin]="1"
[nzMax]="100"
[nzStep]="1"
[nzPrecision]="2"
nzPrecisionMode="cut"
nzPlaceHolder="请输入折扣比例!"
[nzFormatter]="formatterPercent"
[nzParser]="parserPercent"
></nz-input-number>
</nz-form-control>
</nz-form-item>
</form>
</nz-modal>
<nz-modal [(nzVisible)]="visibleConfigProduct" nzTitle="商户产品" (nzOnCancel)="visibleConfigProduct = false" nzWidth="1000px" [nzFooter]="null">
<nz-table #productConfigTable [nzScroll]="{ x: '1200px' }" [nzData]="productConfigArray">
<thead>
<tr>
<th nzWidth="60px">编号</th>
<th nzWidth="90px">充值金额</th>
<th nzWidth="90px">折扣金额</th>
<th nzWidth="120px">运营商</th>
<th nzWidth="90px">充值类型</th>
<th nzWidth="120px">创建时间</th>
<th nzRight nzWidth="80px">状态</th>
<th nzRight nzWidth="160px">操作</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of productConfigTable.data;let i = index">
<td>{{i + 1}}</td>
<td>{{data.rechargePrice}}</td>
<td>{{data.discountPrice}}</td>
<td>{{data.operatorType | rechargePrice}}</td>
<td>{{data.phoneRechargeType== 1? '快充':'慢充'}}</td>
<td>{{data.createTime | date: 'yyyy-MM-dd HH:mm'}}</td>
<td nzRight>{{data.configStatus== 101? '正常':'下架中'}}</td>
<td nzRight class="table-td-operation">
<a *ngIf="data.configStatus != 101" (click)="getEditConfigProduct(data.apiConfigProductId)">编辑</a>
<a style="margin-left: 20px;" (click)='getEditConfigProductStatus(data.apiConfigProductId , data.configStatus)'>{{data.configStatus === 101 ? '下线': '上线'}}</a>
</td>
</tr>
</tbody>
</nz-table>
</nz-modal>
<nz-modal [(nzVisible)]="editConfigVisible" nzTitle="编辑产品折扣" (nzOnCancel)="editConfigVisible = false" (nzOnOk)="handleOkConfigEdit()">
<nz-form-item>
<nz-form-label [nzSpan]="6" nzRequired>折扣比例</nz-form-label>
<nz-form-control [nzSpan]="16" nzErrorTip="请输入折扣比例!">
<nz-input-number
style="width: 200px"
[(ngModel)]="discount"
[nzMin]="1"
[nzMax]="100"
[nzStep]="1"
[nzPrecision]="2"
nzPrecisionMode="cut"
nzPlaceHolder="请输入折扣比例!"
[nzFormatter]="formatterPercent"
[nzParser]="parserPercent"
></nz-input-number>
</nz-form-control>
</nz-form-item>
</nz-modal>

@ -0,0 +1,465 @@
import {Component, OnInit} from '@angular/core';
import {environment} from '../../../../environments/environment';
import {FormBuilder, FormGroup, Validators} from '_@angular_forms@9.0.7@@angular/forms';
import {CouponService} from '../../../services/coupon.service';
import {IconService} from '../../../services/icon.service';
import {NzMessageService} from '_ng-zorro-antd@9.3.0@ng-zorro-antd';
import {Router} from '_@angular_router@9.0.7@@angular/router';
import {CommonsService} from '../../../services/commons.service';
import {ApiMerchantsService} from '../../../services/api-merchants.service';
import {ApiProductService} from '../../../services/api-product.service';
@Component({
selector: 'app-list',
templateUrl: './list.component.html',
styleUrls: ['./list.component.scss']
})
export class ListComponent implements OnInit {
WEB_SERVE_URL = environment.imageUrl;
searchForm: FormGroup; // 搜索框
validateForm: FormGroup; // 添加框
requestData = []; // 列表数据
priceArray = []; // 价格数据
platformArray = []; // 充值平台数据
total: number; // 页码
pageNum = 1; // 页码
pageSize = 10; // 条码
loading = true;
isVisible = false;
visible = false;
configVisible = false;
editConfigVisible = false;
visibleConfigProduct = false;
id: number;
edit = false;
payPrice;
isVisibleGoods = false;
realPrice = 0;
rechargeModal = false;
rechargeForm: FormGroup;
configValidateForm: FormGroup;
rechargeParam: any = {};
smsCodeBtnName = '获取验证码';
smsCodeBtnLoading = false;
submitRechargeBtnLoading = false;
countdownTime;
merchantArray = [];
merchRechargeData = [];
merchantId: number;
configProductId: number;
productArray = [];
productConfigArray = [];
discount;
formatterPercent = (value: number): string => `${value == null ? 0 : value} %`;
parserPercent = (value: string): string => value.replace(' %', '');
constructor(
private form: FormBuilder,
private apiMerchants: ApiMerchantsService,
private apiProduct: ApiProductService,
private coupon: CouponService,
private iconService: IconService,
private message: NzMessageService,
private router: Router,
private common: CommonsService
) {
}
ngOnInit(): void {
this.init();
this.getInitData();
}
// 获取初始化数据
private getInitData(): void {
// 获取价格数据
this.common.getDictionary('RECHARGE_AMOUNT ', data => {
this.priceArray = data['return_data'];
});
// 获取充值平台
this.common.getDictionary('RECHARGE_PLATFORM ', data => {
this.platformArray = data['return_data'];
});
}
public init(): void {
this.rechargeForm = this.form.group({
merchantId: [null, [Validators.required]],
amount: [null, [Validators.required]],
smsCode: [null, [Validators.required]],
});
this.searchForm = this.form.group({
merchantName: [null],
mchId: [null],
phone: [null],
status: [null],
});
this.validateForm = this.form.group({
merchantName: [null, [Validators.required]],
userName: [null, [Validators.required]],
phone: [null, [Validators.required]],
});
this.configValidateForm = this.form.group({
productIds: [null, [Validators.required]],
discount: [null, [Validators.required]],
});
this.getRequest(true, this.searchForm.value);
this.apiMerchants.getListApiMerchantByAll(data => {
if (data['return_code'] === '000000') {
this.merchantArray = data['return_data'];
} else {
this.message.error(data['return_msg']);
}
});
this.apiProduct.getAvailableApiProductByList(data => {
if (data['return_code'] === '000000') {
this.productArray = data['return_data'];
} else {
this.message.error(data['return_msg']);
}
});
}
// 查询列表
public getRequest(reset: boolean = false, whereObject: object) {
this.loading = false;
if (reset) {
this.pageNum = 1;
}
whereObject['pageNum'] = this.pageNum;
whereObject['pageSize'] = this.pageSize;
this.apiMerchants.getListApiMerchant(whereObject, data => {
if (data['return_code'] === '000000') {
this.requestData = data['return_data'].list;
this.total = data['return_data'].total;
} else {
this.message.error(data['return_msg']);
}
});
}
// 重置
public resetForm(): void {
this.searchForm.reset();
}
// 修改
public getEdit(id?: number): void {
if (id != null) {
this.id = id;
this.edit = true;
this.apiMerchants.findById(id, data => {
this.validateForm.patchValue(data['return_data']);
this.isVisible = true;
});
} else {
this.validateForm.reset();
this.isVisible = true;
this.edit = false;
}
}
handleOk(): void {
// tslint:disable-next-line:forin
for (const i in this.validateForm.controls) {
this.validateForm.controls[i].markAsDirty();
this.validateForm.controls[i].updateValueAndValidity();
if (this.validateForm.controls[i].errors != null) {
this.message.error('必填项不能为空');
return;
}
}
const wait = this.message.loading('提交中..', {nzDuration: 0}).messageId;
if (this.edit) {
this.validateForm.value['id'] = this.id;
this.apiMerchants.updateMerchant(this.validateForm.value, data => {
this.message.remove(wait);
if (data['return_code'] === '000000') {
this.message.success('修改成功');
this.getRequest(false, this.searchForm.value);
this.validateForm.reset();
this.isVisible = false;
} else {
this.message.error(data['return_msg']);
}
});
} else {
this.apiMerchants.insertMerchant(this.validateForm.value, data => {
this.message.remove(wait);
if (data['return_code'] === '000000') {
this.message.success('添加成功');
this.getRequest(false, this.searchForm.value);
this.isVisible = false;
this.validateForm.reset();
} else {
this.message.error(data['return_msg']);
}
});
}
}
handleCancel(): void {
this.validateForm.reset();
this.isVisible = false;
}
public getForbiddenUser(idPost, status: any): void {
let statusPost;
let message;
switch (status) {
case 101:
statusPost = 100;
message = '是否上线';
break;
case 100:
statusPost = 101;
message = '是否禁用';
break;
}
this.common.showConfirm(message, item => {
if (item) {
this.apiMerchants.editMerchantsStatus({
id: idPost,
status: statusPost
}, data => {
if (data['return_code'] === '000000') {
this.message.success('提交成功');
this.getRequest(false, this.searchForm.value);
} else {
this.message.error(data['return_msg']);
}
});
}
});
}
public getEditConfigProductStatus(idPost, status: any): void {
let statusPost;
let message;
switch (status) {
case 102:
statusPost = 101;
message = '是否上线';
break;
case 101:
statusPost = 102;
message = '是否禁用';
break;
}
this.common.showConfirm(message, item => {
if (item) {
this.apiMerchants.editConfigApiProductByStatus({
id: idPost,
status: statusPost
}, data => {
if (data['return_code'] === '000000') {
this.message.success('提交成功');
this.getListMerchProduct(this.merchantId);
} else {
this.message.error(data['return_msg']);
}
});
}
});
}
/**
*
*/
showRechargeModal() {
this.rechargeModal = true;
}
/**
*
*/
sendSmsCode() {
this.rechargeForm.controls.merchantId.enable();
this.rechargeForm.controls.amount.enable();
if (this.rechargeForm.value.merchantId == null) {
this.message.error('请选择充值商户');
return;
}
this.rechargeParam['merchantId'] = this.rechargeForm.value['merchantId'];
this.rechargeParam['amount'] = this.rechargeForm.value['amount'];
this.rechargeForm.controls.merchantId.disable();
this.rechargeForm.controls.amount.disable();
this.common.sendRechargeSmsCode('18090580471', this.rechargeParam['merchantId'], this.rechargeParam['amount'], data => {
if (data['return_code'] === '000000') {
this.getVerifyCodeCountdown();
} else {
this.message.error(data['return_msg']);
this.rechargeForm.controls.merchantId.enable();
this.rechargeForm.controls.amount.enable();
}
});
}
/**
*
*/
getVerifyCodeCountdown() {
let countdownSecond = 60; // 倒计时60秒
this.countdownTime = setInterval(() => {
if (countdownSecond <= 1) {
this.smsCodeBtnName = '获取验证码';
this.smsCodeBtnLoading = false;
clearInterval(this.countdownTime);
} else {
countdownSecond--;
this.smsCodeBtnName = String(countdownSecond);
this.smsCodeBtnLoading = true;
}
}, 1000);
}
/**
*
*/
submitRecharge() {
this.submitRechargeBtnLoading = true;
// tslint:disable-next-line:forin
for (const i in this.rechargeForm.controls) {
this.rechargeForm.controls[i].markAsDirty();
this.rechargeForm.controls[i].updateValueAndValidity();
}
this.rechargeParam.smsCode = this.rechargeForm.value['smsCode'];
if (this.rechargeForm.status == null || this.rechargeForm.status !== 'VALID') {
this.message.error('请填写所有必填项');
this.submitRechargeBtnLoading = false;
return;
}
this.apiMerchants.recharge(this.rechargeParam, data => {
if (data['return_code'] === '000000') {
this.message.success('充值成功');
this.rechargeForm.controls.merchantId.enable();
this.rechargeForm.controls.amount.enable();
this.rechargeForm = this.form.group({
merchantId: [null, [Validators.required]],
amount: [null, [Validators.required]],
smsCode: [null, [Validators.required]],
});
this.rechargeModal = false;
this.smsCodeBtnLoading = false;
this.getRequest(false, this.searchForm.value);
} else {
this.message.error(data['return_msg']);
}
this.submitRechargeBtnLoading = false;
});
}
// 请求商户充值记录
public getMerchRechargeData(id: number): void {
this.visible = true;
this.apiMerchants.getMerchRechargeData(id, data => {
if (data['return_code'] === '000000') {
this.merchRechargeData = data['return_data'];
} else {
this.message.error(data['return_msg']);
}
});
}
// 配置产品
public configProduct(id: number): void {
this.merchantId = id;
this.configVisible = true;
}
// 提交配置产品
handleOkConfig(): void {
// tslint:disable-next-line:forin
for (const i in this.configValidateForm.controls) {
this.configValidateForm.controls[i].markAsDirty();
this.configValidateForm.controls[i].updateValueAndValidity();
console.log(this.configValidateForm.controls[i]);
if (this.configValidateForm.controls[i].errors != null) {
this.message.error('必填项不能为空');
return;
}
}
this.configValidateForm.value['merchantsId'] = this.merchantId;
this.apiMerchants.configApiProduct(this.configValidateForm.value , data => {
if (data['return_code'] === '000000') {
this.configVisible = false;
this.message.success('提交成功');
} else {
this.message.error(data['return_msg']);
}
});
}
public showConfigProduct(id: number) {
this.visibleConfigProduct = true;
this.merchantId = id;
this.getListMerchProduct(id);
}
public getListMerchProduct(id: number): void {
this.apiProduct.getListMerchProduct(id , data => {
if (data['return_code'] === '000000') {
this.productConfigArray = data['return_data'];
} else {
this.message.error(data['return_msg']);
}
});
}
// 修改商品
public getEditConfigProduct(id: number) {
this.configProductId = id;
this.apiMerchants.findConfigProduct(id , data => {
if (data['return_code'] === '000000') {
this.discount = data['return_data']['discount'];
} else {
this.message.error(data['return_msg']);
}
});
this.editConfigVisible = true;
}
handleOkConfigEdit() {
if (this.discount == null) {
this.message.error('请输入折扣比例');
}
const prams = {
discount: this.discount,
id: this.configProductId
};
this.apiMerchants.updateConfigApiProduct(prams , data => {
if (data['return_code'] === '000000') {
this.editConfigVisible = false;
this.getListMerchProduct(this.merchantId);
} else {
this.message.error(data['return_msg']);
}
});
}
}

@ -0,0 +1,14 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import {ListComponent} from './list/list.component';
const routes: Routes = [
{ path: 'list', component: ListComponent },
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class ApiProductRoutingModule { }

@ -0,0 +1,29 @@
import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {ApiProductRoutingModule} from './api-product-routing.module';
import {ListComponent} from './list/list.component';
import {NgZorroAntdModule} from '_ng-zorro-antd@9.3.0@ng-zorro-antd';
import {SeparateModule} from '../../common/separate/separate.module';
import {FormsModule, ReactiveFormsModule} from '_@angular_forms@9.0.7@@angular/forms';
import {BreadcrumbModule} from '../../common/breadcrumb/breadcrumb.module';
import {RegionSelectorModule} from '../../common/region-selector/region-selector.module';
import {AppCommonModule} from '../../app-common.module';
@NgModule({
declarations: [ListComponent],
imports: [
CommonModule,
ApiProductRoutingModule,
NgZorroAntdModule,
SeparateModule,
ReactiveFormsModule,
FormsModule,
BreadcrumbModule,
RegionSelectorModule,
AppCommonModule
]
})
export class ApiProductModule {
}

@ -0,0 +1,195 @@
<!-- start 面包屑 -->
<app-breadcrumb></app-breadcrumb>
<!-- end 面包屑 -->
<!--条件搜索-->
<div class="inner-content">
<form nz-form [formGroup]="searchForm" (ngSubmit)="getRequest(true , searchForm.value)">
<div nz-row>
<div nz-col nzSpan="8">
<nz-form-item>
<nz-form-label [nzSpan]="6">运营商</nz-form-label>
<nz-form-control [nzSpan]="16">
<nz-select nzShowSearch nzAllowClear formControlName="operatorType" nzPlaceHolder="请选择运营商">
<nz-option nzLabel="电信运营商" nzValue="1"></nz-option>
<nz-option nzLabel="移动运营商" nzValue="2"></nz-option>
<nz-option nzLabel="联通运营商" nzValue="3"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="8">
<nz-form-item>
<nz-form-label [nzSpan]="6">充值平台</nz-form-label>
<nz-form-control [nzSpan]="16">
<nz-select nzShowSearch nzAllowClear formControlName="rechargePlatform" nzPlaceHolder="请选择充值平台">
<nz-option nzLabel="尖椒" [nzValue]="1"></nz-option>
<nz-option nzLabel="龙阅" [nzValue]="2"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="8">
<nz-form-item>
<nz-form-label [nzSpan]="6">话费充值类型</nz-form-label>
<nz-form-control [nzSpan]="16">
<nz-select nzShowSearch nzAllowClear formControlName="phoneRechargeType" nzPlaceHolder="请选择充值类型">
<nz-option nzLabel="快充" [nzValue]="1"></nz-option>
<nz-option nzLabel="慢充" [nzValue]="2"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="8">
<nz-form-item>
<nz-form-label [nzSpan]="6">状态</nz-form-label>
<nz-form-control [nzSpan]="16">
<nz-select nzShowSearch nzAllowClear formControlName="status" nzPlaceHolder="请选择状态">
<nz-option nzLabel="上线" [nzValue]="101"></nz-option>
<nz-option nzLabel="编辑中" [nzValue]="102"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
</div>
<div nz-row>
<div nz-col nzSpan="24" class="search-button">
<button nz-button nzType="primary"><i nz-icon nzType="search" nzTheme="outline"></i>搜索</button>
<button nz-button nzType="default" (click)="resetForm()"><i nz-icon nzType="reload"
nzTheme="outline"></i>重置
</button>
</div>
</div>
</form>
</div>
<div class="inner-content">
<span>共计 {{total}} 条数据</span>
<div class="operating-button">
<button nz-button nzType="primary" class="right-btn" (click)="getEdit()"><i nz-icon nzType="plus" nzTheme="outline"></i>添加</button>
</div>
<nz-table
class="table"
#ajaxTable
nzShowSizeChanger
[nzFrontPagination]="false"
[nzData]="requestData"
[nzLoading]="loading"
[nzTotal]="total"
[(nzPageIndex)]="pageNum"
[(nzPageSize)]="pageSize"
[nzScroll]="{ x: '1200px' }"
(nzPageIndexChange)="getRequest(false , searchForm.value)"
(nzPageSizeChange)="getRequest(false , searchForm.value)">
<thead nzSingleSort>
<tr>
<th nzWidth="60px">编号</th>
<th nzWidth="90px">充值金额</th>
<th nzWidth="120px">运营商</th>
<th nzWidth="90px">充值类型</th>
<th nzWidth="90px">充值平台</th>
<th nzWidth="80px">商品ID</th>
<th nzWidth="120px">创建时间</th>
<th nzRight nzWidth="80px">状态</th>
<th nzRight nzWidth="160px">操作</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of ajaxTable.data; let i = index">
<td>{{i + 1}}</td>
<td>{{data.rechargePrice}}</td>
<td>{{data.operatorType | rechargePrice}}</td>
<td>{{data.phoneRechargeType== 1? '快充':'慢充'}}</td>
<td>{{data.rechargePlatform | rechargePlatform}}</td>
<td>{{data.goodsId == null ? '暂未配置' : data.goodsId}}</td>
<td>{{data.createTime | date: 'yyyy-MM-dd HH:mm'}}</td>
<td nzRight="">{{data.status== 101? '上线':'编辑中'}}</td>
<td nzRight class="table-td-operation">
<a *ngIf="data.status != 101" (click)="getEdit(data.id)">编辑</a>
<a style="margin-left: 20px;" (click)='getForbiddenUser(data.id , data.status)'>{{data.status === 101 ? '下线': '上线'}}</a>
<a *ngIf="data.status != 101" style="margin-left: 20px;" (click)="getForbiddenUserD(data.id)">删除</a>
</td>
</tbody>
</nz-table>
</div>
<nz-modal [(nzVisible)]="isVisible" nzTitle="金额编辑" (nzOnCancel)="handleCancel()" (nzOnOk)="handleOk()">
<form nz-form [formGroup]="validateForm" class="login-form">
<nz-form-item *ngIf="!edit">
<nz-form-label [nzSpan]="6" nzRequired>充值金额</nz-form-label>
<nz-form-control [nzSpan]="16" nzErrorTip="请选择充值金额!">
<nz-select
nzMode="multiple"
formControlName="prices"
nzPlaceHolder="请选择充值金额"
>
<nz-option *ngFor="let item of priceArray" nzValue="{{item.codeValue}}" nzLabel="{{item.codeName}}"></nz-option>
</nz-select>
<input *ngIf="edit" readonly nz-input formControlName="rechargePrice" />
</nz-form-control>
</nz-form-item>
<nz-form-item *ngIf="edit">
<nz-form-label [nzSpan]="6" nzRequired>充值金额</nz-form-label>
<nz-form-control [nzSpan]="16" nzErrorTip="请输入充值金额!">
<input readonly nz-input formControlName="rechargePrice" />
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSpan]="6" nzRequired>运营商</nz-form-label>
<nz-form-control [nzSpan]="16" nzErrorTip="请选择运营商!">
<nz-select nzShowSearch nzAllowClear formControlName="operatorType" nzPlaceHolder="请选择运营商!">
<nz-option nzLabel="电信运营商" [nzValue]="1"></nz-option>
<nz-option nzLabel="移动运营商" [nzValue]="2"></nz-option>
<nz-option nzLabel="联通运营商" [nzValue]="3"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSpan]="6" nzRequired>充值平台</nz-form-label>
<nz-form-control [nzSpan]="16" nzErrorTip="请选择充值平台!">
<nz-select nzShowSearch nzAllowClear nzMode="multiple" formControlName="rechargePlatform" nzPlaceHolder="请选择充值平台">
<nz-option *ngFor="let item of platformArray" [nzValue]="item.codeValue" [nzLabel]="item.codeName"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSpan]="6" nzRequired>充值类型</nz-form-label>
<nz-form-control [nzSpan]="16" nzErrorTip="请选择充值类型!">
<nz-select nzShowSearch nzAllowClear formControlName="phoneRechargeType" nzPlaceHolder="请选择充值类型">
<nz-option nzLabel="快充" [nzValue] ="1"></nz-option>
<nz-option nzLabel="慢充" [nzValue]="2"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
<nz-form-item *ngIf="edit">
<nz-form-label [nzSpan]="6" >商品编号</nz-form-label>
<nz-form-control [nzSpan]="16" nzErrorTip="请输入商品编号!">
<nz-input-number
style="width: 200px"
formControlName="productId"
[nzMin]="1"
[nzMax]="10000"
[nzStep]="1"
nzPlaceHolder="请输入商品编号!"
></nz-input-number>
</nz-form-control>
</nz-form-item>
<nz-form-item *ngIf="edit">
<nz-form-label [nzSpan]="6" >排序</nz-form-label>
<nz-form-control [nzSpan]="16" nzErrorTip="请输入排序!">
<nz-input-number
style="width: 200px"
formControlName="sort"
[nzMin]="1"
[nzMax]="100"
[nzStep]="1"
nzPlaceHolder="请输入排序!"
></nz-input-number>
</nz-form-control>
</nz-form-item>
</form>
</nz-modal>

@ -0,0 +1,233 @@
import { Component, OnInit } from '@angular/core';
import {environment} from '../../../../environments/environment';
import {FormBuilder, FormGroup, Validators} from '_@angular_forms@9.0.7@@angular/forms';
import {RechargeService} from '../../../services/recharge.service';
import {DiscountService} from '../../../services/discount.service';
import {CouponService} from '../../../services/coupon.service';
import {IconService} from '../../../services/icon.service';
import {NzMessageService} from '_ng-zorro-antd@9.3.0@ng-zorro-antd';
import {Router} from '_@angular_router@9.0.7@@angular/router';
import {CommonsService} from '../../../services/commons.service';
import {ApiProductService} from '../../../services/api-product.service';
@Component({
selector: 'app-list',
templateUrl: './list.component.html',
styleUrls: ['./list.component.scss']
})
export class ListComponent implements OnInit {
WEB_SERVE_URL = environment.imageUrl;
searchForm: FormGroup; // 搜索框
validateForm: FormGroup; // 添加框
requestData = []; // 列表数据
priceArray = []; // 价格数据
platformArray = []; // 充值平台数据
total: number; // 页码
pageNum = 1; // 页码
pageSize = 10; // 条码
loading = true;
isVisible = false;
visible = false;
id: number;
edit = false;
payPrice;
isVisibleGoods = false;
realPrice = 0;
constructor(
private form: FormBuilder,
private recharge: RechargeService,
private discount: DiscountService,
private apiProduct: ApiProductService,
private coupon: CouponService,
private iconService: IconService,
private message: NzMessageService,
private router: Router,
private common: CommonsService
) {
}
ngOnInit(): void {
this.init();
this.getInitData();
}
// 获取初始化数据
private getInitData(): void {
// 获取价格数据
this.common.getDictionary('RECHARGE_AMOUNT ', data => {
this.priceArray = data['return_data'];
});
// 获取充值平台
this.common.getDictionary('RECHARGE_PLATFORM ', data => {
this.platformArray = data['return_data'];
});
}
public init(): void {
this.searchForm = this.form.group({
operatorType : [null],
rechargePlatform: [null],
phoneRechargeType: [null],
status: [null],
});
this.validateForm = this.form.group({
operatorType: [null, [Validators.required]],
prices: [null, [Validators.required]],
phoneRechargeType: [null, [Validators.required]],
rechargePlatform: [null, [Validators.required]],
rechargePrice: [null],
sort: [null],
productId: [null],
});
this.getRequest(true, this.searchForm.value);
}
// 查询列表
public getRequest(reset: boolean = false, whereObject: object) {
this.loading = false;
if (reset) {
this.pageNum = 1;
}
whereObject['pageNum'] = this.pageNum;
whereObject['pageSize'] = this.pageSize;
this.apiProduct.getListApiProduct(whereObject, data => {
if (data['return_code'] === '000000') {
this.requestData = data['return_data'].list;
this.total = data['return_data'].total;
} else {
this.message.error(data['return_msg']);
}
});
}
// 重置
public resetForm(): void {
this.searchForm.reset();
}
// 修改
public getEdit(id?: number): void {
if (id != null) {
this.id = id;
this.edit = true;
this.apiProduct.findById(id, data => {
data['return_data']['rechargePlatform'] = data['return_data']['rechargePlatform'].substring(1 , data['return_data']['rechargePlatform'].length - 1).split('-');
data['return_data']['prices'] = ['1'];
this.validateForm.patchValue(data['return_data']);
this.isVisible = true;
});
} else {
this.validateForm.reset();
this.isVisible = true;
this.edit = false;
}
}
handleOk(): void {
console.log(this.validateForm.value);
const wait = this.message.loading('提交中..', { nzDuration: 0 }).messageId;
// tslint:disable-next-line:forin
for (const i in this.validateForm.controls) {
this.validateForm.controls[i].markAsDirty();
this.validateForm.controls[i].updateValueAndValidity();
if (this.validateForm.controls[i].errors != null) {
this.message.error('必填项不能为空');
return;
}
}
if (this.edit) {
this.validateForm.value['id'] = this.id;
this.apiProduct.updateProduct(this.validateForm.value, data => {
this.message.remove(wait);
if (data['return_code'] === '000000') {
this.message.success('修改成功');
this.getRequest(false, this.searchForm.value);
this.validateForm.reset();
this.isVisible = false;
} else {
this.message.error(data['return_msg']);
}
});
} else {
this.apiProduct.insertProduct(this.validateForm.value, data => {
this.message.remove(wait);
if (data['return_code'] === '000000') {
this.message.success('添加成功');
this.getRequest(false, this.searchForm.value);
this.isVisible = false;
this.validateForm.reset();
} else {
this.message.error(data['return_msg']);
}
});
}
}
handleCancel(): void {
this.validateForm.reset();
this.isVisible = false;
}
public getForbiddenUser(idPost, status: any): void {
let statusPost;
let message;
switch (status) {
case 101:
statusPost = 102;
message = '是否下线';
break;
case 102:
statusPost = 101;
message = '是否上线';
break;
}
this.common.showConfirm(message, item => {
if (item) {
this.apiProduct.editProductStatus( {
id: idPost,
status: statusPost
}, data => {
if (data['return_code'] === '000000') {
this.message.success('提交成功');
this.getRequest(false, this.searchForm.value);
} else {
this.message.error(data['return_msg']);
}
});
}
});
}
public getForbiddenUserD(idPost): void {
this.common.showConfirm('是否删除', item => {
if (item) {
this.recharge.editPriceStatus({
id: idPost,
status: 0
}, data => {
if (data['return_code'] === '000000') {
this.message.success('删除成功');
this.getRequest(false, this.searchForm.value);
} else {
this.message.error(data['return_msg']);
}
});
}
});
}
}

@ -21,7 +21,7 @@ export class IndexComponent implements OnInit {
isVisibleOil = false;
balance: number;
price: number;
code = 60;
code = 23;
listOfData;
countData: any = {};
data: any = {};

@ -11,7 +11,7 @@ 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';
import {MerchantStoreService} from "../../../services/merchant-store.service";
import {MerchantStoreService} from '../../../services/merchant-store.service';
@Component({
selector: 'app-oil-station-order',

@ -6,109 +6,123 @@
<div class="inner-content">
<form nz-form [formGroup]="searchForm" (ngSubmit)="getRequest(true , searchForm.value)">
<div nz-row>
<div nz-col nzSpan="8" *ngIf="roleType === 1">
<nz-form-item>
<nz-form-label [nzSpan]="6">区域公司</nz-form-label>
<nz-form-control [nzSpan]="16">
<nz-select [nzPlaceHolder]="'请选择区域公司...'" nzShowSearch nzAllowClear [formControlName]="'companyId'">
<nz-option *ngFor="let item of companyData" nzValue="{{item.id}}" nzLabel="{{item.name}}"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="8">
<nz-form-item>
<nz-form-label [nzSpan]="6">充值内容</nz-form-label>
<nz-form-control [nzSpan]="16">
<input nz-input placeholder="请输入充值内容..." [formControlName]="'rechargeContent'"/>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="8">
<nz-form-item>
<nz-form-label [nzSpan]="6">订单状态</nz-form-label>
<nz-form-label [nzSpan]="6">订单号</nz-form-label>
<nz-form-control [nzSpan]="16">
<input nz-input placeholder="请输入订单号..." [formControlName]="'orderNo'"/>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="8">
<nz-form-item>
<nz-form-label [nzSpan]="6">支付状态</nz-form-label>
<nz-form-control [nzSpan]="16">
<nz-select nzShowSearch nzAllowClear formControlName="status" nzPlaceHolder="请选择订单状态">
<nz-option nzLabel="待支付" nzValue="1"></nz-option>
<nz-option nzLabel="已支付" nzValue="2"></nz-option>
<nz-option nzLabel="已完成" nzValue="3"></nz-option>
<nz-option nzLabel="已取消" nzValue="4"></nz-option>
<nz-option nzLabel="已退款" nzValue="5"></nz-option>
<nz-option nzLabel="退款中" nzValue="6"></nz-option>
<nz-select nzShowSearch nzAllowClear formControlName="payStatus" nzPlaceHolder="请选择订单状态">
<nz-option nzLabel="待支付" nzValue="101"></nz-option>
<nz-option nzLabel="已支付" nzValue="102"></nz-option>
<nz-option nzLabel="已完成" nzValue="100"></nz-option>
<nz-option nzLabel="已取消" nzValue="104"></nz-option>
<nz-option nzLabel="已退款" nzValue="105"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="8">
<nz-form-item>
<nz-form-label [nzSpan]="6">充值类型</nz-form-label>
<nz-form-label [nzSpan]="6">充值状态</nz-form-label>
<nz-form-control [nzSpan]="16">
<nz-select nzShowSearch nzAllowClear formControlName="rechargeModel" nzPlaceHolder="请选择订单状态">
<nz-option nzLabel="电信充值" nzValue="1"></nz-option>
<nz-option nzLabel="移动充值" nzValue="2"></nz-option>
<nz-option nzLabel="联通充值" nzValue="3"></nz-option>
<nz-select nzShowSearch nzAllowClear formControlName="rechargeStatus" nzPlaceHolder="请选择充值状态">
<nz-option nzLabel="充值中" nzValue="201"></nz-option>
<nz-option nzLabel="充值成功" nzValue="202"></nz-option>
<nz-option nzLabel="充值失败" nzValue="203"></nz-option>
<nz-option nzLabel="未充值" nzValue="204"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="8">
<nz-form-item>
<nz-form-label [nzSpan]="6">支付方式</nz-form-label>
<nz-form-label [nzSpan]="6">运营商类型</nz-form-label>
<nz-form-control [nzSpan]="16">
<nz-select nzShowSearch nzAllowClear formControlName="payType" nzPlaceHolder="支付方式">
<nz-option nzLabel="微信" nzValue="1"></nz-option>
<nz-option nzLabel="工会卡" nzValue="2"></nz-option>
<nz-option nzLabel="积分" nzValue="3"></nz-option>
<nz-option nzLabel="银联" nzValue="4"></nz-option>
<nz-select nzShowSearch nzAllowClear formControlName="operatorType" nzPlaceHolder="请选择运营商类型">
<nz-option nzLabel="电信运营商" nzValue="1"></nz-option>
<nz-option nzLabel="移动运营商" nzValue="2"></nz-option>
<nz-option nzLabel="联通运营商" nzValue="3"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="8">
<nz-form-item>
<nz-form-label [nzSpan]="6">充值号码</nz-form-label>
<nz-form-label [nzSpan]="6">充值类型</nz-form-label>
<nz-form-control [nzSpan]="16">
<input nz-input placeholder="请输入充值号码..." [formControlName]="'rechargeContent'" />
<nz-select nzShowSearch nzAllowClear formControlName="rechargeType" nzPlaceHolder="请选择充值类型">
<nz-option nzLabel="快充" nzValue="1"></nz-option>
<nz-option nzLabel="慢充" nzValue="2"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="8">
<nz-form-item>
<nz-form-label [nzSpan]="6">订单号</nz-form-label>
<nz-form-label [nzSpan]="6">支付方式</nz-form-label>
<nz-form-control [nzSpan]="16">
<input nz-input placeholder="请输入订单号..." [formControlName]="'orderNo'" />
<nz-select nzShowSearch nzAllowClear formControlName="payType" nzPlaceHolder="支付方式">
<nz-option nzLabel="微信支付" nzValue="2"></nz-option>
<nz-option nzLabel="工会卡支付" nzValue="3"></nz-option>
<nz-option nzLabel="银联支付" nzValue="4"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="8">
<nz-form-item>
<nz-form-label [nzSpan]="6">工会卡卡号</nz-form-label>
<nz-form-control [nzSpan]="16">
<input nz-input placeholder="请输入工会卡卡号..." [formControlName]="'idCard'" />
<input nz-input placeholder="请输入工会卡卡号..." [formControlName]="'laborUnionCard'"/>
</nz-form-control>
</nz-form-item>
</div>
<!-- <div nz-col nzSpan="8">-->
<!-- <nz-form-item>-->
<!-- <nz-form-label [nzSpan]="6">用户电话</nz-form-label>-->
<!-- <nz-form-control [nzSpan]="16">-->
<!-- <input nz-input placeholder="请输入用户电话..." [formControlName]="'userPhone'" />-->
<!-- </nz-form-control>-->
<!-- </nz-form-item>-->
<!-- </div>-->
<div nz-col nzSpan="8">
<nz-form-item>
<nz-form-label [nzSpan]="6">支付时间</nz-form-label>
<nz-form-control [nzSpan]="16">
<nz-range-picker [nzShowTime]="{ nzFormat: 'HH:mm' }" formControlName="payTime"></nz-range-picker>
<nz-range-picker [nzShowTime]="{ nzFormat: 'HH:mm' }"
formControlName="payTime"></nz-range-picker>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="8">
<nz-form-item>
<nz-form-label [nzSpan]="6">充值类型</nz-form-label>
<nz-form-label [nzSpan]="6">创建时间</nz-form-label>
<nz-form-control [nzSpan]="16">
<nz-select nzShowSearch nzAllowClear formControlName="rechargeType" nzPlaceHolder="请选择充值类型">
<nz-option nzLabel="快充" [nzValue]="1"></nz-option>
<nz-option nzLabel="慢充" [nzValue]="2"></nz-option>
</nz-select>
<nz-range-picker [nzShowTime]="{ nzFormat: 'HH:mm' }"
formControlName="createTime"></nz-range-picker>
</nz-form-control>
</nz-form-item>
</div>
<!-- <div nz-col nzSpan="8">-->
<!-- <nz-form-item>-->
<!-- <nz-form-label [nzSpan]="6">创建时间</nz-form-label>-->
<!-- <nz-form-control [nzSpan]="16">-->
<!-- <nz-range-picker [nzShowTime]="{ nzFormat: 'HH:mm' }" formControlName="createTime"></nz-range-picker>-->
<!-- </nz-form-control>-->
<!-- </nz-form-item>-->
<!-- </div>-->
</div>
<div nz-row>
<div nz-col nzSpan="24" class="search-button">
@ -142,64 +156,88 @@
<thead nzSingleSort>
<tr>
<th nzWidth="80px">编号</th>
<th nzWidth="180px">订单名称</th>
<th nzWidth="180px">订单类型</th>
<th nzWidth="180px">充值类型</th>
<th nzWidth="180px">工会卡号</th>
<th nzWidth="180px">订单号</th>
<th nzWidth="120px">客户名称</th>
<th nzWidth="130px">充值号码</th>
<th nzWidth="100px">充值类型</th>
<th nzWidth="120px">运营商</th>
<th nzWidth="180px">充值内容</th>
<th nzWidth="100px">充值金额</th>
<th nzWidth="100px">支付金额</th>
<th nzWidth="180px">充值订单号</th>
<th nzWidth="120px">客户名称</th>
<th nzWidth="140px">生成时间</th>
<th nzWidth="140px">支付时间</th>
<th nzWidth="100px" nzRight>支付方式</th>
<th nzWidth="100px" nzRight>状态</th>
<th nzWidth="100px" nzRight>操作</th>
<th nzWidth="90px" nzRight>充值状态</th>
<th nzWidth="100px" nzRight>支付状态</th>
<th nzWidth="180px" nzRight>操作</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of ajaxTable.data; let i = index">
<td>{{i+1}}</td>
<td>{{data.remarks}}</td>
<td>{{data.rechargeModel | rechargePrice}}</td>
<td>{{data.rechargeType== 1? '快充':'慢充'}}</td>
<td>{{data.idCard }}</td>
<td>{{i + 1}}</td>
<td>{{data.type == 1 ? '话费充值' : ''}}</td>
<td>{{data.operatorName}}</td>
<td>{{data.rechargeContent}} | {{data.rechargeType == 1 ? '快充' : '慢充'}}</td>
<td>¥{{data.rechargePrice}}</td>
<td>{{data.orderNo}}</td>
<td>{{data.userName == null ? '暂无': data.userName}}</td>
<td>{{data.rechargeContent == null ? '暂无': data.rechargeContent}}</td>
<td>{{data.orderPrice}}</td>
<td>{{data.payPrice}}</td>
<td>{{data.userName == null ? '暂无' : data.userName}}</td>
<td>{{data.createTimed | date: 'yyyy-MM-dd HH:mm:ss'}}</td>
<td>{{data.payTime | date: 'yyyy-MM-dd HH:mm:ss'}}</td>
<td nzRight>{{data.payType | rechargePayType}}</td>
<td nzRight>{{data.status | rechargeStatus}}</td>
<td nzRight>{{data.rechargeStatus | rechargeStatus}}</td>
<td nzRight>{{data.payStatus | payStatus}}</td>
<td nzRight class="table-td-operation">
<a (click)="getDetail(data.id)">详情</a>
<a (click)="getDetail(data.id)">详情</a>
<!-- <nz-divider nzType="vertical"></nz-divider>-->
<!-- <a (click)="getChildOrder(data.id)">查看子订单</a>-->
</td>
</tbody>
</nz-table>
</div>
<nz-modal [(nzVisible)]="isVisible" nzTitle="订单详情" nzWidth="1200">
<nz-modal [(nzVisible)]="isVisible" nzTitle="订单详情" nzWidth="1200" (nzOnOk)="isVisible = false"
(nzOnCancel)="isVisible = false">
<nz-descriptions nzBordered [nzColumn]="{ xxl: 4, xl: 3, lg: 3, md: 3, sm: 2, xs: 1 }">
<nz-descriptions-item nzTitle="订单名称">{{data['remarks']}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="订单类型">{{data['rechargeModel'] | rechargePrice}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="订单号">{{data['orderNo']}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="客户名称">{{data['userName'] == null ? '暂无': data['userName']}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="充值号码">{{data['rechargeContent'] == null ? '暂无': data['rechargeContent']}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="身份证号" *ngIf="data['rechargeModel'] === 3 ">{{data['idCard']}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="充值姓名" *ngIf="data['rechargeModel'] === 3 ">{{data['rechargeName']}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="充值金额">{{data['orderPrice']}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="支付金额">{{data['payPrice']}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="退款金额" *ngIf="data['refundFee'] != null">{{data['refundFee']}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="充值类型">{{data['type'] == 1 ? '话费充值' : ''}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="运营商">{{data['operatorName']}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="充值内容">{{data['rechargeContent']}} | {{data['rechargeType'] == 1 ? '快充' : '慢充'}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="充值金额">¥{{data['rechargePrice']}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="应付金额">¥{{data['payPrice']}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="积分抵扣金额">¥{{data['integralDeductionPrice'] == null ? '0' : data['integralDeductionPrice']}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="优惠券抵扣金额">¥{{data['discountDeductionPrice'] == null ? '0' : data['discountDeductionPrice']}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="实付金额">¥{{data['payRealPrice']}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="退款金额" *ngIf="data['refundFee'] != null">¥{{data['refundFee']}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="优惠券名称" *ngIf="data['memDiscountName'] != null">{{data['memDiscountName']}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="支付流水号">{{data['paySerialNo']}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="生成时间">{{data['createTimed'] | date: 'yyyy-MM-dd HH:mm:ss'}}</nz-descriptions-item>
<nz-descriptions-item *ngIf="data['cancelTime'] != null" nzTitle="取消时间">{{data['cancelTime'] | date: 'yyyy-MM-dd HH:mm:ss'}}</nz-descriptions-item>
<nz-descriptions-item *ngIf="data['finishTime'] != null" nzTitle="完成时间">{{data['finishTime'] | date: 'yyyy-MM-dd HH:mm:ss'}}</nz-descriptions-item>
<nz-descriptions-item *ngIf="data['payTime'] != null" nzTitle="支付时间">{{data['payTime'] | date: 'yyyy-MM-dd HH:mm:ss'}}</nz-descriptions-item>
<nz-descriptions-item *ngIf="data['refundTime'] != null" nzTitle="退款时间">{{data['refundTime'] | date: 'yyyy-MM-dd HH:mm:ss'}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="状态">{{data['status'] | rechargeStatus}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="支付类型">{{data['payType'] | rechargePayType}}</nz-descriptions-item>
<nz-descriptions-item *ngIf="data['laborUnionCard'] != null" nzTitle="工会卡号">{{data['laborUnionCard']}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="充值状态">{{data['rechargeStatus'] | rechargeStatus}}</nz-descriptions-item>
<nz-descriptions-item nzTitle="支付状态">{{data['payStatus'] | payStatus}}</nz-descriptions-item>
</nz-descriptions>
<div *nzModalFooter>
<button nz-button nzType="default" (click)="handleCancel()">关闭</button>
</div>
</nz-modal>
<nz-modal [(nzVisible)]="isVisibleChild" nzWidth="700" nzTitle="子订单记录" (nzOnCancel)="isVisibleChild = false" (nzOnOk)="isVisibleChild = false">
<nz-table #basicTable [nzData]="childData">
<thead>
<tr>
<th>订单号</th>
<th>充值平台</th>
<th>充值状态</th>
<th>创建时间</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of basicTable.data">
<td>{{data.orderNo}}</td>
<td>{{data.rechargePlatform == 1 ? '尖椒':'龙阅'}}</td>
<td>{{data.status | chlidRechargeStatus}}</td>
<td>{{data['createTime'] | date: 'yyyy-MM-dd HH:mm'}}</td>
</tr>
</tbody>
</nz-table>
</nz-modal>

@ -1,16 +1,14 @@
import { Component, OnInit } from '@angular/core';
import {environment} from '../../../../environments/environment';
import {FormBuilder, FormGroup, Validators} from '@angular/forms';
import {IconService} from '../../../services/icon.service';
import {NzMessageService, NzNotificationService} from 'ng-zorro-antd';
import {Router} from '@angular/router';
import {CommonsService} from '../../../services/commons.service';
import {NzMessageService, NzModalService, NzUploadChangeParam} from 'ng-zorro-antd';
import {RechargeService} from '../../../services/recharge.service';
import {DiscountService} from '../../../services/discount.service';
import {CouponService} from '../../../services/coupon.service';
import {ADMIN_INFO_OBJECT} from "../../../services/local-storage.namespace";
import {LocalStorageService} from "../../../services/local-storage.service";
import {ADMIN_INFO_OBJECT} from '../../../services/local-storage.namespace';
import {LocalStorageService} from '../../../services/local-storage.service';
import {CompanyService} from '../../../services/company.service';
@Component({
selector: 'app-order-h-list',
@ -19,140 +17,192 @@ import {LocalStorageService} from "../../../services/local-storage.service";
})
export class OrderHListComponent implements OnInit {
FILE_URL = environment.imageUrl;
searchForm: FormGroup; // 搜索框
validateForm: FormGroup; // 添加框
requestData = []; // 列表数据
total: number; // 页码
pageNum = 1; // 页码
pageSize = 10; // 条码
loading = true;
isVisible = false;
id: number;
edit = false;
data = {};
private timer; // 定时器
constructor(
private form: FormBuilder,
private recharge: RechargeService,
private discount: DiscountService,
private coupon: CouponService,
private store: LocalStorageService, // 数据请求
private iconService: IconService,
private message: NzMessageService,
) {
}
ngOnInit(): void {
this.init();
console.log(typeof this.store.get(ADMIN_INFO_OBJECT)['bsCompany'].id);
}
public init(): void {
this.searchForm = this.form.group({
status: [null],
orderNo: [null],
rechargeModel: [null],
rechargeType: [null],
rechargeContent: [null],
idCard: [null],
userPhone: [null],
payTime: [null],
payType: [null],
createTime: [null],
});
this.validateForm = this.form.group({
type: [null, [Validators.required]],
price: [null, [Validators.required]],
realPrice: [null, [Validators.required]],
});
this.getRequest(true, this.searchForm.value);
}
// 查询列表
public getRequest(reset: boolean = false, whereObject: object) {
if (this.store.get(ADMIN_INFO_OBJECT)['highAgent'] != null) {
whereObject['code'] = this.store.get(ADMIN_INFO_OBJECT)['highAgent'].id;
FILE_URL = environment.imageUrl;
WEB_SERVE_URL = environment.baseUrl;
searchForm: FormGroup; // 搜索框
validateForm: FormGroup; // 添加框
requestData = []; // 列表数据
childData = []; // 列表数据
importErrorStudentArray = [];
errorStudentVisible = false;
isVisibleChild = false;
total: number; // 页码
pageNum = 1; // 页码
pageSize = 10; // 条码
loading = true;
isVisible = false;
id: number;
edit = false;
data = {};
roleType: number;
companyData = []; // 列表数据
constructor(
private form: FormBuilder,
private recharge: RechargeService,
private discount: DiscountService,
private modal: NzModalService,
private coupon: CouponService,
private iconService: IconService,
private message: NzMessageService,
private company: CompanyService,
private store: LocalStorageService, // 数据请求
) {
}
if (this.store.get(ADMIN_INFO_OBJECT)['bsCompany'].id === 3) {
whereObject['code'] = 60;
ngOnInit(): void {
this.init();
this.roleType = this.store.get(ADMIN_INFO_OBJECT)['secRole']['roleType'];
const whereObject = {};
whereObject['pageNum'] = 1;
whereObject['pageSize'] = 10000;
this.company.selectCompanyList(whereObject, data => {
if (data['return_code'] === '000000') {
this.companyData = data['return_data'].list;
} else {
this.message.error(data['return_msg']);
}
});
}
if (whereObject['payTime'] != null && whereObject['payTime'].length !== 0) {
whereObject['payTimeS'] = whereObject['payTime'][0].getTime();
whereObject['payTimeE'] = whereObject['payTime'][1].getTime();
public init(): void {
this.searchForm = this.form.group({
payStatus: [null], // 支付状态
rechargeStatus: [null], // 充值状态
companyId: [null], // 充值状态
orderNo: [null], // 订单号
operatorType: [null], // 运营商类型
laborUnionCard: [null], // 工会卡号
rechargeContent: [null], // 充值内容
userPhone: [null], // 用户电话
rechargeType: [null], // 充值类型
payTime: [null], // 支付时间
payType: [null], // 支付方式
createTime: [null], // 创建时间
});
this.validateForm = this.form.group({
type: [null, [Validators.required]],
price: [null, [Validators.required]],
realPrice: [null, [Validators.required]],
});
this.getRequest(true, this.searchForm.value);
}
if (whereObject['createTime'] != null && whereObject['createTime'].length !== 0) {
whereObject['createTimeS'] = whereObject['createTime'][0].getTime();
whereObject['createTimeE'] = whereObject['createTime'][1].getTime();
// 查询列表
public getRequest(reset: boolean = false, whereObject: object) {
if (whereObject['payTime'] != null && whereObject['payTime'].length !== 0) {
whereObject['payTimeS'] = whereObject['payTime'][0].getTime();
whereObject['payTimeE'] = whereObject['payTime'][1].getTime();
}
if (whereObject['createTime'] != null && whereObject['createTime'].length !== 0) {
whereObject['createTimeS'] = whereObject['createTime'][0].getTime();
whereObject['createTimeE'] = whereObject['createTime'][1].getTime();
}
this.loading = false;
if (reset) {
this.pageNum = 1;
}
whereObject['pageNum'] = this.pageNum;
whereObject['pageSize'] = this.pageSize;
this.recharge.getOrderList(whereObject, data => {
if (data['return_code'] === '000000') {
this.requestData = data['return_data'].list;
this.total = data['return_data'].total;
} else {
this.message.error(data['return_msg']);
}
});
}
this.loading = false;
if (reset) {
this.pageNum = 1;
// 重置
public resetForm(): void {
this.searchForm.reset();
}
whereObject['pageNum'] = this.pageNum;
whereObject['pageSize'] = this.pageSize;
this.recharge.getOrderList(whereObject, data => {
if (data['return_code'] === '000000') {
this.requestData = data['return_data'].list;
this.total = data['return_data'].total;
} else {
this.message.error(data['return_msg']);
}
});
}
// 重置
public resetForm(): void {
this.searchForm.reset();
}
// 详情
public getDetail(id: number): void {
this.id = id;
this.recharge.getOrderById(id , data => {
if (data['return_code'] === '000000') {
console.log(data);
this.data = data['return_data'];
} else {
this.message.error(data['return_msg']);
}
});
this.isVisible = true;
}
handleCancel(): void {
this.isVisible = false;
}
// 下载模板
downloadTemplate(whereObject) {
if (this.store.get(ADMIN_INFO_OBJECT)['highAgent'] != null) {
whereObject['code'] = this.store.get(ADMIN_INFO_OBJECT)['highAgent'].id;
// 详情
public getDetail(id: number): void {
this.id = id;
this.recharge.getOrderById(id, data => {
if (data['return_code'] === '000000') {
console.log(data);
this.data = data['return_data'];
} else {
this.message.error(data['return_msg']);
}
});
this.isVisible = true;
}
if (whereObject['payTime'] != null && whereObject['payTime'].length !== 0) {
whereObject['payTimeS'] = whereObject['payTime'][0].getTime();
whereObject['payTimeE'] = whereObject['payTime'][1].getTime();
handleCancel(): void {
this.isVisible = false;
}
if (whereObject['createTime'] != null && whereObject['createTime'].length !== 0) {
whereObject['createTimeS'] = whereObject['createTimeS'][0].getTime();
whereObject['createTimeE'] = whereObject['createTimeE'][1].getTime();
// 下载模板
downloadTemplate(whereObject) {
if (whereObject['payTime'] != null && whereObject['payTime'].length !== 0) {
whereObject['payTimeS'] = whereObject['payTime'][0].getTime();
whereObject['payTimeE'] = whereObject['payTime'][1].getTime();
}
if (whereObject['createTime'] != null && whereObject['createTime'].length !== 0) {
whereObject['createTimeS'] = whereObject['createTimeS'][0].getTime();
whereObject['createTimeE'] = whereObject['createTimeE'][1].getTime();
}
this.recharge.exportOrderList(whereObject, data => {
if (data['return_code'] === '000000') {
window.location.href = this.FILE_URL + data['return_data'];
} else {
this.message.error(data['return_msg']);
}
});
}
handleChange(info: NzUploadChangeParam): void {
if (info.file.status === 'done') {
if (info.file.response.return_code === '000000') {
this.loading = false;
if (info.file.response.return_data == null || info.file.response.return_data.errorTotal === 0) {
this.message.success('导入成功');
this.getRequest(true, this.searchForm.value);
} else {
this.modal.warning({
nzTitle: '提示',
nzOkText: '查看失败数据',
nzContent: '只有部分数据导入成功',
nzOnOk: () => this.showErrorStudentModal(info.file.response.return_data)
});
}
} else {
this.loading = false;
this.message.error(info.file.response.return_msg);
}
} else if (info.file.status === 'error') {
this.message.error('上传错误');
}
}
this.recharge.exportOrderList(whereObject, data => {
if (data['return_code'] === '000000') {
window.location.href = this.FILE_URL + data['return_data'];
} else {
this.message.error(data['return_msg']);
}
});
}
// 打开模态框
showErrorStudentModal(data: []) {
this.getRequest(true, this.searchForm.value);
this.importErrorStudentArray = data['errorData'];
this.errorStudentVisible = true;
}
// 查询子订单
public getChildOrder(id: number): void {
this.isVisibleChild = true;
this.recharge.getChildOrder(id, data => {
if (data['return_code'] === '000000') {
this.childData = data['return_data'];
} else {
this.message.error(data['return_msg']);
}
});
}
}

@ -6,6 +6,16 @@
<div class="inner-content">
<form nz-form [formGroup]="searchForm" (ngSubmit)="getRequest(true , searchForm.value)">
<div nz-row>
<div nz-col nzSpan="8" *ngIf="roleType === 1">
<nz-form-item>
<nz-form-label [nzSpan]="6">区域公司</nz-form-label>
<nz-form-control [nzSpan]="16">
<nz-select [nzPlaceHolder]="'请选择区域公司...'" nzShowSearch nzAllowClear [formControlName]="'companyId'">
<nz-option *ngFor="let item of companyData" nzValue="{{item.id}}" nzLabel="{{item.name}}"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="8">
<nz-form-item>
<nz-form-label [nzSpan]="6">充值内容</nz-form-label>
@ -233,7 +243,7 @@
<tbody>
<tr *ngFor="let data of basicTable.data">
<td>{{data.orderNo}}</td>
<td>{{data.rechargePlatform == 1 ? '尖椒':'龙阅'}}</td>
<td>{{data.rechargePlatform == 2 ? '龙阅':'尖椒'}}</td>
<td>{{data.status | chlidRechargeStatus}}</td>
<td>{{data['createTime'] | date: 'yyyy-MM-dd HH:mm'}}</td>
</tr>

@ -10,207 +10,223 @@ import {RechargeService} from '../../../services/recharge.service';
import {NzMessageService, NzModalService, NzNotificationService, NzUploadChangeParam} from 'ng-zorro-antd';
import {FormBuilder, FormGroup, Validators} from '@angular/forms';
import {Router} from '@angular/router';
import {ADMIN_INFO_OBJECT} from "../../../services/local-storage.namespace";
import {CompanyService} from "../../../services/company.service";
import {MerchantService} from "../../../services/merchant.service";
import {LocalStorageService} from "../../../services/local-storage.service";
@Component({
selector: 'app-order-list',
templateUrl: './order-list.component.html',
styleUrls: ['./order-list.component.scss']
selector: 'app-order-list',
templateUrl: './order-list.component.html',
styleUrls: ['./order-list.component.scss']
})
export class OrderListComponent implements OnInit , OnDestroy {
FILE_URL = environment.imageUrl;
WEB_SERVE_URL = environment.baseUrl;
searchForm: FormGroup; // 搜索框
validateForm: FormGroup; // 添加框
requestData = []; // 列表数据
childData = []; // 列表数据
importErrorStudentArray = [];
errorStudentVisible = false;
isVisibleChild = false;
total: number; // 页码
pageNum = 1; // 页码
pageSize = 10; // 条码
loading = true;
isVisible = false;
id: number;
edit = false;
data = {};
private timer; // 定时器
constructor(
private form: FormBuilder,
private recharge: RechargeService,
private discount: DiscountService,
private modal: NzModalService,
private coupon: CouponService,
private iconService: IconService,
private message: NzMessageService,
private router: Router,
private notification: NzNotificationService,
private common: CommonsService
) {
}
ngOnInit(): void {
this.init();
// this.timer = setInterval(() => { // 设置定时刷新事件,每隔1分钟刷新
// this.recharge.countOrder(data => {
// if (data['return_data'] > 0) {
// this.getRequest(true, this.searchForm.value);
// this.notification.info(
// '充值订单',
// '您有' + data['return_data'] + '条未充值的订单,请尽快充值,点击可查看未充值订单!'
// ).onClick.subscribe(() => {
// this.searchForm.value.status = 2;
// this.getRequest(true, this.searchForm.value);
// });
// }
// });
// }, 10000);
}
// 销毁
ngOnDestroy() {
if (this.timer) {
clearInterval(this.timer);
export class OrderListComponent implements OnInit, OnDestroy {
FILE_URL = environment.imageUrl;
WEB_SERVE_URL = environment.baseUrl;
searchForm: FormGroup; // 搜索框
validateForm: FormGroup; // 添加框
requestData = []; // 列表数据
childData = []; // 列表数据
importErrorStudentArray = [];
errorStudentVisible = false;
isVisibleChild = false;
total: number; // 页码
pageNum = 1; // 页码
pageSize = 10; // 条码
loading = true;
isVisible = false;
id: number;
edit = false;
data = {};
roleType: number;
companyData = []; // 列表数据
private timer; // 定时器
constructor(
private form: FormBuilder,
private recharge: RechargeService,
private discount: DiscountService,
private modal: NzModalService,
private coupon: CouponService,
private iconService: IconService,
private message: NzMessageService,
private company: CompanyService,
private store: LocalStorageService, // 数据请求
) {
}
}
public init(): void {
this.searchForm = this.form.group({
payStatus: [null], // 支付状态
rechargeStatus: [null], // 充值状态
orderNo: [null], // 订单号
operatorType: [null], // 运营商类型
laborUnionCard: [null], // 工会卡号
rechargeContent: [null], // 充值内容
userPhone: [null], // 用户电话
rechargeType: [null], // 充值类型
payTime: [null], // 支付时间
payType: [null], // 支付方式
createTime: [null], // 创建时间
});
this.validateForm = this.form.group({
type: [null, [Validators.required]],
price: [null, [Validators.required]],
realPrice: [null, [Validators.required]],
});
this.getRequest(true, this.searchForm.value);
}
// 查询列表
public getRequest(reset: boolean = false, whereObject: object) {
if (whereObject['payTime'] != null && whereObject['payTime'].length !== 0) {
whereObject['payTimeS'] = whereObject['payTime'][0].getTime();
whereObject['payTimeE'] = whereObject['payTime'][1].getTime();
ngOnInit(): void {
this.init();
this.roleType = this.store.get(ADMIN_INFO_OBJECT)['secRole']['roleType'];
const whereObject = {};
whereObject['pageNum'] = 1;
whereObject['pageSize'] = 10000;
this.company.selectCompanyList(whereObject, data => {
if (data['return_code'] === '000000') {
this.companyData = data['return_data'].list;
} else {
this.message.error(data['return_msg']);
}
});
// this.timer = setInterval(() => { // 设置定时刷新事件,每隔1分钟刷新
// this.recharge.countOrder(data => {
// if (data['return_data'] > 0) {
// this.getRequest(true, this.searchForm.value);
// this.notification.info(
// '充值订单',
// '您有' + data['return_data'] + '条未充值的订单,请尽快充值,点击可查看未充值订单!'
// ).onClick.subscribe(() => {
// this.searchForm.value.status = 2;
// this.getRequest(true, this.searchForm.value);
// });
// }
// });
// }, 10000);
}
// 销毁
ngOnDestroy() {
if (this.timer) {
clearInterval(this.timer);
}
}
if (whereObject['createTime'] != null && whereObject['createTime'].length !== 0) {
whereObject['createTimeS'] = whereObject['createTime'][0].getTime();
whereObject['createTimeE'] = whereObject['createTime'][1].getTime();
public init(): void {
this.searchForm = this.form.group({
payStatus: [null], // 支付状态
rechargeStatus: [null], // 充值状态
companyId: [null], // 充值状态
orderNo: [null], // 订单号
operatorType: [null], // 运营商类型
laborUnionCard: [null], // 工会卡号
rechargeContent: [null], // 充值内容
userPhone: [null], // 用户电话
rechargeType: [null], // 充值类型
payTime: [null], // 支付时间
payType: [null], // 支付方式
createTime: [null], // 创建时间
});
this.validateForm = this.form.group({
type: [null, [Validators.required]],
price: [null, [Validators.required]],
realPrice: [null, [Validators.required]],
});
this.getRequest(true, this.searchForm.value);
}
this.loading = false;
if (reset) {
this.pageNum = 1;
// 查询列表
public getRequest(reset: boolean = false, whereObject: object) {
if (whereObject['payTime'] != null && whereObject['payTime'].length !== 0) {
whereObject['payTimeS'] = whereObject['payTime'][0].getTime();
whereObject['payTimeE'] = whereObject['payTime'][1].getTime();
}
if (whereObject['createTime'] != null && whereObject['createTime'].length !== 0) {
whereObject['createTimeS'] = whereObject['createTime'][0].getTime();
whereObject['createTimeE'] = whereObject['createTime'][1].getTime();
}
this.loading = false;
if (reset) {
this.pageNum = 1;
}
whereObject['pageNum'] = this.pageNum;
whereObject['pageSize'] = this.pageSize;
this.recharge.getOrderList(whereObject, data => {
if (data['return_code'] === '000000') {
this.requestData = data['return_data'].list;
this.total = data['return_data'].total;
} else {
this.message.error(data['return_msg']);
}
});
}
whereObject['pageNum'] = this.pageNum;
whereObject['pageSize'] = this.pageSize;
this.recharge.getOrderList(whereObject, data => {
if (data['return_code'] === '000000') {
this.requestData = data['return_data'].list;
this.total = data['return_data'].total;
} else {
this.message.error(data['return_msg']);
}
});
}
// 重置
public resetForm(): void {
this.searchForm.reset();
}
// 详情
public getDetail(id: number): void {
this.id = id;
this.recharge.getOrderById(id , data => {
if (data['return_code'] === '000000') {
console.log(data);
this.data = data['return_data'];
} else {
this.message.error(data['return_msg']);
}
});
this.isVisible = true;
}
handleCancel(): void {
this.isVisible = false;
}
// 下载模板
downloadTemplate(whereObject) {
if (whereObject['payTime'] != null && whereObject['payTime'].length !== 0) {
whereObject['payTimeS'] = whereObject['payTime'][0].getTime();
whereObject['payTimeE'] = whereObject['payTime'][1].getTime();
// 重置
public resetForm(): void {
this.searchForm.reset();
}
if (whereObject['createTime'] != null && whereObject['createTime'].length !== 0) {
whereObject['createTimeS'] = whereObject['createTimeS'][0].getTime();
whereObject['createTimeE'] = whereObject['createTimeE'][1].getTime();
// 详情
public getDetail(id: number): void {
this.id = id;
this.recharge.getOrderById(id, data => {
if (data['return_code'] === '000000') {
console.log(data);
this.data = data['return_data'];
} else {
this.message.error(data['return_msg']);
}
});
this.isVisible = true;
}
this.recharge.exportOrderList(whereObject, data => {
if (data['return_code'] === '000000') {
window.location.href = this.FILE_URL + data['return_data'];
} else {
this.message.error(data['return_msg']);
}
});
}
handleChange(info: NzUploadChangeParam): void {
if (info.file.status === 'done') {
if (info.file.response.return_code === '000000') {
this.loading = false;
if (info.file.response.return_data == null || info.file.response.return_data.errorTotal === 0) {
this.message.success('导入成功');
this.getRequest(true, this.searchForm.value);
} else {
this.modal.warning({
nzTitle: '提示',
nzOkText: '查看失败数据',
nzContent: '只有部分数据导入成功',
nzOnOk: () => this.showErrorStudentModal(info.file.response.return_data)
});
handleCancel(): void {
this.isVisible = false;
}
// 下载模板
downloadTemplate(whereObject) {
if (whereObject['payTime'] != null && whereObject['payTime'].length !== 0) {
whereObject['payTimeS'] = whereObject['payTime'][0].getTime();
whereObject['payTimeE'] = whereObject['payTime'][1].getTime();
}
} else {
this.loading = false;
this.message.error(info.file.response.return_msg);
}
} else if (info.file.status === 'error') {
this.message.error('上传错误');
if (whereObject['createTime'] != null && whereObject['createTime'].length !== 0) {
whereObject['createTimeS'] = whereObject['createTimeS'][0].getTime();
whereObject['createTimeE'] = whereObject['createTimeE'][1].getTime();
}
this.recharge.exportOrderList(whereObject, data => {
if (data['return_code'] === '000000') {
window.location.href = this.FILE_URL + data['return_data'];
} else {
this.message.error(data['return_msg']);
}
});
}
handleChange(info: NzUploadChangeParam): void {
if (info.file.status === 'done') {
if (info.file.response.return_code === '000000') {
this.loading = false;
if (info.file.response.return_data == null || info.file.response.return_data.errorTotal === 0) {
this.message.success('导入成功');
this.getRequest(true, this.searchForm.value);
} else {
this.modal.warning({
nzTitle: '提示',
nzOkText: '查看失败数据',
nzContent: '只有部分数据导入成功',
nzOnOk: () => this.showErrorStudentModal(info.file.response.return_data)
});
}
} else {
this.loading = false;
this.message.error(info.file.response.return_msg);
}
} else if (info.file.status === 'error') {
this.message.error('上传错误');
}
}
// 打开模态框
showErrorStudentModal(data: []) {
this.getRequest(true, this.searchForm.value);
this.importErrorStudentArray = data['errorData'];
this.errorStudentVisible = true;
}
// 查询子订单
public getChildOrder(id: number): void {
this.isVisibleChild = true;
this.recharge.getChildOrder(id, data => {
if (data['return_code'] === '000000') {
this.childData = data['return_data'];
} else {
this.message.error(data['return_msg']);
}
});
}
}
// 打开模态框
showErrorStudentModal(data: []) {
this.getRequest(true, this.searchForm.value);
this.importErrorStudentArray = data['errorData'];
this.errorStudentVisible = true;
}
// 查询子订单
public getChildOrder(id: number): void {
this.isVisibleChild = true;
this.recharge.getChildOrder(id , data => {
if (data['return_code'] === '000000') {
this.childData = data['return_data'];
} else {
this.message.error(data['return_msg']);
}
});
}
}

@ -47,7 +47,8 @@ import {
PriceStatusPipe,
GasStaffStatusPipe,
PayStatusPipe,
ChlidRechargeStatusPipe
ChlidRechargeStatusPipe,
SourceTypePipe
} from './pipes';
import {OilCardStatusPipe} from './pipes';
import {OilTypePipe} from './pipes/store/oil-type.pipe';
@ -100,6 +101,7 @@ const PIPES = [
OilPriceTaskPriceTypePipe,
PayStatusPipe,
ChlidRechargeStatusPipe,
SourceTypePipe,
];

@ -4,139 +4,149 @@ import {NavigationComponent} from './admin/navigation/navigation.component';
import {InitGuardService} from './services/init-guard.service';
const routes: Routes = [
{path: '', pathMatch: 'full', redirectTo: 'adminLogin'},
{
path: 'adminLogin',
loadChildren: () => import('./admin/login/login.module').then(m => m.LoginModule)
},
{
path: 'admin', component: NavigationComponent,
children: [
{
path: 'index',
loadChildren: () => import('./admin/index/index.module').then(m => m.IndexModule),
canActivate: [InitGuardService]
},
{
path: 'user',
loadChildren: () => import('./admin/user/user.module').then(m => m.UserModule),
canActivate: [InitGuardService]
},
{
path: 'merchant',
loadChildren: () => import('./admin/merchant/merchant.module').then(m => m.MerchantModule),
canActivate: [InitGuardService]
},
{
path: 'merchantStore',
loadChildren: () => import('./admin/merchant-store/merchant-store.module').then(m => m.MerchantStoreModule),
canActivate: [InitGuardService]
},
{
path: 'coupon',
loadChildren: () => import('./admin/coupon/coupon.module').then(m => m.CouponModule),
canActivate: [InitGuardService]
},
{
path: 'company',
loadChildren: () => import('./admin/company/company.module').then(m => m.CompanyModule),
canActivate: [InitGuardService]
},
{
path: 'price',
loadChildren: () => import('./admin/price/price.module').then(m => m.PriceModule),
canActivate: [InitGuardService]
},
{
path: 'audit',
loadChildren: () => import('./admin/audit/audit.module').then(m => m.AuditModule),
canActivate: [InitGuardService]
},
{
path: 'order',
loadChildren: () => import('./admin/order/order.module').then(m => m.OrderModule),
canActivate: [InitGuardService]
},
{
path: 'discount',
loadChildren: () => import('./admin/discount/discount.module').then(m => m.DiscountModule),
canActivate: [InitGuardService]
},
{
path: 'system',
loadChildren: () => import('./admin/system/system.module').then(m => m.SystemModule),
canActivate: [InitGuardService]
},
{
path: 'agent',
loadChildren: () => import('./admin/agent/agent.module').then(m => m.AgentModule),
canActivate: [InitGuardService]
},
{
path: 'rechargeOrder',
loadChildren: () => import('./admin/recharge-order/recharge-order.module').then(m => m.RechargeOrderModule),
canActivate: [InitGuardService]
},
{
path: 'cms',
loadChildren: () => import('./admin/cms/cms.module').then(m => m.CmsModule),
canActivate: [InitGuardService]
},
{
path: 'activate',
loadChildren: () => import('./admin/activate/activate.module').then(m => m.ActivateModule),
canActivate: [InitGuardService]
},
{
path: 'config-manage',
loadChildren: () => import('./admin/config-manage/config-manage.module').then(m => m.ConfigManageModule),
canActivate: [InitGuardService]
},
{
path: 'discount-package',
loadChildren: () => import('./admin/discount-package/discount-package.module').then(m => m.DiscountPackageModule),
canActivate: [InitGuardService]
},
{
path: 'tuanyou-agent',
loadChildren: () => import('./admin/tuanyou-agent/tuanyou-agent.module').then(m => m.TuanyouAgentModule),
canActivate: [InitGuardService]
},
{
path: 'company-amount',
loadChildren: () => import('./admin/company-amount/company-amount.module').then(m => m.CompanyAmountModule),
canActivate: [InitGuardService]
},
{
path: 'oil-card',
loadChildren: () => import('./admin/oil-card/oil-card.module').then(m => m.OilCardModule),
canActivate: [InitGuardService]
},
{
path: 'gz-sinopec',
loadChildren: () => import('./admin/gz-sinopec/gz-sinopec.module').then(m => m.GzSinopecModule),
canActivate: [InitGuardService]
},
{
path: 'gas-staff',
loadChildren: () => import('./admin/gas-staff/gas-staff.module').then(m => m.GasStaffModule),
canActivate: [InitGuardService]
},
{
path: 'gas-oil-price',
loadChildren: () => import('./admin/gas-oil-price/gas-oil-price.module').then(m => m.GasOilPriceModule),
canActivate: [InitGuardService]
},
],
},
{path: '', pathMatch: 'full', redirectTo: 'adminLogin'},
{
path: 'adminLogin',
loadChildren: () => import('./admin/login/login.module').then(m => m.LoginModule)
},
{
path: 'admin', component: NavigationComponent,
children: [
{
path: 'index',
loadChildren: () => import('./admin/index/index.module').then(m => m.IndexModule),
canActivate: [InitGuardService]
},
{
path: 'user',
loadChildren: () => import('./admin/user/user.module').then(m => m.UserModule),
canActivate: [InitGuardService]
},
{
path: 'merchant',
loadChildren: () => import('./admin/merchant/merchant.module').then(m => m.MerchantModule),
canActivate: [InitGuardService]
},
{
path: 'merchantStore',
loadChildren: () => import('./admin/merchant-store/merchant-store.module').then(m => m.MerchantStoreModule),
canActivate: [InitGuardService]
},
{
path: 'coupon',
loadChildren: () => import('./admin/coupon/coupon.module').then(m => m.CouponModule),
canActivate: [InitGuardService]
},
{
path: 'company',
loadChildren: () => import('./admin/company/company.module').then(m => m.CompanyModule),
canActivate: [InitGuardService]
},
{
path: 'price',
loadChildren: () => import('./admin/price/price.module').then(m => m.PriceModule),
canActivate: [InitGuardService]
},
{
path: 'audit',
loadChildren: () => import('./admin/audit/audit.module').then(m => m.AuditModule),
canActivate: [InitGuardService]
},
{
path: 'order',
loadChildren: () => import('./admin/order/order.module').then(m => m.OrderModule),
canActivate: [InitGuardService]
},
{
path: 'discount',
loadChildren: () => import('./admin/discount/discount.module').then(m => m.DiscountModule),
canActivate: [InitGuardService]
},
{
path: 'system',
loadChildren: () => import('./admin/system/system.module').then(m => m.SystemModule),
canActivate: [InitGuardService]
},
{
path: 'agent',
loadChildren: () => import('./admin/agent/agent.module').then(m => m.AgentModule),
canActivate: [InitGuardService]
},
{
path: 'rechargeOrder',
loadChildren: () => import('./admin/recharge-order/recharge-order.module').then(m => m.RechargeOrderModule),
canActivate: [InitGuardService]
},
{
path: 'cms',
loadChildren: () => import('./admin/cms/cms.module').then(m => m.CmsModule),
canActivate: [InitGuardService]
},
{
path: 'activate',
loadChildren: () => import('./admin/activate/activate.module').then(m => m.ActivateModule),
canActivate: [InitGuardService]
},
{
path: 'config-manage',
loadChildren: () => import('./admin/config-manage/config-manage.module').then(m => m.ConfigManageModule),
canActivate: [InitGuardService]
},
{
path: 'discount-package',
loadChildren: () => import('./admin/discount-package/discount-package.module').then(m => m.DiscountPackageModule),
canActivate: [InitGuardService]
},
{
path: 'tuanyou-agent',
loadChildren: () => import('./admin/tuanyou-agent/tuanyou-agent.module').then(m => m.TuanyouAgentModule),
canActivate: [InitGuardService]
},
{
path: 'company-amount',
loadChildren: () => import('./admin/company-amount/company-amount.module').then(m => m.CompanyAmountModule),
canActivate: [InitGuardService]
},
{
path: 'oil-card',
loadChildren: () => import('./admin/oil-card/oil-card.module').then(m => m.OilCardModule),
canActivate: [InitGuardService]
},
{
path: 'gz-sinopec',
loadChildren: () => import('./admin/gz-sinopec/gz-sinopec.module').then(m => m.GzSinopecModule),
canActivate: [InitGuardService]
},
{
path: 'gas-staff',
loadChildren: () => import('./admin/gas-staff/gas-staff.module').then(m => m.GasStaffModule),
canActivate: [InitGuardService]
},
{
path: 'gas-oil-price',
loadChildren: () => import('./admin/gas-oil-price/gas-oil-price.module').then(m => m.GasOilPriceModule),
canActivate: [InitGuardService]
},
{
path: 'api-product',
loadChildren: () => import('./admin/api-product/api-product.module').then(m => m.ApiProductModule),
canActivate: [InitGuardService]
},
{
path: 'api-merchants',
loadChildren: () => import('./admin/api-merchants/api-merchants.module').then(m => m.ApiMerchantsModule),
canActivate: [InitGuardService]
},
],
},
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule],
providers: [
// { provide: RouteReuseStrategy, useClass: RouteStrategyService }
],
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule],
providers: [
// { provide: RouteReuseStrategy, useClass: RouteStrategyService }
],
})
export class AppRoutingModule {
}

@ -0,0 +1,18 @@
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: 'sourceType'
})
export class SourceTypePipe implements PipeTransform {
transform(value: number): string {
switch (value) {
case 1:
return '金额充值';
case 2:
return '订单退款';
case 3:
return '话费消费';
}
}
}

@ -37,3 +37,4 @@ export * from './recharge-price/recharge-platform.pipe';
export * from './recharge-price/price-status.pipe';
export * from './pay-status.pipe';
export * from './chlid-recharge-status.pipe';
export * from './apiMerchant/source-type.pipe';

@ -14,7 +14,7 @@ export class RechargeStatusPipe implements PipeTransform {
case 203:
return '充值失败';
case 204:
return '充值';
return '充值';
}
}

@ -0,0 +1,170 @@
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 ApiMerchantsService {
constructor(
private http: HttpClient,
private common: CommonsService
) { }
/**
*
*
* @param paramsObject
* @param callBack
*/
public getListApiMerchant(paramsObject: object, callBack) {
this.http.get(environment.baseUrl + 'apiMerchants/getListApiMerchant?' + this.common.getWhereCondition(paramsObject)).subscribe(data => {
callBack(data);
});
}
/**
* @Author Sum1Dream
* @methodName editPriceStatus
* @Description // 修改价格状态
* @Date 15:03 2021/8/12
* @Param mod
**/
public updateMerchant(params: object, callBack) {
this.http.post(environment.baseUrl + 'apiMerchants/updateMerchant', params).subscribe(data => {
callBack(data);
});
}
/**
*
*
* @param params
* @param callBack
* @return data
*/
public insertMerchant(params: object, callBack) {
this.http.post(environment.baseUrl + 'apiMerchants/insertMerchant', params).subscribe(data => {
callBack(data);
});
}
/**
* @Author Sum1Dream
* @methodName editPriceStatus
* @Description // 修改价格状态
* @Date 15:03 2021/8/12
* @Param mod
**/
public editMerchantsStatus(params: object, callBack) {
this.http.post(environment.baseUrl + 'apiMerchants/editMerchantsStatus', params).subscribe(data => {
callBack(data);
});
}
/**
* id查询详情
*
* @param id id
* @param callBack
*/
public findById(id: number, callBack) {
this.http.get(environment.baseUrl + 'apiMerchants/findById?id=' + id).subscribe(data => {
callBack(data);
});
}
/**
* @Author Sum1Dream
* @methodName getListApiMerchantByAll
* @Description // 查询所有正常商户
* @Date 15:03 2021/8/12
* @Param mod
**/
public getListApiMerchantByAll(callBack) {
this.http.get(environment.baseUrl + 'apiMerchants/getListApiMerchantByAll').subscribe(data => {
callBack(data);
});
}
/**
* @Author Sum1Dream
* @methodName
* @Description // 商户充值
* @Date 14:28 2022/6/8
* @Param
*/
public recharge(params: object, callBack) {
this.http.post(environment.baseUrl + 'apiMerchants/recharge', params).subscribe(data => {
callBack(data);
});
}
/**
* @Author Sum1Dream
* @methodName getMerchRechargeData
* @Description // 查询商户充值数据
* @Date 15:19 2022/6/8
* @Param id
*/
public getMerchRechargeData(id: number, callBack) {
this.http.get(environment.baseUrl + 'apiMerchants/getMerchRechargeData?merchantId=' + id).subscribe(data => {
callBack(data);
});
}
/**
* @Author Sum1Dream
* @methodName configApiProduct
* @Description // 提交配置产品
* @Date 18:00 2022/6/8
* @Param
*/
public configApiProduct(params: object, callBack) {
this.http.post(environment.baseUrl + 'apiProduct/configApiProduct', params).subscribe(data => {
callBack(data);
});
}
/**
* @Author Sum1Dream
* @methodName editPriceStatus
* @Description // 修改价格状态
* @Date 15:03 2021/8/12
* @Param mod
**/
public editConfigApiProductByStatus(params: object, callBack) {
this.http.post(environment.baseUrl + 'apiProduct/editConfigApiProductByStatus', params).subscribe(data => {
callBack(data);
});
}
/**
* id查询详情
*
* @param id id
* @param callBack
*/
public findConfigProduct(id: number, callBack) {
this.http.get(environment.baseUrl + 'apiProduct/findConfigProduct?id=' + id).subscribe(data => {
callBack(data);
});
}
/**
* @Author Sum1Dream
* @methodName editPriceStatus
* @Description // 修改价格状态
* @Date 15:03 2021/8/12
* @Param mod
**/
public updateConfigApiProduct(params: object, callBack) {
this.http.post(environment.baseUrl + 'apiProduct/updateConfigApiProduct', params).subscribe(data => {
callBack(data);
});
}
}

@ -0,0 +1,97 @@
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 ApiProductService {
constructor(
private http: HttpClient,
private common: CommonsService
) { }
/**
*
*
* @param paramsObject
* @param callBack
*/
public getListApiProduct(paramsObject: object, callBack) {
this.http.get(environment.baseUrl + 'apiProduct/getListApiProduct?' + this.common.getWhereCondition(paramsObject)).subscribe(data => {
callBack(data);
});
}
/**
* @Author Sum1Dream
* @methodName editPriceStatus
* @Description // 修改价格状态
* @Date 15:03 2021/8/12
* @Param mod
**/
public updateProduct(params: object, callBack) {
this.http.post(environment.baseUrl + 'apiProduct/updateProduct', params).subscribe(data => {
callBack(data);
});
}
/**
*
*
* @param params
* @param callBack
* @return data
*/
public insertProduct(params: object, callBack) {
this.http.post(environment.baseUrl + 'apiProduct/insertProduct', params).subscribe(data => {
callBack(data);
});
}
/**
* @Author Sum1Dream
* @methodName editPriceStatus
* @Description // 修改价格状态
* @Date 15:03 2021/8/12
* @Param mod
**/
public editProductStatus(params: object, callBack) {
this.http.post(environment.baseUrl + 'apiProduct/editProductStatus', params).subscribe(data => {
callBack(data);
});
}
/**
* id查询详情
*
* @param id id
* @param callBack
*/
public findById(id: number, callBack) {
this.http.get(environment.baseUrl + 'apiProduct/findById?id=' + id).subscribe(data => {
callBack(data);
});
}
/**
* id查询详情
*
* @param callBack
*/
public getAvailableApiProductByList(callBack) {
this.http.get(environment.baseUrl + 'apiProduct/getAvailableApiProductByList').subscribe(data => {
callBack(data);
});
}
public getListMerchProduct(id: number, callBack) {
this.http.get(environment.baseUrl + 'apiMerchants/getListMerchProduct?merchantId=' + id).subscribe(data => {
callBack(data);
});
}
}

@ -388,4 +388,18 @@ export class CommonsService {
});
}
/**
*
*
* @param phone
* @param merchantId
* @param price
* @param callBack
*/
public sendRechargeSmsCode(phone: string, merchantId: number, price: string, callBack) {
this.http.get(environment.baseUrl + 'sendSms/sendRechargeSmsCodeByMchId?phone=' + phone + '&merchantId=' + merchantId + '&price=' + price).subscribe(data => {
callBack(data);
});
}
}

@ -8,6 +8,7 @@ import {CommonsService} from './commons.service';
})
export class OrderService {
constructor(
private http: HttpClient,
private common: CommonsService

@ -4,10 +4,10 @@
export const environment = {
production: false,
baseUrl: 'http://localhost:9302/brest/', // 测试环境服务器地址(请求数据地址)
imageUrl: 'http://localhost:9302/filesystem/',
// baseUrl: 'https://hsgcs.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址)
// imageUrl: 'https://hsgcs.dctpay.com/filesystem/',
// baseUrl: 'http://localhost:9302/brest/', // 测试环境服务器地址(请求数据地址)
// imageUrl: 'http://localhost:9302/filesystem/',
baseUrl: 'https://hsg.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址)
imageUrl: 'https://hsg.dctpay.com/filesystem/',
key: 'https://hsgcs.dctpay.com/phone-recharge-H5/index.html?codeValue=',
inviteUrl: 'https://hsgcs.dctpay.com/wx/?action=ic&id=',
};

Loading…
Cancel
Save