Commit 79898242 by cwq0219
2 parents de0dc4fe 834357bd
const path = 'glsx.accounts.admin.merchant.'
const methods = {
Create: `${path}group.relation.create`, // 分组新增商户
Search: `${path}group.search`,
MerchantType: `${path}dict.type`
MerchantType: `${path}dict.type`,
SearchChildList: `${path}group.search.param`, // 子商户根据商户号或者商户名搜索商户列表
SearchList: `${path}group.search.parampar` // 父商户根据商户号或者商户名搜索商户列表
}
export {
methods
......
// 业务管理
const path = 'glsx.accounts.admin.merchant.dict.'
const methods = {
Business: `${path}business`,
Create: `${path}business.create`,
Channel: `${path}channel`,
Type: `${path}type`
Business: `${path}business`, // 业务列表
Create: `${path}business.create`, // 新增业务
Channel: `${path}channel`, // 获取渠道列表
Type: `${path}type` // 获取商户类型列表
}
export {
methods
......
<template>
<div class="group">
<div class="default">
<gl-form
:inline="true"
:model="searchCondition"
>
<!-- <gl-form-item>
<gl-input
v-model="searchCondition.brand"
class="input-with-select"
placeholder="请输入品牌"
clearable
/>
</gl-form-item>
<gl-form-item>
<gl-button
type="primary"
@click="getList"
>搜索</gl-button>
</gl-form-item> -->
<gl-form-item style="float:right;">
<div class="m-b10">
<gl-button
class="newButton"
type="primary"
@click="dialog"
>新增分组</gl-button>
</gl-form-item>
</gl-form>
</div>
</div>
<gl-table
:table="tableData"
v-loading="tableLoading"
>
<!-- <gl-table-column align="center" v-for="(i, index) in tableData.column" :key="index" :label='i.label' :prop='i.prop' :width='i.width' >
<template slot-scope="scope">
<template v-if='i.prop === "ipBackgroundList"'>
<img class="tableImg" :src="tableData.data[scope.scope.$index][i.prop]">
</template>
<template v-else>
{{tableData.data[scope.scope.$index][i.prop]}}
</template>
</template>
</gl-table-column> -->
v-loading="tableLoading">
</gl-table>
<gl-pagination
background
......@@ -52,20 +20,17 @@
:page-size="pageSize"
layout="sizes, total, ->, prev, pager, next, jumper"
:total="total"
>
</gl-pagination>
></gl-pagination>
<gl-dialog
title="新增分组"
width="30%"
:visible.sync="dialogVisible"
:before-close="handleClose"
>
:before-close="handleClose">
<gl-form
:model="addParams"
:rules="rules"
ref="addParams"
label-width="120px"
>
label-width="120px">
<gl-form-item label="分组名称:" prop="groupName">
<gl-input name="groupName" placeholder="请输入名称" v-model="addParams.groupName"></gl-input>
</gl-form-item>
......@@ -75,8 +40,7 @@
v-validate="'required'"
data-vv-as="业务类型"
v-model="addParams.businessCode"
placeholder="请选择"
>
placeholder="请选择">
<gl-option
v-for="item in businessList"
:key="item.confId"
......@@ -84,14 +48,11 @@
: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">
<gl-button type="primary" @click="handleSubmit('addParams')" :loading="addLoading">提交</gl-button>
<gl-button @click="handleClose">取消</gl-button>
<gl-button type="primary" @click="handleSubmit('addParams')" :loading="addLoading">提交</gl-button>
<gl-button @click="handleClose">取消</gl-button>
</div>
</gl-dialog>
</div>
......@@ -144,7 +105,7 @@ export default {
tableData: {
border: true,
align: 'center',
// height: parseInt(this.$client_height() - 140),
height: parseInt(this.$client_height() - 140),
data: [],
column: [
{
......@@ -290,11 +251,11 @@ export default {
</script>
<style rel="stylesheet/scss" lang="scss" >
.group {
.cell {
.el-button {
padding: 2px 10px;
}
}
}
// .group {
// .cell {
// .el-button {
// padding: 2px 10px;
// }
// }
// }
</style>
......@@ -19,25 +19,28 @@
placeholder="请输入商户名称/商户号"
data-vv-as="商户名称/商户号"
v-validate="'required'"
:remote-method="remoteMethod"
:remote-method="remoteList"
:loading="loading">
<gl-option
v-for="item in options4"
:key="item.value"
:label="item.label"
:value="item.value">
v-for="item in businessList"
:key="item.merchantId"
:label="item.merchantName"
:value="item.merchantId">
</gl-option>
</gl-select>
<span v-show="errorBags.has('merchant')" class="error">{{ errorBags.first('merchant') }}</span>
</gl-form-item>
<gl-form-item label="商户类型:" prop="merchantType">
<gl-select v-model="addForm.merchantType" name="merchantType"
data-vv-as="商户类型" v-validate="'required'" placeholder="请搜索">
<gl-select v-model="addForm.merchantType"
name="merchantType"
data-vv-as="商户类型"
v-validate="'required'"
placeholder="请搜索">
<gl-option
v-for="item in merchantTypeList"
:key="item.merchantId"
:label="item.merchantName"
:value="item.merchantId">
:key="item.confId"
:label="item.confKey"
:value="item.confId">
</gl-option>
</gl-select>
<span v-show="errorBags.has('merchantType')" class="error">{{ errorBags.first('merchantType') }}</span>
......@@ -48,30 +51,43 @@
v-model="item.merchant"
filterable
remote
:name="`item.merchant${idx+1}`"
v-validate="item.merchant || item.merchantType ? 'required' : ''"
:data-vv-as="`子商户${idx+1}`"
clearable
placeholder="请输入商户名称/商户号"
:remote-method="remoteMethod"
:loading="loading">
:remote-method="remoteChildList"
:loading="childLoading">
<gl-option
v-for="item in options4"
:key="item.value"
:label="item.label"
:value="item.value">
v-for="item in businessChildList"
:key="item.merchantId"
:label="item.merchantName"
:value="item.merchantId">
</gl-option>
</gl-select>
<i v-show="item.show" class="el-icon-delete delete" @click="deleteBusiness(idx)"></i>
<span v-show="errorBags.has(`item.merchant${idx+1}`)" class="error">{{ errorBags.first(`item.merchant${idx+1}`) }}</span>
<!-- <span v-show="item.merchant? !item.merchant : !!item.merchantType" class="error">{{ `请填写子商户${idx+1}的商户名称/商户号` }}</span> -->
</gl-form-item>
<gl-form-item label="商户类型:">
<gl-select v-model="item.merchantType" placeholder="请选择">
<gl-select v-model="item.merchantType"
:name="`item.merchantType${idx+1}`"
v-validate="item.merchant || item.merchantType ? 'required' : ''"
:data-vv-as="`子商户${idx+1}类型`"
clearable
placeholder="请选择">
<gl-option
v-for="item in merchantTypeList"
:key="item.merchantId"
:label="item.merchantName"
:value="item.merchantId">
:key="item.confId"
:label="item.confKey"
:value="item.confId">
</gl-option>
</gl-select>
<span v-show="errorBags.has(`item.merchantType${idx+1}`)" class="error">{{ errorBags.first(`item.merchantType${idx+1}`) }}</span>
<!-- <span v-show="item.merchantType? !item.merchantType : !!item.merchant" class="error">{{ `请填写子商户${idx+1}的商户类型` }}</span> -->
</gl-form-item>
</div>
<span v-show="tip" class="error" style="float:right; margin-right: 43px;">{{ '请填写上一条子商户数据' }}</span>
<gl-button @click="addMore">添加更多</gl-button>
</gl-form>
<div slot="footer" class="dialog-footer">
......@@ -83,6 +99,8 @@
</template>
<script>
import notice from '@/common/notice'
import { businessManagenMethods, groupDetailMethods, request } from '@/api'
export default {
name: 'AddBusiness',
props: {
......@@ -90,46 +108,21 @@ export default {
},
data() {
return {
tip: false,
addForm: {
merchant: '',
merchantType: ''
},
merchantTypeList: [
{
merchantId: 1,
merchantName: '广联'
}, {
merchantId: 2,
merchantName: '分组'
}, {
merchantId: 3,
merchantName: '富强'
}
],
merchantTypeList: [],
rules: {
merchant: [{ required: true }],
merchantType: [{ required: true }]
},
// 远程搜索
loading: false,
options4: [],
states: ['Alabama', 'Alaska', 'Arizona',
'Arkansas', 'California', 'Colorado',
'Connecticut', 'Delaware', 'Florida',
'Georgia', 'Hawaii', 'Idaho', 'Illinois',
'Indiana', 'Iowa', 'Kansas', 'Kentucky',
'Louisiana', 'Maine', 'Maryland',
'Massachusetts', 'Michigan', 'Minnesota',
'Mississippi', 'Missouri', 'Montana',
'Nebraska', 'Nevada', 'New Hampshire',
'New Jersey', 'New Mexico', 'New York',
'North Carolina', 'North Dakota', 'Ohio',
'Oklahoma', 'Oregon', 'Pennsylvania',
'Rhode Island', 'South Carolina',
'South Dakota', 'Tennessee', 'Texas',
'Utah', 'Vermont', 'Virginia',
'Washington', 'West Virginia', 'Wisconsin',
'Wyoming'],
childLoading: false,
businessList: [],
businessChildList: [],
addList: [
{
label: '子商户1',
......@@ -145,53 +138,102 @@ export default {
}
},
mounted() {
this.list = this.states.map(item => {
return { value: item, label: item }
})
this.getBusinessType()
},
methods: {
// 确定按钮
ok() {
this.tip = false
this.$validator.validateAll().then((result) => {
if (result) {
this.addList.forEach(item => {
delete item.label
})
this.addForm.merchantRelationAdds = this.addList
this.showAddDialog()
this.addList = [{ label: '子商户1', merchant: '', merchantType: '' }]
this.addForm = { merchant: '', merchantType: '' }
if (this.addList[0].merchantId) {
this.addForm.merchantRelationAdds = this.addList
}
const params = this.$deep_clone(this.addForm)
params.method = groupDetailMethods.Create
request.req(params).then(res => {
notice.okTips()
this.showAddDialog()
}).catch(err => {
notice.errorTips(err)
})
}
})
},
// 显示隐藏添加商户按钮
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 == '') {
this.tip = true
} else {
this.tip = false
this.addList.push({
label: '子商户' + (this.addList.length + 1),
merchant: '',
merchantType: '',
show: true
})
}
},
deleteBusiness(idx) {
console.log(idx)
this.addList.splice(idx, 1)
},
remoteMethod(query) {
// 父商户搜索
remoteList(query) {
if (query !== '') {
this.loading = true
setTimeout(() => {
const params = {}
params.groupId = 1
params.searchWrod = query
params.method = groupDetailMethods.SearchList
request.req(params).then(res => {
this.loading = false
this.options4 = this.list.filter(item => {
return item.label.toLowerCase()
.indexOf(query.toLowerCase()) > -1
})
}, 200)
this.businessList = res.merchantParams
}).catch(err => {
notice.errorTips(err)
})
} else {
this.options4 = []
this.businessList = []
}
},
// 子商户远程搜索
remoteChildList(query) {
if (query !== '') {
this.childLoading = true
const params = {}
params.groupId = 1
params.searchWrod = query
params.method = groupDetailMethods.SearchChildList
request.req(params).then(res => {
this.childLoading = false
this.businessChildList = res.merchantParams
}).catch(err => {
notice.errorTips(err)
})
} else {
this.businessChildList = []
}
},
// 获取商户类型列表
getBusinessType() {
const params = {}
params.method = businessManagenMethods.Type
request.req(params).then(res => {
this.merchantTypeList = res.merchantDictList
}).catch(err => {
notice.errorTips(err)
})
}
}
}
......
<template>
<div class="detail">
<div class="default">
<gl-form
:inline="true"
>
<!-- <gl-form-item>
<gl-input
v-model="searchCondition.brand"
class="input-with-select"
placeholder="请输入品牌"
clearable
/>
</gl-form-item>
<gl-form-item>
<gl-button
type="primary"
@click="getList"
>搜索</gl-button>
</gl-form-item> -->
<gl-form-item style="float:right;">
<gl-button
class="newButton"
type="primary"
@click="searchDialog"
>高级搜索</gl-button>
<gl-button
class="newButton"
type="primary"
@click="addDialog"
>添加商户</gl-button>
</gl-form-item>
</gl-form>
</div>
<gl-table
:table="tableData"
v-loading="tableLoading"
>
<gl-table-column align="center" v-for="(i, index) in tableData.column" :key="index" :label='i.label' :prop='i.prop' :width='i.width' >
<template slot-scope="scope">
<template v-if='i.prop === "merchantName"'>
<a @click="merchantDetail(scope.scope.row.merchantId)" class="el-button el-button--text">{{tableData.data[scope.scope.$index][i.prop]}}</a>
</template>
<template v-else-if='i.prop === "parentMerchantName"'>
<a @click="merchantDetail(scope.scope.row.parentMerchantId)" class="el-button el-button--text">{{tableData.data[scope.scope.$index][i.prop]}}</a>
</template>
<template v-else>
{{tableData.data[scope.scope.$index][i.prop]}}
</template>
<div class="m-b10">
<gl-button
class="newButton"
type="primary"
@click="searchDialog"
>高级搜索</gl-button>
<gl-button
class="newButton"
type="primary"
@click="addDialog"
>添加商户</gl-button>
</div>
<gl-table
:table="tableData"
v-loading="tableLoading">
<gl-table-column align="center" v-for="(i, index) in tableData.column" :key="index" :label='i.label' :prop='i.prop' :width='i.width' >
<template slot-scope="scope">
<template v-if='i.prop === "merchantName"'>
<a @click="merchantDetail(scope.scope.row.merchantId)" class="el-button el-button--text">{{tableData.data[scope.scope.$index][i.prop]}}</a>
</template>
<template v-else-if='i.prop === "parentMerchantName"'>
<a @click="merchantDetail(scope.scope.row.parentMerchantId)" class="el-button el-button--text">{{tableData.data[scope.scope.$index][i.prop]}}</a>
</template>
</gl-table-column>
</gl-table>
<template v-else>
{{tableData.data[scope.scope.$index][i.prop]}}
</template>
</template>
</gl-table-column>
</gl-table>
<gl-pagination
background
@size-change="handleSizeChange"
......@@ -65,13 +44,11 @@
title="高级搜索"
width="40%"
:visible.sync="dialogVisible_search"
:before-close="handleClose_search"
>
:before-close="handleClose_search">
<gl-form
:model="searchParams"
ref="searchParams"
label-width="120px"
>
label-width="120px">
<gl-form-item label="商户名称:" prop="merchantName">
<gl-input name="merchantName" placeholder="请输入商户名称" v-model="searchParams.merchantName"></gl-input>
</gl-form-item>
......@@ -82,8 +59,7 @@
<gl-select
name="merchantType"
v-model="searchParams.merchantType"
placeholder="请选择"
>
placeholder="请选择">
<gl-option
v-for="item in merchantTypeList"
:key="item.value"
......@@ -92,7 +68,6 @@
</gl-option>
</gl-select>
</gl-form-item>
<gl-form-item label="地区:" prop="area">
<city-area
ref="c"
......@@ -217,28 +192,6 @@ export default {
prop: 'parentMerchantId'
}
]
// number: {
// label: '序号',
// width: '50px',
// index: index => {
// ++index
// return index < 10 && index > 0 ? '0' + index : index
// }
// },
// console: {
// show: true,
// label: '操作',
// prop: 'options',
// button: [
// {
// label: '详情',
// type: 'text',
// callback: (index, row) => {
// this.detail(row)
// }
// }
// ]
// }
}
}
},
......@@ -263,7 +216,7 @@ export default {
getParams() {
return Object.assign(
{
pageNum: this.pageNum,
pageCount: this.pageNum,
pageSize: this.pageSize
},
this.searchParams
......@@ -275,11 +228,13 @@ export default {
this.searchParams.endTime = this.times[1].format('yyyy-MM-dd HH:mm:ss')
}
const params = this.getParams()
params.groupId = 1
params.method = groupDetailMethods.Search
console.log(params)
request
.req(params)
.then(res => {
console.log(res)
this.total = res.pagination.totalCount
this.tableData.data = res.merchantGroupRelations
this.tableLoading = false
......
......@@ -19,25 +19,28 @@
placeholder="请输入商户名称/商户号"
data-vv-as="商户名称/商户号"
v-validate="'required'"
:remote-method="remoteMethod"
:remote-method="remoteList"
:loading="loading">
<gl-option
v-for="item in options4"
:key="item.value"
:label="item.label"
:value="item.value">
v-for="item in businessList"
:key="item.merchantId"
:label="item.merchantName"
:value="item.merchantId">
</gl-option>
</gl-select>
<span v-show="errorBags.has('merchant')" class="error">{{ errorBags.first('merchant') }}</span>
</gl-form-item>
<gl-form-item label="商户类型:" prop="merchantType">
<gl-select v-model="addForm.merchantType" name="merchantType"
data-vv-as="商户类型" v-validate="'required'" placeholder="请搜索">
<gl-select v-model="addForm.merchantType"
name="merchantType"
data-vv-as="商户类型"
v-validate="'required'"
placeholder="请搜索">
<gl-option
v-for="item in merchantTypeList"
:key="item.merchantId"
:label="item.merchantName"
:value="item.merchantId">
:key="item.confId"
:label="item.confKey"
:value="item.confId">
</gl-option>
</gl-select>
<span v-show="errorBags.has('merchantType')" class="error">{{ errorBags.first('merchantType') }}</span>
......@@ -48,30 +51,43 @@
v-model="item.merchant"
filterable
remote
:name="`item.merchant${idx+1}`"
v-validate="item.merchant || item.merchantType ? 'required' : ''"
:data-vv-as="`子商户${idx+1}`"
clearable
placeholder="请输入商户名称/商户号"
:remote-method="remoteMethod"
:loading="loading">
:remote-method="remoteChildList"
:loading="childLoading">
<gl-option
v-for="item in options4"
:key="item.value"
:label="item.label"
:value="item.value">
v-for="item in businessChildList"
:key="item.merchantId"
:label="item.merchantName"
:value="item.merchantId">
</gl-option>
</gl-select>
<i v-show="item.show" class="el-icon-delete delete" @click="deleteBusiness(idx)"></i>
<span v-show="errorBags.has(`item.merchant${idx+1}`)" class="error">{{ errorBags.first(`item.merchant${idx+1}`) }}</span>
<!-- <span v-show="item.merchant? !item.merchant : !!item.merchantType" class="error">{{ `请填写子商户${idx+1}的商户名称/商户号` }}</span> -->
</gl-form-item>
<gl-form-item label="商户类型:">
<gl-select v-model="item.merchantType" placeholder="请选择">
<gl-select v-model="item.merchantType"
:name="`item.merchantType${idx+1}`"
v-validate="item.merchant || item.merchantType ? 'required' : ''"
:data-vv-as="`子商户${idx+1}类型`"
clearable
placeholder="请选择">
<gl-option
v-for="item in merchantTypeList"
:key="item.merchantId"
:label="item.merchantName"
:value="item.merchantId">
:key="item.confId"
:label="item.confKey"
:value="item.confId">
</gl-option>
</gl-select>
<span v-show="errorBags.has(`item.merchantType${idx+1}`)" class="error">{{ errorBags.first(`item.merchantType${idx+1}`) }}</span>
<!-- <span v-show="item.merchantType? !item.merchantType : !!item.merchant" class="error">{{ `请填写子商户${idx+1}的商户类型` }}</span> -->
</gl-form-item>
</div>
<span v-show="tip" class="error" style="float:right; margin-right: 43px;">{{ '请填写上一条子商户数据' }}</span>
<gl-button @click="addMore">添加更多</gl-button>
</gl-form>
<div slot="footer" class="dialog-footer">
......@@ -83,6 +99,8 @@
</template>
<script>
import notice from '@/common/notice'
import { businessManagenMethods, groupDetailMethods, request } from '@/api'
export default {
name: 'AddBusiness',
props: {
......@@ -90,46 +108,21 @@ export default {
},
data() {
return {
tip: false,
addForm: {
merchant: '',
merchantType: ''
},
merchantTypeList: [
{
merchantId: 1,
merchantName: '广联'
}, {
merchantId: 2,
merchantName: '分组'
}, {
merchantId: 3,
merchantName: '富强'
}
],
merchantTypeList: [],
rules: {
merchant: [{ required: true }],
merchantType: [{ required: true }]
},
// 远程搜索
loading: false,
options4: [],
states: ['Alabama', 'Alaska', 'Arizona',
'Arkansas', 'California', 'Colorado',
'Connecticut', 'Delaware', 'Florida',
'Georgia', 'Hawaii', 'Idaho', 'Illinois',
'Indiana', 'Iowa', 'Kansas', 'Kentucky',
'Louisiana', 'Maine', 'Maryland',
'Massachusetts', 'Michigan', 'Minnesota',
'Mississippi', 'Missouri', 'Montana',
'Nebraska', 'Nevada', 'New Hampshire',
'New Jersey', 'New Mexico', 'New York',
'North Carolina', 'North Dakota', 'Ohio',
'Oklahoma', 'Oregon', 'Pennsylvania',
'Rhode Island', 'South Carolina',
'South Dakota', 'Tennessee', 'Texas',
'Utah', 'Vermont', 'Virginia',
'Washington', 'West Virginia', 'Wisconsin',
'Wyoming'],
childLoading: false,
businessList: [],
businessChildList: [],
addList: [
{
label: '子商户1',
......@@ -145,53 +138,108 @@ export default {
}
},
mounted() {
this.list = this.states.map(item => {
return { value: item, label: item }
})
this.getBusinessType()
},
methods: {
// 确定按钮
ok() {
this.tip = false
this.$validator.validateAll().then((result) => {
if (result) {
this.addList.forEach(item => {
delete item.label
})
this.addForm.merchantRelationAdds = this.addList
this.showAddDialog()
this.addList = [{ label: '子商户1', merchant: '', merchantType: '' }]
this.addForm = { merchant: '', merchantType: '' }
if (this.addList[0].merchantId) {
this.addForm.merchantRelationAdds = this.addList
}
console.log(this.addForm)
const params = this.$deep_clone(this.addForm)
params.method = groupDetailMethods.Create
request.req(params).then(res => {
notice.okTips()
this.showAddDialog()
}).catch(err => {
notice.errorTips(err)
})
}
})
},
// 显示隐藏添加商户按钮
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
})
console.log(this.addList)
const len = this.addList.length - 1
if (this.addList[len].merchant == '' || this.addList[len].merchantType == '') {
console.log('请填写完上一条数据')
this.tip = true
} else {
this.tip = false
this.addList.push({
label: '子商户' + (this.addList.length + 1),
merchant: '',
merchantType: '',
show: true
})
}
},
deleteBusiness(idx) {
console.log(idx)
this.addList.splice(idx, 1)
},
remoteMethod(query) {
// 父商户搜索
remoteList(query) {
if (query !== '') {
this.loading = true
setTimeout(() => {
const params = {}
params.groupId = 1
params.searchWrod = query
params.method = groupDetailMethods.SearchList
request.req(params).then(res => {
console.log(res.merchantParams)
this.loading = false
this.options4 = this.list.filter(item => {
return item.label.toLowerCase()
.indexOf(query.toLowerCase()) > -1
})
}, 200)
this.businessList = res.merchantParams
}).catch(err => {
notice.errorTips(err)
})
} else {
this.options4 = []
this.businessList = []
}
},
// 子商户远程搜索
remoteChildList(query) {
if (query !== '') {
this.childLoading = true
const params = {}
params.groupId = 1
params.searchWrod = query
params.method = groupDetailMethods.SearchChildList
request.req(params).then(res => {
console.log(res.merchantParams)
this.childLoading = false
this.businessChildList = res.merchantParams
}).catch(err => {
notice.errorTips(err)
})
} else {
this.businessChildList = []
}
},
// 获取商户类型列表
getBusinessType() {
const params = {}
params.method = businessManagenMethods.Type
request.req(params).then(res => {
console.log(res)
this.merchantTypeList = res.merchantDictList
}).catch(err => {
notice.errorTips(err)
})
}
}
}
......
<template>
<div>
<gl-button
type="primary"
@click="showDialog"
>新增业务</gl-button>
<gl-button
type="primary"
@click="add"
>新增商户</gl-button>
<div class="default">
<div class="m-b10">
<gl-button
type="primary"
@click="showDialog"
>新增业务</gl-button>
<!-- <gl-button
type="primary"
@click="add"
>新增商户</gl-button> -->
</div>
<gl-table :table="tableData"></gl-table>
<gl-dialog
title="新增业务"
:visible.sync="dialogFormVisible"
:close-on-click-modal="false"
>
:close-on-click-modal="false">
<gl-form
:model="form"
label-width="100px"
......@@ -53,15 +54,6 @@
class="error"
>{{ errorBags.first('memo') }}</span>
</gl-form-item>
<gl-form-item label="地址">
<city-area
ref="c"
:showCity="showCity"
:eventBus="eventBus"
:validateCity="validateCity"
@cityArea="getCityArea"
></city-area>
</gl-form-item>
</gl-form>
<div
slot="footer"
......@@ -74,50 +66,34 @@
>确 定</gl-button>
</div>
</gl-dialog>
<add-business
<!-- <add-business
:addDialogVisible="addDialogVisible"
@addData="handleAddData"
></add-business>
@addData="add"
></add-business> -->
</div>
</template>
<script>
import Vue from 'vue'
import { CityArea } from '../components'
import addBusiness from './addBusiness'
import notice from '@/common/notice'
import { businessManagenMethods, request } from '@/api'
// import { jumpLink } from '../../../common/common.js'
export default {
name: 'BusinessManagement',
components: {
addBusiness,
CityArea
addBusiness
},
data() {
return {
eventBus: null,
tableData: {
border: true,
stripe: 'true',
align: 'center',
data: [
// {
// businessId: 1,
// confKey: '爱车保镖',
// businessCode: '11',
// memo: ' 基于车联网智能终端大数据为汽车金融提供资产保全的服务',
// createTime: '2018-03-16'
// }, {
// businessId: 2,
// confKey: '爱车保镖',
// businessCode: '11',
// memo: ' 基于车联网智能终端大数据为汽车金融提供资产保全的服务',
// createTime: '2018-03-16'
// }
],
data: [],
column: [
{
label: '业务ID',
prop: 'confId'
prop: 'confId',
width: '100'
}, {
label: '业务名称',
prop: 'confKey'
......@@ -129,22 +105,6 @@ export default {
prop: 'createTime'
}
]
// 详情
// console: {
// show: true,
// label: '操作',
// width: '150',
// fixed: 'right',
// button: [
// {
// type: 'text',
// label: '详情',
// callback: (index, rows) => {
// this.$parent.to(['商户数据平台', '商户数据平台', '商户数据平台', '业务管理', '商户详情'], { id: rows[index].businessId, name: rows[index].confKey })
// }
// }
// ]
// }
},
form: {
confKey: '',
......@@ -157,15 +117,7 @@ export default {
memo: [{ required: true }]
},
// 商户分组组件数据
addDialogVisible: false,
// 省市区
showCity: [1, 1],
validateCity: [1, 1]
}
},
provide() {
return {
$validator: this.$validator
// addDialogVisible: false,
}
},
watch: {
......@@ -173,17 +125,11 @@ export default {
if (val) {
this.form = { confKey: '', memo: '', area: '' }
} else {
this.eventBus.$emit('reset')
this.$validator.errors.clear()
clearTimeout(timer)
const timer = setTimeout(() => {
this.$refs['c'].$validator.errors.clear()
}, 400)
}
}
},
mounted() {
this.eventBus = new Vue()
this.getList()
},
methods: {
......@@ -193,27 +139,18 @@ export default {
},
// 提交表单
submit() {
Promise.all([
this.$refs['c'].$validator.validateAll(),
this.$validator.validateAll()
]).then((result) => {
if (result[0] && result[1]) {
this.$validator.validateAll().then((result) => {
if (result) {
this.businessCreate()
// console.log('提交成功')
// console.log(this.form)
// this.showDialog()
}
})
},
add() {
this.addDialogVisible = !this.addDialogVisible
},
handleAddData() {
this.addDialogVisible = !this.addDialogVisible
},
getCityArea(params) {
console.log(params)
},
// add() {
// this.addDialogVisible = !this.addDialogVisible
// },
// handleAddData() {
// this.addDialogVisible = !this.addDialogVisible
// },
// 接口请求
getList() {
const params = {}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!