Commit 434a798a authored by 沈良进's avatar 沈良进
parents 9cd9ad43 4588089a
......@@ -2,30 +2,24 @@
</style>
<template>
<div>
<div>
<div style="border: none; display: flex; margin-bottom: 20px">
<ul style="overflow: initial!important;display: flex; width: 100%">
<li style="display: flex">
<span style="width: 60px; line-height: 34px">
<em>{{$t('salesModule.keyWords')}}</em>
</span>
<el-input v-model="qMsg.CustomerName" :placeholder="$t('salesModule.InputPhone')"></el-input>
<el-input v-model="qMsg.CustomerName" :placeholder="$t('salesModule.InputPhone')"
@keyup.native="reSearchPage()"></el-input>
</li>
<li>
<input
type="button"
class="hollowFixedBtn"
:value="$t('pub.searchBtn')"
@click="resetPageIndex(),getCustomerList()"
>
<input type="button" class="hollowFixedBtn" :value="$t('pub.searchBtn')" @click="reSearchPage()">
</li>
<li>
<el-button style="margin-left:10px;" size="small " type="primary" @click="sureData" round>确认选择</el-button>
</li>
</ul>
</div>
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>选择同行</span>
<el-button style="float: right; padding: 3px 0" type="text" @click="sureData">确认选择</el-button>
</div>
<div class="chooseCustomerInfo">
<el-table :data="dataList" style="width:100%" border v-loading='loading'
@selection-change="handleSelectionChange">
......@@ -56,7 +50,7 @@
layout="total,prev, pager, next, jumper" :page-size="qMsg.pageSize" :total="qMsg.total">
</el-pagination>
</div>
</el-card></div>
</div>
</template>
<script>
export default {
......@@ -95,7 +89,10 @@
this.qMsg.pageIndex = val;
this.getCustomerList();
},
resetPageIndex() {this.qMsg.pageIndex = 1;},
reSearchPage() {
this.qMsg.pageIndex = 1;
this.getCustomerList();
},
// 获取合作伙伴列表
getCustomerList() {
this.loading = true;
......@@ -116,7 +113,6 @@
}
);
},
},
};
......
......@@ -200,7 +200,7 @@
<el-row>
<el-col :span="24">
<el-form-item label="业务名称" prop="GTeamName">
<el-input v-model="editForm.GTeamName"></el-input>
<el-input v-model="editForm.GTeamName" maxlength="300"></el-input>
</el-form-item>
</el-col>
</el-row>
......@@ -213,7 +213,7 @@
<el-col :span="12">
<!--添加修改航班-->
<ul class="_add_hangban clearfix">
<li :class="addMsg.TicketType == 1 ? '_allWidth' : ''">
<li>
<span class="_add_go_label">{{ $t("Airticket.Air_go") }}</span>
<div class="_add_go" v-for="(item, index) in addMsg.flightList" :key="index">
<template v-if="item.TicketType == 1">
......@@ -249,7 +249,7 @@
<p>
<span>{{ $t("pub.addBtn") }}</span>
<span class="_add_btn" @click="addFlight()">{{
$t("pub.sureBtn")
$t("pub.saveBtn")
}}</span>
</p>
<span class="_add_hbh">
......@@ -321,7 +321,7 @@
<p>
<span>{{ $t("pub.addBtn") }}</span>
<span class="_add_btn" @click="addFlightReturn()">{{
$t("pub.sureBtn")
$t("pub.saveBtn")
}}</span>
</p>
<span class="_add_hbh">
......@@ -442,7 +442,8 @@
<el-col :span="24">
<el-form-item label="合作伙伴">
<template v-for="(subItem,subIndex) in friendList">
<el-tag :key="subIndex+10000" style="margin-right:10px;" closable @close="deleteCustomer(subIndex)">
<el-tag :key="subIndex+10000" style="margin-right:10px;" closable
@close="deleteCustomer(subItem,subIndex)">
{{subItem.CustomerName}}</el-tag>
</template>
<el-button @click="showCustomer">选择</el-button>
......@@ -476,11 +477,18 @@
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-col :span="8">
&nbsp;
</el-col>
<el-col :span="8">
<el-button @click="closeForm()">关闭</el-button>&nbsp;
<el-button @click="submit" type="primary" :loading="saveLoading">
保存
</el-button>
</el-col>
<el-col :span="8">
&nbsp;
</el-col>
</el-row>
</div>
</el-form>
......@@ -538,12 +546,11 @@
friendList: [],
//新增修改航班信息
addMsg: {
TicketType: 2,
flightList: [],
},
AirportNameList: [],
BackAirportNameList: [],
airlineList: [],
AirportNameList: [], //去程航班列表
BackAirportNameList: [], //回程航班列表
airlineList: [], //航空公司列表
editForm: {
GTeamName: "", // 业务名称
StartDate: "", // 出发时间
......@@ -596,7 +603,6 @@
};
},
created() {
this.customers = []
this.initAirlines();
},
mounted() {
......@@ -605,9 +611,33 @@
}
},
methods: {
closeForm() {
//关闭弹窗并刷新页面
this.$emit("success");
},
//删除客户
deleteCustomer(index) {
this.friendList.splice(index, 1);
deleteCustomer(item, index) {
var that = this;
var tipMsg = "确认要删除此合作伙伴?"
that.Confirm(tipMsg, function () {
if (item.TPartnerId && item.TPartnerId > 0) {
that.apipost(
"travelteam_DeleteTravelTeamPartner", {
TPartnerId: item.TPartnerId
},
(res) => {
if (res.data.resultCode == 1) {
that.Success(res.data.message);
} else {
that.Error(res.data.message);
}
}
);
} else {
that.Success("删除合作伙伴成功!");
}
that.friendList.splice(index, 1);
})
},
//显示客户
showCustomer() {
......@@ -617,10 +647,14 @@
refreshPage(selectArray) {
if (selectArray && selectArray.length > 0) {
selectArray.forEach(item => {
let existsObj = this.friendList.find(qitem => qitem.CustomerId == item.CustomerId);
//不存在就添加
if (!existsObj) {
this.friendList.push({
CustomerId: item.CustomerId,
CustomerName: item.CustomerName
})
}
});
}
this.isShowCustomerDialog = false;
......@@ -633,21 +667,16 @@
},
(res) => {
if (res.data.resultCode == 1) {
this.editForm = res.data.data;
const {
TravelTeamFlightList,
TravelTeamPartnerList
} =
res.data.data;
TravelTeamFlightList.forEach((item) => {
item.IsTransfer = item.IsTransfer || 0;
item.TicketType = Math.random() > 0.5 ? 1 : 2;
});
this.addMsg.flightList = TravelTeamFlightList;
console.log("this.addMsg",this.addMsg);
this.friendList = TravelTeamPartnerList;
var tempObj = res.data.data;
this.editForm = tempObj;
if (tempObj.TravelTeamFlightList && tempObj.TravelTeamFlightList.length > 0) {
this.addMsg.flightList = tempObj.TravelTeamFlightList;
}
if (tempObj.TravelTeamPartnerList && tempObj.TravelTeamPartnerList.length > 0) {
this.friendList = tempObj.TravelTeamPartnerList;
}
} else {
this.$message.error(res.data.message);
this.Error(res.data.message);
}
}
);
......@@ -703,6 +732,7 @@
newList.TicketDepartureTime = x.DepartureTime;
newList.TicketArrivalTime = x.ArrivalTime;
newList.ID = this.addGoFlight.ID;
newList.TicketType = 1;
this.addMsg.flightList.push(newList);
}
});
......@@ -727,6 +757,7 @@
newList.TicketDepartureTime = x.DepartureTime;
newList.TicketArrivalTime = x.ArrivalTime;
newList.ID = this.returnTripData.ID;
newList.TicketType = 2;
this.addMsg.flightList.push(newList);
}
});
......
......@@ -128,16 +128,11 @@
<i class="el-icon-arrow-down el-icon--right"></i>
</span>
<el-dropdown-menu slot="dropdown" class="travelControlDropDown">
<el-dropdown-item>
财务入账
<el-dropdown-item @click.native="goToOrderList(item)">
报名清单
</el-dropdown-item>
<el-dropdown-item>
财务审核
</el-dropdown-item>
<el-dropdown-item>
包机结算
</el-dropdown-item>
<el-dropdown-item>
<el-dropdown-item @click.native="DeleteTravelTeam(item)">
删除
</el-dropdown-item>
</el-dropdown-menu>
......@@ -157,7 +152,7 @@
</div>
</div>
<el-dialog class="app-attachment-dialog" width="900" :title="dialogTitle" :visible.sync="isShowEditTeamDialog"
:close-on-click-modal="false" >
:close-on-click-modal="false">
<editTeamInfo v-if="isShowEditTeamDialog" :Q_GTeamId="GTeamId" @success="refreshPage"></editTeamInfo>
</el-dialog>
</div>
......@@ -226,7 +221,26 @@
},
},
methods: {
//删除包机团
DeleteTravelTeam(item) {
var that = this;
var tipMsg = "确认要删除【" + item.GTeamName + "】包机团?"
that.Confirm(tipMsg, function () {
that.apipost(
"travelteam_DelTeavelTeam", {
GTeamId: item.GTeamId
},
(res) => {
if (res.data.resultCode == 1) {
that.Success(res.data.message);
that.refreshPage();
} else {
that.Error(res.data.message);
}
}
);
})
},
//新增修改包机团
editTeam(item) {
if (item) {
......@@ -292,6 +306,12 @@
}
);
},
//跳转到报名清单
goToOrderList(item) {
this.OpenNewPage('/RegistrationList', {
id: item.TCID
});
}
},
mounted() {
this.getTravelTeamList();
......
......@@ -12,11 +12,11 @@ export default {
install(Vue, options) {
Vue.prototype.MsgBus = MsgBus;
Vue.prototype.md5 = md5;
Vue.prototype.QjGroupId = function(msg) {
Vue.prototype.QjGroupId = function (msg) {
let GroupId = 2;
return GroupId;
},
Vue.prototype.orderBy = function(source, orders, type) {
Vue.prototype.orderBy = function (source, orders, type) {
if (
source instanceof Array &&
orders instanceof Array &&
......@@ -28,7 +28,7 @@ export default {
var totalSum = {};
function grouporder(source, orders, totalSum) {
source.sort(function(a, b) {
source.sort(function (a, b) {
var convertA = a[orders[0]];
var convertB = b[orders[0]];
if (typeof convertA == "string" && typeof convertB == "string") {
......@@ -77,7 +77,7 @@ export default {
return source;
}
},
Vue.prototype.calcPageSize = function(itemHeight) {
Vue.prototype.calcPageSize = function (itemHeight) {
let yuHeight = itemHeight
try {
let obj = null
......@@ -97,7 +97,7 @@ export default {
} catch (error) {}
return Math.floor(yuHeight / itemHeight)
}
Vue.prototype.random_string = function(len) {
Vue.prototype.random_string = function (len) {
len = len || 32;
var chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678';
var maxPos = chars.length;
......@@ -108,18 +108,18 @@ export default {
return pwd;
},
//是否是线上环境【发布时修改为true】
Vue.prototype.isOnline = function() {
Vue.prototype.isOnline = function () {
return process.env.NODE_ENV !== 'development';
},
//域名管理对象
Vue.prototype.domainManager = function() {
Vue.prototype.domainManager = function () {
let domainUrl = '';
let mallUrl = ""; //商城API
let lxymallUrl = ''; //国内游api
let crmUrl = ""; //crm API
let locationName = window.location.hostname;
// domainUrl = "http://192.168.10.128";
domainUrl = "http://192.168.10.9:8083" // 刘东电脑
domainUrl = "http://192.168.10.128" // 刘东电脑
// domainUrl = "http://192.168.10.206:8015";
// domainUrl = "http://reborn.oytour.com";
let crmLocalFileStreamDownLoadUrl = "";
......@@ -181,14 +181,14 @@ export default {
};
return obj;
},
Vue.prototype.yinyanFn = function(url, successCall, faildCall) {
Vue.prototype.yinyanFn = function (url, successCall, faildCall) {
this.$http.jsonp(url, )
.then(res => {
successCall(res)
}, faildCall)
},
//消息成功提示
Vue.prototype.Success = function(msg) {
Vue.prototype.Success = function (msg) {
this.$message({
message: msg,
duration: 2000,
......@@ -196,7 +196,7 @@ export default {
});
},
//错误提示
Vue.prototype.Error = function(msg) {
Vue.prototype.Error = function (msg) {
this.$message({
message: msg,
duration: 2000,
......@@ -205,7 +205,7 @@ export default {
},
//一般提示
Vue.prototype.Info = function(msg) {
Vue.prototype.Info = function (msg) {
this.$message({
message: msg,
duration: 2000,
......@@ -213,7 +213,7 @@ export default {
});
},
//警告提示
Vue.prototype.Warning = function(msg) {
Vue.prototype.Warning = function (msg) {
this.$message({
message: msg,
duration: 2000,
......@@ -221,7 +221,7 @@ export default {
});
},
//Confirm
Vue.prototype.Confirm = function(msg, callback) {
Vue.prototype.Confirm = function (msg, callback) {
this.$confirm(msg, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
......@@ -237,7 +237,7 @@ export default {
});
},
//打开新窗口连接
Vue.prototype.OpenNewUrl = function(URL) {
Vue.prototype.OpenNewUrl = function (URL) {
if (URL != '') {
if (URL.indexOf("https") != -1) {
var str = 'http://' + URL.substring(8);
......@@ -252,7 +252,7 @@ export default {
}
//HTTP提交数据
Vue.prototype.apipost = function(cmd, msg, successCall, faildCall, isOnline) {
Vue.prototype.apipost = function (cmd, msg, successCall, faildCall, isOnline) {
if (this.$route.name.indexOf('login') === -1 && this.$route.name.indexOf('clientConfirm') === -1 &&
this.$route.name.indexOf('confirmationOrderDownLoad') === -1 && this.$route.name.indexOf('PrintPage') === -1 &&
this.$route.name.indexOf('TravelContractConfirm') === -1 && this.$route.name.indexOf('ViittoContractConfirm') === -1 &&
......@@ -353,7 +353,7 @@ export default {
}, faildCall)
},
// CRM接口
Vue.prototype.crmapipost = function(cmd, msg, successCall, faildCall, isOnline) {
Vue.prototype.crmapipost = function (cmd, msg, successCall, faildCall, isOnline) {
var apiurl = this.domainManager().crmUrl + cmd;
var token = "";
var key = "";
......@@ -383,7 +383,7 @@ export default {
}, faildCall)
},
// 自动登录HTTP提交数据
Vue.prototype.apipostLogin = function(cmd, msg, successCall, faildCall, isOnline) {
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 &&
......@@ -489,7 +489,7 @@ export default {
}, faildCall)
},
//HTTP提交数据
Vue.prototype.mallapipost = function(cmd, msg, successCall, faildCall, isOnline) {
Vue.prototype.mallapipost = function (cmd, msg, successCall, faildCall, isOnline) {
var apiurl = this.domainManager().mallUrl + cmd;
var postData = this.GetPostData(cmd, msg, "");
this.$http.post(apiurl, postData, {
......@@ -508,7 +508,7 @@ export default {
}
//文件下载
Vue.prototype.GetMallLocalFile = function(cmd, msg, fileName, newCmd, successCall) {
Vue.prototype.GetMallLocalFile = function (cmd, msg, fileName, newCmd, successCall) {
var apiurl = this.domainManager().mallUrl + cmd;
var postData = this.GetPostData(cmd, msg, newCmd);
this.$http.post(apiurl, postData, {
......@@ -524,11 +524,11 @@ export default {
document.body.appendChild(link);
link.click();
successCall(res);
}).catch(function(res) {});
}).catch(function (res) {});
}
//获取请求参数
Vue.prototype.GetPostData = function(cmd, msg, newCmd) {
Vue.prototype.GetPostData = function (cmd, msg, newCmd) {
if (msg == null || msg == "") {
msg = {}
}
......@@ -565,7 +565,7 @@ export default {
},
//用户权限验证
Vue.prototype.CheckUserAuth = function(authCode, successCall, faildCall) {
Vue.prototype.CheckUserAuth = function (authCode, successCall, faildCall) {
let localStorageJson = this.getLocalStorage();
var newCode = ',' + authCode + ',';
if (("," + localStorageJson.ActionMenuCode + ",").indexOf(newCode) > -1) {
......@@ -584,7 +584,7 @@ export default {
}
},
//供应商版请求接口方法
Vue.prototype.ApiPost2 = function(cmd, msg, successCall, faildCall) {
Vue.prototype.ApiPost2 = function (cmd, msg, successCall, faildCall) {
if (msg == null || msg == "") {
msg = {}
}
......@@ -632,7 +632,7 @@ export default {
},
//请求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) {
let previousPathInfo = {
path: this.$route.name,
......@@ -689,7 +689,7 @@ export default {
}, faildCall)
},
//请求资产管理接口
Vue.prototype.apiJavaPostZc = function(cmd, msg, successCall, faildCall) {
Vue.prototype.apiJavaPostZc = 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) {
let previousPathInfo = {
......@@ -748,7 +748,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 timestamp = (new Date()).valueOf();
if (!localStorage.userInfo && localStorage.userInfo != "" && this.$route.path.toLowerCase() != "/login") {
......@@ -782,10 +782,10 @@ export default {
document.body.appendChild(link);
link.click();
successCall(res);
}).catch(function(res) {});
}).catch(function (res) {});
},
//crm下载文件
Vue.prototype.crmGetLocalFile = function(cmd, msg, fileName, callBack) {
Vue.prototype.crmGetLocalFile = function (cmd, msg, fileName, callBack) {
if (msg == null || msg == "") {
msg = {}
}
......@@ -825,11 +825,11 @@ export default {
};
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 timestamp = (new Date()).valueOf();
if (!localStorage.userInfo && localStorage.userInfo != "" && this.$route.path.toLowerCase() != "/login") {
......@@ -867,16 +867,16 @@ export default {
document.body.appendChild(link);
link.click();
successCall(res);
}).catch(function(res) {});
}).catch(function (res) {});
},
//跳转到登录页面
Vue.prototype.goToLogin = function(type) {
Vue.prototype.goToLogin = function (type) {
this.$router.push({
path: '/login'
})
},
//ERP本地缓存
Vue.prototype.getLocalStorage = function() {
Vue.prototype.getLocalStorage = function () {
var localStorageData = window.localStorage["userInfo"];
if (localStorageData !== undefined && localStorageData != 'undefined') {
return JSON.parse(localStorageData);
......@@ -885,7 +885,7 @@ export default {
}
},
//供应商本地缓存
Vue.prototype.getLocalStorageSupplier = function() {
Vue.prototype.getLocalStorageSupplier = function () {
var localStorageData = window.localStorage["userInfo"];
if (localStorageData !== undefined && localStorageData != 'userInfo') {
return JSON.parse(localStorageData);
......@@ -894,11 +894,11 @@ export default {
}
},
//PDF预览
Vue.prototype.previewPDF = function(url) {
Vue.prototype.previewPDF = function (url) {
window.open(url);
},
//文件下载
Vue.prototype.downloadFile = function(objectKey) {
Vue.prototype.downloadFile = function (objectKey) {
var co = require('co');
var OSS = require('ali-oss');
var oss = new OSS({
......@@ -914,7 +914,7 @@ export default {
link.click();
},
//文件重命名下载
Vue.prototype.downloadFileRename = function(objectKey, filename, fileurl) {
Vue.prototype.downloadFileRename = function (objectKey, filename, fileurl) {
var co = require('co');
var OSS = require('ali-oss');
var oss = new OSS({
......@@ -956,7 +956,7 @@ export default {
});
},
//获取文件Blob
Vue.prototype.getFileBlob = function(objectKey, filename) {
Vue.prototype.getFileBlob = function (objectKey, filename) {
var co = require('co');
var OSS = require('ali-oss');
var oss = new OSS({
......@@ -980,7 +980,7 @@ export default {
return getBlob
},
//文件上传
Vue.prototype.uploadImg = function(path, base64Str, successCall, faildCall) {
Vue.prototype.uploadImg = function (path, base64Str, successCall, faildCall) {
var apiurl = this.domainManager().UploadUrl + '/Upload/UploadBase64Two?fileType=1&fileLimit=5&&filePath=' + path;
this.$http.post(apiurl, {
MyFile: base64Str
......@@ -988,12 +988,12 @@ export default {
headers: {
"Content-Type": "application/x-www-form-urlencoded;"
},
}).then(function(res) {
}).then(function (res) {
})
},
//Blob文件上传
Vue.prototype.uploadSelfBlob = function(path, files, successCall) {
Vue.prototype.uploadSelfBlob = function (path, files, successCall) {
let that = this;
var uploadUrl = that.domainManager().UploadUrl + "/Upload/UploadBlob?fileType=1&fileLimit=5&&filePath=" + path;
var formData = new FormData();
......@@ -1008,7 +1008,7 @@ export default {
//path 请按照"/模块名称/用户ID/自定义文件夹/" /谁搞错一次5块红包
//files 文件数组
//p 进度回调函数
Vue.prototype.uploadFile = function(path, files, successCall) {
Vue.prototype.uploadFile = function (path, files, successCall) {
if (files && files.length > 0) {
let nameList = new Array()
......@@ -1024,24 +1024,24 @@ export default {
let that = this;
let checkpoint = null;
let percentage = 0;
co(function*() {
co(function* () {
for (let index = 0; index < files.length; index++) {
let fileName = nameList[index]
fileName = "/New" + path + fileName + "." + files[index].name.split('.').pop()
var result = yield oss.multipartUpload(fileName, files[index], {
progress: function*(p) {},
progress: function* (p) {},
mime: 'application/octet-stream'
})
successCall(result);
}
}).catch(function(err) {
}).catch(function (err) {
});
}
},
//公用判断图片地址 判断是否包含http
Vue.prototype.getIconLink = function(url) {
Vue.prototype.getIconLink = function (url) {
let str = ''
if (url && url != '') {
if (url.indexOf('http') != -1) {
......@@ -1053,14 +1053,14 @@ export default {
}
},
//上传文件到本地服务器
Vue.prototype.UploadSelfFileT = function(path, files, successCall, ocr) {
Vue.prototype.UploadSelfFileT = function (path, files, successCall, ocr) {
if (files && files.length > 0) {
let nameList = new Array()
for (let index = 0; index < files.length; index++) {
nameList.push(this.random_string());
}
let that = this;
co(function*() {
co(function* () {
for (let index = 0; index < files.length; index++) {
let fileName = nameList[index]
fileName = path + fileName + "." + files[index].name.split('.').pop()
......@@ -1070,14 +1070,14 @@ export default {
that.$http.post(uploadUrl, formData, {})
.then(res => {
successCall(res);
}).catch(function(reason) {
}).catch(function (reason) {
that.$refs['my-upload'].clearFiles();
that.$message.error('上传失败!');
that.MsgBus.$emit('UploadSelfFileErr')
});
}
}).catch(function(err) {
}).catch(function (err) {
that.$refs['my-upload'].clearFiles();
that.$message.error('上传失败!');
});
......@@ -1088,8 +1088,8 @@ export default {
//type : m_filt 填充 m_w 宽度固定 高度不固定 m_h 高度固定 宽度不固定
// w : 宽
// h : 高
Vue.prototype.compressImg = function(path, type, w, h) {
if(!path||path=='') return ''
Vue.prototype.compressImg = function (path, type, w, h) {
if (!path || path == '') return ''
let url = this.domainManager().UploadUrl;
let poise = 'm_filt';
......@@ -1103,7 +1103,7 @@ export default {
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;
}
Vue.prototype.uploadSelfBlob = function(path, files, successCall) {
Vue.prototype.uploadSelfBlob = function (path, files, successCall) {
let that = this;
var uploadUrl = that.domainManager().UploadUrl + "/Upload/UploadBlob?fileType=1&fileLimit=5&&filePath=" + path;
var formData = new FormData();
......@@ -1117,7 +1117,7 @@ export default {
},
//验证只能输入2位小数【负数:isMinus传true】
Vue.prototype.checkPrice = function(item, filed, isMinus) {
Vue.prototype.checkPrice = function (item, filed, isMinus) {
var value = "" + item[filed]; //转字符串
var t = value.charAt(0);
value = value.replace(/[^\d.]/g, ""); //清除“数字”和“.”以外的字符
......@@ -1135,7 +1135,7 @@ export default {
item[filed] = value;
}
//验证输入6位小数汇率
Vue.prototype.checkRate = function(item, filed) {
Vue.prototype.checkRate = function (item, filed) {
var value = "" + item[filed]; //转字符串
var p1 = /[^\d\.]/g; // 过滤非数字及小数点 /g :所有范围中过滤
var p2 = /(\.\d{6})\d*$/g;
......@@ -1150,7 +1150,7 @@ export default {
}
//验证只能输入整数【负数:isMinus传true】
Vue.prototype.checkInteger = function(item, filed, isMinus) {
Vue.prototype.checkInteger = function (item, filed, isMinus) {
var value = "" + item[filed]; //转字符串
var t = value.charAt(0);
value = value.replace(this.$commonUtils.Regex.isInteger, "");
......@@ -1161,7 +1161,7 @@ export default {
item[filed] = value;
}
//格式化日期
Vue.prototype.FormartDate = function(date) {
Vue.prototype.FormartDate = function (date) {
let today =
date.getFullYear() +
"-" +
......@@ -1173,7 +1173,7 @@ export default {
return today;
}
//时间验证
Vue.prototype.checkTime = function(item, filed) {
Vue.prototype.checkTime = function (item, filed) {
var date = item[filed];
if (date.length == 1) {
var v1 = date.substring(0, 1);
......@@ -1217,7 +1217,7 @@ export default {
this.$forceUpdate();
}
// 计算当前日期的前后日期
Vue.prototype.getBeforeDate = function(num, time) {
Vue.prototype.getBeforeDate = function (num, time) {
let n = num;
let d = '';
if (time) {
......@@ -1245,7 +1245,7 @@ export default {
},
//价钱格式化,三位数逗号分隔,保留两位小数 duanjun
Vue.prototype.moneyFormat = function(value) {
Vue.prototype.moneyFormat = function (value) {
let nStr = Number(value).toFixed(2)
nStr += '';
let x = nStr.split('.');
......@@ -1258,7 +1258,7 @@ export default {
return x1 + x2;
},
//价钱格式化,三位数逗号分隔,保留八位小数 duanjun
Vue.prototype.moneyFormatB = function(value) {
Vue.prototype.moneyFormatB = function (value) {
let nStr = Number(value).toFixed(8)
nStr += '';
let x = nStr.split('.');
......@@ -1271,7 +1271,7 @@ export default {
return x1 + x2;
},
//文件图标
Vue.prototype.loadFileICON = function(suffix) {
Vue.prototype.loadFileICON = function (suffix) {
let icons = [{
"name": "\u7f51\u76d8BT\u79bb\u7ebf\u4e0b\u8f7d",
......@@ -1554,7 +1554,7 @@ export default {
},
//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 postData = this.GetNewPostData(cmd, msg, "");
this.$http.post(apiurl, postData, {
......@@ -1572,14 +1572,14 @@ export default {
}, faildCall)
},
//公用跳转
Vue.prototype.CommonJump = function(path, obj) {
Vue.prototype.CommonJump = function (path, obj) {
this.$router.push({
name: path,
query: obj
});
}
//获取请求参数
Vue.prototype.GetNewPostData = function(cmd, msg, newCmd) {
Vue.prototype.GetNewPostData = function (cmd, msg, newCmd) {
if (msg == null || msg == "") {
msg = {}
}
......@@ -1619,5 +1619,14 @@ export default {
}
return postData
}
//新页面打开页面
Vue.prototype.OpenNewPage = function (path, queryObj) {
var newUrl = this.$router.resolve({
path: path,
query: queryObj
});
window.open(newUrl.href, '_blank');
}
}
}
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