值机柜台优化
This commit is contained in:
@@ -20,9 +20,17 @@ SEARCH = ''; //手动输入条件
|
||||
FLT_POS = 1; //过滤还是定位
|
||||
SEL_COL = ''; //选择列名
|
||||
|
||||
//下拉框
|
||||
public filterItems = {
|
||||
terminalAreaCode:'',
|
||||
checkinGroupCode:'',
|
||||
chutCode:'',
|
||||
}
|
||||
|
||||
checkinDesks : Array<any>;
|
||||
public row_state: any = { renderFlight: {} };
|
||||
public render_data: Array<object> = []; //显示数据,即需要显示的数据
|
||||
public return_data: Array<object> = []; //下拉框显示数据
|
||||
ngOnInit() {
|
||||
this.checkinDesks = this.basicDataService.checkin_desk;
|
||||
this.basicDataService.checkin_desk_subject.subscribe(
|
||||
@@ -42,114 +50,38 @@ ngOnInit() {
|
||||
tableCont.addEventListener('scroll',scrollHandle);
|
||||
}
|
||||
|
||||
//刷新
|
||||
clearFiter(){
|
||||
$("#inputerInfo").val(""); //清空过滤或查找定位文本框
|
||||
$("#qy").val(""); //清空所属航站楼区域
|
||||
$("#zjd").val(""); //清空值机岛
|
||||
$("#xl").val(""); //清空行李传送带
|
||||
this.ngOnInit();
|
||||
}
|
||||
//输入框回车事件
|
||||
inputEnter() {
|
||||
if (this.FLT_POS === 1) {
|
||||
this.selectChange()
|
||||
} else {
|
||||
this.selectChange()
|
||||
this.inputPosition(this.render_data)
|
||||
}
|
||||
if (this.FLT_POS === 1) {
|
||||
this.inputFilter(this.checkinDesks)
|
||||
} else {
|
||||
this.inputFilter(this.checkinDesks)
|
||||
this.inputPosition(this.checkinDesks)
|
||||
}
|
||||
}
|
||||
|
||||
//下拉框选择筛选
|
||||
selectChange() {
|
||||
let filter_data = [];
|
||||
let filtercheckinDesks = this.render_data;
|
||||
this.render_data.forEach(item => {
|
||||
filter_data.push(Object.assign({}, item));
|
||||
})
|
||||
if (this.FLT_POS === 1) {
|
||||
this.inputFilter(filter_data);
|
||||
} else {
|
||||
this.checkinDesks = filter_data;
|
||||
this.row_state = this.checkinDesks.length > 0 ? this.checkinDesks[0] : { renderFlight: {} };
|
||||
}
|
||||
//下拉框筛选
|
||||
filter_data = filter_data.filter(item => {
|
||||
if (item) {
|
||||
this.return_data = this.checkinDesks.filter(item=>{
|
||||
let is_satis = true;
|
||||
for (const key in filtercheckinDesks) {
|
||||
if (filtercheckinDesks.hasOwnProperty(key) && filtercheckinDesks[key]) {
|
||||
if (item[key] === filtercheckinDesks[key]) {
|
||||
for (const key in this.filterItems) {
|
||||
if (this.filterItems.hasOwnProperty(key) && this.filterItems[key]) {
|
||||
if (item[key] === this.filterItems[key]) {
|
||||
is_satis = true;
|
||||
continue;
|
||||
} else {
|
||||
is_satis = false;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return is_satis;
|
||||
} else if (item) {
|
||||
let is_satis = true;
|
||||
for (const key in filtercheckinDesks) {
|
||||
if (filtercheckinDesks.hasOwnProperty(key) && filtercheckinDesks[key]) {
|
||||
if (item[key] === filtercheckinDesks[key]) {
|
||||
is_satis = true;
|
||||
continue;
|
||||
} else {
|
||||
is_satis = false;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return is_satis;
|
||||
} else {
|
||||
let pre_satis = true;
|
||||
let rea_satis = true;
|
||||
for (const key in filtercheckinDesks) {
|
||||
if (filtercheckinDesks.hasOwnProperty(key) && filtercheckinDesks[key]) {
|
||||
if (item[key] === filtercheckinDesks[key]) {
|
||||
pre_satis = true;
|
||||
continue;
|
||||
} else {
|
||||
pre_satis = false;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
for (const key in filtercheckinDesks) {
|
||||
if (filtercheckinDesks.hasOwnProperty(key) && filtercheckinDesks[key]) {
|
||||
if (item[key] === filtercheckinDesks[key]) {
|
||||
rea_satis = true;
|
||||
continue;
|
||||
} else {
|
||||
rea_satis = false;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (pre_satis && !rea_satis) {
|
||||
item = item;
|
||||
return pre_satis;
|
||||
} else if (!pre_satis && rea_satis) {
|
||||
item = item;
|
||||
return rea_satis;
|
||||
} else if (pre_satis && rea_satis) {
|
||||
return pre_satis && rea_satis;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
this.render_data = this.return_data;
|
||||
}
|
||||
|
||||
//输入框筛选
|
||||
inputFilter(filterData) {
|
||||
//输入框筛选
|
||||
inputFilter(filterData) {
|
||||
if (this.SEARCH) {
|
||||
if (this.SEL_COL) {
|
||||
let sel_col = this.SEL_COL;
|
||||
@@ -197,14 +129,14 @@ selectChange() {
|
||||
})
|
||||
}
|
||||
}
|
||||
this.checkinDesks = filterData;
|
||||
this.row_state = this.checkinDesks.length > 0 ? this.checkinDesks[0] : { renderFlight: {} };
|
||||
}
|
||||
this.render_data = filterData;
|
||||
this.row_state = this.render_data.length > 0 ? this.render_data[0] : { renderFlight: {} };
|
||||
}
|
||||
|
||||
positionArray: Array<any> = [];
|
||||
positionArrayIndex: number = 0;
|
||||
//输入框定位
|
||||
inputPosition(filterData) {
|
||||
positionArray: Array<any> = [];
|
||||
positionArrayIndex: number = 0;
|
||||
//输入框定位
|
||||
inputPosition(filterData) {
|
||||
let transArray = []
|
||||
if (this.SEL_COL) {
|
||||
let sel_col = this.SEL_COL;
|
||||
|
||||
Reference in New Issue
Block a user