提交代码

master
胡锐 1 year ago
parent 34ab01e956
commit 6e6318a7a2
  1. 2
      src/app/admin/trade-checking/trade-checking-detail/trade-checking-detail.component.html
  2. 12
      src/app/admin/trade-checking/trade-checking-detail/trade-checking-detail.component.ts
  3. 2
      src/app/admin/trade-checking/trade-checking/trade-checking.component.html
  4. 13
      src/app/admin/trade-checking/trade-checking/trade-checking.component.ts

@ -10,7 +10,7 @@
<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">
<nz-select nzAllowClear nzShowSearch formControlName="merNo" [nzDropdownMatchSelectWidth]="false"> <nz-select nzShowSearch formControlName="merNo" [nzDropdownMatchSelectWidth]="false">
<nz-option *ngFor="let item of merArray" nzLabel="({{item.merNo}}){{item.merName}}" nzValue="{{item.merNo}}"></nz-option> <nz-option *ngFor="let item of merArray" nzLabel="({{item.merNo}}){{item.merName}}" nzValue="{{item.merNo}}"></nz-option>
</nz-select> </nz-select>
</nz-form-control> </nz-form-control>

@ -6,6 +6,8 @@ import {MerService} from '../../../services/mer.service';
import {TradeCheckingService} from '../../../services/trade-checking.service'; import {TradeCheckingService} from '../../../services/trade-checking.service';
import differenceInCalendarDays from 'date-fns/differenceInCalendarDays'; import differenceInCalendarDays from 'date-fns/differenceInCalendarDays';
import {environment} from '../../../../environments/environment'; import {environment} from '../../../../environments/environment';
import {ADMIN_INFO_OBJECT} from '../../../services/local-storage.namespace';
import {LocalStorageService} from '../../../services/local-storage.service';
@Component({ @Component({
selector: 'app-trade-checking-detail', selector: 'app-trade-checking-detail',
@ -35,15 +37,19 @@ export class TradeCheckingDetailComponent implements OnInit {
}; };
dataDetailModal = false; dataDetailModal = false;
currentDate = new Date(); currentDate = new Date();
// 角色类型 0:超级管理员 1:公司 2:代理商 3:业务员 4:商户 5:门店
roleType: number;
constructor(private modal: NzModalService, constructor(private modal: NzModalService,
private message: NzMessageService, private message: NzMessageService,
private form: FormBuilder, private form: FormBuilder,
private platformService: PlatformService, private platformService: PlatformService,
private localStorage: LocalStorageService,
private merService: MerService, private merService: MerService,
private tradeCheckingService: TradeCheckingService) { private tradeCheckingService: TradeCheckingService) {
} }
ngOnInit(): void { ngOnInit(): void {
this.roleType = this.localStorage.get(ADMIN_INFO_OBJECT)['secRole'].roleType;
this.currentDate.setDate(this.currentDate.getDate() - 1); this.currentDate.setDate(this.currentDate.getDate() - 1);
this.searchForm = this.form.group({ this.searchForm = this.form.group({
merNo: [null], merNo: [null],
@ -53,6 +59,7 @@ export class TradeCheckingDetailComponent implements OnInit {
settleTimeE: [ this.currentDate.getTime() ], settleTimeE: [ this.currentDate.getTime() ],
}); });
if (this.roleType == 2) {
this.merService.getMerList({ merStatus: 1, pageNum: 1, pageSize: 9999}, data => { this.merService.getMerList({ merStatus: 1, pageNum: 1, pageSize: 9999}, data => {
this.merArray = data['return_data']['list']; this.merArray = data['return_data']['list'];
if (this.merArray.length > 0) { if (this.merArray.length > 0) {
@ -60,6 +67,11 @@ export class TradeCheckingDetailComponent implements OnInit {
this.requestData(this.pageNum, this.pageSize); 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);
}
} }
/** /**

@ -10,7 +10,7 @@
<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">
<nz-select nzAllowClear nzShowSearch formControlName="merNo" [nzDropdownMatchSelectWidth]="false"> <nz-select nzShowSearch formControlName="merNo" [nzDropdownMatchSelectWidth]="false">
<nz-option *ngFor="let item of merArray" nzLabel="({{item.merNo}}){{item.merName}}" nzValue="{{item.merNo}}"></nz-option> <nz-option *ngFor="let item of merArray" nzLabel="({{item.merNo}}){{item.merName}}" nzValue="{{item.merNo}}"></nz-option>
</nz-select> </nz-select>
</nz-form-control> </nz-form-control>

@ -6,6 +6,8 @@ import {TradeCheckingService} from '../../../services/trade-checking.service';
import {MerService} from '../../../services/mer.service'; import {MerService} from '../../../services/mer.service';
import differenceInCalendarDays from 'date-fns/differenceInCalendarDays'; import differenceInCalendarDays from 'date-fns/differenceInCalendarDays';
import {environment} from '../../../../environments/environment'; import {environment} from '../../../../environments/environment';
import {ADMIN_INFO_OBJECT} from '../../../services/local-storage.namespace';
import {LocalStorageService} from '../../../services/local-storage.service';
@Component({ @Component({
selector: 'app-trade-checking', selector: 'app-trade-checking',
templateUrl: './trade-checking.component.html', templateUrl: './trade-checking.component.html',
@ -29,15 +31,20 @@ export class TradeCheckingComponent implements OnInit {
settleList: [] settleList: []
}; };
currentDate = new Date(); currentDate = new Date();
// 角色类型 0:超级管理员 1:公司 2:代理商 3:业务员 4:商户 5:门店
roleType: number;
constructor(private modal: NzModalService, constructor(private modal: NzModalService,
private message: NzMessageService, private message: NzMessageService,
private form: FormBuilder, private form: FormBuilder,
private platformService: PlatformService, private platformService: PlatformService,
private localStorage: LocalStorageService,
private merService: MerService, private merService: MerService,
private tradeCheckingService: TradeCheckingService) { private tradeCheckingService: TradeCheckingService) {
} }
ngOnInit(): void { ngOnInit(): void {
this.roleType = this.localStorage.get(ADMIN_INFO_OBJECT)['secRole'].roleType;
this.currentDate.setDate(this.currentDate.getDate() - 1); this.currentDate.setDate(this.currentDate.getDate() - 1);
this.searchForm = this.form.group({ this.searchForm = this.form.group({
merNo: [null], merNo: [null],
@ -45,6 +52,7 @@ export class TradeCheckingComponent implements OnInit {
settleTimeE: [ this.currentDate.getTime() ], settleTimeE: [ this.currentDate.getTime() ],
}); });
if (this.roleType == 2) {
this.merService.getMerList({ merStatus: 1, pageNum: 1, pageSize: 9999}, data => { this.merService.getMerList({ merStatus: 1, pageNum: 1, pageSize: 9999}, data => {
this.merArray = data['return_data']['list']; this.merArray = data['return_data']['list'];
if (this.merArray.length > 0) { if (this.merArray.length > 0) {
@ -52,6 +60,11 @@ export class TradeCheckingComponent implements OnInit {
this.requestData(); 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();
}
} }
/** /**

Loading…
Cancel
Save