Commit 93546332 by cwq0219

远程搜索

1 parent 2d2725e8
......@@ -6,12 +6,23 @@
inline="true"
>
<el-form-item label="客户名称:">
<el-input
<el-select
v-model="searchForm.customerName"
placeholder="请输入客户名称"
:size="$store.state.d2admin.size.value"
filterable
remote
clearable
></el-input>
placeholder="请选择客户名称"
:remote-method="getUserDownList"
:size="$store.state.d2admin.size.value"
>
<el-option
v-for="(item, index) in baseData.userList"
:key="index"
:label="item"
:value="item"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="设备类型:">
<el-select
......@@ -63,12 +74,14 @@
</template>
<script>
import { deviceList, userDeviceDropList } from '@api/api'
import { deviceList, userDeviceDropList, userDropList } from '@api/api'
export default {
name: 'device',
data() {
return {
searchForm: {},
searchForm: {
customerName: ''
},
activateTime: [],
getListApi: deviceList,
tableParams: {
......@@ -113,10 +126,14 @@ export default {
}
},
watch: {
'searchForm.customerName'(newVal) {
!newVal && (this.baseData.userList = [])
}
},
mounted() {
userDeviceDropList({}).then(res => {
// console.log(res)
// this.baseData.userList = res.customerNameList
this.baseData.deviceList = res.deviceTypeList
})
},
......@@ -133,7 +150,15 @@ export default {
},
handleRest() {
this.activateTime = []
this.searchForm = {}
this.searchForm = {
customerName: ''
}
this.baseData.userList = []
},
getUserDownList(query) {
userDropList({ customerName: query }).then(res => {
this.baseData.userList = res
})
}
}
}
......
......@@ -6,12 +6,23 @@
inline="true"
>
<el-form-item label="客户名称:">
<el-input
<el-select
v-model="searchForm.customerName"
placeholder="请输入客户名称"
:size="$store.state.d2admin.size.value"
filterable
remote
clearable
></el-input>
placeholder="请选择客户名称"
:remote-method="getUserDownList"
:size="$store.state.d2admin.size.value"
>
<el-option
v-for="(item, index) in baseData.userList"
:key="index"
:label="item"
:value="item"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="注册时间:">
<el-date-picker
......@@ -54,7 +65,9 @@ export default {
name: 'user',
data() {
return {
searchForm: {},
searchForm: {
customerName: ''
},
registerTime: [],
getListApi: userList,
tableParams: {
......@@ -100,12 +113,14 @@ export default {
}
},
mounted() {
// userDropList({}).then(res => {
// this.baseData.userList = res
// })
watch: {
'searchForm.customerName'(newVal) {
!newVal && (this.baseData.userList = [])
}
},
mounted() { },
methods: {
beforeSearchFn() {
return new Promise(resolve => {
......@@ -118,7 +133,15 @@ export default {
},
handleRest() {
this.registerTime = []
this.searchForm = {}
this.searchForm = {
customerName: ''
}
this.baseData.userList = []
},
getUserDownList(query) {
userDropList({ customerName: query }).then(res => {
this.baseData.userList = res
})
}
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!