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