|
@@ -140,10 +140,11 @@
|
|
|
filterable
|
|
|
clearable
|
|
|
multiple
|
|
|
+ :filter-method="dataFilter"
|
|
|
>
|
|
|
<el-option
|
|
|
- v-for="(item, index) in siteList"
|
|
|
- :key="index"
|
|
|
+ v-for="(item) in siteList"
|
|
|
+ :key="item.channelId"
|
|
|
:label="item.name"
|
|
|
:value="item.channelId">
|
|
|
<div>
|
|
@@ -168,10 +169,11 @@
|
|
|
filterable
|
|
|
clearable
|
|
|
multiple
|
|
|
+ :filter-method="dataFilter2"
|
|
|
>
|
|
|
<el-option
|
|
|
- v-for="(item, index) in channelList"
|
|
|
- :key="index"
|
|
|
+ v-for="(item) in channelList"
|
|
|
+ :key="item.channelId"
|
|
|
:label="item.name"
|
|
|
:value="item.channelId">
|
|
|
<div>
|
|
@@ -263,8 +265,10 @@ export default {
|
|
|
},
|
|
|
// 门店列表
|
|
|
siteList: [],
|
|
|
+ siteCopyList:[],
|
|
|
// 上级渠道列表
|
|
|
channelList:[],
|
|
|
+ channelCopyList:[],
|
|
|
rules: {
|
|
|
type: [
|
|
|
{ required: true, message: "请选择盲票类型", trigger: "change" },
|
|
@@ -451,14 +455,40 @@ export default {
|
|
|
getChannelList(){
|
|
|
listAllChannel().then(response => {
|
|
|
this.channelList = response.data || [];
|
|
|
+ this.channelCopyList = response.data || [];
|
|
|
});
|
|
|
},
|
|
|
+ dataFilter2(val) {
|
|
|
+ if (val) { //val存在
|
|
|
+ this.channelList = this.channelCopyList.filter((item) => {
|
|
|
+ if (!!~item.mobile.indexOf(val) || !!~item.mobile.toUpperCase().indexOf(val.toUpperCase())
|
|
|
+ || !!~item.name.indexOf(val) || !!~item.name.indexOf(val)) {
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else { //val为空时,还原数组
|
|
|
+ this.channelList = this.channelCopyList;
|
|
|
+ }
|
|
|
+ },
|
|
|
// 获取门店下拉列表
|
|
|
getSiteList() {
|
|
|
listAllSaleSite({}).then(response => {
|
|
|
this.siteList = response.data || [];
|
|
|
+ this.siteCopyList = response.data || [];
|
|
|
});
|
|
|
},
|
|
|
+ dataFilter(val) {
|
|
|
+ if (val) { //val存在
|
|
|
+ this.siteList = this.siteCopyList.filter((item) => {
|
|
|
+ if (!!~item.mobile.indexOf(val) || !!~item.mobile.toUpperCase().indexOf(val.toUpperCase())
|
|
|
+ || !!~item.name.indexOf(val) || !!~item.name.indexOf(val)) {
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else { //val为空时,还原数组
|
|
|
+ this.siteList = this.siteCopyList;
|
|
|
+ }
|
|
|
+ },
|
|
|
|
|
|
// 保存
|
|
|
submitForm() {
|