This commit is contained in:
bryan sun
2020-01-07 12:54:34 +08:00
parent 4a275f7912
commit fd02edb41c
5 changed files with 80 additions and 10 deletions

View File

@@ -0,0 +1,60 @@
<template>
<div class="app-container">
<el-card>
<span>项目名称</span>
<el-select v-model="projectValue" filterable clearable size="small" style="margin-top:10px;width: 220px" placeholder="项目名称" @change="typeChange()">
<el-option
v-for="item in project"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span>机床名称</span>
<el-select v-model="machineValue" clearable filterable size="small" style="margin-bottom:10px;width: 220px" placeholder="机床名称">
<el-option
v-for="item in machine"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-card>
</div>
</template>
<script>
import { initProject, initMachine } from '@/api/ManufacturingCenter/ProjectPlanningQuery'
export default {
data() {
return {
project: [],
projectValue: '', // 项目名称
machineValue: '', // 机床名称
machine: []
}
},
created() {
this.fetchData()
},
methods: {
fetchData() {
this.getSelect(initProject, ['项目名称', '项目流水号'], 'project')
},
typeChange() {
this.machineValue = ''
this.machine = []
initMachine(this.projectValue).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.machine.push({
label: response.data[i].机床图号,
value: response.data[i].机床流水号
})
}
})
}
}
}
</script>
<style scoped>
</style>