diff --git a/src/app/admin/config-manage/integral-rebate/integral-rebate.component.html b/src/app/admin/config-manage/integral-rebate/integral-rebate.component.html index 23d349f..4914aca 100644 --- a/src/app/admin/config-manage/integral-rebate/integral-rebate.component.html +++ b/src/app/admin/config-manage/integral-rebate/integral-rebate.component.html @@ -102,12 +102,10 @@ 编号 - - 产品名称 - 利润比例 - 积分抵扣比例 - 支付方式 - 展示平台 + 积分返利比例 + 类型 + 产品 + 返利时间范围 创建时间 操作 @@ -115,19 +113,17 @@ {{i + 1}} - - {{data.productName}} - {{data.discount + "%"}} - {{data.integralDiscount + "%"}} - {{data.productPayTypeString.substring(0 , data.productPayTypeString.length - 1)}} - {{data.productPlatformString.substring(0 , data.productPlatformString.length - 1)}} + {{data.percentage + "%"}} + {{data.type | integralType}} + {{data.type | integralProduct : data.productId}} + {{data.startTime | date: 'yyyy-MM-dd HH:mm'}} - {{data.endTime | date: 'yyyy-MM-dd HH:mm'}} {{data.createTime | date: 'yyyy-MM-dd HH:mm'}} 更多操作 @@ -152,8 +148,8 @@ 卡券产品 - - + + @@ -161,7 +157,7 @@ 在线加油产品 - + @@ -169,9 +165,9 @@ 话费产品 - - - + + + @@ -179,12 +175,18 @@ 第三方产品 - - - + + + + + 第三方产品 + + + + 积分返利比例 diff --git a/src/app/admin/config-manage/integral-rebate/integral-rebate.component.ts b/src/app/admin/config-manage/integral-rebate/integral-rebate.component.ts index ef731a6..53d3b3d 100644 --- a/src/app/admin/config-manage/integral-rebate/integral-rebate.component.ts +++ b/src/app/admin/config-manage/integral-rebate/integral-rebate.component.ts @@ -73,6 +73,7 @@ export class IntegralRebateComponent implements OnInit { productId: [null], type: [null, [Validators.required]], percentage: [null, [Validators.required]], + time: [null, [Validators.required]], }); @@ -88,7 +89,7 @@ export class IntegralRebateComponent implements OnInit { } whereObject['pageNum'] = this.pageNum; whereObject['pageSize'] = this.pageSize; - this.apiProduct.getProductConfig(whereObject, data => { + this.apiProduct.getIntegralRebateByList(whereObject, data => { if (data['return_code'] === '000000') { console.log(data); this.requestData = data['return_data'].list; @@ -109,9 +110,8 @@ export class IntegralRebateComponent implements OnInit { if (id != null) { this.id = id; this.edit = true; - this.apiProduct.findProductConfig(id, data => { - data['return_data']['productPlatform'] = data['return_data']['productPlatformString'].substring(0 , data['return_data']['productPlatformString'].length - 1).split(','); - data['return_data']['payType'] = data['return_data']['productPayTypeString'].substring(0 , data['return_data']['productPayTypeString'].length - 1).split(','); + this.apiProduct.findIntegralRebateById(id, data => { + data['return_data'].time = [new Date(data['return_data']['startTime']), new Date(data['return_data']['endTime'])]; this.validateForm.patchValue(data['return_data']); this.isVisible = true; }); @@ -135,10 +135,13 @@ export class IntegralRebateComponent implements OnInit { return; } } - + if (this.validateForm.value['time'] != null && this.validateForm.value['time'].length !== 0) { + this.validateForm.value['startTime'] = this.validateForm.value['time'][0].getTime(); + this.validateForm.value['endTime'] = this.validateForm.value['time'][1].getTime(); + } if (this.edit) { this.validateForm.value['id'] = this.id; - this.apiProduct.updateProductConfig(this.validateForm.value, data => { + this.apiProduct.updateIntegralRebate(this.validateForm.value, data => { this.message.remove(wait); if (data['return_code'] === '000000') { this.message.success('修改成功'); @@ -150,7 +153,7 @@ export class IntegralRebateComponent implements OnInit { } }); } else { - this.apiProduct.productConfig(this.validateForm.value, data => { + this.apiProduct.insertIntegralRebate(this.validateForm.value, data => { this.message.remove(wait); if (data['return_code'] === '000000') { this.message.success('添加成功'); @@ -174,10 +177,7 @@ export class IntegralRebateComponent implements OnInit { this.common.showConfirm('是否删除', item => { if (item) { - this.recharge.editPriceStatus({ - id: idPost, - status: 0 - }, data => { + this.apiProduct.deleteIntegralRebate(idPost, data => { if (data['return_code'] === '000000') { this.message.success('删除成功'); this.getRequest(false, this.searchForm.value); 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 147702e..95864b4 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 @@ -30,17 +30,17 @@ -
- - 充值类型 - - - - - - - -
+ + + + + + + + + + + @@ -119,7 +119,7 @@ 支付金额 积分抵扣比例 运营商 - 充值类型 + 充值平台 支付方式 展示平台 @@ -137,7 +137,7 @@ {{data.payPrice}} {{data.integralDiscount + "%"}} {{data.operatorType | rechargePrice}} - {{data.rechargeType== 1? '快充':'慢充'}} + {{data.rechargePlatform | rechargePlatform}} {{data.productPayTypeString.substring(0 , data.productPayTypeString.length - 1)}} {{data.productPlatformString.substring(0 , data.productPlatformString.length - 1)}} @@ -237,15 +237,15 @@ - - 充值类型 - - - - - - - + + + + + + + + + 折扣比例 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 f1b9640..c615afd 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 @@ -81,7 +81,7 @@ export class PriceListComponent implements OnInit { this.searchForm = this.form.group({ operatorType : [null], rechargePlatform: [null], - rechargeType: [null], + // rechargeType: [null], rechargeWay: [null], status: [null], }); @@ -91,7 +91,7 @@ export class PriceListComponent implements OnInit { operatorType: [null, [Validators.required]], rechargePrices: [null, [Validators.required]], productPlatform: [null, [Validators.required]], - rechargeType: [null, [Validators.required]], + // rechargeType: [null, [Validators.required]], rechargePlatform: [null, [Validators.required]], rechargeWay: [null, [Validators.required]], payType: [null, [Validators.required]], diff --git a/src/app/app-common.module.ts b/src/app/app-common.module.ts index d4bed88..8cd1865 100644 --- a/src/app/app-common.module.ts +++ b/src/app/app-common.module.ts @@ -56,6 +56,8 @@ import {OilPriceTaskStatusPipe} from './pipes/gas-oil-price/oil-price-task-statu 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'; +import { IntegralTypePipe } from './pipes/integral/integral-type.pipe'; +import { IntegralProductPipe } from './pipes/integral/integral-product.pipe'; const PIPES = [ TimesPipe, @@ -119,10 +121,14 @@ const PIPES = [ ], declarations: [ ...PIPES, + IntegralTypePipe, + IntegralProductPipe, ], exports: [ ...PIPES, + IntegralTypePipe, + IntegralProductPipe, ], }) diff --git a/src/app/services/api-product.service.ts b/src/app/services/api-product.service.ts index 9fced35..1f82462 100644 --- a/src/app/services/api-product.service.ts +++ b/src/app/services/api-product.service.ts @@ -220,4 +220,67 @@ export class ApiProductService { }); } + /** + * @Author Sum1Dream + * @methodName insertMemberProduct + * @Description // 新增积分返利配置 + * @Date 10:39 2022/7/12 + * @Param params: object, callBack + */ + public insertIntegralRebate(params: object, callBack) { + this.http.post(environment.baseUrl + 'bsIntegralRebate/insertIntegralRebate', params).subscribe(data => { + callBack(data); + }); + } + + /** + * @Author Sum1Dream + * @methodName updateMemberProduct + * @Description // 修改积分返利配置 + * @Date 10:40 2022/7/12 + * @Param params: object, callBack + */ + public updateIntegralRebate(params: object, callBack) { + this.http.post(environment.baseUrl + 'bsIntegralRebate/updateIntegralRebate', params).subscribe(data => { + callBack(data); + }); + } + + /** + * @Author Sum1Dream + * @methodName getListApiMemberProduct + * @Description // 查询列表 + * @Date 10:38 2022/7/12 + * @Param paramsObject: object, callBack + */ + public getIntegralRebateByList(paramsObject: object, callBack) { + this.http.get(environment.baseUrl + 'bsIntegralRebate/getIntegralRebateByList?' + this.common.getWhereCondition(paramsObject)).subscribe(data => { + callBack(data); + }); + } + + /** + * 根据id查询产品详情 + * + * @param id id + * @param callBack 回调 + */ + public findIntegralRebateById(id: number, callBack) { + this.http.get(environment.baseUrl + 'bsIntegralRebate/findIntegralRebateById?id=' + id).subscribe(data => { + callBack(data); + }); + } + + /** + * 删除 + * + * @param id id + * @param callBack 回调 + */ + public deleteIntegralRebate(id: number, callBack) { + this.http.get(environment.baseUrl + 'bsIntegralRebate/deleteIntegralRebate?id=' + id).subscribe(data => { + callBack(data); + }); + } + }