提交代理商订单页面

pull/1/head
袁野 2 years ago
parent e711e76912
commit bf3f32e154
  1. 23
      src/app/admin/activate/activate-edit/activate-edit.component.ts
  2. 75
      src/app/admin/api-merchants/list/list.component.html
  3. 175
      src/app/admin/api-merchants/list/list.component.ts
  4. 53
      src/app/admin/api-product/list/list.component.html
  5. 40
      src/app/admin/api-product/list/list.component.ts
  6. 2
      src/app/admin/cms/cms-content/cms-content.component.ts
  7. 7
      src/app/admin/recharge-order/price-list/price-list.component.ts
  8. 10
      src/app/app-common.module.ts
  9. 2
      src/app/pipes/index.ts
  10. 2
      src/app/pipes/third-product/product-type.pipe.ts
  11. 8
      src/app/services/api-merchants.service.ts
  12. 24
      src/app/services/api-product.service.ts
  13. 75
      src/app/services/commons.service.ts

@ -98,14 +98,21 @@ export class ActivateEditComponent implements OnInit {
} }
public getCouponList(whereObject) { public getCouponList(whereObject) {
whereObject.status = 2; this.coupon.getCouponListByAll({} , data => {
this.coupon.getCouponList(whereObject, data => { if (data['return_code'] === '000000') {
if (data['return_code'] === '000000') { this.listOfOption = data['return_data'];
this.listOfOption = data['return_data'].list; } else {
} else { this.message.error(data['return_msg']);
this.message.error(data['return_msg']); }
} });
}); // whereObject.status = 2;
// this.coupon.getCouponList(whereObject, data => {
// if (data['return_code'] === '000000') {
// this.listOfOption = data['return_data'].list;
// } else {
// this.message.error(data['return_msg']);
// }
// });
} }
// 绑定优惠券 // 绑定优惠券

