From 0baf73e78d9f536910081175b458bb2482b54af6 Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Thu, 13 Oct 2022 17:49:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../order-coupon-list.component.html | 100 +++++++- .../order-coupon-list.component.ts | 39 ++- .../order-integral-recharge.component.html | 229 ++++++++++++++++++ .../order-integral-recharge.component.scss | 6 + .../order-integral-recharge.component.ts | 173 +++++++++++++ .../order-manage-routing.module.ts | 4 +- .../admin/order-manage/order-manage.module.ts | 3 +- .../services/order/order-coupon.service.ts | 16 +- .../order/order-integral-recharge.service.ts | 51 ++++ 9 files changed, 604 insertions(+), 17 deletions(-) create mode 100644 src/app/admin/order-manage/order-integral-recharge/order-integral-recharge.component.html create mode 100644 src/app/admin/order-manage/order-integral-recharge/order-integral-recharge.component.scss create mode 100644 src/app/admin/order-manage/order-integral-recharge/order-integral-recharge.component.ts create mode 100644 src/app/services/order/order-integral-recharge.service.ts diff --git a/src/app/admin/order-manage/order-coupon/order-coupon-list/order-coupon-list.component.html b/src/app/admin/order-manage/order-coupon/order-coupon-list/order-coupon-list.component.html index eac9083..c719ef1 100644 --- a/src/app/admin/order-manage/order-coupon/order-coupon-list/order-coupon-list.component.html +++ b/src/app/admin/order-manage/order-coupon/order-coupon-list/order-coupon-list.component.html @@ -65,7 +65,7 @@ 订单状态 - + @@ -148,7 +148,7 @@ 创建时间 支付时间 完成时间 - + 操作 @@ -169,17 +169,97 @@ {{data.createTime | date : 'yyyy-MM-dd HH:mm:ss'}} {{data.payTime | date : 'yyyy-MM-dd HH:mm:ss'}} {{data.finishTime | date : 'yyyy-MM-dd HH:mm:ss'}} - + + 操作列表 + + + + + + + + + + + {{orderDetailObject.tradeOrder.orderNo}} + {{orderDetailObject.tradeOrder.paySerialNo!=null?orderDetailObject.tradeOrder.paySerialNo:'无'}} + {{orderDetailObject.tradeOrder.memPhone}} + {{orderDetailObject.tradeOrder.orderStatus | orderStatus}} + {{orderDetailObject.tradeOrder.payType | orderPayType}} + + {{orderDetailObject.tradeOrder.memCardNo}} + + {{orderDetailObject.tradeOrder.memDiscountName?orderDetailObject.tradeOrder.memDiscountName:'无'}} + {{orderDetailObject.tradeOrder.whetherRebate?'是':'否'}} + {{orderDetailObject.tradeOrder.remarks}} + + + + + {{orderDetailObject.tradeOrder.totalPrice}} 元 + {{orderDetailObject.tradeOrder.deductionPrice}} 元 + {{orderDetailObject.tradeOrder.payablePrice}} 元 + {{orderDetailObject.tradeOrder.payGold / 100}} 元 + + {{orderDetailObject.tradeOrder.payRealPrice!=null?orderDetailObject.tradeOrder.payRealPrice+' 元':'未支付'}} + + + + + + + + +

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

+

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

+
+ +

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

+

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

