Commit e9cb9c4a by cwq0219
2 parents 8c85ffe9 a212417f
This diff could not be displayed because it is too large.
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
"dependencies": { "dependencies": {
"axios": "^0.18.0", "axios": "^0.18.0",
"glsx-vue-common": "^1.2.1", "glsx-vue-common": "^1.2.1",
"blueimp-md5": "^2.10.0",
"glsx-vue-components": "^1.0.13", "glsx-vue-components": "^1.0.13",
"js-md5": "^0.7.3", "js-md5": "^0.7.3",
"node-sass": "^4.9.3", "node-sass": "^4.9.3",
......
const path = '/glsx.accounts.admin.merchant.group.'
const businessPath = '/glsx.accounts.admin.merchant.'
const methods = {
Search: `${path}dict`,
Create: `${path}create`,
BusinessList: `${businessPath}dict.business`
}
export {
methods
}
const path = '/glsx.accounts.admin.merchant.'
const methods = {
Search: `${path}group.search`,
MerchantType: `${path}dict.type`
}
export {
methods
}
...@@ -6,6 +6,12 @@ import { sign } from './sign' ...@@ -6,6 +6,12 @@ import { sign } from './sign'
import { import {
methods as bizMethods methods as bizMethods
} from './bussinessListApi' } from './bussinessListApi'
import {
methods as groupMethods
} from './businessGroup'
import {
methods as groupDetailMethods
} from './businessGroupDetail'
const request = { const request = {
req: params => { req: params => {
const url = process.env.NODE_ENV === 'production' ? 'router' : params.methods const url = process.env.NODE_ENV === 'production' ? 'router' : params.methods
...@@ -14,5 +20,7 @@ const request = { ...@@ -14,5 +20,7 @@ const request = {
} }
export { export {
bizMethods, bizMethods,
request request,
groupMethods,
groupDetailMethods
} }
...@@ -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, {
......
<template> <template>
<div> <div class="group">
<h1>商户分组</h1> <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;">
<gl-button
class="newButton"
type="primary"
@click="dialog"
>新增分组</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 === "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> -->
</gl-table>
<gl-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="pageNum"
:page-sizes="[10,20,30,40]"
:page-size="pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
>
</gl-pagination>
<gl-dialog
title="新增分组"
width="30%"
:visible.sync="dialogVisible"
:before-close="handleClose"
>
<gl-form
:model="addParams"
:rules="rules"
ref="addParams"
label-width="120px"
>
<gl-form-item label="分组名称:" prop="groupName">
<gl-input name="groupName" placeholder="请输入名称" v-model="addParams.groupName"></gl-input>
</gl-form-item>
<gl-form-item label="业务类型:" prop="businessCode">
<gl-select
name="businessCode"
v-validate="'required'"
data-vv-as="业务类型"
v-model="addParams.businessCode"
placeholder="请选择"
>
<gl-option
v-for="item in businessList"
:key="item.value"
:label="item.label"
:value="item.value">
</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>
</div>
</gl-dialog>
</div> </div>
</template> </template>
<script> <script>
// import Edit from './Edit'
// import { fn, treeCheckKeys, deleteEmptyAttribute } from '@/common/common'
// import { getMerchantGroupList, createGroup } from '@/api/index'
// import { NoticeMixin } from '@/mixins'
// import Vue from 'vue'
import { groupMethods, request } from '@/api'
export default { export default {
name: 'BusinessGroup' name: 'businessGroup',
components: {
// Edit,
},
watch: {
dialogVisible(val) {
if (!val) {
this.$refs['addParams'].resetFields()
}
}
},
// mixins: [NoticeMixin],
data() {
return {
searchCondition: {},
addParams: {
groupName: '',
businessCode: ''
},
rules: {
groupName: [
{ required: true, message: '请输入分组名称', trigger: 'blur' },
{ max: 10, message: '长度最多10个字符', trigger: 'blur' }
],
businessCode: [
{ required: true, message: '请选择业务类型', trigger: 'change' }
]
},
businessList: [],
pageNum: 1,
pageSize: 10,
total: 10,
tableLoading: false,
addLoading: false,
dialogVisible: false,
tableData: {
border: true,
align: 'center',
// height: parseInt(this.$client_height() - 140),
data: [],
column: [
{
label: '分组ID',
prop: 'id'
},
{
label: '分组名称',
prop: 'groupName'
},
{
label: '分组编号',
prop: 'groupCode'
},
{
label: '业务编号',
prop: 'businessCode'
},
{
label: '业务名称',
prop: 'businessName'
},
{
label: '创建时间',
prop: 'createTime'
// formatter: cellValue => {
// if (cellValue.createTime) {
// return new Date(cellValue.createTime).format('yyyy-MM-dd')
// }
// }
}
],
// 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)
}
}
]
}
}
}
},
mounted() {
this.getList()
this.getBusinessList()
},
methods: {
loadingGetList() {
this.tableLoading = true
this.getList()
},
/* 接口请求-start */
// getParams() {
// return Object.assign(
// {
// pageNum: this.pageNum,
// pageSize: this.pageSize
// },
// this.searchCondition
// )
// },
getList() {
// const params = this.getParams()
const params = {}
params.methods = groupMethods.Search
request
.req(params)
.then(res => {
this.total = res.pagination.totalCount
this.tableData.data = res.groupDicts
this.tableLoading = false
})
.catch(err => {
this.tableLoading = false
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) {
this.pageSize = val
this.loadingGetList()
},
handleCurrentChange(val) {
this.pageNum = val
this.loadingGetList()
},
dialog() {
this.dialogVisible = !this.dialogVisible
// this.idPassvalue.$emit('expressionId', objId)
},
// 新增分组
handleSubmit(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
this.createGroup(this.addParams)
} else {
console.log('error submit!!')
return false
}
})
},
createGroup(pas) {
const params = pas
params.methods = groupMethods.Create
request
.req(params)
.then(res => {
this.loadingGetList()
this.dialogVisible = !this.dialogVisible
})
.catch(err => console.log(err))
},
// 关闭新增分组弹出框
handleClose() {
this.dialogVisible = !this.dialogVisible
}
}
} }
</script> </script>
<style lang="sass" scoped> <style rel="stylesheet/scss" lang="scss" >
.group {
.cell {
.el-button {
padding: 2px 10px;
}
}
}
</style> </style>
<template>
<div>
<gl-dialog
title="添加商户"
:visible.sync="addDialogVisible"
width="400px"
:before-close="showAddDialog">
<gl-form
ref="addForm" :model="addForm"
label-width="100px"
:rules="rules">
<gl-form-item label="商户:" prop="merchant">
<gl-select
v-model="addForm.merchant"
filterable
remote
clearable
name="merchant"
placeholder="请输入商户名称/商户号"
data-vv-as="商户名称/商户号"
v-validate="'required'"
:remote-method="remoteMethod"
:loading="loading">
<gl-option
v-for="item in options4"
:key="item.value"
:label="item.label"
:value="item.value">
</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-option
v-for="item in merchantTypeList"
:key="item.merchantId"
:label="item.merchantName"
:value="item.merchantId">
</gl-option>
</gl-select>
<span v-show="errorBags.has('merchantType')" class="error">{{ errorBags.first('merchantType') }}</span>
</gl-form-item>
<div v-for="(item, idx) in addList" :key="idx">
<gl-form-item :label="item.label + ':'">
<gl-select
v-model="item.merchant"
filterable
remote
clearable
placeholder="请输入商户名称/商户号"
:remote-method="remoteMethod"
:loading="loading">
<gl-option
v-for="item in options4"
:key="item.value"
:label="item.label"
:value="item.value">
</gl-option>
</gl-select>
<i v-show="item.show" class="el-icon-delete delete" @click="deleteBusiness(idx)"></i>
</gl-form-item>
<gl-form-item label="商户类型:">
<gl-select v-model="item.merchantType" placeholder="请选择">
<gl-option
v-for="item in merchantTypeList"
:key="item.merchantId"
:label="item.merchantName"
:value="item.merchantId">
</gl-option>
</gl-select>
</gl-form-item>
</div>
<gl-button @click="addMore">添加更多</gl-button>
</gl-form>
<div slot="footer" class="dialog-footer">
<gl-button @click="showAddDialog">取 消</gl-button>
<gl-button type="primary" @click="ok">确 定</gl-button>
</div>
</gl-dialog>
</div>
</template>
<script>
export default {
name: 'AddBusiness',
props: {
addDialogVisible: Boolean
},
data() {
return {
addForm: {
merchant: '',
merchantType: ''
},
merchantTypeList: [
{
merchantId: 1,
merchantName: '广联'
}, {
merchantId: 2,
merchantName: '分组'
}, {
merchantId: 3,
merchantName: '富强'
}
],
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'],
addList: [
{
label: '子商户1',
merchant: '',
merchantType: ''
}
]
}
},
watch: {
addDialogVisible(val) {
this.$validator.errors.clear()
}
},
mounted() {
this.list = this.states.map(item => {
return { value: item, label: item }
})
},
methods: {
ok() {
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: '' }
}
})
},
showAddDialog() {
this.$emit('addData')
},
addMore() {
console.log(this.addList.length)
this.addList.push({
label: '子商户' + (this.addList.length + 1),
merchant: '',
merchantType: '',
show: true
})
},
deleteBusiness(idx) {
console.log(idx)
this.addList.splice(idx, 1)
},
remoteMethod(query) {
if (query !== '') {
this.loading = true
setTimeout(() => {
this.loading = false
this.options4 = this.list.filter(item => {
return item.label.toLowerCase()
.indexOf(query.toLowerCase()) > -1
})
}, 200)
} else {
this.options4 = []
}
}
}
}
</script>
<style>
.delete {
color: red;
margin-left: 20px;
font-size: 18px;
}
</style>
import App from './index.vue'
import base from '@/base'
import GlsxVueCommon from 'glsx-vue-common'
base.getConfig().then(data => {
const { vue, config } = data
vue.use(GlsxVueCommon, config)
base.render(App)
})
<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>
</template>
</gl-table-column>
</gl-table>
<gl-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="pageNum"
:page-sizes="[10,20,30,40]"
:page-size="pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
>
</gl-pagination>
<gl-dialog
title="高级搜索"
width="40%"
:visible.sync="dialogVisible_search"
:before-close="handleClose_search"
>
<gl-form
:model="searchParams"
ref="searchParams"
label-width="120px"
>
<gl-form-item label="商户名称:" prop="merchantName">
<gl-input name="merchantName" placeholder="请输入商户名称" v-model="searchParams.merchantName"></gl-input>
</gl-form-item>
<gl-form-item label="商户号:" prop="merchantId">
<gl-input name="merchantId" placeholder="请输入商户号" v-model="searchParams.merchantId"></gl-input>
</gl-form-item>
<gl-form-item label="商户类型:" prop="merchantType">
<gl-select
name="merchantType"
v-model="searchParams.merchantType"
placeholder="请选择"
>
<gl-option
v-for="item in merchantTypeList"
:key="item.value"
:label="item.label"
:value="item.value">
</gl-option>
</gl-select>
</gl-form-item>
<gl-form-item label="地区:" prop="area">
<city-area
ref="c"
:showCity="showCity"
:eventBus="eventBus"
@cityArea="getCityArea"
></city-area>
</gl-form-item>
<gl-form-item label='加入分组时间:'>
<gl-date-picker
v-model="times"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期">
</gl-date-picker>
</gl-form-item>
</gl-form>
<div slot="footer" class="dialog-footer">
<gl-button type="primary" @click="handleSubmit_search" :loading="searchLoading">搜索</gl-button>
<gl-button @click="searchReset">重置</gl-button>
</div>
</gl-dialog>
<add-business
:addDialogVisible="addDialogVisible"
@addData="handleAddData"
></add-business>
</div>
</template>
<script>
// import Edit from './Edit'
// import { fn, treeCheckKeys, deleteEmptyAttribute } from '@/common/common'
// import { getMerchantGroupDetailList } from '@/api/index'
// import { NoticeMixin } from '@/mixins'
// import Vue from 'vue'
import Vue from 'vue'
import { groupDetailMethods, request } from '@/api'
import AddBusiness from './addBusiness'
import { CityArea } from '../components'
export default {
name: 'detail',
components: {
AddBusiness,
CityArea
},
watch: {
},
// mixins: [NoticeMixin],
data() {
return {
// searchCondition: {},
searchParams: {
merchantName: '',
merchantId: null,
merchantType: null,
provinceId: null,
cityId: null,
startTime: '',
endTime: ''
},
times: [],
merchantTypeList: [],
pageNum: 1,
pageSize: 10,
total: 10,
tableLoading: false,
searchLoading: false,
// 高级搜索
dialogVisible_search: false,
// 添加商户
addDialogVisible: false,
// 省市区
showCity: [1, 1],
eventBus: null,
tableData: {
border: true,
align: 'center',
// height: parseInt(this.$client_height() - 140),
data: [],
column: [
{
label: '序号',
prop: 'id'
},
{
label: '商户名称',
prop: 'merchantName'
},
{
label: '商户号',
prop: 'merchantId'
},
{
label: '地区',
prop: 'areaAddress'
},
{
label: '商户类型',
prop: 'merchantTypeName'
},
{
label: '加入分组时间',
prop: 'createTime'
// formatter: cellValue => {
// if (cellValue.createTime) {
// return new Date(cellValue.createTime).format('yyyy-MM-dd')
// }
// }
},
{
label: '父商户名称',
prop: 'parentMerchantName'
},
{
label: '父商户号',
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)
// }
// }
// ]
// }
}
}
},
mounted() {
this.getList()
this.getMerchantType()
this.eventBus = new Vue()
},
methods: {
loadingGetList() {
this.tableLoading = true
this.getList()
},
/* 接口请求-start */
getParams() {
return Object.assign(
{
pageNum: this.pageNum,
pageSize: this.pageSize
},
this.searchParams
)
},
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()
params.methods = groupDetailMethods.Search
console.log(params)
request
.req(params)
.then(res => {
this.total = res.pagination.totalCount
this.tableData.data = res.merchantGroupRelations
this.tableLoading = false
})
.catch(err => {
this.tableLoading = false
console.log(err)
})
},
handleSizeChange(val) {
this.pageSize = val
this.loadingGetList()
},
handleCurrentChange(val) {
this.pageNum = val
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() {
this.dialogVisible_search = !this.dialogVisible_search
// this.idPassvalue.$emit('expressionId', objId)
},
// 关闭高级搜索弹出框
handleClose_search() {
this.dialogVisible_search = !this.dialogVisible_search
},
// 高级搜索
handleSubmit_search() {
this.getList()
},
// 重置搜索
searchReset() {
this.$refs['searchParams'].resetFields()
this.eventBus.$emit('reset')
this.times = []
},
addDialog() {
this.addDialogVisible = !this.addDialogVisible
},
handleAddData() {
this.addDialogVisible = !this.addDialogVisible
},
getCityArea(params) {
if (params[0]) {
this.searchParams.provinceId = params[0]
}
if (params[1]) {
this.searchParams.cityId = params[1]
}
},
merchantDetail(merchantId) {
console.log(merchantId)
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" >
.detail {
.cell {
.el-button {
padding: 2px 10px;
}
}
}
// .tableImg{
// width: 36px;
// height: 36px;
// cursor: pointer;
// }
</style>
...@@ -21,7 +21,7 @@ module.exports = { ...@@ -21,7 +21,7 @@ module.exports = {
}, },
devServer: { devServer: {
port: 8085, port: 8085,
host: 'localhost', host: '0.0.0.0',
open: true, open: true,
proxy: { proxy: {
'/api': { '/api': {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!