Commit c8b4d1db by 胡悦

修改商户分组新增子商户去重

1 parent 14a0f6d7
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
v-validate="item.merchantId || item.merchantType ? 'required' : ''" v-validate="item.merchantId || item.merchantType ? 'required' : ''"
:data-vv-as="`子商户`" :data-vv-as="`子商户`"
clearable clearable
@change="changeMerchant"
placeholder="请输入商户名称/商户号" placeholder="请输入商户名称/商户号"
:remote-method="remoteChildList" :remote-method="remoteChildList"
:loading="childLoading"> :loading="childLoading">
...@@ -250,7 +251,22 @@ export default { ...@@ -250,7 +251,22 @@ export default {
params.method = groupDetailMethods.SearchChildList params.method = groupDetailMethods.SearchChildList
request.req(params).then(res => { request.req(params).then(res => {
this.childLoading = false this.childLoading = false
this.businessChildList = res.merchantParams let arr = res.merchantParams
let index = []
let list = []
if (!res.merchantParams || !res.merchantParams.length) {
this.businessChildList = []
return
}
for(var i of res.merchantParams) {
for(var j of this.addList) {
if (i.merchantId === j.merchantId) {
index.push(i.merchantId)
}
}
}
list = arr.filter(item => !index.includes(item.merchantId))
this.businessChildList = index.length ? list : arr
}).catch(err => { }).catch(err => {
notice.errorTips(err) notice.errorTips(err)
}) })
...@@ -258,6 +274,9 @@ export default { ...@@ -258,6 +274,9 @@ export default {
this.businessChildList = [] this.businessChildList = []
} }
}, },
changeMerchant(val) {
this.businessChildList = []
},
// 获取商户类型列表 // 获取商户类型列表
getBusinessType() { getBusinessType() {
const params = {} const params = {}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!