From 6e78f3331166e14b13887b919aba4936ddd1c4bb Mon Sep 17 00:00:00 2001 From: Sum1Dream <418471657@qq.com> Date: Thu, 21 Jul 2022 15:11:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BF=AE=E6=94=B9=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../order-list/order-list.component.html | 2 +- .../price-list/price-list.component.html | 45 ++++++++++++------- .../price-list/price-list.component.ts | 38 ++++++++++++++-- src/app/app-common.module.ts | 2 + src/app/pipes/index.ts | 1 + .../recharge-price/recharge-platform.pipe.ts | 3 ++ src/app/services/recharge.service.ts | 25 +++++++++++ 7 files changed, 95 insertions(+), 21 deletions(-) diff --git a/src/app/admin/recharge-order/order-list/order-list.component.html b/src/app/admin/recharge-order/order-list/order-list.component.html index b31a206..e7df9a5 100644 --- a/src/app/admin/recharge-order/order-list/order-list.component.html +++ b/src/app/admin/recharge-order/order-list/order-list.component.html @@ -243,7 +243,7 @@ {{data.orderNo}} - {{data.rechargePlatform == 2 ? '龙阅':'尖椒'}} + {{data.rechargePlatform | platform}} {{data.status | chlidRechargeStatus}} {{data['createTime'] | date: 'yyyy-MM-dd HH:mm'}} diff --git a/src/app/admin/recharge-order/price-list/price-list.component.html b/src/app/admin/recharge-order/price-list/price-list.component.html index d03eac8..147702e 100644 --- a/src/app/admin/recharge-order/price-list/price-list.component.html +++ b/src/app/admin/recharge-order/price-list/price-list.component.html @@ -145,9 +145,15 @@ {{data.createTime | date: 'yyyy-MM-dd HH:mm'}} {{data.status | priceStatus}} - 编辑 - {{data.status === 1 ? '售空': '上线'}} - 删除 + 更多操作 + + + @@ -275,19 +281,19 @@ > - - 商品编号 - - - - + + + + + + + + + + + + + 排序 @@ -304,3 +310,10 @@ + +
+ + + +
+
diff --git a/src/app/admin/recharge-order/price-list/price-list.component.ts b/src/app/admin/recharge-order/price-list/price-list.component.ts index 903eccd..f1b9640 100644 --- a/src/app/admin/recharge-order/price-list/price-list.component.ts +++ b/src/app/admin/recharge-order/price-list/price-list.component.ts @@ -29,12 +29,13 @@ export class PriceListComponent implements OnInit { pageSize = 10; // 条码 loading = true; isVisible = false; + isVisibleProductCode = false; id: number; edit = false; payPrice; isVisibleGoods = false; realPrice = 0; - + rechargeCodeList: any; formatterPercent = (value: number): string => `${value == null ? 0 : value} %`; parserPercent = (value: string): string => value.replace(' %', ''); @@ -231,9 +232,6 @@ export class PriceListComponent implements OnInit { }); } }); - console.log(status); - console.log(statusPost); - console.log(message); } public getForbiddenUserD(idPost): void { @@ -259,5 +257,37 @@ export class PriceListComponent implements OnInit { this.payPrice = this.validateForm.value['rechargePrice'] * e / 100; } + // 配置产品编码 + public getProductCode(productId: number): void { + const paramsObject = { + id: productId, + codeType: 'RECHARGE_PLATFORM' + }; + 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'] = 1; + } + } 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']); + } + }); + } } diff --git a/src/app/app-common.module.ts b/src/app/app-common.module.ts index 9085c4a..cbc2583 100644 --- a/src/app/app-common.module.ts +++ b/src/app/app-common.module.ts @@ -55,6 +55,7 @@ import {OilTypePipe} from './pipes/store/oil-type.pipe'; import {OilPriceTaskStatusPipe} from './pipes/gas-oil-price/oil-price-task-status.pipe'; import {OilPriceTaskExecutionTypePipe} from './pipes/gas-oil-price/oil-price-task-execution-type.pipe'; import {OilPriceTaskPriceTypePipe} from './pipes/gas-oil-price/oil-price-task-price-type.pipe'; +import { PlatformPipe } from './pipes/recharge-pipe/platform.pipe'; const PIPES = [ TimesPipe, @@ -103,6 +104,7 @@ const PIPES = [ ChlidRechargeStatusPipe, SourceTypePipe, GasClassGroupTaskStatusPipe, + PlatformPipe, ]; diff --git a/src/app/pipes/index.ts b/src/app/pipes/index.ts index 7aac75a..dd9723f 100644 --- a/src/app/pipes/index.ts +++ b/src/app/pipes/index.ts @@ -39,3 +39,4 @@ export * from './pay-status.pipe'; export * from './chlid-recharge-status.pipe'; export * from './apiMerchant/source-type.pipe'; export * from './gas-class-group-task/gas-class-group-task-status.pipe'; +export * from './recharge-pipe/platform.pipe'; diff --git a/src/app/pipes/recharge-price/recharge-platform.pipe.ts b/src/app/pipes/recharge-price/recharge-platform.pipe.ts index 5897009..2ba3345 100644 --- a/src/app/pipes/recharge-price/recharge-platform.pipe.ts +++ b/src/app/pipes/recharge-price/recharge-platform.pipe.ts @@ -15,6 +15,9 @@ export class RechargePlatformPipe implements PipeTransform { if (Number(i) === 2) { string = string + '龙阅,'; } + if (Number(i) === 3) { + string = string + '城宇,'; + } } return string.substring(0 , string.length - 1); diff --git a/src/app/services/recharge.service.ts b/src/app/services/recharge.service.ts index 4f22dc7..b93adca 100644 --- a/src/app/services/recharge.service.ts +++ b/src/app/services/recharge.service.ts @@ -260,4 +260,29 @@ export class RechargeService { }); } + /** + * 获取充值产品编码列表 + * + * @param paramsObject 对象 + * @param callBack 回调 + */ + public getRechargeCodeList(paramsObject: object, callBack) { + this.http.get(environment.baseUrl + 'outRechargePrice/getRechargeCodeList?' + this.common.getWhereCondition(paramsObject)).subscribe(data => { + callBack(data); + }); + } + + /** + * 编辑产品编码 + * + * @param params 上传对象 + * @param callBack 回调 + * @return data 返回结果 + */ + public editRechargeCode(params: object, callBack) { + this.http.post(environment.baseUrl + 'outRechargePrice/editRechargeCode', params).subscribe(data => { + callBack(data); + }); + } + }