Commit 1e6af53a authored by 黄奎's avatar 黄奎

页面修改

parent d00aad5b
...@@ -371,10 +371,10 @@ ...@@ -371,10 +371,10 @@
<div class="block date"> <div class="block date">
<label class="demonstration">日付</label> <label class="demonstration">日付</label>
<el-date-picker v-model="msg.sDate" type="date" :placeholder="$t('admin.admin_choDate')" <el-date-picker v-model="msg.sDate" type="date" :placeholder="$t('admin.admin_choDate')"
value-format="yyyy-MM-dd" :picker-options="pickerOptions1"> value-format="yyyy-MM-dd" ><!--:picker-options="pickerOptions1"-->
</el-date-picker> </el-date-picker>
<el-date-picker v-model="msg.eDate" type="date" :placeholder="$t('admin.admin_choDate')" <el-date-picker v-model="msg.eDate" type="date" :placeholder="$t('admin.admin_choDate')"
value-format="yyyy-MM-dd" :picker-options="pickerOptions2"> value-format="yyyy-MM-dd" ><!--:picker-options="pickerOptions2"-->
</el-date-picker> </el-date-picker>
</div> </div>
</li> </li>
......
...@@ -115,12 +115,12 @@ export default { ...@@ -115,12 +115,12 @@ export default {
Vue.prototype.domainManager = function () { Vue.prototype.domainManager = function () {
let domainUrl = ''; let domainUrl = '';
let mallUrl = ""; //商城API let mallUrl = ""; //商城API
let lxymallUrl = '';//国内游api let lxymallUrl = ''; //国内游api
let crmUrl = ""; //crm API let crmUrl = ""; //crm API
let locationName = window.location.hostname; let locationName = window.location.hostname;
domainUrl ="http://192.168.10.36:8083"; domainUrl = "http://192.168.10.46";
let crmLocalFileStreamDownLoadUrl = ""; let crmLocalFileStreamDownLoadUrl = "";
crmLocalFileStreamDownLoadUrl = locationName.indexOf('oytour') !== -1? "http://crm.oytour.com" : "http://testcrm.oytour.com"; crmLocalFileStreamDownLoadUrl = locationName.indexOf('oytour') !== -1 ? "http://crm.oytour.com" : "http://testcrm.oytour.com";
let javaUrldo = ""; 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"; 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 //商城API
...@@ -144,7 +144,7 @@ export default { ...@@ -144,7 +144,7 @@ export default {
DomainUrl: domainUrl, DomainUrl: domainUrl,
//常用提交数据URL //常用提交数据URL
PostUrl: domainUrl + "/api/common/post", PostUrl: domainUrl + "/api/common/post",
//上传文件URL //上传文件URL
UploadFileUrl: domainUrl + '/api/File/post', UploadFileUrl: domainUrl + '/api/File/post',
//本站模板文件下载地址 //本站模板文件下载地址
...@@ -170,7 +170,7 @@ export default { ...@@ -170,7 +170,7 @@ export default {
//Java接口本站文件流下载地址 //Java接口本站文件流下载地址
JavaLocalFileStreamDownLoadUrl: javaUrldo, JavaLocalFileStreamDownLoadUrl: javaUrldo,
mallUrl: mallUrl, mallUrl: mallUrl,
lxymallUrl:lxymallUrl, lxymallUrl: lxymallUrl,
crmUrl: crmUrl, crmUrl: crmUrl,
crmRoutingUrl: locationName.indexOf('oytour') !== -1 || locationName.indexOf('viitto') !== -1 ? "http://fcrmyx.oytour.com/#/" : "http://localhost:8081/#/", crmRoutingUrl: locationName.indexOf('oytour') !== -1 || locationName.indexOf('viitto') !== -1 ? "http://fcrmyx.oytour.com/#/" : "http://localhost:8081/#/",
}; };
...@@ -302,9 +302,7 @@ export default { ...@@ -302,9 +302,7 @@ export default {
}) })
} else { } else {
if (!localStorage.userInfo && localStorage.userInfo != "" && this.$route.path.toLowerCase() != "/login") { if (!localStorage.userInfo && localStorage.userInfo != "" && this.$route.path.toLowerCase() != "/login") {
this.$router.push({ this.goToLogin(1);
path: '/login'
})
} }
} }
var token = ""; var token = "";
...@@ -339,10 +337,8 @@ export default { ...@@ -339,10 +337,8 @@ export default {
}) })
.then(res => { .then(res => {
if (res.data.resultCode == 10000 || res.data.resultCode == 10001) { if (res.data.resultCode == 10000 || res.data.resultCode == 10001) {
if (this.getLocalStorage()){ if (this.getLocalStorage()) {
this.$router.push({ this.goToLogin(2);
path: '/login'
});
} }
} else if (res.resultCode == 10005) { } else if (res.resultCode == 10005) {
this.$router.go(-1); this.$router.go(-1);
...@@ -447,7 +443,7 @@ export default { ...@@ -447,7 +443,7 @@ export default {
} }
var token = ""; var token = "";
var type = ""; var type = "";
if (localStorage.crmuserInfo) { if (localStorage.crmuserInfo) {
token = data.token; token = data.token;
type = data.type type = data.type
} }
...@@ -460,7 +456,7 @@ export default { ...@@ -460,7 +456,7 @@ export default {
} else if (localStorage.language == "Japanese") { } else if (localStorage.language == "Japanese") {
tempLanguage = 2; tempLanguage = 2;
} }
} }
var postData = { var postData = {
"msg": {}, "msg": {},
"cmd": cmd, "cmd": cmd,
...@@ -470,11 +466,11 @@ export default { ...@@ -470,11 +466,11 @@ export default {
"languageId": tempLanguage "languageId": tempLanguage
} }
this.$http.post(apiurl, postData, { this.$http.post(apiurl, postData, {
headers: { headers: {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'Referer-Viitto': this.$route.path 'Referer-Viitto': this.$route.path
} }
}) })
.then(res => { .then(res => {
if (res.data.resultCode == 10000 || res.data.resultCode == 10001) { if (res.data.resultCode == 10000 || res.data.resultCode == 10001) {
this.$router.push({ this.$router.push({
...@@ -633,7 +629,6 @@ export default { ...@@ -633,7 +629,6 @@ export default {
//请求Java接口 //请求Java接口
Vue.prototype.apiJavaPost = function (cmd, msg, successCall, faildCall) { Vue.prototype.apiJavaPost = function (cmd, msg, successCall, faildCall) {
if (this.$route.name.indexOf('login') === -1 && this.$route.name.indexOf('confirmationOrderDownLoad') === -1 && this.$route.name.indexOf('PrintPage') === -1 && this.$route.name.indexOf('clientConfirm') === -1) { if (this.$route.name.indexOf('login') === -1 && this.$route.name.indexOf('confirmationOrderDownLoad') === -1 && this.$route.name.indexOf('PrintPage') === -1 && this.$route.name.indexOf('clientConfirm') === -1) {
let previousPathInfo = { let previousPathInfo = {
path: this.$route.name, path: this.$route.name,
query: this.$route.query query: this.$route.query
...@@ -676,9 +671,7 @@ export default { ...@@ -676,9 +671,7 @@ export default {
}) })
.then(res => { .then(res => {
if (res.resultCode == 10000 || res.resultCode == 10001) { if (res.resultCode == 10000 || res.resultCode == 10001) {
this.$router.push({ this.goToLogin(3);
path: '/login'
})
} else if (res.resultCode == 10005) { } else if (res.resultCode == 10005) {
this.$router.go(-1) this.$router.go(-1)
} else if (res.data.data && res.data.data.isJumpTwoCode == 1) { } else if (res.data.data && res.data.data.isJumpTwoCode == 1) {
...@@ -736,9 +729,7 @@ export default { ...@@ -736,9 +729,7 @@ export default {
}) })
.then(res => { .then(res => {
if (res.resultCode == 10000 || res.resultCode == 10001) { if (res.resultCode == 10000 || res.resultCode == 10001) {
this.$router.push({ this.goToLogin(4);
path: '/login'
})
} else if (res.resultCode == 10005) { } else if (res.resultCode == 10005) {
this.$router.go(-1) this.$router.go(-1)
} else if (res.data.data && res.data.data.isJumpTwoCode == 1) { } else if (res.data.data && res.data.data.isJumpTwoCode == 1) {
...@@ -756,9 +747,7 @@ export default { ...@@ -756,9 +747,7 @@ export default {
var apiurl = this.domainManager().LocalFileStreamDownLoadUrl; var apiurl = this.domainManager().LocalFileStreamDownLoadUrl;
var timestamp = (new Date()).valueOf(); var timestamp = (new Date()).valueOf();
if (!localStorage.userInfo && localStorage.userInfo != "" && this.$route.path.toLowerCase() != "/login") { if (!localStorage.userInfo && localStorage.userInfo != "" && this.$route.path.toLowerCase() != "/login") {
this.$router.push({ this.goToLogin(5);
path: '/login'
})
} }
var token = ""; var token = "";
var key = ""; var key = "";
...@@ -791,57 +780,55 @@ export default { ...@@ -791,57 +780,55 @@ export default {
}).catch(function (res) {}); }).catch(function (res) {});
}, },
//crm下载文件 //crm下载文件
Vue.prototype.crmGetLocalFile = function(cmd, msg, fileName, callBack) { Vue.prototype.crmGetLocalFile = function (cmd, msg, fileName, callBack) {
if (msg == null || msg == "") { if (msg == null || msg == "") {
msg = {} msg = {}
} }
var apiurl = this.domainManager().crmUrl + cmd; var apiurl = this.domainManager().crmUrl + cmd;
var token = ""; var token = "";
var key = ""; var key = "";
if (this.getLocalStorage() != null) { if (this.getLocalStorage() != null) {
token = this.getLocalStorage().token; token = this.getLocalStorage().token;
key = this.getLocalStorage().SecretKey; key = this.getLocalStorage().SecretKey;
} }
var encodeMsg = encodeURIComponent(JSON.stringify(msg)).toLowerCase(); var encodeMsg = encodeURIComponent(JSON.stringify(msg)).toLowerCase();
var md5Str = md5(`msg=${encodeMsg}&token=${token}&key=${key}`); var md5Str = md5(`msg=${encodeMsg}&token=${token}&key=${key}`);
var postData = { var postData = {
"msg": msg, "msg": msg,
"token": token, "token": token,
"sign": md5Str "sign": md5Str
} }
this.$http.post(apiurl, postData, { this.$http.post(apiurl, postData, {
headers: { headers: {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'Referer-Viitto': this.$route.path, 'Referer-Viitto': this.$route.path,
}, },
responseType: 'blob' responseType: 'blob'
}).then((res) => { }).then((res) => {
let blob = new Blob([res.data], { let blob = new Blob([res.data], {
type: "application/vnd.ms-excel" type: "application/vnd.ms-excel"
}) })
let url = URL.createObjectURL(blob); let url = URL.createObjectURL(blob);
let link = document.createElement('a'); let link = document.createElement('a');
link.href = url; link.href = url;
link.setAttribute("download", fileName); link.setAttribute("download", fileName);
document.body.appendChild(link); document.body.appendChild(link);
link.click(); link.click();
if (callBack) { if (callBack) {
var result = { var result = {
Code: 1 Code: 1
}; };
callBack(result); callBack(result);
} }
}).catch(function(res) { }).catch(function (res) {
}); });
} }
Vue.prototype.JavaGetLocalFile = function (cmd, msg, fileName, successCall) { Vue.prototype.JavaGetLocalFile = function (cmd, msg, fileName, successCall) {
var apiurl = this.domainManager().JavaLocalFileStreamDownLoadUrl + cmd; var apiurl = this.domainManager().JavaLocalFileStreamDownLoadUrl + cmd;
var timestamp = (new Date()).valueOf(); var timestamp = (new Date()).valueOf();
if (!localStorage.userInfo && localStorage.userInfo != "" && this.$route.path.toLowerCase() != "/login") { if (!localStorage.userInfo && localStorage.userInfo != "" && this.$route.path.toLowerCase() != "/login") {
this.$router.push({ this.goToLogin(6);
path: '/login'
})
} }
var token = ""; var token = "";
var key = ""; var key = "";
...@@ -877,6 +864,12 @@ export default { ...@@ -877,6 +864,12 @@ export default {
successCall(res); successCall(res);
}).catch(function (res) {}); }).catch(function (res) {});
}, },
//跳转到登录页面
Vue.prototype.goToLogin = function (type) {
this.$router.push({
path: '/login'
})
},
//ERP本地缓存 //ERP本地缓存
Vue.prototype.getLocalStorage = function () { Vue.prototype.getLocalStorage = function () {
var localStorageData = window.localStorage["userInfo"]; var localStorageData = window.localStorage["userInfo"];
...@@ -1100,8 +1093,8 @@ export default { ...@@ -1100,8 +1093,8 @@ export default {
} else if (type === 'h') { } else if (type === 'h') {
poise = 'm_h' poise = 'm_h'
} }
var newpath= path.replace('http://192.168.10.214:8130', '').replace('https://imgfile.oytour.com', '').replace('https://imgfile.oytour.com', '').split('?')[0]; var newpath = path.replace('http://192.168.10.214:8130', '').replace('https://imgfile.oytour.com', '').replace('https://imgfile.oytour.com', '').split('?')[0];
return url + '/image/index?filePath=' +newpath + '&process=resize,' + poise + ',w_' + w + ',h_' + h; return url + '/image/index?filePath=' + newpath + '&process=resize,' + poise + ',w_' + w + ',h_' + h;
} }
Vue.prototype.uploadSelfBlob = function (path, files, successCall) { Vue.prototype.uploadSelfBlob = function (path, files, successCall) {
let that = this; let that = this;
...@@ -1500,32 +1493,32 @@ export default { ...@@ -1500,32 +1493,32 @@ export default {
} }
return css; return css;
}, },
//HTTP提交数据 5-18新的 司导旅行新加的 //HTTP提交数据 5-18新的 司导旅行新加的
Vue.prototype.lxymallapipost = function (cmd, msg, successCall, faildCall, isOnline) { Vue.prototype.lxymallapipost = function (cmd, msg, successCall, faildCall, isOnline) {
var apiurl = this.domainManager().lxymallUrl + cmd; var apiurl = this.domainManager().lxymallUrl + cmd;
var postData = this.GetNewPostData(cmd, msg, ""); var postData = this.GetNewPostData(cmd, msg, "");
this.$http.post(apiurl, postData, { this.$http.post(apiurl, postData, {
headers: { headers: {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'Referer-Viitto': this.$route.path 'Referer-Viitto': this.$route.path
} }
}) })
.then(res => { .then(res => {
if (res.data.resultCode == 10000 || res.data.resultCode == 10001) {} else if (res.resultCode == 10005) { if (res.data.resultCode == 10000 || res.data.resultCode == 10001) {} else if (res.resultCode == 10005) {
this.$router.go(-1); this.$router.go(-1);
} else { } else {
successCall(res); successCall(res);
} }
}, faildCall) }, faildCall)
}, },
//公用跳转 //公用跳转
Vue.prototype.CommonJump = function (path, obj) { Vue.prototype.CommonJump = function (path, obj) {
this.$router.push({ this.$router.push({
name: path, name: path,
query: obj query: obj
}); });
} }
//获取请求参数 //获取请求参数
Vue.prototype.GetNewPostData = function (cmd, msg, newCmd) { Vue.prototype.GetNewPostData = function (cmd, msg, newCmd) {
if (msg == null || msg == "") { if (msg == null || msg == "") {
...@@ -1567,5 +1560,5 @@ export default { ...@@ -1567,5 +1560,5 @@ export default {
} }
return postData return postData
} }
} }
} }
\ No newline at end of file
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