提交代碼

pull/1/head
胡锐 3 years ago
parent 43d1017ca8
commit 77f2d31f73
  1. 18
      src/app/admin/tuanyou-agent/order/ty-order-list/ty-order-list.component.html
  2. 72
      src/app/admin/tuanyou-agent/order/ty-order-list/ty-order-list.component.ts

@ -10,7 +10,9 @@
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="8">代理公司</nz-form-label> <nz-form-label [nzSpan]="8">代理公司</nz-form-label>
<nz-form-control [nzSpan]="14"> <nz-form-control [nzSpan]="14">
<input nz-input formControlName="orgName" /> <nz-select formControlName="orgId" nzAllowClear (ngModelChange)="requestAgent($event)">
<nz-option *ngFor="let item of orgIdArray" nzValue="{{item['id']}}" nzLabel="{{item['name']}}"></nz-option>
</nz-select>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
</div> </div>
@ -18,15 +20,19 @@
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="8">代理商</nz-form-label> <nz-form-label [nzSpan]="8">代理商</nz-form-label>
<nz-form-control [nzSpan]="14"> <nz-form-control [nzSpan]="14">
<input nz-input formControlName="agentName" /> <nz-select formControlName="agentId"nzAllowClear (ngModelChange)="requestSalesman($event)">
<nz-option *ngFor="let item of tyAgentArray" nzValue="{{item['id']}}" nzLabel="{{item['agentName']}}"></nz-option>
</nz-select>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
</div> </div>
<div nz-col nzSpan="8" *ngIf="roleType == 8 || roleType == 5"> <div nz-col nzSpan="8" *ngIf="roleType == 8 || (roleType == 5 && adminFlag == 1)">
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="8">业务员</nz-form-label> <nz-form-label [nzSpan]="8">业务员</nz-form-label>
<nz-form-control [nzSpan]="14"> <nz-form-control [nzSpan]="14">
<input nz-input formControlName="salesmanName" /> <nz-select formControlName="salesmanId" nzAllowClear>
<nz-option *ngFor="let item of tySalesmanArray" nzValue="{{item['id']}}" nzLabel="{{item['salesmanName']}}"></nz-option>
</nz-select>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
</div> </div>
@ -96,7 +102,7 @@
<tr> <tr>
<th nzWidth="120px" *ngIf="adminFlag == 1 && roleType == 5">代理公司</th> <th nzWidth="120px" *ngIf="adminFlag == 1 && roleType == 5">代理公司</th>
<th nzWidth="120px" *ngIf="roleType == 5">代理商</th> <th nzWidth="120px" *ngIf="roleType == 5">代理商</th>
<th nzWidth="120px" *ngIf="roleType == 8 || roleType == 5">业务员</th> <th nzWidth="120px" *ngIf="roleType == 8 || (roleType == 5 && adminFlag == 1)">业务员</th>
<th nzWidth="160px">加油站</th> <th nzWidth="160px">加油站</th>
<th nzWidth="160px" *ngIf="adminFlag == 1 && roleType == 5">用户手机号</th> <th nzWidth="160px" *ngIf="adminFlag == 1 && roleType == 5">用户手机号</th>
<th nzWidth="200px">订单号</th> <th nzWidth="200px">订单号</th>
@ -117,7 +123,7 @@
<tr *ngFor="let data of basicTable.data;let i = index"> <tr *ngFor="let data of basicTable.data;let i = index">
<td *ngIf="adminFlag == 1 && roleType == 5">{{data.orgName?data.orgName:'无'}}</td> <td *ngIf="adminFlag == 1 && roleType == 5">{{data.orgName?data.orgName:'无'}}</td>
<td *ngIf="roleType == 5">{{data.agentName?data.agentName:'无'}}</td> <td *ngIf="roleType == 5">{{data.agentName?data.agentName:'无'}}</td>
<td *ngIf="roleType == 8 || roleType == 5">{{data.salesmanName?data.salesmanName:'无'}}</td> <td *ngIf="roleType == 8 ||(roleType == 5 && adminFlag == 1)">{{data.salesmanName?data.salesmanName:'无'}}</td>
<td>{{data.goodsName}}</td> <td>{{data.goodsName}}</td>
<td *ngIf="adminFlag == 1 && roleType == 5">{{data.memPhone}}</td> <td *ngIf="adminFlag == 1 && roleType == 5">{{data.memPhone}}</td>
<td>{{data.orderNo}}</td> <td>{{data.orderNo}}</td>

@ -5,6 +5,9 @@ import {TyAgentOilStationService} from '../../../../services/ty-agent-oil-statio
import {ADMIN_INFO_OBJECT} from "../../../../services/local-storage.namespace"; import {ADMIN_INFO_OBJECT} from "../../../../services/local-storage.namespace";
import {LocalStorageService} from "../../../../services/local-storage.service"; import {LocalStorageService} from "../../../../services/local-storage.service";
import {environment} from "../../../../../environments/environment"; 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({ @Component({
selector: 'app-ty-order-list', selector: 'app-ty-order-list',
@ -22,10 +25,17 @@ export class TyOrderListComponent implements OnInit {
pageNum: number; pageNum: number;
whereObject: any = {}; whereObject: any = {};
orgIdArray = [];
tyAgentArray = [];
tySalesmanArray = [];
constructor(private modal: NzModalService, constructor(private modal: NzModalService,
private message: NzMessageService, private message: NzMessageService,
private store: LocalStorageService, private store: LocalStorageService,
private tyAgentOilStationService: TyAgentOilStationService, private tyAgentOilStationService: TyAgentOilStationService,
private tyAgentService: TyAgentService,
private tySalesmanService: TySalesmanService,
private organizationService: OrganizationService,
private form: FormBuilder) { private form: FormBuilder) {
this.roleType = Number(this.store.get(ADMIN_INFO_OBJECT)['secRole'].roleType); this.roleType = Number(this.store.get(ADMIN_INFO_OBJECT)['secRole'].roleType);
this.adminFlag = Number(this.store.get(ADMIN_INFO_OBJECT)['secUser'].adminFlag); this.adminFlag = Number(this.store.get(ADMIN_INFO_OBJECT)['secUser'].adminFlag);
@ -36,12 +46,27 @@ export class TyOrderListComponent implements OnInit {
orderNo: [null], orderNo: [null],
goodsName: [null], goodsName: [null],
orgName: [null], orgName: [null],
orgId: [null],
agentName: [null], agentName: [null],
agentId: [null],
salesmanName: [null], salesmanName: [null],
salesmanId: [null],
memPhone: [null], memPhone: [null],
payTimeArray: [null], payTimeArray: [null],
}); });
this.requestData(1); 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 * @param whereObject
@ -74,7 +145,6 @@ export class TyOrderListComponent implements OnInit {
whereObject['payTimeE'] = null; whereObject['payTimeE'] = null;
} }
this.whereObject = whereObject; this.whereObject = whereObject;
console.log(this.whereObject);
this.requestData(1); this.requestData(1);
} }

Loading…
Cancel
Save