提交话费修改

pull/1/head
袁野 3 years ago
parent 929b9e8f7d
commit a0e126f447
  1. 10
      src/app/admin/login/login/login.component.ts
  2. 34
      src/app/admin/navigation/navigation.component.ts
  3. 211
      src/app/admin/recharge-order/price-list/price-list.component.html
  4. 70
      src/app/admin/recharge-order/price-list/price-list.component.ts
  5. 6
      src/app/pipes/recharge-price.pipe.ts
  6. 54
      src/app/services/commons.service.ts
  7. 1
      src/app/services/local-storage.namespace.ts

@ -1,12 +1,13 @@
import {Component, OnInit} from '@angular/core'; import {Component, OnInit} from '@angular/core';
import {FormGroup, Validators, FormBuilder} from '@angular/forms'; import {FormGroup, Validators, FormBuilder} from '@angular/forms';
import {LoginService} from '../../../services/login.service'; import {LoginService} from '../../../services/login.service';
import {NzModalService} from 'ng-zorro-antd'; import {NzMessageService, NzModalService} from 'ng-zorro-antd';
import {ADMIN_INFO_OBJECT, TOKEN, INIT_FLAG, LOGINTYPE} from '../../../services/local-storage.namespace'; import {ADMIN_INFO_OBJECT, TOKEN, INIT_FLAG, LOGINTYPE} from '../../../services/local-storage.namespace';
import {LocalStorageService} from '../../../services/local-storage.service'; import {LocalStorageService} from '../../../services/local-storage.service';
import {Router} from '@angular/router'; import {Router} from '@angular/router';
import {HttpClient} from '@angular/common/http'; import {HttpClient} from '@angular/common/http';
@Component({ @Component({
selector: 'app-login', selector: 'app-login',
templateUrl: './login.component.html', templateUrl: './login.component.html',
@ -21,6 +22,7 @@ export class LoginComponent implements OnInit {
private form: FormBuilder, // 表单校验 private form: FormBuilder, // 表单校验
private http: HttpClient, // http请求 private http: HttpClient, // http请求
private loginService: LoginService, private loginService: LoginService,
private message: NzMessageService,
private modal: NzModalService) { private modal: NzModalService) {
} }
@ -55,11 +57,9 @@ export class LoginComponent implements OnInit {
this.store.set(LOGINTYPE, data['return_data']['type']); this.store.set(LOGINTYPE, data['return_data']['type']);
this.router.navigateByUrl('/admin/index').then(); this.router.navigateByUrl('/admin/index').then();
} else { } else {
this.modal.warning({ this.message.error(data['return_msg']);
nzTitle: '提示',
nzContent: data['return_msg']
});
} }
}); });
} }
} }

