From 77f2d31f73017819e384f3bf8abe3a74b7c8260d Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Tue, 12 Apr 2022 11:27:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A2=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ty-order-list.component.html | 18 +++-- .../ty-order-list/ty-order-list.component.ts | 72 ++++++++++++++++++- 2 files changed, 83 insertions(+), 7 deletions(-) diff --git a/src/app/admin/tuanyou-agent/order/ty-order-list/ty-order-list.component.html b/src/app/admin/tuanyou-agent/order/ty-order-list/ty-order-list.component.html index 6b6da52..6b8c0e3 100644 --- a/src/app/admin/tuanyou-agent/order/ty-order-list/ty-order-list.component.html +++ b/src/app/admin/tuanyou-agent/order/ty-order-list/ty-order-list.component.html @@ -10,7 +10,9 @@ 代理公司 - + + + @@ -18,15 +20,19 @@ 代理商 - + + + -
+
业务员 - + + +
@@ -96,7 +102,7 @@ 代理公司 代理商 - 业务员 + 业务员 加油站 用户手机号 订单号 @@ -117,7 +123,7 @@ {{data.orgName?data.orgName:'无'}} {{data.agentName?data.agentName:'无'}} - {{data.salesmanName?data.salesmanName:'无'}} + {{data.salesmanName?data.salesmanName:'无'}} {{data.goodsName}} {{data.memPhone}} {{data.orderNo}} diff --git a/src/app/admin/tuanyou-agent/order/ty-order-list/ty-order-list.component.ts b/src/app/admin/tuanyou-agent/order/ty-order-list/ty-order-list.component.ts index 008e30c..38cd5ec 100644 --- a/src/app/admin/tuanyou-agent/order/ty-order-list/ty-order-list.component.ts +++ b/src/app/admin/tuanyou-agent/order/ty-order-list/ty-order-list.component.ts @@ -5,6 +5,9 @@ import {TyAgentOilStationService} from '../../../../services/ty-agent-oil-statio import {ADMIN_INFO_OBJECT} from "../../../../services/local-storage.namespace"; import {LocalStorageService} from "../../../../services/local-storage.service"; import {environment} from "../../../../../environments/environment"; +import {TyAgentService} from "../../../../services/ty-agent.service"; +import {TySalesmanService} from "../../../../services/ty-salesman.service"; +import {OrganizationService} from "../../../../services/organization.service"; @Component({ selector: 'app-ty-order-list', @@ -22,10 +25,17 @@ export class TyOrderListComponent implements OnInit { pageNum: number; whereObject: any = {}; + orgIdArray = []; + tyAgentArray = []; + tySalesmanArray = []; + constructor(private modal: NzModalService, private message: NzMessageService, private store: LocalStorageService, private tyAgentOilStationService: TyAgentOilStationService, + 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); @@ -36,12 +46,27 @@ export class TyOrderListComponent implements OnInit { orderNo: [null], goodsName: [null], orgName: [null], + orgId: [null], agentName: [null], + agentId: [null], salesmanName: [null], + salesmanId: [null], memPhone: [null], payTimeArray: [null], }); this.requestData(1); + + if (this.roleType === 5 && this.adminFlag === 1) { + this.requestOrgId(); + } + + 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); + } } /** @@ -61,6 +86,52 @@ export class TyOrderListComponent implements OnInit { }); } + /** + * 请求数据 + */ + requestOrgId() { + this.organizationService.getOrganizationList(this.store.get(ADMIN_INFO_OBJECT)['secUser'].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.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.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 条件 @@ -74,7 +145,6 @@ export class TyOrderListComponent implements OnInit { whereObject['payTimeE'] = null; } this.whereObject = whereObject; - console.log(this.whereObject); this.requestData(1); }