Commit eb55d8ae by 胡悦

修改分组添加父商户,有类型显示类型且不能选择

1 parent 0ee3ccac
......@@ -20,6 +20,7 @@
placeholder="请输入商户名称/商户号"
data-vv-as="商户名称/商户号"
v-validate="'required'"
@change="changeMerchant"
:remote-method="remoteList"
:loading="loading">
<gl-option
......@@ -35,8 +36,9 @@
<gl-select v-model="addForm.merchantType"
name="merchantType"
data-vv-as="商户类型"
:disabled="disabledMerchant"
v-validate="'required'"
placeholder="请搜索">
placeholder="请选择">
<gl-option
v-for="item in merchantTypeList"
:key="item.confId"
......@@ -56,7 +58,7 @@
v-validate="item.merchantId || item.merchantType ? 'required' : ''"
:data-vv-as="`子商户`"
clearable
@change="changeMerchant"
@change="changeMerchantChild"
placeholder="请输入商户名称/商户号"
:remote-method="remoteChildList"
:loading="childLoading">
......@@ -115,6 +117,7 @@ export default {
return {
tip: false, // 添加下一个子商户的提示
isAdd: false, // 添加子商户,需填写商户提示
disabledMerchant: false,
addForm: {
merchantId: '',
merchantType: ''
......@@ -137,13 +140,12 @@ export default {
this.$validator.errors.clear()
},
'addForm.merchantId'(val) {
if (!val) {
this.addForm.merchantType = ''
this.disabledMerchant = false
}
if (this.addList.length !== 0) {
this.addList.forEach(item => {
// for (var j in item) {
// if (j == 'merchantId' || j == 'merchantType') {
// item[j] = ''
// }
// }
item['merchantId'] = ''
item['merchantType'] = ''
})
......@@ -175,6 +177,7 @@ export default {
request.req(params).then(res => {
notice.okTips()
this.showAddDialog(true)
this.disabledMerchant = false
}).catch(err => {
notice.errorTips(err)
})
......@@ -277,6 +280,17 @@ export default {
}
},
changeMerchant(val) {
if (val) {
this.businessList.forEach(item => {
if (item.merchantId == val && item.merchantType !== null) {
this.addForm.merchantType = item.merchantType
this.disabledMerchant = true
}
})
this.businessList = []
}
},
changeMerchantChild(val) {
this.businessChildList = []
},
// 获取商户类型列表
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!