621 lines
32 KiB
PHP
621 lines
32 KiB
PHP
![]() |
<!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="<?$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: 54px;
|
|||
|
height: 54px;
|
|||
|
border-radius: 50%;
|
|||
|
}
|
|||
|
|
|||
|
.hed-right .el-button {
|
|||
|
height: 38px;
|
|||
|
}
|
|||
|
|
|||
|
.hed-right .btn-jrpt {
|
|||
|
width: 130px;
|
|||
|
}
|
|||
|
|
|||
|
.hed-right .btn-ty {
|
|||
|
width: 104px;
|
|||
|
}
|
|||
|
|
|||
|
.mar_t3 {
|
|||
|
margin-top: 3px;
|
|||
|
}
|
|||
|
.avatar-uploader .el-upload {
|
|||
|
width: 100px;
|
|||
|
height: 100px;
|
|||
|
line-height: 100px;
|
|||
|
}
|
|||
|
.el-icon-plus:before {
|
|||
|
font-size: 20px;
|
|||
|
}
|
|||
|
|
|||
|
</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="upimg">
|
|||
|
<div class="attachment hei"><?php echo $this->render('@app/views/admin/public/attachment-img.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">
|
|||
|
<el-form :model="ruleForm" status-icon :rules="rules" ref="ruleForm" label-width="10%"
|
|||
|
class="demo-ruleForm">
|
|||
|
<!-- <div class="ba_f bor_rad5 pad_20 mar_b30">
|
|||
|
<div class="flex-bet">
|
|||
|
<div class="flex pad_tb_10 mar_l20">
|
|||
|
<div class=""><img class="namelogo" :src="formInline.apply_image"/></div>
|
|||
|
<div class="flex-col mar_l20 t_l">
|
|||
|
<div class="overflowlnr">{{formInline.apply_name}}</div>
|
|||
|
<div class="color_9 fon_12 mar_t10">类型:{{formInline.app_type_name}}</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
<div class="mar_r20 hed-right">
|
|||
|
<el-button type="primary" class="btn-jrpt">进入平台</el-button>
|
|||
|
<el-button class="btn-ty" @click="deactivation()">停用</el-button>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div> -->
|
|||
|
<div class="ba_f">
|
|||
|
<div class="main-tab ba_f bor_rad5 pad_tb_30">
|
|||
|
<el-tabs v-model="activeName" @tab-click="handleClick">
|
|||
|
<?php if($this->params['userType']):?>
|
|||
|
<el-tab-pane label="平台信息" name="msg">平台信息</el-tab-pane>
|
|||
|
<?php endif;?>
|
|||
|
<el-tab-pane label="操作员管理" name="user">操作员管理</el-tab-pane>
|
|||
|
<?php if($this->params['userType']):?>
|
|||
|
<el-tab-pane label="其他设置" name="setting">其他设置</el-tab-pane>
|
|||
|
<?php endif;?>
|
|||
|
<!-- <el-tab-pane label="远程附件" name="enclosure">远程附件</el-tab-pane> -->
|
|||
|
</el-tabs>
|
|||
|
<div class="tips t_l flex flex-y-center">
|
|||
|
<span class="iconfont icontishi maincolor fon_16 mar_r10 mar_t3"></span>
|
|||
|
<p class="fon_12 maincolor">提示:一个操作员账号只能对应一个平台,一个手机号可以关联多个平台。(注意:此账号仅作为平台管理,不可用于商户端登录)。</p>
|
|||
|
<!-- <p class="fon_12 maincolor">提示:用户登录链接:<a :href="path" target="_blank">{{path}}</a></p> -->
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
<div class="main-con pad_tb_30" v-if="!userId">
|
|||
|
<el-form-item label="操作员头像" prop="logo">
|
|||
|
<div class="flex-grow-1 t_l right-width">
|
|||
|
<div class="imgbox bor_rad5">
|
|||
|
<el-upload
|
|||
|
class="avatar-uploader"
|
|||
|
:action="upload_url"
|
|||
|
:show-file-list="false"
|
|||
|
:on-success="handleAvatarSuccess"
|
|||
|
:before-upload="beforeAvatarUpload">
|
|||
|
<img v-if="imageUrl" :src="imageUrl" class="avatar">
|
|||
|
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
|||
|
</el-upload>
|
|||
|
</div>
|
|||
|
<!-- <div class="uploadSource bor_de rel flex curs" v-if="imageUrl">-->
|
|||
|
<!-- <label class="statusLabel curs" @mouseenter="enter(1)" @mouseleave="leave(1)">-->
|
|||
|
<!-- <i class="el-icon-check" ref="imgicon1"></i>-->
|
|||
|
<!-- <i class="el-icon-close" @click="deleteMultiImage(imageUrl,1)"></i>-->
|
|||
|
<!-- </label>-->
|
|||
|
<!-- <img :src="imageUrl" @click='test(1)' class="wid"/>-->
|
|||
|
<!-- </div>-->
|
|||
|
<!-- <div class="uploadSource flex-center curs" v-else @click='test(1)'>-->
|
|||
|
<!-- <i class="el-icon-plus fon_40 color_d9"></i>-->
|
|||
|
<!-- </div>-->
|
|||
|
<!-- <attachment-img ref="img1" type="img" @attachment='imgadd1'></attachment-img>-->
|
|||
|
</div>
|
|||
|
</el-form-item>
|
|||
|
<el-form-item label="操作员账号" prop="user_name">
|
|||
|
<el-input v-model="ruleForm.user_name" autocomplete="off"
|
|||
|
placeholder="请输入操作员账号"></el-input>
|
|||
|
<div class="color_9 fon_12">提示:一个操作员账号只能对应一个平台,一个手机号可以关联多个平台。(注意:此操作员账号仅作为平台管理,不可用于商户端登录)。</div>
|
|||
|
</el-form-item>
|
|||
|
<el-form-item label="登录密码" prop="password">
|
|||
|
<el-input v-model="ruleForm.password" autocomplete="off" type="password"
|
|||
|
placeholder="请输入登录密码"></el-input>
|
|||
|
</el-form-item>
|
|||
|
<el-form-item label="确认登录密码" prop="checkPass">
|
|||
|
<el-input v-model="ruleForm.checkPass" autocomplete="off" type="password"
|
|||
|
placeholder="请再次输入登录密码"></el-input>
|
|||
|
</el-form-item>
|
|||
|
<el-form-item label="关联手机号">
|
|||
|
<?php if($this->params['userLoginType']==2):?>
|
|||
|
<el-input v-model="ruleForm.user_phone" autocomplete="off"
|
|||
|
placeholder="请输入关联手机号" disabled></el-input>
|
|||
|
<?php else:?>
|
|||
|
<el-input v-model="ruleForm.user_phone" autocomplete="off"
|
|||
|
placeholder="请输入关联手机号"></el-input>
|
|||
|
<?php endif;?>
|
|||
|
<div class="color_9 fon_12">提示:一个操作员账号只能对应一个平台,一个手机号可以关联多个平台。(注意:此手机号仅作为平台管理,不可用于商户端登录)。</div>
|
|||
|
</el-form-item>
|
|||
|
</div>
|
|||
|
<div v-else class="main-con pad_tb_30">
|
|||
|
<el-form-item label="操作员头像" prop="logo">
|
|||
|
<div class="imgbox bor_rad5">
|
|||
|
<el-upload
|
|||
|
class="avatar-uploader"
|
|||
|
:action="upload_url"
|
|||
|
:show-file-list="false"
|
|||
|
:on-success="handleAvatarSuccess"
|
|||
|
:before-upload="beforeAvatarUpload">
|
|||
|
<img v-if="imageUrl" :src="imageUrl" class="avatar">
|
|||
|
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
|||
|
</el-upload>
|
|||
|
</div>
|
|||
|
<!-- <div class="flex-grow-1 t_l right-width">-->
|
|||
|
<!-- <div class="uploadSource bor_de rel flex curs" v-if="imageUrl">-->
|
|||
|
<!-- <label class="statusLabel curs" @mouseenter="enter(1)" @mouseleave="leave(1)">-->
|
|||
|
<!-- <i class="el-icon-check" ref="imgicon1"></i>-->
|
|||
|
<!-- <i class="el-icon-close" @click="deleteMultiImage(imageUrl,1)"></i>-->
|
|||
|
<!-- </label>-->
|
|||
|
<!-- <img :src="imageUrl" @click='test(1)' class="wid"/>-->
|
|||
|
<!-- </div>-->
|
|||
|
<!-- <div class="uploadSource flex-center curs" v-else @click='test(1)'>-->
|
|||
|
<!-- <i class="el-icon-plus fon_40 color_d9"></i>-->
|
|||
|
<!-- </div>-->
|
|||
|
<!-- <attachment-img ref="img1" type="img" @attachment='imgadd1'></attachment-img>-->
|
|||
|
<!-- </div>-->
|
|||
|
</el-form-item>
|
|||
|
<el-form-item label="操作员账号" prop="user_name2">
|
|||
|
<el-input v-model="ruleForm2.user_name" autocomplete="off"
|
|||
|
placeholder="请输入操作员账号" disabled></el-input>
|
|||
|
<div class="color_9 fon_12">提示:一个操作员账号只能对应一个平台,一个手机号可以关联多个平台。注意:此操作员账号仅作为平台管理,不可用于商户端登录)。</div>
|
|||
|
</el-form-item>
|
|||
|
<el-form-item label="登录密码" prop="password2">
|
|||
|
<el-input v-model="ruleForm2.password" disabled autocomplete="off" type="password"
|
|||
|
placeholder="请输入登录密码"></el-input>
|
|||
|
<el-button type="text" class="mar_l20" @click="handleEdit(ruleForm2.password)">修改</el-button>
|
|||
|
</el-form-item>
|
|||
|
<?php if($this->params['userType']):?>
|
|||
|
<el-form-item label="绑定手机号" prop="user_phone2">
|
|||
|
<el-input v-model="ruleForm2.user_phone" disabled autocomplete="off"
|
|||
|
placeholder="请输入绑定手机号"></el-input>
|
|||
|
<el-button type="text" class="mar_l20" @click="handleEdit2(ruleForm2.user_phone)">修改</el-button>
|
|||
|
<div class="color_9 fon_12">提示:一个操作员账号只能对应一个平台,一个手机号可以关联多个平台。注意:此手机号仅作为平台管理,不可用于商户端登录)。</div>
|
|||
|
</el-form-item>
|
|||
|
<?php endif;?>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
<div class="ba_f mar_t20 pad_30 main-button" v-if="!userId">
|
|||
|
<el-button type="primary" class="tijiao" @click="submitForm(ruleForm)">保存</el-button>
|
|||
|
</div>
|
|||
|
<div class="ba_f mar_t20 pad_30 main-button" v-else>
|
|||
|
<el-button type="primary" class="tijiao" @click="submitForm2(ruleForm2)">保存</el-button>
|
|||
|
</div>
|
|||
|
</el-form>
|
|||
|
</div>
|
|||
|
</el-main>
|
|||
|
</el-container>
|
|||
|
</el-container>
|
|||
|
<el-dialog
|
|||
|
title="修改密码"
|
|||
|
:visible.sync="dialogFormVisible"
|
|||
|
width="500px"
|
|||
|
:close-on-click-modal="false"
|
|||
|
>
|
|||
|
<el-form ref="dialogform" :model="dialogform" label-width="120px">
|
|||
|
<el-form-item label="操作员账号" prop="user_name">
|
|||
|
<el-input v-model="dialogform.user_name" type="text" autocomplete="off" placeholder="请输入操作员账号"></el-input>
|
|||
|
</el-form-item>
|
|||
|
<el-form-item label="新密码" prop="newpassWord">
|
|||
|
<el-input v-model="dialogform.newpassWord" type="password" autocomplete="off" placeholder="请输入新密码"></el-input>
|
|||
|
</el-form-item>
|
|||
|
<el-form-item label="确认新密码" prop="comfirmpassWord">
|
|||
|
<el-input v-model="dialogform.comfirmpassWord" type="password" autocomplete="off" placeholder="请确认新密码"></el-input>
|
|||
|
</el-form-item>
|
|||
|
</el-form>
|
|||
|
<div slot="footer" class="dialog-footer">
|
|||
|
<el-button size="medium" @click="dialogFormVisible = false">取 消</el-button>
|
|||
|
<el-button size="medium" type="primary" @click="save">确 定</el-button>
|
|||
|
</div>
|
|||
|
</el-dialog>
|
|||
|
<el-dialog
|
|||
|
title="修改手机号"
|
|||
|
:visible.sync="dialogFormVisible2"
|
|||
|
width="500px"
|
|||
|
:close-on-click-modal="false"
|
|||
|
>
|
|||
|
<el-form ref="dialogform2" :model="dialogform2" label-width="120px">
|
|||
|
<el-form-item label="手机号">
|
|||
|
<el-input v-model="dialogform2.phone" autocomplete="off" placeholder="请输入手机号"></el-input>
|
|||
|
</el-form-item>
|
|||
|
</el-form>
|
|||
|
<div slot="footer" class="dialog-footer">
|
|||
|
<el-button size="medium" @click="dialogFormVisible2 = false">取 消</el-button>
|
|||
|
<el-button size="medium" type="primary" @click="save2">确 定</el-button>
|
|||
|
</div>
|
|||
|
</el-dialog>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
<script>
|
|||
|
$(document).ready(function () {
|
|||
|
$(".slimScrollDiv ul .main-nav-li a").eq(1).addClass("menu_active");
|
|||
|
$(".main-nav .main-nav-li .submenu").eq(1).addClass("block");
|
|||
|
$(".main-nav .main-nav-li .submenu").children().children().eq(1).addClass("menu_active2")
|
|||
|
});
|
|||
|
</script>
|
|||
|
<script>
|
|||
|
new Vue({
|
|||
|
el: '#platformList',
|
|||
|
created() {
|
|||
|
const id = utils.GetQueryString("id")
|
|||
|
const userId = utils.GetQueryString("userId")
|
|||
|
if (id) {
|
|||
|
this.ruleForm.id=id
|
|||
|
//this.getbyid(id)
|
|||
|
}if(id && userId) {
|
|||
|
this.ruleForm.id=id
|
|||
|
this.userId=userId
|
|||
|
// this.getbyid(id)
|
|||
|
this.getbyuserId(userId,id)
|
|||
|
// _this = this;
|
|||
|
// this.init();
|
|||
|
}
|
|||
|
const publishUrl = 'https://bkycms.com/addons/yb_wm/views/channel/index/index.html#/login';
|
|||
|
const backendPath = isDev ? publishUrl : 'https://'+location.host+'/views/channel/index/index.html#/login';
|
|||
|
this.path = backendPath
|
|||
|
},
|
|||
|
data: function () {
|
|||
|
var checkTel = (rule, value, callback) => {
|
|||
|
if (!value) {
|
|||
|
return callback(new Error('绑定手机号不能为空'));
|
|||
|
}
|
|||
|
setTimeout(() => {
|
|||
|
callback();
|
|||
|
}, 1000);
|
|||
|
};
|
|||
|
var checkName = (rule, value, callback) => {
|
|||
|
if (!value) {
|
|||
|
return callback(new Error('用户名不能为空'));
|
|||
|
}
|
|||
|
setTimeout(() => {
|
|||
|
callback();
|
|||
|
}, 1000);
|
|||
|
};
|
|||
|
var validatePass = (rule, value, callback) => {
|
|||
|
if (value === '') {
|
|||
|
callback(new Error('请输入密码'));
|
|||
|
} else {
|
|||
|
if (this.ruleForm.checkPass !== '') {
|
|||
|
this.$refs.ruleForm.validateField('checkPass');
|
|||
|
}
|
|||
|
callback();
|
|||
|
}
|
|||
|
};
|
|||
|
var validatePass2 = (rule, value, callback) => {
|
|||
|
if (value === '') {
|
|||
|
callback(new Error('请再次输入密码'));
|
|||
|
} else if (value !== this.ruleForm.password) {
|
|||
|
callback(new Error('两次输入密码不一致!'));
|
|||
|
} else {
|
|||
|
callback();
|
|||
|
}
|
|||
|
};
|
|||
|
return {
|
|||
|
cardLoading: false,
|
|||
|
activeName: 'user',
|
|||
|
formInline:{
|
|||
|
apply_image:'',
|
|||
|
apply_name:'',
|
|||
|
app_type_name:'',
|
|||
|
},
|
|||
|
ruleForm: {
|
|||
|
user_phone: "<?php echo ($this->params['userInfo']['phone']);?>",
|
|||
|
user_name: '',
|
|||
|
password: '',
|
|||
|
checkPass: '',
|
|||
|
id:'',
|
|||
|
},
|
|||
|
ruleForm2: {
|
|||
|
user_phone: '',
|
|||
|
user_name: '',
|
|||
|
password: '',
|
|||
|
checkPass: '',
|
|||
|
id:'',
|
|||
|
},
|
|||
|
userId:'',
|
|||
|
rules: {
|
|||
|
password: [
|
|||
|
{ validator: validatePass, trigger: 'blur' }
|
|||
|
],
|
|||
|
checkPass: [
|
|||
|
{ validator: validatePass2, trigger: 'blur' }
|
|||
|
],
|
|||
|
user_phone: [
|
|||
|
{ validator: checkTel, trigger: 'blur' }
|
|||
|
],
|
|||
|
user_name: [
|
|||
|
{ validator: checkName, trigger: 'blur' }
|
|||
|
]
|
|||
|
},
|
|||
|
edition: '1',
|
|||
|
imageUrl:'',
|
|||
|
upload_url:"<?= Yii::$app->urlManager->createUrl(['admin/common/upload']);?>",
|
|||
|
path:'',
|
|||
|
dialogFormVisible: false,
|
|||
|
dialogform:{
|
|||
|
user_name:'',
|
|||
|
newpassWord:'',
|
|||
|
},
|
|||
|
dialogFormVisible2: false,
|
|||
|
dialogform2:{
|
|||
|
phone:'',
|
|||
|
},
|
|||
|
// dialogform:{
|
|||
|
// oldPassWord:[
|
|||
|
// { required: true, message: '请输入旧密码', trigger: 'blur' }
|
|||
|
// ],
|
|||
|
// newpassWord:[
|
|||
|
// { required: true, message: '请输入新密码', trigger: 'blur' }
|
|||
|
// ],
|
|||
|
// comfirmpassWord:[
|
|||
|
// { required: true, message: '请确认新密码', trigger: 'blur' }
|
|||
|
// ],
|
|||
|
// },
|
|||
|
}
|
|||
|
},
|
|||
|
methods: {
|
|||
|
//编辑显示平台数据
|
|||
|
async getbyid(id) {
|
|||
|
let params = {
|
|||
|
id: id
|
|||
|
}
|
|||
|
res = await utils.requestGet({data: params, url: "admin/apply/apply-details"},this)
|
|||
|
if (res.code == 1) {
|
|||
|
this.cardLoading= false
|
|||
|
this.formInline = res.data
|
|||
|
}
|
|||
|
},
|
|||
|
//编辑显示用户数据
|
|||
|
async getbyuserId(userId,id){
|
|||
|
let params = {
|
|||
|
userId: userId,
|
|||
|
id: id,
|
|||
|
}
|
|||
|
res = await utils.requestGet({data: params, url: "admin/applyuser/apply-user-info"},this)
|
|||
|
if (res.code == 1) {
|
|||
|
this.ruleForm2.user_name = res.data.userName
|
|||
|
this.ruleForm2.password = res.data.passWord
|
|||
|
this.ruleForm2.user_phone = res.data.phone
|
|||
|
this.imageUrl = res.data.portrait
|
|||
|
this.dialogform.user_name = res.data.userName
|
|||
|
}
|
|||
|
},
|
|||
|
handleEdit(password) {
|
|||
|
this.dialogFormVisible =true
|
|||
|
// if(password){
|
|||
|
// this.dialogFormVisible =true
|
|||
|
// }else{
|
|||
|
// this.$message.error('请设置密码')
|
|||
|
// }
|
|||
|
},
|
|||
|
handleEdit2(user_phone){
|
|||
|
if(user_phone){
|
|||
|
this.dialogFormVisible2 =true
|
|||
|
}else{
|
|||
|
this.$message.error('请设置手机号')
|
|||
|
}
|
|||
|
},
|
|||
|
async save(){
|
|||
|
if(this.dialogform.user_name==''){
|
|||
|
this.$message.error('请输入操作员账号')
|
|||
|
return
|
|||
|
}
|
|||
|
if(this.dialogform.newpassWord==''&&this.dialogform.comfirmpassWord){
|
|||
|
this.$message.error('请输入新密码')
|
|||
|
return
|
|||
|
}
|
|||
|
if(this.dialogform.newpassWord&&this.dialogform.comfirmpassWord==''){
|
|||
|
this.$message.error('请确认新密码')
|
|||
|
return
|
|||
|
}
|
|||
|
if(this.dialogform.newpassWord&&this.dialogform.newpassWord&&this.dialogform.newpassWord!=this.dialogform.comfirmpassWord){
|
|||
|
this.$message.error('两次输入密码不一致')
|
|||
|
return
|
|||
|
}
|
|||
|
res = await utils.requestPost({
|
|||
|
data: {userId:this.userId,newpassWord:this.dialogform.newpassWord,user_name:this.dialogform.user_name},
|
|||
|
url: "admin/applyuser/usersave"
|
|||
|
},this)
|
|||
|
if (res.code == 1) {
|
|||
|
this.dialogFormVisible =false
|
|||
|
this.$message({
|
|||
|
type: 'success',
|
|||
|
message: '操作成功!',
|
|||
|
duration:1000,
|
|||
|
onClose:()=>{
|
|||
|
location.href="<?= Yii::$app->urlManager->createUrl('admin/apply/platform_management');?>";
|
|||
|
},
|
|||
|
});
|
|||
|
}
|
|||
|
},
|
|||
|
async save2(){
|
|||
|
if(this.dialogform2.phone==''){
|
|||
|
this.$message.error('请输入手机号')
|
|||
|
return
|
|||
|
}
|
|||
|
res = await utils.requestPost({
|
|||
|
data: {userId:this.userId,user_phone:this.dialogform2.phone},
|
|||
|
url: "admin/applyuser/usersave"
|
|||
|
},this)
|
|||
|
if (res.code == 1) {
|
|||
|
this.dialogFormVisible2 =false
|
|||
|
this.$message({
|
|||
|
type: 'success',
|
|||
|
message: '操作成功!',
|
|||
|
duration:1000,
|
|||
|
onClose:()=>{
|
|||
|
location.href="<?= Yii::$app->urlManager->createUrl('admin/apply/platform_management');?>";
|
|||
|
},
|
|||
|
});
|
|||
|
}
|
|||
|
},
|
|||
|
//点击停用
|
|||
|
async deactivation() {
|
|||
|
await utils.showConfirm({content: '此操作将停用该项目, 是否继续?'},this)
|
|||
|
var requstData = {
|
|||
|
id: this.id,
|
|||
|
status: 2,
|
|||
|
}
|
|||
|
res = await utils.requestPost({
|
|||
|
data: requstData,
|
|||
|
url: "admin/apply/delapply"
|
|||
|
},this)
|
|||
|
if (res.code == 1) {
|
|||
|
this.$message({
|
|||
|
type: 'success',
|
|||
|
message: '操作成功!',
|
|||
|
duration: 1000,
|
|||
|
onClose: () => {
|
|||
|
location.href = "<?= Yii::$app->urlManager->createUrl('admin/apply/platform_management');?>";
|
|||
|
},
|
|||
|
});
|
|||
|
}
|
|||
|
},
|
|||
|
enter(i=0){
|
|||
|
this.$refs['imgicon' + i].style.display = 'none'
|
|||
|
},
|
|||
|
leave(i=0){
|
|||
|
this.$refs['imgicon' + i].style.display = 'inline-block'
|
|||
|
},
|
|||
|
test(i = 0) {
|
|||
|
// console.log(this.$refs, i)
|
|||
|
this.$refs['img' + i].dialogVisible = true
|
|||
|
},
|
|||
|
imgadd1(url) {
|
|||
|
this.imageUrl = url.str
|
|||
|
},
|
|||
|
imgadd2(url) {
|
|||
|
this.imageUrl2 = url.str
|
|||
|
},
|
|||
|
deleteMultiImage(item, index, type) {
|
|||
|
//typem没传是单图multigraph多图;index上传图片组件排序
|
|||
|
Array.prototype.remove = function (val) {
|
|||
|
var index = this.indexOf(val);
|
|||
|
if (index > -1) {
|
|||
|
this.splice(index, 1);
|
|||
|
}
|
|||
|
};
|
|||
|
if (type == 'multigraph') {
|
|||
|
} else {
|
|||
|
switch (index) {
|
|||
|
case 1:
|
|||
|
this.imageUrl = '';
|
|||
|
break
|
|||
|
case 2:
|
|||
|
this.imageUrl2 = '';
|
|||
|
break
|
|||
|
}
|
|||
|
}
|
|||
|
},
|
|||
|
handleClick(tab, event) {
|
|||
|
if (tab.name == 'msg') {
|
|||
|
location.href = "<?= Yii::$app->urlManager->createUrl('admin/apply/platform_edit');?>"+"?id="+this.ruleForm.id+"&userId="+this.userId;
|
|||
|
}
|
|||
|
if (tab.name == 'user') {
|
|||
|
location.href = "<?= Yii::$app->urlManager->createUrl('admin/apply/platform_userm');?>"+"?id="+this.ruleForm.id+"&userId="+this.userId;
|
|||
|
}
|
|||
|
if (tab.name == 'enclosure') {
|
|||
|
location.href = "<?= Yii::$app->urlManager->createUrl('admin/apply/platform_enclosure');?>"+"?id="+this.ruleForm.id;
|
|||
|
}
|
|||
|
if (tab.name == 'setting') {
|
|||
|
location.href = "<?= Yii::$app->urlManager->createUrl('admin/apply/other_set');?>"+"?id="+this.ruleForm.id+"&userId="+this.userId;
|
|||
|
}
|
|||
|
},
|
|||
|
async submitForm(formName) {
|
|||
|
if (formName.user_name && formName.password && formName.checkPass ) {
|
|||
|
// var unionid = localStorage.getItem("apply_add");
|
|||
|
this.ruleForm.headimgurl = this.imageUrl
|
|||
|
res = await utils.requestPost({
|
|||
|
data: this.ruleForm,
|
|||
|
url: "admin/applyuser/usersave"
|
|||
|
},this)
|
|||
|
if (res.code == 1) {
|
|||
|
this.$message({
|
|||
|
type: 'success',
|
|||
|
message: '操作成功!',
|
|||
|
duration:1000,
|
|||
|
onClose:()=>{
|
|||
|
location.href="<?= Yii::$app->urlManager->createUrl('admin/apply/platform_management');?>";
|
|||
|
},
|
|||
|
});
|
|||
|
}
|
|||
|
} else {
|
|||
|
console.log('error submit!!');
|
|||
|
this.$message.error('请完整填写相关信息')
|
|||
|
return false;
|
|||
|
}
|
|||
|
},
|
|||
|
async submitForm2(formName) {
|
|||
|
// console.log('formName',formName)
|
|||
|
if (this.ruleForm2.user_name && this.imageUrl) {
|
|||
|
res = await utils.requestPost({
|
|||
|
data: {headimgurl:this.imageUrl,user_name:this.ruleForm2.user_name,userId:this.userId},
|
|||
|
url: "admin/applyuser/usersave"
|
|||
|
},this)
|
|||
|
if (res.code == 1) {
|
|||
|
this.$message({
|
|||
|
type: 'success',
|
|||
|
message: '操作成功!',
|
|||
|
duration:1000,
|
|||
|
onClose:()=>{
|
|||
|
location.href="<?= Yii::$app->urlManager->createUrl('admin/apply/platform_management');?>";
|
|||
|
},
|
|||
|
});
|
|||
|
}
|
|||
|
} else {
|
|||
|
console.log('error submit!!');
|
|||
|
this.$message.error('请完整填写相关信息')
|
|||
|
return false;
|
|||
|
}
|
|||
|
},
|
|||
|
|
|||
|
handleAvatarSuccess(res, file) {
|
|||
|
this.ruleForm.headimgurl = res.data
|
|||
|
this.imageUrl = res.data
|
|||
|
// this.formInline.apply_image = file.raw
|
|||
|
},
|
|||
|
|
|||
|
beforeAvatarUpload(file) {
|
|||
|
const isJPG = file.type ===
|
|||
|
file.type === 'image/jpg' ||
|
|||
|
file.type === 'image/jpeg' ||
|
|||
|
file.type === 'image/png' ||
|
|||
|
file.type === 'image/gif'
|
|||
|
const isLt2M = file.size / 1024 / 1024 < 2;
|
|||
|
if (!isJPG) {
|
|||
|
this.$message.error('请上传图片文件!');
|
|||
|
}
|
|||
|
if (!isLt2M) {
|
|||
|
this.$message.error('上传头像图片大小不能超过 2MB!');
|
|||
|
}
|
|||
|
return isJPG && isLt2M;
|
|||
|
}
|
|||
|
}
|
|||
|
})
|
|||
|
|
|||
|
</script>
|
|||
|
</body>
|
|||
|
</html>
|