fix bug
This commit is contained in:
@ -19,8 +19,13 @@ export class DatatableOperationtableComponent implements OnInit {
|
||||
defineDate = [];
|
||||
time: any = ['2022-01-01 00:00:00']
|
||||
dateFormat = 'yyyy-MM-dd';
|
||||
dateNext: any = null;
|
||||
modeNext = 'year';
|
||||
timeNext: any = ['2022-01-01 00:00:00']
|
||||
today = new Date();
|
||||
|
||||
enterpriseInfoId = ''
|
||||
enterpriseInfoIdPie = ''
|
||||
interManlist: any = []
|
||||
columns: STColumn[] = [
|
||||
{ title: '运营主体', index: 'networkTransporterName', className: 'text-center' },
|
||||
{ title: '订单数', index: 'zsl', className: 'text-center' },
|
||||
@ -37,12 +42,12 @@ export class DatatableOperationtableComponent implements OnInit {
|
||||
/**
|
||||
* 查询参数
|
||||
*/
|
||||
get reqParams() {
|
||||
if(this.mode === 'year') {
|
||||
get reqParams() {
|
||||
if (this.mode === 'year') {
|
||||
this.type = 1
|
||||
} else if(this.mode === 'month') {
|
||||
} else if (this.mode === 'month') {
|
||||
this.type = 2
|
||||
} else if(this.mode === 'date') {
|
||||
} else if (this.mode === 'date') {
|
||||
this.type = 3
|
||||
} else {
|
||||
this.type = 4
|
||||
@ -50,32 +55,41 @@ export class DatatableOperationtableComponent implements OnInit {
|
||||
let params: any = {
|
||||
time: this.time,
|
||||
type: this.type
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
delete params._$expand;
|
||||
return { ...params };
|
||||
}
|
||||
|
||||
constructor(public service: DataService, private datePipe: DatePipe) { }
|
||||
ngOnInit(): void { }
|
||||
ngOnInit(): void {
|
||||
this.initData()
|
||||
}
|
||||
initData() {
|
||||
this.service.getNetworkFreightForwarder().subscribe(res => {
|
||||
this.interManlist = res
|
||||
this.enterpriseInfoId = res[0].value
|
||||
this.enterpriseInfoIdPie = res[0].value
|
||||
})
|
||||
}
|
||||
|
||||
changeData(){
|
||||
if(this.mode === 'year') {
|
||||
changeData() {
|
||||
if (this.mode === 'year') {
|
||||
this.dateFormat = 'yyyy'
|
||||
} else if(this.mode === 'month') {
|
||||
} else if (this.mode === 'month') {
|
||||
this.dateFormat = 'yyyy-MM'
|
||||
} else {
|
||||
this.dateFormat = 'yyyy-MM-dd'
|
||||
}
|
||||
}
|
||||
}
|
||||
onChange(result: any) {
|
||||
if(this.mode === 'year') {
|
||||
if (this.mode === 'year') {
|
||||
this.time = [this.datePipe.transform(this.date, 'yyyy') + '-01-01 00:00:00']
|
||||
} else if(this.mode === 'month') {
|
||||
} else if (this.mode === 'month') {
|
||||
this.time = [this.datePipe.transform(this.date, 'yyyy-MM') + '-01 00:00:00']
|
||||
} else if(this.mode === 'date') {
|
||||
} else if (this.mode === 'date') {
|
||||
this.time = [this.datePipe.transform(this.date, 'yyyy-MM-dd') + ' 00:00:00']
|
||||
} else{
|
||||
} else {
|
||||
this.time = [this.datePipe.transform(this.defineDate[0], 'yyyy-MM-dd') + '00:00:00', this.datePipe.transform(this.defineDate[1], 'yyyy-MM-dd') + ' 00:00:00']
|
||||
}
|
||||
this.st.reload({ ...this.reqParams });
|
||||
@ -83,8 +97,27 @@ export class DatatableOperationtableComponent implements OnInit {
|
||||
disabledDate = (current: Date): boolean =>
|
||||
// Can not select days before today and today
|
||||
differenceInCalendarDays(current, this.today) > 0;
|
||||
exportFun(){
|
||||
exportFun() {
|
||||
|
||||
}
|
||||
changeCurve(){
|
||||
|
||||
}
|
||||
changePie(){
|
||||
|
||||
}
|
||||
changeDataNext() {
|
||||
if(this.mode === 'year') {
|
||||
this.dateFormat = 'yyyy'
|
||||
} else if(this.mode === 'month') {
|
||||
this.dateFormat = 'yyyy-MM'
|
||||
}
|
||||
}
|
||||
onChangeNext(result: any) {
|
||||
if(this.mode === 'year') {
|
||||
this.timeNext = [this.datePipe.transform(this.dateNext, 'yyyy') + '-01-01 00:00:00']
|
||||
} else if(this.mode === 'month') {
|
||||
this.timeNext = [this.datePipe.transform(this.dateNext, 'yyyy-MM') + '-01 00:00:00']
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user