创建运行图 出库数据,环路数据,进库数据页面操作时,过滤显示的问题

This commit is contained in:
ival 2021-03-15 17:31:47 +08:00
parent 1cc4cebb27
commit d5d9b91cb4
2 changed files with 117 additions and 25 deletions

View File

@ -198,6 +198,7 @@
<el-select
v-model="formModel[item.prop]"
filterable
:clearable="!!item.clearable"
:placeholder="item.placeholder"
:no-data-text="item.noDataText?item.noDataText:'无数据'"
:disabled="item.disabled"
@ -217,7 +218,7 @@
v-model="formModel[item.prop]"
filterable
:no-data-text="item.noDataText?item.noDataText:'无数据'"
:clearable="item.clearable"
:clearable="!!item.clearable"
:placeholder="item.placeholder"
:disabled="item.disabled"
@change="((val)=>{deviceChange(val, item)})"

View File

@ -110,11 +110,11 @@ export default {
{ prop: 'overTime', label: '结束时间', type: 'timePicker', selectableRange:'02:00:00-23:59:59'},
{ prop: 'runLevel', label: '运行等级', type: 'select', options: this.runLevelList },
{ prop: 'departureInterval', label: '发车间隔', type: 'number', show:this.formModel.gernarateType == '02', min:0, step:1, precisionFlag:true, precision:0, message:'s'},
{ prop: 'outboundRouting', label: '出库交路', type: 'select', options: this.outboundRouteList, change:true, onChange: this.outboundRouteChange, noDataText:'请先设置交路'},
{ prop: 'outboundRouting', label: '出库交路', type: 'select', options: this.outboundRouteList, clearable: true, change:true, onChange: this.onOutboundRouteChange, noDataText:'请先设置交路'},
{ prop: 'runningRouting1', label: '环路交路1', type: 'select', show:false},
{ prop: 'runningRouting2', label: '环路交路2', type: 'select', show:false},
{prop:'runningRouting', label:'环路', type: 'select', options: this.runningRouteList, noDataText:'请先设置交路', change:true, onChange:this.runningRouteChange},
{ prop: 'inboundRouting', label: '入库交路', type: 'select', options: this.inboundRouteList, noDataText:'请先设置交路'}
{ prop: 'runningRouting', label:'环路', type: 'select', options: this.runningRouteList, noDataText:'请先设置交路', clearable: true, change:true, onChange:this.onRunningRouteChange},
{ prop: 'inboundRouting', label: '入库交路', type: 'select', options: this.inboundRouteList, noDataText:'请先设置交路', clearable: true, change:true, onChange:this.onInboundRouteChange}
]
};
}
@ -159,11 +159,12 @@ export default {
}
});
this.runningRoutingMap = runningRoutingMap;
this.outboundRouteList = this.covertRouting(this.routingList, route => {
return route.routingType == 'OUTBOUND'
})
this.onOutboundRouteChange();
this.onRunningRouteChange();
this.onInboundRouteChange();
this.dataLoading = false;
}).catch(_ => {
console.log(_)
this.dataLoading = false;
this.$messageBox(`获取交路列表失败`);
});
@ -206,33 +207,123 @@ export default {
}
}
},
outboundRouteChange(outboundRouting) {
const outboundRoute = this.routingList.find(route => route.value == outboundRouting);
this.formModel.runningRouting = '';
this.formModel.runningRouting1 = '';
this.formModel.runningRouting2 = '';
this.formModel.inboundRouting = '';
this.inboundRouteList = [];
this.runningRouteList = this.covertRouting(Object.values(this.runningRoutingMap), route => {
return route.runningRouting1 && route.runningRouting2 && outboundRoute.endSectionCode == route.startSectionCode
})
onOutboundRouteChange(outboundRouting='') {
if (this.formModel.runningRouting || outboundRouting) {
//
const outboundRoute = this.routingList.find(route => route.value == outboundRouting);
const inboundRoute = this.routingList.find(route => route.value == this.formModel.inboundRouting);
this.runningRouteList = this.covertRouting(Object.values(this.runningRoutingMap), route => {
return route.runningRouting1 && route.runningRouting2 && (
!inboundRoute && outboundRoute && outboundRoute.endSectionCode == route.startSectionCode ||
inboundRoute && !outboundRoute && inboundRoute.startSectionCode == route.endSectionCode ||
inboundRoute && outboundRoute && outboundRoute.endSectionCode == route.startSectionCode && inboundRoute.startSectionCode == route.endSectionCode
)
})
//
if (!this.runningRouteList.find(route => route.value == this.formModel.runningRouting)) {
this.formModel.runningRouting = '';
this.formModel.runningRouting1 = '';
this.formModel.runningRouting2 = '';
}
} else {
//
this.outboundRouteList = this.covertRouting(this.routingList, route => {
return route.routingType == 'OUTBOUND'
})
//
if (!this.formModel.outboundRouting && !this.formModel.inboundRouting) {
this.runningRouteList = Object.values(this.runningRoutingMap).filter(route => route.runningRouting1 && route.runningRouting2)
}
}
this.$nextTick(_ => {
this.$refs.dataform && this.$refs.dataform.clearValidate();
});
},
runningRouteChange(runningRouting) {
const temp = this.runningRoutingMap[runningRouting];
onRunningRouteChange(runningRouting='') {
const temp = this.runningRoutingMap[runningRouting];
if (temp) {
this.formModel.runningRouting1 = temp.runningRouting1;
this.formModel.runningRouting2 = temp.runningRouting2;
}
const runningRoute = Object.values(this.runningRoutingMap).find(route => route.value == runningRouting);
this.formModel.runningRouting1 = temp.runningRouting1;
this.formModel.runningRouting2 = temp.runningRouting2;
this.formModel.inboundRouting = '';
this.inboundRouteList = this.covertRouting(this.routingList, route => {
return route.routingType == 'INBOUND' && runningRoute.endSectionCode == route.startSectionCode
})
if (this.formModel.runningRouting) {
this.outboundRouteList = this.covertRouting(this.routingList, route => {
return route.routingType == 'OUTBOUND' && runningRoute && runningRoute.startSectionCode == route.endSectionCode
})
if (!this.outboundRouteList.find(route => route.value == this.formModel.outboundRouting)) {
this.formModel.outboundRouting = '';
}
this.inboundRouteList = this.covertRouting(this.routingList, route => {
return route.routingType == 'INBOUND' && runningRoute && runningRoute.endSectionCode == route.startSectionCode
})
if (!this.inboundRouteList.find(route => route.value == this.formModel.inboundRouting)) {
this.formModel.inboundRouting = '';
}
} else {
this.outboundRouteList = this.covertRouting(this.routingList, route => {
return route.routingType == 'OUTBOUND'
})
const outboundRoute = this.routingList.find(route => route.value == this.formModel.outboundRouting);
const inboundRoute = this.routingList.find(route => route.value == this.formModel.inboundRouting);
this.runningRouteList = Object.values(this.runningRoutingMap).filter(route => route.runningRouting1 && route.runningRouting2 && (
!inboundRoute && outboundRoute && outboundRoute.endSectionCode == route.startSectionCode ||
inboundRoute && !outboundRoute && inboundRoute.startSectionCode == route.endSectionCode ||
inboundRoute && outboundRoute && outboundRoute.endSectionCode == route.startSectionCode && inboundRoute.startSectionCode == route.endSectionCode ||
!inboundRoute && !outboundRoute
))
this.inboundRouteList = this.covertRouting(this.routingList, route => {
return route.routingType == 'INBOUND';
})
}
this.$nextTick(_ => {
this.$refs.dataform && this.$refs.dataform.clearValidate();
})
},
onInboundRouteChange(inboundRouting='') {
if (this.formModel.runningRouting || inboundRouting) {
//
const outboundRoute = this.routingList.find(route => route.value == this.formModel.outboundRouting);
const inboundRoute = this.routingList.find(route => route.value == inboundRouting);
this.runningRouteList = this.covertRouting(Object.values(this.runningRoutingMap), route => {
return route.runningRouting1 && route.runningRouting2 && (
inboundRoute && !outboundRoute && inboundRoute.startSectionCode == route.endSectionCode ||
!inboundRoute && outboundRoute && outboundRoute.endSectionCode == route.startSectionCode ||
inboundRoute && outboundRoute && inboundRoute.startSectionCode == route.endSectionCode && outboundRoute.endSectionCode == route.startSectionCode
)
})
//
if (!this.runningRouteList.find(route => route.value == this.formModel.runningRouting)) {
this.formModel.runningRouting = '';
this.formModel.runningRouting1 = '';
this.formModel.runningRouting2 = '';
}
} else {
//
this.inboundRouteList = this.covertRouting(this.routingList, route => {
return route.routingType == 'INBOUND';
})
//
if (!this.formModel.outboundRouting && !this.formModel.inboundRouting) {
this.runningRouteList = Object.values(this.runningRoutingMap).filter(route => route.runningRouting1 && route.runningRouting2)
}
}
this.$nextTick(_ => {
this.$refs.dataform && this.$refs.dataform.clearValidate();
})
},
doClose() {
this.loading = false;
this.$refs.dataform.resetForm();