Commit fe329500 authored by youjie's avatar youjie
parents 2027e3a2 0bf97055
<style>
@import "../assets/css/summaryLogin.css";
@import "../assets/css/summaryLogin.css";
</style>
<style>
......@@ -7,431 +8,451 @@
<template>
<div class="login-box newSummaryLogin">
<div class="homepage-hero-module">
<div :style="{'height':'100vh'}">
<div class="item">
<img :style="{'height':'100vh'}" src="../assets/img/summary.jpg" />
</div>
<div class="homepage-hero-module">
<div :style="{'height':'100vh'}">
<div class="item">
<img :style="{'height':'100vh'}" src="../assets/img/summary.jpg" />
</div>
</div>
<form class="Summary_login_Div">
<div v-if="isShow==1">
<div class="sumMainTitle">{{groupModel.GroupName?groupModel.GroupName:''}}</div>
<div class="login-commonBotm">
<i class="icon-login-name iconfont icon-user11"></i>
<input class="input" @focus="name_bline=true" @blur="name_bline=false" maxlength="20" autocomplete="new-password" v-model="userInfo.name" style="background-color:transparent !important;" type="text" :placeholder="$t('login.login_account')" @keyup.enter="doLogin"/>
<div class="name_bline_left" :class="name_bline==true?'_bline_w':''"></div>
<div class="name_bline_right" :class="name_bline==true?'_bline_w':''"></div>
</div>
<div class="error-msg">
<div v-show="nameIsShow"><img src="../assets/img/login-error-tips.png"/>{{ nameErrorMsg }}</div>
</div>
<div class="login-commonBotm">
<i class="icon-login-password iconfont icon-mima"></i>
<input class="input" @focus="pwd_bline=true" @blur="pwd_bline=false" maxlength="20" autocomplete="new-password" v-model="userInfo.password" style="background-color:transparent !important" type="password" :placeholder="$t('login.login_password')" @keyup.enter="doLogin"/>
<div class="pwd_bline_left" :class="pwd_bline==true?'_bline_w':''"></div>
<div class="pwd_bline_right" :class="pwd_bline==true?'_bline_w':''"></div>
</div>
<div class="error-msg">
<div v-show="passwordIsShow"><img src="../assets/img/login-error-tips.png"/>{{ passwordErrorMsg }}</div>
</div>
<form class="Summary_login_Div">
<div v-if="isShow==1">
<div class="sumMainTitle">{{groupModel.GroupName?groupModel.GroupName:''}}</div>
<div class="login-commonBotm">
<i class="icon-login-name iconfont icon-user11"></i>
<input class="input" @focus="name_bline=true" @blur="name_bline=false" maxlength="20"
autocomplete="new-password" v-model="userInfo.name" style="background-color:transparent !important;"
type="text" :placeholder="$t('login.login_account')" @keyup.enter="doLogin" />
<div class="name_bline_left" :class="name_bline==true?'_bline_w':''"></div>
<div class="name_bline_right" :class="name_bline==true?'_bline_w':''"></div>
</div>
<div class="error-msg">
<div v-show="nameIsShow"><img src="../assets/img/login-error-tips.png" />{{ nameErrorMsg }}</div>
</div>
<div class="login-commonBotm">
<i class="icon-login-password iconfont icon-mima"></i>
<input class="input" @focus="pwd_bline=true" @blur="pwd_bline=false" maxlength="20"
autocomplete="new-password" v-model="userInfo.password" style="background-color:transparent !important"
type="password" :placeholder="$t('login.login_password')" @keyup.enter="doLogin" />
<div class="pwd_bline_left" :class="pwd_bline==true?'_bline_w':''"></div>
<div class="pwd_bline_right" :class="pwd_bline==true?'_bline_w':''"></div>
</div>
<div class="error-msg">
<div v-show="passwordIsShow"><img src="../assets/img/login-error-tips.png" />{{ passwordErrorMsg }}</div>
</div>
<button type="button" class="sLoginBtn" :class="{'loginIng':loginState==1}" :disabled="loginState==1"
@click="doLogin">{{loginState==1?'登录中...':'登录'}}</button>
<div class="forgetPw">
<span @click="updatePwd">{{$t('login.login_forgetpwd')}}?</span>
</div>
<div class="login-way">
<div class="wayLeft">
<i class="icon-login-qqicon"></i>
<span>QQ登录</span>
</div>
<button type="button" class="sLoginBtn" :class="{'loginIng':loginState==1}" :disabled="loginState==1" @click="doLogin">{{loginState==1?'登录中...':'登录'}}</button>
<div class="forgetPw">
<span @click="updatePwd">{{$t('login.login_forgetpwd')}}?</span>
<div class="wayRight">
<i class="icon-login-wechaticon"></i>
<span>微信登录</span>
</div>
<div class="login-way">
<div class="wayLeft">
<i class="icon-login-qqicon"></i>
<span>QQ登录</span>
</div>
<div class="wayRight">
<i class="icon-login-wechaticon"></i>
<span>微信登录</span>
</div>
</div>
</div>
<div v-if="isShow==2" class="phoneLogin">
<div class="sumMainTitle bindTitle">{{groupModel.GroupName?groupModel.GroupName:''}}</div>
<div class="sumPhone">绑定手机号</div>
<div class="login-commonBotm">
<i class="icon-login-name iconfont icon-phone1"></i>
<input class="input" @focus="name_bline=true" @blur="name_bline=false"
onkeyup="value=value.replace(/[^\d]/g,'')" maxlength="11" autocomplete="new-password" v-model="mobileNumber"
style="background-color:transparent !important;" type="text" placeholder="请输入手机号" />
<div class="name_bline_left" :class="name_bline==true?'_bline_w':''"></div>
<div class="name_bline_right" :class="name_bline==true?'_bline_w':''"></div>
</div>
<div class="error-msg">
<div v-show="nameIsShow"><img src="../assets/img/login-error-tips.png" />{{ nameErrorMsg }}</div>
</div>
<div class="login-commonBotm">
<i class="icon-login-password iconfont icon-mima"></i>
<input class="input phoneValidate" maxlength="4" @focus="pwd_bline=true"
onkeyup="value=value.replace(/[^\d]/g,'')" @blur="pwd_bline=false" v-model="code"
autocomplete="new-password" style="background-color:transparent !important" type="text" placeholder="验证码"
@keyup.enter="doBind" />
<div class="pwd_bline_left" :class="pwd_bline==true?'_bline_w':''"></div>
<div class="pwd_bline_right" :class="pwd_bline==true?'_bline_w':''"></div>
<div class="validatCode">
<span v-show="show" @click="getCode">获取验证码</span>
<span v-show="!show" class="count">{{count}}s重新获取</span>
</div>
</div>
<div v-if="isShow==2" class="phoneLogin">
<div class="sumMainTitle bindTitle">{{groupModel.GroupName?groupModel.GroupName:''}}</div>
<div class="sumPhone">绑定手机号</div>
<div class="login-commonBotm">
<i class="icon-login-name iconfont icon-phone1"></i>
<input class="input" @focus="name_bline=true" @blur="name_bline=false" onkeyup="value=value.replace(/[^\d]/g,'')" maxlength="11" autocomplete="new-password" v-model="mobileNumber" style="background-color:transparent !important;" type="text" placeholder="请输入手机号"/>
<div class="name_bline_left" :class="name_bline==true?'_bline_w':''"></div>
<div class="name_bline_right" :class="name_bline==true?'_bline_w':''"></div>
</div>
<div class="error-msg">
<div v-show="nameIsShow"><img src="../assets/img/login-error-tips.png"/>{{ nameErrorMsg }}</div>
</div>
<div class="login-commonBotm">
<i class="icon-login-password iconfont icon-mima"></i>
<input class="input phoneValidate" maxlength="4" @focus="pwd_bline=true" onkeyup="value=value.replace(/[^\d]/g,'')" @blur="pwd_bline=false" v-model="code" autocomplete="new-password" style="background-color:transparent !important" type="text" placeholder="验证码" @keyup.enter="doBind"/>
<div class="pwd_bline_left" :class="pwd_bline==true?'_bline_w':''"></div>
<div class="pwd_bline_right" :class="pwd_bline==true?'_bline_w':''"></div>
<div class="validatCode">
<span v-show="show" @click="getCode">获取验证码</span>
<span v-show="!show" class="count">{{count}}s重新获取</span>
</div>
</div>
<div class="error-msg">
<div v-show="passwordIsShow"><img src="../assets/img/login-error-tips.png"/>{{ passwordErrorMsg }}</div>
</div>
<input type="button" class="sLoginBtn" @click="doBind" value="确认绑定"/>
<div class="error-msg">
<div v-show="passwordIsShow"><img src="../assets/img/login-error-tips.png" />{{ passwordErrorMsg }}</div>
</div>
<input type="button" class="sLoginBtn" @click="doBind" value="确认绑定" />
</div>
<div v-if="isShow==3" class="phoneLogin">
<div class="sumMainTitle bindTitle">{{groupModel.GroupName?groupModel.GroupName:''}}</div>
<div class="sumPhone">修改密码</div>
<div class="login-commonBotm">
<i class="icon-login-name iconfont icon-phone1"></i>
<input class="input" @focus="name_bline=true" onkeyup="value=value.replace(/[^\d]/g,'')" maxlength="11" @blur="name_bline=false" autocomplete="new-password" v-model="mobileNumber" style="background-color:transparent !important;" type="text" placeholder="请输入手机号"/>
<div class="name_bline_left" :class="name_bline==true?'_bline_w':''"></div>
<div class="name_bline_right" :class="name_bline==true?'_bline_w':''"></div>
</div>
<div class="error-msg">
<div v-show="nameIsShow"><img src="../assets/img/login-error-tips.png"/>{{ nameErrorMsg }}</div>
</div>
<div class="login-commonBotm">
<i class="icon-login-password iconfont icon-mima"></i>
<input class="input" @focus="pwd_bline=true" @blur="pwd_bline=false" autocomplete="new-password" maxlength="20" v-model="password" style="background-color:transparent !important" type="password" placeholder="请输入新密码"/>
<div class="pwd_bline_left" :class="pwd_bline==true?'_bline_w':''"></div>
<div class="pwd_bline_right" :class="pwd_bline==true?'_bline_w':''"></div>
</div>
<div v-if="isShow==3" class="phoneLogin">
<div class="sumMainTitle bindTitle">{{groupModel.GroupName?groupModel.GroupName:''}}</div>
<div class="sumPhone">修改密码</div>
<div class="login-commonBotm">
<i class="icon-login-name iconfont icon-phone1"></i>
<input class="input" @focus="name_bline=true" onkeyup="value=value.replace(/[^\d]/g,'')" maxlength="11"
@blur="name_bline=false" autocomplete="new-password" v-model="mobileNumber"
style="background-color:transparent !important;" type="text" placeholder="请输入手机号" />
<div class="name_bline_left" :class="name_bline==true?'_bline_w':''"></div>
<div class="name_bline_right" :class="name_bline==true?'_bline_w':''"></div>
</div>
<div class="error-msg">
<div v-show="nameIsShow"><img src="../assets/img/login-error-tips.png" />{{ nameErrorMsg }}</div>
</div>
<div class="login-commonBotm">
<i class="icon-login-password iconfont icon-mima"></i>
<input class="input" @focus="pwd_bline=true" @blur="pwd_bline=false" autocomplete="new-password"
maxlength="20" v-model="password" style="background-color:transparent !important" type="password"
placeholder="请输入新密码" />
<div class="pwd_bline_left" :class="pwd_bline==true?'_bline_w':''"></div>
<div class="pwd_bline_right" :class="pwd_bline==true?'_bline_w':''"></div>
</div>
<div class="login-commonBotm btValidate">
<i class="icon-login-password iconfont icon-mima"></i>
<input class="input phoneValidate" maxlength="4" onkeyup="value=value.replace(/[^\d]/g,'')" @focus="validate_bline=true" @blur="validate_bline=false" v-model="code" autocomplete="new-password" style="background-color:transparent !important" type="text" placeholder="验证码" @keyup.enter="changePwd"/>
<div class="pwd_bline_left" :class="validate_bline==true?'_bline_w':''"></div>
<div class="pwd_bline_right" :class="validate_bline==true?'_bline_w':''"></div>
<div class="validatCode">
<span v-show="show" @click="getCode">获取验证码</span>
<span v-show="!show" class="count">{{count}}s重新获取</span>
</div>
</div>
<div class="forgetPw">
<div class="error-msg" style="float:left;width:auto;">
<div v-show="passwordIsShow"><img src="../assets/img/login-error-tips.png"/>{{ passwordErrorMsg }}</div>
</div>
<span @click="goLogin">去登录</span>
</div>
<input type="button" class="sLoginBtn changeBtn" @click="changePwd" value="确认修改"/>
<div class="login-commonBotm btValidate">
<i class="icon-login-password iconfont icon-mima"></i>
<input class="input phoneValidate" maxlength="4" onkeyup="value=value.replace(/[^\d]/g,'')"
@focus="validate_bline=true" @blur="validate_bline=false" v-model="code" autocomplete="new-password"
style="background-color:transparent !important" type="text" placeholder="验证码" @keyup.enter="changePwd" />
<div class="pwd_bline_left" :class="validate_bline==true?'_bline_w':''"></div>
<div class="pwd_bline_right" :class="validate_bline==true?'_bline_w':''"></div>
<div class="validatCode">
<span v-show="show" @click="getCode">获取验证码</span>
<span v-show="!show" class="count">{{count}}s重新获取</span>
</div>
</div>
<img class="login_elephant" src="../assets/img/elephant.gif" alt=""/>
</form>
<div class="forgetPw">
<div class="error-msg" style="float:left;width:auto;">
<div v-show="passwordIsShow"><img src="../assets/img/login-error-tips.png" />{{ passwordErrorMsg }}</div>
</div>
<span @click="goLogin">去登录</span>
</div>
<input type="button" class="sLoginBtn changeBtn" @click="changePwd" value="确认修改" />
</div>
<img class="login_elephant" src="../assets/img/elephant.gif" alt="" />
</form>
</div>
</template>
<script>
import url_1 from "@/assets/img/login_bg_1.jpg";
import url_2 from "@/assets/img/login_bg_2.jpg";
export default {
name: "login-box",
data() {
return {
userInfo: {
name: "",
export default {
name: "login-box",
data() {
return {
userInfo: {
name: "",
password: "",
Domain: ""
},
groupModel: "",
password: "",
Domain:""
},
groupModel:"",
password: "",
mobileNumber: "",
code: "",
mobileCodeType: 1,
show: true,
count: "",
timer: null,
isShow: 1,
vedioCanPlay: false,
fixStyle: "",
nameIsShow: false,
passwordIsShow: false,
nameErrorMsg: "",
passwordErrorMsg: "",
name_bline: false,
pwd_bline: false,
validate_bline: false,
loginState: 0,
height:0,
clock:null,
crtIndex:0,
imgs:[
url_1,
url_2
]
};
},
mounted() {
this.init();
let that=this;
this.clock=setInterval(()=>{
that.init()
},1000);
let _audio = this.$refs.audio;
try {
_audio.playbackRate = 0.5;
} catch (error) {}
this.getGroup();
mobileNumber: "",
code: "",
mobileCodeType: 1,
show: true,
count: "",
timer: null,
isShow: 1,
vedioCanPlay: false,
fixStyle: "",
nameIsShow: false,
passwordIsShow: false,
nameErrorMsg: "",
passwordErrorMsg: "",
name_bline: false,
pwd_bline: false,
validate_bline: false,
loginState: 0,
height: 0,
clock: null,
crtIndex: 0,
imgs: [
url_1,
url_2
]
};
},
mounted() {
this.init();
let that = this;
this.clock = setInterval(() => {
that.init()
}, 1000);
let _audio = this.$refs.audio;
try {
_audio.playbackRate = 0.5;
} catch (error) {}
this.getGroup();
this.initData();
window.onresize = () => {
const windowWidth = document.body.clientWidth;
const windowHeight = document.body.clientHeight;
const windowAspectRatio = windowHeight / windowWidth;
let videoWidth;
let videoHeight;
if (windowAspectRatio < 0.5625) {
videoWidth = windowWidth;
videoHeight = videoWidth * 0.5625;
this.fixStyle = {
height: windowWidth * 0.5625 + "px",
width: windowWidth + "px",
"margin-bottom": (windowHeight - videoHeight) / 2 + "px",
"margin-left": "initial"
};
} else {
videoHeight = windowHeight;
videoWidth = videoHeight / 0.5625;
this.fixStyle = {
height: windowHeight + "px",
width: windowHeight / 0.5625 + "px",
"margin-left": (windowWidth - videoWidth) / 2 + "px",
"margin-bottom": "initial"
};
}
};
window.onresize();
},
methods: {
init(){
let over=true;
let maxHeight=0;
if(!this.$refs['swiper'])
return false;
this.$refs['swiper'].forEach(x=>{
if(x.complete){
maxHeight=x.height>maxHeight?x.height:maxHeight
}else{
over=false;
return false
this.initData();
window.onresize = () => {
const windowWidth = document.body.clientWidth;
const windowHeight = document.body.clientHeight;
const windowAspectRatio = windowHeight / windowWidth;
let videoWidth;
let videoHeight;
if (windowAspectRatio < 0.5625) {
videoWidth = windowWidth;
videoHeight = videoWidth * 0.5625;
this.fixStyle = {
height: windowWidth * 0.5625 + "px",
width: windowWidth + "px",
"margin-bottom": (windowHeight - videoHeight) / 2 + "px",
"margin-left": "initial"
};
} else {
videoHeight = windowHeight;
videoWidth = videoHeight / 0.5625;
this.fixStyle = {
height: windowHeight + "px",
width: windowHeight / 0.5625 + "px",
"margin-left": (windowWidth - videoWidth) / 2 + "px",
"margin-bottom": "initial"
};
}
});
if(over){
this.height=maxHeight;
clearInterval(this.clock);
let that=this;
that.change();
setInterval(()=>{
that.change()
},8000)
}
},
change(){
if(this.crtIndex<this.imgs.length-1)
this.crtIndex++
else
this.crtIndex=0
},
//初始化数据
initData() {
//判断是否是线上环境
if (!this.isOnline()) {
this.userInfo.name = "17602887190";
this.userInfo.password = "123456";
}
this.userInfo.Domain =window.location.hostname
};
window.onresize();
},
getGroup() { //获取集团
let Domain= window.location.hostname
this.apipost('admin_get_GetModelByDomain',{'Domain':Domain}, res => {
methods: {
init() {
let over = true;
let maxHeight = 0;
if (!this.$refs['swiper'])
return false;
this.$refs['swiper'].forEach(x => {
if (x.complete) {
maxHeight = x.height > maxHeight ? x.height : maxHeight
} else {
over = false;
return false
}
});
if (over) {
this.height = maxHeight;
clearInterval(this.clock);
let that = this;
that.change();
setInterval(() => {
that.change()
}, 8000)
}
},
change() {
if (this.crtIndex < this.imgs.length - 1)
this.crtIndex++
else
this.crtIndex = 0
},
//初始化数据
initData() {
//判断是否是线上环境
if (!this.isOnline()) {
this.userInfo.name = "17602887190";
this.userInfo.password = "123456";
}
this.userInfo.Domain = window.location.hostname
},
getGroup() { //获取集团
let Domain = window.location.hostname
this.apipost('admin_get_GetModelByDomain', {
'Domain': Domain
}, res => {
this.groupModel = res.data.data;
document.title="欢迎使用 "+this.groupModel.GroupName+" ERP系统";
}, err => {})
},
canplay() {
this.vedioCanPlay = true;
},
doLogin() {
if (this.userInfo.name == "") {
this.nameIsShow = true;
this.nameErrorMsg = "请输入用户名";
return;
} else if (this.userInfo.password == "") {
this.passwordIsShow = true;
this.passwordErrorMsg = "请输入密码";
return;
} else {
this.nameIsShow = false;
this.passwordIsShow = false;
}
this.loginState = 1;
var msg = {
EmAccount: this.userInfo.name,
EmPassword: this.userInfo.password,
Domain: this.userInfo.Domain
};
this.apipost(
"admin_get_EmployeeLogin",
msg,
response => {
var jsonData = response.data;
//未绑定手机号码
if (jsonData.resultCode == 10006) {
document.title = "欢迎使用 " + this.groupModel.GroupName + " ERP系统";
}, err => {})
},
canplay() {
this.vedioCanPlay = true;
},
doLogin() {
if (this.userInfo.name == "") {
this.nameIsShow = true;
this.nameErrorMsg = "请输入用户名";
return;
} else if (this.userInfo.password == "") {
this.passwordIsShow = true;
this.passwordErrorMsg = "请输入密码";
return;
} else {
this.nameIsShow = false;
this.passwordIsShow = false;
}
this.loginState = 1;
var msg = {
EmAccount: this.userInfo.name,
EmPassword: this.userInfo.password,
Domain: this.userInfo.Domain
};
this.apipost(
"admin_get_EmployeeLogin",
msg,
response => {
var jsonData = response.data;
//未绑定手机号码
if (jsonData.resultCode == 10006) {
this.$notify.error({
title: this.$t('tips.tips'),
customClass: "msgTips",
message: "请绑定手机号",
showClose: false,
duration: 3000
});
this.isShow = 2;
} else if (jsonData.resultCode == 1) {
//登录成功
var userData = jsonData.data;
var userJson = JSON.stringify(userData);
localStorage.removeItem('navTabs')
localStorage.removeItem('orderObj')
localStorage.userInfo = userJson;
let firstTire = []
userData.UserMenu.forEach(x => {
if (x.MenuUrl == '') {
firstTire.push(x.MenuName)
}
})
//UserMenu
this.$cookie.set("account", this.userInfo.name);
this.$cookie.set("EmployeeId", userData.EmployeeId);
this.$cookie.set("RB_Branch_id", userData.RB_Branch_id);
this.$cookie.set("RB_Group_id", userData.RB_Group_id);
localStorage.menu = JSON.stringify(firstTire)
this.loginState = 0;
this.$router.push({
path: "/personalCenter"
});
} else {
this.$notify.error({
title: this.$t('tips.tips'),
customClass: "msgTips",
message: response.data.message,
showClose: false,
duration: 3000
});
this.loginState = 0;
}
},
err => {}
);
},
getCode() {
var phoneReg = /(^1[3|4|5|6|7|8|9]\d{9}$)|(^09\d{8}$)/;
//电话
var phone = this.mobileNumber.replace(/^\s+|\s+$/gm, "");
if (!phoneReg.test(phone)) {
this.nameIsShow = true;
this.nameErrorMsg = "请输入有效的手机号码!";
return false;
} else {
this.nameIsShow = false;
}
const TIME_COUNT = 60;
this.code = "";
if (!this.timer) {
this.count = TIME_COUNT;
this.show = false;
this.timer = setInterval(() => {
if (this.count > 0 && this.count <= TIME_COUNT) {
this.count--;
} else {
this.show = true;
clearInterval(this.timer);
this.timer = null;
}
}, 1000);
}
let msg = {
mobileNumber: this.mobileNumber,
mobileCodeType: this.mobileCodeType
};
this.apipost("user_get_moblieNumber_code", msg, res => {
if (res.data.resultCode == 1) {} else {
this.$notify.error({
title: this.$t('tips.tips'),
customClass: "msgTips",
message: "请绑定手机号",
message: res.data.message,
showClose: false,
duration: 3000
});
this.isShow = 2;
} else if (jsonData.resultCode == 1) {
//登录成功
var userData = jsonData.data;
var userJson = JSON.stringify(userData);
localStorage.removeItem('navTabs')
localStorage.removeItem('orderObj')
localStorage.userInfo = userJson;
let firstTire = []
userData.UserMenu.forEach(x=>{
if(x.MenuUrl=='') {
firstTire.push(x.MenuName)
}
})
//UserMenu
this.$cookie.set("account", this.userInfo.name);
this.$cookie.set("EmployeeId", userData.EmployeeId);
this.$cookie.set("RB_Branch_id", userData.RB_Branch_id);
this.$cookie.set("RB_Group_id", userData.RB_Group_id);
localStorage.menu=JSON.stringify(firstTire)
}
});
},
doBind() {
if (this.mobileNumber == "") {
this.nameIsShow = true;
this.nameErrorMsg = "请输入手机号";
return;
} else if (this.code == "") {
this.passwordIsShow = true;
this.passwordErrorMsg = "请输入验证码";
return;
}
let msg = {
account: this.userInfo.name,
password: this.userInfo.password,
mobileNumber: this.mobileNumber,
code: this.code
};
this.apipost("user_account_bind_moblieNumber", msg, res => {
if (res.data.resultCode == 1) {
this.isShow = 1;
this.loginState = 0;
this.$router.push({ path: "/personalCenter" });
this.userInfo.name = this.mobileNumber;
} else {
this.$notify.error({
title: this.$t('tips.tips'),
customClass: "msgTips",
message: response.data.message,
message: res.data.message,
showClose: false,
duration: 3000
});
this.loginState = 0;
}
},
err => {}
);
},
getCode() {
var phoneReg = /(^1[3|4|5|6|7|8|9]\d{9}$)|(^09\d{8}$)/;
//电话
var phone = this.mobileNumber.replace(/^\s+|\s+$/gm, "");
if (!phoneReg.test(phone)) {
this.nameIsShow = true;
this.nameErrorMsg = "请输入有效的手机号码!";
return false;
} else {
this.nameIsShow = false;
}
const TIME_COUNT = 60;
this.code = "";
if (!this.timer) {
this.count = TIME_COUNT;
this.show = false;
this.timer = setInterval(() => {
if (this.count > 0 && this.count <= TIME_COUNT) {
this.count--;
});
},
updatePwd() {
this.isShow = 3;
this.mobileCodeType = 2;
},
changePwd() {
let msg = {
password: this.password,
mobileNumber: this.mobileNumber,
code: this.code
};
this.apipost("user_change_password_by_mobileNumber", msg, res => {
if (res.data.resultCode == 1) {
this.isShow = 1;
this.$notify.success({
title: this.$t('tips.tips'),
customClass: "msgTips",
message: res.data.message,
showClose: false,
duration: 3000
});
} else {
this.show = true;
clearInterval(this.timer);
this.timer = null;
this.$notify.error({
title: this.$t('tips.tips'),
customClass: "msgTips",
message: res.data.message,
showClose: false,
duration: 3000
});
}
}, 1000);
}
let msg = {
mobileNumber: this.mobileNumber,
mobileCodeType: this.mobileCodeType
};
this.apipost("user_get_moblieNumber_code", msg, res => {
if (res.data.resultCode == 1) {
} else {
this.$notify.error({
title: this.$t('tips.tips'),
customClass: "msgTips",
message: res.data.message,
showClose: false,
duration: 3000
});
}
});
},
doBind() {
if (this.mobileNumber == "") {
this.nameIsShow = true;
this.nameErrorMsg = "请输入手机号";
return;
} else if (this.code == "") {
this.passwordIsShow = true;
this.passwordErrorMsg = "请输入验证码";
return;
});
},
goLogin() {
this.isShow = 1;
}
let msg = {
account: this.userInfo.name,
password: this.userInfo.password,
mobileNumber: this.mobileNumber,
code: this.code
};
this.apipost("user_account_bind_moblieNumber", msg, res => {
if (res.data.resultCode == 1) {
this.isShow = 1;
this.loginState = 0;
this.userInfo.name = this.mobileNumber;
} else {
this.$notify.error({
title: this.$t('tips.tips'),
customClass: "msgTips",
message: res.data.message,
showClose: false,
duration: 3000
});
}
});
},
updatePwd() {
this.isShow = 3;
this.mobileCodeType = 2;
},
changePwd() {
let msg = {
password: this.password,
mobileNumber: this.mobileNumber,
code: this.code
};
this.apipost("user_change_password_by_mobileNumber", msg, res => {
if (res.data.resultCode == 1) {
this.isShow = 1;
this.$notify.success({
title: this.$t('tips.tips'),
customClass: "msgTips",
message: res.data.message,
showClose: false,
duration: 3000
});
} else {
this.$notify.error({
title: this.$t('tips.tips'),
customClass: "msgTips",
message: res.data.message,
showClose: false,
duration: 3000
});
}
});
},
goLogin() {
this.isShow = 1;
}
}
};
};
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<template>
<div class="flexOne">
<div class="query-box">
<ul>
<li>
<span><em>{{$t('adm.adm_title')}}</em><el-input v-model='msg.Title' class="permiss-input"></el-input></span>
</li>
<li>
<span><em>{{$t('adm.adm_Publisher')}}</em><el-select filterable clearable v-model='msg.UpdateBy' :placeholder="$t('pub.unlimitedSel')">
<el-option :label="$t('pub.unlimitedSel')" value='-1'></el-option>
<el-option v-for='item in Employee'
:label='item.EmName'
:value='item.EmployeeId'
:key='item.EmployeeId'>
</el-option>
</el-select>
</span>
</li>
<li>
<span><em>{{$t('adm.adm_ublicationstatus')}}</em><el-select v-model="msg.Status" :placeholder="$t('pub.unlimitedSel')">
<el-option :label="$t('pub.unlimitedSel')" value='-1'></el-option>
<el-option :label="$t('adm.adm_tobepublish')" value='0'></el-option>
<el-option :label="$t('adm.adm_published')" value='1'></el-option>
<el-option :label="$t('adm.adm_Withdrawn')" value='2'></el-option>
</el-select>
</span>
</li>
<li>
<span><em>{{$t('adm.adm_Ceilingsituation')}}</em><el-select v-model="msg.Is_top" :placeholder="$t('pub.unlimitedSel')">
<el-option :label="$t('pub.unlimitedSel')" value='-1'></el-option>
<el-option :label="$t('adm.adm_Noroofset')" value='0'></el-option>
<el-option :label="$t('adm.adm_roofset')" value='1'></el-option>
</el-select>
</span>
</li>
<li>
<input type="button" class="hollowFixedBtn" :value="$t('pub.searchBtn')" @click="resetPageIndex(),getList()" />
<input type="button" @click="outerVisible = true,dialogTitle=$t('objFill.v101.administrative.tianjiagogao'),layerType=2,clearMessage()" class="normalBtn" :value="$t('pub.addBtn')" />
</li>
</ul>
</div>
<table class="singeRowTable" border="0" cellspacing="0" cellpadding="0">
<tr>
<th>{{$t('adm.adm_theme')}}</th>
<!-- <th>{{$t('adm.adm_Ceilingsituation')}}</th> -->
<th>{{$t('adm.adm_ublicationstatus')}}</th>
<th>{{$t('admin.admin_czPerson')}}</th>
<th>{{$t('fnc.caozuoriqi')}}</th>
<th>{{$t('system.table_operation')}}</th>
</tr>
<tr v-for="(item,index) in DataList" v-loading='loading'>
<td>{{item.Title}}</td>
<!-- <td>{{item.Is_top==0?'':$t('adm.adm_roofset')}}</td> -->
<td>{{item.Status | noticeFormat(item.Status)}}</td>
<td>{{item.UpdateName}}</td>
<td>{{item.UpdateTime|dateFormat(item.UpdateTime)}}</td>
<td>
<el-button-group>
<el-tooltip v-if="item.Status!='0'" class="item" effect="dark" :content="$t('fnc.xiangqing')" placement="top-start">
<el-button @click='getDetails(item.Id, item.Title)' type="primary" icon="el-icon-tickets" ></el-button>
</el-tooltip>
<el-tooltip v-if="item.Status=='0'" class="item" effect="dark" :content="$t('pub.updateMsg')" placement="top-start">
<el-button @click='updateNotice(item.Id)' type="primary" icon="el-icon-edit" ></el-button>
</el-tooltip>
<!-- <el-tooltip v-if="item.Is_top==0&&item.Status=='1'" class="item" effect="dark" :content="$t('adm.adm_roof')" placement="top-start">
<div class="flexOne">
<div class="query-box">
<ul>
<li>
<span><em>{{$t('adm.adm_title')}}</em>
<el-input v-model='msg.Title' class="permiss-input"></el-input>
</span>
</li>
<li>
<span><em>{{$t('adm.adm_Publisher')}}</em>
<el-select filterable clearable v-model='msg.UpdateBy' :placeholder="$t('pub.unlimitedSel')">
<el-option :label="$t('pub.unlimitedSel')" value='-1'></el-option>
<el-option v-for='item in Employee' :label='item.EmName' :value='item.EmployeeId' :key='item.EmployeeId'>
</el-option>
</el-select>
</span>
</li>
<li>
<span><em>{{$t('adm.adm_ublicationstatus')}}</em>
<el-select v-model="msg.Status" :placeholder="$t('pub.unlimitedSel')">
<el-option :label="$t('pub.unlimitedSel')" value='-1'></el-option>
<el-option :label="$t('adm.adm_tobepublish')" value='0'></el-option>
<el-option :label="$t('adm.adm_published')" value='1'></el-option>
<el-option :label="$t('adm.adm_Withdrawn')" value='2'></el-option>
</el-select>
</span>
</li>
<li>
<span><em>{{$t('adm.adm_Ceilingsituation')}}</em>
<el-select v-model="msg.Is_top" :placeholder="$t('pub.unlimitedSel')">
<el-option :label="$t('pub.unlimitedSel')" value='-1'></el-option>
<el-option :label="$t('adm.adm_Noroofset')" value='0'></el-option>
<el-option :label="$t('adm.adm_roofset')" value='1'></el-option>
</el-select>
</span>
</li>
<li>
<input type="button" class="hollowFixedBtn" :value="$t('pub.searchBtn')"
@click="resetPageIndex(),getList()" />
<input type="button"
@click="outerVisible = true,dialogTitle=$t('objFill.v101.administrative.tianjiagogao'),layerType=2,clearMessage()"
class="normalBtn" :value="$t('pub.addBtn')" />
</li>
</ul>
</div>
<table class="singeRowTable" border="0" cellspacing="0" cellpadding="0">
<tr>
<th>{{$t('adm.adm_theme')}}</th>
<!-- <th>{{$t('adm.adm_Ceilingsituation')}}</th> -->
<th>{{$t('adm.adm_ublicationstatus')}}</th>
<th>{{$t('admin.admin_czPerson')}}</th>
<th>{{$t('fnc.caozuoriqi')}}</th>
<th>{{$t('system.table_operation')}}</th>
</tr>
<tr v-for="(item,index) in DataList" v-loading='loading'>
<td>{{item.Title}}</td>
<!-- <td>{{item.Is_top==0?'':$t('adm.adm_roofset')}}</td> -->
<td>{{item.Status | noticeFormat(item.Status)}}</td>
<td>{{item.UpdateName}}</td>
<td>{{item.UpdateTime|dateFormat(item.UpdateTime)}}</td>
<td>
<el-button-group>
<el-tooltip v-if="item.Status!='0'" class="item" effect="dark" :content="$t('fnc.xiangqing')"
placement="top-start">
<el-button @click='getDetails(item.Id, item.Title)' type="primary" icon="el-icon-tickets"></el-button>
</el-tooltip>
<el-tooltip v-if="item.Status=='0'" class="item" effect="dark" :content="$t('pub.updateMsg')"
placement="top-start">
<el-button @click='updateNotice(item.Id)' type="primary" icon="el-icon-edit"></el-button>
</el-tooltip>
<!-- <el-tooltip v-if="item.Is_top==0&&item.Status=='1'" class="item" effect="dark" :content="$t('adm.adm_roof')" placement="top-start">
<el-button @click="setTop(item.Id)" type="primary" icon="iconfont icon-control-top" ></el-button>
</el-tooltip> -->
<!-- <el-tooltip v-if="item.Is_top==1&&item.Status=='1'" class="item" effect="dark" :content="$t('adm.adm_exitroof')" placement="top-start">
<!-- <el-tooltip v-if="item.Is_top==1&&item.Status=='1'" class="item" effect="dark" :content="$t('adm.adm_exitroof')" placement="top-start">
<el-button @click="setTop(item.Id)" type="primary" icon="iconfont icon-control-bottom" ></el-button>
</el-tooltip> -->
<el-tooltip v-if="item.Status=='1'" class="item" effect="dark" :content="$t('adm.adm_chehui')" placement="top-start">
<el-button @click='reCallNotice(item.Id)' type="warning" icon="el-icon-delete"></el-button>
</el-tooltip>
<el-tooltip v-if="item.Status=='0'" class="item" effect="dark" :content="$t('system.table_delete')" placement="top-start">
<el-button @click='deleteNotice(item.Id)' type="danger" icon="el-icon-delete" ></el-button>
</el-tooltip>
</el-button-group>
</td>
</tr>
</table>
<el-pagination
background
@current-change="handleCurrentChange"
:current-page.sync="currentPage"
layout="total,prev, pager, next, jumper"
:page-size=msg.pageSize
:total=total>
</el-pagination>
<el-dialog custom-class='w800' :title="dialogTitle" :visible.sync="outerVisible" center :before-close="closeChangeMachie">
<div v-if='layerType==1'>
<p style="text-align: right; padding: 5px 0;">{{detailMessage.EmName}}&nbsp;&nbsp;&nbsp;&nbsp;{{detailMessage.UpdateTime}}</p>
<div v-html="detailMessage.Content">
<el-tooltip v-if="item.Status=='1'" class="item" effect="dark" :content="$t('adm.adm_chehui')"
placement="top-start">
<el-button @click='reCallNotice(item.Id)' type="warning" icon="el-icon-delete"></el-button>
</el-tooltip>
<el-tooltip v-if="item.Status=='0'" class="item" effect="dark" :content="$t('system.table_delete')"
placement="top-start">
<el-button @click='deleteNotice(item.Id)' type="danger" icon="el-icon-delete"></el-button>
</el-tooltip>
</el-button-group>
</td>
</tr>
</table>
<el-pagination background @current-change="handleCurrentChange" :current-page.sync="currentPage"
layout="total,prev, pager, next, jumper" :page-size=msg.pageSize :total=total>
</el-pagination>
<el-dialog custom-class='w800' :title="dialogTitle" :visible.sync="outerVisible" center
:before-close="closeChangeMachie">
<div v-if='layerType==1'>
<p style="text-align: right; padding: 5px 0;">
{{detailMessage.EmName}}&nbsp;&nbsp;&nbsp;&nbsp;{{detailMessage.UpdateTime}}</p>
<div v-html="detailMessage.Content">
</div>
<!-- <pre style="letter-spacing: 1px; font-size: 14px; color: #333;">
</div>
<!-- <pre style="letter-spacing: 1px; font-size: 14px; color: #333;">
{{detailMessage.Content}}
</pre> -->
<p style="padding:0 10px; margin: 10px 0; background: #f1f1f1;">{{$t('adm.adm_fujian')}}</p>
<p style="height: 28px; padding: 0 10px; line-height: 28px;" v-for="item in downLoadList" class="AnnFileListPMeta">
<i class="iconfont icon-xiazai"></i>--<span @click="downloadSingle(item)">{{item.Name}}</span>
</p>
</div>
<el-form v-if='layerType==2' :model="addMsg" :rules="rules" ref="addMsg" label-width="100px" >
<table class="layerNoIcon">
<tr>
<td>
<el-form-item :label="$t('adm.adm_title')" prop="Title">
<el-input class='w600' type="text" v-model="addMsg.Title" :placeholder="$t('pub.pleaseImport')"></el-input>
</el-form-item>
</td>
</tr>
<tr>
<td>
<quill-editor :options="editorOption" v-model="addMsg.Content"></quill-editor>
</td>
</tr>
<tr>
<td><el-form-item :label="$t('adm.adm_fujian')">
<el-upload
:http-request="UploadAttachment"
:multiple="true" :show-file-list="false" action="">
<el-button size="small" type="danger" icon="el-icon-upload2">{{$t('adm.adm_content')}}</el-button>
</el-upload>
</el-form-item>
</td>
</tr>
<tr v-if='uploadList.length>0'>
<td>
<el-form-item :label="$t('adm.adm_fjlist')">
<div class="AnnfileList">
<li v-for="item in uploadList">
<span @click="downloadOne(item)">{{item.name}}--{{$t('adm.adm_download')}}</span>
<i class="el-icon-circle-close-outline" @click="deleteFile(item)"></i>
</li>
</div>
</el-form-item>
</td>
</tr>
</table>
</el-form>
<div v-if='layerType!=1' slot="footer" class="dialog-footer">
<button class="hollowFixedBtn" @click="outerVisible = false,resetForm('addMsg')">{{$t('pub.cancelBtn')}}</button>
&nbsp;
<button class="normalBtn" type="primary" @click="submitForm('addMsg',0)">{{$t('fnc.zancun')}}</button>
&nbsp;
<button class="normalBtn" type="primary" @click="submitForm('addMsg',1)">{{$t('adm.adm_publish')}}</button>
</div>
<div v-if='layerType==1' slot="footer" class="dialog-footer">
<button class="normalBtn" @click="outerVisible = false">{{$t('pub.closeSel')}}</button>
</div>
</el-dialog>
</div>
<p style="padding:0 10px; margin: 10px 0; background: #f1f1f1;">{{$t('adm.adm_fujian')}}</p>
<p style="height: 28px; padding: 0 10px; line-height: 28px;" v-for="item in downLoadList"
class="AnnFileListPMeta">
<i class="iconfont icon-xiazai"></i>--<span @click="downloadSingle(item)">{{item.Name}}</span>
</p>
</div>
<el-form v-if='layerType==2' :model="addMsg" :rules="rules" ref="addMsg" label-width="100px">
<table class="layerNoIcon">
<tr>
<td>
<el-form-item :label="$t('adm.adm_title')" prop="Title">
<el-input class='w600' type="text" v-model="addMsg.Title" :placeholder="$t('pub.pleaseImport')">
</el-input>
</el-form-item>
</td>
</tr>
<tr>
<td>
<quill-editor :options="editorOption" v-model="addMsg.Content"></quill-editor>
</td>
</tr>
<tr>
<td>
<el-form-item :label="$t('adm.adm_fujian')">
<el-upload :http-request="UploadAttachment" :multiple="true" :show-file-list="false" action="">
<el-button size="small" type="danger" icon="el-icon-upload2">{{$t('adm.adm_content')}}</el-button>
</el-upload>
</el-form-item>
</td>
</tr>
<tr v-if='uploadList.length>0'>
<td>
<el-form-item :label="$t('adm.adm_fjlist')">
<div class="AnnfileList">
<li v-for="item in uploadList">
<span @click="downloadOne(item)">{{item.name}}--{{$t('adm.adm_download')}}</span>
<i class="el-icon-circle-close-outline" @click="deleteFile(item)"></i>
</li>
</div>
</el-form-item>
</td>
</tr>
</table>
</el-form>
<div v-if='layerType!=1' slot="footer" class="dialog-footer">
<button class="hollowFixedBtn"
@click="outerVisible = false,resetForm('addMsg')">{{$t('pub.cancelBtn')}}</button>
&nbsp;
<button class="normalBtn" type="primary" @click="submitForm('addMsg',0)">{{$t('fnc.zancun')}}</button>
&nbsp;
<button class="normalBtn" type="primary" @click="submitForm('addMsg',1)">{{$t('adm.adm_publish')}}</button>
</div>
<div v-if='layerType==1' slot="footer" class="dialog-footer">
<button class="normalBtn" @click="outerVisible = false">{{$t('pub.closeSel')}}</button>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
data() {
return {
editorOption: {
modules:{
toolbar:[
['bold', 'italic', 'underline', 'strike', 'image'], // toggled buttons
[{ 'header': [1, 2, 3, 4, 5, 6, false] }],
[{ 'color': [] }, {'background': [] }],
[{ 'font': [] }],
[{ 'align': [] }],
[{ 'size': ['small', false, 'large', 'huge'] }],
[{ 'list': 'ordered'}, { 'list': 'bullet' }]
]
}
},
uploadList:[],
layerType:'',
loading:true,
//分页
total: 0,
pageSize: '',
currentPage: 1,
//弹窗
outerVisible: false,
isRight: true,
dialogTitle: '',
//请求参数
msg: {
pageIndex: 1,
pageSize: 15,
Status: '-1',
Is_top: '-1',
Title: '',
UpdateBy: '-1'
},
addMsg:{
Id:'-1',
Title:'',
Content:'',
Status:'',
FileList:[],
RB_Group_Id:'-1',
},
rules:{
Title: [{
required: true,
message: this.$t('adm.adm_qsrgbbiaoti'),
trigger: 'blur'
}],
Content: [{
required: true,
message: this.$t('adm.adm_qsrgbneirong'),
trigger: 'blur'
}],
},
employeeMsg:{
GroupId:'',
BranchId:0,
DepartmentId:0,
PostId:0,
IsLeave:0,
},
//返回结果
DataList: [],
Employee:[],
detailMessage:[],
downLoadList:[],
fabuStatus:{
export default {
data() {
return {
editorOption: {
modules: {
toolbar: [
['bold', 'italic', 'underline', 'strike', 'image'], // toggled buttons
[{
'header': [1, 2, 3, 4, 5, 6, false]
}],
[{
'color': []
}, {
'background': []
}],
[{
'font': []
}],
[{
'align': []
}],
[{
'size': ['small', false, 'large', 'huge']
}],
[{
'list': 'ordered'
}, {
'list': 'bullet'
}]
]
}
},
uploadList: [],
layerType: '',
loading: true,
//分页
total: 0,
pageSize: '',
currentPage: 1,
//弹窗
outerVisible: false,
isRight: true,
dialogTitle: '',
//请求参数
msg: {
pageIndex: 1,
pageSize: 15,
Status: '-1',
Is_top: '-1',
Title: '',
UpdateBy: '-1'
},
addMsg: {
Id: '-1',
Title: '',
Content: '',
Status: '',
FileList: [],
RB_Group_Id: '-1',
},
rules: {
Title: [{
required: true,
message: this.$t('adm.adm_qsrgbbiaoti'),
trigger: 'blur'
}],
Content: [{
required: true,
message: this.$t('adm.adm_qsrgbneirong'),
trigger: 'blur'
}],
},
employeeMsg: {
GroupId: '',
BranchId: 0,
DepartmentId: 0,
PostId: 0,
IsLeave: 0,
},
//返回结果
DataList: [],
Employee: [],
detailMessage: [],
downLoadList: [],
fabuStatus: {
t1: this.$t('objFill.fabuzts')[0],
t2: this.$t('objFill.fabuzts')[1],
t3: this.$t('objFill.fabuzts')[2],
}
}
},
filters:{
noticeFormat(status){
if(status=="0")
return this.fabuStatus.t1
if(status=="1")
return this.fabuStatus.t2
if(status=="2")
return this.fabuStatus.t3
},
dateFormat(date){
return date.replace('T',' ')
}
},
mounted() {
let userInfo=this.getLocalStorage();
this.addMsg.RB_Group_Id=userInfo.RB_Group_id
this.getList();
this.getEmployee();
},
methods: {
UploadAttachment(file) { //上传
if(file.file.size > 1024 * 1024 * 100) {
this.$message.warning(this.$t('adm.adm_filenotmoreM'))
return
}
let newArr = [];
newArr.push(file.file)
let path = "/Upload/Temporary/"
this.$message.info(this.$t('tips.shangchuanzhong'))
this.UploadSelfFileT(path, newArr, x => {
let fileSize = file.file.size<1024? file.file.size:(file.file.size / 1024).toFixed(0);
this.saveMsg = []
this.saveMsg.push({
Path: x.data.FilePath,
FileName: file.file.name,
MD5Sign: file.file.uid,
FileSize: fileSize,
FolderId: this.msg.ParentId
})
this.uploadList.push({url:x.data.FilePath,name:file.file.name})
});
},
downloadSingle(obj){
const link = document.createElement('a');
let _loadUrl=this.domainManager().UploadUrl;
link.href = obj.Url;
document.body.appendChild(link);
window.open(obj.Url)
},
downloadOne(obj){
this.downloadFileRename(obj.url,obj.name);
},
deleteFile(obj){
if(this.uploadList.findIndex(item => item.url === obj.url)!=-1){
this.uploadList.splice(this.uploadList.findIndex(item => item.url === obj.url), 1)
}
},
reCallNotice(id){
this.$confirm(this.$t('adm.adm_sfchehui'), this.$t('tips.tips'), {
confirmButtonText: this.$t('pub.sureBtn'),
cancelButtonText: this.$t('pub.cancelBtn'),
type: 'warning'
}).then(() => {
this.apipost("User_post_NoticeSetRevocation",{noticeId:id},res=>{
if(res.data.resultCode == 1) {
this.$message.success( this.$t('adm.adm_chsuccess'))
this.getList();
}
},err=>{})
}).catch(() => {
this.$message({
type: 'info',
message: this.$t('adm.adm_chexit')
});
});
},
deleteNotice(id){
this.$confirm(this.$t('tips.shifoushanchu'), this.$t('tips.tips'), {
confirmButtonText: this.$t('pub.sureBtn'),
cancelButtonText: this.$t('pub.cancelBtn'),
type: 'warning'
}).then(() => {
this.apipost("User_post_NoticeRemove",{noticeId:id},res=>{
if(res.data.resultCode == 1) {
this.$message.success(this.$t('tips.shanchuchenggong'))
this.getList();
}
},err=>{})
}).catch(() => {
this.$message({
type: 'info',
message: this.$t('tips.cancleDelete')
});
});
},
getList() { //公告列表
this.loading=true;
this.apipost('User_get_NoticeGetPageList', this.msg, res => {
if(res.data.resultCode == 1) {
this.loading=false;
this.DataList = res.data.data.pageData;
this.total = res.data.data.count;
}
}, err => {})
},
getEmployee() { //员工
this.apipost('admin_get_EmployeeGetList', this.employeeMsg, res => {
if(res.data.resultCode == 1) {
this.Employee = res.data.data;
}
}, err => {})
},
addNotice(_status){
this.addMsg.FileList=this.uploadList;
this.layerType=2;
this.addMsg.Status = _status;
this.apipost('User_post_NoticeSet', this.addMsg, res => {
if(res.data.resultCode == 1) {
this.$message.success(res.data.message)
this.outerVisible=false;
this.getList()
this.resetForm('addMsg');
} else {
this.$message.error(res.data.message)
}
}, err => {})
},
updateNotice(id){
this.addMsg.Id=id;
this.dialogTitle=this.$t('tips.adm_xgnotice');
this.outerVisible=true;
this.layerType=2;
this.apipost('User_get_NoticeGet',{noticeId:id},res=>{
if(res.data.resultCode == 1) {
this.addMsg.Title=res.data.data.Title
this.addMsg.Content=res.data.data.Content
this.uploadList=[]
if(res.data.data.File_url){
let _arr=JSON.parse(res.data.data.File_url);
if(_arr.length>0){
_arr.forEach(item=>{
this.uploadList.push({name:item.Name,url:item.Url})
})
}
}
}
},err=>{})
},
getDetails(id, tit){
this.outerVisible=true;
this.layerType=1;
this.dialogTitle=tit;
this.apipost('User_get_NoticeGet',{noticeId:id},res=>{
if(res.data.resultCode == 1) {
this.detailMessage=res.data.data
if(res.data.data.File_url){
this.downLoadList=JSON.parse(res.data.data.File_url)
this.downLoadList.forEach(item=>{
item.Url=this.domainManager().ViittoFileUrl+item.Url
})
}
}else{
this.$message.error(res.data.message)
}
},err=>{})
},
setTop(id){ //置顶
this.$confirm(this.$t('adm.adm_shifouroof'), this.$t('tips.tips'), {
confirmButtonText: this.$t('pub.sureBtn'),
cancelButtonText: this.$t('pub.cancelBtn'),
type: 'warning'
}).then(() => {
this.apipost('User_post_NoticeSetTop', {noticeId:id}, res => {
if(res.data.resultCode == 1) {
this.Employee = res.data.data;
this.getList();
} else {
this.$message.warning(res.data.message)
}
}, err => {})
}).catch(() => {
this.$message({
type: 'info',
message: this.$t('adm.adm_exitroof')
});
});
},
clearMessage(){
this.uploadList.length=0;
},
handleCurrentChange(val) {
this.msg.pageIndex = val;
this.getList();
},
resetPageIndex() {
this.msg.pageIndex = 1;
this.currentPage=1
},
submitForm(addMsg,_type) { //提交创建、修改表单
this.$refs[addMsg].validate((valid) => {
if(valid) {
this.addNotice(_type)
} else {
return false;
}
});
},
closeChangeMachie(done) { //弹出框关闭初始化弹框内表单
done();
this.resetForm('addMsg');
},
resetForm(formName) { //弹出框取消 初始化谈框内表单
if (formName) {
this.$refs[formName].resetFields();
}
this.addMsg.Id='-1'
}
}
}
}
},
filters: {
noticeFormat(status) {
if (status == "0")
return this.fabuStatus.t1
if (status == "1")
return this.fabuStatus.t2
if (status == "2")
return this.fabuStatus.t3
},
dateFormat(date) {
return date.replace('T', ' ')
}
},
mounted() {
let userInfo = this.getLocalStorage();
this.addMsg.RB_Group_Id = userInfo.RB_Group_id
this.getList();
this.getEmployee();
},
methods: {
UploadAttachment(file) { //上传
if (file.file.size > 1024 * 1024 * 100) {
this.$message.warning(this.$t('adm.adm_filenotmoreM'))
return
}
let newArr = [];
newArr.push(file.file)
let path = "/Upload/Temporary/"
this.$message.info(this.$t('tips.shangchuanzhong'))
this.UploadSelfFileT(path, newArr, x => {
let fileSize = file.file.size < 1024 ? file.file.size : (file.file.size / 1024).toFixed(0);
this.saveMsg = []
this.saveMsg.push({
Path: x.data.FilePath,
FileName: file.file.name,
MD5Sign: file.file.uid,
FileSize: fileSize,
FolderId: this.msg.ParentId
})
this.uploadList.push({
url: x.data.FilePath,
name: file.file.name
})
});
},
downloadSingle(obj) {
const link = document.createElement('a');
let _loadUrl = this.domainManager().UploadUrl;
link.href = obj.Url;
document.body.appendChild(link);
window.open(obj.Url)
},
downloadOne(obj) {
this.downloadFileRename(obj.url, obj.name);
},
deleteFile(obj) {
if (this.uploadList.findIndex(item => item.url === obj.url) != -1) {
this.uploadList.splice(this.uploadList.findIndex(item => item.url === obj.url), 1)
}
},
reCallNotice(id) {
this.$confirm(this.$t('adm.adm_sfchehui'), this.$t('tips.tips'), {
confirmButtonText: this.$t('pub.sureBtn'),
cancelButtonText: this.$t('pub.cancelBtn'),
type: 'warning'
}).then(() => {
this.apipost("User_post_NoticeSetRevocation", {
noticeId: id
}, res => {
if (res.data.resultCode == 1) {
this.$message.success(this.$t('adm.adm_chsuccess'))
this.getList();
}
}, err => {})
}).catch(() => {
this.$message({
type: 'info',
message: this.$t('adm.adm_chexit')
});
});
},
deleteNotice(id) {
this.$confirm(this.$t('tips.shifoushanchu'), this.$t('tips.tips'), {
confirmButtonText: this.$t('pub.sureBtn'),
cancelButtonText: this.$t('pub.cancelBtn'),
type: 'warning'
}).then(() => {
this.apipost("User_post_NoticeRemove", {
noticeId: id
}, res => {
if (res.data.resultCode == 1) {
this.$message.success(this.$t('tips.shanchuchenggong'))
this.getList();
}
}, err => {})
}).catch(() => {
this.$message({
type: 'info',
message: this.$t('tips.cancleDelete')
});
});
},
getList() { //公告列表
this.loading = true;
this.apipost('User_get_NoticeGetPageList', this.msg, res => {
if (res.data.resultCode == 1) {
this.loading = false;
this.DataList = res.data.data.pageData;
this.total = res.data.data.count;
}
}, err => {})
},
getEmployee() { //员工
this.apipost('admin_get_EmployeeGetList', this.employeeMsg, res => {
if (res.data.resultCode == 1) {
this.Employee = res.data.data;
}
}, err => {})
},
addNotice(_status) {
this.addMsg.FileList = this.uploadList;
this.layerType = 2;
this.addMsg.Status = _status;
this.apipost('User_post_NoticeSet', this.addMsg, res => {
if (res.data.resultCode == 1) {
this.$message.success(res.data.message)
this.outerVisible = false;
this.getList()
this.resetForm('addMsg');
} else {
this.$message.error(res.data.message)
}
}, err => {})
},
updateNotice(id) {
this.addMsg.Id = id;
this.dialogTitle = this.$t('tips.adm_xgnotice');
this.outerVisible = true;
this.layerType = 2;
this.apipost('User_get_NoticeGet', {
noticeId: id
}, res => {
if (res.data.resultCode == 1) {
this.addMsg.Title = res.data.data.Title
this.addMsg.Content = res.data.data.Content
this.uploadList = []
if (res.data.data.File_url) {
let _arr = JSON.parse(res.data.data.File_url);
if (_arr.length > 0) {
_arr.forEach(item => {
this.uploadList.push({
name: item.Name,
url: item.Url
})
})
}
}
}
}, err => {})
},
getDetails(id, tit) {
this.outerVisible = true;
this.layerType = 1;
this.dialogTitle = tit;
this.apipost('User_get_NoticeGet', {
noticeId: id
}, res => {
if (res.data.resultCode == 1) {
this.detailMessage = res.data.data
if (res.data.data.File_url) {
this.downLoadList = JSON.parse(res.data.data.File_url)
this.downLoadList.forEach(item => {
item.Url = this.domainManager().ViittoFileUrl + item.Url
})
}
} else {
this.$message.error(res.data.message)
}
}, err => {})
},
setTop(id) { //置顶
this.$confirm(this.$t('adm.adm_shifouroof'), this.$t('tips.tips'), {
confirmButtonText: this.$t('pub.sureBtn'),
cancelButtonText: this.$t('pub.cancelBtn'),
type: 'warning'
}).then(() => {
this.apipost('User_post_NoticeSetTop', {
noticeId: id
}, res => {
if (res.data.resultCode == 1) {
this.Employee = res.data.data;
this.getList();
} else {
this.$message.warning(res.data.message)
}
}, err => {})
}).catch(() => {
this.$message({
type: 'info',
message: this.$t('adm.adm_exitroof')
});
});
},
clearMessage() {
this.uploadList.length = 0;
},
handleCurrentChange(val) {
this.msg.pageIndex = val;
this.getList();
},
resetPageIndex() {
this.msg.pageIndex = 1;
this.currentPage = 1
},
submitForm(addMsg, _type) { //提交创建、修改表单
this.$refs[addMsg].validate((valid) => {
if (valid) {
this.addNotice(_type)
} else {
return false;
}
});
},
closeChangeMachie(done) { //弹出框关闭初始化弹框内表单
done();
this.resetForm('addMsg');
},
resetForm(formName) { //弹出框取消 初始化谈框内表单
if (formName) {
this.$refs[formName].resetFields();
}
this.addMsg.Id = '-1'
}
}
}
</script>
<style>
.ann_detail_title{line-height: 24px; font-size: 15px; font-weight: bold; text-align: center;}
.ann_textarea textarea{height:400px!important;}
.AnnfileList{padding: 5px 0;}
.AnnfileList li{height: 30px; line-height: 30px; padding: 0 10px;}
.AnnfileList li:hover{background: #f1f1f1;}
.AnnfileList li>i{float: right; margin-top:8px;}
.AnnfileList li:hover,.AnnFileListPMeta:hover{text-decoration: underline; color: #E95252; cursor: pointer;}
.AnnFileListPMeta{
color: blue
}
.AnnFileListPMeta .iconfon{
font-size: 12px;
}
</style>
\ No newline at end of file
.ann_detail_title {
line-height: 24px;
font-size: 15px;
font-weight: bold;
text-align: center;
}
.ann_textarea textarea {
height: 400px !important;
}
.AnnfileList {
padding: 5px 0;
}
.AnnfileList li {
height: 30px;
line-height: 30px;
padding: 0 10px;
}
.AnnfileList li:hover {
background: #f1f1f1;
}
.AnnfileList li>i {
float: right;
margin-top: 8px;
}
.AnnfileList li:hover,
.AnnFileListPMeta:hover {
text-decoration: underline;
color: #E95252;
cursor: pointer;
}
.AnnFileListPMeta {
color: blue
}
.AnnFileListPMeta .iconfon {
font-size: 12px;
}
</style>
......@@ -108,11 +108,9 @@
</el-radio-group>
</template>
<template v-if="item.SurveyType === 3">
<el-checkbox v-for="(radio, rIndex) in item.SurveyOptionsList" v-model="radio.IsCheckS" :label="radio.ID"
:key="rIndex">
{{radio.OptionsName}}</el-checkbox>
</template>
<template v-if="item.SurveyType === 4">
<el-input type="textarea" :rows="2" :placeholder="$t('fnc.qsrneirong')" v-model="item.TextContent">
......
......@@ -6441,22 +6441,7 @@ export default {
meta: {
title: '财务批量打印页面'
},
},
// {
// path: '/guestlogin', //意见调查表登录
// name: 'guestlogin',
// component: resolve => require(['@/components/guestlogin'], resolve),
// meta: {
// title: '意见调查表登录'
// },
// },
// {
// path: '/guestSign', //意见调查表填写
// name: 'guestSign',
// component: resolve => require(['@/components/guestSign'], resolve),
// meta: {
// title: '意见调查表填写'
// },
// },
}
]
}
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