Compare commits

...

No commits in common. "main" and "master" have entirely different histories.
main ... master

21 changed files with 416 additions and 367 deletions

View File

@ -1,9 +0,0 @@
import request from '@/utils/request'
export function getList(params) {
return request({
url: '/vue-admin-template/table/list',
method: 'get',
params
})
}

View File

@ -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
})
}

View File

@ -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)
}, },

View File

@ -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' })
} }
} }
} }

View File

@ -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

View File

@ -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) {

View File

@ -51,28 +51,19 @@ export const constantRoutes = [
path: 'dashboard', path: 'dashboard',
name: 'Dashboard', name: 'Dashboard',
component: () => import('@/views/dashboard/index'), component: () => import('@/views/dashboard/index'),
meta: { title: 'Dashboard', icon: 'dashboard' } meta: { title: '推广人列表', icon: 'dashboard' }
}] }]
}, },
{ {
path: '/example', path: '/example',
component: Layout, component: Layout,
redirect: '/example/table',
name: 'Example',
meta: { title: 'Example', icon: 'el-icon-s-help' },
children: [ children: [
{ {
path: 'table', path: 'table',
name: 'Table', name: 'Table',
component: () => import('@/views/table/index'), component: () => import('@/views/table/index'),
meta: { title: 'Table', icon: 'table' } meta: { title: '进件审核', icon: 'table' }
},
{
path: 'tree',
name: 'Tree',
component: () => import('@/views/tree/index'),
meta: { title: 'Tree', icon: 'tree' }
} }
] ]
}, },
@ -85,77 +76,7 @@ export const constantRoutes = [
path: 'index', path: 'index',
name: 'Form', name: 'Form',
component: () => import('@/views/form/index'), component: () => import('@/views/form/index'),
meta: { title: 'Form', icon: 'form' } meta: { title: '新增推广人', icon: 'form' }
}
]
},
{
path: '/nested',
component: Layout,
redirect: '/nested/menu1',
name: 'Nested',
meta: {
title: 'Nested',
icon: 'nested'
},
children: [
{
path: 'menu1',
component: () => import('@/views/nested/menu1/index'), // Parent router-view
name: 'Menu1',
meta: { title: 'Menu1' },
children: [
{
path: 'menu1-1',
component: () => import('@/views/nested/menu1/menu1-1'),
name: 'Menu1-1',
meta: { title: 'Menu1-1' }
},
{
path: 'menu1-2',
component: () => import('@/views/nested/menu1/menu1-2'),
name: 'Menu1-2',
meta: { title: 'Menu1-2' },
children: [
{
path: 'menu1-2-1',
component: () => import('@/views/nested/menu1/menu1-2/menu1-2-1'),
name: 'Menu1-2-1',
meta: { title: 'Menu1-2-1' }
},
{
path: 'menu1-2-2',
component: () => import('@/views/nested/menu1/menu1-2/menu1-2-2'),
name: 'Menu1-2-2',
meta: { title: 'Menu1-2-2' }
}
]
},
{
path: 'menu1-3',
component: () => import('@/views/nested/menu1/menu1-3'),
name: 'Menu1-3',
meta: { title: 'Menu1-3' }
}
]
},
{
path: 'menu2',
component: () => import('@/views/nested/menu2/index'),
name: 'Menu2',
meta: { title: 'menu2' }
}
]
},
{
path: 'external-link',
component: Layout,
children: [
{
path: 'https://panjiachen.github.io/vue-element-admin-site/#/',
meta: { title: 'External Link', icon: 'link' }
} }
] ]
}, },

View File

@ -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)
}) // })
}) })
}, },

View File

@ -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

View File

