canyin-project/ybcy/views/admin/applyuser/administration_user.php

376 lines
18 KiB
PHP
Raw Normal View History

2024-11-01 16:07:54 +08:00
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="renderer" content="webkit">
<?php if($this->params['site_image']):?>
<link rel="shortcut icon" type="image/x-icon" href="<?php echo $this->params['site_image'];?>" />
<?php else:?>
<link rel="shortcut icon" type="image/x-icon" href="<?=Yii::$app->request->baseUrl?>/web/favicon.ico" />
<?php endif;?>
<title> <?php if($this->params['site_title']):?>
<?php echo $this->params['site_title']; ?>
<?php else:?>
应用管理后台
<?php endif;?>-用户管理</title>
<link rel="stylesheet" type="text/css" href="<?=Yii::$app->request->baseUrl?>/web/static/css/globle.css"/>
<script src="<?=Yii::$app->request->baseUrl?>/web/static/js/config.js" type="text/javascript" charset="utf-8"></script>
</head>
<style>
.namelogo {
width: 40px;
height: 40px;
border-radius: 50%;
}
color_0b {
color: #0FA42B;
}
.el-tag{
height: 28px;
line-height: 28px;
}
.lsb{color: #FD5500;background: #FFF6F2;border-color:#FFF6F2 }
.ptb{color: #3F83E8;background: #F5F9FE;border-color:#F5F9FE }
.ddb{color: #606273;background: #F7F7F8;border-color:#F7F7F8 }
.sjsjd{color: #1F8C0D;background: #F4F9F3;border-color:#F4F9F3 }
.rightsearch{
top: 20px;
right: 0;
}
.elinput{
width: 230px;
}
</style>
<body>
<div class="pHead">
<div class="publicHeader"><?php echo $this->render('@app/views/admin/public/publicHeader.html');?></div>
</div>
<div class="pLeft">
<div class="publicAside hei"><?php echo $this->render('@app/views/admin/public/publicAside.html');?></div>
</div>
<div class="yb_body">
<div class="layout" id="platformList" v-cloak v-loading="cardLoading">
<el-container>
<el-container>
<el-main>
<div class="main" style="min-width: 800px">
<div class="main_search ba_f bor_rad5">
<div class="main_search_tit t_l fon_16 wei pad_30">操作员管理</div>
<div class="tips t_l flex-bet flex-y-center">
<div class="flex">
<span class="iconfont icontishi maincolor fon_16 mar_r10 mar_t3"></span>
<p class="fon_12 maincolor">提示:一个操作员账号只能对应一个平台,一个手机号可以关联多个平台。(注意:此账号仅作为平台管理,不可用于商户端登录)。</p>
</div>
<div></div>
</div>
</div>
<div class="ba_f pad_b_30 rel pad_30">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="操作员列表" name="1">操作员列表</el-tab-pane>
<el-tab-pane label="手机号列表" name="2">手机号列表</el-tab-pane>
</el-tabs>
<div class="mar_r30 ab rightsearch">
<el-input v-model="formInline.tel" placeholder="请输入操作员或平台名称搜索"
class="elinput" @input="onInputBlur"></el-input>
</div>
</div>
<div class="main-table pad_30 ba_f bor_rad5" v-show="activeName=='1'">
<div class="fon_14 color_3">
<el-table ref="multipleTable" :data="tableData" tooltip-effect="dark"
style="width: 100%">
<el-table-column label="操作员账号 " prop="user_name">
<template slot-scope="scope">
<div class="flex pad_tb_10">
<div class="">
<img v-if="scope.row.portrait" class="namelogo" :src="scope.row.portrait"/>
<img v-else class="namelogo" src="/web/static/images/index/admin.png"/>
</div>
<div class="flex-col mar_l20">
<div class="overflowlnr">{{scope.row.userName}}</div>
<div class="fon_12 color_9">关联时间:{{scope.row.createdAt}}</div>
</div>
</div>
</template>
</el-table-column>
<el-table-column prop="id" label="所属平台ID" width="220"></el-table-column>
<el-table-column prop="apply_name" label="所属平台名称"></el-table-column>
<el-table-column prop="end_time" label="平台到期时间"
show-overflow-tooltip></el-table-column>
<el-table-column prop="phone" label="关联手机号"
show-overflow-tooltip></el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<div class="textbutton" v-if="activeName=='1'">
<el-button type="text" class="fon_14" @click="edit(scope.row.uniacid,scope.row.id)">编辑</el-button>
<el-button type="text" class="fon_14 mar_l20" @click="del(scope.row.id)"
>删除
</el-button>
</div>
<!-- <div class="textbutton" v-if="activeName=='2'">
<el-button type="text" class="fon_14 color_0b" @click="del(scope.row.id,1)">恢复</el-button>
<el-button type="text" class="fon_14 mar_l20" @click="del(scope.row.id,3)">删除</el-button>
</div> -->
</template>
</el-table-column>
</el-table>
<div class="t_l">
<el-pagination background layout="prev, pager, next" :total="total"
:page-size="pagesize"
@current-change="current_change">
</el-pagination>
</div>
</div>
</div>
<div class="main-table pad_30 ba_f bor_rad5" v-show="activeName=='2'">
<div class="fon_14 color_3">
<el-table ref="multipleTable" :data="tableData2" tooltip-effect="dark"
style="width: 100%">
<!-- <el-table-column prop="id" label="ID"show-overflow-tooltip></el-table-column>-->
<el-table-column prop="phone" label="手机号"show-overflow-tooltip></el-table-column>
<el-table-column label="关联平台名称 " prop="user_name">
<template slot-scope="scope">
<div v-if="scope.row.apply.length">
<div class="flex pad_tb_10" v-for="(item,index) in scope.row.apply":key="index">
<div>平台名称:{{item.apply_name}}</div>
<div class="mar_l20">平台ID{{item.uniacid}}</div>
</div>
</div>
</template>
</el-table-column>
<el-table-column label="可新增平台数量">
<template slot-scope="scope">
<div class="textbutton">
<el-button type="text" class="fon_14" @click="setnumber(scope.row)">
{{scope.row.appNum}}</el-button>
</div>
</template>
</el-table-column>
<el-table-column label="设置利润比例">
<template slot-scope="scope">
<div class="textbutton">
<el-button type="text" class="fon_14" @click="setnumber2(scope.row)">
{{scope.row.ratio}}</el-button>
</div>
</template>
</el-table-column>
</el-table>
<div class="t_l">
<el-pagination background layout="prev, pager, next" :total="total2"
:page-size="pagesize2"
@current-change="current_change2">
</el-pagination>
</div>
<el-dialog
title="设置平台数量"
:visible.sync="centerDialogVisible"
width="500px"
center>
<div>
<el-form ref="form" :model="form" label-width="140px">
<!-- <el-form-item label="平台数量">
<el-radio-group v-model="form.type">
<el-radio label="1">单个</el-radio>
<el-radio label="2">多个</el-radio>
</el-radio-group>
</el-form-item> -->
<el-form-item label="可创建平台数量">
<el-input v-model="rowappNum" style="width:280px" placeholder="请输入平台数量"></el-input>
</el-form-item>
</el-form>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="centerDialogVisible = false"> </el-button>
<el-button type="primary" @click="setratio"> </el-button>
</span>
</el-dialog>
<el-dialog
title="设置抽佣比例"
:visible.sync="centerDialogVisible2"
width="500px"
center>
<div>
<el-form ref="form" :model="form" label-width="140px">
<el-form-item label="设置抽佣比例">
<el-input v-model="rowratio" style="width:280px" placeholder="请输入设置抽佣比率"></el-input>
</el-form-item>
</el-form>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="centerDialogVisible2 = false"> </el-button>
<el-button type="primary" @click="setratio"> </el-button>
</span>
</el-dialog>
</div>
</div>
</div>
</el-main>
</el-container>
</el-container>
</div>
</div>
<script>
$(document).ready(function () {
$(".slimScrollDiv ul .main-nav-li a").eq(7).addClass("menu_active");
$(".main-nav .main-nav-li .submenu").eq(3).addClass("block");
$(".main-nav .main-nav-li .submenu").children().children().eq(8).addClass("menu_active2")
});
</script>
<script>
new Vue({
el: '#platformList',
created() {
this.init();
},
data: function () {
return {
cardLoading: true,
activeName: '1',
formInline: {
tel: '',
},
active:'',
tableData: [],
tableData2: [],
total: 0,
pagesize: 10,
currentPage: 1,
total2: 0,
pagesize2: 10,
currentPage2: 1,
centerDialogVisible: false,
centerDialogVisible2: false,
form:{
type:'1',
appNum:'',
},
rowphone:'',
rowappNum:'',
rowratio:'',
}
},
methods: {
async init() {
var params = {
page: this.currentPage,
keyword:this.formInline.tel,
status:this.activeName,
}
this.tableData= []
res = await utils.requestPost({
data: params,
url: "admin/applyuser/getuserlist"
},this)
if (res.code == 1) {
this.cardLoading= false
this.tableData = res.data
this.total = res.count
}
},
async init2() {
var params = {
page: this.currentPage2,
keyword:this.formInline.tel,
status:this.activeName,
}
this.tableData= []
res = await utils.requestPost({
data: params,
url: "admin/applyuser/user-phone-list"
},this)
if (res.code == 1) {
this.cardLoading= false
this.tableData2 = res.data
this.total2 = res.count
}
},
//切换分页
current_change: function (currentPage) {
this.currentPage = currentPage;
this.init()
},
//切换分页
current_change2: function (currentPage) {
this.currentPage2 = currentPage;
this.init2()
},
//搜索
onInputBlur(){
this.init()
},
edit(uniacid,id) {
location.href = "<?= Yii::$app->urlManager->createUrl('admin/apply/platform_userm');?>"+"?id="+uniacid+ "&userId=" + id;
},
async del(id) {
var requstData = {
id,
}
res = await utils.requestPost({
data: requstData,
url: "admin/applyuser/userset"
},this)
if (res.code == 1) {
this.$message({
type: 'success',
message: '操作成功!',
duration: 1000,
onClose: () => {
location.href = "<?= Yii::$app->urlManager->createUrl('admin/applyuser/administration_user');?>";
// this.init()
// this.currentPage = 1;
},
});
}
},
handleClick(tab, event) {
this.active= tab.name
this.currentPage = 1;
if (tab.name == '1') {
this.init()
}
if (tab.name == '2') {
this.init2()
}
},
setnumber(row){
this.centerDialogVisible =true
this.rowphone = row.phone
this.rowappNum = row.appNum
},
setnumber2(row){
this.centerDialogVisible2 =true
this.rowphone = row.phone
this.rowratio = row.ratio
},
async setratio(){
var requstData = {phone:this.rowphone,ratio:this.rowratio,appNum:this.rowappNum,}
res = await utils.requestPost({
data: requstData,
url: "admin/applyuser/set-app-num"
},this)
if (res.code == 1) {
this.$message({
type: 'success',
message: '操作成功!',
duration: 1000,
});
this.centerDialogVisible =false
this.centerDialogVisible2 =false
this.init2()
}
},
}
})
</script>
</body>
</html>