Commit c8b4d1db by 胡悦

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

1 parent 14a0f6d7
......@@ -56,6 +56,7 @@
v-validate="item.merchantId || item.merchantType ? 'required' : ''"
:data-vv-as="`子商户`"
clearable
@change="changeMerchant"
placeholder="请输入商户名称/商户号"
:remote-method="remoteChildList"
:loading="childLoading">
......@@ -75,7 +76,7 @@
:name="`item.merchantType${idx+1}`"
v-validate="item.merchantId || item.merchantType ? 'required' : ''"
:data-vv-as="`子商户类型`"
clearable
clearable
placeholder="请选择">
<gl-option
v-for="item in merchantTypeList"
......@@ -250,7 +251,22 @@ export default {
params.method = groupDetailMethods.SearchChildList
request.req(params).then(res => {
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 => {
notice.errorTips(err)
})
......@@ -258,6 +274,9 @@ export default {
this.businessChildList = []
}
},
changeMerchant(val) {
this.businessChildList = []
},
// 获取商户类型列表
getBusinessType() {
const params = {}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!