Commit ed8bd88e authored by 刘雅文's avatar 刘雅文

修复问题

parent 2e638ea4
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
<el-button type="text" size="small" @click="handleShow(scope.row,'SettleReport','结清报告')">结清报告 <el-button type="text" size="small" @click="handleShow(scope.row,'SettleReport','结清报告')">结清报告
</el-button> </el-button>
</template> </template>
<template v-if="scope.row.status==='SETTLED' && scope.row.capitalCode == 'OWNBUSINESS'&&zyItem"> <template v-if="scope.row.status==='SETTLED' && scope.row.capitalCode == 'OWNBUSINESS'&&zyItem[0].url">
<el-button type="text" size="small" @click="handleShow(scope.row,'GenerateSettleReport','结清报告')">结清报告 <el-button type="text" size="small" @click="handleShow(scope.row,'GenerateSettleReport','结清报告')">结清报告
</el-button> </el-button>
</template> </template>
...@@ -106,6 +106,7 @@ export default { ...@@ -106,6 +106,7 @@ export default {
async created() { async created() {
// console.log(localStorage.getItem('btnUrl'), 999888888); // console.log(localStorage.getItem('btnUrl'), 999888888);
this.zyItem=localStorage.getItem('btnUrl'); this.zyItem=localStorage.getItem('btnUrl');
console.log(this.zyItem,'bynurl');
const {clientNo, clientProductName} = this.params; const {clientNo, clientProductName} = this.params;
const res = await this.$$post('/loan/getLoanListByClientNo/', {productName: clientProductName, clientNo: clientNo}); const res = await this.$$post('/loan/getLoanListByClientNo/', {productName: clientProductName, clientNo: clientNo});
const {success, result} = res.data; const {success, result} = res.data;
......
<template> <template>
<div id="login"> <div id="login">
<canvas id="canvas"></canvas> <canvas id="canvas"></canvas>
<div class="box"> <div class="box">
<transition appear> <transition appear>
<div class="login"> <div class="login">
<br />
<br> <br />
<br>
<h1>客服后台</h1> <h1>客服后台</h1>
<br> <br />
<el-form :model="user" :rules="rules" ref="userForm"> <el-form :model="user" :rules="rules" ref="userForm">
<el-form-item class="login-input" label="" prop="username"> <el-form-item class="login-input" label="" prop="username">
<el-input name="username" placeholder="账户" v-model="user.username" <el-input
name="username"
placeholder="账户"
v-model="user.username"
@keyup.enter.native="submit" @keyup.enter.native="submit"
:autofocus="true"> :autofocus="true"
>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item class="login-input" label="" prop="password"> <el-form-item class="login-input" label="" prop="password">
<el-input name="password" type="password" placeholder="密码" v-model="user.password" <el-input
@keyup.enter.native="submit"> name="password"
type="password"
placeholder="密码"
v-model="user.password"
@keyup.enter.native="submit"
>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item class="code-input" label="" prop="vcode"> <el-form-item class="code-input" label="" prop="vcode">
<el-input class="login-input-code" name="vcode" placeholder="验证码" :loading="sendLoad" <el-input
v-model="user.vcode" maxlength="4" class="login-input-code"
@keyup.enter.native="submit"> name="vcode"
placeholder="验证码"
:loading="sendLoad"
v-model="user.vcode"
maxlength="4"
@keyup.enter.native="submit"
>
</el-input> </el-input>
<el-button class="code-button" type="success" plain @click="sendMail()">{{ text }}</el-button> <el-button
class="code-button"
type="success"
plain
@click="sendMail()"
>{{ text }}</el-button
>
</el-form-item> </el-form-item>
<br> <br />
<el-button :loading="ui.loginLoading" class="login-btn" <el-button
size="large" type="info" @click="submit">登录 :loading="ui.loginLoading"
class="login-btn"
size="large"
type="info"
@click="submit"
>登录
</el-button> </el-button>
</el-form> </el-form>
</div> </div>
</transition> </transition>
</div> </div>
...@@ -45,102 +67,115 @@ ...@@ -45,102 +67,115 @@
<script type="text/ecmascript-6"> <script type="text/ecmascript-6">
export default { export default {
name: 'SisLogin', name: "SisLogin",
data() { data() {
return { return {
show: true, show: true,
sendLoad: false, sendLoad: false,
time: '获取验证码', time: "获取验证码",
ui: { ui: {
loginLoading: false, loginLoading: false,
errorAlert: {isShow: false, title: ''} errorAlert: { isShow: false, title: "" },
}, },
rules: { rules: {
username: [ username: [
{required: true, message: '请输入账户', trigger: 'blur'}, { required: true, message: "请输入账户", trigger: "blur" },
{min: 3, max: 15, message: '长度在 3 到 15 个字符', trigger: 'blur'} {
min: 3,
max: 15,
message: "长度在 3 到 15 个字符",
trigger: "blur",
},
], ],
password: [ password: [
{required: true, message: '请输入密码', trigger: 'blur'}, { required: true, message: "请输入密码", trigger: "blur" },
{min: 3, max: 15, message: '长度在 3 到 15 个字符', trigger: 'blur'} {
min: 3,
max: 15,
message: "长度在 3 到 15 个字符",
trigger: "blur",
},
], ],
vcode: [ vcode: [
{required: true, message: '请输入验证码', trigger: 'blur'}, { required: true, message: "请输入验证码", trigger: "blur" },
{min: 3, max: 6, message: '长度在 3 到 6 个字符', trigger: 'blur'} { min: 3, max: 6, message: "长度在 3 到 6 个字符", trigger: "blur" },
] ],
}, },
user: { user: {
userId: '', userId: "",
password: '', password: "",
username: '', username: "",
vcode: '', vcode: "",
smsType: 'backLogin', smsType: "backLogin",
} },
} };
}, },
methods: { methods: {
submit() { submit() {
this.$refs['userForm'].validate((valid) => { this.$refs["userForm"].validate((valid) => {
if (!valid) { if (!valid) {
return false return false;
} }
this.ui.loginLoading = true this.ui.loginLoading = true;
this.$cacheUtils.cleanCache(); this.$cacheUtils.cleanCache();
this.$$post('/login', this.user) this.$$post("/login", this.user).then((res) => {
.then(res => { if (res.data.code === "200") {
if (res.data.code === '200') { localStorage.setItem("userName", res.data.result.userName);
localStorage.setItem("agentNo", res.data.result.extensionNumber);
localStorage.setItem('userName', res.data.result.userName); localStorage.setItem("loginName", res.data.result.loginName);
localStorage.setItem('agentNo', res.data.result.extensionNumber);
localStorage.setItem('loginName', res.data.result.loginName); let userRolePermission = this.userRolelistToStringUtils(
res.data.result.userRole
let userRolePermission = this.userRolelistToStringUtils(res.data.result.userRole); );
localStorage.setItem('userRole', userRolePermission); localStorage.setItem("userRole", userRolePermission);
let btnPermission = this.listToStringUtils(
let btnPermission = this.listToStringUtils(res.data.result.buttonList); res.data.result.buttonList
localStorage.setItem('btnPermission', btnPermission) );
if(res.data.result.buttonList){ localStorage.setItem("btnPermission", btnPermission);
localStorage.setItem('btnUrl', res.data.result.buttonList[0].url) if (res.data.result.buttonList != []) {
localStorage.setItem("btnUrl", res.data.result.buttonList);
}else{ }else{
localStorage.setItem('btnUrl', res.data.result.buttonList) localStorage.setItem("btnUrl", null);
} }
localStorage.setItem(
localStorage.setItem('authaaaa', JSON.stringify(res.data.result.menuList)) "authaaaa",
JSON.stringify(res.data.result.menuList)
);
const uName = res.data.result.loginName; const uName = res.data.result.loginName;
let canvas = document.getElementById('canvas') let canvas = document.getElementById("canvas");
canvas.width = 300 canvas.width = 300;
canvas.height = 300 canvas.height = 300;
let context = canvas.getContext('2d') let context = canvas.getContext("2d");
context.translate(-85, 125); context.translate(-85, 125);
context.rotate(-35 * Math.PI / 180); context.rotate((-35 * Math.PI) / 180);
context.font = 'normal 30px Arial' context.font = "normal 30px Arial";
context.fillStyle = '#d1d1d1' context.fillStyle = "#d1d1d1";
context.fillText(uName, 50, 150); context.fillText(uName, 50, 150);
localStorage.setItem('bg', context.canvas.toDataURL()); localStorage.setItem("bg", context.canvas.toDataURL());
this.$router.push('/index') this.$router.push("/index");
} else { } else {
this.ui.loginLoading = false this.ui.loginLoading = false;
this.$message({ this.$message({
message: `${res.data.message}`, message: `${res.data.message}`,
type: 'warning' type: "warning",
}); });
} }
}) });
}) });
}, },
sendMail() { sendMail() {
if (!this.user.username) { if (!this.user.username) {
this.$message({ this.$message({
message: `用户名不能为空`, message: `用户名不能为空`,
type: 'warning' type: "warning",
}); });
return; return;
} }
...@@ -148,7 +183,7 @@ export default { ...@@ -148,7 +183,7 @@ export default {
if (!this.user.password) { if (!this.user.password) {
this.$message({ this.$message({
message: `密码不能为空`, message: `密码不能为空`,
type: 'warning' type: "warning",
}); });
return; return;
} }
...@@ -157,25 +192,23 @@ export default { ...@@ -157,25 +192,23 @@ export default {
return; return;
} }
//java发送验证码接口 //java发送验证码接口
this.$$post('/login/sendLoginSms', this.user) this.$$post("/login/sendLoginSms", this.user).then((res) => {
.then(res => { if (res.data.code === "200") {
if (res.data.code === '200') {
this.sendLoad = true; this.sendLoad = true;
this.time = 60; this.time = 60;
this.timer(); this.timer();
this.$message({ this.$message({
message: '验证码发送成功,请查看', message: "验证码发送成功,请查看",
type: 'success' type: "success",
}); });
} else { } else {
this.sendLoad = false; this.sendLoad = false;
this.$message({ this.$message({
message: `${res.data.message}`, message: `${res.data.message}`,
type: 'warning' type: "warning",
}); });
} }
}) });
}, },
timer() { timer() {
if (this.time > 0) { if (this.time > 0) {
...@@ -184,72 +217,71 @@ export default { ...@@ -184,72 +217,71 @@ export default {
} }
}, },
listToStringUtils(list) { listToStringUtils(list) {
var returnStr = '' var returnStr = "";
for (var num in list) { for (var num in list) {
if (num === list.length - 1) { if (num === list.length - 1) {
returnStr = returnStr + list[num].code returnStr = returnStr + list[num].code;
} else { } else {
returnStr = returnStr + list[num].code + "," returnStr = returnStr + list[num].code + ",";
} }
} }
return returnStr; return returnStr;
}, },
userRolelistToStringUtils(list) { userRolelistToStringUtils(list) {
var returnStr = '' var returnStr = "";
for (var num in list) { for (var num in list) {
if (num === list.length - 1) { if (num === list.length - 1) {
returnStr = returnStr + list[num].roleCode returnStr = returnStr + list[num].roleCode;
} else { } else {
returnStr = returnStr + list[num].roleCode + "," returnStr = returnStr + list[num].roleCode + ",";
} }
} }
return returnStr; return returnStr;
}, },
showErrorAlert(err) { showErrorAlert(err) {
this.$message.error(err.msg === undefined ? '404' : err.msg) this.$message.error(err.msg === undefined ? "404" : err.msg);
this.ui.loginLoading = false this.ui.loginLoading = false;
} },
}, },
computed: { computed: {
text: function () { text: function () {
if (this.time === 0) { if (this.time === 0) {
this.sendLoad = false; this.sendLoad = false;
} }
return this.time > 0 ? this.time + 's 后重新获取' : '获取验证码'; return this.time > 0 ? this.time + "s 后重新获取" : "获取验证码";
}
}, },
} },
};
</script> </script>
<style lang="stylus" scoped rel="stylesheet/stylus"> <style lang="stylus" scoped rel="stylesheet/stylus">
#login { #login {
width 100% width: 100%;
height 100% height: 100%;
background-image url('../../../public/image/backimg20190828.jpg') background-image: url('../../../public/image/backimg20190828.jpg');
background-repeat no-repeat background-repeat: no-repeat;
background-position center background-position: center;
background-size cover background-size: cover;
.box { .box {
position absolute position: absolute;
top 50% top: 50%;
left 50% left: 50%;
background-color: rgba(30, 30, 30, 0.6) background-color: rgba(30, 30, 30, 0.6);
width bw = 700px width: bw = 700px;
height bh = 600px height: bh = 600px;
margin-left -(bw/ 2) margin-left: -(bw / 2);
margin-top -(bh/ 2) margin-top: -(bh / 2);
.slide-fade-left-enter-active { .slide-fade-left-enter-active {
transition: all 2s ease; transition: all 2s ease;
} }
.slide-fade-left-leave-active { .slide-fade-left-leave-active {
transition: all 2s cubic-bezier(1.0, 0.5, 0.8, 1.0); transition: all 2s cubic-bezier(1, 0.5, 0.8, 1);
} }
.slide-fade-left-enter, .slide-fade-left-leave-to { .slide-fade-left-enter, .slide-fade-left-leave-to {
...@@ -262,7 +294,7 @@ export default { ...@@ -262,7 +294,7 @@ export default {
} }
.slide-fade-right-leave-active { .slide-fade-right-leave-active {
transition: all 2s cubic-bezier(1.0, 0.5, 0.8, 1.0); transition: all 2s cubic-bezier(1, 0.5, 0.8, 1);
} }
.slide-fade-right-enter, .slide-fade-right-leave-to { .slide-fade-right-enter, .slide-fade-right-leave-to {
...@@ -275,7 +307,7 @@ export default { ...@@ -275,7 +307,7 @@ export default {
} }
.slide-fade-top-leave-active { .slide-fade-top-leave-active {
transition: all 2.5s cubic-bezier(1.0, 0.5, 0.8, 1.0); transition: all 2.5s cubic-bezier(1, 0.5, 0.8, 1);
} }
.slide-fade-top-enter, .slide-fade-top-leave-to { .slide-fade-top-enter, .slide-fade-top-leave-to {
...@@ -284,76 +316,71 @@ export default { ...@@ -284,76 +316,71 @@ export default {
} }
.right { .right {
position absolute position: absolute;
top 0 top: 0;
right 0 right: 0;
width: bw - 120;
width bw - 120 height: bh - 60;
height bh - 60 background-color: rgba(255, 255, 255, 0.5);
border-radius: 3px;
background-color rgba(255, 255, 255, .5)
border-radius 3px
} }
.left { .left {
position absolute position: absolute;
bottom 0 bottom: 0;
left 0 left: 0;
width: bw - 120;
width bw - 120 height: bh - 60;
height bh - 60 background-color: rgba(0, 0, 0, 0.5);
border-radius: 3px;
background-color rgba(0, 0, 0, .5)
border-radius 3px
} }
.login { .login {
position absolute position: absolute;
top 60px top: 60px;
left 150px left: 150px;
z-index 10 z-index: 10;
width 400px width: 400px;
height 480px height: 480px;
h1 { h1 {
color white color: white;
text-align center text-align: center;
} }
.login-input { .login-input {
width 90% width: 90%;
margin 20px margin: 20px;
.el-form-item__error { .el-form-item__error {
font-size 13px font-size: 13px;
} }
} }
.code-input{ .code-input {
width 95% width: 95%;
} }
.login-input-code { .login-input-code {
margin-left 1.4em margin-left: 1.4em;
width 50% width: 50%;
margin-right 15px margin-right: 15px;
float left float: left;
} }
.code-button { .code-button {
float right float: right;
} }
.login-btn { .login-btn {
display block display: block;
width 80% width: 80%;
margin auto margin: auto;
background-color #3592FE background-color: #3592FE;
border-color #162938 border-color: #162938;
} }
} }
} }
} }
#canvas { #canvas {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment