创建运行图 出库数据,环路数据,进库数据页面操作时,过滤显示的问题
This commit is contained in:
parent
1cc4cebb27
commit
d5d9b91cb4
@ -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)})"
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user