@ -1,6 +1,14 @@
import { Component, OnInit } from '@angular/core'; import {Component, OnInit} from '@angular/core';
import {LocalStorageService} from '../../services/local-storage.service'; import {LocalStorageService} from '../../services/local-storage.service';
import {DATA, ROUTENAME, MENUNAME, CHILDMENUNAME, INIT_FLAG, ADMIN_INFO_OBJECT, TOKEN} from '../../services/local-storage.namespace'; import {
DATA,
ROUTENAME,
MENUNAME,
CHILDMENUNAME,
INIT_FLAG,
ADMIN_INFO_OBJECT,
TOKEN
} from '../../services/local-storage.namespace';
import {LoginService} from '../../services/login.service'; import {LoginService} from '../../services/login.service';
import {NzMessageService, NzModalService} from 'ng-zorro-antd'; import {NzMessageService, NzModalService} from 'ng-zorro-antd';
import {Router} from '@angular/router'; import {Router} from '@angular/router';
@ -29,6 +37,7 @@ export class NavigationComponent implements OnInit {
menuList: any; menuList: any;
routeName: string; routeName: string;
switchValue = false; switchValue = false;
constructor( constructor(
private storage: LocalStorageService, private storage: LocalStorageService,
private loginService: LoginService, private loginService: LoginService,
@ -38,9 +47,11 @@ export class NavigationComponent implements OnInit {
private http: HttpClient, // http请求 private http: HttpClient, // http请求
private iconService: IconService, private iconService: IconService,
private modal: NzModalService, private modal: NzModalService,
private common: CommonsService,
private fb: FormBuilder, // 表单 private fb: FormBuilder, // 表单
private router: Router, private router: Router,
) { } ) {
}
ngOnInit(): void { ngOnInit(): void {
this.validateForm = this.fb.group({ this.validateForm = this.fb.group({
@ -55,15 +66,23 @@ export class NavigationComponent implements OnInit {
this.switchValue = data['return_data']['codeValue'] === '1'; this.switchValue = data['return_data']['codeValue'] === '1';
}); });
this.menuList = this.storage.getList(ADMIN_INFO_OBJECT)['menuList']; // 定义菜单数据 this.menuList = this.storage.getList(ADMIN_INFO_OBJECT)['menuList']; // 定义菜单数据
this.common.getDictionaries(data => {
if (data['return_code'] === '000000') {
console.log(data);
} else {
this.message.error(data['return_msg']);
}
});
} }
public activeLi(routeName): void { public activeLi(routeName): void {
this.routeName = routeName; this.routeName = routeName;
this.storage.set(ROUTENAME, routeName); this.storage.set(ROUTENAME, routeName);
} }
// 菜单姓名 // 菜单姓名
public getRouteName(menuName , childMenuName): void { public getRouteName(menuName, childMenuName): void {
this.storage.set(MENUNAME, menuName); this.storage.set(MENUNAME, menuName);
this.storage.set(CHILDMENUNAME, childMenuName); this.storage.set(CHILDMENUNAME, childMenuName);
} }
@ -89,7 +108,7 @@ export class NavigationComponent implements OnInit {
clickSwitch(): void { clickSwitch(): void {
this.switchValue = !this.switchValue; this.switchValue = !this.switchValue;
this.commonsService.updateDictionary('RECHARGE' , this.switchValue === true ? '1' : '0' , data => { this.commonsService.updateDictionary('RECHARGE', this.switchValue === true ? '1' : '0', data => {
if (data['return_code'] === '000000') { if (data['return_code'] === '000000') {
this.message.success(data['return_data']); this.message.success(data['return_data']);
} else { } else {
@ -163,13 +182,12 @@ export class NavigationComponent implements OnInit {
*/ */
checkPwd = (control: FormControl): { [s: string]: boolean } => { checkPwd = (control: FormControl): { [s: string]: boolean } => {
if (!control.value) { if (!control.value) {
return { required: true }; return {required: true};
} else if (control.value !== this.validateForm.controls.newPassword.value) { } else if (control.value !== this.validateForm.controls.newPassword.value) {
return { confirm: true, error: true }; return {confirm: true, error: true};
} }
return {}; return {};
} }
} }

@ -9,24 +9,23 @@
<div nz-col nzSpan="8"> <div nz-col nzSpan="8">
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="6">金额类型</nz-form-label> <nz-form-label [nzSpan]="6">运营商</nz-form-label>
<nz-form-control [nzSpan]="16"> <nz-form-control [nzSpan]="16">
<nz-select nzShowSearch nzAllowClear formControlName="type" nzPlaceHolder="请选择金额类型"> <nz-select nzShowSearch nzAllowClear formControlName="operatorType" nzPlaceHolder="请选择运营商">
<nz-option nzLabel="电信充值" nzValue="1"></nz-option> <nz-option nzLabel="电信运营商" nzValue="1"></nz-option>
<nz-option nzLabel="移动充值" nzValue="2"></nz-option> <nz-option nzLabel="移动运营商" nzValue="2"></nz-option>
<nz-option nzLabel="联通充值" nzValue="3"></nz-option> <nz-option nzLabel="联通运营商" nzValue="3"></nz-option>
</nz-select> </nz-select>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
</div> </div>
<div nz-col nzSpan="8"> <div nz-col nzSpan="8">
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="6">展示区域</nz-form-label> <nz-form-label [nzSpan]="6">充值平台</nz-form-label>
<nz-form-control [nzSpan]="16"> <nz-form-control [nzSpan]="16">
<nz-select nzShowSearch nzAllowClear formControlName="showType" nzPlaceHolder="请选择展示区域"> <nz-select nzShowSearch nzAllowClear formControlName="showType" nzPlaceHolder="请选择充值平台">
<nz-option nzLabel="小程序" [nzValue]="1"></nz-option> <nz-option nzLabel="尖椒" [nzValue]="1"></nz-option>
<nz-option nzLabel="H5" [nzValue]="2"></nz-option> <nz-option nzLabel="龙阅" [nzValue]="2"></nz-option>
<nz-option nzLabel="银联" [nzValue]="3"></nz-option>
</nz-select> </nz-select>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
@ -42,6 +41,30 @@
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
</div> </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="rechargeWay" 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="rechargeWay" 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> </div>
@ -78,11 +101,11 @@
<thead nzSingleSort> <thead nzSingleSort>
<tr> <tr>
<th>编号</th> <th>编号</th>
<th>金额类型</th> <th>充值金额</th>
<th>充值类型</th> <th>折扣比例</th>
<th>支付金额</th>
<th>展示区域</th> <th>展示区域</th>
<!-- <th>供货商编号</th>--> <th>商品ID</th>
<!-- <th>商品ID</th>-->
<th>充值金额</th> <th>充值金额</th>
<th>支付金额</th> <th>支付金额</th>
<th>创建时间</th> <th>创建时间</th>
@ -92,7 +115,10 @@
<tbody> <tbody>
<tr *ngFor="let data of ajaxTable.data; let i = index"> <tr *ngFor="let data of ajaxTable.data; let i = index">
<td>{{i + 1}}</td> <td>{{i + 1}}</td>
<td>{{data.type | rechargePrice}}</td> <td>{{data.rechargePrice}}</td>
<td>{{data.discount + "%"}}</td>
<td>{{data.payPrice}}</td>
<td>{{data.operatorType | rechargePrice}}</td>
<td>{{data.rechargeType== 1? '快充':'慢充'}}</td> <td>{{data.rechargeType== 1? '快充':'慢充'}}</td>
<td>{{data.showType | showType}}</td> <td>{{data.showType | showType}}</td>
<td>{{data.price}}</td> <td>{{data.price}}</td>
@ -100,7 +126,7 @@
<td>{{data.createTime | date: 'yyyy-MM-dd HH:mm'}}</td> <td>{{data.createTime | date: 'yyyy-MM-dd HH:mm'}}</td>
<td class="table-td-operation"> <td class="table-td-operation">
<a (click)="getEdit(data.id)">编辑</a> <a (click)="getEdit(data.id)">编辑</a>
<a style="margin-left: 20px;" (click)='getForbiddenUser(data.id , data.status)'>{{data.status === 1 ? '禁用': '启用'}}</a> <a style="margin-left: 20px;" (click)='getForbiddenUser(data.id , data.status)'>{{data.status === 1 ? '售空': '禁用'}}</a>
<a style="margin-left: 20px;" (click)="getForbiddenUserD(data.id)">删除</a> <a style="margin-left: 20px;" (click)="getForbiddenUserD(data.id)">删除</a>
</td> </td>
</tbody> </tbody>
@ -109,103 +135,112 @@
<nz-modal [(nzVisible)]="isVisible" nzTitle="金额编辑" (nzOnCancel)="handleCancel()" (nzOnOk)="handleOk()"> <nz-modal [(nzVisible)]="isVisible" nzTitle="金额编辑" (nzOnCancel)="handleCancel()" (nzOnOk)="handleOk()">
<form nz-form [formGroup]="validateForm" class="login-form"> <form nz-form [formGroup]="validateForm" class="login-form">
<nz-form-item *ngIf="!edit"> <nz-form-item>
<nz-form-label [nzSpan]="6" nzRequired>金额类型</nz-form-label> <nz-form-label [nzSpan]="6" nzRequired>金额类型</nz-form-label>
<nz-form-control [nzSpan]="16" nzErrorTip="请选择类型!"> <nz-form-control [nzSpan]="16" nzErrorTip="请选择类型!">
<nz-select nzShowSearch nzAllowClear formControlName="type" nzPlaceHolder="请选择类型"> <nz-select
<nz-option nzLabel="电信充值" nzValue="1"></nz-option> nzMode="multiple"
<nz-option nzLabel="移动充值" nzValue="2"></nz-option> formControlName="rechargePrices"
<nz-option nzLabel="联通充值" nzValue="3"></nz-option> nzPlaceHolder="请选择充值金额"
>
<nz-option *ngFor="let item of priceArray" nzValue="{{item.codeValue}}" nzLabel="{{item.codeName}}"></nz-option>
</nz-select> </nz-select>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
<nz-form-item > <nz-form-item *ngIf="!edit">
<nz-form-label [nzSpan]="6" nzRequired>展示区域</nz-form-label> <nz-form-label [nzSpan]="6" nzRequired>运营商</nz-form-label>
<nz-form-control [nzSpan]="16" nzErrorTip="请选择展示区域!"> <nz-form-control [nzSpan]="16" nzErrorTip="请选择运营商!">
<nz-select nzShowSearch nzAllowClear formControlName="showType" nzPlaceHolder="请选择展示区域"> <nz-select nzShowSearch nzAllowClear formControlName="operatorType" nzPlaceHolder="请选择运营商!">
<nz-option nzLabel="小程序" [nzValue] ="1"></nz-option> <nz-option nzLabel="电信运营商" nzValue="1"></nz-option>
<nz-option nzLabel="H5" [nzValue] ="2"></nz-option> <nz-option nzLabel="移动运营商" nzValue="2"></nz-option>
<nz-option nzLabel="银联" [nzValue] ="3"></nz-option> <nz-option nzLabel="联通运营商" nzValue="3"></nz-option>
</nz-select> </nz-select>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
<nz-form-item > <nz-form-item>
<nz-form-label [nzSpan]="6" nzRequired>充值类型</nz-form-label> <nz-form-label [nzSpan]="6" nzRequired>展示平台</nz-form-label>
<nz-form-control [nzSpan]="16" nzErrorTip="请选择充值类型!"> <nz-form-control [nzSpan]="16" nzErrorTip="请选择展示平台!">
<nz-select nzShowSearch nzAllowClear formControlName="rechargeType" nzPlaceHolder="请选择充值类型"> <nz-select
<nz-option nzLabel="快充" [nzValue] ="1"></nz-option> nzMode="multiple"
<nz-option nzLabel="慢充" [nzValue]="2"></nz-option> formControlName="productPlatform"
nzPlaceHolder="请选择展示平台"
>
<nz-option *ngFor="let item of productPlatformArray" nzValue="{{item.codeValue}}" nzLabel="{{item.codeName}}"></nz-option>
</nz-select> </nz-select>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="6" nzRequired>商品排序</nz-form-label> <nz-form-label [nzSpan]="6" nzRequired>充值平台</nz-form-label>
<nz-form-control [nzSpan]="16" nzErrorTip="请输入商品排序!"> <nz-form-control [nzSpan]="16" nzErrorTip="请选择充值平台!">
<input [type]="'number'" nz-input formControlName="sort" /> <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-control>
</nz-form-item> </nz-form-item>
<!-- <nz-form-item>-->
<!-- <nz-form-label [nzSpan]="6" nzRequired>供货商编号</nz-form-label>-->
<!-- <nz-form-control [nzSpan]="16" nzErrorTip="请输入供货商编号!">-->
<!-- <input [type]="'number'" nz-input formControlName="channel" />-->
<!-- </nz-form-control>-->
<!-- </nz-form-item>-->
<!-- <nz-form-item>-->
<!-- <nz-form-label [nzSpan]="6" nzRequired>商品ID</nz-form-label>-->
<!-- <nz-form-control [nzSpan]="16" nzErrorTip="请输入商品ID!">-->
<!-- <input [type]="'number'" nz-input formControlName="goodsId" />-->
<!-- </nz-form-control>-->
<!-- </nz-form-item>-->
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="6" nzRequired>充值金额</nz-form-label> <nz-form-label [nzSpan]="6" nzRequired>支付方式</nz-form-label>
<nz-form-control [nzSpan]="16" nzErrorTip="请输入充值金额!"> <nz-form-control [nzSpan]="16" nzErrorTip="请选择支付方式!">
<nz-input-group nzSuffix="RMB" nzPrefix="¥"> <nz-select
<input [type]="'number'" (ngModelChange)="getPrice()" nz-input formControlName="price" /> nzMode="multiple"
</nz-input-group> formControlName="payType"
nzPlaceHolder="请选择支付方式"
>
<nz-option *ngFor="let item of priceTypeArray" 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="rechargeWay" 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>
<nz-form-label [nzSpan]="6" nzRequired>充值类型</nz-form-label>
<nz-form-control [nzSpan]="16" nzErrorTip="请选择充值类型!">
<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-control>
</nz-form-item> </nz-form-item>
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="6" nzRequired>折扣比例</nz-form-label> <nz-form-label [nzSpan]="6" nzRequired>折扣比例</nz-form-label>
<nz-form-control [nzSpan]="16" nzErrorTip="请输入折扣比例!"> <nz-form-control [nzSpan]="16" nzErrorTip="请输入折扣比例!">
<nz-input-group nzSuffix="%" > <nz-input-number
<input [type]="'number'" (ngModelChange)="getPrice()" nz-input formControlName="discount" /> style="width: 200px"
</nz-input-group> 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-control>
</nz-form-item> </nz-form-item>
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="6" nzRequired>支付金额</nz-form-label> <nz-form-label [nzSpan]="6" nzRequired>积分支付比例</nz-form-label>
<nz-form-control [nzSpan]="16" nzErrorTip="请输入支付金额!"> <nz-form-control [nzSpan]="16" nzErrorTip="请输入积分支付比例!">
<nz-input-group nzSuffix="RMB" nzPrefix="¥"> <nz-input-number
<input [type]="'number'" nz-input [(ngModel)]="realPrice" formControlName="realPrice" /> style="width: 200px"
</nz-input-group> formControlName="integralDiscount"
[nzMin]="1"
[nzMax]="100"
[nzStep]="1"
[nzPrecision]="2"
nzPrecisionMode="cut"
nzPlaceHolder="请输入积分支付比例!"
[nzFormatter]="formatterPercent"
[nzParser]="parserPercent"
></nz-input-number>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
</form> </form>
</nz-modal> </nz-modal>
<nz-modal [(nzVisible)]="isVisibleGoods" nzWidth="900" nzTitle="渠道商获取关联商品" (nzOnCancel)="handleCancelGoods()" (nzOnOk)="handleCancelGoods()">
<nz-table #basicTable [nzData]="goodsArray">
<thead>
<tr>
<th>供货商编号</th>
<th>商品ID</th>
<th>渠道商标识符</th>
<th>折扣比例</th>
<th>商品名称</th>
<th>渠道商名称</th>
<th>状态</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of basicTable.data">
<td>{{data.channel}}</td>
<td>{{data.goodsId}}</td>
<td>{{data.channelMark | channelMark}}</td>
<td>{{data.discountRatio}}%</td>
<td>{{data.goodsName}}</td>
<td>{{data.memberName}}</td>
<td>{{data.state == 1 ? '上架' : '下架'}}</td>
</tr>
</tbody>
</nz-table>
</nz-modal>

@ -19,6 +19,10 @@ export class PriceListComponent implements OnInit {
searchForm: FormGroup; // 搜索框 searchForm: FormGroup; // 搜索框
validateForm: FormGroup; // 添加框 validateForm: FormGroup; // 添加框
requestData = []; // 列表数据 requestData = []; // 列表数据
priceArray = []; // 价格数据
priceTypeArray = []; // 支付类型数据
platformArray = []; // 充值平台数据
productPlatformArray = []; // 展示平台数据
total: number; // 页码 total: number; // 页码
pageNum = 1; // 页码 pageNum = 1; // 页码
@ -30,7 +34,10 @@ export class PriceListComponent implements OnInit {
isVisibleGoods = false; isVisibleGoods = false;
realPrice = 0; realPrice = 0;
goodsArray;
formatterPercent = (value: number): string => `${value == null ? 0 : value} %`;
parserPercent = (value: string): string => value.replace(' %', '');
constructor( constructor(
private form: FormBuilder, private form: FormBuilder,
private recharge: RechargeService, private recharge: RechargeService,
@ -45,23 +52,49 @@ export class PriceListComponent implements OnInit {
ngOnInit(): void { ngOnInit(): void {
this.init(); this.init();
this.getInitData();
}
// 获取初始化数据
private getInitData(): void {
// 获取价格数据
this.common.getDictionary('RECHARGE_AMOUNT ', data => {
this.priceArray = data['return_data'];
});
// 获取支付类型
this.common.getDictionary('PAY_TYPE ', data => {
this.priceTypeArray = data['return_data'];
});
// 获取充值平台
this.common.getDictionary('RECHARGE_PLATFORM ', data => {
this.platformArray = data['return_data'];
});
// 获取展示平台
this.common.getDictionary('SHOW_PLATFORM ', data => {
this.productPlatformArray = data['return_data'];
});
} }
public init(): void { public init(): void {
this.searchForm = this.form.group({ this.searchForm = this.form.group({
type: [null], operatorType : [null],
rechargePlatform: [null],
rechargeType: [null], rechargeType: [null],
showType: [null], rechargeWay: [null],
status: [null],
}); });
this.validateForm = this.form.group({ this.validateForm = this.form.group({
type: [null, [Validators.required]],
showType: [null, [Validators.required]],
price: [null, [Validators.required]],
rechargeType: [null, [Validators.required]],
realPrice: [{value: null, disabled: true}, [Validators.required]],
discount: [null, [Validators.required]], discount: [null, [Validators.required]],
sort: [null, [Validators.required]], integralDiscount: [null, [Validators.required]],
// channel: [null, [Validators.required]], operatorType: [null, [Validators.required]],
rechargePrices: [null, [Validators.required]],
productPlatform: [null, [Validators.required]],
rechargeType: [null, [Validators.required]],
rechargePlatform: [null, [Validators.required]],
rechargeWay: [null, [Validators.required]],
payType: [null, [Validators.required]],
}); });
@ -128,7 +161,6 @@ export class PriceListComponent implements OnInit {
return; return;
} }
} }
this.validateForm.value.realPrice = this.validateForm.value.price * this.validateForm.value.discount / 100;
if (this.edit) { if (this.edit) {
this.validateForm.value['id'] = this.id; this.validateForm.value['id'] = this.id;
@ -136,6 +168,7 @@ export class PriceListComponent implements OnInit {
if (data['return_code'] === '000000') { if (data['return_code'] === '000000') {
this.message.success('修改成功'); this.message.success('修改成功');
this.getRequest(false, this.searchForm.value); this.getRequest(false, this.searchForm.value);
this.validateForm.reset();
this.isVisible = false; this.isVisible = false;
} else { } else {
this.message.error(data['return_msg']); this.message.error(data['return_msg']);
@ -147,6 +180,7 @@ export class PriceListComponent implements OnInit {
this.message.success('添加成功'); this.message.success('添加成功');
this.getRequest(false, this.searchForm.value); this.getRequest(false, this.searchForm.value);
this.isVisible = false; this.isVisible = false;
this.validateForm.reset();
} else { } else {
this.message.error(data['return_msg']); this.message.error(data['return_msg']);
} }
@ -159,9 +193,7 @@ export class PriceListComponent implements OnInit {
this.isVisible = false; this.isVisible = false;
} }
handleCancelGoods(): void {
this.isVisibleGoods = false;
}
public getForbiddenUser(id, status: any): void { public getForbiddenUser(id, status: any): void {
const message = (status === 1 ? '是否禁用' : '是否启用'); const message = (status === 1 ? '是否禁用' : '是否启用');
@ -196,16 +228,6 @@ export class PriceListComponent implements OnInit {
}); });
} }
public getMemberGoods(): void {
this.isVisibleGoods = true;
this.recharge.getMemberGoods(data => {
this.goodsArray = data['return_data']['data'];
});
}
public getPrice(): void {
this.realPrice = this.validateForm.value.price * this.validateForm.value.discount / 100;
}

@ -8,11 +8,11 @@ export class RechargePricePipe implements PipeTransform {
transform(value: number): string { transform(value: number): string {
switch (value) { switch (value) {
case 1: case 1:
return '电信充值'; return '电信运营商';
case 2: case 2:
return '移动充值'; return '移动运营商';
case 3: case 3:
return '联通充值'; return '联通运营商';
} }
} }

@ -15,7 +15,8 @@ export class CommonsService {
private modalService: NzModalService, // 对话框 private modalService: NzModalService, // 对话框
private http: HttpClient, private http: HttpClient,
private notification: NzNotificationService private notification: NzNotificationService
) { } ) {
}
/** /**
* GET请求参数 key1=value1&key2=value2 * GET请求参数 key1=value1&key2=value2
@ -55,7 +56,7 @@ export class CommonsService {
* @param message * @param message
* @param callback * @param callback
*/ */
public showConfirm(message , callback) { public showConfirm(message, callback) {
this.modalService.confirm({ this.modalService.confirm({
nzTitle: message, nzTitle: message,
nzOkText: '是', nzOkText: '是',
@ -71,7 +72,7 @@ export class CommonsService {
* @param estateId id * @param estateId id
* @param callBack * @param callBack
*/ */
public getMallCategoryTree(estateId: number , callBack) { public getMallCategoryTree(estateId: number, callBack) {
this.http.get(environment.baseUrl + 'categoryEstates/getMallCategoryTree?estateId=' + estateId).subscribe(data => { this.http.get(environment.baseUrl + 'categoryEstates/getMallCategoryTree?estateId=' + estateId).subscribe(data => {
callBack(data); callBack(data);
}); });
@ -161,20 +162,20 @@ export class CommonsService {
* @param codeType * @param codeType
* @param callback * @param callback
*/ */
public getDictionary(codeType: string , callback): any { public getDictionary(codeType: string, callback): any {
this.http.get(environment.baseUrl + '/common/getDictionaryByCodeType?codeType=' + codeType).subscribe( data => { this.http.get(environment.baseUrl + '/common/getDictionaryByCodeType?codeType=' + codeType).subscribe(data => {
callback(data); callback(data);
}); });
} }
public mappingSysNameOl(codeType: string , callback): any { public mappingSysNameOl(codeType: string, callback): any {
this.http.get(environment.baseUrl + '/common/getDictionaryByCodeTypeOl?codeType=' + codeType).subscribe( data => { this.http.get(environment.baseUrl + '/common/getDictionaryByCodeTypeOl?codeType=' + codeType).subscribe(data => {
callback(data); callback(data);
}); });
} }
public updateDictionary(codeType: string , codeValue: string , callback): any { public updateDictionary(codeType: string, codeValue: string, callback): any {
this.http.get(environment.baseUrl + '/common/updateDictionary?codeType=' + codeType + '&codeValue=' + codeValue).subscribe( data => { this.http.get(environment.baseUrl + '/common/updateDictionary?codeType=' + codeType + '&codeValue=' + codeValue).subscribe(data => {
callback(data); callback(data);
}); });
} }
@ -186,7 +187,7 @@ export class CommonsService {
* @param callback * @param callback
*/ */
getAllJobType(callback) { getAllJobType(callback) {
this.http.get('assets/json/jobType.json').subscribe( data => { this.http.get('assets/json/jobType.json').subscribe(data => {
callback(data); callback(data);
}); });
} }
@ -230,7 +231,7 @@ export class CommonsService {
* @param title * @param title
* @param content * @param content
*/ */
public createNotification(type: string , title: string , content: string): void { public createNotification(type: string, title: string, content: string): void {
this.notification.create( this.notification.create(
type, type,
title, title,
@ -245,13 +246,13 @@ export class CommonsService {
* @param object object * @param object object
* @param callback * @param callback
*/ */
public positionKeyValue<T>(value: string , object: Array<any> , callback): void { public positionKeyValue<T>(value: string, object: Array<any>, callback): void {
// tslint:disable-next-line:forin // tslint:disable-next-line:forin
for (const i in object) { for (const i in object) {
if (object[i].value === value) { if (object[i].value === value) {
callback(object[i].label); callback(object[i].label);
} else { } else {
this.positionKeyValue(value , object[i].children , callback); this.positionKeyValue(value, object[i].children, callback);
} }
} }
} }
@ -263,8 +264,8 @@ export class CommonsService {
* @param codeValue value * @param codeValue value
* @param callback * @param callback
*/ */
public getDictionaryByCodeTypeAndValue(codeType: string , codeValue: string , callback): any { public getDictionaryByCodeTypeAndValue(codeType: string, codeValue: string, callback): any {
this.http.get(environment.baseUrl + '/common/getDictionaryByCodeTypeAndValue?codeType=' + codeType + '&codeValue=' + codeValue).subscribe( data => { this.http.get(environment.baseUrl + '/common/getDictionaryByCodeTypeAndValue?codeType=' + codeType + '&codeValue=' + codeValue).subscribe(data => {
callback(data); callback(data);
}); });
} }
@ -276,7 +277,7 @@ export class CommonsService {
* @param codeValue value * @param codeValue value
* @param callback * @param callback
*/ */
public getDictionaryByCodeTypeAndValuePromise(codeType: string , codeValue: string): any { public getDictionaryByCodeTypeAndValuePromise(codeType: string, codeValue: string): any {
return new Promise(resolve => { return new Promise(resolve => {
this.http.get(environment.baseUrl + '/common/getDictionaryByCodeTypeAndValue?codeType=' + codeType + '&codeValue=' + codeValue).subscribe(data => { this.http.get(environment.baseUrl + '/common/getDictionaryByCodeTypeAndValue?codeType=' + codeType + '&codeValue=' + codeValue).subscribe(data => {
resolve(data['return_data']['codeName']); resolve(data['return_data']['codeName']);
@ -290,7 +291,7 @@ export class CommonsService {
* @param callback * @param callback
*/ */
public getHomeCompanyList(param: object, callback): any { public getHomeCompanyList(param: object, callback): any {
this.http.get(environment.baseUrl + 'common/getHomeCompanyList?' + this.getWhereCondition(param)).subscribe( data => { this.http.get(environment.baseUrl + 'common/getHomeCompanyList?' + this.getWhereCondition(param)).subscribe(data => {
callback(data); callback(data);
}); });
} }
@ -326,7 +327,7 @@ export class CommonsService {
* @param id id * @param id id
* @param callBack * @param callBack
*/ */
public getDetailById(id: number , callBack) { public getDetailById(id: number, callBack) {
this.http.get(environment.baseUrl + 'highGasDiscountOilPrice/getDetailById?id=' + id).subscribe(data => { this.http.get(environment.baseUrl + 'highGasDiscountOilPrice/getDetailById?id=' + id).subscribe(data => {
callBack(data); callBack(data);
}); });
@ -338,8 +339,8 @@ export class CommonsService {
* @param id id * @param id id
* @param callBack * @param callBack
*/ */
public delete(id: number , callBack) { public delete(id: number, callBack) {
this.http.post(environment.baseUrl + 'highGasDiscountOilPrice/delete' , { id: id}).subscribe(data => { this.http.post(environment.baseUrl + 'highGasDiscountOilPrice/delete', {id: id}).subscribe(data => {
callBack(data); callBack(data);
}); });
} }
@ -350,7 +351,18 @@ export class CommonsService {
* @param callback * @param callback
*/ */
public getOrganizationList(param: object, callback): any { public getOrganizationList(param: object, callback): any {
this.http.get(environment.baseUrl + 'bsOrganization/getOrganizationList?' + this.getWhereCondition(param)).subscribe( data => { this.http.get(environment.baseUrl + 'bsOrganization/getOrganizationList?' + this.getWhereCondition(param)).subscribe(data => {
callback(data);
});
}
/**
*
* @param param
* @param callback
*/
public getDictionaries(callback): any {
this.http.get(environment.baseUrl + 'bsOrganization/getOrganizationList').subscribe(data => {
callback(data); callback(data);
}); });
} }

@ -14,3 +14,4 @@ export const RESUME_STATUS = 'resume_status';
export const RESUME_STATUS_NAME = 'resume_status_name'; export const RESUME_STATUS_NAME = 'resume_status_name';
export const LOGINTYPE = 'loginType'; // 1 pc端登录 2 后台登录 export const LOGINTYPE = 'loginType'; // 1 pc端登录 2 后台登录
export const COMPANYMENU = 'companyMenu'; // 1 公司路由 export const COMPANYMENU = 'companyMenu'; // 1 公司路由
export const ALL_DICTIONARY = 'dictionary'; // 数据字典

Loading…
Cancel
Save