|
@@ -0,0 +1,345 @@
|
|
|
+<template>
|
|
|
+ <div class="data-export-user-list">
|
|
|
+ <div class="dataBox">
|
|
|
+ <el-table
|
|
|
+ v-loading="loading"
|
|
|
+ :data="tableDataReport.list"
|
|
|
+ style="width: 100%">
|
|
|
+ <el-table-column
|
|
|
+ prop="user_name"
|
|
|
+ label="姓名"
|
|
|
+ width="90">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="daily_limit"
|
|
|
+ label="每日限额"
|
|
|
+ align="center"
|
|
|
+ width="100">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div class="setNumber highlight-text">
|
|
|
+ <span v-if="scope.row.setNumber_daily_limit" @click="scope.row.setNumber_daily_limit = false,overstep_daily_limit=true"> {{ limitFormatter(scope.row.daily_limit) }} </span>
|
|
|
+ <div v-else>
|
|
|
+ <el-tooltip class="item" effect="dark" content="限额超出,请重新输入" placement="top" :value="true" manual :disabled="overstep_daily_limit">
|
|
|
+ <input v-model="scope.row.daily_limit" type="number" autofocus @blur="setLimit('daily_limit', scope.row)" maxlength="8" />
|
|
|
+ </el-tooltip>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ width="100"
|
|
|
+ align="center"
|
|
|
+ label="总量限额">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div class="setNumber highlight-text">
|
|
|
+ <span v-if="scope.row.setNumber_total_limit" @click="scope.row.setNumber_total_limit = false,overstep_total_limit=true"> {{ limitFormatter(scope.row.total_limit) }} </span>
|
|
|
+ <div v-else>
|
|
|
+ <el-tooltip class="item" effect="dark" content="限额超出,请重新输入" placement="top" :value="true" manual :disabled="overstep_total_limit">
|
|
|
+ <input v-model="scope.row.total_limit" type="number" autofocus @blur="setLimit('total_limit', scope.row)" maxlength="8" />
|
|
|
+ </el-tooltip>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-Column
|
|
|
+ prop="record_phone"
|
|
|
+ label="手机">
|
|
|
+ </el-table-Column>
|
|
|
+ <el-table-column
|
|
|
+ prop="name"
|
|
|
+ label="部门">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="user_identity"
|
|
|
+ label="角色">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.row.user_identity || '--' }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span class="edit" @click="del_recordPerson(scope.row)">删除</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ <div class="pagination-container" v-if="totalAll > 0">
|
|
|
+ <el-pagination
|
|
|
+ popper-class="pagination-custom-select"
|
|
|
+ background
|
|
|
+ layout="prev, pager, next, sizes, jumper"
|
|
|
+ :key="pageobj.key"
|
|
|
+ :page-size="pageobj.pageSize"
|
|
|
+ :current-page="pageobj.current"
|
|
|
+ :total="totalAll"
|
|
|
+ :page-sizes="[5, 10, 50, 100]"
|
|
|
+ :show-confirm-btn="true"
|
|
|
+ @current-change="getPageData"
|
|
|
+ @size-change="onSizeChange"
|
|
|
+ >
|
|
|
+ </el-pagination>
|
|
|
+ </div>
|
|
|
+ <power-person ref="powerNode" :showBottomEmpowerTip="false"></power-person>
|
|
|
+
|
|
|
+ <!-- 确认删除弹窗 -->
|
|
|
+ <del-tips ref="childDel" title="删除人员">
|
|
|
+ <template slot="content">
|
|
|
+ <p>确定删除{{ del_current.user_name }}?</p>
|
|
|
+ </template>
|
|
|
+ <template slot="del">
|
|
|
+ <button @click="del_Btn" class="del">删除</button>
|
|
|
+ </template>
|
|
|
+ </del-tips>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { recordPersonListInter, setLimit_recordpersonListInter, del_recordpersonListInter, waitEmpowerDetail } from '@/api/api'
|
|
|
+import powerPerson from './powerPerson'
|
|
|
+import delTips from './del'
|
|
|
+
|
|
|
+export default {
|
|
|
+ components: { powerPerson, delTips },
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ tableDataReport: {},
|
|
|
+ currentIndex: '1',
|
|
|
+ totalAll: 0,
|
|
|
+ del_current: {},
|
|
|
+ pageobj: {
|
|
|
+ current: 1,
|
|
|
+ isSingle: true,
|
|
|
+ pageSize: 10,
|
|
|
+ key: 1
|
|
|
+ },
|
|
|
+ loading: true,
|
|
|
+ overstep_daily_limit: true,
|
|
|
+ overstep_total_limit: true,
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {},
|
|
|
+ created () {
|
|
|
+ this.record_getDataList()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ emptyValue(t) {
|
|
|
+ return t === null || t === undefined
|
|
|
+ },
|
|
|
+ hasValue(t) {
|
|
|
+ return !this.emptyValue(t)
|
|
|
+ },
|
|
|
+ limitFormatter(t) {
|
|
|
+ return this.hasValue(t) ? t : '输入数量'
|
|
|
+ },
|
|
|
+ // 设置数据导出没人限额
|
|
|
+ setLimit (type, val) {
|
|
|
+ if (this.hasValue(val[type]) && val[type] >= 0) {
|
|
|
+ const payload = {
|
|
|
+ userId: val.user_id,
|
|
|
+ limitId: val.limit_id
|
|
|
+ }
|
|
|
+ if (type === 'total_limit') {
|
|
|
+ payload.reqType = 'maxNums'
|
|
|
+ payload.maxNums = Number(val[type])
|
|
|
+ } else if (type === 'daily_limit') {
|
|
|
+ payload.limitNum = Number(val[type])
|
|
|
+ }
|
|
|
+ setLimit_recordpersonListInter(payload).then(res => {
|
|
|
+ if (res.data.status == 1) {
|
|
|
+ this.$message({ message: '设置成功', type: 'success' })
|
|
|
+ this.record_getDataList()
|
|
|
+ } else if (res.data.status == 3) {
|
|
|
+ this[`overstep_${type}`] = false
|
|
|
+ return
|
|
|
+ } else {
|
|
|
+ this[`overstep_${type}`] = true
|
|
|
+ }
|
|
|
+ val[`setNumber_${type}`] = true
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.record_getDataList()
|
|
|
+ this.$message({ message: '请输入大于等于0的有效数字', type: 'warning' })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 获取当前点击页数据
|
|
|
+ getPageData (page) {
|
|
|
+ if (this.currentIndex == 0) {
|
|
|
+ this.sj_getDataList()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onSizeChange (size) {
|
|
|
+ this.pageobj.pageSize = size
|
|
|
+ this.pageobj.current = 1
|
|
|
+ this.record_getDataList()
|
|
|
+ },
|
|
|
+ // 数据导出人员使用列表
|
|
|
+ record_getDataList () {
|
|
|
+ this.loading = true
|
|
|
+ recordPersonListInter({ page: this.pageobj.current, pageSize: this.pageobj.pageSize }).then(res => {
|
|
|
+ this.loading = false
|
|
|
+ if (res.data && res.data.list) {
|
|
|
+ res.data.list.forEach(v => {
|
|
|
+ // 初始化数据
|
|
|
+ v.setNumber_daily_limit = true
|
|
|
+ v.setNumber_total_limit = true
|
|
|
+ v.daily_limit = v.data_limit
|
|
|
+ v.total_limit = v.max_nums
|
|
|
+ })
|
|
|
+ this.pageobj.isSingle = Number(res.data.count) <= this.pageobj.pageSize
|
|
|
+ this.tableDataReport = res.data
|
|
|
+ this.totalAll = res.data.count
|
|
|
+ this.tableDataReport.list.forEach(v => {
|
|
|
+ v.record_phone = v.user_phone
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.pageobj.isSingle = true
|
|
|
+ this.tableDataReport = {}
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 商机管理、数据导出人员列表删除
|
|
|
+ del_recordPerson (val) {
|
|
|
+ this.del_current = val
|
|
|
+ this.$refs.childDel.dialogTableVisible = true
|
|
|
+ },
|
|
|
+ // 确认删除
|
|
|
+ del_Btn () {
|
|
|
+ this.$refs.childDel.dialogTableVisible = false
|
|
|
+ del_recordpersonListInter({ userId: this.del_current.user_id }).then(res => {
|
|
|
+ this.del_current = {}
|
|
|
+ if (res.data.status == 1) {
|
|
|
+ this.$message({ message: '删除成功', type: 'success' })
|
|
|
+ this.record_getDataList()
|
|
|
+ } else {
|
|
|
+ this.$message({ message: '删除失败', type: 'warning' })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if (this.tableDataReport.list.length == 1 && this.pageobj.current > 1) {
|
|
|
+ this.pageobj.current -= 1
|
|
|
+ }
|
|
|
+ },
|
|
|
+ addPerson() {
|
|
|
+ this.addDepart()
|
|
|
+ },
|
|
|
+ // 添加人员
|
|
|
+ addDepart () {
|
|
|
+ this.$refs.powerNode.searchVal = ''
|
|
|
+ this.$refs.powerNode.centerDialogVisible = true
|
|
|
+ this.$refs.powerNode.currentIndex = this.currentIndex
|
|
|
+ this.$refs.powerNode.titleMsg = '数据导出使用人员'
|
|
|
+ this.$refs.powerNode.getData()
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss">
|
|
|
+.dataBox {
|
|
|
+ padding: 0 16px 22px;
|
|
|
+ margin-top: 16px;
|
|
|
+ min-height: 500px;
|
|
|
+
|
|
|
+ ::v-deep {
|
|
|
+ .el-table th.el-table__cell > .cell{
|
|
|
+ padding-left: 16px;
|
|
|
+ }
|
|
|
+ .el-table__empty-block{
|
|
|
+ width: 100%!important;
|
|
|
+ }
|
|
|
+ .el-table::before{
|
|
|
+ display: none;
|
|
|
+ }
|
|
|
+ .el-table tr {
|
|
|
+ color: #1d1d1d;
|
|
|
+ }
|
|
|
+ .el-table .cell {
|
|
|
+ padding-left: 16px;
|
|
|
+ }
|
|
|
+ .el-table .el-table__header{
|
|
|
+ width: 100%!important;
|
|
|
+ }
|
|
|
+ .el-table .el-table__body{
|
|
|
+ width: 100%!important;
|
|
|
+ }
|
|
|
+ .el-table th.el-table__cell{
|
|
|
+ background: #F7F9FC;
|
|
|
+ }
|
|
|
+ .el-table__cell.gutter{
|
|
|
+ display: block!important;
|
|
|
+ }
|
|
|
+ .el-dialog{
|
|
|
+ border-radius: 8px;
|
|
|
+ }
|
|
|
+ .el-pagination{
|
|
|
+ display: flex;
|
|
|
+ justify-content: flex-end;
|
|
|
+ }
|
|
|
+ .ent_del{
|
|
|
+ .el-dialog{
|
|
|
+ height: 202px;
|
|
|
+ }
|
|
|
+ .el-dialog__wrapper .el-dialog--center {
|
|
|
+ padding: 12px 24px 32px;
|
|
|
+ }
|
|
|
+ .el-dialog__body{
|
|
|
+ padding: 20px 12px 0;
|
|
|
+ }
|
|
|
+ .btns {
|
|
|
+ margin-top: 32px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .data-paging{
|
|
|
+ margin-top: 24px;
|
|
|
+ }
|
|
|
+ .edit{
|
|
|
+ cursor: pointer;
|
|
|
+ color: #2ABED1;
|
|
|
+ }
|
|
|
+
|
|
|
+ .el-table {
|
|
|
+ thead{
|
|
|
+ color: $weight_color;
|
|
|
+ font-size: 14px;
|
|
|
+ .cell{
|
|
|
+ font-weight: bolder;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .setNumber{
|
|
|
+ width: 100%;
|
|
|
+ text-align: center;
|
|
|
+ position: relative;
|
|
|
+ .tipMsg{
|
|
|
+ position: absolute;
|
|
|
+ bottom: 30px;
|
|
|
+ background: rgba(0,0,0,1);
|
|
|
+ color: #fff;
|
|
|
+ }
|
|
|
+ input{
|
|
|
+ width: 88px;
|
|
|
+ height: 28px;
|
|
|
+ border: 1px solid #e0e0e0;
|
|
|
+ }
|
|
|
+ span{
|
|
|
+ color: $light_color;
|
|
|
+ text-decoration: underline;
|
|
|
+ cursor: pointer;
|
|
|
+ display: block;
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .edit{
|
|
|
+ display: block;
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ color: $light_color;
|
|
|
+ cursor: pointer;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+.pagination-container {
|
|
|
+ padding-bottom: 16px;
|
|
|
+}
|
|
|
+</style>
|