Commit 1ca7fc7c by 胡悦

新增商户

1 parent 0433b41e
......@@ -60,9 +60,10 @@
</gl-option>
</gl-select>
<i v-show="item.show" class="el-icon-delete delete" @click="deleteBusiness(idx)"></i>
<span v-show="errorBags.has('merchantType')" class="error">{{ errorBags.first('merchantType') }}</span>
</gl-form-item>
<gl-form-item label="商户类型:">
<gl-select v-model="item.merchantType" placeholder="请选择">
<gl-select v-model="item.merchantType" clearable placeholder="请选择">
<gl-option
v-for="item in merchantTypeList"
:key="item.merchantId"
......@@ -150,6 +151,7 @@ export default {
})
},
methods: {
// 确定按钮
ok() {
this.$validator.validateAll().then((result) => {
if (result) {
......@@ -158,22 +160,30 @@ export default {
})
this.addForm.merchantRelationAdds = this.addList
this.showAddDialog()
this.addList = [{ label: '子商户1', merchant: '', merchantType: '' }]
this.addForm = { merchant: '', merchantType: '' }
}
})
},
// 显示隐藏添加商户按钮
showAddDialog() {
this.$emit('addData')
setTimeout(() => {
this.addList = [{ label: '子商户1', merchant: '', merchantType: '' }]
this.addForm = { merchant: '', merchantType: '' }
}, 400)
},
// 添加更多按钮
addMore() {
console.log(this.addList.length)
this.addList.push({
label: '子商户' + (this.addList.length + 1),
merchant: '',
merchantType: '',
show: true
})
const len = this.addList.length - 1
if (this.addList[len].merchant == '' || this.addList[len].merchantType == '') {
console.log('请填写完上一条数据')
} else {
this.addList.push({
label: '子商户' + (this.addList.length + 1),
merchant: '',
merchantType: '',
show: true
})
}
},
deleteBusiness(idx) {
console.log(idx)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!