@ -1,6 +1,46 @@
<template> <template>
<div class="dashboard-container"> <div class="dashboard-container">
<div class="dashboard-text">name: {{ name }}</div> <div class="dashboard-text">
<el-table
:data="tableData"
height="800"
border
style="width: 100%"
>
<el-table-column
prop="date"
label="编号"
/>
<el-table-column
prop="name"
label="姓名"
/>
<el-table-column
prop="address"
label="手机号"
/>
<el-table-column
prop="name"
label="推广总数"
/>
<el-table-column
prop="name"
label="审核通过完成数"
/>
<el-table-column
prop="name"
label="入驻时间"
/>
<el-table-column
prop="name"
label="推广人编号"
/>
<el-table-column
prop="name"
label="所在地区"
/>
</el-table>
</div>
</div> </div>
</template> </template>
@ -9,6 +49,39 @@ import { mapGetters } from 'vuex'
export default { export default {
name: 'Dashboard', name: 'Dashboard',
data() {
return {
tableData: [{
date: '2016-05-03',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄'
}, {
date: '2016-05-02',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄'
}, {
date: '2016-05-04',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄'
}, {
date: '2016-05-01',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄'
}, {
date: '2016-05-08',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄'
}, {
date: '2016-05-06',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄'
}, {
date: '2016-05-07',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄'
}]
}
},
computed: { computed: {
...mapGetters([ ...mapGetters([
'name' 'name'

View File

@ -1,77 +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="Activity name"> <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="Activity zone"> <el-form-item label="手机号" prop="phone">
<el-select v-model="form.region" placeholder="please select your zone"> <el-input v-model="form.phone" />
<el-option label="Zone one" value="shanghai" />
<el-option label="Zone two" value="beijing" />
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="Activity time"> <el-form-item label="所属地区" prop="area">
<el-col :span="11"> <el-cascader
<el-date-picker v-model="form.date1" type="date" placeholder="Pick a date" style="width: 100%;" /> ref="cascaderRef"
</el-col> :props="props"
<el-col :span="2" class="line">-</el-col> @change="handleChange"
<el-col :span="11"> />
<el-time-picker v-model="form.date2" type="fixed-time" placeholder="Pick a time" style="width: 100%;" />
</el-col>
</el-form-item>
<el-form-item label="Instant delivery">
<el-switch v-model="form.delivery" />
</el-form-item>
<el-form-item label="Activity type">
<el-checkbox-group v-model="form.type">
<el-checkbox label="Online activities" name="type" />
<el-checkbox label="Promotion activities" name="type" />
<el-checkbox label="Offline activities" name="type" />
<el-checkbox label="Simple brand exposure" name="type" />
</el-checkbox-group>
</el-form-item>
<el-form-item label="Resources">
<el-radio-group v-model="form.resource">
<el-radio label="Sponsor" />
<el-radio label="Venue" />
</el-radio-group>
</el-form-item>
<el-form-item label="Activity form">
<el-input v-model="form.desc" type="textarea" />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="onSubmit">Create</el-button> <el-button type="primary" @click="submitForm('form')">添加</el-button>
<el-button @click="onCancel">Cancel</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: '',
region: '', phone: '',
date1: '', area: {}
date2: '', },
delivery: false, rules: {
type: [], name: [
resource: '', { required: true, message: '请输入名字', trigger: 'blur' }
desc: '' ],
phone: [
{ required: true, message: '请输入手机号', trigger: 'change' },
{ min: 11, max: 11, message: '长度为11位', trigger: 'blur' }
],
area: [
{ required: true, message: '请选择地区', trigger: 'change' }
]
},
proviceID: '',
cityID: '',
provice_name: '',
city_name: '',
area_name: '',
props: {
lazy: true,
lazyLoad(node, resolve) {
var nodes = []
const { level } = node
// 1
const type = level === 0 ? '1' : node.value
const child = []
const child2 = []
if (node.level === 0) {
getArea({ area_level: type }).then(res => {
if (res && res.data) {
//
res.data.map(item => {
const obj = {
value: item.cityCd,
label: item.cityNm,
leaf: level >= 2
}
nodes.push(obj)
this.options = nodes
})
return resolve(nodes)
}
})
} else if (node.level === 1) { //
nodes = this.options
getArea({ parent_city_cd: node.data.value, area_level: '2' }).then(res => {
nodes.map(item => {
if (item.value === node.data.value) {
item.children = []
res.data.map(item2 => {
const obj = {
value: item2.cityCd,
label: item2.cityNm,
leaf: level >= 3
}
item.children.push(obj)
child.push(obj)
})
}
})
this.options = nodes
this.proviceID = node.data.value
this.provice_name = node.data.label
return resolve(child)
})
} else if (node.level === 2) { //
nodes = this.options
this.cityID = node.data.value
this.city_name = node.data.label
getArea({ parent_city_cd: node.data.value, area_level: '3' }).then(res => {
this.options.map(item => {
if (item.value === this.proviceID) {
item.children.map(item2 => {
if (item2.value === this.cityID) {
item2.children = []
res.data.map(item3 => {
const obj = {
value: item3.cityCd,
label: item3.cityNm,
leaf: true
}
item2.children.push(obj)
child2.push(obj)
})
}
})
}
})
return resolve(child2)
})
}
}
} }
} }
}, },
methods: { methods: {
onSubmit() { submitForm(formName) {
this.$message('submit!') this.$refs[formName].validate((valid) => {
}, if (valid) {
onCancel() { register({ name: this.form.name, phone: this.form.phone,
this.$message({ area: {
message: 'cancel!', provice_name: this.form.area.provice_name,
type: 'warning' 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) {
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]
}
} }
} }
} }

View File

@ -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()
} }

View File

@ -1,7 +0,0 @@
<template>
<div style="padding:30px;">
<el-alert :closable="false" title="menu 1">
<router-view />
</el-alert>
</div>
</template>

View File

@ -1,7 +0,0 @@
<template>
<div style="padding:30px;">
<el-alert :closable="false" title="menu 1-1" type="success">
<router-view />
</el-alert>
</div>
</template>

View File

@ -1,7 +0,0 @@
<template>
<div style="padding:30px;">
<el-alert :closable="false" title="menu 1-2" type="success">
<router-view />
</el-alert>
</div>
</template>

View File

@ -1,5 +0,0 @@
<template functional>
<div style="padding:30px;">
<el-alert :closable="false" title="menu 1-2-1" type="warning" />
</div>
</template>

View File

@ -1,5 +0,0 @@
<template functional>
<div style="padding:30px;">
<el-alert :closable="false" title="menu 1-2-2" type="warning" />
</div>
</template>

View File

@ -1,5 +0,0 @@
<template functional>
<div style="padding:30px;">
<el-alert :closable="false" title="menu 1-3" type="success" />
</div>
</template>

View File

@ -1,5 +0,0 @@
<template>
<div style="padding:30px;">
<el-alert :closable="false" title="menu 2" />
</div>
</template>

View File

@ -1,66 +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="ID" width="95"> <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="Title"> <el-table-column label="进件时间" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.title }} <span>{{ scope.row.account_date }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="Author" width="110" align="center"> <el-table-column label="所在地区" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.author }}</span> {{ scope.row.license_address }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="Pageviews" width="110" align="center"> <el-table-column class-name="status-col" label="费率" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.pageviews }} {{ scope.row.rates }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column class-name="status-col" label="Status" width="110" 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 align="center" prop="created_at" label="Display_time" width="200"> <el-table-column class-name="status-col" label="法人名字" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<i class="el-icon-time" /> {{ scope.row.name }}
<span>{{ scope.row.display_time }}</span> </template>
</el-table-column>
<el-table-column class-name="status-col" label="进件人" align="center">
<template slot-scope="scope">
{{ scope.row.manager }}
</template>
</el-table-column>
<el-table-column align="center" prop="created_at" label="进件状态">
<template slot-scope="scope">
<span>{{ scope.row.state==1?'进件中': scope.row.state==2?'审核中':scope.row.state==3?'待签约':scope.row.state==4?'已驳回':'已完成' }}</span>
</template>
</el-table-column>
<el-table-column class-name="status-col" label="详情" align="center">
<template slot-scope="scope">
<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-form :model="form" :inline="true">
<el-form-item label="店铺名称" :label-width="formLabelWidth">
<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 label="法人身份证号" :label-width="formLabelWidth">
<el-input v-model="form.id_number" autocomplete="off" :disabled="true" />
</el-form-item>
<el-form-item label="手机号" :label-width="formLabelWidth">
<el-input v-model="form.phone" autocomplete="off" :disabled="true" />
</el-form-item>
<el-form-item label="邮箱" :label-width="formLabelWidth">
<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.uscc" autocomplete="off" :disabled="true" />
</el-form-item>
<el-form-item label="营业执照名称" :label-width="formLabelWidth">
<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.license_address" autocomplete="off" :disabled="true" />
</el-form-item>
<el-form-item label="结算银行卡号" :label-width="formLabelWidth">
<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.bank_phone" autocomplete="off" :disabled="true" />
</el-form-item>
<el-form-item label="进件人" :label-width="formLabelWidth">
<el-input v-model="form.manager" autocomplete="off" :disabled="true" />
</el-form-item>
<el-form-item label="费率" :label-width="formLabelWidth">
<el-input v-model="form.rates" autocomplete="off" :disabled="true" />
</el-form-item>
<el-form-item label="进件状态" :label-width="formLabelWidth">
<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>
</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,
formLabelWidth: '120px',
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() {
@ -68,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>

View File

@ -1,78 +0,0 @@
<template>
<div class="app-container">
<el-input v-model="filterText" placeholder="Filter keyword" style="margin-bottom:30px;" />
<el-tree
ref="tree2"
:data="data2"
:props="defaultProps"
:filter-node-method="filterNode"
class="filter-tree"
default-expand-all
/>
</div>
</template>
<script>
export default {
data() {
return {
filterText: '',
data2: [{
id: 1,
label: 'Level one 1',
children: [{
id: 4,
label: 'Level two 1-1',
children: [{
id: 9,
label: 'Level three 1-1-1'
}, {
id: 10,
label: 'Level three 1-1-2'
}]
}]
}, {
id: 2,
label: 'Level one 2',
children: [{
id: 5,
label: 'Level two 2-1'
}, {
id: 6,
label: 'Level two 2-2'
}]
}, {
id: 3,
label: 'Level one 3',
children: [{
id: 7,
label: 'Level two 3-1'
}, {
id: 8,
label: 'Level two 3-2'
}]
}],
defaultProps: {
children: 'children',
label: 'label'
}
}
},
watch: {
filterText(val) {
this.$refs.tree2.filter(val)
}
},
methods: {
filterNode(value, data) {
if (!value) return true
return data.label.indexOf(value) !== -1
}
}
}
</script>