+
+ 支付时间:{{orderDetailObject.tradeOrder.payTime | date : 'yyyy-MM-dd HH:mm:ss'}} + 完成时间:{{orderDetailObject.tradeOrder.finishTime | date : 'yyyy-MM-dd HH:mm:ss'}} + 退款时间:{{orderDetailObject.tradeOrder.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-coupon/order-coupon-list/order-coupon-list.component.ts b/src/app/admin/order-manage/order-coupon/order-coupon-list/order-coupon-list.component.ts index 4f041aa..d67a265 100644 --- a/src/app/admin/order-manage/order-coupon/order-coupon-list/order-coupon-list.component.ts +++ b/src/app/admin/order-manage/order-coupon/order-coupon-list/order-coupon-list.component.ts @@ -33,6 +33,13 @@ export class OrderCouponListComponent implements OnInit { positionTypeArray = []; + orderDetailModal = false; + orderDetailModalLoading = false; + orderDetailObject: any = { + tradeOrder: {}, + gasOrder: {}, + }; + constructor(private modal: NzModalService, private message: NzMessageService, private store: LocalStorageService, @@ -52,7 +59,7 @@ export class OrderCouponListComponent implements OnInit { memPhone: [null], couponName: [null], payType: [null], - orderStatus: [null], + status: [null], createTime: [null], payTime: [null], finishTime: [null], @@ -123,6 +130,32 @@ export class OrderCouponListComponent implements OnInit { this.isCollapse = !this.isCollapse; } + /** + * 打开订单详情 + */ + showOrderDetail(orderNo: string) { + this.orderDetailModal = true; + this.orderDetailModalLoading = true; + + this.orderCouponService.getCouponOrderDetail(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 @@ -131,11 +164,11 @@ export class OrderCouponListComponent implements OnInit { this.loadingObject.spinning = true; this.loadingObject.msg = '处理中...'; - /*this.orderService.exportOrderCouponExcel(this.whereObject, data => { + this.orderCouponService.exportOrderCouponExcel(this.whereObject, data => { this.loadingObject.spinning = false; if (data['return_code'] === '000000') { window.location.href = this.FILE_URL + data['return_data']; } - });*/ + }); } } diff --git a/src/app/admin/order-manage/order-integral-recharge/order-integral-recharge.component.html b/src/app/admin/order-manage/order-integral-recharge/order-integral-recharge.component.html new file mode 100644 index 0000000..fab6369 --- /dev/null +++ b/src/app/admin/order-manage/order-integral-recharge/order-integral-recharge.component.html @@ -0,0 +1,229 @@ + + + + + + +
+
+
+ +
+ + 交易单号 + + + + +
+ +
+ + 客户电话 + + + + +
+ +
+ + 订单状态 + + + + + + + +
+
+ +
+
+ + 支付方式 + + + + + + + + + + + + +
+ +
+ + 创建时间 + + + + +
+ +
+ + 支付时间 + + + + +
+ +
+ +
+
+ + + 更多条件 +
+
+
+
+ +
+ 共计 {{dataObject.total?dataObject.total:0}} 条数据 +
+ +
+ + + + + + 序号 + 交易单号 + 客户电话 + 充值积分 + 订单总额 + 优惠金额 + 应付金额 + 实付金额 + 支付方式 + 订单状态 + 创建时间 + 支付时间 + 操作 + + + + + {{i+1}} + {{data.orderNo}} + {{data.memPhone}} + {{data.goodsPrice}} + ¥{{data.totalPrice}} + ¥{{data.deductionPrice}} + ¥{{data.payablePrice}} + ¥{{data.payPrice}} + {{data.payType}} + {{data.orderStatus}} + {{data.createTime | date : 'yyyy-MM-dd HH:mm:ss'}} + {{data.payTime | date : 'yyyy-MM-dd HH:mm:ss'}} + + 操作列表 + + + + + + + +
+
+ + + + + + + + {{orderDetailObject.tradeOrder.orderNo}} + {{orderDetailObject.tradeOrder.paySerialNo!=null?orderDetailObject.tradeOrder.paySerialNo:'无'}} + {{orderDetailObject.tradeOrder.memPhone}} + {{orderDetailObject.tradeOrder.orderStatus | orderStatus}} + {{orderDetailObject.tradeOrder.payType | orderPayType}} + + {{orderDetailObject.tradeOrder.memCardNo}} + + {{orderDetailObject.tradeOrder.memDiscountName?orderDetailObject.tradeOrder.memDiscountName:'无'}} + {{orderDetailObject.tradeOrder.whetherRebate?'是':'否'}} + {{orderDetailObject.tradeOrder.remarks}} + + + + + {{orderDetailObject.tradeOrder.totalPrice}} 元 + {{orderDetailObject.tradeOrder.deductionPrice}} 元 + {{orderDetailObject.tradeOrder.payablePrice}} 元 + {{orderDetailObject.tradeOrder.payGold / 100}} 元 + + {{orderDetailObject.tradeOrder.payRealPrice!=null?orderDetailObject.tradeOrder.payRealPrice+' 元':'未支付'}} + + + + + + + + +

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

+

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

+
+ +

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

+

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

+
+ 支付时间:{{orderDetailObject.tradeOrder.payTime | date : 'yyyy-MM-dd HH:mm:ss'}} + 完成时间:{{orderDetailObject.tradeOrder.finishTime | date : 'yyyy-MM-dd HH:mm:ss'}} + 退款时间:{{orderDetailObject.tradeOrder.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-integral-recharge/order-integral-recharge.component.scss b/src/app/admin/order-manage/order-integral-recharge/order-integral-recharge.component.scss new file mode 100644 index 0000000..f01f217 --- /dev/null +++ b/src/app/admin/order-manage/order-integral-recharge/order-integral-recharge.component.scss @@ -0,0 +1,6 @@ +.collapse { + margin-left: 15px; +} +nz-range-picker { + width: 100%; +} diff --git a/src/app/admin/order-manage/order-integral-recharge/order-integral-recharge.component.ts b/src/app/admin/order-manage/order-integral-recharge/order-integral-recharge.component.ts new file mode 100644 index 0000000..cd2b655 --- /dev/null +++ b/src/app/admin/order-manage/order-integral-recharge/order-integral-recharge.component.ts @@ -0,0 +1,173 @@ +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'; +import {OrderIntegralRechargeService} from '../../../services/order/order-integral-recharge.service'; + +@Component({ + selector: 'app-order-integral-recharge', + templateUrl: './order-integral-recharge.component.html', + styleUrls: ['./order-integral-recharge.component.scss'] +}) +export class OrderIntegralRechargeComponent implements OnInit { + + FILE_URL = environment.imageUrl; + roleType; + adminFlag; + loadingObject = { + spinning: false, + msg: '加载中' + }; + + dataObject: any = {}; + tableLoading = true; + searchForm: FormGroup; + pageNum: number; + whereObject: any = {}; + isCollapse = false; + + orderDetailModal = false; + orderDetailModalLoading = false; + orderDetailObject: any = { + tradeOrder: {}, + gasOrder: {}, + }; + + constructor(private modal: NzModalService, + private message: NzMessageService, + private store: LocalStorageService, + private orderManageService: OrderManageService, + private orderIntegralRechargeService: OrderIntegralRechargeService, + 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], + memPhone: [null], + couponName: [null], + payType: [null], + status: [null], + createTime: [null], + payTime: [null], + finishTime: [null], + }); + this.requestData(1); + } + + /** + * 请求数据 + */ + requestData(pageNum) { + this.tableLoading = true; + this.whereObject['pageNum'] = pageNum; + this.whereObject['pageSize'] = 10; + this.orderIntegralRechargeService.getOrderList(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.orderIntegralRechargeService.getCouponOrderDetail(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']; + } + }); + } + +} 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 0ffb4d9..cfe430d 100644 --- a/src/app/admin/order-manage/order-manage-routing.module.ts +++ b/src/app/admin/order-manage/order-manage-routing.module.ts @@ -2,11 +2,13 @@ import { NgModule } from '@angular/core'; 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'; const routes: Routes = [ { path: 'order-oil-list', component: OrderOilListComponent }, - { path: 'order-coupon-list', component: OrderCouponListComponent } + { path: 'order-coupon-list', component: OrderCouponListComponent }, + { path: 'order-integral-recharge-list', component: OrderIntegralRechargeComponent} ]; @NgModule({ diff --git a/src/app/admin/order-manage/order-manage.module.ts b/src/app/admin/order-manage/order-manage.module.ts index 2818de9..f214fac 100644 --- a/src/app/admin/order-manage/order-manage.module.ts +++ b/src/app/admin/order-manage/order-manage.module.ts @@ -8,10 +8,11 @@ import {FormsModule, ReactiveFormsModule} from '@angular/forms'; 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'; @NgModule({ - declarations: [OrderOilListComponent, OrderCouponListComponent], + declarations: [OrderOilListComponent, OrderCouponListComponent, OrderIntegralRechargeComponent], imports: [ CommonModule, OrderManageRoutingModule, diff --git a/src/app/services/order/order-coupon.service.ts b/src/app/services/order/order-coupon.service.ts index 7e390c5..087486a 100644 --- a/src/app/services/order/order-coupon.service.ts +++ b/src/app/services/order/order-coupon.service.ts @@ -28,11 +28,23 @@ export class OrderCouponService { /** * 查询订单详情 * + * @param orderNo 对象 + * @param callBack 回调 + */ + public getCouponOrderDetail(orderNo: string, callBack) { + this.http.get(environment.orderUrl + 'coupon/getOrderDetail?orderNo=' + orderNo).subscribe(data => { + callBack(data); + }); + } + + /** + * 导出卡券订单 + * * @param paramsObject 对象 * @param callBack 回调 */ - public getCouponOrderDetail(param: object, callBack) { - this.http.get(environment.orderUrl + 'coupon/getCouponOrderDetail?' + this.common.getWhereCondition(param)).subscribe(data => { + public exportOrderCouponExcel(param: object, callBack) { + this.http.get(environment.orderUrl + 'coupon/exportOrderCouponExcel?' + this.common.getWhereCondition(param)).subscribe(data => { callBack(data); }); } diff --git a/src/app/services/order/order-integral-recharge.service.ts b/src/app/services/order/order-integral-recharge.service.ts new file mode 100644 index 0000000..734474c --- /dev/null +++ b/src/app/services/order/order-integral-recharge.service.ts @@ -0,0 +1,51 @@ +import { Injectable } from '@angular/core'; +import {HttpClient} from '@angular/common/http'; +import {CommonsService} from '../commons.service'; +import {environment} from '../../../environments/environment'; + +@Injectable({ + providedIn: 'root' +}) +export class OrderIntegralRechargeService { + + constructor( + private http: HttpClient, + private common: CommonsService + ) { } + + /** + * 查询订单列表 + * + * @param paramsObject 对象 + * @param callBack 回调 + */ + public getOrderList(param: object, callBack) { + this.http.get(environment.orderUrl + 'integralRecharge/getOrderList?' + this.common.getWhereCondition(param)).subscribe(data => { + callBack(data); + }); + } + + /** + * 查询订单详情 + * + * @param orderNo 对象 + * @param callBack 回调 + */ + public getCouponOrderDetail(orderNo: string, callBack) { + this.http.get(environment.orderUrl + 'integralRecharge/getOrderDetail?orderNo=' + orderNo).subscribe(data => { + callBack(data); + }); + } + + /** + * 导出订单 + * + * @param paramsObject 对象 + * @param callBack 回调 + */ + public exportOrder(param: object, callBack) { + this.http.get(environment.orderUrl + 'integralRecharge/exportOrder?' + this.common.getWhereCondition(param)).subscribe(data => { + callBack(data); + }); + } +}