Commit 10b37f59 authored by 罗超's avatar 罗超

no message

parent f778b911
......@@ -122,6 +122,20 @@ export default {
this.$router.push({
path: '/login'
})
// if(!window.location.href){
// this.$router.push({
// path: '/login'
// })
// }
// else{
// let href = window.location.href;
// if(href&&localStorage.crmuserInfo){
// this.$router.push({
// path: `/ChoiceAddFinancialDocuments?token=${data.token}&type=${data.type}&OtherType=${data.OtherType}&ReFinanceId=${data.ReFinanceId}&ReFinanceId2=${data.ReFinanceId2}&GuestId=${data.GuestId}`
// });
// }
// }
}else{
if(document.URL.indexOf("clientConfirm")!=-1||document.URL.indexOf("TravelContractConfirm")!=-1||document.URL.indexOf("ViittoContractConfirm")!=-1){
localStorage.openMode=0
......
......@@ -122,28 +122,78 @@
if(this.active==1){
// 手配费 收款单参数Handmsg
if(this.$route.query.Handmsg){
console.log('-----', '11111111')
this.$router.push({ name: "addReceivablesDocuments",query:{"Handmsg":this.Handmsg,"tradeWay":this.tradeWay,"platformAccount":this.platformAccount,"id":id,"Name":Name,"Type":Type,"orderObj":this.orderObj,'path':this.$route.query.path,'IsUploadPic':IsUploadPic,'Cmd':this.$route.query.Cmd,'companyID':this.$route.query.companyID,blank:'y',tab:'新增收款单'}})
}
// 财务收据
else if(this.$route.query.czmsg){
console.log('-----', '222222')
let Handmsg=this.$route.query.czmsg;
this.$router.push({ name: "addReceivablesDocuments",query:{"Handmsg":Handmsg,"tradeWay":this.tradeWay,"platformAccount":this.platformAccount,"id":id,"Name":Name,"Type":Type,"orderObj":this.orderObj,'path':this.$route.query.path,'IsUploadPic':IsUploadPic,'Cmd':this.$route.query.Cmd,'companyID':this.$route.query.companyID,blank:'y',tab:'新增收款单'}})
}
else{
this.$router.push({ name: "addReceivablesDocuments",query:{"tradeWay":this.tradeWay,"platformAccount":this.platformAccount,"id":id,"Name":Name,"Type":Type,"orderObj":this.orderObj,'path':this.$route.query.path,'IsUploadPic':IsUploadPic,'Cmd':this.$route.query.Cmd,'companyID':this.$route.query.companyID,blank:'y',tab:'新增收款单'}})
// 判断是否crm带参自动登录跳转
if(this.$route.query.orderObj&&this.$route.query.orderObj.GuestId){
let crmOrderObj = {
token: this.$route.query.orderObj.token,
type: this.$route.query.orderObj.type,
OtherType: this.$route.query.orderObj.OtherType,
ReFinanceId: this.$route.query.orderObj.ReFinanceId,
ReFinanceId2: this.$route.query.orderObj.ReFinanceId2,
GuestId: this.$route.query.orderObj.GuestId
}
console.log(JSON.stringify(crmOrderObj), '99988888')
this.$router.push({
name: "addReceivablesDocuments",
query:{
"tradeWay":this.tradeWay,
"platformAccount":this.platformAccount,
"id":id,
"Name":Name,
"Type":Type,
"crmOrderObj":JSON.stringify(crmOrderObj),
'path':this.$route.query.path,
'IsUploadPic':IsUploadPic,
'Cmd':this.$route.query.Cmd,
'companyID':this.$route.query.companyID,
blank:'y',
tab:'新增收款单'
}
})
}else{
console.log('-----', '30000000033333333')
this.$router.push({
name: "addReceivablesDocuments",
query:{
"tradeWay":this.tradeWay,
"platformAccount":this.platformAccount,
"id":id,
"Name":Name,
"Type":Type,
"orderObj":this.orderObj,
'path':this.$route.query.path,
'IsUploadPic':IsUploadPic,
'Cmd':this.$route.query.Cmd,
'companyID':this.$route.query.companyID,
blank:'y',
tab:'新增收款单'
}
})
}
}
}else if(this.active==2){
// 付款单参数czmsg
// 领队报账 预付款冲抵 返款制单
if(this.$route.query.czmsg){
console.log('-----', '')
this.$router.push({ name: path,query:{"czmsg":this.czmsg,"id":id,"Name":Name,"Type":Type,"orderObj":this.orderObj,'path':this.$route.query.path,'IsUploadPic':IsUploadPic,'Cmd':this.$route.query.Cmd,'companyID':this.$route.query.companyID,blank:'y',tab:'新增付款单'}})
}else{
console.log('22222222222-----', '')
this.$router.push({ name: path,query:{"id":id,"Name":Name,"Type":Type,"orderObj":this.orderObj,'path':this.$route.query.path,'IsUploadPic':IsUploadPic,'Cmd':this.$route.query.Cmd,'companyID':this.$route.query.companyID,blank:'y',tab:'新增付款单'}})
}
}else if(this.active==4){
this.$router.push({ name: path,query:{"id":id,"Name":Name,"Type":2,"orderObj":this.orderObj,'path':this.$route.query.path,'IsUploadPic':IsUploadPic,'Cmd':this.$route.query.Cmd,'companyID':this.$route.query.companyID,blank:'y',tab:'新增付款单'}})
......@@ -263,12 +313,23 @@
},
}
,mounted(){
let userInfo = this.getLocalStorage();
this.DepartID = userInfo.RB_Department_Id;
this.EmployeeId = userInfo.EmployeeId;
// 判断是否自动登陆跳转
if(this.$route.query.orderObj&&this.$route.query.orderObj.GuestId){
var data = JSON.parse(localStorage.crmuserInfo)
this.active = data.type
this.showTab = data.type
}else{
this.showTab = this.$route.query.Type?this.$route.query.Type:0;
this.active = parseInt(this.$route.query.Type)?parseInt(this.$route.query.Type):1;
}
if(this.getLocalStorage()){
let userInfo = this.getLocalStorage();
this.DepartID = userInfo.RB_Department_Id;
this.EmployeeId = userInfo.EmployeeId;
}
this.templateID = this.$route.query.templateID ? JSON.parse(this.$route.query.templateID) : null
this.OrderSource = this.$route.query.OrderSource ? this.$route.query.OrderSource : null
this.showTab = this.$route.query.Type?this.$route.query.Type:0;
// this.showTab = this.$route.query.Type?this.$route.query.Type:0;
this.tradeWay = this.$route.query.tradeWay?this.$route.query.tradeWay:0;
this.platformAccount = this.$route.query.platformAccount?this.$route.query.platformAccount:0;
this.searchVal = this.$route.query.searchTitle?this.$route.query.searchTitle:'';
......@@ -289,7 +350,7 @@
this.GetList = this.ZRList;
}
this.active = parseInt(this.$route.query.Type)?parseInt(this.$route.query.Type):1;
// this.active = parseInt(this.$route.query.Type)?parseInt(this.$route.query.Type):1;
this.orderObj = this.$route.query.orderObj;
this.Handmsg = this.$route.query.Handmsg?this.$route.query.Handmsg:this.Handmsg;
this.czmsg = this.$route.query.czmsg?this.$route.query.czmsg:this.czmsg;
......
......@@ -1815,7 +1815,14 @@
let that = this;
this.tradeWay = this.$route.query.tradeWay ? this.$route.query.tradeWay : 0;
this.platformAccount = this.$route.query.platformAccount ? this.$route.query.platformAccount : 0;
this.orderObj = this.$route.query.orderObj ? JSON.parse(this.$route.query.orderObj) : null;
// 判断是否crm带参自动登录跳转
if(this.$route.query.crmOrderObj){
this.orderObj = JSON.parse(this.$route.query.crmOrderObj);
console.log(this.orderObj, '')
}else{
this.orderObj = this.$route.query.orderObj ? JSON.parse(this.$route.query.orderObj) : null;
}
this.Handmsg = this.$route.query.Handmsg ? JSON.parse(this.$route.query.Handmsg) : null;
if (this.orderObj != null && this.orderObj.OrderSource === 8 && this.orderObj.tipObj == 1) {
......
<style>
@import "../assets/css/login2019.css";
.Autologin{
position: fixed;
left: 0;
top: 0;
right: 0;
bottom: 0;
/* transform: translate(-50%,-50%); */
background: url('../assets/img/login/load.gif')no-repeat center;
background-size: 350px auto;
}
</style>
<template>
<div>
<div class="Autologin">
<div class="gifContent">
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
loading: false,
msg:{},
userInfo: {
name: "",
password: "",
Domain: ""
},
orderObj:{}
}
},
components: {
},
mounted() {
},
created() {
let href = window.location.href;
if(href){
let param = href.split('?')[1].split("&") ;
if(param){
let obj={};
obj.token=param[0].split('=')[1];
obj.type=param[1].split('=')[1];
obj.OtherType=param[2].split('=')[1];
obj.ReFinanceId=param[3].split('=')[1];
obj.ReFinanceId2=param[4].split('=')[1];
obj.GuestId=param[5].split('=')[1];
localStorage.crmuserInfo = JSON.stringify(obj);
}
}
if(!this.getLocalStorage()){
this.autoLogin()
}else{
var data = JSON.parse(localStorage.crmuserInfo)
this.orderObj = {
token: data.token,
type: data.type,
OtherType: data.OtherType,
ReFinanceId: data.ReFinanceId,
ReFinanceId2: data.ReFinanceId2,
GuestId: data.GuestId
}
// ?token=${data.token}&type=${data.type}&OtherType=${data.OtherType}&ReFinanceId=${data.ReFinanceId}&ReFinanceId2=${data.ReFinanceId2}&GuestId=${data.GuestId}
this.$router.push({
path: `ChoiceAddFinancialDocuments`,
query:{
orderObj: this.orderObj
}
});
}
},
methods: {
autoLogin(){
this.apipostLogin(
"admin_get_GetErpAutoLoginInfo",
this.msg,
response => {
console.log(response.data, 'response.data')
var jsonData = response.data;
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 != '/' && x.MenuUrl!='') {
firstTire.push(x.MenuName)
} else {
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;
var data = JSON.parse(localStorage.crmuserInfo)
this.orderObj = {
token: data.token,
type: data.type,
OtherType: data.OtherType,
ReFinanceId: data.ReFinanceId,
ReFinanceId2: data.ReFinanceId2,
GuestId: data.GuestId
}
// ?token=${data.token}&type=${data.type}&OtherType=${data.OtherType}&ReFinanceId=${data.ReFinanceId}&ReFinanceId2=${data.ReFinanceId2}&GuestId=${data.GuestId}
this.$router.push({
path: `ChoiceAddFinancialDocuments`,
query:{
orderObj: this.orderObj
}
});
} else {
this.$notify.error({
title: "提示",
customClass: "msgTips",
message: response.data.message,
showClose: false,
duration: 3000
});
}
},
err => {}
);
}
},
}
</script>
......@@ -117,7 +117,7 @@ export default {
let mallUrl = ""; //商城API
let lxymallUrl = '';//国内游api
let locationName = window.location.hostname;
domainUrl="http://192.168.10.46";
domainUrl="http://192.168.10.2:8083";
let javaUrldo = "";
javaUrldo = locationName.indexOf('oytour') !== -1 || locationName.indexOf('viitto') !== -1 ? (locationName.indexOf('oytour') !== -1 ? "http://efficient.oytour.com" : "http://47.96.12.235:9001") : "http://192.168.2.215:9000";
//商城API
......@@ -330,9 +330,11 @@ export default {
})
.then(res => {
if (res.data.resultCode == 10000 || res.data.resultCode == 10001) {
this.$router.push({
path: '/login'
});
if (!localStorage.crmuserInfo){
this.$router.push({
path: '/login'
});
}
} else if (res.resultCode == 10005) {
this.$router.go(-1);
} else {
......@@ -340,7 +342,112 @@ export default {
}
}, faildCall)
},
// 自动登录HTTP提交数据
Vue.prototype.apipostLogin = function (cmd, msg, successCall, faildCall, isOnline) {
if (this.$route.name.indexOf('login') === -1 && this.$route.name.indexOf('clientConfirm') === -1 &&
this.$route.name.indexOf('confirmationsOrderDownLoad') === -1 && this.$route.name.indexOf('PrintPage') === -1 &&
this.$route.name.indexOf('TravelContractConfirm') === -1 && this.$route.name.indexOf('ViittoContractConfirm') === -1 &&
this.$route.name.indexOf('OrderProfitLossList') === -1
) {
let previousPathInfo = {
path: this.$route.name,
query: this.$route.query
}
localStorage.previousPathInfo = JSON.stringify(previousPathInfo);
}
if (msg == null || msg == "") {
msg = {}
}
var apiurl = this.domainManager().PostUrl;
//酒店接口
if (isOnline) {
apiurl = this.domainManager().HotelApi;
}
var timestamp = (new Date()).valueOf();
this.apiurl = apiurl;
var data = JSON.parse(localStorage.crmuserInfo)
if (this.$route.path.toLowerCase() == "/signature") {
this.$router.push({
path: '/signature'
})
} else if (this.$route.path == "/clientConfirm") {
let TCID = this.$route.query.TCID;
let orderID = this.$route.query.orderID;
this.$router.push({
name: "clientConfirm",
query: {
TCID: TCID,
orderID: orderID
}
})
} else if (this.$route.path == "/TravelContractConfirm") {
let ContractId = this.$route.query.ContractId;
this.$router.push({
name: "TravelContractConfirm",
query: {
ContractId: ContractId
}
})
} else if (this.$route.path == "/ViittoContractConfirm") {
let Id = this.$route.query.Id;
this.$router.push({
name: "ViittoContractConfirm",
query: {
Id: Id
}
})
} else {
if (!localStorage.userInfo && localStorage.userInfo != "" && this.$route.path.toLowerCase() != "/automaticLogin") {
this.$router.push({
path: `/automaticLogin?token=${data.token}&type=${data.type}&OtherType=${data.OtherType}&ReFinanceId=${data.ReFinanceId}&ReFinanceId2=${data.ReFinanceId2}&GuestId=${data.GuestId}`
})
}
}
var token = "";
var type = "";
if (localStorage.crmuserInfo) {
token = data.token;
type = data.type
}
var encodeMsg = encodeURIComponent(JSON.stringify(msg)).toLowerCase();
var md5Str = md5(`cmd=${cmd}&msg=${encodeMsg}&timestamp=${timestamp}&token=${token}&type=${type}`);
let tempLanguage = 0;
if (localStorage.language && localStorage.language != '') {
if (localStorage.language == "zh-TW") {
tempLanguage = 1;
} else if (localStorage.language == "Japanese") {
tempLanguage = 2;
}
}
var postData = {
"msg": {},
"cmd": cmd,
"timestamp": timestamp,
"token": token,
"sign": md5Str,
"languageId": tempLanguage
}
this.$http.post(apiurl, postData, {
headers: {
'Content-Type': 'application/json',
'Referer-Viitto': this.$route.path
}
})
.then(res => {
if (res.data.resultCode == 10000 || res.data.resultCode == 10001) {
this.$router.push({
path: `/automaticLogin?token=${data.token}&type=${data.type}&OtherType=${data.OtherType}&ReFinanceId=${data.ReFinanceId}&ReFinanceId2=${data.ReFinanceId2}&GuestId=${data.GuestId}`
})
} else if (res.resultCode == 10005) {
this.$router.go(-1);
} else {
successCall(res);
}
}, faildCall)
},
//HTTP提交数据
Vue.prototype.mallapipost = function (cmd, msg, successCall, faildCall, isOnline) {
var apiurl = this.domainManager().mallUrl + cmd;
......
......@@ -5,6 +5,7 @@ import clientConfirm from '../components/clientConfirm'
import SignName from '../components/SignName'
import supplierLogin from '../components/SupplierLogin'
import supplierIndex from '../components/SupplierIndex'
import automaticLogin from '../components/automaticLogin'
export default {
routes: [{
path: '/',
......@@ -16,6 +17,7 @@ export default {
name: 'login',
component: login
},
{
path: '/leaderPrint', //领队用款计划
name: 'leaderPrint',
......@@ -5447,5 +5449,10 @@ export default {
},
]
},
{ // crm财务单据自动登录
path: '/automaticLogin',
name: 'automaticLogin',
component: automaticLogin
},
]
}
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