Commit 0dba450d by cwq0219

商户列表

1 parent 5251e82f
This diff could not be displayed because it is too large.
import {
GlAxios
} from 'glsx-vue-common'
const path = '/oss-merchant-data/businessList'
const __sGetList = `${path}/findMerchantsRemote`
const getList = {
p: [__sGetList],
req: params => GlAxios.get(__sGetList, {
params
})
}
export {
getList
}
......@@ -4,6 +4,7 @@ import Vue from 'vue'
import GlsxVueComponents from 'glsx-vue-components'
import 'glsx-vue-components/dist/glsx-vue-components.css'
import './styles/index.scss'
import './styles/common.scss'
// import axios from 'axios'
Vue.use(GlsxVueComponents)
......@@ -31,8 +32,8 @@ var mixin = {
})
}
}
const URL = ' http://192.168.3.171:7300/mock/5be17454f31545347559d499/config'
const getConfig = (url = URL + '/authority_common') => {
const URL = 'http://192.168.3.171:7300/mock/5be17454f31545347559d499/config'
const getConfig = (url = URL + '/business_data_config') => {
return new Promise(resolve => {
const xhr = new XMLHttpRequest()
xhr.onreadystatechange = () => {
......
.default {
position: relative;
padding: 0px 25px;
}
.m-b10 {
margin-bottom: 10px;
}
.p-t15 {
padding-top: 15px;
}
\ No newline at end of file
<!-- 新增商户 -->
<template>
<div>
<gl-dialog
:title="title"
:visible.sync="isVisible"
:before-close="handleClose"
:width="diaWidth"
>
<gl-form
:model="merchantForm"
label-width="85px"
>
<gl-form-item label="商户名称:">
<gl-input
v-model="merchantForm.name"
placeholder="请输入商户名称"
clearable
></gl-input>
</gl-form-item>
<gl-form-item label="商户地址:"></gl-form-item>
<gl-form-item label="商户渠道:">
<gl-select
v-model="merchantForm.merchantChannel"
placeholder="请选择"
></gl-select>
</gl-form-item>
<gl-form-item label="联系人:">
<gl-input
v-model="merchantForm.contactor"
placeholder="请输入联系人姓名"
clearable
></gl-input>
</gl-form-item>
<gl-form-item label="手机号码:">
<gl-input
v-model="merchantForm.contactPhone"
placeholder="请输入联系人手机号码"
clearable
></gl-input>
</gl-form-item>
</gl-form>
<span slot="footer">
<el-button
type="primary"
@click="handleComfrim"
>确 定</el-button>
<el-button @click="handleClose">取 消</el-button>
</span>
</gl-dialog>
</div>
</template>
<script>
export default {
name: 'AddDialog',
data() {
return {
title: '新增商户'
}
},
props: {
isVisible: {
type: Boolean,
default: false
},
diaWidth: {
type: String,
default: '40%'
},
merchantForm: Object
},
methods: {
handleClose() {
this.$emit('hideDialog')
},
handleComfrim() {
this.$emit('comfirmDialog')
}
}
}
</script>
<style>
</style>
\ No newline at end of file
<!-- 搜索弹窗 -->
<template>
<div>
<gl-dialog
:title="title"
:visible.sync="isVisible"
:before-close="handleClose"
:width="diaWidth"
>
<gl-form
:model="merchantSearch"
label-width="85px"
>
<gl-form-item label="商户名称:">
<gl-input
v-model="merchantSearch.name"
placeholder="请输入商户名称"
clearable
></gl-input>
</gl-form-item>
<gl-col :span="12">
<gl-form-item label="商户号:">
<gl-input
v-model="merchantSearch.merchantId"
placeholder="请输入商户号"
clearable
></gl-input>
</gl-form-item>
</gl-col>
<gl-col :span="12">
<gl-form-item label="地区:">
<gl-col :span="11">
<gl-select
v-model="merchantSearch.provinceId"
placeholder="省"
>
</gl-select>
</gl-col>
<gl-col
:span="11"
:push="2"
>
<gl-select
v-model="merchantSearch.cityId"
placeholder="市"
>
</gl-select>
</gl-col>
</gl-form-item>
</gl-col>
<gl-col :span="12">
<gl-form-item label="渠道:">
<gl-select
style="width: 100%;"
v-model="merchantSearch.merchantChannel"
placeholder="请选择渠道"
></gl-select>
</gl-form-item>
</gl-col>
<gl-col :span="12">
<gl-form-item label="状态:">
<gl-select
style="width: 100%;"
v-model="merchantSearch.merchantStatus"
placeholder="请选择状态"
>
<!-- <gl-option
v-for="(item, index) in statusItems"
:key="item"
:value="index"
:label="item"
></gl-option> -->
<gl-option
v-for="(value, key) in statusItems"
:key="value"
:value="key"
:label="value"
></gl-option>
</gl-select>
</gl-form-item>
</gl-col>
<gl-col>
<gl-form-item label="注册时间:">
<gl-col :span="11">
<gl-date-picker
type="date"
placeholder="选择日期"
v-model="merchantSearch.startTime"
style="width:92%;"
></gl-date-picker>
</gl-col>
<gl-col
class="line"
:span="2"
>至</gl-col>
<gl-col :span="11">
<gl-date-picker
type="date"
placeholder="选择日期"
v-model="merchantSearch.endTime"
style="width: 100%;"
></gl-date-picker>
</gl-col>
</gl-form-item>
</gl-col>
</gl-form>
<span slot="footer">
<el-button
type="primary"
@click="handleComfrim"
>搜 索</el-button>
<el-button @click="hideDialog">重 置</el-button>
</span>
</gl-dialog>
</div>
</template>
<script>
export default {
name: 'SearchDialog',
data() {
return {
title: '高级搜索'
}
},
props: {
isVisible: {
type: Boolean,
default: false
},
diaWidth: {
type: String,
default: '40%'
},
merchantSearch: Object,
statusItems: Object
},
methods: {
handleClose() {
this.$emit('hideDialog', true)
},
handleComfrim() {
this.$emit('comfirmDialog')
},
hideDialog() {
this.$emit('hideDialog')
}
}
}
</script>
<style>
</style>
\ No newline at end of file
<template>
<div>
<h1>商户列表</h1>
<div class="default">
<div class="m-b10">
<gl-button
type="primary"
@click="handleSearch"
>高级搜索</gl-button>
<gl-button type="primary" @click="handleAdd">新增商户</gl-button>
</div>
<div>
<gl-table
class="m-b10"
:table="ListTableData"
></gl-table>
<gl-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="currentPage"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize"
layout="sizes, total, ->, prev, pager, next"
:total="total"
>
</gl-pagination>
</div>
<add-dialog
@hideDialog="handleAddHide"
@comfirmDialog="handleAddComfirm"
:isVisible="addVisible"
:merchantForm="merchantForm">
</add-dialog>
<search-dialog
@comfirmDialog="handleSearchComfirm"
@hideDialog="handleSearchHide"
:isVisible="searchVisible"
:merchantSearch="merchantSearch"
:statusItems="status"
>
</search-dialog>
</div>
</template>
<script>
import SearchDialog from './SearchDialog'
import AddDialog from './AddDialog'
import { getList } from '@/api/bussinessListApi'
export default {
name: 'businessList'
name: 'businessList',
components: {
SearchDialog,
AddDialog
},
data() {
return {
// 新增弹窗
addVisible: false,
merchantForm: {
merchantName: '',
address: '',
merchantChannel: '',
contactor: '',
contactPhone: ''
},
// 搜索弹窗
searchVisible: false,
merchantSearch: {
name: '',
merchantId: '',
provinceId: '',
cityId: '',
merchantChannel: '',
merchantStatus: '',
startTime: '',
endTime: ''
},
// status: ['已停用', '已启用', '待审核'],
status: {
0: '已停用',
1: '已启用',
2: '待审核'
},
// 分页所需参数-start
total: 10,
currentPage: 1,
pageSize: 10,
// 分页所需参数-end
ListTableData: {
border: true,
height: parseInt(this.$client_height() - 140),
align: 'center',
data: [],
column: [{
label: '商户名称',
prop: 'merchantName'
}, {
label: '商户号',
prop: 'merchantId'
}, {
label: '地区',
prop: 'merchantAdd'
}, {
label: '渠道',
prop: 'merchantChannel'
}, {
label: '联系人',
prop: 'merchantContact'
}, {
label: '电话',
prop: 'merchantPhone'
}, {
label: '注册时间',
prop: 'merchantTime'
}, {
label: '状态',
prop: 'merchantStatus',
formatter: (cellValue) => {
return this.status[cellValue.merchantStatus]
}
}],
number: {
label: '序号',
width: '80px',
index: (index) => {
++index
return index
}
},
console: {
show: true,
label: '操作',
button: [{
label: '详情',
type: 'text',
callback: (index, rows) => {
console.log(rows[index])
}
}]
}
}
}
},
mounted() {
this.getList()
},
methods: {
// 获取页面参数
getParams() {
const params = this.$deep_clone(this.merchantSearch)
params.pageSize = this.pageSize
params.currentPage = this.currentPage
return params
},
// 接口请求-start
getList() {
const params = this.getParams()
getList.req(params).then(res => {
this.ListTableData.data = res.data
this.total = res.total
this.reset(this.merchantSearch)
}).catch(err => {
console.log(err)
this.reset(this.merchantSearch)
})
},
// 接口请求-end
handleSizeChange(val) {
this.pageSize = val
this.getList()
},
handleCurrentChange(val) {
this.currentPage = val
this.getList()
},
reset(params) {
for (var item in params) {
params[item] = ''
}
},
// 搜索-start--------
handleSearch() {
this.searchVisible = !this.searchVisible
},
// 隐藏/重置
handleSearchHide(hide) {
this.reset(this.merchantSearch)
hide && this.handleSearch()
},
// 搜索
handleSearchComfirm() {
this.handleSearch()
this.getList()
},
// 搜索-end--------
// 新增
handleAdd() {
this.addVisible = !this.addVisible
},
handleAddHide() {
this.handleAdd()
this.reset(this.merchantForm)
},
handleAddComfirm() {
this.handleAdd()
}
}
}
</script>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!