From 62e2a5e6172a161775c73c427b5097e68aa28cd2 Mon Sep 17 00:00:00 2001
From: Sum1Dream <418471657@qq.com>
Date: Tue, 19 Oct 2021 23:20:38 +0800
Subject: [PATCH] 1
---
.../agent-list/agent-list.component.html | 2 +-
.../agent/agent-list/agent-list.component.ts | 3 +-
.../order-agent/order-agent.component.html | 186 +++++++++++++++++
.../order-agent/order-agent.component.scss | 4 +
.../order-agent/order-agent.component.ts | 190 ++++++++++++++++++
src/app/admin/order/order-routing.module.ts | 2 +
src/app/admin/order/order.module.ts | 3 +-
src/app/services/order.service.ts | 18 ++
8 files changed, 404 insertions(+), 4 deletions(-)
create mode 100644 src/app/admin/order/order-agent/order-agent.component.html
create mode 100644 src/app/admin/order/order-agent/order-agent.component.scss
create mode 100644 src/app/admin/order/order-agent/order-agent.component.ts
diff --git a/src/app/admin/agent/agent-list/agent-list.component.html b/src/app/admin/agent/agent-list/agent-list.component.html
index cc26920..f67add9 100644
--- a/src/app/admin/agent/agent-list/agent-list.component.html
+++ b/src/app/admin/agent/agent-list/agent-list.component.html
@@ -86,7 +86,7 @@
编号 |
代理商名称 |
代理商地址 |
- 邀请链接 |
+ 标识链接 |
联系人 |
联系方式 |
创建时间 |
diff --git a/src/app/admin/agent/agent-list/agent-list.component.ts b/src/app/admin/agent/agent-list/agent-list.component.ts
index 3c9d9e7..cc34f3a 100644
--- a/src/app/admin/agent/agent-list/agent-list.component.ts
+++ b/src/app/admin/agent/agent-list/agent-list.component.ts
@@ -18,7 +18,6 @@ import {CouponService} from '../../../services/coupon.service';
export class AgentListComponent implements OnInit {
WEB_SERVE_URL = environment.imageUrl;
- FILE_URL = environment.baseUrl;
inviteUrl = environment.inviteUrl;
searchForm: FormGroup; // 搜索框
validateForm: FormGroup; // 搜索框
@@ -312,7 +311,7 @@ export class AgentListComponent implements OnInit {
public generateAgentQrCode(id: number): void {
this.agent.generateRechargeAgentQrCode(id, data => {
if (data['return_code'] === '000000') {
- window.location.href = this.FILE_URL + data['return_data'];
+ window.location.href = this.WEB_SERVE_URL + data['return_data'];
} else {
this.message.error(data['return_msg']);
}
diff --git a/src/app/admin/order/order-agent/order-agent.component.html b/src/app/admin/order/order-agent/order-agent.component.html
new file mode 100644
index 0000000..df1d388
--- /dev/null
+++ b/src/app/admin/order/order-agent/order-agent.component.html
@@ -0,0 +1,186 @@
+
+
+
+
+
+
+
+
+
+
共计 {{total}} 条数据
+
+
+
+
+
+
+ 编号 |
+ 商品名称 |
+ 订单来源 |
+ 订单类型 |
+ 订单号 |
+ 支付流水号 |
+ 客户名称 |
+ 客户电话 |
+ 支付模式 |
+ 支付方式 |
+ 支付金额 |
+ 生成时间 |
+ 支付时间 |
+ 取消时间 |
+ 状态 |
+
+
+
+
+
+ {{i+1}} |
+ {{data.goodsName}} |
+ {{data.giveawayType}} |
+ {{data.goodsType}} |
+ {{data.orderNo}} |
+ {{data.paySerialNo}} |
+ {{data.memName == null ? '暂无': data.memName}} |
+ {{data.memPhone == null ? '暂无': data.memPhone}} |
+ {{data.payModel}} |
+ {{data.payType}} |
+ {{data.payPrice}} |
+ {{data.createTime | date: 'yyyy-MM-dd HH:mm:ss'}} |
+ {{data.payTime | date: 'yyyy-MM-dd HH:mm:ss'}} |
+ {{data.cancelTime | date: 'yyyy-MM-dd HH:mm:ss'}} |
+ {{data.orderStatus}} |
+
+
+
+
+
+
+
+
+
+
+
+ 退款理由
+
+
+
+
+
+
diff --git a/src/app/admin/order/order-agent/order-agent.component.scss b/src/app/admin/order/order-agent/order-agent.component.scss
new file mode 100644
index 0000000..8bee3fb
--- /dev/null
+++ b/src/app/admin/order/order-agent/order-agent.component.scss
@@ -0,0 +1,4 @@
+.head_img {
+ height: 60px;
+ width: 60px;
+}
diff --git a/src/app/admin/order/order-agent/order-agent.component.ts b/src/app/admin/order/order-agent/order-agent.component.ts
new file mode 100644
index 0000000..1ab4073
--- /dev/null
+++ b/src/app/admin/order/order-agent/order-agent.component.ts
@@ -0,0 +1,190 @@
+import { Component, OnInit } from '@angular/core';
+import {environment} from "../../../../environments/environment";
+import {FormBuilder, FormGroup} from "_@angular_forms@9.0.7@@angular/forms";
+import {OrderService} from "../../../services/order.service";
+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 {CompanyService} from "../../../services/company.service";
+import {MerchantService} from "../../../services/merchant.service";
+import {CommonsService} from "../../../services/commons.service";
+import {ADMIN_INFO_OBJECT, DATA} from "../../../services/local-storage.namespace";
+import {LocalStorageService} from "../../../services/local-storage.service";
+
+@Component({
+ selector: 'app-order-agent',
+ templateUrl: './order-agent.component.html',
+ styleUrls: ['./order-agent.component.scss']
+})
+export class OrderAgentComponent implements OnInit {
+
+ WEB_SERVE_URL = environment.baseUrl;
+ FILE_URL = environment.imageUrl;
+ searchForm: FormGroup; // 搜索框
+ requestData = []; // 列表数据
+ companyData = []; // 列表数据
+ merchantData = []; // 列表数据
+ total: number; // 页码
+ pageNum = 1; // 页码
+ pageSize = 10; // 条码
+ loading = true;
+ id: number; // 订单ID
+ isVisible = false;
+ refundContent: string;
+ constructor(
+ private form: FormBuilder,
+ private order: OrderService,
+ private iconService: IconService,
+ private message: NzMessageService,
+ private router: Router,
+ private store: LocalStorageService, // 数据请求
+ private company: CompanyService,
+ private merchant: MerchantService,
+ private common: CommonsService
+ ) {
+ }
+
+ ngOnInit(): void {
+ console.log(this.store.get(ADMIN_INFO_OBJECT)['highAgent']['id']);
+
+ this.init();
+ const whereObject = {};
+ whereObject['pageNum'] = 1;
+ whereObject['pageSize'] = 10000;
+ this.company.selectCompanyList(whereObject, data => {
+ if (data['return_code'] === '000000') {
+ this.companyData = data['return_data'].list;
+ } else {
+ this.message.error(data['return_msg']);
+ }
+ });
+ this.getMerchantListByCompany(this.searchForm.value.companyId);
+ }
+
+ public init(): void {
+ this.searchForm = this.form.group({
+ companyId: [null],
+ merchantId: [null],
+ orderNo: [null],
+ paySerialNo: [null],
+ payModel: [null],
+ payType: [null],
+ memDiscountName: [null],
+ memPhone: [null],
+ orderStatus: [null],
+ payTime: [null],
+ identificationCode: this.store.get(ADMIN_INFO_OBJECT)['highAgent']['id']
+ });
+ this.getRequest(true, this.searchForm.value);
+ }
+
+ // 查询列表
+ public getRequest(reset: boolean = false, whereObject: object) {
+
+ if (whereObject['payTime'] != null && whereObject['payTime'].length !== 0) {
+ whereObject['payTimeS'] = whereObject['payTime'][0].getTime();
+ whereObject['payTimeE'] = whereObject['payTime'][1].getTime();
+ }
+
+ this.loading = false;
+ if (reset) {
+ this.pageNum = 1;
+ }
+ whereObject['pageNum'] = this.pageNum;
+ whereObject['pageSize'] = this.pageSize;
+ whereObject['identificationCode'] = this.store.get(ADMIN_INFO_OBJECT)['highAgent']['id'];
+ this.order.getOrderListByIdCode(whereObject, data => {
+ if (data['return_code'] === '000000') {
+ this.requestData = data['return_data'].list;
+ this.total = data['return_data'].total;
+ } else {
+ this.message.error(data['return_msg']);
+ }
+ });
+ }
+
+ // 查询商户
+ public getMerchantListByCompany(companyId: number): void {
+ this.merchant.getMerchantListByCompany(companyId, data => {
+ if (data['return_code'] === '000000') {
+ if (data['return_code'] === '000000') {
+ this.merchantData = data['return_data'];
+ } else {
+ this.message.error(data['return_msg']);
+ }
+ } else {
+ this.message.error(data['return_msg']);
+ }
+ });
+ }
+
+ // 重置
+ public resetForm(): void {
+ this.searchForm.reset();
+ }
+
+
+ // 查看详情
+ public getDetail(id: number): void {
+ this.router.navigate(['/admin/order/order-detail'], {
+ queryParams: {
+ merchantId: id
+ }
+ }).then(r => console.log(r));
+ }
+
+ // 下载模板
+ downloadTemplate(whereObject) {
+ if (whereObject['payTime'] != null && whereObject['payTime'].length !== 0) {
+ whereObject['payTimeS'] = whereObject['payTime'][0].getTime();
+ whereObject['payTimeE'] = whereObject['payTime'][1].getTime();
+ }
+ whereObject['identificationCode'] = this.store.get(ADMIN_INFO_OBJECT)['highAgent']['id'];
+ this.order.exportOrderListByIdCode(whereObject, data => {
+ if (data['return_code'] === '000000') {
+ window.location.href = this.FILE_URL + data['return_data'];
+ } else {
+ this.message.error(data['return_msg']);
+ }
+ });
+ }
+
+ provinceChange(e) {
+ console.log(e);
+ }
+
+ // 退款
+ public orderToRefund(id): void {
+
+ }
+
+ showModal(id): void {
+ this.id = id;
+ this.isVisible = true;
+ }
+
+ handleOk(): void {
+ this.common.showConfirm('确认订单是否退款', item => {
+ if (item) {
+ const params = {
+ orderId: this.id ,
+ refundContent: this.refundContent
+ };
+ this.order.refuelingOrderRefund(params, data => {
+ if (data['return_code'] === '000000') {
+ this.getRequest(false, this.searchForm.value);
+ this.isVisible = false;
+ this.message.success('退款成功');
+ } else {
+ this.message.error(data['return_msg']);
+ }
+ });
+ }
+ });
+ }
+
+ handleCancel(): void {
+ this.isVisible = false;
+ }
+
+}
diff --git a/src/app/admin/order/order-routing.module.ts b/src/app/admin/order/order-routing.module.ts
index b3d5c8e..31aa3da 100644
--- a/src/app/admin/order/order-routing.module.ts
+++ b/src/app/admin/order/order-routing.module.ts
@@ -8,6 +8,7 @@ import {OrderTListComponent} from './order-Tlist/order-Tlist.component';
import {OrderCListComponent} from './order-c-list/order-c-list.component';
import {OrderKListComponent} from './order-k-list/order-k-list.component';
import {OrderHListComponent} from './order-h-list/order-h-list.component';
+import {OrderAgentComponent} from "./order-agent/order-agent.component";
const routes: Routes = [
@@ -19,6 +20,7 @@ const routes: Routes = [
{ path: 'order-c-list', component: OrderCListComponent },
{ path: 'order-k-list', component: OrderKListComponent },
{ path: 'order-h-list', component: OrderHListComponent },
+ { path: 'order-agent', component: OrderAgentComponent },
];
@NgModule({
diff --git a/src/app/admin/order/order.module.ts b/src/app/admin/order/order.module.ts
index 3f91ee1..814e92e 100644
--- a/src/app/admin/order/order.module.ts
+++ b/src/app/admin/order/order.module.ts
@@ -16,10 +16,11 @@ import {OrderTListComponent} from './order-Tlist/order-Tlist.component';
import { OrderKListComponent } from './order-k-list/order-k-list.component';
import {OrderCListComponent} from './order-c-list/order-c-list.component';
import { OrderHListComponent } from './order-h-list/order-h-list.component';
+import { OrderAgentComponent } from './order-agent/order-agent.component';
@NgModule({
- declarations: [OrderListComponent, OrderDetailComponent, OrderCouponsComponent, OrderCouponComponent , OrderTListComponent, OrderKListComponent , OrderCListComponent, OrderHListComponent],
+ declarations: [OrderListComponent, OrderDetailComponent, OrderCouponsComponent, OrderCouponComponent , OrderTListComponent, OrderKListComponent , OrderCListComponent, OrderHListComponent, OrderAgentComponent],
imports: [
CommonModule,
OrderRoutingModule,
diff --git a/src/app/services/order.service.ts b/src/app/services/order.service.ts
index 77f3c67..7bad9c9 100644
--- a/src/app/services/order.service.ts
+++ b/src/app/services/order.service.ts
@@ -25,6 +25,18 @@ export class OrderService {
});
}
+ /**
+ * 查询代理商订单列表
+ *
+ * @param paramsObject 对象
+ * @param callBack 回调
+ */
+ public getOrderListByIdCode(paramsObject: object, callBack) {
+ this.http.get(environment.baseUrl + 'highOrder/getOrderListByIdCode?' + this.common.getWhereCondition(paramsObject)).subscribe(data => {
+ callBack(data);
+ });
+ }
+
/**
* 查询团游订单列表
*
@@ -80,6 +92,12 @@ export class OrderService {
});
}
+ public exportOrderListByIdCode(paramsObject: object, callBack) {
+ this.http.get(environment.baseUrl + 'highOrder/exportOrderListByIdCode?' + this.common.getWhereCondition(paramsObject)).subscribe(data => {
+ callBack(data);
+ });
+ }
+
/**
* 退款
*