|
|
|
@ -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); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|