diff --git a/src/app/admin/order-manage/order-manage-routing.module.ts b/src/app/admin/order-manage/order-manage-routing.module.ts new file mode 100644 index 0000000..897d37e --- /dev/null +++ b/src/app/admin/order-manage/order-manage-routing.module.ts @@ -0,0 +1,14 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; +import {OrderOilListComponent} from './order-oil/order-oil-list/order-oil-list.component'; + + +const routes: Routes = [ + { path: 'order-oil-list', component: OrderOilListComponent} +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class OrderManageRoutingModule { } diff --git a/src/app/admin/order-manage/order-manage.module.ts b/src/app/admin/order-manage/order-manage.module.ts new file mode 100644 index 0000000..871d67f --- /dev/null +++ b/src/app/admin/order-manage/order-manage.module.ts @@ -0,0 +1,24 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; + +import { OrderManageRoutingModule } from './order-manage-routing.module'; +import { OrderOilListComponent } from './order-oil/order-oil-list/order-oil-list.component'; +import {NgZorroAntdModule} from 'ng-zorro-antd'; +import {FormsModule, ReactiveFormsModule} from '@angular/forms'; +import {BreadcrumbModule} from '../../common/breadcrumb/breadcrumb.module'; +import {AppCommonModule} from '../../app-common.module'; + + +@NgModule({ + declarations: [OrderOilListComponent], + imports: [ + CommonModule, + OrderManageRoutingModule, + NgZorroAntdModule, + ReactiveFormsModule, + FormsModule, + BreadcrumbModule, + AppCommonModule, + ] +}) +export class OrderManageModule { } 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 new file mode 100644 index 0000000..c9c1a88 --- /dev/null +++ b/src/app/admin/order-manage/order-oil/order-oil-list/order-oil-list.component.html @@ -0,0 +1,446 @@ + + + + + + + +
+
+
+ +
+ + 加油站 + + + + +
+ +
+ + 交易订单号 + + + + +
+ +
+ + 客户手机号 + + + + +
+ +
+ + 支付时间 + + + + +
+ +
+ + 交易状态 + + + + + + +
+ + +
+ + 油号 + + + + + + +
+
+ +
+ +
+ + 加油员 + + + + +
+ +
+ + 创建时间 + + + + +
+ +
+ + 退款时间 + + + + +
+ +
+ + 分公司 + + + + + + +
+ +
+ + 商户 + + + + + + +
+ +
+ + 代理公司 + + + + + + +
+ +
+ + 代理商 + + + + + + +
+ +
+ + 业务员 + + + + + + +
+ +
+ +
+
+ + + 更多条件 +
+
+
+
+ +
+ 共计 {{dataObject.total?dataObject.total:0}} 条数据 +
+ +
+ + + + + + 交易订单号 + 加油站 + 加油员 + 客户手机号 + 加油信息 + 支付信息 + 交易状态 + 创建时间 + 支付时间 + 退款时间 + 取消时间 + 分公司 + 商户 + 代理公司 + 代理商 + 业务员 + 操作 + + + 加油金额 + 加油升数 + 油号 + 油枪号 + 平台折扣 + 平台补贴 + 平台价 + 油站价 + 国标价 + 支付方式 + 加油优惠 + 应付金额 + 积分抵扣 + 实付金额 + + + + + {{data.orderNo}} + {{data.storeName}} + {{data.gasStaffName?data.gasStaffName:'未知'}} + {{data.memPhone}} + {{data.gasRefuelPrice}}元 + {{data.gasOilLiters}}升 + {{data.gasOilNo}}# + {{data.gasGunNo}}号枪 + {{data.gasDiscount != 1?(data.gasDiscount*100) + '折':'无'}} + {{data.gasOilSubsidy}}元 + {{data.gasPricePlatform}}元 + {{data.gasPriceGun}}元 + {{data.gasPriceOfficial}}元 + {{data.payType | orderPayType}} + {{data.deductionPrice}}元 + {{data.payablePrice}}元 + {{data.payGold / 100}}元 + {{data.payPrice!=null?data.payPrice+'元':'未支付'}} + {{data.status | orderOilStatus}} + {{data.createTime | date : 'yyyy-MM-dd HH:mm:ss'}} + {{data.payTime | date : 'yyyy-MM-dd HH:mm:ss'}} + {{data.refundTime | date : 'yyyy-MM-dd HH:mm:ss'}} + {{data.cancelTime | date : 'yyyy-MM-dd HH:mm:ss'}} + {{data.companyName?data.companyName:'无'}} + {{data.merName?data.merName:'无'}} + {{data.gasOrgName?data.gasOrgName:'无'}} + {{data.gasAgentName?data.gasAgentName:'无'}} + {{data.gasSalesmanName?data.gasSalesmanName:'无'}} + + 操作列表 + +
    +
  • 交易详情
  • +
  • 交易退款
  • +
  • 退款记录
  • +
+
+ + + +
+
+
+ + + + + + + + {{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 }} 元 + + + + + + + {{orderDetailObject.gasOrder.storeName}} + {{orderDetailObject.gasOrder.gasClassGroupName?orderDetailObject.gasOrder.gasClassGroupName:'无'}} + {{orderDetailObject.gasOrder.gasStaffName!=null?orderDetailObject.gasOrder.gasStaffName:'未知'}} + {{orderDetailObject.gasOrder.gasRefuelPrice}}元 + {{orderDetailObject.gasOrder.gasOilLiters}}升 + {{orderDetailObject.gasOrder.gasOilNo}} # + {{orderDetailObject.gasOrder.gasGunNo}} 号枪 + + 平台折扣:{{orderDetailObject.gasOrder.gasDiscount != 1?(orderDetailObject.gasOrder.gasDiscount * 100)+'折':'无'}}
+ 平台补贴:{{orderDetailObject.gasOrder.gasOilSubsidy}} 元
+ 每升优惠:{{orderDetailObject.gasOrder.gasLitersPreferences}}元
+
+ +
+
+ +
+ + {{orderDetailObject.gasOrder.gasOrgName?orderDetailObject.gasOrder.gasOrgName:'无'}} + + + {{orderDetailObject.gasOrder.gasAgentName?orderDetailObject.gasOrder.gasAgentName:'无'}} + + + {{orderDetailObject.gasOrder.gasSalesmanName?orderDetailObject.gasOrder.gasSalesmanName:'无'}} + +
+
+
+
+
+ + + +
+ + 交易单号 + + + + + + + 退款备注 + + + + +
+ +
+
+
+
+ + diff --git a/src/app/admin/order-manage/order-oil/order-oil-list/order-oil-list.component.scss b/src/app/admin/order-manage/order-oil/order-oil-list/order-oil-list.component.scss new file mode 100644 index 0000000..e6f52e7 --- /dev/null +++ b/src/app/admin/order-manage/order-oil/order-oil-list/order-oil-list.component.scss @@ -0,0 +1,9 @@ +.collapse { + margin-left: 15px; +} +::ng-deep .order-oil-tab .ant-descriptions-item-label { + width: 150px; +} +::ng-deep .order-oil-tab .ant-descriptions-item-content { + width: 200px; +} 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 new file mode 100644 index 0000000..00bc4cc --- /dev/null +++ b/src/app/admin/order-manage/order-oil/order-oil-list/order-oil-list.component.ts @@ -0,0 +1,380 @@ +import { Component, OnInit } from '@angular/core'; +import {environment} from '../../../../../environments/environment'; +import {FormBuilder, FormGroup, Validators} from '@angular/forms'; +import {NzMessageService, NzModalService} from 'ng-zorro-antd'; +import {LocalStorageService} from '../../../../services/local-storage.service'; +import {TyAgentOilStationService} from '../../../../services/ty-agent-oil-station.service'; +import {TyAgentService} from '../../../../services/ty-agent.service'; +import {TySalesmanService} from '../../../../services/ty-salesman.service'; +import {OrganizationService} from '../../../../services/organization.service'; +import {ADMIN_INFO_OBJECT} from '../../../../services/local-storage.namespace'; +import {OrderManageService} from '../../../../services/order-manage.service'; +import {CommonsService} from '../../../../services/commons.service'; +import {CompanyService} from '../../../../services/company.service'; +import {MerchantService} from '../../../../services/merchant.service'; + +@Component({ + selector: 'app-order-oil-list', + templateUrl: './order-oil-list.component.html', + styleUrls: ['./order-oil-list.component.scss'] +}) +export class OrderOilListComponent implements OnInit { + FILE_URL = environment.imageUrl; + roleType; + adminFlag; + + loadingObject = { + title: "加载中...", + status: false, + }; + dataObject: any = {}; + tableLoading = true; + searchForm: FormGroup; + pageNum = 1; + pageSize = 10; + whereObject: any = {}; + isCollapse = false; + + refundModal = false; + refundForm: FormGroup; + + orderDetailModal = false; + orderDetailModalLoading = false; + orderDetailObject: any = { + tradeOrder: {}, + gasOrder: {}, + }; + + orderStatusArray = []; + companyArray = []; + merArray = []; + oilArray = []; + orgIdArray = []; + tyAgentArray = []; + tySalesmanArray = []; + + constructor(private modal: NzModalService, + private message: NzMessageService, + private commonsService: CommonsService, + private companyService: CompanyService, + private merchantService: MerchantService, + private store: LocalStorageService, + private orderManageService: OrderManageService, + private tyAgentService: TyAgentService, + private tySalesmanService: TySalesmanService, + private organizationService: OrganizationService, + 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.refundForm = this.form.group({ + orderNo: [{ value: null, disabled: true}, [Validators.required]], + remarks: [null], + }); + + this.searchForm = this.form.group({ + orderNo: [null], + gasOrgId: [null], + gasAgentId: [null], + gasSalesmanId: [null], + salesmanName: [null], + salesmanId: [null], + gasStaffName: [null], + gasOilNo: [null], + storeName: [null], + memPhone: [null], + status: [null], + createTimeArray: [null], + payTimeArray: [null], + refundTimeArray: [null], + companyId: [null], + merId: [null], + }); + this.requestOrderData(1); + + this.commonsService.getDictionary("GAS_OIL_TYPE", data => { + this.oilArray = data['return_data']; + }); + this.commonsService.getDictionary("ORDER_OIL_STATUS", data => { + this.orderStatusArray = data['return_data']; + }); + + if (this.roleType === 0 || this.roleType === 1) { + this.companyService.selectCompanyList({ pageNum: 1,pageSize: 999 }, data => { + this.companyArray = data['return_data']['list']; + }); + } + + if (this.roleType === 5) { + this.requestMerList(this.store.get(ADMIN_INFO_OBJECT)['bsCompany']['id']) + } + + if (this.roleType === 5 && this.adminFlag === 1) { + this.requestOrgId(this.store.get(ADMIN_INFO_OBJECT)['bsCompany']['id']); + } + + if (this.roleType === 5 && this.adminFlag === 0) { + this.requestAgent(this.store.get(ADMIN_INFO_OBJECT)['secUser'].organizationId); + } + + if (this.roleType === 8) { + this.requestSalesman(this.store.get(ADMIN_INFO_OBJECT)['highTyAgent'].id); + } + } + + /** + * 请求订单数据 + */ + requestOrderData(pageNum: number) { + this.tableLoading = true; + this.whereObject['pageNum'] = pageNum; + this.whereObject['pageSize'] = this.pageSize; + this.orderManageService.getGasOrderList(this.whereObject, data => { + if (data['return_code'] === '000000') { + this.dataObject = data['return_data']; + } else { + this.modal.error(data['return_msg']); + } + this.tableLoading = false; + }); + } + + /** + * 请求数据 + */ + requestMerList(companyId: number) { + if (companyId != null) { + this.searchForm.controls['merId'].setValue(null); + this.merchantService.getMerchantListByCompany(companyId, data => { + if (data['return_code'] === '000000') { + this.merArray = data['return_data']; + } else { + this.modal.error(data['return_msg']); + } + this.tableLoading = false; + }); + + this.requestOrgId(companyId); + } + } + + /** + * 请求数据 + */ + requestOrgId(companyId: number) { + this.organizationService.getOrganizationList(companyId, data => { + if (data['return_code'] === '000000') { + this.orgIdArray = data['return_data']; + } else { + this.modal.error(data['return_msg']); + } + this.tableLoading = false; + }); + } + + /** + * 请求数据 + */ + requestAgent(orgId: number) { + if (orgId != null) { + this.searchForm.controls['gasAgentId'].setValue(null); + this.searchForm.controls['gasSalesmanId'].setValue(null); + + this.tyAgentService.getAgentList({ orgId: orgId, pageNum: 1, pageSize: 9999}, data => { + if (data['return_code'] === '000000') { + this.tyAgentArray = data['return_data']['list']; + } else { + this.modal.error(data['return_msg']); + } + this.tableLoading = false; + }); + } + } + + /** + * 请求数据 + */ + requestSalesman(tyAgentId: number) { + if (tyAgentId != null) { + this.searchForm.controls['gasSalesmanId'].setValue(null); + + this.tySalesmanService.getSalesmanList({ tyAgentId: tyAgentId, pageNum: 1, pageSize: 9999}, data => { + if (data['return_code'] === '000000') { + this.tySalesmanArray = data['return_data']['list']; + } else { + this.modal.error(data['return_msg']); + } + this.tableLoading = false; + }); + } + } + + /** + * 搜索 + * @param whereObject 条件 + */ + search(whereObject: object) { + if (whereObject['createTimeArray'] != null) { + whereObject['createTimeS'] = new Date(whereObject['createTimeArray'][0]).getTime(); + whereObject['createTimeE'] = new Date(whereObject['createTimeArray'][1]).getTime(); + } else { + whereObject['createTimeS'] = null; + whereObject['createTimeE'] = null; + } + + if (whereObject['payTimeArray'] != null) { + whereObject['payTimeS'] = new Date(whereObject['payTimeArray'][0]).getTime(); + whereObject['payTimeE'] = new Date(whereObject['payTimeArray'][1]).getTime(); + } else { + whereObject['payTimeS'] = null; + whereObject['payTimeE'] = null; + } + + if (whereObject['refundTimeArray'] != null) { + whereObject['refundTimeS'] = new Date(whereObject['refundTimeArray'][0]).getTime(); + whereObject['refundTimeE'] = new Date(whereObject['refundTimeArray'][1]).getTime(); + } else { + whereObject['refundTimeS'] = null; + whereObject['refundTimeE'] = null; + } + this.whereObject = whereObject; + this.requestOrderData(1); + } + + /** + * 分页 + * @param pageSize + */ + pageSizeChang(pageSize: number) { + this.pageSize = pageSize; + this.requestOrderData(1) + } + + /** + * 重置 + */ + resetSearchForm(): void { + this.searchForm.reset(); + } + + /** + * 搜索条件折叠 + */ + toggleCollapse(): void { + this.isCollapse = !this.isCollapse; + } + + /** + * 导出订单 + */ + excelOrder() { + this.loadingObject.status = true; + this.loadingObject.title = '数据导出中...'; + + this.orderManageService.exportGasOrderList(this.whereObject, data => { + if (data['return_code'] === '000000') { + window.location.href = this.FILE_URL + 'temporary/' + data['return_data']; + } else { + this.modal.error({ + nzTitle: '提示', + nzContent: data['return_msg'] + }); + } + this.loadingObject.status = false; + }); + } + + /** + * 打开订单详情 + */ + showOrderDetail(orderNo: string) { + this.orderDetailModal = true; + this.orderDetailModalLoading = true; + + this.orderManageService.getGasOrderDetail(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; + } + + /** + * 打开退款模态框 + * @param orderNo + */ + showRefund(orderNo: string) { + this.refundForm.patchValue({ orderNo: orderNo}) + this.refundModal = true; + } + + /** + * 提交退款确认框 + */ + submitRefundConfirm() { + for (const i in this.refundForm.controls) { + this.refundForm.controls[i].markAsDirty(); + this.refundForm.controls[i].updateValueAndValidity(); + } + if (this.refundForm.status == null || this.refundForm.status !== 'VALID') { + this.modal.warning({ + nzTitle: '提示', + nzContent: '请填写所有必填项', + }); + return; + } + this.modal.confirm({ + nzTitle: '提示', + nzContent: '确定对交易订号('+this.refundForm.controls.orderNo.value+')进行退款吗?', + nzOnOk: () => this.submitRefund() + }); + } + + /** + * 提交退款 + * @param orderNo + */ + submitRefund() { + this.loadingObject.status = true; + this.loadingObject.title = '处理中...'; + this.orderManageService.refundOrder(this.refundForm.controls.orderNo.value,this.refundForm.controls.remarks.value, data => { + if (data['return_code'] === '000000') { + this.modal.success({ + nzTitle: '提示', + nzContent: '操作成功', + }); + this.requestOrderData(this.whereObject.pageNum); + this.closeRefund(); + } else { + this.modal.error({ + nzTitle: '提示', + nzContent: data['return_msg'], + }); + } + this.loadingObject.status = false; + }); + this.refundModal = true; + } + + /** + * 关闭退款模态框 + * @param orderNo + */ + closeRefund() { + this.refundModal = false; + } +} diff --git a/src/app/admin/promotion/distribution-integral-list/distribution-integral-list.component.ts b/src/app/admin/promotion/distribution-integral-list/distribution-integral-list.component.ts index 9c691ad..67e1072 100644 --- a/src/app/admin/promotion/distribution-integral-list/distribution-integral-list.component.ts +++ b/src/app/admin/promotion/distribution-integral-list/distribution-integral-list.component.ts @@ -1,11 +1,9 @@ import { Component, OnInit } from '@angular/core'; import {environment} from '../../../../environments/environment'; -import {FormBuilder, FormGroup} from '_@angular_forms@9.0.7@@angular/forms'; import {IconService} from '../../../services/icon.service'; -import {NzMessageService} from '_ng-zorro-antd@9.3.0@ng-zorro-antd'; -import {Router} from '_@angular_router@9.0.7@@angular/router'; -import {CommonsService} from '../../../services/commons.service'; import {DistributionService} from '../../../services/distribution.service'; +import {FormBuilder, FormGroup} from '@angular/forms'; +import {NzMessageService} from 'ng-zorro-antd'; @Component({ selector: 'app-distribution-integral-list', diff --git a/src/app/admin/promotion/promotion-order-list/promotion-order-list.component.ts b/src/app/admin/promotion/promotion-order-list/promotion-order-list.component.ts index 401c83a..efe8b85 100644 --- a/src/app/admin/promotion/promotion-order-list/promotion-order-list.component.ts +++ b/src/app/admin/promotion/promotion-order-list/promotion-order-list.component.ts @@ -1,9 +1,9 @@ import { Component, OnInit } from '@angular/core'; import {environment} from '../../../../environments/environment'; -import {FormBuilder, FormGroup} from '_@angular_forms@9.0.7@@angular/forms'; import {DistributionService} from '../../../services/distribution.service'; import {IconService} from '../../../services/icon.service'; -import {NzMessageService} from '_ng-zorro-antd@9.3.0@ng-zorro-antd'; +import {FormBuilder, FormGroup} from '@angular/forms'; +import {NzMessageService} from 'ng-zorro-antd'; @Component({ selector: 'app-promotion-order-list', diff --git a/src/app/admin/promotion/promotion.module.ts b/src/app/admin/promotion/promotion.module.ts index a4e6705..ddf99bf 100644 --- a/src/app/admin/promotion/promotion.module.ts +++ b/src/app/admin/promotion/promotion.module.ts @@ -4,10 +4,10 @@ import { CommonModule } from '@angular/common'; import { PromotionRoutingModule } from './promotion-routing.module'; import { DistributionIntegralListComponent } from './distribution-integral-list/distribution-integral-list.component'; import { PromotionOrderListComponent } from './promotion-order-list/promotion-order-list.component'; -import {NgZorroAntdModule} from '_ng-zorro-antd@9.3.0@ng-zorro-antd'; import {SeparateModule} from '../../common/separate/separate.module'; -import {FormsModule, ReactiveFormsModule} from '_@angular_forms@9.0.7@@angular/forms'; import {BreadcrumbModule} from '../../common/breadcrumb/breadcrumb.module'; +import {NgZorroAntdModule} from 'ng-zorro-antd'; +import {FormsModule, ReactiveFormsModule} from '@angular/forms'; @NgModule({ diff --git a/src/app/app-common.module.ts b/src/app/app-common.module.ts index 8cd1865..e1a5476 100644 --- a/src/app/app-common.module.ts +++ b/src/app/app-common.module.ts @@ -48,7 +48,7 @@ import { GasStaffStatusPipe, PayStatusPipe, ChlidRechargeStatusPipe, - SourceTypePipe, GasClassGroupTaskStatusPipe, GasOrderStatusPipe + SourceTypePipe, GasClassGroupTaskStatusPipe, GasOrderStatusPipe, OrderStatusPipe, OrderPayTypePipe, OrderChildGoodsTypePipe } from './pipes'; import {OilCardStatusPipe} from './pipes'; import {OilTypePipe} from './pipes/store/oil-type.pipe'; @@ -58,6 +58,7 @@ import {OilPriceTaskPriceTypePipe} from './pipes/gas-oil-price/oil-price-task-pr 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, @@ -108,6 +109,10 @@ const PIPES = [ GasClassGroupTaskStatusPipe, GasOrderStatusPipe, PlatformPipe, + OrderOilStatusPipe, + OrderStatusPipe, + OrderPayTypePipe, + OrderChildGoodsTypePipe, ]; diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 3877c1f..c1fc476 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -62,6 +62,11 @@ const routes: Routes = [ loadChildren: () => import('./admin/order/order.module').then(m => m.OrderModule), canActivate: [InitGuardService] }, + { + path: 'order-manage', + loadChildren: () => import('./admin/order-manage/order-manage.module').then(m => m.OrderManageModule), + canActivate: [InitGuardService] + }, { path: 'discount', loadChildren: () => import('./admin/discount/discount.module').then(m => m.DiscountModule), diff --git a/src/app/pipes/index.ts b/src/app/pipes/index.ts index 5956d41..e594bda 100644 --- a/src/app/pipes/index.ts +++ b/src/app/pipes/index.ts @@ -41,3 +41,7 @@ export * from './apiMerchant/source-type.pipe'; export * from './gas-class-group-task/gas-class-group-task-status.pipe'; export * from './gas-order/gas-order-status.pipe'; export * from './recharge-pipe/platform.pipe'; +export * from './order/order-oil-status.pipe'; +export * from './order/order-status.pipe'; +export * from './order/order-pay-type.pipe'; +export * from './order/order-child-goods-type.pipe'; diff --git a/src/app/pipes/order/order-child-goods-type.pipe.ts b/src/app/pipes/order/order-child-goods-type.pipe.ts new file mode 100644 index 0000000..4df2cef --- /dev/null +++ b/src/app/pipes/order/order-child-goods-type.pipe.ts @@ -0,0 +1,32 @@ +import { Pipe, PipeTransform } from '@angular/core'; + +@Pipe({ + name: 'orderChildGoodsType' +}) +export class OrderChildGoodsTypePipe implements PipeTransform { + + transform(value: number): string { + switch (value) { + case 1: + return '卡券'; + case 2: + return '积分充值'; + case 3: + return '加油订单'; + case 4: + return 'KFC'; + case 5: + return '电影票'; + case 6: + return '话费充值'; + case 7: + return '优惠卷包'; + case 8: + return '汇联通充值'; + case 9: + return '星巴克'; + case 10: + return '第三方充值'; + } + } +} diff --git a/src/app/pipes/order/order-oil-status.pipe.ts b/src/app/pipes/order/order-oil-status.pipe.ts new file mode 100644 index 0000000..7e0e399 --- /dev/null +++ b/src/app/pipes/order/order-oil-status.pipe.ts @@ -0,0 +1,25 @@ +import { Pipe, PipeTransform } from '@angular/core'; + +@Pipe({ + name: 'orderOilStatus' +}) +export class OrderOilStatusPipe implements PipeTransform { + + transform(value: number): string { + switch (value) { + case 1: + return '待支付'; + case 2: + return '已支付'; + case 3: + return '已取消'; + case 4: + return '已退款'; + case 5: + return '退款中'; + case 6: + return '退款失败'; + } + } + +} diff --git a/src/app/pipes/order/order-pay-type.pipe.ts b/src/app/pipes/order/order-pay-type.pipe.ts new file mode 100644 index 0000000..a105349 --- /dev/null +++ b/src/app/pipes/order/order-pay-type.pipe.ts @@ -0,0 +1,27 @@ +import { Pipe, PipeTransform } from '@angular/core'; + +@Pipe({ + name: 'orderPayType' +}) +export class OrderPayTypePipe implements PipeTransform { + + transform(value: number): string { + switch (value) { + case 1: + return '支付宝'; + case 2: + return '微信'; + case 3: + return '积分抵扣'; + case 4: + return '贵州汇联通工会卡'; + case 5: + return '银联'; + case 6: + return '银联分期'; + case 7: + return '嗨森逛油卡'; + } + } + +} diff --git a/src/app/pipes/order/order-status.pipe.ts b/src/app/pipes/order/order-status.pipe.ts new file mode 100644 index 0000000..b8c9cc9 --- /dev/null +++ b/src/app/pipes/order/order-status.pipe.ts @@ -0,0 +1,23 @@ +import { Pipe, PipeTransform } from '@angular/core'; + +@Pipe({ + name: 'orderStatus' +}) +export class OrderStatusPipe implements PipeTransform { + + transform(value: number): string { + switch (value) { + case 1: + return '待支付'; + case 2: + return '已支付'; + case 3: + return '已完成'; + case 4: + return '已退款'; + case 5: + return '已取消'; + } + } + +} diff --git a/src/app/pipes/paytype.pipe.ts b/src/app/pipes/paytype.pipe.ts index 412ce30..089e7bc 100644 --- a/src/app/pipes/paytype.pipe.ts +++ b/src/app/pipes/paytype.pipe.ts @@ -17,6 +17,8 @@ export class PaytypePipe implements PipeTransform { return '汇联通工会卡'; case 5: return '银联'; + default: + return '未知'; } } } diff --git a/src/app/services/distribution.service.ts b/src/app/services/distribution.service.ts index 159feab..ee720bd 100644 --- a/src/app/services/distribution.service.ts +++ b/src/app/services/distribution.service.ts @@ -1,7 +1,7 @@ import { Injectable } from '@angular/core'; -import {HttpClient} from '_@angular_common@9.0.7@@angular/common/http'; import {CommonsService} from './commons.service'; import {environment} from '../../environments/environment'; +import {HttpClient} from '@angular/common/http'; @Injectable({ providedIn: 'root' diff --git a/src/app/services/order-manage.service.ts b/src/app/services/order-manage.service.ts new file mode 100644 index 0000000..6776c29 --- /dev/null +++ b/src/app/services/order-manage.service.ts @@ -0,0 +1,68 @@ +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 OrderManageService { + + constructor( + private http: HttpClient, + private common: CommonsService + ) { + } + + /** + * 交易订单退款 + * + * @param paramsObject 对象 + * @param callBack 回调 + */ + public refundOrder(orderNo: string, remarks: string, callBack) { + this.http.post(environment.orderUrl + 'refundOrder', { orderNo: orderNo, remarks: remarks}).subscribe(data => { + callBack(data); + }); + } + + + /** + * 查询加油订单 + * + * @param paramsObject 对象 + * @param callBack 回调 + */ + public getGasOrderList(param: object, callBack) { + this.http.get(environment.orderUrl + 'bweb/getGasOrderList?' + this.common.getWhereCondition(param)).subscribe(data => { + callBack(data); + }); + } + + /** + * 查询油站订单详情 + * + * @param paramsObject 对象 + * @param callBack 回调 + */ + public getGasOrderDetail(orderNo: string, callBack) { + this.http.get(environment.orderUrl + 'bweb/getGasOrderDetail?orderNo=' + orderNo).subscribe(data => { + callBack(data); + }); + } + + /** + * 导出加油订单 + * + * @param paramsObject 对象 + * @param callBack 回调 + */ + public exportGasOrderList(param: object, callBack) { + this.http.get(environment.orderUrl + 'bweb/exportGasOrder?' + this.common.getWhereCondition(param)).subscribe(data => { + callBack(data); + }); + } + + + +} diff --git a/src/environments/environment.ts b/src/environments/environment.ts index a2d6d6f..5b580fd 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -5,7 +5,8 @@ export const environment = { production: false, baseUrl: 'http://localhost:9302/brest/', // 测试环境服务器地址(请求数据地址) - imageUrl: 'http://localhost:9302/filesystem/', + orderUrl: 'http://localhost:9304/order/', + imageUrl: 'https://hsgcs.dctpay.com/filesystem/', // baseUrl: 'https://hsgcs.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址) // imageUrl: 'https://hsgcs.dctpay.com/filesystem/', key: 'https://hsgcs.dctpay.com/phone-recharge-H5/index.html?codeValue=',