|
@@ -13,7 +13,7 @@
|
|
|
@search="querySearch"
|
|
|
>
|
|
|
<template slot="dataSource">
|
|
|
- <a-select-option v-for="email in restaurants" :key="email.weituiClient">{{email.weituiClient}}</a-select-option>
|
|
|
+ <a-select-option v-for="(item, index) in weituoClients" :key="index" :value="item.id">{{item.weituiClient}}</a-select-option>
|
|
|
</template>
|
|
|
|
|
|
|
|
@@ -97,7 +97,8 @@ export default {
|
|
|
components: {},
|
|
|
data() {
|
|
|
return {
|
|
|
- restaurants: [],
|
|
|
+ restaurants: [], // 获取的所有客户信息
|
|
|
+ weituoClients: [], // 搜索用的客户下拉列表
|
|
|
model: {},
|
|
|
labelCol: {
|
|
|
xs: { span: 24 },
|
|
@@ -154,6 +155,7 @@ export default {
|
|
|
getAction('/ItdmWtkehu/itdmWtkehu/olist', {}).then((res) => {
|
|
|
if (res.success) {
|
|
|
this.restaurants = res.result
|
|
|
+ this.weituoClients = res.result
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -162,22 +164,24 @@ export default {
|
|
|
var restaurants = this.restaurants
|
|
|
var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants
|
|
|
console.log(queryString, results)
|
|
|
- // 调用 callback 返回建议列表的数据
|
|
|
-
|
|
|
- this.restaurants=results
|
|
|
+
|
|
|
+ this.weituoClients = results
|
|
|
},
|
|
|
createFilter(queryString) {
|
|
|
return (restaurant) => {
|
|
|
- return (restaurant.weituiClient.toLowerCase().indexOf(queryString.toLowerCase()) === 0)
|
|
|
+ return (restaurant.weituiClient.toLowerCase().indexOf(queryString.toLowerCase()) !== -1)
|
|
|
}
|
|
|
},
|
|
|
// 选择委托单位
|
|
|
handleSelect(item) {
|
|
|
- var v = this.restaurants.filter(i => i.weituiClient === item)[0]
|
|
|
- this.model.weituoAddress = v.weituiAddress
|
|
|
- this.model.weituoEmail = v.weituiEmail
|
|
|
- this.model.weituoLxr = v.weituiLxr
|
|
|
- this.model.weituoPhone = v.weituiPhone
|
|
|
+ var v = this.restaurants.find(i => i.id === item)
|
|
|
+ // var v = this.restaurants.find(i => i.weituiClient === item)
|
|
|
+ if(v){
|
|
|
+ this.model.weituoAddress = v.weituiAddress
|
|
|
+ this.model.weituoEmail = v.weituiEmail
|
|
|
+ this.model.weituoLxr = v.weituiLxr
|
|
|
+ this.model.weituoPhone = v.weituiPhone
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
init() {
|