diff --git a/src/app/pages/trade/order-refund/order-refund.component.html b/src/app/pages/trade/order-refund/order-refund.component.html new file mode 100644 index 0000000..e56f8db --- /dev/null +++ b/src/app/pages/trade/order-refund/order-refund.component.html @@ -0,0 +1,160 @@ +
+
+
+ + 用户电话 + + + + +
+
+ + 退款单号 + + + + +
+
+ + 交易单号 + + + + +
+
+ + 商品单号 + + + + +
+
+ + 退款状态 + + + + + + +
+
+ + 创建时间 + + + + + + + +
+
+ + +
+
+
+ + + + + 用户电话 + 退款单号 + 交易单号 + 商品单号 + 支付渠道 + 支付方式 + 退款金额 + 退款积分 + 创建时间 + 状态 + 操作 + + + + + {{data.userPhone}} + {{data.refundOrderNo}} + {{data.orderNo}} + {{data.orderChildNo}} + {{data.refundPayChannel | dictionary: 'ORDER_PAY_CHANNEL'}} + {{data.refundPayType | dictionary: 'ORDER_PAY_TYPE'}} + {{data.refundPrice}} + {{data.refundIntegral}} + {{data.createTime | date: 'yyyy-MM-dd HH:mm:ss'}} + {{data.refundStatus | dictionary: 'ORDER_REFUND_STATUS'}} + + 详情 + + + + + 总计 {{ total }} 条 + + + + + + + + + {{refundDetail.refund.userPhone}} + {{refundDetail.refund.refundOrderNo}} + {{refundDetail.refund.orderNo}} + {{refundDetail.refund.orderChildNo}} + {{refundDetail.refund.refundPayChannel | dictionary: 'ORDER_PAY_CHANNEL'}} + {{refundDetail.refund.reufndPayType | dictionary: 'ORDER_PAY_TYPE'}} + {{refundDetail.refund.refundPayChannelOrderNo}} + {{refundDetail.refund.refundSerialNo}} + {{refundDetail.refund.refundPrice}} + {{refundDetail.refund.refundIntegral}} + {{refundDetail.refund.refundRemark}} + {{refundDetail.refund.createTime}} + {{refundDetail.refund.finishTime}} + {{refundDetail.refund.refundStatus | dictionary: 'ORDER_REFUND_STATUS'}} + {{refundDetail.refund.refundFailReason}} + + + + + {{refundDetail.orderChild.orderNo}} + {{refundDetail.orderChild.childOrderNo}} + {{refundDetail.orderChild.productType | dictionary: 'ORDER_CHILD_PRODUCT_TYPE'}} + {{refundDetail.orderChild.productName}} + {{refundDetail.orderChild.productSpecName}} + {{refundDetail.orderChild.productCount}} + {{refundDetail.orderChild.productTotalPrice}} + {{refundDetail.orderChild.totalDeductionPrice}} + {{refundDetail.orderChild.couponDiscountPrice}} + {{refundDetail.orderChild.integralDiscountPrice}} + {{refundDetail.orderChild.productActualPrice}} + {{refundDetail.orderChild.status | dictionary: 'ORDER_CHILD_STATUS'}} + {{refundDetail.orderChild.createTime | date: 'yyyy-MM-dd HH:mm:ss'}} + + + + + diff --git a/src/app/pages/trade/order-refund/order-refund.component.less b/src/app/pages/trade/order-refund/order-refund.component.less new file mode 100644 index 0000000..f257b03 --- /dev/null +++ b/src/app/pages/trade/order-refund/order-refund.component.less @@ -0,0 +1,9 @@ +.search-area { + margin-bottom: 10px; +} +.search-area button { + margin-right: 8px; +} +.submit-btn { + width: 150px; +} diff --git a/src/app/pages/trade/order-refund/order-refund.component.ts b/src/app/pages/trade/order-refund/order-refund.component.ts new file mode 100644 index 0000000..0a82533 --- /dev/null +++ b/src/app/pages/trade/order-refund/order-refund.component.ts @@ -0,0 +1,213 @@ +import { Component } from '@angular/core'; +import {environment} from "../../../../environments/environment"; +import {FormGroup, FormsModule, NonNullableFormBuilder, ReactiveFormsModule, Validators} from "@angular/forms"; +import {DateSelectType, DateUtils} from "../../../utils/dateUtils.service"; +import {DictionaryPipe} from "../../../pipes/common/dictionary.pipe"; +import {NzMessageService} from "ng-zorro-antd/message"; +import {NzModalComponent, NzModalModule, NzModalService} from "ng-zorro-antd/modal"; +import {OrderRefundService} from "../../../services/trade/order-refund.service"; +import {DatePipe, NgForOf, NgIf, NgSwitch} from "@angular/common"; +import {NzButtonComponent} from "ng-zorro-antd/button"; +import { + NzCellEllipsisDirective, + NzCellFixedDirective, + NzTableCellDirective, + NzTableComponent, + NzTbodyComponent, NzTheadComponent, + NzThMeasureDirective, NzTrDirective +} from "ng-zorro-antd/table"; +import {NzColDirective, NzRowDirective} from "ng-zorro-antd/grid"; +import {NzDividerComponent} from "ng-zorro-antd/divider"; +import {NzDropDownADirective, NzDropDownDirective, NzDropdownMenuComponent} from "ng-zorro-antd/dropdown"; +import {NzFlexDirective} from "ng-zorro-antd/flex"; +import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form"; +import {NzIconDirective} from "ng-zorro-antd/icon"; +import {NzInputDirective} from "ng-zorro-antd/input"; +import {NzMenuDirective, NzMenuItemComponent} from "ng-zorro-antd/menu"; +import {NzOptionComponent, NzSelectComponent} from "ng-zorro-antd/select"; +import {NzDatePickerComponent, NzDatePickerModule, NzRangePickerComponent} from "ng-zorro-antd/date-picker"; +import {NzRadioButtonDirective, NzRadioComponent, NzRadioGroupComponent} from "ng-zorro-antd/radio"; +import {NzTooltipDirective} from "ng-zorro-antd/tooltip"; +import {NzTreeComponent} from "ng-zorro-antd/tree"; +import {NzDescriptionsModule} from "ng-zorro-antd/descriptions"; +import {NzTabComponent, NzTabSetComponent, NzTabsModule} from "ng-zorro-antd/tabs"; +import {NzTimelineModule} from "ng-zorro-antd/timeline"; +import {NzImageDirective, NzImageModule} from "ng-zorro-antd/image"; +import {NzTypographyComponent} from "ng-zorro-antd/typography"; + +@Component({ + selector: 'app-order-refund', + standalone: true, + imports: [ + DatePipe, + DictionaryPipe, + FormsModule, + NgForOf, + NgIf, + NzButtonComponent, + NzCellFixedDirective, + NzColDirective, + NzDividerComponent, + NzDropDownADirective, + NzDropDownDirective, + NzDropdownMenuComponent, + NzFlexDirective, + NzFormControlComponent, + NzFormDirective, + NzFormItemComponent, + NzFormLabelComponent, + NzIconDirective, + NzInputDirective, + NzMenuDirective, + NzMenuItemComponent, + NzModalComponent, + NzOptionComponent, + NzRowDirective, + NzSelectComponent, + NzTableCellDirective, + NzTableComponent, + NzTbodyComponent, + NzThMeasureDirective, + NzTheadComponent, + NzTrDirective, + ReactiveFormsModule, + NzModalModule, + NzRangePickerComponent, + NzDatePickerComponent, + NzDatePickerModule, + NzRadioButtonDirective, + NzRadioComponent, + NzRadioGroupComponent, + NgSwitch, + NzCellEllipsisDirective, + NzTooltipDirective, + NzTreeComponent, + NzDescriptionsModule, + NzTabSetComponent, + NzTabComponent, + NzTabsModule, + NzTimelineModule, + NzImageDirective, + NzImageModule, + NzTypographyComponent + ], + templateUrl: './order-refund.component.html', + styleUrl: './order-refund.component.less' +}) +export class OrderRefundComponent { + imageUrl = environment.imageUrl; + // 表单页数 + tablePageNum = 1; + // 表单数据 + tableData: any = { + total: 0, + list: [], + }; + // 搜索表单 + searchForm: FormGroup; + // 时间类型选择 + dateTypeSelect = DateSelectType; + // 退款状态 + refundStatusArray = new DictionaryPipe().getDictionaryList('ORDER_REFUND_STATUS'); + // 详情模态框 + refundDetailVisible = false; + // 详情数据 + refundDetail: any = { + refund: {}, + orderChild: {}, + }; + constructor(private fb: NonNullableFormBuilder, + private orderRefundService : OrderRefundService, + private message: NzMessageService, + private modal: NzModalService) { + // 初始化搜索框 + this.searchForm = this.fb.group({ + userPhone: [''], + orderNo: [''], + orderChildNo: [''], + refundOrderNo: [''], + refundStatus: [''], + createTimeArray: [[]], + createTimeSelect: ['1'], + createTimeS: [''], + createTimeE: [''], + }); + this.createTimeInit(); + this.queryData(); + } + + /** + * 获取数据 + */ + queryData() { + if (this.searchForm.controls['createTimeArray'].value != null + && this.searchForm.controls['createTimeArray'].value.length > 0) { + this.searchForm.controls['createTimeS'].setValue(this.searchForm.controls['createTimeArray'].value[0]); + this.searchForm.controls['createTimeE'].setValue(this.searchForm.controls['createTimeArray'].value[1]); + } else { + this.searchForm.controls['createTimeS'].setValue(null); + this.searchForm.controls['createTimeE'].setValue(null); + } + this.searchForm.value.pageNum = this.tablePageNum; + this.searchForm.value.pageSize = 10; + this.searchForm.value.time = new Date().getTime(); + this.orderRefundService.queryList(this.searchForm.value, (data: any) => { + if (data['return_code'] == '000000') { + this.tableData = data['return_data']; + } + }); + } + + /** + * 搜索表单提交 + */ + searchFormSubmit(): void { + this.tablePageNum = 1; + this.queryData(); + } + + /** + * 搜索表单重置 + */ + searchFormReset(): void { + this.searchForm.reset(); + } + + /** + * 创建时间初始化 + */ + createTimeInit() { + let createTimeSelect = this.searchForm.controls['createTimeSelect'].value; + if (createTimeSelect != null) { + let timeObj = DateUtils.getDate(new Date(), Number(createTimeSelect)); + this.searchForm.controls['createTimeArray'].setValue([timeObj.timeS, timeObj.timeE]); + } + } + + /** + * 展示详情 + * @param applyNo + */ + showDetail(refundOrderNo: string) { + const param = { + refundOrderNo: refundOrderNo + }; + this.orderRefundService.queryRefund(param,(data: any) => { + if (data['return_code'] == '000000') { + this.refundDetail = data['return_data']; + this.refundDetailVisible = true; + } else { + this.message.error(data['return_msg']); + } + }); + } + + /** + * 关闭详情 + */ + closeDetail() { + this.refundDetail = {}; + this.refundDetailVisible = false; + } + +} diff --git a/src/app/pages/trade/trade.routes.ts b/src/app/pages/trade/trade.routes.ts index 49a63e1..82c2b0d 100644 --- a/src/app/pages/trade/trade.routes.ts +++ b/src/app/pages/trade/trade.routes.ts @@ -2,9 +2,11 @@ import { Routes } from '@angular/router'; import {CompOrderComponent} from "./comp-order/comp-order.component"; import {OrderAfterSalesComponent} from "./order-after-sales/order-after-sales.component"; import {GoodsListComponent} from "./goods-list/goods-list.component"; +import {OrderRefundComponent} from "./order-refund/order-refund.component"; export const TRADE_ROUTES: Routes = [ { path: 'goods-list', component: GoodsListComponent }, { path: 'comp-order', component: CompOrderComponent }, { path: 'order-after-sales', component: OrderAfterSalesComponent }, + { path: 'order-refund', component: OrderRefundComponent }, ]; diff --git a/src/app/services/trade/order-refund.service.ts b/src/app/services/trade/order-refund.service.ts new file mode 100644 index 0000000..f01211f --- /dev/null +++ b/src/app/services/trade/order-refund.service.ts @@ -0,0 +1,35 @@ +import { Injectable } from '@angular/core'; +import {HttpClient} from "@angular/common/http"; +import {environment} from "../../../environments/environment"; +import {ObjectData} from "../../utils/objectData.service"; + +@Injectable({ + providedIn: 'root' +}) +export class OrderRefundService { + + constructor(private http: HttpClient) { } + + /** + * 查询退款订单列表 + * @param param + * @param callBack + */ + public queryList(param: object, callBack:any) { + this.http.get(environment.orderUrl + 'refund/queryList?'+ObjectData.objectByString(param)).subscribe(data => { + callBack(data); + }); + } + + /** + * 查询退款订单 + * @param param + * @param callBack + */ + public queryRefund(param: object, callBack:any) { + this.http.get(environment.orderUrl + 'refund/queryRefund?'+ObjectData.objectByString(param)).subscribe(data => { + callBack(data); + }); + } + +} diff --git a/src/environments/environment.ts b/src/environments/environment.ts index b43cabf..8ff2b9b 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -4,12 +4,12 @@ export const environment = { production: false, - // baseUrl: 'https://phgcs.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址) - // orderUrl: 'https://phgcs.dctpay.com/order/', // 测试环境服务器地址(请求数据地址) + baseUrl: 'https://phgcs.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址) + orderUrl: 'https://phgcs.dctpay.com/order/', // 测试环境服务器地址(请求数据地址) userUrl: 'https://phgcs.dctpay.com/user/', // 测试环境服务器地址(请求数据地址) // imageUrl: 'https://phgcs.dctpay.com/filesystem/', - baseUrl: 'http://localhost:9702/brest/', // 测试环境服务器地址(请求数据地址) - orderUrl: 'http://localhost:9703/order/', // 测试环境服务器地址(请求数据地址) + //baseUrl: 'http://localhost:9702/brest/', // 测试环境服务器地址(请求数据地址) + //orderUrl: 'http://localhost:9703/order/', // 测试环境服务器地址(请求数据地址) // userUrl: 'http://localhost:9704/user/', // 测试环境服务器地址(请求数据地址) imageUrl: 'https://phgcs.dctpay.com/filesystem/',