查询条件

This commit is contained in:
liushuai
2018-11-19 09:50:08 +08:00
parent 613cacecb0
commit 305186058e
7 changed files with 12 additions and 50 deletions

View File

@@ -4,13 +4,11 @@
<span>项目名称:</span>
<el-select
v-model="entryNameValue"
:remote-method="remoteMethod"
placeholder="项目名称"
style="width:200px"
size="small"
clearable
filterable
remote
@change="empty">
<el-option
v-for="item in entryName"
@@ -242,7 +240,6 @@ export default {
title: '',
dialogFormVisible2: false,
dialogFormVisible3: false,
List: [],
check: null,
check1: null,
check2: null,
@@ -293,8 +290,6 @@ export default {
}
},
created() {
},
mounted() {
this.getList()
},
methods: {
@@ -350,30 +345,15 @@ export default {
}
},
getList() { // 初始化项目名称
this.list = []
initProject().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.list.push({
this.entryName.push({
label: response.data[i].项目名称,
value: response.data[i].项目流水号
})
}
})
},
remoteMethod(query) {
if (query !== '') {
setTimeout(() => {
this.entryName = this.list.filter(item => {
if (item.label !== null) {
return item.label.toLowerCase()
.indexOf(query.toLowerCase()) > -1
}
})
}, 1000)
} else {
this.entryName = []
}
},
empty() {
this.machineToolNumber = ''
this.groupNumber = ''

View File

@@ -5,13 +5,11 @@
<span>项目名称:</span>
<el-select
v-model="entryNameValue"
:remote-method="remoteMethod"
placeholder="项目名称"
style="width:200px"
size="small"
clearable
filterable
remote
@change="empty">
<el-option
v-for="item in entryName"
@@ -306,8 +304,6 @@ export default {
},
created() {
this.fetchData()
},
mounted() {
this.getList()
},
methods: {
@@ -367,28 +363,15 @@ export default {
})
},
getList() { // 初始化项目名称
this.list = []
initProject().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.list.push({
this.entryName.push({
label: response.data[i].项目名称,
value: response.data[i].项目流水号
})
}
})
},
remoteMethod(query) {
if (query !== '') {
setTimeout(() => {
this.entryName = this.list.filter(item => {
return item.label.toLowerCase()
.indexOf(query.toLowerCase()) > -1
})
}, 1000)
} else {
this.entryName = []
}
},
empty() {
this.machineToolNumber = ''
this.groupNumber = ''