|
|
@@ -1,11 +1,19 @@
|
|
|
<template>
|
|
|
- <common-home>
|
|
|
+ <common-home
|
|
|
+ :pageSize="pageParams.size"
|
|
|
+ :total="total"
|
|
|
+ :searchKeys="searchKeys"
|
|
|
+ :searchKey="pageParams.key"
|
|
|
+ :searchKeyword="pageParams.keyword"
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
+ @refresh-data="handleRefreshData"
|
|
|
+ @search="handleSearchAction">
|
|
|
<div slot="screen-type">
|
|
|
<!-- 申诉类型 -->
|
|
|
<label>申诉类型</label>
|
|
|
- <el-select v-model="value" placeholder="不限">
|
|
|
+ <el-select v-model="pageParams.type" clearable placeholder="不限" @change="handleRefreshData">
|
|
|
<el-option
|
|
|
- v-for="item in options"
|
|
|
+ v-for="item in typeOptions"
|
|
|
:key="item.value"
|
|
|
:label="item.label"
|
|
|
:value="item.value">
|
|
|
@@ -14,9 +22,9 @@
|
|
|
|
|
|
<!-- 申诉来源 -->
|
|
|
<label>申诉来源</label>
|
|
|
- <el-select v-model="value" placeholder="不限">
|
|
|
+ <el-select v-model="pageParams.fromApp" clearable placeholder="不限" @change="handleRefreshData">
|
|
|
<el-option
|
|
|
- v-for="item in options"
|
|
|
+ v-for="item in fromAppOptions"
|
|
|
:key="item.value"
|
|
|
:label="item.label"
|
|
|
:value="item.value">
|
|
|
@@ -25,9 +33,9 @@
|
|
|
|
|
|
<!-- 申诉状态 -->
|
|
|
<label>申诉状态</label>
|
|
|
- <el-select v-model="value" placeholder="不限">
|
|
|
+ <el-select v-model="pageParams.status" clearable placeholder="不限" @change="handleRefreshData">
|
|
|
<el-option
|
|
|
- v-for="item in options"
|
|
|
+ v-for="item in statusOptions"
|
|
|
:key="item.value"
|
|
|
:label="item.label"
|
|
|
:value="item.value">
|
|
|
@@ -36,7 +44,7 @@
|
|
|
</div>
|
|
|
|
|
|
<el-table
|
|
|
- :data="tableData"
|
|
|
+ :data="pageContent"
|
|
|
stripe
|
|
|
style="width: 100%">
|
|
|
<el-table-column
|
|
|
@@ -44,67 +52,239 @@
|
|
|
width="130"
|
|
|
align="center">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button @click="handleClick(scope.row)" type="text" size="small">查看</el-button>
|
|
|
+ <el-button type="text" size="small" v-if="scope.row.status === 1" @click="approveRequest(scope.row)">审批</el-button>
|
|
|
+ <el-button type="text" size="small" v-else @click="showDetail(scope.row)">查看</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="name"
|
|
|
- label="姓名"
|
|
|
- width="180">
|
|
|
+ prop="status"
|
|
|
+ label="申诉状态"
|
|
|
+ width="100">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span v-if="scope.row.status === 2">已认证</span>
|
|
|
+ <span v-if="scope.row.status === 0">未认证</span>
|
|
|
+ <span v-if="scope.row.status === 1" style="color: #E68615;">待认证</span>
|
|
|
+ <span v-if="scope.row.status === 3">未通过</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ label="申诉人"
|
|
|
+ width="100">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span v-if="scope.row.submitterUU > 0" v-text="scope.row.contactName"></span>
|
|
|
+ <span v-else>游客</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="submitterUU"
|
|
|
+ label="个人UU"
|
|
|
+ width="80">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span v-if="scope.row.submitterUU > 0" v-text="scope.row.submitterUU"></span>
|
|
|
+ <span v-else>未登录</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="type"
|
|
|
+ label="申诉类型"
|
|
|
+ width="90">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span v-if="scope.row.type === 'validAccount'">验证手机</span>
|
|
|
+ <span v-else-if="scope.row.type === 'changeAdmin'">更换管理员</span>
|
|
|
+ <span v-else-if="scope.row.type === 'resetPassword'">找回密码</span>
|
|
|
+ <span v-else>{{scope.row.type}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="fromApp"
|
|
|
+ label="申诉来源"
|
|
|
+ width="100">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="submitDate"
|
|
|
+ label="申诉时间"
|
|
|
+ :formatter="formatDate"
|
|
|
+ width="150">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="contactName"
|
|
|
+ label="联系人"
|
|
|
+ width="100">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="address"
|
|
|
- label="地址">
|
|
|
+ prop="contactTel"
|
|
|
+ label="手机号"
|
|
|
+ width="120">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="contactEmail"
|
|
|
+ label="邮箱">
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
</common-home>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+ import _ from 'lodash'
|
|
|
+ import axios from '@/assets/js/axios'
|
|
|
import CommonHome from '../common/CommonHome'
|
|
|
|
|
|
+ function showAppealsByPagination (pageParams, success, error) {
|
|
|
+ const params = _.defaultsDeep({}, pageParams)
|
|
|
+ params.page = params.page - 1
|
|
|
+
|
|
|
+ axios.get('/api/appeal//showAppealByPagination', { params })
|
|
|
+ .then(success)
|
|
|
+ .catch(error)
|
|
|
+ }
|
|
|
+
|
|
|
+ function formatDate (row, column, value) {
|
|
|
+ if (!value) {
|
|
|
+ return ''
|
|
|
+ }
|
|
|
+
|
|
|
+ const date = new Date(value)
|
|
|
+ let str = ''
|
|
|
+ str += date.getFullYear() + '-'
|
|
|
+ if (date.getMonth() + 1 < 10) {
|
|
|
+ str += '0'
|
|
|
+ }
|
|
|
+ str += (date.getMonth() + 1) + '-'
|
|
|
+ if (date.getDate() < 10) {
|
|
|
+ str += '0'
|
|
|
+ }
|
|
|
+ str += date.getDate() + ' '
|
|
|
+ if (date.getHours() < 10) {
|
|
|
+ str += '0'
|
|
|
+ }
|
|
|
+ str += date.getHours() + ':'
|
|
|
+ if (date.getMinutes() < 10) {
|
|
|
+ str += '0'
|
|
|
+ }
|
|
|
+ str += date.getMinutes() + ':'
|
|
|
+ if (date.getSeconds() < 10) {
|
|
|
+ str += '0'
|
|
|
+ }
|
|
|
+ str += date.getSeconds()
|
|
|
+ return str
|
|
|
+ }
|
|
|
+
|
|
|
+ const typeOptions = [
|
|
|
+ {
|
|
|
+ label: '找回密码',
|
|
|
+ value: 'resetPassword'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '验证手机',
|
|
|
+ value: 'validAccount'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '更换管理员',
|
|
|
+ value: 'changeAdmin'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+
|
|
|
+ const fromAppOptions = []
|
|
|
+
|
|
|
+ const statusOptions = [
|
|
|
+ {
|
|
|
+ label: '已认证',
|
|
|
+ key: 'AUTHENTICATED',
|
|
|
+ value: 2
|
|
|
+ }, {
|
|
|
+ label: '未认证',
|
|
|
+ key: 'NOT_APPLYING',
|
|
|
+ value: 0
|
|
|
+ }, {
|
|
|
+ label: '待认证',
|
|
|
+ key: 'TO_BE_CERTIFIED',
|
|
|
+ value: 1
|
|
|
+ }, {
|
|
|
+ label: '未通过',
|
|
|
+ key: 'NOT_PASSED',
|
|
|
+ value: 3
|
|
|
+ }
|
|
|
+ ]
|
|
|
+
|
|
|
+ const searchKeys = [
|
|
|
+ {
|
|
|
+ label: '手机号',
|
|
|
+ value: 'contactTel'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+
|
|
|
export default {
|
|
|
- name: 'user-home',
|
|
|
+ name: 'appeal-home',
|
|
|
components: {
|
|
|
CommonHome
|
|
|
},
|
|
|
data () {
|
|
|
return {
|
|
|
- tableData: [{
|
|
|
- date: '查看',
|
|
|
- name: '王小虎',
|
|
|
- address: '上海市普陀区金沙江路 1518 弄'
|
|
|
- }, {
|
|
|
- date: '查看',
|
|
|
- name: '王小虎',
|
|
|
- address: '上海市普陀区金沙江路 1517 弄'
|
|
|
- }, {
|
|
|
- date: '查看',
|
|
|
- name: '王小虎',
|
|
|
- address: '上海市普陀区金沙江路 1519 弄'
|
|
|
- }, {
|
|
|
- date: '查看',
|
|
|
- name: '王小虎',
|
|
|
- address: '上海市普陀区金沙江路 1516 弄'
|
|
|
- }],
|
|
|
- options: [{
|
|
|
- value: '选项1',
|
|
|
- label: '黄金糕'
|
|
|
- }, {
|
|
|
- value: '选项2',
|
|
|
- label: '双皮奶'
|
|
|
- }, {
|
|
|
- value: '选项3',
|
|
|
- label: '蚵仔煎'
|
|
|
- }, {
|
|
|
- value: '选项4',
|
|
|
- label: '龙须面'
|
|
|
- }, {
|
|
|
- value: '选项5',
|
|
|
- label: '北京烤鸭'
|
|
|
- }],
|
|
|
- value: ''
|
|
|
+ pageParams: {
|
|
|
+ page: 1,
|
|
|
+ size: 8,
|
|
|
+ type: null,
|
|
|
+ fromApp: null,
|
|
|
+ status: null,
|
|
|
+ key: 'contactTel',
|
|
|
+ keyword: null
|
|
|
+ },
|
|
|
+ pageContent: [],
|
|
|
+ total: 0,
|
|
|
+ formatDate: formatDate,
|
|
|
+ typeOptions: typeOptions,
|
|
|
+ fromAppOptions: fromAppOptions,
|
|
|
+ statusOptions: statusOptions,
|
|
|
+ searchKeys: searchKeys
|
|
|
}
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ showErrorMessage (error) {
|
|
|
+ this.$message.error(error)
|
|
|
+ },
|
|
|
+ fetchData () {
|
|
|
+ const success = page => {
|
|
|
+ console.log(page)
|
|
|
+ this.pageContent = page.content || []
|
|
|
+ this.total = page.totalElements
|
|
|
+ }
|
|
|
+
|
|
|
+ showAppealsByPagination(this.pageParams, success, this.showErrorMessage)
|
|
|
+ },
|
|
|
+ handleCurrentChange (currentPage) {
|
|
|
+ this.pageParams.page = currentPage
|
|
|
+ this.fetchData()
|
|
|
+ },
|
|
|
+ handleRefreshData () {
|
|
|
+ console.log(this.pageParams)
|
|
|
+ this.fetchData()
|
|
|
+ },
|
|
|
+ handleSearchAction (key, keyword) {
|
|
|
+ console.log(key, keyword)
|
|
|
+ this.pageParams.key = key
|
|
|
+ this.pageParams.keyword = keyword
|
|
|
+
|
|
|
+ this.fetchData()
|
|
|
+ },
|
|
|
+ approveRequest (appeal) {
|
|
|
+ console.log(appeal)
|
|
|
+ if (appeal.type === 'resetPassword') {
|
|
|
+ console.log('找回密码')
|
|
|
+ } else if (appeal.type === 'validAccount') {
|
|
|
+ console.log('验证手机')
|
|
|
+ } else if (appeal.type === 'changeAdmin') {
|
|
|
+ console.log('更换管理员')
|
|
|
+ }
|
|
|
+ },
|
|
|
+ showDetail () {
|
|
|
+ this.$message.info('此功能暂未开通')
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created () {
|
|
|
+ this.fetchData()
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ '$route': 'fetchData'
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
@@ -112,3 +292,7 @@
|
|
|
<style scoped>
|
|
|
|
|
|
</style>
|
|
|
+
|
|
|
+<style>
|
|
|
+
|
|
|
+</style>
|