更新操作栏
parent
a90f0bd897
commit
cbfd5bbbcd
@ -1,52 +1,52 @@
|
||||
<!--
|
||||
* @Description:
|
||||
* @Autor: 飘泊客
|
||||
* @Date: 2021-12-02 16:54:53
|
||||
* @LastEditors: 飘泊客
|
||||
* @LastEditTime: 2022-11-02 10:52:06
|
||||
-->
|
||||
<script>
|
||||
import { DatePicker, DatePickerOptions } from 'element-ui'
|
||||
import { calendarShortcuts } from '@/utils/shortcuts'
|
||||
|
||||
export default {
|
||||
name: 'DateRangePicker',
|
||||
mixins: [DatePicker],
|
||||
props: {
|
||||
type: {
|
||||
type: String,
|
||||
default: 'daterange'
|
||||
},
|
||||
valueFormat: {
|
||||
type: String,
|
||||
default: 'yyyy-MM-dd HH:mm:ss'
|
||||
},
|
||||
defaultTime: {
|
||||
type: Array,
|
||||
default: _ => ['00:00:00', '23:59:59']
|
||||
},
|
||||
pickerOptions: {
|
||||
type: DatePickerOptions,
|
||||
default: _ => {
|
||||
return { shortcuts: calendarShortcuts }
|
||||
}
|
||||
},
|
||||
size: {
|
||||
type: String,
|
||||
default: 'small'
|
||||
},
|
||||
rangeSeparator: {
|
||||
type: String,
|
||||
default: ':'
|
||||
},
|
||||
startPlaceholder: {
|
||||
type: String,
|
||||
default: '开始日期'
|
||||
},
|
||||
endPlaceholder: {
|
||||
type: String,
|
||||
default: '结束日期'
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<!--
|
||||
* @Description:
|
||||
* @Autor: 飘泊客
|
||||
* @Date: 2021-12-02 16:54:53
|
||||
* @LastEditors: 飘泊客
|
||||
* @LastEditTime: 2022-11-02 10:52:06
|
||||
-->
|
||||
<script>
|
||||
import { DatePicker, DatePickerOptions } from 'element-ui'
|
||||
import { calendarShortcuts } from '@/utils/shortcuts'
|
||||
|
||||
export default {
|
||||
name: 'DateRangePicker',
|
||||
mixins: [DatePicker],
|
||||
props: {
|
||||
type: {
|
||||
type: String,
|
||||
default: 'daterange'
|
||||
},
|
||||
valueFormat: {
|
||||
type: String,
|
||||
default: 'yyyy-MM-dd HH:mm:ss'
|
||||
},
|
||||
defaultTime: {
|
||||
type: Array,
|
||||
default: _ => ['00:00:00', '23:59:59']
|
||||
},
|
||||
pickerOptions: {
|
||||
type: DatePickerOptions,
|
||||
default: _ => {
|
||||
return { shortcuts: calendarShortcuts }
|
||||
}
|
||||
},
|
||||
size: {
|
||||
type: String,
|
||||
default: 'small'
|
||||
},
|
||||
rangeSeparator: {
|
||||
type: String,
|
||||
default: ':'
|
||||
},
|
||||
startPlaceholder: {
|
||||
type: String,
|
||||
default: '开始日期'
|
||||
},
|
||||
endPlaceholder: {
|
||||
type: String,
|
||||
default: '结束日期'
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,235 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-row :gutter="20">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div>
|
||||
<!-- 搜索 -->
|
||||
<date-range-picker v-model="query.createTime" class="date-item" />
|
||||
<el-input
|
||||
v-model="query.taskName"
|
||||
clearable
|
||||
size="small"
|
||||
placeholder="输入任务名"
|
||||
style="width: 200px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
<!-- <el-select v-model="value" size="small" class="filter-item" style="width: 110px" clearable placeholder="请选择状态" @change="crud.toQuery">
|
||||
<el-option :value="0">等待建模</el-option>
|
||||
<el-option :value="1">建模成功</el-option>
|
||||
</el-select> -->
|
||||
<rrOperation />
|
||||
</div>
|
||||
</div>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
:header-cell-style="{ 'text-align': 'left' }"
|
||||
style="width: 100%;"
|
||||
>
|
||||
<el-table-column :show-overflow-tooltip="true" prop="id" label="ID" width="35" />
|
||||
<el-table-column
|
||||
:show-overflow-tooltip="true"
|
||||
prop="taskName"
|
||||
label="任务名"
|
||||
/>
|
||||
<el-table-column
|
||||
:show-overflow-tooltip="true"
|
||||
prop="uploadNum"
|
||||
label="上传数量"
|
||||
/>
|
||||
<el-table-column
|
||||
:show-overflow-tooltip="true"
|
||||
prop="analysisNum"
|
||||
label="解析数量"
|
||||
/>
|
||||
<el-table-column
|
||||
:show-overflow-tooltip="true"
|
||||
prop="payTime"
|
||||
width="135"
|
||||
label="上传时间"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
:show-overflow-tooltip="true"
|
||||
prop="payTime"
|
||||
width="110"
|
||||
label="发送类型"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span>{{ statecCmparison('uploadTypeList', scope.row.recordType) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
:show-overflow-tooltip="true"
|
||||
prop="recordStatus"
|
||||
width="110"
|
||||
label="状态"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span>{{ statecCmparison('statusList', scope.row.recordStatus) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
width="75"
|
||||
label="操作"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
slot="reference"
|
||||
size="mini"
|
||||
type="text"
|
||||
:disabled="scope.row.recordStatus !== 1"
|
||||
@click="openModeling(scope.row.id)"
|
||||
>建模</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<template #empty>
|
||||
<div style="width: 100%; height: 450px;display: flex; flex-direction: column; justify-content: center;align-items: center">
|
||||
<img src="@/assets/images/zanwu.png" alt="">
|
||||
<div>暂无数据</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</el-row>
|
||||
<el-dialog title="建模创建" :visible.sync="dialogFormVisible" width="420px" @close="closeDialog">
|
||||
<el-form ref="refForm" :model="modelingForm">
|
||||
<el-form-item label="活动ID" prop="actId" :rules="[{ required: true, message: '请输入活动id'}]">
|
||||
<el-input v-model="modelingForm.actId" autocomplete="off" />
|
||||
</el-form-item>
|
||||
<el-form-item label="活动名称" prop="actName" :rules="[{ required: true, message: '请输入活动名称'}]">
|
||||
<el-input v-model="modelingForm.actName" autocomplete="off" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="dialogFormVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="recordBuildFun">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import DateRangePicker from '@/components/DateRangePicker'
|
||||
import {
|
||||
recordBuild
|
||||
} from '@/api/index'
|
||||
import { mapGetters } from 'vuex'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
const defaultForm = {}
|
||||
export default {
|
||||
name: 'ManageIndex',
|
||||
components: { rrOperation, pagination, DateRangePicker },
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '建模管理',
|
||||
url: 'api-management/api/mode/record',
|
||||
crudMethod: {}
|
||||
})
|
||||
},
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
data() {
|
||||
return {
|
||||
height: document.documentElement.clientHeight - 180 + 'px;',
|
||||
permission: {
|
||||
add: ['admin', 'user:add'],
|
||||
edit: ['admin', 'user:edit'],
|
||||
del: ['admin', 'user:del'],
|
||||
download: ['admin', 'user:download']
|
||||
},
|
||||
dialogFormVisible: false,
|
||||
modelingForm: {
|
||||
id: '',
|
||||
actId: '',
|
||||
actName: ''
|
||||
},
|
||||
uploadTypeList: [
|
||||
{
|
||||
key: '方式一',
|
||||
value: '0'
|
||||
},
|
||||
{
|
||||
key: '方式二',
|
||||
value: '1'
|
||||
},
|
||||
{
|
||||
key: '方式三',
|
||||
value: '2'
|
||||
}
|
||||
],
|
||||
statusList: [
|
||||
{
|
||||
key: '上传失败',
|
||||
value: '-1'
|
||||
},
|
||||
{
|
||||
key: '上传中',
|
||||
value: '0'
|
||||
},
|
||||
{
|
||||
key: '上传成功',
|
||||
value: '1'
|
||||
},
|
||||
{
|
||||
key: '建模中',
|
||||
value: '2'
|
||||
},
|
||||
{
|
||||
key: '建模成功',
|
||||
value: '3'
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['user'])
|
||||
},
|
||||
created() {
|
||||
},
|
||||
mounted: function() {
|
||||
const that = this
|
||||
window.onresize = function temp() {
|
||||
that.height = document.documentElement.clientHeight - 180 + 'px;'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
openModeling(id) {
|
||||
this.modelingForm.id = id
|
||||
this.dialogFormVisible = true
|
||||
},
|
||||
closeDialog() {
|
||||
this.$refs.refForm.resetFields()
|
||||
},
|
||||
recordBuildFun() {
|
||||
this.$refs.refForm.validate((valid) => {
|
||||
if (valid) {
|
||||
recordBuild(this.modelingForm).then(res => {
|
||||
this.$message('操作成功')
|
||||
this.dialogFormVisible = false
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
statecCmparison(name, val) {
|
||||
return this[name].filter(item => { return Number(item.value) === val })[0].key
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
::v-deep .el-dialog__body {
|
||||
padding: 20px;
|
||||
}
|
||||
</style>
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,293 +1,293 @@
|
||||
<!--
|
||||
* @Description:
|
||||
* @Autor: 飘泊客
|
||||
* @Date: 2022-04-19 15:52:12
|
||||
* @LastEditors: 飘泊客
|
||||
* @LastEditTime: 2023-05-06 14:25:58
|
||||
-->
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-row :gutter="20">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<el-input
|
||||
v-model="query.phone"
|
||||
clearable
|
||||
size="small"
|
||||
placeholder="输入手机号码搜索"
|
||||
style="width: 200px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
<!-- <date-range-picker v-model="query.createTime" class="date-item" /> -->
|
||||
<!-- <el-select
|
||||
v-model="query.enabled"
|
||||
clearable
|
||||
size="small"
|
||||
placeholder="状态"
|
||||
class="filter-item"
|
||||
style="width: 90px"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in enabledTypeOptions"
|
||||
:key="item.key"
|
||||
:label="item.display_name"
|
||||
:value="item.key"
|
||||
/>
|
||||
</el-select> -->
|
||||
<rrOperation />
|
||||
</div>
|
||||
<!-- <crudOperation show="" :permission="permission" @onRechargeArr="onRecharges">
|
||||
<template v-slot:right>
|
||||
<div class="rig-btn filter-item">
|
||||
<el-upload
|
||||
class="upload-demo"
|
||||
:action="importUsers"
|
||||
:show-file-list="false"
|
||||
:headers="headers"
|
||||
accept=".xlsx,.xls"
|
||||
multiple
|
||||
:limit="1"
|
||||
:on-success="onsucess"
|
||||
:on-error="onerror"
|
||||
>
|
||||
<el-button size="mini" type="primary">批量上传</el-button>
|
||||
</el-upload>
|
||||
<el-link type="primary" :underline="false" @click="downLink">(模板下载)</el-link>
|
||||
</div>
|
||||
</template>
|
||||
</crudOperation> -->
|
||||
</div>
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" style="width: 100%;" :header-cell-style="{'text-align':'left'}" @selection-change="crud.selectionChangeHandler">
|
||||
<el-table-column :show-overflow-tooltip="true" prop="phone" label="用户名" />
|
||||
<el-table-column prop="invitationNums" label="邀请数量" width="80" />
|
||||
<el-table-column :show-overflow-tooltip="true" width="135" prop="qrCodePath" label="分销二维码">
|
||||
<template slot-scope="scope">
|
||||
<el-image
|
||||
style="width: 100px; height: 100px"
|
||||
:src=" baseImgUrl + scope.row.qrCodePath"
|
||||
fit="contain"
|
||||
:preview-src-list="previewImg(baseImgUrl + scope.row.qrCodePath)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" align="center" width="100" prop="status">
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
v-model="scope.row.status"
|
||||
:disabled="user.id === scope.row.id"
|
||||
active-color="#409EFF"
|
||||
inactive-color="#F56C6C"
|
||||
@change="changeEnabled(scope.row, scope.row.status)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :show-overflow-tooltip="true" prop="lastLoginTime" label="最后登录时间">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.lastLoginTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :show-overflow-tooltip="true" prop="createTime" label="创建日期">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-permission="['admin','user:edit','user:del']"
|
||||
label="操作"
|
||||
width="140"
|
||||
fixed="right"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-button slot="reference" type="primary" size="mini" @click="openDetail(scope.row.id)">详情</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</el-row>
|
||||
<el-dialog append-to-body :close-on-click-modal="false" :visible.sync="recordProp" title="分销人员" width="850px">
|
||||
<!-- <div class="mb-10">
|
||||
<date-range-picker v-model="childrenQuery.createTime" class="date-item" />
|
||||
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="toQuery">搜索</el-button>
|
||||
</div> -->
|
||||
<el-table ref="table" v-loading="detail.loading" :data="detail.data" :header-cell-style="{'text-align':'left'}" style="width: 100%;">
|
||||
<el-table-column :show-overflow-tooltip="true" prop="name" label="姓名" width="80" />
|
||||
<el-table-column prop="nid" label="电话" width="120" />
|
||||
<el-table-column :show-overflow-tooltip="true" prop="debtType" label="债务类别">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ (scope.row.debtType == 0 ? '信用卡' : scope.row.debtType == 1 ? '网贷' : '信用卡+网贷') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :show-overflow-tooltip="true" prop="quota" label="额度">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ (scope.row.quota == 0 ? '5-10万' : scope.row.quota == 1 ? '10-20万' : scope.row.quota == 2 ? '20-30万' : scope.row.quota == 3 ? '30-50万' : '50万以上') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :show-overflow-tooltip="true" prop="createTime" label="创建日期">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<el-pagination
|
||||
:page-size.sync="page.size"
|
||||
:total="page.total"
|
||||
:current-page.sync="page.page"
|
||||
style="margin-top: 8px;"
|
||||
layout="total, prev, pager, next"
|
||||
@current-change="pageChangeHandler"
|
||||
/>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="recordProp = false">关闭</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudUser from '@/api/system/user'
|
||||
import { getToken } from '@/utils/auth'
|
||||
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import { mapGetters } from 'vuex'
|
||||
import { updateUserStatus, debtqueryAll } from '@/api/index'
|
||||
const defaultForm = { id: null, username: null, nickName: null, gender: '男', email: null, enabled: 'false', roles: [], jobs: [], dept: { id: null }, phone: null }
|
||||
// 分销商
|
||||
export default {
|
||||
name: 'Distributor',
|
||||
components: { rrOperation, pagination },
|
||||
cruds() {
|
||||
return CRUD({ title: '分销商', url: 'api-management/api/form/user/queryAll', crudMethod: { ...crudUser }})
|
||||
},
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
// 数据字典
|
||||
dicts: ['user_status'],
|
||||
data() {
|
||||
return {
|
||||
height: document.documentElement.clientHeight - 180 + 'px;',
|
||||
deptName: '', depts: [], deptDatas: [], jobs: [], level: 3, roles: [],
|
||||
jobDatas: [], roleDatas: '', // 多选时使用
|
||||
defaultProps: { children: 'children', label: 'name', isLeaf: 'leaf' },
|
||||
permission: {
|
||||
add: ['admin', 'user:add'],
|
||||
edit: ['admin', 'user:edit'],
|
||||
del: ['admin', 'user:del'],
|
||||
download: ['admin', 'user:download'],
|
||||
copy: true,
|
||||
more: true,
|
||||
recharge: true
|
||||
},
|
||||
enabledTypeOptions: [
|
||||
{ key: 'true', display_name: '激活' },
|
||||
{ key: 'false', display_name: '锁定' }
|
||||
],
|
||||
headers: {
|
||||
Authorization: 'Bearer ' + getToken()
|
||||
},
|
||||
page: {
|
||||
page: 1,
|
||||
size: 10,
|
||||
total: 0
|
||||
},
|
||||
childrenQuery: {
|
||||
createTime: ''
|
||||
},
|
||||
detail: {
|
||||
data: [],
|
||||
loading: false
|
||||
},
|
||||
recordProp: false,
|
||||
detailId: null // 二级操作id
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'user',
|
||||
'importUsers',
|
||||
'baseImgUrl'
|
||||
])
|
||||
},
|
||||
created() {},
|
||||
mounted: function() {
|
||||
const that = this
|
||||
window.onresize = function temp() {
|
||||
that.height = document.documentElement.clientHeight - 180 + 'px;'
|
||||
}
|
||||
setTimeout(() => {
|
||||
console.log(this.crud.data)
|
||||
}, 6000)
|
||||
},
|
||||
methods: {
|
||||
// 改变状态
|
||||
changeEnabled(data, val) {
|
||||
this.$confirm('此操作将 "' + this.dict.label.user_status[val] + '" ' + data.phone + ', 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
updateUserStatus({ status: data.status, id: data.id }).then(res => {
|
||||
this.crud.notify(this.dict.label.user_status[val] + '成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
}).catch(() => {
|
||||
data.status = !data.status
|
||||
})
|
||||
}).catch(() => {
|
||||
data.status = !data.status
|
||||
})
|
||||
},
|
||||
// 预览图片
|
||||
previewImg(img) {
|
||||
return [img]
|
||||
},
|
||||
// 修改页码
|
||||
pageChangeHandler(option) {
|
||||
this.page.page = option
|
||||
this.searchDetail()
|
||||
},
|
||||
openDetail(id) {
|
||||
this.detailId = id
|
||||
this.page.page = 1
|
||||
this.searchDetail()
|
||||
},
|
||||
// 搜索
|
||||
toQuery() {
|
||||
this.page.page = 1
|
||||
this.searchDetail()
|
||||
},
|
||||
searchDetail() {
|
||||
this.detail.loading = true
|
||||
this.recordProp = true
|
||||
debtqueryAll({ userId: this.detailId, createTime: this.childrenQuery.createTime, page: this.page.page - 1, size: this.page.size }).then(res => {
|
||||
this.page.total = res.totalElements
|
||||
this.detail.data = res.content
|
||||
this.detail.loading = false
|
||||
}).catch(() => {
|
||||
this.detail.loading = false
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
::v-deep .vue-treeselect__control,::v-deep .vue-treeselect__placeholder,::v-deep .vue-treeselect__single-value {
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
}
|
||||
.rig-btn {
|
||||
width: 180px;
|
||||
display: flex!important;
|
||||
}
|
||||
.upload-demo {
|
||||
margin-left: 7px;
|
||||
}
|
||||
.head-container ::v-deep .crud-opts-left {
|
||||
display: inherit!important;
|
||||
}
|
||||
</style>
|
||||
<!--
|
||||
* @Description:
|
||||
* @Autor: 飘泊客
|
||||
* @Date: 2022-04-19 15:52:12
|
||||
* @LastEditors: 飘泊客
|
||||
* @LastEditTime: 2023-05-06 14:25:58
|
||||
-->
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-row :gutter="20">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<el-input
|
||||
v-model="query.phone"
|
||||
clearable
|
||||
size="small"
|
||||
placeholder="输入手机号码搜索"
|
||||
style="width: 200px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
<!-- <date-range-picker v-model="query.createTime" class="date-item" /> -->
|
||||
<!-- <el-select
|
||||
v-model="query.enabled"
|
||||
clearable
|
||||
size="small"
|
||||
placeholder="状态"
|
||||
class="filter-item"
|
||||
style="width: 90px"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in enabledTypeOptions"
|
||||
:key="item.key"
|
||||
:label="item.display_name"
|
||||
:value="item.key"
|
||||
/>
|
||||
</el-select> -->
|
||||
<rrOperation />
|
||||
</div>
|
||||
<!-- <crudOperation show="" :permission="permission" @onRechargeArr="onRecharges">
|
||||
<template v-slot:right>
|
||||
<div class="rig-btn filter-item">
|
||||
<el-upload
|
||||
class="upload-demo"
|
||||
:action="importUsers"
|
||||
:show-file-list="false"
|
||||
:headers="headers"
|
||||
accept=".xlsx,.xls"
|
||||
multiple
|
||||
:limit="1"
|
||||
:on-success="onsucess"
|
||||
:on-error="onerror"
|
||||
>
|
||||
<el-button size="mini" type="primary">批量上传</el-button>
|
||||
</el-upload>
|
||||
<el-link type="primary" :underline="false" @click="downLink">(模板下载)</el-link>
|
||||
</div>
|
||||
</template>
|
||||
</crudOperation> -->
|
||||
</div>
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" style="width: 100%;" :header-cell-style="{'text-align':'left'}" @selection-change="crud.selectionChangeHandler">
|
||||
<el-table-column :show-overflow-tooltip="true" prop="phone" label="用户名" />
|
||||
<el-table-column prop="invitationNums" label="邀请数量" width="80" />
|
||||
<el-table-column :show-overflow-tooltip="true" width="135" prop="qrCodePath" label="分销二维码">
|
||||
<template slot-scope="scope">
|
||||
<el-image
|
||||
style="width: 100px; height: 100px"
|
||||
:src=" baseImgUrl + scope.row.qrCodePath"
|
||||
fit="contain"
|
||||
:preview-src-list="previewImg(baseImgUrl + scope.row.qrCodePath)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" align="center" width="100" prop="status">
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
v-model="scope.row.status"
|
||||
:disabled="user.id === scope.row.id"
|
||||
active-color="#409EFF"
|
||||
inactive-color="#F56C6C"
|
||||
@change="changeEnabled(scope.row, scope.row.status)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :show-overflow-tooltip="true" prop="lastLoginTime" label="最后登录时间">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.lastLoginTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :show-overflow-tooltip="true" prop="createTime" label="创建日期">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-permission="['admin','user:edit','user:del']"
|
||||
label="操作"
|
||||
width="75"
|
||||
fixed="right"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-button slot="reference" type="primary" size="mini" @click="openDetail(scope.row.id)">详情</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</el-row>
|
||||
<el-dialog append-to-body :close-on-click-modal="false" :visible.sync="recordProp" title="分销人员" width="850px">
|
||||
<!-- <div class="mb-10">
|
||||
<date-range-picker v-model="childrenQuery.createTime" class="date-item" />
|
||||
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="toQuery">搜索</el-button>
|
||||
</div> -->
|
||||
<el-table ref="table" v-loading="detail.loading" :data="detail.data" :header-cell-style="{'text-align':'left'}" style="width: 100%;">
|
||||
<el-table-column :show-overflow-tooltip="true" prop="name" label="姓名" width="80" />
|
||||
<el-table-column prop="nid" label="电话" width="120" />
|
||||
<el-table-column :show-overflow-tooltip="true" prop="debtType" label="债务类别">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ (scope.row.debtType == 0 ? '信用卡' : scope.row.debtType == 1 ? '网贷' : '信用卡+网贷') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :show-overflow-tooltip="true" prop="quota" label="额度">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ (scope.row.quota == 0 ? '5-10万' : scope.row.quota == 1 ? '10-20万' : scope.row.quota == 2 ? '20-30万' : scope.row.quota == 3 ? '30-50万' : '50万以上') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :show-overflow-tooltip="true" prop="createTime" label="创建日期">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<el-pagination
|
||||
:page-size.sync="page.size"
|
||||
:total="page.total"
|
||||
:current-page.sync="page.page"
|
||||
style="margin-top: 8px;"
|
||||
layout="total, prev, pager, next"
|
||||
@current-change="pageChangeHandler"
|
||||
/>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="recordProp = false">关闭</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudUser from '@/api/system/user'
|
||||
import { getToken } from '@/utils/auth'
|
||||
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import { mapGetters } from 'vuex'
|
||||
import { updateUserStatus, debtqueryAll } from '@/api/index'
|
||||
const defaultForm = { id: null, username: null, nickName: null, gender: '男', email: null, enabled: 'false', roles: [], jobs: [], dept: { id: null }, phone: null }
|
||||
// 分销商
|
||||
export default {
|
||||
name: 'Distributor',
|
||||
components: { rrOperation, pagination },
|
||||
cruds() {
|
||||
return CRUD({ title: '分销商', url: 'api-management/api/form/user/queryAll', crudMethod: { ...crudUser }})
|
||||
},
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
// 数据字典
|
||||
dicts: ['user_status'],
|
||||
data() {
|
||||
return {
|
||||
height: document.documentElement.clientHeight - 180 + 'px;',
|
||||
deptName: '', depts: [], deptDatas: [], jobs: [], level: 3, roles: [],
|
||||
jobDatas: [], roleDatas: '', // 多选时使用
|
||||
defaultProps: { children: 'children', label: 'name', isLeaf: 'leaf' },
|
||||
permission: {
|
||||
add: ['admin', 'user:add'],
|
||||
edit: ['admin', 'user:edit'],
|
||||
del: ['admin', 'user:del'],
|
||||
download: ['admin', 'user:download'],
|
||||
copy: true,
|
||||
more: true,
|
||||
recharge: true
|
||||
},
|
||||
enabledTypeOptions: [
|
||||
{ key: 'true', display_name: '激活' },
|
||||
{ key: 'false', display_name: '锁定' }
|
||||
],
|
||||
headers: {
|
||||
Authorization: 'Bearer ' + getToken()
|
||||
},
|
||||
page: {
|
||||
page: 1,
|
||||
size: 10,
|
||||
total: 0
|
||||
},
|
||||
childrenQuery: {
|
||||
createTime: ''
|
||||
},
|
||||
detail: {
|
||||
data: [],
|
||||
loading: false
|
||||
},
|
||||
recordProp: false,
|
||||
detailId: null // 二级操作id
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'user',
|
||||
'importUsers',
|
||||
'baseImgUrl'
|
||||
])
|
||||
},
|
||||
created() {},
|
||||
mounted: function() {
|
||||
const that = this
|
||||
window.onresize = function temp() {
|
||||
that.height = document.documentElement.clientHeight - 180 + 'px;'
|
||||
}
|
||||
setTimeout(() => {
|
||||
console.log(this.crud.data)
|
||||
}, 6000)
|
||||
},
|
||||
methods: {
|
||||
// 改变状态
|
||||
changeEnabled(data, val) {
|
||||
this.$confirm('此操作将 "' + this.dict.label.user_status[val] + '" ' + data.phone + ', 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
updateUserStatus({ status: data.status, id: data.id }).then(res => {
|
||||
this.crud.notify(this.dict.label.user_status[val] + '成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
}).catch(() => {
|
||||
data.status = !data.status
|
||||
})
|
||||
}).catch(() => {
|
||||
data.status = !data.status
|
||||
})
|
||||
},
|
||||
// 预览图片
|
||||
previewImg(img) {
|
||||
return [img]
|
||||
},
|
||||
// 修改页码
|
||||
pageChangeHandler(option) {
|
||||
this.page.page = option
|
||||
this.searchDetail()
|
||||
},
|
||||
openDetail(id) {
|
||||
this.detailId = id
|
||||
this.page.page = 1
|
||||
this.searchDetail()
|
||||
},
|
||||
// 搜索
|
||||
toQuery() {
|
||||
this.page.page = 1
|
||||
this.searchDetail()
|
||||
},
|
||||
searchDetail() {
|
||||
this.detail.loading = true
|
||||
this.recordProp = true
|
||||
debtqueryAll({ userId: this.detailId, createTime: this.childrenQuery.createTime, page: this.page.page - 1, size: this.page.size }).then(res => {
|
||||
this.page.total = res.totalElements
|
||||
this.detail.data = res.content
|
||||
this.detail.loading = false
|
||||
}).catch(() => {
|
||||
this.detail.loading = false
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
::v-deep .vue-treeselect__control,::v-deep .vue-treeselect__placeholder,::v-deep .vue-treeselect__single-value {
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
}
|
||||
.rig-btn {
|
||||
width: 180px;
|
||||
display: flex!important;
|
||||
}
|
||||
.upload-demo {
|
||||
margin-left: 7px;
|
||||
}
|
||||
.head-container ::v-deep .crud-opts-left {
|
||||
display: inherit!important;
|
||||
}
|
||||
</style>
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue