Commit 434a798a authored by 沈良进's avatar 沈良进
parents 9cd9ad43 4588089a
...@@ -2,30 +2,24 @@ ...@@ -2,30 +2,24 @@
</style> </style>
<template> <template>
<div> <div>
<div style="border: none; display: flex; margin-bottom: 20px"> <div style="border: none; display: flex; margin-bottom: 20px">
<ul style="overflow: initial!important;display: flex; width: 100%"> <ul style="overflow: initial!important;display: flex; width: 100%">
<li style="display: flex"> <li style="display: flex">
<span style="width: 60px; line-height: 34px"> <span style="width: 60px; line-height: 34px">
<em>{{$t('salesModule.keyWords')}}</em> <em>{{$t('salesModule.keyWords')}}</em>
</span> </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>
<li> <li>
<input <input type="button" class="hollowFixedBtn" :value="$t('pub.searchBtn')" @click="reSearchPage()">
type="button" </li>
class="hollowFixedBtn" <li>
:value="$t('pub.searchBtn')" <el-button style="margin-left:10px;" size="small " type="primary" @click="sureData" round>确认选择</el-button>
@click="resetPageIndex(),getCustomerList()"
>
</li> </li>
</ul> </ul>
</div> </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"> <div class="chooseCustomerInfo">
<el-table :data="dataList" style="width:100%" border v-loading='loading' <el-table :data="dataList" style="width:100%" border v-loading='loading'
@selection-change="handleSelectionChange"> @selection-change="handleSelectionChange">
...@@ -56,7 +50,7 @@ ...@@ -56,7 +50,7 @@
layout="total,prev, pager, next, jumper" :page-size="qMsg.pageSize" :total="qMsg.total"> layout="total,prev, pager, next, jumper" :page-size="qMsg.pageSize" :total="qMsg.total">
</el-pagination> </el-pagination>
</div> </div>
</el-card></div> </div>
</template> </template>
<script> <script>
export default { export default {
...@@ -95,7 +89,10 @@ ...@@ -95,7 +89,10 @@
this.qMsg.pageIndex = val; this.qMsg.pageIndex = val;
this.getCustomerList(); this.getCustomerList();
}, },
resetPageIndex() {this.qMsg.pageIndex = 1;}, reSearchPage() {
this.qMsg.pageIndex = 1;
this.getCustomerList();
},
// 获取合作伙伴列表 // 获取合作伙伴列表
getCustomerList() { getCustomerList() {
this.loading = true; this.loading = true;
...@@ -116,7 +113,6 @@ ...@@ -116,7 +113,6 @@
} }
); );
}, },
}, },
}; };
......
...@@ -200,7 +200,7 @@ ...@@ -200,7 +200,7 @@
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="业务名称" prop="GTeamName"> <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-form-item>
</el-col> </el-col>
</el-row> </el-row>
...@@ -213,7 +213,7 @@ ...@@ -213,7 +213,7 @@
<el-col :span="12"> <el-col :span="12">
<!--添加修改航班--> <!--添加修改航班-->
<ul class="_add_hangban clearfix"> <ul class="_add_hangban clearfix">
<li :class="addMsg.TicketType == 1 ? '_allWidth' : ''"> <li>
<span class="_add_go_label">{{ $t("Airticket.Air_go") }}</span> <span class="_add_go_label">{{ $t("Airticket.Air_go") }}</span>
<div class="_add_go" v-for="(item, index) in addMsg.flightList" :key="index"> <div class="_add_go" v-for="(item, index) in addMsg.flightList" :key="index">
<template v-if="item.TicketType == 1"> <template v-if="item.TicketType == 1">
...@@ -249,7 +249,7 @@ ...@@ -249,7 +249,7 @@
<p> <p>
<span>{{ $t("pub.addBtn") }}</span> <span>{{ $t("pub.addBtn") }}</span>
<span class="_add_btn" @click="addFlight()">{{ <span class="_add_btn" @click="addFlight()">{{
$t("pub.sureBtn") $t("pub.saveBtn")
}}</span> }}</span>
</p> </p>
<span class="_add_hbh"> <span class="_add_hbh">
...@@ -321,7 +321,7 @@ ...@@ -321,7 +321,7 @@
<p> <p>
<span>{{ $t("pub.addBtn") }}</span> <span>{{ $t("pub.addBtn") }}</span>
<span class="_add_btn" @click="addFlightReturn()">{{ <span class="_add_btn" @click="addFlightReturn()">{{
$t("pub.sureBtn") $t("pub.saveBtn")
}}</span> }}</span>
</p> </p>
<span class="_add_hbh"> <span class="_add_hbh">
...@@ -442,7 +442,8 @@ ...@@ -442,7 +442,8 @@
<el-col :span="24"> <el-col :span="24">
<el-form-item label="合作伙伴"> <el-form-item label="合作伙伴">
<template v-for="(subItem,subIndex) in friendList"> <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> {{subItem.CustomerName}}</el-tag>
</template> </template>
<el-button @click="showCustomer">选择</el-button> <el-button @click="showCustomer">选择</el-button>
...@@ -476,11 +477,18 @@ ...@@ -476,11 +477,18 @@
</el-col> </el-col>
</el-row> </el-row>
<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 @click="submit" type="primary" :loading="saveLoading">
保存 保存
</el-button> </el-button>
</el-col> </el-col>
<el-col :span="8">
&nbsp;
</el-col>
</el-row> </el-row>
</div> </div>
</el-form> </el-form>
...@@ -538,12 +546,11 @@ ...@@ -538,12 +546,11 @@
friendList: [], friendList: [],
//新增修改航班信息 //新增修改航班信息
addMsg: { addMsg: {
TicketType: 2,
flightList: [], flightList: [],
}, },
AirportNameList: [], AirportNameList: [], //去程航班列表
BackAirportNameList: [], BackAirportNameList: [], //回程航班列表
airlineList: [], airlineList: [], //航空公司列表
editForm: { editForm: {
GTeamName: "", // 业务名称 GTeamName: "", // 业务名称
StartDate: "", // 出发时间 StartDate: "", // 出发时间
...@@ -596,7 +603,6 @@ ...@@ -596,7 +603,6 @@
}; };
}, },
created() { created() {
this.customers = []
this.initAirlines(); this.initAirlines();
}, },
mounted() { mounted() {
...@@ -605,9 +611,33 @@ ...@@ -605,9 +611,33 @@
} }
}, },
methods: { methods: {
closeForm() {
//关闭弹窗并刷新页面
this.$emit("success");
},
//删除客户 //删除客户
deleteCustomer(index) { deleteCustomer(item, index) {
this.friendList.splice(index, 1); 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() { showCustomer() {
...@@ -617,10 +647,14 @@ ...@@ -617,10 +647,14 @@
refreshPage(selectArray) { refreshPage(selectArray) {
if (selectArray && selectArray.length > 0) { if (selectArray && selectArray.length > 0) {
selectArray.forEach(item => { selectArray.forEach(item => {
let existsObj = this.friendList.find(qitem => qitem.CustomerId == item.CustomerId);
//不存在就添加
if (!existsObj) {
this.friendList.push({ this.friendList.push({
CustomerId: item.CustomerId, CustomerId: item.CustomerId,
CustomerName: item.CustomerName CustomerName: item.CustomerName
}) })
}
}); });
} }
this.isShowCustomerDialog = false; this.isShowCustomerDialog = false;
...@@ -633,21 +667,16 @@ ...@@ -633,21 +667,16 @@
}, },
(res) => { (res) => {
if (res.data.resultCode == 1) { if (res.data.resultCode == 1) {
this.editForm = res.data.data; var tempObj = res.data.data;
const { this.editForm = tempObj;
TravelTeamFlightList, if (tempObj.TravelTeamFlightList && tempObj.TravelTeamFlightList.length > 0) {
TravelTeamPartnerList this.addMsg.flightList = tempObj.TravelTeamFlightList;
} = }
res.data.data; if (tempObj.TravelTeamPartnerList && tempObj.TravelTeamPartnerList.length > 0) {
TravelTeamFlightList.forEach((item) => { this.friendList = tempObj.TravelTeamPartnerList;
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;
} else { } else {
this.$message.error(res.data.message); this.Error(res.data.message);
} }
} }
); );
...@@ -703,6 +732,7 @@ ...@@ -703,6 +732,7 @@
newList.TicketDepartureTime = x.DepartureTime; newList.TicketDepartureTime = x.DepartureTime;
newList.TicketArrivalTime = x.ArrivalTime; newList.TicketArrivalTime = x.ArrivalTime;
newList.ID = this.addGoFlight.ID; newList.ID = this.addGoFlight.ID;
newList.TicketType = 1;
this.addMsg.flightList.push(newList); this.addMsg.flightList.push(newList);
} }
}); });
...@@ -727,6 +757,7 @@ ...@@ -727,6 +757,7 @@
newList.TicketDepartureTime = x.DepartureTime; newList.TicketDepartureTime = x.DepartureTime;
newList.TicketArrivalTime = x.ArrivalTime; newList.TicketArrivalTime = x.ArrivalTime;
newList.ID = this.returnTripData.ID; newList.ID = this.returnTripData.ID;
newList.TicketType = 2;
this.addMsg.flightList.push(newList); this.addMsg.flightList.push(newList);
} }
}); });
......
...@@ -128,16 +128,11 @@ ...@@ -128,16 +128,11 @@
<i class="el-icon-arrow-down el-icon--right"></i> <i class="el-icon-arrow-down el-icon--right"></i>
</span> </span>
<el-dropdown-menu slot="dropdown" class="travelControlDropDown"> <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 @click.native="DeleteTravelTeam(item)">
</el-dropdown-item>
<el-dropdown-item>
包机结算
</el-dropdown-item>
<el-dropdown-item>
删除 删除
</el-dropdown-item> </el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
...@@ -157,7 +152,7 @@ ...@@ -157,7 +152,7 @@
</div> </div>
</div> </div>
<el-dialog class="app-attachment-dialog" width="900" :title="dialogTitle" :visible.sync="isShowEditTeamDialog" <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> <editTeamInfo v-if="isShowEditTeamDialog" :Q_GTeamId="GTeamId" @success="refreshPage"></editTeamInfo>
</el-dialog> </el-dialog>
</div> </div>
...@@ -226,7 +221,26 @@ ...@@ -226,7 +221,26 @@
}, },
}, },
methods: { 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) { editTeam(item) {
if (item) { if (item) {
...@@ -292,6 +306,12 @@ ...@@ -292,6 +306,12 @@
} }
); );
}, },
//跳转到报名清单
goToOrderList(item) {
this.OpenNewPage('/RegistrationList', {
id: item.TCID
});
}
}, },
mounted() { mounted() {
this.getTravelTeamList(); this.getTravelTeamList();
......
...@@ -12,11 +12,11 @@ export default { ...@@ -12,11 +12,11 @@ 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.QjGroupId = function(msg) { Vue.prototype.QjGroupId = function (msg) {
let GroupId = 2; let GroupId = 2;
return GroupId; return GroupId;
}, },
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 &&
...@@ -28,7 +28,7 @@ export default { ...@@ -28,7 +28,7 @@ export default {
var totalSum = {}; var totalSum = {};
function grouporder(source, orders, totalSum) { function grouporder(source, orders, totalSum) {
source.sort(function(a, b) { source.sort(function (a, b) {
var convertA = a[orders[0]]; var convertA = a[orders[0]];
var convertB = b[orders[0]]; var convertB = b[orders[0]];
if (typeof convertA == "string" && typeof convertB == "string") { if (typeof convertA == "string" && typeof convertB == "string") {
...@@ -77,7 +77,7 @@ export default { ...@@ -77,7 +77,7 @@ 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
...@@ -97,7 +97,7 @@ export default { ...@@ -97,7 +97,7 @@ export default {
} catch (error) {} } catch (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,18 +108,18 @@ export default { ...@@ -108,18 +108,18 @@ 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 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.128"; // 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://192.168.10.206:8015";
// domainUrl = "http://reborn.oytour.com"; // domainUrl = "http://reborn.oytour.com";
let crmLocalFileStreamDownLoadUrl = ""; let crmLocalFileStreamDownLoadUrl = "";
...@@ -181,14 +181,14 @@ export default { ...@@ -181,14 +181,14 @@ export default {
}; };
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,
...@@ -196,7 +196,7 @@ export default { ...@@ -196,7 +196,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,
...@@ -205,7 +205,7 @@ export default { ...@@ -205,7 +205,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,
...@@ -213,7 +213,7 @@ export default { ...@@ -213,7 +213,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,
...@@ -221,7 +221,7 @@ export default { ...@@ -221,7 +221,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: "取消",
...@@ -237,7 +237,7 @@ export default { ...@@ -237,7 +237,7 @@ export default {
}); });
}, },
//打开新窗口连接 //打开新窗口连接
Vue.prototype.OpenNewUrl = function(URL) { Vue.prototype.OpenNewUrl = function (URL) {
if (URL != '') { if (URL != '') {
if (URL.indexOf("https") != -1) { if (URL.indexOf("https") != -1) {
var str = 'http://' + URL.substring(8); var str = 'http://' + URL.substring(8);
...@@ -252,7 +252,7 @@ export default { ...@@ -252,7 +252,7 @@ export default {
} }
//HTTP提交数据 //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 && 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('confirmationOrderDownLoad') === -1 && this.$route.name.indexOf('PrintPage') === -1 &&
this.$route.name.indexOf('TravelContractConfirm') === -1 && this.$route.name.indexOf('ViittoContractConfirm') === -1 && this.$route.name.indexOf('TravelContractConfirm') === -1 && this.$route.name.indexOf('ViittoContractConfirm') === -1 &&
...@@ -353,7 +353,7 @@ export default { ...@@ -353,7 +353,7 @@ export default {
}, faildCall) }, faildCall)
}, },
// CRM接口 // 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 apiurl = this.domainManager().crmUrl + cmd;
var token = ""; var token = "";
var key = ""; var key = "";
...@@ -383,7 +383,7 @@ export default { ...@@ -383,7 +383,7 @@ export default {
}, faildCall) }, faildCall)
}, },
// 自动登录HTTP提交数据 // 自动登录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 && 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('confirmationsOrderDownLoad') === -1 && this.$route.name.indexOf('PrintPage') === -1 &&
this.$route.name.indexOf('TravelContractConfirm') === -1 && this.$route.name.indexOf('ViittoContractConfirm') === -1 && this.$route.name.indexOf('TravelContractConfirm') === -1 && this.$route.name.indexOf('ViittoContractConfirm') === -1 &&
...@@ -489,7 +489,7 @@ export default { ...@@ -489,7 +489,7 @@ export default {
}, faildCall) }, faildCall)
}, },
//HTTP提交数据 //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 apiurl = this.domainManager().mallUrl + cmd;
var postData = this.GetPostData(cmd, msg, ""); var postData = this.GetPostData(cmd, msg, "");
this.$http.post(apiurl, postData, { this.$http.post(apiurl, postData, {
...@@ -508,7 +508,7 @@ export default { ...@@ -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 apiurl = this.domainManager().mallUrl + cmd;
var postData = this.GetPostData(cmd, msg, newCmd); var postData = this.GetPostData(cmd, msg, newCmd);
this.$http.post(apiurl, postData, { this.$http.post(apiurl, postData, {
...@@ -524,11 +524,11 @@ export default { ...@@ -524,11 +524,11 @@ 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.GetPostData = function(cmd, msg, newCmd) { Vue.prototype.GetPostData = function (cmd, msg, newCmd) {
if (msg == null || msg == "") { if (msg == null || msg == "") {
msg = {} msg = {}
} }
...@@ -565,7 +565,7 @@ export default { ...@@ -565,7 +565,7 @@ export default {
}, },
//用户权限验证 //用户权限验证
Vue.prototype.CheckUserAuth = function(authCode, successCall, faildCall) { Vue.prototype.CheckUserAuth = function (authCode, successCall, faildCall) {
let localStorageJson = this.getLocalStorage(); let localStorageJson = this.getLocalStorage();
var newCode = ',' + authCode + ','; var newCode = ',' + authCode + ',';
if (("," + localStorageJson.ActionMenuCode + ",").indexOf(newCode) > -1) { if (("," + localStorageJson.ActionMenuCode + ",").indexOf(newCode) > -1) {
...@@ -584,7 +584,7 @@ export default { ...@@ -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 == "") { if (msg == null || msg == "") {
msg = {} msg = {}
} }
...@@ -632,7 +632,7 @@ export default { ...@@ -632,7 +632,7 @@ 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,
...@@ -689,7 +689,7 @@ export default { ...@@ -689,7 +689,7 @@ export default {
}, faildCall) }, 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) { 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 = {
...@@ -748,7 +748,7 @@ export default { ...@@ -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 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") {
...@@ -782,10 +782,10 @@ export default { ...@@ -782,10 +782,10 @@ export default {
document.body.appendChild(link); document.body.appendChild(link);
link.click(); link.click();
successCall(res); successCall(res);
}).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 = {}
} }
...@@ -825,11 +825,11 @@ export default { ...@@ -825,11 +825,11 @@ export default {
}; };
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") {
...@@ -867,16 +867,16 @@ export default { ...@@ -867,16 +867,16 @@ 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.goToLogin = function(type) { Vue.prototype.goToLogin = function (type) {
this.$router.push({ this.$router.push({
path: '/login' path: '/login'
}) })
}, },
//ERP本地缓存 //ERP本地缓存
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);
...@@ -885,7 +885,7 @@ export default { ...@@ -885,7 +885,7 @@ export default {
} }
}, },
//供应商本地缓存 //供应商本地缓存
Vue.prototype.getLocalStorageSupplier = function() { Vue.prototype.getLocalStorageSupplier = function () {
var localStorageData = window.localStorage["userInfo"]; var localStorageData = window.localStorage["userInfo"];
if (localStorageData !== undefined && localStorageData != 'userInfo') { if (localStorageData !== undefined && localStorageData != 'userInfo') {
return JSON.parse(localStorageData); return JSON.parse(localStorageData);
...@@ -894,11 +894,11 @@ export default { ...@@ -894,11 +894,11 @@ export default {
} }
}, },
//PDF预览 //PDF预览
Vue.prototype.previewPDF = function(url) { Vue.prototype.previewPDF = function (url) {
window.open(url); window.open(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({
...@@ -914,7 +914,7 @@ export default { ...@@ -914,7 +914,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');
var oss = new OSS({ var oss = new OSS({
...@@ -956,7 +956,7 @@ export default { ...@@ -956,7 +956,7 @@ export default {
}); });
}, },
//获取文件Blob //获取文件Blob
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({
...@@ -980,7 +980,7 @@ export default { ...@@ -980,7 +980,7 @@ export default {
return getBlob 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; var apiurl = this.domainManager().UploadUrl + '/Upload/UploadBase64Two?fileType=1&fileLimit=5&&filePath=' + path;
this.$http.post(apiurl, { this.$http.post(apiurl, {
MyFile: base64Str MyFile: base64Str
...@@ -988,12 +988,12 @@ export default { ...@@ -988,12 +988,12 @@ export default {
headers: { headers: {
"Content-Type": "application/x-www-form-urlencoded;" "Content-Type": "application/x-www-form-urlencoded;"
}, },
}).then(function(res) { }).then(function (res) {
}) })
}, },
//Blob文件上传 //Blob文件上传
Vue.prototype.uploadSelfBlob = function(path, files, successCall) { Vue.prototype.uploadSelfBlob = function (path, files, successCall) {
let that = this; let that = this;
var uploadUrl = that.domainManager().UploadUrl + "/Upload/UploadBlob?fileType=1&fileLimit=5&&filePath=" + path; var uploadUrl = that.domainManager().UploadUrl + "/Upload/UploadBlob?fileType=1&fileLimit=5&&filePath=" + path;
var formData = new FormData(); var formData = new FormData();
...@@ -1008,7 +1008,7 @@ export default { ...@@ -1008,7 +1008,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()
...@@ -1024,24 +1024,24 @@ export default { ...@@ -1024,24 +1024,24 @@ export default {
let that = this; let that = this;
let checkpoint = null; let checkpoint = null;
let percentage = 0; let percentage = 0;
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 = "/New" + path + fileName + "." + files[index].name.split('.').pop() fileName = "/New" + 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) {
}); });
} }
}, },
//公用判断图片地址 判断是否包含http //公用判断图片地址 判断是否包含http
Vue.prototype.getIconLink = function(url) { Vue.prototype.getIconLink = function (url) {
let str = '' let str = ''
if (url && url != '') { if (url && url != '') {
if (url.indexOf('http') != -1) { if (url.indexOf('http') != -1) {
...@@ -1053,14 +1053,14 @@ export default { ...@@ -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) { 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++) {
nameList.push(this.random_string()); nameList.push(this.random_string());
} }
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()
...@@ -1070,14 +1070,14 @@ export default { ...@@ -1070,14 +1070,14 @@ export default {
that.$http.post(uploadUrl, formData, {}) that.$http.post(uploadUrl, formData, {})
.then(res => { .then(res => {
successCall(res); successCall(res);
}).catch(function(reason) { }).catch(function (reason) {
that.$refs['my-upload'].clearFiles(); that.$refs['my-upload'].clearFiles();
that.$message.error('上传失败!'); that.$message.error('上传失败!');
that.MsgBus.$emit('UploadSelfFileErr') that.MsgBus.$emit('UploadSelfFileErr')
}); });
} }
}).catch(function(err) { }).catch(function (err) {
that.$refs['my-upload'].clearFiles(); that.$refs['my-upload'].clearFiles();
that.$message.error('上传失败!'); that.$message.error('上传失败!');
}); });
...@@ -1088,8 +1088,8 @@ export default { ...@@ -1088,8 +1088,8 @@ export default {
//type : m_filt 填充 m_w 宽度固定 高度不固定 m_h 高度固定 宽度不固定 //type : m_filt 填充 m_w 宽度固定 高度不固定 m_h 高度固定 宽度不固定
// w : 宽 // w : 宽
// h : 高 // h : 高
Vue.prototype.compressImg = function(path, type, w, h) { Vue.prototype.compressImg = function (path, type, w, h) {
if(!path||path=='') return '' if (!path || path == '') return ''
let url = this.domainManager().UploadUrl; let url = this.domainManager().UploadUrl;
let poise = 'm_filt'; let poise = 'm_filt';
...@@ -1103,7 +1103,7 @@ export default { ...@@ -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]; 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;
var uploadUrl = that.domainManager().UploadUrl + "/Upload/UploadBlob?fileType=1&fileLimit=5&&filePath=" + path; var uploadUrl = that.domainManager().UploadUrl + "/Upload/UploadBlob?fileType=1&fileLimit=5&&filePath=" + path;
var formData = new FormData(); var formData = new FormData();
...@@ -1117,7 +1117,7 @@ export default { ...@@ -1117,7 +1117,7 @@ export default {
}, },
//验证只能输入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, ""); //清除“数字”和“.”以外的字符
...@@ -1135,7 +1135,7 @@ export default { ...@@ -1135,7 +1135,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;
...@@ -1150,7 +1150,7 @@ export default { ...@@ -1150,7 +1150,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, "");
...@@ -1161,7 +1161,7 @@ export default { ...@@ -1161,7 +1161,7 @@ export default {
item[filed] = value; item[filed] = value;
} }
//格式化日期 //格式化日期
Vue.prototype.FormartDate = function(date) { Vue.prototype.FormartDate = function (date) {
let today = let today =
date.getFullYear() + date.getFullYear() +
"-" + "-" +
...@@ -1173,7 +1173,7 @@ export default { ...@@ -1173,7 +1173,7 @@ export default {
return today; return today;
} }
//时间验证 //时间验证
Vue.prototype.checkTime = function(item, filed) { Vue.prototype.checkTime = function (item, filed) {
var date = item[filed]; var date = item[filed];
if (date.length == 1) { if (date.length == 1) {
var v1 = date.substring(0, 1); var v1 = date.substring(0, 1);
...@@ -1217,7 +1217,7 @@ export default { ...@@ -1217,7 +1217,7 @@ export default {
this.$forceUpdate(); this.$forceUpdate();
} }
// 计算当前日期的前后日期 // 计算当前日期的前后日期
Vue.prototype.getBeforeDate = function(num, time) { Vue.prototype.getBeforeDate = function (num, time) {
let n = num; let n = num;
let d = ''; let d = '';
if (time) { if (time) {
...@@ -1245,7 +1245,7 @@ export default { ...@@ -1245,7 +1245,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('.');
...@@ -1258,7 +1258,7 @@ export default { ...@@ -1258,7 +1258,7 @@ export default {
return x1 + x2; return x1 + x2;
}, },
//价钱格式化,三位数逗号分隔,保留八位小数 duanjun //价钱格式化,三位数逗号分隔,保留八位小数 duanjun
Vue.prototype.moneyFormatB = function(value) { Vue.prototype.moneyFormatB = function (value) {
let nStr = Number(value).toFixed(8) let nStr = Number(value).toFixed(8)
nStr += ''; nStr += '';
let x = nStr.split('.'); let x = nStr.split('.');
...@@ -1271,7 +1271,7 @@ export default { ...@@ -1271,7 +1271,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",
...@@ -1554,7 +1554,7 @@ export default { ...@@ -1554,7 +1554,7 @@ export default {
}, },
//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, {
...@@ -1572,14 +1572,14 @@ export default { ...@@ -1572,14 +1572,14 @@ export default {
}, 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 == "") {
msg = {} msg = {}
} }
...@@ -1619,5 +1619,14 @@ export default { ...@@ -1619,5 +1619,14 @@ export default {
} }
return postData 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