Commit 9a837160 by 胡悦

修复bug

1 parent a6f130c9
......@@ -301,6 +301,7 @@ export default {
this.hasLocation = false
this.$root.eventBus.$on('params', (params) => {
this.activeName = 'first'
this.isVisible = false
this.merchantId = params.merchantId
// 标记merchantId改变
this.IdChange = [1, 1, 1]
......
......@@ -34,7 +34,8 @@
ref="addParams"
label-width="120px">
<gl-form-item label="分组名称:" prop="groupName">
<gl-input name="groupName" placeholder="请输入名称" v-model="addParams.groupName"></gl-input>
<gl-input name="groupName" placeholder="请输入名称" data-vv-as="分组名称" v-validate="'required|max: 64'" v-model="addParams.groupName"></gl-input>
<span v-show="errorBags.has('groupName')" class="error">{{ errorBags.first('groupName') }}</span>
</gl-form-item>
<gl-form-item label="业务类型:" prop="businessCode">
<gl-select
......@@ -50,6 +51,7 @@
:value="item.confId">
</gl-option>
</gl-select>
<span v-show="errorBags.has('businessCode')" class="error">{{ errorBags.first('businessCode') }}</span>
</gl-form-item>
</gl-form>
<div slot="footer" class="dialog-footer">
......@@ -69,9 +71,7 @@ export default {
},
watch: {
dialogVisible(val) {
if (!val) {
this.$refs['addParams'].resetFields()
}
this.$validator.errors.clear()
}
},
data() {
......@@ -83,11 +83,10 @@ export default {
},
rules: {
groupName: [
{ required: true, message: '请输入分组名称', trigger: 'blur' },
{ max: 64, message: '长度最多64个字符', trigger: 'blur' }
{ required: true }
],
businessCode: [
{ required: true, message: '请选择业务类型', trigger: 'change' }
{ required: true }
]
},
businessList: [],
......@@ -210,8 +209,9 @@ export default {
},
// 新增分组
handleSubmit(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
// this.$refs[formName].validate((valid) => {
this.$validator.validateAll().then((result) => {
if (result) {
this.createGroup(this.addParams)
} else {
return false
......
......@@ -78,6 +78,7 @@
:name="`item.merchantType${idx+1}`"
v-validate="item.merchantId || item.merchantType ? 'required' : ''"
:data-vv-as="`子商户类型`"
:disabled="item.disabledMerchantChild"
clearable
placeholder="请选择">
<gl-option
......@@ -138,6 +139,12 @@ export default {
watch: {
addDialogVisible(val) {
this.$validator.errors.clear()
if (!val) {
setTimeout(() => {
this.addList = []
this.addForm = { merchantId: '', merchantType: '' }
}, 400)
}
},
'addForm.merchantId'(val) {
if (!val) {
......@@ -187,10 +194,7 @@ export default {
// 显示隐藏添加商户按钮
showAddDialog(t) {
this.$emit('addData', t)
setTimeout(() => {
this.addList = []
this.addForm = { merchantId: '', merchantType: '' }
}, 400)
},
// 添加更多按钮
addMore() {
......@@ -201,7 +205,8 @@ export default {
label: '子商户' + (this.addList.length + 1),
merchantId: '',
merchantType: '',
show: true
show: true,
disabledMerchantChild: false
})
} else {
const len = this.addList.length - 1
......@@ -269,7 +274,6 @@ export default {
// }
// list = arr.filter(item => !index.includes(item.merchantId))
list = [...arr].filter(item => [...this.addList].every(obj => obj.merchantId !== item.merchantId))
console.log(list)
// this.businessChildList = index.length ? list : arr
this.businessChildList = list
}).catch(err => {
......@@ -291,6 +295,19 @@ export default {
}
},
changeMerchantChild(val) {
if (val) {
this.businessChildList.forEach(i => {
let index = ''
if (i.merchantId == val && i.merchantType !== null) {
this.addList.forEach((v, j) => {
v.merchantId === val
index = j
})
this.addList[index].merchantType = i.merchantType
this.addList[index].disabledMerchantChild = true
}
})
}
this.businessChildList = []
},
// 获取商户类型列表
......
......@@ -210,6 +210,8 @@ export default {
this.$root.eventBus.$on('params', (params) => {
this.groupId = params.groupId
this.getList()
this.addDialogVisible = false
this.dialogVisible_search = false
// this.searchParams.groupId = params.groupId
})
// this.loadingGetList()
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!