@ -110,10 +110,9 @@
<a nz-dropdown [nzDropdownMenu]="menu">更多操作</a> <a nz-dropdown [nzDropdownMenu]="menu">更多操作</a>
<nz-dropdown-menu #menu="nzDropdownMenu"> <nz-dropdown-menu #menu="nzDropdownMenu">
<ul nz-menu nzSelectable> <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)="configProduct(data.mchId)">配置产品</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)="showConfigProduct(data.mchId)">产品详情</a></li>
<li class="li-a" nz-menu-item><a (click)="configIp(data.mchId)">配置IP地址</a></li> <li class="li-a" nz-menu-item><a (click)="configIp(data.mchId)">配置IP地址</a></li>
<li class="li-a" nz-menu-item><a (click)="configApiProduct(data.mchId)">配置可用接口</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)="getMerchRechargeData(data.id)">金额记录</a></li>
<li class="li-a" nz-menu-item><a (click)='getForbiddenUser(data.id , data.status)'>{{data.status === 101 ? '上线': '禁用'}}</a></li> <li class="li-a" nz-menu-item><a (click)='getForbiddenUser(data.id , data.status)'>{{data.status === 101 ? '上线': '禁用'}}</a></li>
</ul> </ul>
@ -200,7 +199,7 @@
<td>¥{{data.amount}}</td> <td>¥{{data.amount}}</td>
<td>¥{{data.beforeAmount}}</td> <td>¥{{data.beforeAmount}}</td>
<td>¥{{data.afterAmount}}</td> <td>¥{{data.afterAmount}}</td>
<td>{{data.sourceType | sourceType}}</td> <td>{{data.sourceType | orderProductType}}</td>
<td>{{data.sourceContent}}</td> <td>{{data.sourceContent}}</td>
<td>{{data.operatorName}}</td> <td>{{data.operatorName}}</td>
<td>{{data.createTime | date : 'yyyy-MM-dd HH:mm:ss'}}</td> <td>{{data.createTime | date : 'yyyy-MM-dd HH:mm:ss'}}</td>
@ -209,17 +208,17 @@
</nz-table> </nz-table>
</nz-modal> </nz-modal>
<nz-modal [(nzVisible)]="configVisible" nzTitle="产品配置" (nzOnCancel)="handleCancelConfig()" (nzOnOk)="handleOkConfig()"> <nz-modal [(nzVisible)]="configVisible" [nzWidth]="700" nzTitle="产品配置(当前配置为全局配置,会覆盖当前商户所有配置产品内容)" (nzOnCancel)="handleCancelConfig()" (nzOnOk)="handleOkConfig()">
<form nz-form [formGroup]="configValidateForm" class="login-form"> <form nz-form [formGroup]="configValidateForm" class="login-form">
<nz-form-item *ngIf="!edit"> <nz-form-item *ngIf="!edit">
<nz-form-label [nzSpan]="6" nzRequired>选择产品</nz-form-label> <nz-form-label [nzSpan]="6" >选择产品</nz-form-label>
<nz-form-control [nzSpan]="16" nzErrorTip="请选择选择产品!"> <nz-form-control [nzSpan]="16" nzErrorTip="请选择产品!">
<nz-select <nz-select
nzMode="multiple" nzMode="multiple"
formControlName="productIds" formControlName="productType"
nzPlaceHolder="请选择充值金额" nzPlaceHolder="请选择产品"
> >
<nz-option *ngFor="let item of productArray" nzValue="{{item.id}}" nzLabel="{{item.operatorType | rechargePrice}}|{{item.phoneRechargeType== 1? '快充':'慢充'}}|{{item.rechargePrice}}元"></nz-option> <nz-option *ngFor="let item of productTypeArray" nzValue="{{item.codeValue}}" nzLabel="{{item.codeName}}"></nz-option>
</nz-select> </nz-select>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
@ -240,36 +239,46 @@
></nz-input-number> ></nz-input-number>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
<nz-form-item *ngIf="configValidateForm.value['productType'] | verifyProductType">
<nz-form-label [nzSpan]="6" nzRequired>选择公司</nz-form-label>
<nz-form-control [nzSpan]="16" nzErrorTip="请选择公司!">
<nz-select nzShowSearch formControlName="companyId" nzAllowClear (ngModelChange)="requestMerList($event)">
<nz-option *ngFor="let item of companyArray" nzValue="{{item['id']}}" nzLabel="{{item['name']}}"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
<nz-form-item *ngIf="configValidateForm.value['productType'] | verifyProductType">
<nz-form-label [nzSpan]="6" nzRequired>选择商户</nz-form-label>
<nz-form-control [nzSpan]="16" nzErrorTip="请选择商户!">
<nz-select nzMode="multiple" formControlName="merchantId" nzAllowClear>
<nz-option *ngFor="let item of merArray" nzValue="{{item['id']}}" nzLabel="{{item['merchantName']}}"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</form> </form>
</nz-modal> </nz-modal>
<nz-modal [(nzVisible)]="visibleConfigProduct" nzTitle="商户产品" (nzOnCancel)="visibleConfigProduct = false" nzWidth="1000px" [nzFooter]="null"> <nz-modal [(nzVisible)]="visibleConfigProduct" nzTitle="商户产品" (nzOnCancel)="visibleConfigProduct = false" nzWidth="900px" [nzFooter]="null">
<nz-table #productConfigTable nzBordered [nzScroll]="{ x: '1200px' }" [nzData]="productConfigArray"> <nz-table #productConfigTable [nzLoading]="loading" nzBordered [nzData]="productConfigArray">
<thead> <thead>
<tr> <tr>
<th nzWidth="60px">编号</th> <th nzWidth="30px">编号</th>
<th nzWidth="90px">充值金额</th> <th nzWidth="200px">产品</th>
<th nzWidth="90px">折扣金额</th> <th nzWidth="40px">折扣比例</th>
<th nzWidth="120px">运营商</th> <th nzWidth="60px">操作</th>
<th nzWidth="90px">充值类型</th>
<th nzWidth="80px">状态</th>
<th nzRight nzWidth="100px">操作</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr *ngFor="let data of productConfigTable.data;let i = index"> <tr *ngFor="let data of productConfigTable.data;let i = index">
<td>{{i + 1}}</td> <td>{{i + 1}}</td>
<td>{{data.rechargePrice}}</td> <td>{{data.ext1}}</td>
<td>{{data.discountPrice}}</td> <td>{{data.discount}}%</td>
<td>{{data.operatorType | rechargePrice}}</td> <td class="table-td-operation">
<td>{{data.phoneRechargeType== 1? '快充':'慢充'}}</td> <a (click)="getEditConfigProduct(data.id , data.ext1)">编辑</a>
<td>{{data.configStatus== 101? '正常':'下架中'}}</td> <nz-divider nzType="vertical"></nz-divider>
<td nzRight class="table-td-operation"> <a (click)="showDeleteConfirmDelete(data.id)">删除</a>
<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> </td>
</tr> </tr>
</tbody> </tbody>
@ -277,7 +286,7 @@
</nz-modal> </nz-modal>
<nz-modal [(nzVisible)]="editConfigVisible" nzTitle="编辑产品折扣" (nzOnCancel)="editConfigVisible = false" (nzOnOk)="handleOkConfigEdit()"> <nz-modal [(nzVisible)]="editConfigVisible" nzTitle="编辑折扣({{productName}})" (nzOnCancel)="editConfigVisible = false" (nzOnOk)="handleOkConfigEdit()">
<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="请输入折扣比例!">
@ -297,7 +306,7 @@
</nz-form-item> </nz-form-item>
</nz-modal> </nz-modal>
<nz-modal [(nzVisible)]="isVisibleIpAddress" nzTitle="编辑产品折扣" (nzOnCancel)="isVisibleIpAddress = false" (nzOnOk)="handleOkConfigIp()"> <nz-modal [(nzVisible)]="isVisibleIpAddress" nzTitle="编辑商户IP地址" (nzOnCancel)="isVisibleIpAddress = false" (nzOnOk)="handleOkConfigIp()">
<nz-spin [nzSpinning]="isSpinning" nzTip="提交中..."> <nz-spin [nzSpinning]="isSpinning" nzTip="提交中...">
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="6" nzRequired>IP地址</nz-form-label> <nz-form-label [nzSpan]="6" nzRequired>IP地址</nz-form-label>
@ -309,9 +318,3 @@
</nz-modal> </nz-modal>
<nz-modal [(nzVisible)]="isVisibleConfig" nzTitle="配置可用接口" (nzOnCancel)="isVisibleConfig = false" (nzOnOk)="handleOkConfigProduct()">
<nz-spin [nzSpinning]="isSpinning" nzTip="配置中...">
<nz-checkbox-group [(ngModel)]="checkOptions"></nz-checkbox-group>
</nz-spin>
</nz-modal>

