Commit 173b5cf4 authored by 吴春's avatar 吴春

没有提交的

parents 702bd428 3e05a730
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<template> <template>
<div class="travelControlTrip detail-box"> <div class="travelControlTrip detail-box">
<div class="trip_cover" v-show="pdfLoading" v-loading="pdfLoading"></div> <div class="trip_cover" v-show="pdfLoading" v-loading="pdfLoading"></div>
<input type="button" class="travelControlTripBtn" value="下载PDF" @click="toPDF(orderMsg.startDate + orderMsg.lineteamName+orderMsg.dayNum+'日游')" /> <input type="button" style="width: auto !important;" class="travelControlTripBtn" value="下载电脑版PDF" @click="toPDF(orderMsg.startDate + orderMsg.lineteamName+orderMsg.dayNum+'日游')" />
<input type="button" style="width: auto !important;" class="travelControlTripBtn" value="下载手机版WORD" @click="gernalFeature()" /> <input type="button" style="width: auto !important;" class="travelControlTripBtn" value="下载手机版WORD" @click="gernalFeature()" />
<!-- ToWord(orderMsg.startDate + orderMsg.lineteamName+orderMsg.dayNum+'日游') --> <!-- ToWord(orderMsg.startDate + orderMsg.lineteamName+orderMsg.dayNum+'日游') -->
<!--&&isopOperation HK 注释 可以让销售修改基本信息--> <!--&&isopOperation HK 注释 可以让销售修改基本信息-->
......
...@@ -11,7 +11,7 @@ export default { ...@@ -11,7 +11,7 @@ export default {
install(Vue, options) { install(Vue, options) {
Vue.prototype.MsgBus = MsgBus; Vue.prototype.MsgBus = MsgBus;
Vue.prototype.md5 = md5; Vue.prototype.md5 = md5;
Vue.prototype.orderBy = function(source, orders, type) { Vue.prototype.orderBy=function(source, orders, type) {
if ( if (
source instanceof Array && source instanceof Array &&
orders instanceof Array && orders instanceof Array &&
...@@ -77,27 +77,27 @@ export default { ...@@ -77,27 +77,27 @@ export default {
return source; return source;
} }
}, },
Vue.prototype.calcPageSize = function(itemHeight) { Vue.prototype.calcPageSize=function(itemHeight){
let yuHeight = itemHeight let yuHeight=itemHeight
try { try {
let obj = null let obj=null
document.querySelectorAll('.frame-box').forEach(x => { document.querySelectorAll('.frame-box').forEach(x=>{
if (x.style.display != 'none') { if(x.style.display!='none'){
obj = x obj=x
} }
}) })
let dom = obj.offsetHeight let dom=obj.offsetHeight
yuHeight = dom - (obj.querySelector('.v-table-header') ? obj.querySelector('.v-table-header').offsetHeight : 39) - 50 //减去面包屑,减去表格头部,减去分页,减去偏量 yuHeight=dom-(obj.querySelector('.v-table-header')?obj.querySelector('.v-table-header').offsetHeight:39)-50//减去面包屑,减去表格头部,减去分页,减去偏量
//减去其它同级元素 //减去其它同级元素
obj.childNodes[0].childNodes.forEach(x => { obj.childNodes[0].childNodes.forEach(x=>{
if (x.className && x.className.indexOf('v-table-views') == -1) { if(x.className && x.className.indexOf('v-table-views')==-1){
yuHeight -= x.offsetHeight ? x.offsetHeight : 0 yuHeight-=x.offsetHeight?x.offsetHeight:0
} }
}) })
} catch (error) { console.log(error) } } catch (error) {console.log(error)}
return Math.floor(yuHeight / itemHeight) return Math.floor(yuHeight/itemHeight)
} }
Vue.prototype.random_string = function(len) { Vue.prototype.random_string = function (len) {
len = len || 32; len = len || 32;
var chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678'; var chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678';
var maxPos = chars.length; var maxPos = chars.length;
...@@ -108,24 +108,24 @@ export default { ...@@ -108,24 +108,24 @@ export default {
return pwd; return pwd;
}, },
//是否是线上环境【发布时修改为true】 //是否是线上环境【发布时修改为true】
Vue.prototype.isOnline = function() { Vue.prototype.isOnline = function () {
return process.env.NODE_ENV !== 'development'; return process.env.NODE_ENV !== 'development';
}, },
//域名管理对象 //域名管理对象
Vue.prototype.domainManager = function() { Vue.prototype.domainManager = function () {
let domainUrl = ''; let domainUrl = '';
let locationName = window.location.hostname; let locationName = window.location.hostname;
//domainUrl = "http://127.0.0.1"; //214主域名 domainUrl = "http://127.0.0.1"; //214主域名
// 127.0.0.12 // 127.0.0.12
// domainUrl = "http://192.168.2.88"; //王悦主域名 // domainUrl = "http://192.168.2.88"; //王悦主域名
// domainUrl = "http://127.0.0.1"; //214主域名 // domainUrl = "http://127.0.0.1"; //214主域名
// domainUrl = "http://192.168.2.16:8083"; //王悦主域名 // domainUrl = "http://192.168.2.16:8083"; //王悦主域名
// domainUrl = "http://127.0.0.1"; //214主域名 // domainUrl = "http://127.0.0.1"; //214主域名
domainUrl = "http://192.168.2.65:8025"; //吴春主域名 // domainUrl = "http://192.168.2.65:8025"; //吴春主域名
// domainUrl = "http://192.168.2.106:8082"; //罗超主域名 // domainUrl = "http://192.168.2.106:8082"; //罗超主域名
if (locationName.indexOf('oytour') !== -1) { if (locationName.indexOf('oytour')!==-1) {
domainUrl = "https://reborn.oytour.com"; domainUrl = "https://reborn.oytour.com";
} else if (locationName.indexOf('viitto') !== -1) { }else if (locationName.indexOf('viitto')!==-1) {
domainUrl = "https://test.viitto.com"; domainUrl = "https://test.viitto.com";
} }
var obj = { var obj = {
...@@ -149,18 +149,20 @@ export default { ...@@ -149,18 +149,20 @@ export default {
GoogleMapUrl: "http://ditu.google.cn/maps/api/js?key=AIzaSyAZ5MIfzicStzKbIkbI3RcBBeZBjQFKsp0&sensor=false&language=zh-CN", GoogleMapUrl: "http://ditu.google.cn/maps/api/js?key=AIzaSyAZ5MIfzicStzKbIkbI3RcBBeZBjQFKsp0&sensor=false&language=zh-CN",
//google地图图片地址 //google地图图片地址
GoogleMapImageUrl: "http://super.oytour.com", GoogleMapImageUrl: "http://super.oytour.com",
UploadUrl: "http://upload.oytour.com" // "http://upload.oytour.com"
UploadUrl: locationName.indexOf('oytour')!==-1 ? "http://upload.oytour.com" : "http://127.0.0.1:8120"
// UploadUrl: "http://upload.oytour.com"
}; };
return obj; return obj;
}, },
Vue.prototype.yinyanFn = function(url, successCall, faildCall) { Vue.prototype.yinyanFn = function (url, successCall, faildCall) {
this.$http.jsonp(url, ) this.$http.jsonp(url, )
.then(res => { .then(res => {
successCall(res) successCall(res)
}, faildCall) }, faildCall)
}, },
//消息成功提示 //消息成功提示
Vue.prototype.Success = function(msg) { Vue.prototype.Success = function (msg) {
this.$message({ this.$message({
message: msg, message: msg,
duration: 2000, duration: 2000,
...@@ -168,7 +170,7 @@ export default { ...@@ -168,7 +170,7 @@ export default {
}); });
}, },
//错误提示 //错误提示
Vue.prototype.Error = function(msg) { Vue.prototype.Error = function (msg) {
this.$message({ this.$message({
message: msg, message: msg,
duration: 2000, duration: 2000,
...@@ -177,7 +179,7 @@ export default { ...@@ -177,7 +179,7 @@ export default {
}, },
//一般提示 //一般提示
Vue.prototype.Info = function(msg) { Vue.prototype.Info = function (msg) {
this.$message({ this.$message({
message: msg, message: msg,
duration: 2000, duration: 2000,
...@@ -185,7 +187,7 @@ export default { ...@@ -185,7 +187,7 @@ export default {
}); });
}, },
//警告提示 //警告提示
Vue.prototype.Warning = function(msg) { Vue.prototype.Warning = function (msg) {
this.$message({ this.$message({
message: msg, message: msg,
duration: 2000, duration: 2000,
...@@ -193,7 +195,7 @@ export default { ...@@ -193,7 +195,7 @@ export default {
}); });
}, },
//Confirm //Confirm
Vue.prototype.Confirm = function(msg, callback) { Vue.prototype.Confirm = function (msg, callback) {
this.$confirm(msg, "提示", { this.$confirm(msg, "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
...@@ -210,22 +212,22 @@ export default { ...@@ -210,22 +212,22 @@ export default {
}, },
//打开新窗口连接 //打开新窗口连接
Vue.prototype.OpenNewUrl = function(URL) { Vue.prototype.OpenNewUrl = function (URL) {
if (URL != '') { if (URL != '') {
window.open('http://' + URL, '_blank'); window.open('http://' + URL, '_blank');
} }
} }
Vue.prototype.uploadImg = function(tcID, msg, successCall, faildCall) { Vue.prototype.uploadImg = function (tcID, msg, successCall, faildCall) {
var apiurl = this.domainManager().Upload + '/Upload/UploadBase64?fileType=1&fileLimit=5&&filePath=Freature/TCID' + tcID; var apiurl = this.domainManager().Upload + '/Upload/UploadBase64?fileType=1&fileLimit=5&&filePath=Freature/TCID' + tcID;
this.$http.post(apiurl, msg, { this.$http.post(apiurl, msg, {
datatype: "jsonP", datatype:"jsonP",
}).then(res => { }).then(res => {
successCall(res); successCall(res);
}, faildCall) }, faildCall)
} }
//HTTP提交数据 //HTTP提交数据
Vue.prototype.apipost = function(cmd, msg, successCall, faildCall) { Vue.prototype.apipost = function (cmd, msg, successCall, faildCall) {
if (msg == null || msg == "") { if (msg == null || msg == "") {
msg = {} msg = {}
} }
...@@ -278,7 +280,7 @@ export default { ...@@ -278,7 +280,7 @@ export default {
}, },
//下载文件 //下载文件
Vue.prototype.GetLocalFile = function(cmd, msg, fileName, successCall) { Vue.prototype.GetLocalFile = function (cmd, msg, fileName, successCall) {
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") {
...@@ -314,20 +316,20 @@ export default { ...@@ -314,20 +316,20 @@ export default {
document.body.appendChild(link); document.body.appendChild(link);
link.click(); link.click();
successCall(res); successCall(res);
}).catch(function(res) {}); }).catch(function (res) {});
}, },
Vue.prototype.getCookieItem = function() { Vue.prototype.getCookieItem = function () {
return JSON.parse(this.getCookie("userInfo")) return JSON.parse(this.getCookie("userInfo"))
}, },
Vue.prototype.getLocalStorage = function() { Vue.prototype.getLocalStorage = function () {
var localStorageData = window.localStorage["userInfo"]; var localStorageData = window.localStorage["userInfo"];
if (localStorageData !== undefined && localStorageData != 'undefined') { if (localStorageData !== undefined && localStorageData!='undefined') {
return JSON.parse(localStorageData); return JSON.parse(localStorageData);
} else { } else {
return null; return null;
} }
}, },
Vue.prototype.getCookie = function(cookieName) { Vue.prototype.getCookie = function (cookieName) {
var strCookie = document.cookie; var strCookie = document.cookie;
var arrCookie = strCookie.split("; "); var arrCookie = strCookie.split("; ");
for (var i = 0; i < arrCookie.length; i++) { for (var i = 0; i < arrCookie.length; i++) {
...@@ -338,19 +340,19 @@ export default { ...@@ -338,19 +340,19 @@ export default {
} }
return ""; return "";
}, },
Vue.prototype.getLoginUser = function() { Vue.prototype.getLoginUser = function () {
return this.loginUser return this.loginUser
}, },
Vue.prototype.setLoginUser = function(user) { Vue.prototype.setLoginUser = function (user) {
this.loginUser = user this.loginUser = user
} }
//PDF预览 //PDF预览
Vue.prototype.previewPDF = function(url) { Vue.prototype.previewPDF = function (url) {
window.open(this.domainManager().PDFViewUrl + url); window.open(this.domainManager().PDFViewUrl + url);
}, },
Vue.prototype.downloadFile = function(objectKey) { Vue.prototype.downloadFile = function (objectKey) {
var co = require('co'); var co = require('co');
var OSS = require('ali-oss'); var OSS = require('ali-oss');
var oss = new OSS({ var oss = new OSS({
...@@ -366,7 +368,7 @@ export default { ...@@ -366,7 +368,7 @@ export default {
link.click(); link.click();
}, },
Vue.prototype.downloadFileRename = function(objectKey, filename, fileurl) { Vue.prototype.downloadFileRename = function (objectKey, filename, fileurl) {
var co = require('co'); var co = require('co');
var OSS = require('ali-oss'); var OSS = require('ali-oss');
...@@ -378,7 +380,7 @@ export default { ...@@ -378,7 +380,7 @@ export default {
}) })
let url = ''; let url = '';
if (fileurl) if(fileurl)
url = fileurl url = fileurl
else else
url = oss.signatureUrl(objectKey); url = oss.signatureUrl(objectKey);
...@@ -410,7 +412,7 @@ export default { ...@@ -410,7 +412,7 @@ export default {
}); });
}, },
Vue.prototype.getFileBlob = function(objectKey, filename) { Vue.prototype.getFileBlob = function (objectKey, filename) {
var co = require('co'); var co = require('co');
var OSS = require('ali-oss'); var OSS = require('ali-oss');
var oss = new OSS({ var oss = new OSS({
...@@ -437,7 +439,7 @@ export default { ...@@ -437,7 +439,7 @@ export default {
//path 请按照"/模块名称/用户ID/自定义文件夹/" /谁搞错一次5块红包 //path 请按照"/模块名称/用户ID/自定义文件夹/" /谁搞错一次5块红包
//files 文件数组 //files 文件数组
//p 进度回调函数 //p 进度回调函数
Vue.prototype.uploadFile = function(path, files, successCall) { Vue.prototype.uploadFile = function (path, files, successCall) {
if (files && files.length > 0) { if (files && files.length > 0) {
let nameList = new Array() let nameList = new Array()
for (let index = 0; index < files.length; index++) { for (let index = 0; index < files.length; index++) {
...@@ -450,24 +452,24 @@ export default { ...@@ -450,24 +452,24 @@ export default {
bucket: 'reborndev' bucket: 'reborndev'
}) })
let that = this let that = this
co(function*() { co(function* () {
for (let index = 0; index < files.length; index++) { for (let index = 0; index < files.length; index++) {
let fileName = nameList[index] let fileName = nameList[index]
fileName = path + fileName + "." + files[index].name.split('.').pop() fileName = path + fileName + "." + files[index].name.split('.').pop()
var result = yield oss.multipartUpload(fileName, files[index], { var result = yield oss.multipartUpload(fileName, files[index], {
progress: function*(p) {}, progress: function* (p) {},
mime: 'application/octet-stream' mime: 'application/octet-stream'
}) })
successCall(result); successCall(result);
} }
}).catch(function(err) { }).catch(function (err) {
console.log(err); console.log(err);
}); });
} }
}, },
Vue.prototype.uploadBlob = function(path, files, successCall) { Vue.prototype.uploadBlob = function (path, files, successCall) {
if (files && files.length > 0) { if (files && files.length > 0) {
var oss = new OSS({ var oss = new OSS({
region: 'oss-cn-hangzhou', region: 'oss-cn-hangzhou',
...@@ -476,22 +478,22 @@ export default { ...@@ -476,22 +478,22 @@ export default {
bucket: 'reborndev' bucket: 'reborndev'
}) })
let that = this let that = this
co(function*() { co(function* () {
for (let index = 0; index < files.length; index++) { for (let index = 0; index < files.length; index++) {
var result = yield oss.multipartUpload(path, files[index], { var result = yield oss.multipartUpload(path, files[index], {
progress: function*(p) {}, progress: function* (p) {},
mime: 'application/octet-stream' mime: 'application/octet-stream'
}) })
successCall(result); successCall(result);
} }
}).catch(function(err) { }).catch(function (err) {
console.log(err); console.log(err);
}); });
} }
}, },
//验证只能输入2位小数【负数:isMinus传true】 //验证只能输入2位小数【负数:isMinus传true】
Vue.prototype.checkPrice = function(item, filed, isMinus) { Vue.prototype.checkPrice = function (item, filed, isMinus) {
var value = "" + item[filed]; //转字符串 var value = "" + item[filed]; //转字符串
var t = value.charAt(0); var t = value.charAt(0);
value = value.replace(/[^\d.]/g, ""); //清除“数字”和“.”以外的字符 value = value.replace(/[^\d.]/g, ""); //清除“数字”和“.”以外的字符
...@@ -509,7 +511,7 @@ export default { ...@@ -509,7 +511,7 @@ export default {
item[filed] = value; item[filed] = value;
} }
//验证输入6位小数汇率 //验证输入6位小数汇率
Vue.prototype.checkRate = function(item, filed) { Vue.prototype.checkRate = function (item, filed) {
var value = "" + item[filed]; //转字符串 var value = "" + item[filed]; //转字符串
var p1 = /[^\d\.]/g; // 过滤非数字及小数点 /g :所有范围中过滤 var p1 = /[^\d\.]/g; // 过滤非数字及小数点 /g :所有范围中过滤
var p2 = /(\.\d{6})\d*$/g; var p2 = /(\.\d{6})\d*$/g;
...@@ -524,7 +526,7 @@ export default { ...@@ -524,7 +526,7 @@ export default {
} }
//验证只能输入整数【负数:isMinus传true】 //验证只能输入整数【负数:isMinus传true】
Vue.prototype.checkInteger = function(item, filed, isMinus) { Vue.prototype.checkInteger = function (item, filed, isMinus) {
var value = "" + item[filed]; //转字符串 var value = "" + item[filed]; //转字符串
var t = value.charAt(0); var t = value.charAt(0);
value = value.replace(this.$commonUtils.Regex.isInteger, ""); value = value.replace(this.$commonUtils.Regex.isInteger, "");
...@@ -536,7 +538,7 @@ export default { ...@@ -536,7 +538,7 @@ export default {
} }
//价钱格式化,三位数逗号分隔,保留两位小数 duanjun //价钱格式化,三位数逗号分隔,保留两位小数 duanjun
Vue.prototype.moneyFormat = function(value) { Vue.prototype.moneyFormat = function (value) {
let nStr = Number(value).toFixed(2) let nStr = Number(value).toFixed(2)
nStr += ''; nStr += '';
let x = nStr.split('.'); let x = nStr.split('.');
...@@ -549,7 +551,7 @@ export default { ...@@ -549,7 +551,7 @@ export default {
return x1 + x2; return x1 + x2;
}, },
Vue.prototype.loadFileICON = function(suffix) { Vue.prototype.loadFileICON = function (suffix) {
let icons = [{ let icons = [{
"name": "\u7f51\u76d8BT\u79bb\u7ebf\u4e0b\u8f7d", "name": "\u7f51\u76d8BT\u79bb\u7ebf\u4e0b\u8f7d",
......
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