This commit is contained in:
parent
fdb942c706
commit
341cbab1b3
|
@ -1,9 +0,0 @@
|
||||||
import request from '@/utils/request'
|
|
||||||
|
|
||||||
export function getList(params) {
|
|
||||||
return request({
|
|
||||||
url: '/vue-admin-template/table/list',
|
|
||||||
method: 'get',
|
|
||||||
params
|
|
||||||
})
|
|
||||||
}
|
|
|
@ -1,5 +1,5 @@
|
||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
|
// 登录
|
||||||
export function login(data) {
|
export function login(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/vue-admin-template/user/login',
|
url: '/vue-admin-template/user/login',
|
||||||
|
@ -7,7 +7,7 @@ export function login(data) {
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 用户信息
|
||||||
export function getInfo(token) {
|
export function getInfo(token) {
|
||||||
return request({
|
return request({
|
||||||
url: '/vue-admin-template/user/info',
|
url: '/vue-admin-template/user/info',
|
||||||
|
@ -15,10 +15,42 @@ export function getInfo(token) {
|
||||||
params: { token }
|
params: { token }
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 登出
|
||||||
export function logout() {
|
export function logout() {
|
||||||
return request({
|
return request({
|
||||||
url: '/vue-admin-template/user/logout',
|
url: '/vue-admin-template/user/logout',
|
||||||
method: 'post'
|
method: 'post'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 推广人注册
|
||||||
|
export function register(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/promoter/register',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 图片上传
|
||||||
|
export function upload(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/public/upload',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 所在地区
|
||||||
|
export function getArea(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/public/areas',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 进件列表
|
||||||
|
export function getApplyList(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/promoter/account_list',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
|
@ -29,12 +29,12 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
getBreadcrumb() {
|
getBreadcrumb() {
|
||||||
// only show routes with meta.title
|
// only show routes with meta.title
|
||||||
let matched = this.$route.matched.filter(item => item.meta && item.meta.title)
|
const matched = this.$route.matched.filter(item => item.meta && item.meta.title)
|
||||||
const first = matched[0]
|
// const first = matched[0]
|
||||||
|
|
||||||
if (!this.isDashboard(first)) {
|
// if (!this.isDashboard(first)) {
|
||||||
matched = [{ path: '/dashboard', meta: { title: 'Dashboard' }}].concat(matched)
|
// matched = [{ path: '/dashboard', meta: { title: '推广人' }}].concat(matched)
|
||||||
}
|
// }
|
||||||
|
|
||||||
this.levelList = matched.filter(item => item.meta && item.meta.title && item.meta.breadcrumb !== false)
|
this.levelList = matched.filter(item => item.meta && item.meta.title && item.meta.breadcrumb !== false)
|
||||||
},
|
},
|
||||||
|
|
|
@ -7,21 +7,10 @@
|
||||||
<div class="right-menu">
|
<div class="right-menu">
|
||||||
<el-dropdown class="avatar-container" trigger="click">
|
<el-dropdown class="avatar-container" trigger="click">
|
||||||
<div class="avatar-wrapper">
|
<div class="avatar-wrapper">
|
||||||
<img :src="avatar+'?imageView2/1/w/80/h/80'" class="user-avatar">
|
<img class="user-avatar" :src="'https://pics0.baidu.com/feed/38dbb6fd5266d0162e9568c498ca300937fa35b9.jpeg?token=7a95a445d85460e466d9063cbc0597e3'" alt="">
|
||||||
<i class="el-icon-caret-bottom" />
|
<i class="el-icon-caret-bottom" />
|
||||||
</div>
|
</div>
|
||||||
<el-dropdown-menu slot="dropdown" class="user-dropdown">
|
<el-dropdown-menu slot="dropdown" class="user-dropdown">
|
||||||
<router-link to="/">
|
|
||||||
<el-dropdown-item>
|
|
||||||
Home
|
|
||||||
</el-dropdown-item>
|
|
||||||
</router-link>
|
|
||||||
<a target="_blank" href="https://github.com/PanJiaChen/vue-admin-template/">
|
|
||||||
<el-dropdown-item>Github</el-dropdown-item>
|
|
||||||
</a>
|
|
||||||
<a target="_blank" href="https://panjiachen.github.io/vue-element-admin-site/#/">
|
|
||||||
<el-dropdown-item>Docs</el-dropdown-item>
|
|
||||||
</a>
|
|
||||||
<el-dropdown-item divided @click.native="logout">
|
<el-dropdown-item divided @click.native="logout">
|
||||||
<span style="display:block;">Log Out</span>
|
<span style="display:block;">Log Out</span>
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
|
@ -53,7 +42,7 @@ export default {
|
||||||
},
|
},
|
||||||
async logout() {
|
async logout() {
|
||||||
await this.$store.dispatch('user/logout')
|
await this.$store.dispatch('user/logout')
|
||||||
this.$router.push(`/login?redirect=${this.$route.fullPath}`)
|
this.$router.push({ name: 'login' })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,9 +29,9 @@ if (process.env.NODE_ENV === 'production') {
|
||||||
}
|
}
|
||||||
|
|
||||||
// set ElementUI lang to EN
|
// set ElementUI lang to EN
|
||||||
Vue.use(ElementUI, { locale })
|
// Vue.use(ElementUI, { locale })
|
||||||
// 如果想要中文版 element-ui,按如下方式声明
|
// 如果想要中文版 element-ui,按如下方式声明
|
||||||
// Vue.use(ElementUI)
|
Vue.use(ElementUI)
|
||||||
|
|
||||||
Vue.config.productionTip = false
|
Vue.config.productionTip = false
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ router.beforeEach(async(to, from, next) => {
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
// get user info
|
// get user info
|
||||||
await store.dispatch('user/getInfo')
|
// await store.dispatch('user/getInfo')
|
||||||
|
|
||||||
next()
|
next()
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
|
@ -30,51 +30,50 @@ const mutations = {
|
||||||
const actions = {
|
const actions = {
|
||||||
// user login
|
// user login
|
||||||
login({ commit }, userInfo) {
|
login({ commit }, userInfo) {
|
||||||
const { username, password } = userInfo
|
// const { username, password } = userInfo
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
login({ username: username.trim(), password: password }).then(response => {
|
// login({ username: username.trim(), password: password }).then(response => {
|
||||||
const { data } = response
|
commit('SET_TOKEN', 'admin-token')
|
||||||
commit('SET_TOKEN', data.token)
|
setToken('admin-token')
|
||||||
setToken(data.token)
|
resolve()
|
||||||
resolve()
|
// }).catch(error => {
|
||||||
}).catch(error => {
|
// reject(error)
|
||||||
reject(error)
|
// })
|
||||||
})
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
// get user info
|
// get user info
|
||||||
getInfo({ commit, state }) {
|
getInfo({ commit, state }) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
getInfo(state.token).then(response => {
|
// getInfo(state.token).then(response => {
|
||||||
const { data } = response
|
// const { data } = response
|
||||||
|
|
||||||
if (!data) {
|
// if (!data) {
|
||||||
return reject('Verification failed, please Login again.')
|
// return reject('Verification failed, please Login again.')
|
||||||
}
|
// }
|
||||||
|
|
||||||
const { name, avatar } = data
|
// const { name, avatar } = data
|
||||||
|
|
||||||
commit('SET_NAME', name)
|
// commit('SET_NAME', name)
|
||||||
commit('SET_AVATAR', avatar)
|
// commit('SET_AVATAR', avatar)
|
||||||
resolve(data)
|
// resolve(data)
|
||||||
}).catch(error => {
|
// }).catch(error => {
|
||||||
reject(error)
|
// reject(error)
|
||||||
})
|
// })
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
// user logout
|
// user logout
|
||||||
logout({ commit, state }) {
|
logout({ commit, state }) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
logout(state.token).then(() => {
|
// logout(state.token).then(() => {
|
||||||
removeToken() // must remove token first
|
removeToken() // must remove token first
|
||||||
resetRouter()
|
resetRouter()
|
||||||
commit('RESET_STATE')
|
commit('RESET_STATE')
|
||||||
resolve()
|
resolve()
|
||||||
}).catch(error => {
|
// }).catch(error => {
|
||||||
reject(error)
|
// reject(error)
|
||||||
})
|
// })
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -5,8 +5,9 @@ import { getToken } from '@/utils/auth'
|
||||||
|
|
||||||
// create an axios instance
|
// create an axios instance
|
||||||
const service = axios.create({
|
const service = axios.create({
|
||||||
baseURL: process.env.VUE_APP_BASE_API, // url = base url + request url
|
// baseURL: process.env.VUE_APP_BASE_API, // url = base url + request url
|
||||||
// withCredentials: true, // send cookies when cross-domain requests
|
// withCredentials: true, // send cookies when cross-domain requests
|
||||||
|
baseURL: 'http://192.168.0.155:7301',
|
||||||
timeout: 5000 // request timeout
|
timeout: 5000 // request timeout
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -46,26 +47,12 @@ service.interceptors.response.use(
|
||||||
const res = response.data
|
const res = response.data
|
||||||
|
|
||||||
// if the custom code is not 20000, it is judged as an error.
|
// if the custom code is not 20000, it is judged as an error.
|
||||||
if (res.code !== 20000) {
|
if (res.code !== 200) {
|
||||||
Message({
|
Message({
|
||||||
message: res.message || 'Error',
|
message: res.message || 'Error',
|
||||||
type: 'error',
|
type: 'error',
|
||||||
duration: 5 * 1000
|
duration: 5 * 1000
|
||||||
})
|
})
|
||||||
|
|
||||||
// 50008: Illegal token; 50012: Other clients logged in; 50014: Token expired;
|
|
||||||
if (res.code === 50008 || res.code === 50012 || res.code === 50014) {
|
|
||||||
// to re-login
|
|
||||||
MessageBox.confirm('You have been logged out, you can cancel to stay on this page, or log in again', 'Confirm logout', {
|
|
||||||
confirmButtonText: 'Re-Login',
|
|
||||||
cancelButtonText: 'Cancel',
|
|
||||||
type: 'warning'
|
|
||||||
}).then(() => {
|
|
||||||
store.dispatch('user/resetToken').then(() => {
|
|
||||||
location.reload()
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
return Promise.reject(new Error(res.message || 'Error'))
|
return Promise.reject(new Error(res.message || 'Error'))
|
||||||
} else {
|
} else {
|
||||||
return res
|
return res
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<div class="dashboard-text">
|
<div class="dashboard-text">
|
||||||
<el-table
|
<el-table
|
||||||
:data="tableData"
|
:data="tableData"
|
||||||
height="250"
|
height="800"
|
||||||
border
|
border
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
>
|
>
|
||||||
|
|
|
@ -1,239 +1,160 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form ref="form" :model="form" label-width="120px">
|
<el-form ref="form" :model="form" label-width="120px" :rules="rules">
|
||||||
<el-form-item label="名字">
|
<el-form-item label="名字" prop="name">
|
||||||
<el-input v-model="form.name" />
|
<el-input v-model="form.name" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="手机号">
|
<el-form-item label="手机号" prop="phone">
|
||||||
<el-input v-model="form.phone" />
|
<el-input v-model="form.phone" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="所属地区">
|
<el-form-item label="所属地区" prop="area">
|
||||||
<el-cascader
|
<el-cascader
|
||||||
v-model="form.area"
|
ref="cascaderRef"
|
||||||
:options="options"
|
:props="props"
|
||||||
placeholder="请选择地区"
|
|
||||||
@change="handleChange"
|
@change="handleChange"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" @click="onSubmit">添加</el-button>
|
<el-button type="primary" @click="submitForm('form')">添加</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { register, getArea } from '@/api/user'
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
form: {
|
form: {
|
||||||
name: '',
|
name: '',
|
||||||
phone: '',
|
phone: '',
|
||||||
area: ''
|
area: {}
|
||||||
},
|
},
|
||||||
options: [{
|
rules: {
|
||||||
value: 'zhinan',
|
name: [
|
||||||
label: '指南',
|
{ required: true, message: '请输入名字', trigger: 'blur' }
|
||||||
children: [{
|
],
|
||||||
value: 'shejiyuanze',
|
phone: [
|
||||||
label: '设计原则',
|
{ required: true, message: '请输入手机号', trigger: 'change' },
|
||||||
children: [{
|
{ min: 11, max: 11, message: '长度为11位', trigger: 'blur' }
|
||||||
value: 'yizhi',
|
],
|
||||||
label: '一致'
|
area: [
|
||||||
}, {
|
{ required: true, message: '请选择地区', trigger: 'change' }
|
||||||
value: 'fankui',
|
]
|
||||||
label: '反馈'
|
},
|
||||||
}, {
|
proviceID: '',
|
||||||
value: 'xiaolv',
|
cityID: '',
|
||||||
label: '效率'
|
provice_name: '',
|
||||||
}, {
|
city_name: '',
|
||||||
value: 'kekong',
|
area_name: '',
|
||||||
label: '可控'
|
props: {
|
||||||
}]
|
lazy: true,
|
||||||
}, {
|
lazyLoad(node, resolve) {
|
||||||
value: 'daohang',
|
var nodes = []
|
||||||
label: '导航',
|
const { level } = node
|
||||||
children: [{
|
// 为1代表第一次请求
|
||||||
value: 'cexiangdaohang',
|
const type = level === 0 ? '1' : node.value
|
||||||
label: '侧向导航'
|
const child = []
|
||||||
}, {
|
const child2 = []
|
||||||
value: 'dingbudaohang',
|
if (node.level === 0) {
|
||||||
label: '顶部导航'
|
getArea({ area_level: type }).then(res => {
|
||||||
}]
|
if (res && res.data) {
|
||||||
}]
|
// 处理正常的数据
|
||||||
}, {
|
res.data.map(item => {
|
||||||
value: 'zujian',
|
const obj = {
|
||||||
label: '组件',
|
value: item.cityCd,
|
||||||
children: [{
|
label: item.cityNm,
|
||||||
value: 'basic',
|
leaf: level >= 2
|
||||||
label: 'Basic',
|
}
|
||||||
children: [{
|
nodes.push(obj)
|
||||||
value: 'layout',
|
this.options = nodes
|
||||||
label: 'Layout 布局'
|
})
|
||||||
}, {
|
return resolve(nodes)
|
||||||
value: 'color',
|
}
|
||||||
label: 'Color 色彩'
|
})
|
||||||
}, {
|
} else if (node.level === 1) { // 选择市区
|
||||||
value: 'typography',
|
nodes = this.options
|
||||||
label: 'Typography 字体'
|
getArea({ parent_city_cd: node.data.value, area_level: '2' }).then(res => {
|
||||||
}, {
|
nodes.map(item => {
|
||||||
value: 'icon',
|
if (item.value === node.data.value) {
|
||||||
label: 'Icon 图标'
|
item.children = []
|
||||||
}, {
|
res.data.map(item2 => {
|
||||||
value: 'button',
|
const obj = {
|
||||||
label: 'Button 按钮'
|
value: item2.cityCd,
|
||||||
}]
|
label: item2.cityNm,
|
||||||
}, {
|
leaf: level >= 3
|
||||||
value: 'form',
|
}
|
||||||
label: 'Form',
|
item.children.push(obj)
|
||||||
children: [{
|
child.push(obj)
|
||||||
value: 'radio',
|
})
|
||||||
label: 'Radio 单选框'
|
}
|
||||||
}, {
|
})
|
||||||
value: 'checkbox',
|
this.options = nodes
|
||||||
label: 'Checkbox 多选框'
|
this.proviceID = node.data.value
|
||||||
}, {
|
this.provice_name = node.data.label
|
||||||
value: 'input',
|
return resolve(child)
|
||||||
label: 'Input 输入框'
|
})
|
||||||
}, {
|
} else if (node.level === 2) { // 选择县区
|
||||||
value: 'input-number',
|
nodes = this.options
|
||||||
label: 'InputNumber 计数器'
|
this.cityID = node.data.value
|
||||||
}, {
|
this.city_name = node.data.label
|
||||||
value: 'select',
|
getArea({ parent_city_cd: node.data.value, area_level: '3' }).then(res => {
|
||||||
label: 'Select 选择器'
|
this.options.map(item => {
|
||||||
}, {
|
if (item.value === this.proviceID) {
|
||||||
value: 'cascader',
|
item.children.map(item2 => {
|
||||||
label: 'Cascader 级联选择器'
|
if (item2.value === this.cityID) {
|
||||||
}, {
|
item2.children = []
|
||||||
value: 'switch',
|
res.data.map(item3 => {
|
||||||
label: 'Switch 开关'
|
const obj = {
|
||||||
}, {
|
value: item3.cityCd,
|
||||||
value: 'slider',
|
label: item3.cityNm,
|
||||||
label: 'Slider 滑块'
|
leaf: true
|
||||||
}, {
|
}
|
||||||
value: 'time-picker',
|
item2.children.push(obj)
|
||||||
label: 'TimePicker 时间选择器'
|
child2.push(obj)
|
||||||
}, {
|
})
|
||||||
value: 'date-picker',
|
}
|
||||||
label: 'DatePicker 日期选择器'
|
})
|
||||||
}, {
|
}
|
||||||
value: 'datetime-picker',
|
})
|
||||||
label: 'DateTimePicker 日期时间选择器'
|
return resolve(child2)
|
||||||
}, {
|
})
|
||||||
value: 'upload',
|
}
|
||||||
label: 'Upload 上传'
|
}
|
||||||
}, {
|
}
|
||||||
value: 'rate',
|
|
||||||
label: 'Rate 评分'
|
|
||||||
}, {
|
|
||||||
value: 'form',
|
|
||||||
label: 'Form 表单'
|
|
||||||
}]
|
|
||||||
}, {
|
|
||||||
value: 'data',
|
|
||||||
label: 'Data',
|
|
||||||
children: [{
|
|
||||||
value: 'table',
|
|
||||||
label: 'Table 表格'
|
|
||||||
}, {
|
|
||||||
value: 'tag',
|
|
||||||
label: 'Tag 标签'
|
|
||||||
}, {
|
|
||||||
value: 'progress',
|
|
||||||
label: 'Progress 进度条'
|
|
||||||
}, {
|
|
||||||
value: 'tree',
|
|
||||||
label: 'Tree 树形控件'
|
|
||||||
}, {
|
|
||||||
value: 'pagination',
|
|
||||||
label: 'Pagination 分页'
|
|
||||||
}, {
|
|
||||||
value: 'badge',
|
|
||||||
label: 'Badge 标记'
|
|
||||||
}]
|
|
||||||
}, {
|
|
||||||
value: 'notice',
|
|
||||||
label: 'Notice',
|
|
||||||
children: [{
|
|
||||||
value: 'alert',
|
|
||||||
label: 'Alert 警告'
|
|
||||||
}, {
|
|
||||||
value: 'loading',
|
|
||||||
label: 'Loading 加载'
|
|
||||||
}, {
|
|
||||||
value: 'message',
|
|
||||||
label: 'Message 消息提示'
|
|
||||||
}, {
|
|
||||||
value: 'message-box',
|
|
||||||
label: 'MessageBox 弹框'
|
|
||||||
}, {
|
|
||||||
value: 'notification',
|
|
||||||
label: 'Notification 通知'
|
|
||||||
}]
|
|
||||||
}, {
|
|
||||||
value: 'navigation',
|
|
||||||
label: 'Navigation',
|
|
||||||
children: [{
|
|
||||||
value: 'menu',
|
|
||||||
label: 'NavMenu 导航菜单'
|
|
||||||
}, {
|
|
||||||
value: 'tabs',
|
|
||||||
label: 'Tabs 标签页'
|
|
||||||
}, {
|
|
||||||
value: 'breadcrumb',
|
|
||||||
label: 'Breadcrumb 面包屑'
|
|
||||||
}, {
|
|
||||||
value: 'dropdown',
|
|
||||||
label: 'Dropdown 下拉菜单'
|
|
||||||
}, {
|
|
||||||
value: 'steps',
|
|
||||||
label: 'Steps 步骤条'
|
|
||||||
}]
|
|
||||||
}, {
|
|
||||||
value: 'others',
|
|
||||||
label: 'Others',
|
|
||||||
children: [{
|
|
||||||
value: 'dialog',
|
|
||||||
label: 'Dialog 对话框'
|
|
||||||
}, {
|
|
||||||
value: 'tooltip',
|
|
||||||
label: 'Tooltip 文字提示'
|
|
||||||
}, {
|
|
||||||
value: 'popover',
|
|
||||||
label: 'Popover 弹出框'
|
|
||||||
}, {
|
|
||||||
value: 'card',
|
|
||||||
label: 'Card 卡片'
|
|
||||||
}, {
|
|
||||||
value: 'carousel',
|
|
||||||
label: 'Carousel 走马灯'
|
|
||||||
}, {
|
|
||||||
value: 'collapse',
|
|
||||||
label: 'Collapse 折叠面板'
|
|
||||||
}]
|
|
||||||
}]
|
|
||||||
}, {
|
|
||||||
value: 'ziyuan',
|
|
||||||
label: '资源',
|
|
||||||
children: [{
|
|
||||||
value: 'axure',
|
|
||||||
label: 'Axure Components'
|
|
||||||
}, {
|
|
||||||
value: 'sketch',
|
|
||||||
label: 'Sketch Templates'
|
|
||||||
}, {
|
|
||||||
value: 'jiaohu',
|
|
||||||
label: '组件交互文档'
|
|
||||||
}]
|
|
||||||
}]
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
onSubmit() {
|
submitForm(formName) {
|
||||||
this.$message('submit!')
|
this.$refs[formName].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
register({ name: this.form.name, phone: this.form.phone,
|
||||||
|
area: {
|
||||||
|
provice_name: this.form.area.provice_name,
|
||||||
|
city_name: this.form.area.city_name,
|
||||||
|
area_name: this.form.area.area_name
|
||||||
|
}}
|
||||||
|
).then(res => {
|
||||||
|
if (res && res.code === 200) {
|
||||||
|
this.$message('添加成功!')
|
||||||
|
this.resetForm(formName)
|
||||||
|
} else {
|
||||||
|
this.$message(res.msg)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
resetForm(formName) {
|
||||||
|
this.$refs[formName].resetFields()
|
||||||
},
|
},
|
||||||
handleChange(value) {
|
handleChange(value) {
|
||||||
console.log(value)
|
this.form.area = {
|
||||||
|
provice_name: this.$refs['cascaderRef'].getCheckedNodes()[0].pathLabels[0],
|
||||||
|
city_name: this.$refs['cascaderRef'].getCheckedNodes()[0].pathLabels[1],
|
||||||
|
area_name: this.$refs['cascaderRef'].getCheckedNodes()[0].pathLabels[2]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form" auto-complete="on" label-position="left">
|
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form" auto-complete="on" label-position="left">
|
||||||
|
|
||||||
<div class="title-container">
|
<div class="title-container">
|
||||||
<h3 class="title">Login Form</h3>
|
<h3 class="title">登录</h3>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<el-form-item prop="username">
|
<el-form-item prop="username">
|
||||||
|
@ -41,7 +41,7 @@
|
||||||
</span>
|
</span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-button :loading="loading" type="primary" style="width:100%;margin-bottom:30px;" @click.native.prevent="handleLogin">Login</el-button>
|
<el-button :loading="loading" type="primary" style="width:100%;margin-bottom:30px;" @click.native.prevent="handleLogin">登录</el-button>
|
||||||
|
|
||||||
<div class="tips">
|
<div class="tips">
|
||||||
<span style="margin-right:20px;">username: admin</span>
|
<span style="margin-right:20px;">username: admin</span>
|
||||||
|
@ -67,7 +67,7 @@ export default {
|
||||||
}
|
}
|
||||||
const validatePassword = (rule, value, callback) => {
|
const validatePassword = (rule, value, callback) => {
|
||||||
if (value.length < 6) {
|
if (value.length < 6) {
|
||||||
callback(new Error('The password can not be less than 6 digits'))
|
callback(new Error('密码不能少于6位数'))
|
||||||
} else {
|
} else {
|
||||||
callback()
|
callback()
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,155 +1,138 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
|
<!-- -->
|
||||||
<el-table
|
<el-table
|
||||||
v-loading="listLoading"
|
|
||||||
:data="list"
|
|
||||||
element-loading-text="Loading"
|
element-loading-text="Loading"
|
||||||
|
:data="list"
|
||||||
border
|
border
|
||||||
fit
|
fit
|
||||||
highlight-current-row
|
highlight-current-row
|
||||||
>
|
>
|
||||||
<el-table-column align="center" label="商户名字">
|
<el-table-column align="center" label="商户名字">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ scope.$index }}
|
{{ scope.row.shop_name }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="进件时间" align="center">
|
<el-table-column label="进件时间" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ scope.row.author }}</span>
|
<span>{{ scope.row.account_date }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="所在地区" align="center">
|
<el-table-column label="所在地区" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ scope.row.pageviews }}
|
{{ scope.row.license_address }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column class-name="status-col" label="费率" align="center">
|
<el-table-column class-name="status-col" label="费率" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-tag :type="scope.row.status | statusFilter">{{ scope.row.status }}</el-tag>
|
{{ scope.row.rates }}
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column class-name="status-col" label="所属行业" align="center">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-tag :type="scope.row.status | statusFilter">{{ scope.row.status }}</el-tag>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column class-name="status-col" label="商户手机号" align="center">
|
<el-table-column class-name="status-col" label="商户手机号" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-tag :type="scope.row.status | statusFilter">{{ scope.row.status }}</el-tag>
|
{{ scope.row.phone }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column class-name="status-col" label="法人名字" align="center">
|
<el-table-column class-name="status-col" label="法人名字" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-tag :type="scope.row.status | statusFilter">{{ scope.row.status }}</el-tag>
|
{{ scope.row.name }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column class-name="status-col" label="进件人" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.manager }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" prop="created_at" label="进件状态">
|
<el-table-column align="center" prop="created_at" label="进件状态">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<i class="el-icon-time" />
|
<span>{{ scope.row.state==1?'进件中': scope.row.state==2?'审核中':scope.row.state==3?'待签约':scope.row.state==4?'已驳回':'已完成' }}</span>
|
||||||
<span>{{ scope.row.display_time }}</span>
|
|
||||||
<el-button type="success" size="mini">通过</el-button>
|
|
||||||
<el-button type="danger" size="mini">驳回</el-button>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column class-name="status-col" label="详情" align="center">
|
<el-table-column class-name="status-col" label="详情" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span style="color: #3033d1;" @click="dialogFormVisible =true">查看</span>
|
<span style="color: #409EFF;" @click="checkInfo(scope.row)">查看</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<el-dialog title="进件详情" :visible.sync="dialogFormVisible">
|
<el-dialog title="进件详情" :visible.sync="dialogFormVisible">
|
||||||
<el-form :model="form" :inline="true">
|
<el-form :model="form" :inline="true">
|
||||||
<el-form-item label="商户类型" :label-width="formLabelWidth">
|
|
||||||
<el-input v-model="form.name" autocomplete="off" :disabled="true" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="店铺名称" :label-width="formLabelWidth">
|
<el-form-item label="店铺名称" :label-width="formLabelWidth">
|
||||||
<el-input v-model="form.name" autocomplete="off" :disabled="true" />
|
<el-input v-model="form.shop_name" autocomplete="off" :disabled="true" />
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="身份证正反面" :label-width="formLabelWidth">
|
|
||||||
<el-input v-model="form.name" autocomplete="off" :disabled="true" />
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="法人姓名" :label-width="formLabelWidth">
|
<el-form-item label="法人姓名" :label-width="formLabelWidth">
|
||||||
<el-input v-model="form.name" autocomplete="off" :disabled="true" />
|
<el-input v-model="form.name" autocomplete="off" :disabled="true" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="身份证号" :label-width="formLabelWidth">
|
<el-form-item label="法人身份证号" :label-width="formLabelWidth">
|
||||||
<el-input v-model="form.name" autocomplete="off" :disabled="true" />
|
<el-input v-model="form.id_number" autocomplete="off" :disabled="true" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="手机号" :label-width="formLabelWidth">
|
<el-form-item label="手机号" :label-width="formLabelWidth">
|
||||||
<el-input v-model="form.name" autocomplete="off" :disabled="true" />
|
<el-input v-model="form.phone" autocomplete="off" :disabled="true" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="邮箱" :label-width="formLabelWidth">
|
<el-form-item label="邮箱" :label-width="formLabelWidth">
|
||||||
<el-input v-model="form.name" autocomplete="off" :disabled="true" />
|
<el-input v-model="form.email" autocomplete="off" :disabled="true" />
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="营业执照" :label-width="formLabelWidth">
|
|
||||||
<el-input v-model="form.name" autocomplete="off" :disabled="true" />
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
label="统一社会信用代
|
label="统一社会信用代
|
||||||
码"
|
码"
|
||||||
:label-width="formLabelWidth"
|
:label-width="formLabelWidth"
|
||||||
>
|
>
|
||||||
<el-input v-model="form.name" autocomplete="off" :disabled="true" />
|
<el-input v-model="form.uscc" autocomplete="off" :disabled="true" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="营业执照名称" :label-width="formLabelWidth">
|
<el-form-item label="营业执照名称" :label-width="formLabelWidth">
|
||||||
<el-input v-model="form.name" autocomplete="off" :disabled="true" />
|
<el-input v-model="form.license_name" autocomplete="off" :disabled="true" />
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="执照有效期" :label-width="formLabelWidth">
|
|
||||||
<el-input v-model="form.name" autocomplete="off" :disabled="true" />
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="营业执照地址" :label-width="formLabelWidth">
|
<el-form-item label="营业执照地址" :label-width="formLabelWidth">
|
||||||
<el-input v-model="form.name" autocomplete="off" :disabled="true" />
|
<el-input v-model="form.license_address" autocomplete="off" :disabled="true" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="商户营业地区" :label-width="formLabelWidth">
|
<el-form-item label="结算银行卡号" :label-width="formLabelWidth">
|
||||||
<el-input v-model="form.name" autocomplete="off" :disabled="true" />
|
<el-input v-model="form.bank_number" autocomplete="off" :disabled="true" />
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="银行卡正反面" :label-width="formLabelWidth">
|
|
||||||
<el-input v-model="form.name" autocomplete="off" :disabled="true" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="银行卡号" :label-width="formLabelWidth">
|
|
||||||
<el-input v-model="form.name" autocomplete="off" :disabled="true" />
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="预留手机号" :label-width="formLabelWidth">
|
<el-form-item label="预留手机号" :label-width="formLabelWidth">
|
||||||
<el-input v-model="form.name" autocomplete="off" :disabled="true" />
|
<el-input v-model="form.bank_phone" autocomplete="off" :disabled="true" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="客户经理" :label-width="formLabelWidth">
|
<el-form-item label="进件人" :label-width="formLabelWidth">
|
||||||
<el-input v-model="form.name" autocomplete="off" :disabled="true" />
|
<el-input v-model="form.manager" autocomplete="off" :disabled="true" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="费率" :label-width="formLabelWidth">
|
<el-form-item label="费率" :label-width="formLabelWidth">
|
||||||
<el-input v-model="form.name" autocomplete="off" :disabled="true" />
|
<el-input v-model="form.rates" autocomplete="off" :disabled="true" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="进件状态" :label-width="formLabelWidth">
|
<el-form-item label="进件状态" :label-width="formLabelWidth">
|
||||||
<el-input v-model="form.name" autocomplete="off" :disabled="true" />
|
<el-input v-model="form.state==1?'进件中': form.state==2?'审核中':form.state==3?'待签约':form.state==4?'已驳回':'已完成'" autocomplete="off" :disabled="true" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
|
||||||
<el-button @click="dialogFormVisible = false">驳回</el-button>
|
|
||||||
<el-button type="primary" @click="dialogFormVisible = false">通过</el-button>
|
|
||||||
</div>
|
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
<!-- 分页 -->
|
||||||
|
<el-pagination
|
||||||
|
background
|
||||||
|
layout="prev, pager, next"
|
||||||
|
:total="total"
|
||||||
|
:page-size="size"
|
||||||
|
:current-page="page"
|
||||||
|
@size-change="handleSizeChange"
|
||||||
|
@current-change="handleCurrentChange"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getList } from '@/api/table'
|
import { getApplyList } from '@/api/user'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
filters: {
|
|
||||||
statusFilter(status) {
|
|
||||||
const statusMap = {
|
|
||||||
published: 'success',
|
|
||||||
draft: 'gray',
|
|
||||||
deleted: 'danger'
|
|
||||||
}
|
|
||||||
return statusMap[status]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
list: null,
|
list: [],
|
||||||
listLoading: true,
|
|
||||||
dialogFormVisible: false,
|
dialogFormVisible: false,
|
||||||
formLabelWidth: '120px',
|
formLabelWidth: '120px',
|
||||||
form: {}
|
form: {},
|
||||||
|
page: 1,
|
||||||
|
size: 20,
|
||||||
|
total: 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
currentList() {
|
||||||
|
const start = (this.page - 1) * this.size
|
||||||
|
return this.list.slice(start, start + this.size) // 返回当前页的数据
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
@ -157,12 +140,33 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
fetchData() {
|
fetchData() {
|
||||||
this.listLoading = true
|
getApplyList({ page: this.page, size: this.size }).then(res => {
|
||||||
getList().then(response => {
|
this.total = res.data.total || 0
|
||||||
this.list = response.data.items
|
this.list = res.data.data || []
|
||||||
this.listLoading = false
|
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
handleSizeChange(val) {
|
||||||
|
this.size = val // 更新每页显示条数
|
||||||
|
this.page = 1 // 当页面大小改变时返回到第一页
|
||||||
|
this.fetchData()
|
||||||
|
},
|
||||||
|
handleCurrentChange(val) {
|
||||||
|
this.page = val // 更新当前页
|
||||||
|
this.fetchData() // 重新拉取数据
|
||||||
|
},
|
||||||
|
checkInfo(row) {
|
||||||
|
this.form = row
|
||||||
|
this.dialogFormVisible = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
.el-pagination {
|
||||||
|
text-align: center;
|
||||||
|
margin-top: 20px;
|
||||||
|
}
|
||||||
|
.el-table th.status-col {
|
||||||
|
width: 120px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
Loading…
Reference in New Issue