@ -1,15 +1,15 @@
import {Component, OnInit} from '@angular/core'; import {Component, OnInit} from '@angular/core';
import {environment} from '../../../../environments/environment';
import {CouponService} from '../../../services/coupon.service';
import {IconService} from '../../../services/icon.service'; import {IconService} from '../../../services/icon.service';
import {CommonsService} from '../../../services/commons.service'; import {CommonsService} from '../../../services/commons.service';
import {ApiMerchantsService} from '../../../services/api-merchants.service'; import {ApiMerchantsService} from '../../../services/api-merchants.service';
import {ApiProductService} from '../../../services/api-product.service'; import {ApiProductService} from '../../../services/api-product.service';
import {FormBuilder, FormGroup, Validators} from '@angular/forms'; import {FormBuilder, FormGroup, Validators} from '@angular/forms';
import {NzMessageService} from 'ng-zorro-antd'; import {NzMessageService} from 'ng-zorro-antd';
import {Router} from '@angular/router';
import {HttpClient} from '@angular/common/http'; import {CompanyService} from '../../../services/company.service';
import { map, filter, scan , take } from 'rxjs/operators'; import {MerchantService} from '../../../services/merchant.service';
import {NzModalService} from '_ng-zorro-antd@9.3.0@ng-zorro-antd';
@Component({ @Component({
selector: 'app-list', selector: 'app-list',
@ -18,13 +18,9 @@ import { map, filter, scan , take } from 'rxjs/operators';
}) })
export class ListComponent implements OnInit { export class ListComponent implements OnInit {
WEB_SERVE_URL = environment.imageUrl;
searchForm: FormGroup; // 搜索框 searchForm: FormGroup; // 搜索框
validateForm: FormGroup; // 添加框 validateForm: FormGroup; // 添加框
requestData = []; // 列表数据 requestData = []; // 列表数据
priceArray = []; // 价格数据
platformArray = []; // 充值平台数据
total: number; // 页码 total: number; // 页码
pageNum = 1; // 页码 pageNum = 1; // 页码
pageSize = 10; // 条码 pageSize = 10; // 条码
@ -36,9 +32,7 @@ export class ListComponent implements OnInit {
visibleConfigProduct = false; visibleConfigProduct = false;
id: number; id: number;
edit = false; edit = false;
payPrice;
isVisibleIpAddress = false; isVisibleIpAddress = false;
realPrice = 0;
mchId: string; mchId: string;
rechargeModal = false; rechargeModal = false;
rechargeForm: FormGroup; rechargeForm: FormGroup;
@ -48,7 +42,6 @@ export class ListComponent implements OnInit {
smsCodeBtnLoading = false; smsCodeBtnLoading = false;
submitRechargeBtnLoading = false; submitRechargeBtnLoading = false;
countdownTime; countdownTime;
merchantArray = []; merchantArray = [];
merchRechargeData = []; merchRechargeData = [];
merchantId: number; merchantId: number;
@ -57,9 +50,14 @@ export class ListComponent implements OnInit {
productConfigArray = []; productConfigArray = [];
discount; discount;
ipAddress: string; ipAddress: string;
productName: string;
isSpinning = false; isSpinning = false;
isVisibleConfig = false; isVisibleConfig = false;
checkOptions = []; checkOptions = [];
merArray = [];
// 产品类型
productTypeArray = [];
companyArray = [];
formatterPercent = (value: number): string => `${value == null ? 0 : value} %`; formatterPercent = (value: number): string => `${value == null ? 0 : value} %`;
parserPercent = (value: string): string => value.replace(' %', ''); parserPercent = (value: string): string => value.replace(' %', '');
@ -67,12 +65,13 @@ export class ListComponent implements OnInit {
private form: FormBuilder, private form: FormBuilder,
private apiMerchants: ApiMerchantsService, private apiMerchants: ApiMerchantsService,
private apiProduct: ApiProductService, private apiProduct: ApiProductService,
private coupon: CouponService,
private iconService: IconService, private iconService: IconService,
private message: NzMessageService, private message: NzMessageService,
private http: HttpClient, private companyService: CompanyService,
private router: Router, private merchantService: MerchantService,
private modalService: NzModalService,
private common: CommonsService private common: CommonsService
) { ) {
} }
@ -83,16 +82,16 @@ export class ListComponent implements OnInit {
// 获取初始化数据 // 获取初始化数据
private getInitData(): void { private getInitData(): void {
// 获取价格数据 // 获取产品类型
this.common.getDictionary('RECHARGE_AMOUNT ', data => { this.common.getDictionary('ORDER_PRODUCT_TYPE', data => {
this.priceArray = data['return_data']; this.productTypeArray = data['return_data'];
}); });
// 获取充值平台 // 获取所有公司
this.common.getDictionary('RECHARGE_PLATFORM ', data => { this.companyService.selectCompanyList({ pageNum: 1, pageSize: 999 }, data => {
this.platformArray = data['return_data']; this.companyArray = data['return_data']['list'];
}); });
// 获取可用接口数据 // 获取可用接口数据
this.common.getDictionary('API_PRODUCT_CONFIG ', data => { this.common.getDictionary('API_PRODUCT_CONFIG', data => {
for (const i of data['return_data']) { for (const i of data['return_data']) {
this.checkOptions.push({ this.checkOptions.push({
label: i['codeName'], value: i['codeValue'] label: i['codeName'], value: i['codeValue']
@ -115,8 +114,11 @@ export class ListComponent implements OnInit {
}); });
this.initApiMerchantsPostFrom(false); this.initApiMerchantsPostFrom(false);
this.configValidateForm = this.form.group({ this.configValidateForm = this.form.group({
productIds: [null, [Validators.required]], productType: [null],
discount: [null, [Validators.required]], companyId: [null],
merchantId: [null],
mchId: [null],
discount: [null],
}); });
this.getRequest(true, this.searchForm.value); this.getRequest(true, this.searchForm.value);
@ -272,38 +274,6 @@ export class ListComponent implements OnInit {
}); });
} }
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']);
}
});
}
});
}
/** /**
* *
@ -410,8 +380,8 @@ export class ListComponent implements OnInit {
} }
// 配置产品 // 配置产品
public configProduct(id: number): void { public configProduct(mchId: string): void {
this.merchantId = id; this.mchId = mchId;
this.configVisible = true; this.configVisible = true;
} }
@ -421,13 +391,13 @@ export class ListComponent implements OnInit {
for (const i in this.configValidateForm.controls) { for (const i in this.configValidateForm.controls) {
this.configValidateForm.controls[i].markAsDirty(); this.configValidateForm.controls[i].markAsDirty();
this.configValidateForm.controls[i].updateValueAndValidity(); this.configValidateForm.controls[i].updateValueAndValidity();
console.log(this.configValidateForm.controls[i]);
if (this.configValidateForm.controls[i].errors != null) { if (this.configValidateForm.controls[i].errors != null) {
this.message.error('必填项不能为空'); this.message.error('必填项不能为空');
return; return;
} }
} }
this.configValidateForm.value['merchantsId'] = this.merchantId; this.configValidateForm.controls['mchId'].setValue(this.mchId);
console.log(this.configValidateForm.value);
this.apiMerchants.configApiProduct(this.configValidateForm.value , data => { this.apiMerchants.configApiProduct(this.configValidateForm.value , data => {
if (data['return_code'] === '000000') { if (data['return_code'] === '000000') {
this.configVisible = false; this.configVisible = false;
@ -439,15 +409,17 @@ export class ListComponent implements OnInit {
}); });
} }
public showConfigProduct(id: number) { public showConfigProduct(id: string) {
this.visibleConfigProduct = true; this.visibleConfigProduct = true;
this.merchantId = id; this.mchId = id;
this.getListMerchProduct(id); this.getListMerchProduct(id);
} }
public getListMerchProduct(id: number): void { public getListMerchProduct(id: string): void {
this.loading = true;
this.apiProduct.getListMerchProduct(id , data => { this.apiProduct.getListMerchProduct(id , data => {
this.loading = false;
if (data['return_code'] === '000000') { if (data['return_code'] === '000000') {
this.productConfigArray = data['return_data']; this.productConfigArray = data['return_data'];
} else { } else {
@ -458,9 +430,10 @@ export class ListComponent implements OnInit {
// 修改商品 // 修改商品
public getEditConfigProduct(id: number) { public getEditConfigProduct(id: number , name: string) {
this.configProductId = id; this.configProductId = id;
this.apiMerchants.findConfigProduct(id , data => { this.productName = name;
this.apiMerchants.findMchProduct(id , data => {
if (data['return_code'] === '000000') { if (data['return_code'] === '000000') {
this.discount = data['return_data']['discount']; this.discount = data['return_data']['discount'];
} else { } else {
@ -482,7 +455,7 @@ export class ListComponent implements OnInit {
this.apiMerchants.updateConfigApiProduct(prams , data => { this.apiMerchants.updateConfigApiProduct(prams , data => {
if (data['return_code'] === '000000') { if (data['return_code'] === '000000') {
this.editConfigVisible = false; this.editConfigVisible = false;
this.getListMerchProduct(this.merchantId); this.getListMerchProduct(this.mchId);
} else { } else {
this.message.error(data['return_msg']); this.message.error(data['return_msg']);
} }
@ -498,6 +471,7 @@ export class ListComponent implements OnInit {
// 打开配置ip地址 // 打开配置ip地址
public configIp(mchId: string): void { public configIp(mchId: string): void {
this.mchId = mchId; this.mchId = mchId;
this.ipAddress = null;
this.apiMerchants.findByMchId( mchId , data => { this.apiMerchants.findByMchId( mchId , data => {
if (data['return_code'] === '000000') { if (data['return_code'] === '000000') {
this.ipAddress = data['return_data']['ipAddress']; this.ipAddress = data['return_data']['ipAddress'];
@ -523,50 +497,41 @@ export class ListComponent implements OnInit {
}); });
} }
// 打开配置产品弹框
public configApiProduct(mchId: string): void {
this.mchId = mchId;
this.apiMerchants.getSecConfigList(mchId , data => {
console.log(data);
const returnData = data['return_data'];
if (data['return_data'].length > 0) {
for (const i of this.checkOptions) {
if (returnData.filter(item => item['codeType'] === i['value']).length > 0) {
i['checked'] = true;
} else {
i['checked'] = false;
}
}
}
this.isVisibleConfig = true;
});
// 获取商户列表
requestMerList(companyId: number) {
if (companyId != null) {
this.merchantService.getMerchantListByCompany(companyId, data => {
if (data['return_code'] === '000000') {
this.merArray = data['return_data'];
} else {
this.message.error(data['return_msg']);
}
});
}
}
// 是否删除
showDeleteConfirmDelete(id): void {
this.modalService.confirm({
nzTitle: '是否确定删除',
nzOkText: '是',
nzOnOk: () => this.deleteModule(id),
nzCancelText: '否',
});
} }
// 配置产品 deleteModule(id: number) {
public handleOkConfigProduct(): void { if (id != null) {
const data = []; this.apiProduct.detailApiMchProduct(id, data => {
for (const i of this.checkOptions) { if (data['return_code'] === '000000') {
if (i['checked']) { this.getListMerchProduct(this.mchId);
data.push(i['value']); this.message.success('操作成功');
} } else {
this.message.error(data['return_msg']);
}
});
} }
console.log(data);
const postData = {
mchId: this.mchId,
configProduct: data.join(',')
};
this.isSpinning = true;
this.apiMerchants.configMerchant(postData , res => {
if (res['return_code'] === '000000') {
this.isSpinning = false;
this.message.success('配置成功');
this.isVisibleConfig = false;
} else {
this.message.error(res['return_msg']);
}
});
} }
} }

@ -26,17 +26,7 @@
<nz-select nzShowSearch nzAllowClear formControlName="rechargePlatform" nzPlaceHolder="请选择充值平台"> <nz-select nzShowSearch nzAllowClear formControlName="rechargePlatform" 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-select> <nz-option nzLabel="畅停" [nzValue]="4"></nz-option>
</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-select>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
@ -109,9 +99,15 @@
<td>{{data.createTime | date: 'yyyy-MM-dd HH:mm'}}</td> <td>{{data.createTime | date: 'yyyy-MM-dd HH:mm'}}</td>
<td nzRight="">{{data.status== 101? '上线':'编辑中'}}</td> <td nzRight="">{{data.status== 101? '上线':'编辑中'}}</td>
<td nzRight class="table-td-operation"> <td nzRight class="table-td-operation">
<a *ngIf="data.status != 101" (click)="getEdit(data.id)">编辑</a> <a nz-dropdown [nzDropdownMenu]="menu">更多操作<i nz-icon nzType="down"></i></a>
<a style="margin-left: 20px;" (click)='getForbiddenUser(data.id , data.status)'>{{data.status === 101 ? '下线': '上线'}}</a> <nz-dropdown-menu #menu="nzDropdownMenu">
<a *ngIf="data.status != 101" style="margin-left: 20px;" (click)="getForbiddenUserD(data.id)">删除</a> <ul nz-menu nzSelectable>
<li nz-menu-item><a *ngIf="data.status != 101" (click)="getEdit(data.id)">产品编辑</a></li>
<li nz-menu-item><a (click)="getProductCode(data.id)">配置编码</a></li>
<li nz-menu-item><a (click)='getForbiddenUser(data.id , data.status)'>{{data.status === 101 ? '产品下线': '产品上线'}}</a></li>
<li *ngIf="data.status != 101" nz-menu-item><a (click)="getForbiddenUserD(data.id)">产品删除</a></li>
</ul>
</nz-dropdown-menu>
</td> </td>
</tbody> </tbody>
</nz-table> </nz-table>
@ -157,28 +153,6 @@
</nz-select> </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="请选择充值类型!">
<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-item *ngIf="edit">
<nz-form-label [nzSpan]="6" >排序</nz-form-label> <nz-form-label [nzSpan]="6" >排序</nz-form-label>
<nz-form-control [nzSpan]="16" nzErrorTip="请输入排序!"> <nz-form-control [nzSpan]="16" nzErrorTip="请输入排序!">
@ -194,3 +168,10 @@
</nz-form-item> </nz-form-item>
</form> </form>
</nz-modal> </nz-modal>
<nz-modal [(nzVisible)]="isVisibleProductCode" nzTitle="产品编码编辑" (nzOnCancel)="isVisibleProductCode = false" (nzOnOk)="handleOkCode()">
<div style="margin-bottom: 30px;" *ngFor="let item of rechargeCodeList">
<nz-input-group nzAddOnBefore="{{item.rechargePlatformName}}" >
<input type="text" nz-input [(ngModel)]="item.goodsId" placeholder="请输入产品编码" />
</nz-input-group>
</div>
</nz-modal>

@ -33,9 +33,8 @@ export class ListComponent implements OnInit {
id: number; id: number;
edit = false; edit = false;
payPrice; payPrice;
isVisibleGoods = false; isVisibleProductCode = false;
realPrice = 0; rechargeCodeList: any;
constructor( constructor(
private form: FormBuilder, private form: FormBuilder,
private recharge: RechargeService, private recharge: RechargeService,
@ -76,11 +75,9 @@ export class ListComponent implements OnInit {
this.validateForm = this.form.group({ this.validateForm = this.form.group({
operatorType: [null, [Validators.required]], operatorType: [null, [Validators.required]],
prices: [null, [Validators.required]], prices: [null, [Validators.required]],
phoneRechargeType: [null, [Validators.required]],
rechargePlatform: [null, [Validators.required]], rechargePlatform: [null, [Validators.required]],
rechargePrice: [null], rechargePrice: [null],
sort: [null], sort: [null],
productId: [null],
}); });
@ -229,5 +226,38 @@ export class ListComponent implements OnInit {
}); });
} }
// 配置产品编码
public getProductCode(productId: number): void {
const paramsObject = {
id: productId,
codeType: 'RECHARGE_PLATFORM',
type: 2
};
this.recharge.getRechargeCodeList(paramsObject , data => {
if (data['return_code'] === '000000') {
this.isVisibleProductCode = true;
this.rechargeCodeList = data['return_data'];
for (const i of this.rechargeCodeList) {
i['sourceId'] = productId;
i['type'] = 2;
}
} else {
this.message.error(data['return_msg']);
}
});
}
// 上传配置
public handleOkCode(): void {
this.recharge.editRechargeCode(this.rechargeCodeList , data => {
if (data['return_code'] === '000000') {
this.isVisibleProductCode = false;
this.message.success('编辑成功');
this.getRequest(false, this.searchForm.value);
} else {
this.message.error(data['return_msg']);
}
});
}
} }

@ -223,7 +223,7 @@ export class CmsContentComponent implements OnInit {
} }
showDeleteConfirmDelete(id: number): void { showDeleteConfirmDelete(id: number): void {
this.common.showConfirm('是否确定删除!', dataR => { this.common.showConfirm('是否确定!', dataR => {
if (dataR) { if (dataR) {
this.cms.deleteById(id, data => { this.cms.deleteById(id, data => {
if (data['return_code'] === '000000') { if (data['return_code'] === '000000') {

@ -33,8 +33,7 @@ export class PriceListComponent implements OnInit {
id: number; id: number;
edit = false; edit = false;
payPrice; payPrice;
isVisibleGoods = false;
realPrice = 0;
rechargeCodeList: any; rechargeCodeList: any;
formatterPercent = (value: number): string => `${value == null ? 0 : value} %`; formatterPercent = (value: number): string => `${value == null ? 0 : value} %`;
parserPercent = (value: string): string => value.replace(' %', ''); parserPercent = (value: string): string => value.replace(' %', '');
@ -261,9 +260,11 @@ export class PriceListComponent implements OnInit {
public getProductCode(productId: number): void { public getProductCode(productId: number): void {
const paramsObject = { const paramsObject = {
id: productId, id: productId,
codeType: 'RECHARGE_PLATFORM' codeType: 'RECHARGE_PLATFORM',
type: 1
}; };
this.recharge.getRechargeCodeList(paramsObject , data => { this.recharge.getRechargeCodeList(paramsObject , data => {
console.log(data);
if (data['return_code'] === '000000') { if (data['return_code'] === '000000') {
this.isVisibleProductCode = true; this.isVisibleProductCode = true;
this.rechargeCodeList = data['return_data']; this.rechargeCodeList = data['return_data'];

@ -67,9 +67,15 @@ import {
ProductTypePipe, ProductTypePipe,
OrderRefundOpuserTypePipe, OrderRefundOpuserTypePipe,
OrderChildStatusPipe, OrderChildStatusPipe,
PayStatusPipe, CallbackStatusPipe, ProductConfigPipe, PayCouponStatusPipe, OrderOilChannelTypePipe PayStatusPipe,
CallbackStatusPipe,
ProductConfigPipe,
PayCouponStatusPipe,
OrderOilChannelTypePipe,
VerifyProductTypePipe
} from './pipes'; } from './pipes';
import {MsgTypePipe} from './pipes/msg/msg-type.pipe'; import {MsgTypePipe} from './pipes/msg/msg-type.pipe';
import { OrderProductTypePipe } from './pipes/order/order-product-type.pipe';
@ -140,6 +146,8 @@ const PIPES = [
ProductTypePipe, ProductTypePipe,
MsgTypePipe, MsgTypePipe,
OrderOilChannelTypePipe, OrderOilChannelTypePipe,
VerifyProductTypePipe,
OrderProductTypePipe,
]; ];

@ -59,3 +59,5 @@ export * from './index/product-config.pipe';
export * from './apiMerchant/callback-status.pipe'; export * from './apiMerchant/callback-status.pipe';
export * from './order/pay-coupon-status.pipe'; export * from './order/pay-coupon-status.pipe';
export * from './order/order-oil-channel-type.pipe'; export * from './order/order-oil-channel-type.pipe';
export * from './apiMerchant/verify-product-type.pipe';
export * from './order/order-product-type.pipe';

@ -11,7 +11,7 @@ export class ProductTypePipe implements PipeTransform {
3: ['第三方产品'], 3: ['第三方产品'],
4: ['积分充值'], 4: ['积分充值'],
5: ['中石化', '消费券', '其他卡券' , '贵州中石化' , '重庆中石油'], 5: ['中石化', '消费券', '其他卡券' , '贵州中石化' , '重庆中石油'],
6: ['在线加油'], 6: [''],
7: ['优惠券包'], 7: ['优惠券包'],
8: ['汇联通充值'], 8: ['汇联通充值'],
}; };

@ -127,7 +127,7 @@ export class ApiMerchantsService {
* @Param configApiProduct * @Param configApiProduct
*/ */
public configApiProduct(params: object, callBack) { public configApiProduct(params: object, callBack) {
this.http.post(environment.baseUrl + 'apiProduct/configApiProduct', params).subscribe(data => { this.http.post(environment.baseUrl + 'apiMchProduct/insertMchProduct', params).subscribe(data => {
callBack(data); callBack(data);
}); });
} }
@ -151,8 +151,8 @@ export class ApiMerchantsService {
* @param id id * @param id id
* @param callBack * @param callBack
*/ */
public findConfigProduct(id: number, callBack) { public findMchProduct(id: number, callBack) {
this.http.get(environment.baseUrl + 'apiProduct/findConfigProduct?id=' + id).subscribe(data => { this.http.get(environment.baseUrl + 'apiMchProduct/findMchProduct?id=' + id).subscribe(data => {
callBack(data); callBack(data);
}); });
} }
@ -165,7 +165,7 @@ export class ApiMerchantsService {
* @Param mod * @Param mod
**/ **/
public updateConfigApiProduct(params: object, callBack) { public updateConfigApiProduct(params: object, callBack) {
this.http.post(environment.baseUrl + 'apiProduct/updateConfigApiProduct', params).subscribe(data => { this.http.post(environment.baseUrl + 'apiMchProduct/editMchProduct', params).subscribe(data => {
callBack(data); callBack(data);
}); });
} }

@ -88,8 +88,15 @@ export class ApiProductService {
}); });
} }
public getListMerchProduct(id: number, callBack) { /**
this.http.get(environment.baseUrl + 'apiMerchants/getListMerchProduct?merchantId=' + id).subscribe(data => { * @Author Sum1Dream
* @methodName getListMerchProduct
* @Description // 查询商户产品列表
* @Date 09:51 2023/2/24
* @Param mchId: number, callBack
*/
public getListMerchProduct(mchId: string, callBack) {
this.http.get(environment.baseUrl + 'apiMchProduct/getListApiMchProduct?mchId=' + mchId).subscribe(data => {
callBack(data); callBack(data);
}); });
} }
@ -283,4 +290,17 @@ export class ApiProductService {
}); });
} }
/**
* @Author Sum1Dream
* @methodName detailApiMchProduct
* @Description //根据id 删除配置产品
* @Date 11:10 2023/2/24
* @Param id: number, callBack
*/
public detailApiMchProduct(id: number, callBack) {
this.http.get(environment.baseUrl + 'apiMchProduct/detailApiMchProduct?id=' + id).subscribe(data => {
callBack(data);
});
}
} }

