Commit 12933300 by wangql

提交代码

1 parent 99ae3cdf
const path = '/glsx.accounts.admin.merchant.group.' const path = '/glsx.accounts.admin.merchant.group.'
const businessPath = '/glsx.accounts.admin.merchant.'
const methods = { const methods = {
Search: `${path}dict`, Search: `${path}dict`,
Create: `${path}create` Create: `${path}create`,
BusinessList: `${businessPath}dict.business`
} }
export { export {
methods methods
......
const path = '/glsx.accounts.admin.merchant.group.' const path = '/glsx.accounts.admin.merchant.'
const methods = { const methods = {
Search: `${path}search` Search: `${path}group.search`,
MerchantType: `${path}dict.type`
} }
export { export {
methods methods
......
...@@ -7,6 +7,7 @@ import './styles/index.scss' ...@@ -7,6 +7,7 @@ import './styles/index.scss'
import './styles/common.scss' import './styles/common.scss'
// import axios from 'axios' // import axios from 'axios'
import VeeValidate from 'vee-validate' import VeeValidate from 'vee-validate'
import './date.js'
Vue.use(GlsxVueComponents) Vue.use(GlsxVueComponents)
Vue.use(VeeValidate, { Vue.use(VeeValidate, {
......
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
placeholder="请选择" placeholder="请选择"
> >
<gl-option <gl-option
v-for="item in businessCodeList" v-for="item in businessList"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value"> :value="item.value">
...@@ -133,7 +133,7 @@ export default { ...@@ -133,7 +133,7 @@ export default {
{ required: true, message: '请选择业务类型', trigger: 'change' } { required: true, message: '请选择业务类型', trigger: 'change' }
] ]
}, },
businessCodeList: [], businessList: [],
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
total: 10, total: 10,
...@@ -203,6 +203,7 @@ export default { ...@@ -203,6 +203,7 @@ export default {
}, },
mounted() { mounted() {
this.getList() this.getList()
this.getBusinessList()
}, },
methods: { methods: {
loadingGetList() { loadingGetList() {
...@@ -235,6 +236,21 @@ export default { ...@@ -235,6 +236,21 @@ export default {
console.log(err) console.log(err)
}) })
}, },
getBusinessList() {
const params = {}
params.methods = groupMethods.BusinessList
request
.req(params)
.then(res => {
res.merchantDictList.forEach((item, index) => {
this.businessList.push({ 'label': item.confKey, 'value': item.confId })
})
})
.catch(err => {
this.tableLoading = false
console.log(err)
})
},
handleSizeChange(val) { handleSizeChange(val) {
this.pageSize = val this.pageSize = val
this.loadingGetList() this.loadingGetList()
...@@ -264,7 +280,6 @@ export default { ...@@ -264,7 +280,6 @@ export default {
request request
.req(params) .req(params)
.then(res => { .then(res => {
console.log(res)
this.loadingGetList() this.loadingGetList()
this.dialogVisible = !this.dialogVisible this.dialogVisible = !this.dialogVisible
}) })
......
...@@ -39,10 +39,10 @@ ...@@ -39,10 +39,10 @@
<gl-table-column align="center" v-for="(i, index) in tableData.column" :key="index" :label='i.label' :prop='i.prop' :width='i.width' > <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 slot-scope="scope">
<template v-if='i.prop === "merchantName"'> <template v-if='i.prop === "merchantName"'>
<a @href="merchantDetail(scope.scope.row[merchantId])">{{tableData.data[scope.scope.$index][i.prop]}}</a> <a @click="merchantDetail(scope.scope.row.merchantId)" class="el-button el-button--text">{{tableData.data[scope.scope.$index][i.prop]}}</a>
</template> </template>
<template v-else-if='i.prop === "parentMerchantName"'> <template v-else-if='i.prop === "parentMerchantName"'>
<a @href="merchantDetail(scope.scope.row[parentMerchantId])">{{tableData.data[scope.scope.$index][i.prop]}}</a> <a @click="merchantDetail(scope.scope.row.parentMerchantId)" class="el-button el-button--text">{{tableData.data[scope.scope.$index][i.prop]}}</a>
</template> </template>
<template v-else> <template v-else>
{{tableData.data[scope.scope.$index][i.prop]}} {{tableData.data[scope.scope.$index][i.prop]}}
...@@ -69,6 +69,7 @@ ...@@ -69,6 +69,7 @@
> >
<gl-form <gl-form
:model="searchParams" :model="searchParams"
ref="searchParams"
label-width="120px" label-width="120px"
> >
<gl-form-item label="商户名称:" prop="merchantName"> <gl-form-item label="商户名称:" prop="merchantName">
...@@ -97,7 +98,6 @@ ...@@ -97,7 +98,6 @@
ref="c" ref="c"
:showCity="showCity" :showCity="showCity"
:eventBus="eventBus" :eventBus="eventBus"
:validateCity="validateCity"
@cityArea="getCityArea" @cityArea="getCityArea"
></city-area> ></city-area>
</gl-form-item> </gl-form-item>
...@@ -148,7 +148,11 @@ export default { ...@@ -148,7 +148,11 @@ export default {
searchParams: { searchParams: {
merchantName: '', merchantName: '',
merchantId: null, merchantId: null,
merchantType: null merchantType: null,
provinceId: null,
cityId: null,
startTime: '',
endTime: ''
}, },
times: [], times: [],
merchantTypeList: [], merchantTypeList: [],
...@@ -163,7 +167,6 @@ export default { ...@@ -163,7 +167,6 @@ export default {
addDialogVisible: false, addDialogVisible: false,
// 省市区 // 省市区
showCity: [1, 1], showCity: [1, 1],
validateCity: [0, 0],
eventBus: null, eventBus: null,
tableData: { tableData: {
border: true, border: true,
...@@ -236,6 +239,7 @@ export default { ...@@ -236,6 +239,7 @@ export default {
}, },
mounted() { mounted() {
this.getList() this.getList()
this.getMerchantType()
this.eventBus = new Vue() this.eventBus = new Vue()
}, },
methods: { methods: {
...@@ -254,8 +258,13 @@ export default { ...@@ -254,8 +258,13 @@ export default {
) )
}, },
getList() { getList() {
if (this.times.length) {
this.searchParams.startTime = this.times[0].format('yyyy-MM-dd HH:mm:ss')
this.searchParams.endTime = this.times[1].format('yyyy-MM-dd HH:mm:ss')
}
const params = this.getParams() const params = this.getParams()
params.methods = groupDetailMethods.Search params.methods = groupDetailMethods.Search
console.log(params)
request request
.req(params) .req(params)
.then(res => { .then(res => {
...@@ -276,6 +285,22 @@ export default { ...@@ -276,6 +285,22 @@ export default {
this.pageNum = val this.pageNum = val
this.loadingGetList() this.loadingGetList()
}, },
// 获取商户类型
getMerchantType() {
const params = {}
params.methods = groupDetailMethods.MerchantType
request
.req(params)
.then(res => {
res.merchantDictList.forEach((item, index) => {
this.merchantTypeList.push({ 'label': item.confKey, 'value': item.confId })
})
})
.catch(err => {
this.tableLoading = false
console.log(err)
})
},
// 打开高级搜索弹出框 // 打开高级搜索弹出框
searchDialog() { searchDialog() {
this.dialogVisible_search = !this.dialogVisible_search this.dialogVisible_search = !this.dialogVisible_search
...@@ -287,11 +312,13 @@ export default { ...@@ -287,11 +312,13 @@ export default {
}, },
// 高级搜索 // 高级搜索
handleSubmit_search() { handleSubmit_search() {
this.getList()
}, },
// 重置搜索 // 重置搜索
searchReset() { searchReset() {
this.$refs['searchParams'].resetFields()
this.eventBus.$emit('reset')
this.times = []
}, },
addDialog() { addDialog() {
this.addDialogVisible = !this.addDialogVisible this.addDialogVisible = !this.addDialogVisible
...@@ -300,7 +327,15 @@ export default { ...@@ -300,7 +327,15 @@ export default {
this.addDialogVisible = !this.addDialogVisible this.addDialogVisible = !this.addDialogVisible
}, },
getCityArea(params) { getCityArea(params) {
console.log(params) if (params[0]) {
this.searchParams.provinceId = params[0]
}
if (params[1]) {
this.searchParams.cityId = params[1]
}
},
merchantDetail(merchantId) {
console.log(merchantId)
} }
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!