diff --git a/src/app/admin/order-manage/order-manage-routing.module.ts b/src/app/admin/order-manage/order-manage-routing.module.ts index c62cd7a..aa660d0 100644 --- a/src/app/admin/order-manage/order-manage-routing.module.ts +++ b/src/app/admin/order-manage/order-manage-routing.module.ts @@ -3,13 +3,14 @@ import { Routes, RouterModule } from '@angular/router'; import {OrderOilListComponent} from './order-oil/order-oil-list/order-oil-list.component'; import {OrderCouponListComponent} from './order-coupon/order-coupon-list/order-coupon-list.component'; import {OrderIntegralRechargeComponent} from './order-integral-recharge/order-integral-recharge.component'; -import {KfcOrderListComponent} from './kfc-order/kfc-order-list/kfc-order-list.component'; +import {OrderRefundListComponent} from './order-refund-list/order-refund-list.component'; const routes: Routes = [ { path: 'order-oil-list', component: OrderOilListComponent }, { path: 'order-coupon-list', component: OrderCouponListComponent }, - { path: 'order-integral-recharge-list', component: OrderIntegralRechargeComponent}, + { path: 'order-integral-recharge-list', component: OrderIntegralRechargeComponent }, + { path: 'order-refund-list', component: OrderRefundListComponent }, { path: 'order-kfc-list', component: KfcOrderListComponent} ]; diff --git a/src/app/admin/order-manage/order-manage.module.ts b/src/app/admin/order-manage/order-manage.module.ts index 03b9753..b7ed2d2 100644 --- a/src/app/admin/order-manage/order-manage.module.ts +++ b/src/app/admin/order-manage/order-manage.module.ts @@ -9,11 +9,10 @@ import {BreadcrumbModule} from '../../common/breadcrumb/breadcrumb.module'; import {AppCommonModule} from '../../app-common.module'; import { OrderCouponListComponent } from './order-coupon/order-coupon-list/order-coupon-list.component'; import { OrderIntegralRechargeComponent } from './order-integral-recharge/order-integral-recharge.component'; -import { KfcOrderListComponent } from './kfc-order/kfc-order-list/kfc-order-list.component'; - +import { OrderRefundListComponent } from './order-refund-list/order-refund-list.component'; @NgModule({ - declarations: [OrderOilListComponent, OrderCouponListComponent, OrderIntegralRechargeComponent, KfcOrderListComponent], + declarations: [OrderOilListComponent, OrderCouponListComponent, OrderIntegralRechargeComponent, OrderRefundListComponent, KfcOrderListComponent], imports: [ CommonModule, OrderManageRoutingModule, diff --git a/src/app/admin/order-manage/order-oil/order-oil-list/order-oil-list.component.html b/src/app/admin/order-manage/order-oil/order-oil-list/order-oil-list.component.html index 1882d9b..66ea9bf 100644 --- a/src/app/admin/order-manage/order-oil/order-oil-list/order-oil-list.component.html +++ b/src/app/admin/order-manage/order-oil/order-oil-list/order-oil-list.component.html @@ -275,7 +275,7 @@ @@ -422,27 +422,29 @@ - diff --git a/src/app/admin/order-manage/order-oil/order-oil-list/order-oil-list.component.ts b/src/app/admin/order-manage/order-oil/order-oil-list/order-oil-list.component.ts index d23499e..df5d0da 100644 --- a/src/app/admin/order-manage/order-oil/order-oil-list/order-oil-list.component.ts +++ b/src/app/admin/order-manage/order-oil/order-oil-list/order-oil-list.component.ts @@ -39,6 +39,8 @@ export class OrderOilListComponent implements OnInit { refundModal = false; refundForm: FormGroup; + refundRecordModal = false; + orderDetailModal = false; orderDetailModalLoading = false; orderDetailObject: any = { @@ -379,4 +381,23 @@ export class OrderOilListComponent implements OnInit { closeRefund() { this.refundModal = false; } + + + /** + * 打开退款记录模态框 + * @param orderNo + */ + showRefundRecord(orderNo: string) { + this.refundModal = true; + } + + + /** + * 关闭退款记录模态框 + * @param orderNo + */ + closeRefundRecord() { + this.refundModal = false; + } + } diff --git a/src/app/admin/order-manage/order-refund-list/order-refund-list.component.html b/src/app/admin/order-manage/order-refund-list/order-refund-list.component.html new file mode 100644 index 0000000..d073ed7 --- /dev/null +++ b/src/app/admin/order-manage/order-refund-list/order-refund-list.component.html @@ -0,0 +1,255 @@ + + + + + + +
+
+
+ +
+ + 交易单号 + + + + +
+ +
+ + 产品单号 + + + + +
+ +
+ + 退款单号 + + + + +
+
+ +
+
+ + 客户电话 + + + + +
+ +
+ + 产品类型 + + + + +
+ +
+ + 产品名称 + + + + +
+ +
+ + 退款状态 + + + + + + +
+ +
+ + 创建时间 + + + + +
+ +
+ + 退款时间 + + + + +
+
+ +
+
+ + + 更多条件 +
+
+
+
+ +
+ 共计 {{dataObject.total?dataObject.total:0}} 条数据 +
+ +
+ + + + + + 交易单号 + 产品单号 + 客户电话 + 产品类型 + 产品名称 + 退款单号 + 退款数量 + 退款总额 + 退回金额 + 退回积分 + 退款状态 + 创建时间 + 退款时间 + 退款备注 + 操作 + + + + + {{data.orderNo}} + {{data.orderChildNo}} + {{data.memPhone}} + {{data.goodsType | orderChildGoodsType}} + {{data.goodsName}} + {{data.refundOrderNo}} + {{data.goodsCount}} + ¥{{data.returnTotalPrice}} + ¥{{data.refundPrice}} + {{data.refundIntegral}} + {{data.refundStatus | orderRefundStatus}} + {{data.createTime | date : 'yyyy-MM-dd HH:mm:ss'}} + {{data.refundTime | date : 'yyyy-MM-dd HH:mm:ss'}} + {{data.refundRemark}} + + 操作列表 + + + + + + + +
+
+ + + + + + + + {{orderDetailObject.orderNo}} + {{orderDetailObject.paySerialNo!=null?orderDetailObject.paySerialNo:'无'}} + {{orderDetailObject.memPhone}} + {{orderDetailObject.orderStatus | orderStatus}} + {{orderDetailObject.payType | orderPayType}} + + {{orderDetailObject.memCardNo}} + + {{orderDetailObject.memDiscountName?orderDetailObject.tradeOrder.memDiscountName:'无'}} + {{orderDetailObject.whetherRebate?'是':'否'}} + {{orderDetailObject.remarks}} + + + + + {{orderDetailObject.totalPrice}} 元 + {{orderDetailObject.deductionPrice}} 元 + {{orderDetailObject.payablePrice}} 元 + {{orderDetailObject.payGold / 100}} 元 + + {{orderDetailObject.payRealPrice!=null?orderDetailObject.payRealPrice+' 元':'未支付'}} + + + + + + + + +

创建时间:{{orderDetailObject.createTime | date : 'yyyy-MM-dd HH:mm:ss'}}

+

备注:{{orderDetailObject.remarks?orderDetailObject.tradeOrder.remarks:'无'}}

+
+ +

取消时间:{{orderDetailObject.cancelTime | date : 'yyyy-MM-dd HH:mm:ss'}}

+

备注:{{orderDetailObject.cancelRemarks?orderDetailObject.cancelRemarks:'无'}}

+
+ 支付时间:{{orderDetailObject.payTime | date : 'yyyy-MM-dd HH:mm:ss'}} + 完成时间:{{orderDetailObject.finishTime | date : 'yyyy-MM-dd HH:mm:ss'}} + 退款时间:{{orderDetailObject.refundTime | date : 'yyyy-MM-dd HH:mm:ss'}} +
+
+
+ + + + + 产品类型 + 产品名称 + 产品规格 + 数量 + 单价 + 总价 + + + + + {{ data.goodsType | orderChildGoodsType}} + + {{ data.goodsName }} + 赠品 + + {{ data.goodsSpecName }} + {{ data.saleCount }} + {{ data.goodsActualPrice }} 元 + {{ data.totalActualPrice }} 元 + + + + +
+
+
+ diff --git a/src/app/admin/order-manage/order-refund-list/order-refund-list.component.scss b/src/app/admin/order-manage/order-refund-list/order-refund-list.component.scss new file mode 100644 index 0000000..f01f217 --- /dev/null +++ b/src/app/admin/order-manage/order-refund-list/order-refund-list.component.scss @@ -0,0 +1,6 @@ +.collapse { + margin-left: 15px; +} +nz-range-picker { + width: 100%; +} diff --git a/src/app/admin/order-manage/order-refund-list/order-refund-list.component.spec.ts b/src/app/admin/order-manage/order-refund-list/order-refund-list.component.spec.ts new file mode 100644 index 0000000..477e61c --- /dev/null +++ b/src/app/admin/order-manage/order-refund-list/order-refund-list.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { OrderRefundListComponent } from './order-refund-list.component'; + +describe('OrderRefundListComponent', () => { + let component: OrderRefundListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ OrderRefundListComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(OrderRefundListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/admin/order-manage/order-refund-list/order-refund-list.component.ts b/src/app/admin/order-manage/order-refund-list/order-refund-list.component.ts new file mode 100644 index 0000000..734e48d --- /dev/null +++ b/src/app/admin/order-manage/order-refund-list/order-refund-list.component.ts @@ -0,0 +1,190 @@ +import { Component, OnInit } from '@angular/core'; +import {environment} from '../../../../environments/environment'; +import {FormBuilder, FormGroup} from '@angular/forms'; +import {NzMessageService, NzModalService} from 'ng-zorro-antd'; +import {LocalStorageService} from '../../../services/local-storage.service'; +import {OrderManageService} from '../../../services/order/order-manage.service'; +import {CommonsService} from '../../../services/commons.service'; +import {Router} from '@angular/router'; +import {ADMIN_INFO_OBJECT} from '../../../services/local-storage.namespace'; + +@Component({ + selector: 'app-order-refund-list', + templateUrl: './order-refund-list.component.html', + styleUrls: ['./order-refund-list.component.scss'] +}) +export class OrderRefundListComponent implements OnInit { + + FILE_URL = environment.imageUrl; + roleType; + adminFlag; + loadingObject = { + spinning: false, + msg: '加载中' + }; + + dataObject: any = {}; + tableLoading = true; + searchForm: FormGroup; + pageNum = 1; + pageSize = 10; + whereObject: any = {}; + isCollapse = false; + + orderDetailModal = false; + orderDetailModalLoading = false; + orderDetailObject: any = { }; + + orderChildGoodsTypeArray = [] ; + orderRefundStatusArray = [] ; + + constructor(private modal: NzModalService, + private message: NzMessageService, + private store: LocalStorageService, + private orderManageService: OrderManageService, + private commonsService: CommonsService, + private router: Router, + private form: FormBuilder) { + this.roleType = Number(this.store.get(ADMIN_INFO_OBJECT)['secRole'].roleType); + this.adminFlag = Number(this.store.get(ADMIN_INFO_OBJECT)['secUser'].adminFlag); + } + + + ngOnInit(): void { + this.searchForm = this.form.group({ + orderNo: [null], + orderChildNo: [null], + refundOrderNo: [null], + memPhone: [null], + goodsType: [null], + goodsName: [null], + status: [null], + createTime: [null], + }); + + this.commonsService.getDictionary("ORDER_CHILD_GOODS_TYPE", data => { + this.orderChildGoodsTypeArray = data['return_data']; + }); + + this.commonsService.getDictionary("ORDER_REFUND_STATUS", data => { + this.orderRefundStatusArray = data['return_data']; + }); + + this.requestData(1); + } + + /** + * 请求数据 + */ + requestData(pageNum) { + this.tableLoading = true; + this.whereObject['pageNum'] = pageNum; + this.whereObject['pageSize'] = this.pageSize; + this.orderManageService.getRefundList(this.whereObject, data => { + if (data['return_code'] === '000000') { + this.dataObject = data['return_data']; + } else { + this.modal.error(data['return_msg']); + } + this.tableLoading = false; + }); + } + + /** + * 搜索 + * @param whereObject 条件 + */ + search(whereObject: object) { + if (whereObject['createTime'] != null) { + whereObject['createTimeS'] = whereObject['createTime'][0].getTime(); + whereObject['createTimeE'] = whereObject['createTime'][1].getTime(); + } else { + whereObject['createTimeS'] = null; + whereObject['createTimeE'] = null; + } + + if (whereObject['payTime'] != null) { + whereObject['payTimeS'] = whereObject['payTime'][0].getTime(); + whereObject['payTimeE'] = whereObject['payTime'][1].getTime(); + } else { + whereObject['payTimeS'] = null; + whereObject['payTimeE'] = null; + } + + if (whereObject['finishTime'] != null) { + whereObject['finishTimeS'] = whereObject['finishTime'][0].getTime(); + whereObject['finishTimeE'] = whereObject['finishTime'][1].getTime(); + } else { + whereObject['finishTimeS'] = null; + whereObject['finishTimeE'] = null; + } + this.whereObject = whereObject; + this.requestData(1); + } + + /** + * 重置 + */ + resetForm(): void { + this.searchForm.reset(); + } + + /** + * 搜索条件折叠 + */ + toggleCollapse(): void { + this.isCollapse = !this.isCollapse; + } + + /** + * 打开订单详情 + */ + showOrderDetail(orderNo: string) { + this.orderDetailModal = true; + this.orderDetailModalLoading = true; + + this.orderManageService.getDetailByOrderNo(orderNo, data => { + if (data['return_code'] === '000000') { + this.orderDetailObject = data['return_data']; + } else { + this.modal.error({ + nzTitle: '提示', + nzContent: data['return_msg'] + }); + } + this.orderDetailModalLoading = false; + }); + } + + /** + * 关闭订单详情 + */ + closeOrderDetail() { + this.orderDetailModal = false; + } + + /** + * 导出Excel + */ + exportExcel(): void { + this.loadingObject.spinning = true; + this.loadingObject.msg = '处理中...'; +/* + this.orderIntegralRechargeService.exportOrder(this.whereObject, data => { + this.loadingObject.spinning = false; + if (data['return_code'] === '000000') { + window.location.href = this.FILE_URL + data['return_data']; + } + });*/ + } + + /** + * 分页 + * @param pageSize + */ + pageSizeChang(pageSize: number) { + this.pageSize = pageSize; + this.requestData(1) + } + +} diff --git a/src/app/app-common.module.ts b/src/app/app-common.module.ts index e69de29..c84a52d 100644 --- a/src/app/app-common.module.ts +++ b/src/app/app-common.module.ts @@ -0,0 +1,156 @@ + +import { + FormsModule, + ReactiveFormsModule, +} from '@angular/forms'; + +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import {NgZorroAntdModule} from 'ng-zorro-antd'; +import {NgxNeditorModule} from '@notadd/ngx-neditor'; + +// 管道 +import { + TimesPipe, + TextareaPipe, + SystemPipe, + CouponStatusPipe, + CouponCodePipe, + AuditTypePipe, + AuditStatusPipe, + PaymodelPipe, + PaytypePipe, + DiscountTypePipe, + OrderCouponStatusPipe, + DiscountStatusPipe, + DisplayAreaPipe, + DiscountCodeStatusPipe, + RechargePricePipe, + RechargeStatusPipe, + ChannelMarkPipe, + TypePipe, + StatusPipe, + RechargePayTypePipe, + RefundSourcePipe, + RefundStatusPipe, + PreOrderStatusPipe, + ButtonPipe, + DiscountPackageStatusPipe, + PriceShowPipe, + ShowTypePipe, + EnergyTypePipe, + CompanyAmountRecordTypePipe, + CompanyAmountRecordSourceTypePipe, + OilCardBindStatusPipe, + OilCardRecordTypePipe, + OilCardRecordSourceTypePipe, + RechargePlatformPipe, + PriceStatusPipe, + GasStaffStatusPipe, + PayStatusPipe, + ChlidRechargeStatusPipe, + SourceTypePipe, + GasClassGroupTaskStatusPipe, + GasOrderStatusPipe, + OrderStatusPipe, + OrderPayTypePipe, + OrderChildGoodsTypePipe, + OrderRefundStatusPipe +} from './pipes'; +import {OilCardStatusPipe} from './pipes'; +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'; +import { IntegralTypePipe } from './pipes/integral/integral-type.pipe'; +import { IntegralProductPipe } from './pipes/integral/integral-product.pipe'; +import {OrderOilStatusPipe} from './pipes/order/order-oil-status.pipe'; + +const PIPES = [ + TimesPipe, + TextareaPipe, + SystemPipe, + CouponStatusPipe, + CouponCodePipe, + AuditTypePipe, + AuditStatusPipe, + OrderCouponStatusPipe, + PaymodelPipe, + PaytypePipe, + DiscountTypePipe, + DiscountStatusPipe, + DisplayAreaPipe, + DiscountCodeStatusPipe, + RechargePricePipe, + RechargeStatusPipe, + ChannelMarkPipe, + ChannelMarkPipe, + TypePipe, + StatusPipe, + RechargePayTypePipe, + RefundSourcePipe, + RefundStatusPipe, + PreOrderStatusPipe, + ButtonPipe, + DiscountPackageStatusPipe, + ShowTypePipe, + PriceShowPipe, + EnergyTypePipe, + CompanyAmountRecordTypePipe, + CompanyAmountRecordSourceTypePipe, + OilCardStatusPipe, + OilCardBindStatusPipe, + OilCardRecordTypePipe, + OilCardRecordSourceTypePipe, + GasStaffStatusPipe, + OilTypePipe, + RechargePlatformPipe, + PriceStatusPipe, + OilPriceTaskStatusPipe, + OilPriceTaskExecutionTypePipe, + OilPriceTaskPriceTypePipe, + PayStatusPipe, + ChlidRechargeStatusPipe, + SourceTypePipe, + GasClassGroupTaskStatusPipe, + GasOrderStatusPipe, + PlatformPipe, + OrderOilStatusPipe, + OrderStatusPipe, + OrderPayTypePipe, + OrderChildGoodsTypePipe, + OrderRefundStatusPipe, +]; + + +@NgModule({ + imports: [ + CommonModule, + FormsModule, + ReactiveFormsModule, + NgZorroAntdModule, + NgxNeditorModule + ], + declarations: [ + ...PIPES, + IntegralTypePipe, + IntegralProductPipe, + ], + + exports: [ + ...PIPES, + IntegralTypePipe, + IntegralProductPipe, + ], +}) + +export class AppCommonModule { + static forRoot() { + return { + ngModule: AppCommonModule, + providers: [], + }; + } +} + diff --git a/src/app/pipes/index.ts b/src/app/pipes/index.ts index 5d7f5dc..300c80a 100644 --- a/src/app/pipes/index.ts +++ b/src/app/pipes/index.ts @@ -46,3 +46,4 @@ export * from './order/order-status.pipe'; export * from './order/order-pay-type.pipe'; export * from './order/order-child-goods-type.pipe'; export * from './third-product/product-type.pipe'; +export * from './order/order-refund-status.pipe'; diff --git a/src/app/pipes/order/order-refund-status.pipe.ts b/src/app/pipes/order/order-refund-status.pipe.ts new file mode 100644 index 0000000..a4ef3a1 --- /dev/null +++ b/src/app/pipes/order/order-refund-status.pipe.ts @@ -0,0 +1,19 @@ +import { Pipe, PipeTransform } from '@angular/core'; + +@Pipe({ + name: 'orderRefundStatus' +}) +export class OrderRefundStatusPipe implements PipeTransform { + + transform(value: number): string { + switch (value) { + case 1: + return '退款中'; + case 2: + return '退款成功'; + case 3: + return '退款失败'; + } + } + +} diff --git a/src/app/services/order/order-manage.service.ts b/src/app/services/order/order-manage.service.ts index 2a986fe..a141a33 100644 --- a/src/app/services/order/order-manage.service.ts +++ b/src/app/services/order/order-manage.service.ts @@ -14,6 +14,18 @@ export class OrderManageService { ) { } + /** + * 查询交易订单 + * + * @param paramsObject 参数 + * @param callBack 回调 + */ + public getDetailByOrderNo(orderNo: string, callBack) { + this.http.get(environment.orderUrl + 'getDetailByOrderNo?orderNo='+ orderNo).subscribe(data => { + callBack(data); + }); + } + /** * 交易订单退款 * @@ -26,4 +38,16 @@ export class OrderManageService { }); } + /** + * 交退款 + * + * @param paramsObject 参数 + * @param callBack 回调 + */ + public getRefundList(param: object, callBack) { + this.http.get(environment.orderUrl + 'getRefundList?'+this.common.getWhereCondition(param)).subscribe(data => { + callBack(data); + }); + } + }