季度计划增加查询年份操作
This commit is contained in:
@@ -59,6 +59,10 @@
|
||||
<option *ngFor="let item of flightTypes" [value]="item.flightTypeCode">{{item.flightTypeNameCn}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="input-container mr-4">
|
||||
<label for="startDate">查询年份: </label>
|
||||
<input readonly type="text" id="startDate" class="form-control" style="background:transparent;cursor: pointer">
|
||||
</div>
|
||||
<div class="input-container mr-4">
|
||||
<label for="arriOrDept">到达/出发: </label>
|
||||
<select class="form-control" [(ngModel)]="filterItems.arriOrDept" (ngModelChange)="selectChange()">
|
||||
|
||||
@@ -5,6 +5,8 @@ import { ChangeDetectorRef } from '@angular/core';
|
||||
import { ToastService } from '../../components/toast/toast.service';
|
||||
import { ToastConfig, ToastType } from '../../components/toast/toast-model';
|
||||
import * as $ from 'jquery';
|
||||
import { format } from 'util';
|
||||
declare var laydate: any;
|
||||
@Component({
|
||||
selector: 'app-seasonal-plan',
|
||||
templateUrl: './seasonal-plan.component.html',
|
||||
@@ -68,20 +70,14 @@ export class SeasonalPlanComponent implements OnInit {
|
||||
public render_data: Array<object> = []; //显示数据,即需要显示的数据
|
||||
public return_data: Array<object> = []; //下拉框显示数据
|
||||
ngOnInit() {
|
||||
this.laydateYear();
|
||||
/* 获取季度计划信息 */
|
||||
this.httpCilent.get('/adminapi/schedule/flightSchdSeasons').subscribe(
|
||||
var value = new Date(new Date().getTime());
|
||||
var subValue = format(value).substring(11,15); //时间截取到年份
|
||||
this.httpCilent.get('/adminapi/schedule/flightSchdSeasons',{startDate: subValue}).subscribe(
|
||||
data => {
|
||||
this.seasonals = data.body;
|
||||
this.render_data = this.seasonals;
|
||||
if(this.airlines && this.airlines.length > 0){//航空公司列表数据转换
|
||||
this.basicDataTransHandle();
|
||||
}
|
||||
if(this.aircraftTypes && this.aircraftTypes.length > 0){//机型列表数据转换
|
||||
this.aircraftTypesHandle();
|
||||
}
|
||||
if(this.flightTypes && this.flightTypes.length > 0){//航班类别列表数据转换
|
||||
this.flightTypesHandle();
|
||||
}
|
||||
this.render_data.forEach(element => {//航线类别列表显示数据转换
|
||||
if (element['routeType'] == 'D') {
|
||||
element['routeType'] = '国内'
|
||||
@@ -117,6 +113,9 @@ export class SeasonalPlanComponent implements OnInit {
|
||||
this.basicDataService.airline_subject.subscribe(
|
||||
data=>{
|
||||
this.airlines = data;
|
||||
if(this.airlines && this.airlines.length > 0){//航空公司列表数据转换
|
||||
this.irlinesHandle();
|
||||
}
|
||||
}
|
||||
)
|
||||
//机型
|
||||
@@ -124,6 +123,9 @@ export class SeasonalPlanComponent implements OnInit {
|
||||
this.basicDataService.aircraft_type_subject.subscribe(
|
||||
data => {
|
||||
this.aircraftTypes = data;
|
||||
if(this.aircraftTypes && this.aircraftTypes.length > 0){//机型列表数据转换
|
||||
this.aircraftTypesHandle();
|
||||
}
|
||||
}
|
||||
)
|
||||
//航班类别
|
||||
@@ -131,6 +133,9 @@ export class SeasonalPlanComponent implements OnInit {
|
||||
this.basicDataService.flightTypes_subject.subscribe(
|
||||
data=> {
|
||||
this.flightTypes = data;
|
||||
if(this.flightTypes && this.flightTypes.length > 0){//航班类别列表数据转换
|
||||
this.flightTypesHandle();
|
||||
}
|
||||
}
|
||||
)
|
||||
/**
|
||||
@@ -144,7 +149,7 @@ export class SeasonalPlanComponent implements OnInit {
|
||||
tableCont.addEventListener('scroll',scrollHandle);
|
||||
}
|
||||
//航空公司名称数据转换处理
|
||||
basicDataTransHandle() {
|
||||
irlinesHandle() {
|
||||
this.render_data.forEach(item => {
|
||||
let airlineLinkIndex = this.airlines.findIndex(val => val.airlineId === item['airlineId']);
|
||||
if(this.airlines[airlineLinkIndex]){
|
||||
@@ -173,6 +178,82 @@ export class SeasonalPlanComponent implements OnInit {
|
||||
})
|
||||
}
|
||||
|
||||
//选择年份
|
||||
laydateYear(){
|
||||
laydate.render({
|
||||
elem: '#startDate',
|
||||
showBottom: true,
|
||||
value: new Date(new Date().getTime()),
|
||||
type: 'year',
|
||||
// format: 'yyyy',
|
||||
done: (value) => {
|
||||
this.httpCilent.get('/adminapi/schedule/flightSchdSeasons', { startDate: value }).subscribe(
|
||||
data => {
|
||||
this.seasonals = data.body;
|
||||
this.render_data = this.seasonals;
|
||||
if(this.airlines && this.airlines.length > 0){//航空公司列表数据转换
|
||||
this.irlinesHandle();
|
||||
}
|
||||
if(this.aircraftTypes && this.aircraftTypes.length > 0){//机型列表数据转换
|
||||
this.aircraftTypesHandle();
|
||||
}
|
||||
if(this.flightTypes && this.flightTypes.length > 0){//航班类别列表数据转换
|
||||
this.flightTypesHandle();
|
||||
}
|
||||
this.render_data.forEach(element => {//航线类别列表显示数据转换
|
||||
if (element['routeType'] == 'D') {
|
||||
element['routeType'] = '国内'
|
||||
return element['routeType'];
|
||||
}
|
||||
if(element['routeType'] == 'I'){
|
||||
element['routeType'] = '国际'
|
||||
return element['routeType'];
|
||||
}
|
||||
if(element['routeType'] == 'M'){
|
||||
element['routeType'] = '混合'
|
||||
return element['routeType'];
|
||||
}
|
||||
if(element['routeType'] = 'R'){
|
||||
element['routeType'] = '地区'
|
||||
return element['routeType'];
|
||||
}
|
||||
});
|
||||
this.render_data.forEach(item => {//到达/出发列表显示数据转换
|
||||
if(item['arriOrDept'] == 'A'){
|
||||
item['arriOrDept'] = '到达'
|
||||
return item['arriOrDept']
|
||||
}
|
||||
if(item['arriOrDept'] == 'D'){
|
||||
item['arriOrDept'] = '出发'
|
||||
return item['arriOrDept']
|
||||
}
|
||||
});
|
||||
})
|
||||
//航空公司
|
||||
this.airlines = this.basicDataService.airline;
|
||||
this.basicDataService.airline_subject.subscribe(
|
||||
data=>{
|
||||
this.airlines = data;
|
||||
}
|
||||
)
|
||||
//机型
|
||||
this.aircraftTypes = this.basicDataService.aircraft_type;
|
||||
this.basicDataService.aircraft_type_subject.subscribe(
|
||||
data => {
|
||||
this.aircraftTypes = data;
|
||||
}
|
||||
)
|
||||
//航班类别
|
||||
this.flightTypes = this.basicDataService.flightTypes;
|
||||
this.basicDataService.flightTypes_subject.subscribe(
|
||||
data=> {
|
||||
this.flightTypes = data;
|
||||
}
|
||||
)
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 复选框勾选事件
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user