Commit 78ea32a3 authored by zhengke's avatar zhengke

修改报价单

parent 37a90b8f
<template>
<div v-if="isShow" class="DirectQuotation clearfix">
<DirectQuotation ref="QuotationPrice" :postConfig="postData"></DirectQuotation>
<div class="btnFixedDiv">
<div class="toTop" @click="backTop">
<i class="iconfont icon-huidaodingbu"></i>
</div>
<div class="DTSaveBtn" :class="{'disClick':!isSubmit}" @click="submitForm(2)">提交</div>
<div class="DTSaveBtn" @click="copyQuotationData" style="display:none;">复制</div>
<div class="DTSaveBtn caogao" :class="{'disClick':!isSubmit}" @click="submitForm(1)">
<span>保存</span>
<span>草稿</span>
</div>
</div>
</div>
</template>
<script>
import DirectQuotation from "../TravelNewQuotation/DirectNewQuotation";
export default {
data() {
return {
postData: "",
isSubmit: true,
priceIsDirect: 2, //是否直采报价(1-否-2-是)
isShow: false //数据请求后再加载组件
};
},
methods: {
//表单提交
submitForm(type) {
this.$refs["QuotationPrice"].submitForm(type);
},
changeDirect(value) {
this.priceIsDirect = value;
this.postData.PriceIsDirect = value;
this.isSubmit = true;
if (this.postData.IsDirect == 1) {
this.changeTeamLocalOfferValue();
}
},
updateSubmitState(state) {
this.isSubmit = state;
},
changeTeamLocalOfferValue() {
this.postData.PriceList.forEach(y => {
let localOfferList = JSON.parse(
JSON.stringify(y.OfferPrice.FullLocalOfferList)
);
y.OfferPrice.LocalOfferList = localOfferList;
});
},
//回到顶部
backTop() {
var timer = setInterval(function() {
var scrollTop = document.getElementsByClassName("flexParent")[0]
.scrollTop;
var ispeed = Math.floor(-scrollTop / 6);
if (scrollTop == 0) {
clearInterval(timer);
}
document.getElementsByClassName("flexParent")[0].scrollTop =
scrollTop + ispeed;
}, 30);
},
//获取行程信息
getConfigDayTrip(subConfig) {
var TrafficList = [];
var ScenicList = [];
var HotelList = [];
var DinnerList = [];
var FreedomList = [];
var WarmTipList = [];
var TitleList = [];
subConfig.DayList.forEach((item, dayIndex) => {
var rank = 1;
if (item.dayArray != null && item.dayArray.length > 0) {
item.dayArray.forEach(subItem => {
subItem.childItem.Rank = rank;
subItem.childItem.dayNum = item.dayNum;
subItem.Type = subItem.Type.toString();
switch (subItem.Type) {
case this.$tripUtils.TypeKey.traffic:
TrafficList.push(subItem.childItem);
break;
case this.$tripUtils.TypeKey.scenic:
ScenicList.push(subItem.childItem);
break;
case this.$tripUtils.TypeKey.hotel:
HotelList.push(subItem.childItem);
break;
case this.$tripUtils.TypeKey.dinner:
DinnerList.push(subItem.childItem);
break;
case this.$tripUtils.TypeKey.freedom:
FreedomList.push(subItem.childItem);
break;
case this.$tripUtils.TypeKey.warmtip:
WarmTipList.push(subItem.childItem);
break;
case this.$tripUtils.TypeKey.title:
TitleList.push(subItem.childItem);
break;
}
rank++;
});
}
});
var obj = {
DinnerList: DinnerList,
FreedomList: FreedomList,
HotelList: HotelList,
ScenicList: ScenicList,
TrafficList: TrafficList,
WarmTipList: WarmTipList,
TitleList: TitleList
};
return obj;
},
//复制信息
copyQuotationData() {
this.$refs.QuotationPrice.copyInfo();
},
getPostData() {
let configId = this.$route.query.configId;
if (configId > 0) {
let msg = { ID: configId };
this.apipost(
"travel_get_GetMyTravelInfo",
msg,
res => {
if (res.data.resultCode == 1) {
this.postData = res.data.data;
let postDaysTrip = this.getConfigDayTrip(this.postData);
this.postData.DinnerList = postDaysTrip.DinnerList;
this.postData.FreedomList = postDaysTrip.FreedomList;
this.postData.HotelList = postDaysTrip.HotelList;
this.postData.ScenicList = postDaysTrip.ScenicList;
this.postData.TrafficList = postDaysTrip.TrafficList;
this.postData.WarmTipList = postDaysTrip.WarmTipList;
this.postData.TitleList = postDaysTrip.TitleList;
if (this.postData.OfferList == null) {
this.postData.OfferList = [];
}
if (this.postData.IsDirect == 1) {
this.priceIsDirect = 2;
this.postData.PriceIsDirect = 2;
} else {
this.priceIsDirect = 1;
this.postData.PriceIsDirect = 1;
}
this.isShow = true;
} else {
this.Error(res.data.message);
}
},
err => {}
);
} else {
let params = { isNoOffer: false };
this.$router.push({ name: "quoTation", params: params });
}
}
},
created() {
this.getPostData();
},
components: {
DirectQuotation: DirectQuotation
}
};
</script>
......@@ -48,6 +48,7 @@
</li>
<li>
<button class="hollowFixedBtn" @click="getList(),resetPageIndex()">查询</button>
<button class="hollowFixedBtn" @click="goMakeQuo('MakeQuotation')">新增</button>
</li>
</ul>
</div>
......@@ -455,6 +456,15 @@
}
});
},
goMakeQuo(path) {
this.$router.push({
path: path,
query: {
blank:'y',
tab:'报价单'
}
});
},
goSubInfo(path, configId) {
this.$store.commit("pageConditionUpdate", this.queryData);
......
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