diff --git a/src/app/admin/trade-checking/trade-checking-detail/trade-checking-detail.component.html b/src/app/admin/trade-checking/trade-checking-detail/trade-checking-detail.component.html index 92e7a23..b5f8098 100644 --- a/src/app/admin/trade-checking/trade-checking-detail/trade-checking-detail.component.html +++ b/src/app/admin/trade-checking/trade-checking-detail/trade-checking-detail.component.html @@ -10,7 +10,7 @@ 商户号 - + diff --git a/src/app/admin/trade-checking/trade-checking-detail/trade-checking-detail.component.ts b/src/app/admin/trade-checking/trade-checking-detail/trade-checking-detail.component.ts index a23b967..1a4b685 100644 --- a/src/app/admin/trade-checking/trade-checking-detail/trade-checking-detail.component.ts +++ b/src/app/admin/trade-checking/trade-checking-detail/trade-checking-detail.component.ts @@ -6,6 +6,8 @@ import {MerService} from '../../../services/mer.service'; import {TradeCheckingService} from '../../../services/trade-checking.service'; import differenceInCalendarDays from 'date-fns/differenceInCalendarDays'; import {environment} from '../../../../environments/environment'; +import {ADMIN_INFO_OBJECT} from '../../../services/local-storage.namespace'; +import {LocalStorageService} from '../../../services/local-storage.service'; @Component({ selector: 'app-trade-checking-detail', @@ -35,15 +37,19 @@ export class TradeCheckingDetailComponent implements OnInit { }; dataDetailModal = false; currentDate = new Date(); + // 角色类型 0:超级管理员 1:公司 2:代理商 3:业务员 4:商户 5:门店 + roleType: number; constructor(private modal: NzModalService, private message: NzMessageService, private form: FormBuilder, private platformService: PlatformService, + private localStorage: LocalStorageService, private merService: MerService, private tradeCheckingService: TradeCheckingService) { } ngOnInit(): void { + this.roleType = this.localStorage.get(ADMIN_INFO_OBJECT)['secRole'].roleType; this.currentDate.setDate(this.currentDate.getDate() - 1); this.searchForm = this.form.group({ merNo: [null], @@ -53,13 +59,19 @@ export class TradeCheckingDetailComponent implements OnInit { settleTimeE: [ this.currentDate.getTime() ], }); - this.merService.getMerList({ merStatus: 1, pageNum: 1, pageSize: 9999}, data => { - this.merArray = data['return_data']['list']; - if (this.merArray.length > 0) { - this.searchForm.controls['merNo'].setValue(this.merArray[0]['merNo']); - this.requestData(this.pageNum, this.pageSize); - } - }); + if (this.roleType == 2) { + this.merService.getMerList({ merStatus: 1, pageNum: 1, pageSize: 9999}, data => { + this.merArray = data['return_data']['list']; + if (this.merArray.length > 0) { + this.searchForm.controls['merNo'].setValue(this.merArray[0]['merNo']); + this.requestData(this.pageNum, this.pageSize); + } + }); + } else if (this.roleType == 4) { + this.merArray.push(this.localStorage.get(ADMIN_INFO_OBJECT)['mer']); + this.searchForm.controls['merNo'].setValue(this.merArray[0]['merNo']); + this.requestData(this.pageNum, this.pageSize); + } } /** diff --git a/src/app/admin/trade-checking/trade-checking/trade-checking.component.html b/src/app/admin/trade-checking/trade-checking/trade-checking.component.html index aec920a..b77c567 100644 --- a/src/app/admin/trade-checking/trade-checking/trade-checking.component.html +++ b/src/app/admin/trade-checking/trade-checking/trade-checking.component.html @@ -10,7 +10,7 @@ 商户号 - + diff --git a/src/app/admin/trade-checking/trade-checking/trade-checking.component.ts b/src/app/admin/trade-checking/trade-checking/trade-checking.component.ts index 043cad2..e85b075 100644 --- a/src/app/admin/trade-checking/trade-checking/trade-checking.component.ts +++ b/src/app/admin/trade-checking/trade-checking/trade-checking.component.ts @@ -6,6 +6,8 @@ import {TradeCheckingService} from '../../../services/trade-checking.service'; import {MerService} from '../../../services/mer.service'; import differenceInCalendarDays from 'date-fns/differenceInCalendarDays'; import {environment} from '../../../../environments/environment'; +import {ADMIN_INFO_OBJECT} from '../../../services/local-storage.namespace'; +import {LocalStorageService} from '../../../services/local-storage.service'; @Component({ selector: 'app-trade-checking', templateUrl: './trade-checking.component.html', @@ -29,15 +31,20 @@ export class TradeCheckingComponent implements OnInit { settleList: [] }; currentDate = new Date(); + // 角色类型 0:超级管理员 1:公司 2:代理商 3:业务员 4:商户 5:门店 + roleType: number; constructor(private modal: NzModalService, private message: NzMessageService, private form: FormBuilder, private platformService: PlatformService, + private localStorage: LocalStorageService, private merService: MerService, private tradeCheckingService: TradeCheckingService) { } ngOnInit(): void { + this.roleType = this.localStorage.get(ADMIN_INFO_OBJECT)['secRole'].roleType; + this.currentDate.setDate(this.currentDate.getDate() - 1); this.searchForm = this.form.group({ merNo: [null], @@ -45,13 +52,19 @@ export class TradeCheckingComponent implements OnInit { settleTimeE: [ this.currentDate.getTime() ], }); - this.merService.getMerList({ merStatus: 1, pageNum: 1, pageSize: 9999}, data => { - this.merArray = data['return_data']['list']; - if (this.merArray.length > 0) { - this.searchForm.controls['merNo'].setValue(this.merArray[0]['merNo']); - this.requestData(); - } - }); + if (this.roleType == 2) { + this.merService.getMerList({ merStatus: 1, pageNum: 1, pageSize: 9999}, data => { + this.merArray = data['return_data']['list']; + if (this.merArray.length > 0) { + this.searchForm.controls['merNo'].setValue(this.merArray[0]['merNo']); + this.requestData(); + } + }); + } else if (this.roleType == 4) { + this.merArray.push(this.localStorage.get(ADMIN_INFO_OBJECT)['mer']); + this.searchForm.controls['merNo'].setValue(this.merArray[0]['merNo']); + this.requestData(); + } } /**