@ -99,25 +99,7 @@ export class CommonsService {
}); });
} }
/**
*
* @param callBack
*/
public getAllProvinceAndCityRegion(callBack) {
this.http.get(environment.baseUrl + 'common/getAllProvinceAndCityRegion').subscribe(data => {
callBack(data);
});
}
/**
*
* @param callBack
*/
public getAllIndustry(callBack) {
this.http.get(environment.baseUrl + 'secCompanyIndustry/findIndustryTree').subscribe(data => {
callBack(data);
});
}
/** /**
* *
@ -278,63 +260,6 @@ export class CommonsService {
); );
} }
/**
* key查询value
*
* @param value string
* @param object object
* @param callback
*/
public positionKeyValue<T>(value: string, object: Array<any>, callback): void {
// tslint:disable-next-line:forin
for (const i in object) {
if (object[i].value === value) {
callback(object[i].label);
} else {
this.positionKeyValue(value, object[i].children, callback);
}
}
}
/**
*
*
* @param codeType
* @param codeValue value
* @param callback
*/
public getDictionaryByCodeTypeAndValue(codeType: string, codeValue: string, callback): any {
this.http.get(environment.baseUrl + '/common/getDictionaryByCodeTypeAndValue?codeType=' + codeType + '&codeValue=' + codeValue).subscribe(data => {
callback(data);
});
}
/**
*
*
* @param codeType
* @param codeValue value
* @param callback
*/
public getDictionaryByCodeTypeAndValuePromise(codeType: string, codeValue: string): any {
return new Promise(resolve => {
this.http.get(environment.baseUrl + '/common/getDictionaryByCodeTypeAndValue?codeType=' + codeType + '&codeValue=' + codeValue).subscribe(data => {
resolve(data['return_data']['codeName']);
});
});
}
/**
*
* @param param
* @param callback
*/
public getHomeCompanyList(param: object, callback): any {
this.http.get(environment.baseUrl + 'common/getHomeCompanyList?' + this.getWhereCondition(param)).subscribe(data => {
callback(data);
});
}
/** /**
* *
* *

Loading…
Cancel
Save