Commit 256fd9ff authored by zhengke's avatar zhengke

修改

parent 8376a94b
......@@ -8,14 +8,15 @@
<div>
<div class="singlePrice clearfix CP_Div">
<div class="CP_title">
{{lineName}}{{lineTeamName}}
<!-- {{lineName}}{{lineTeamName}} -->
123
</div>
<el-form>
<!-- <div class="QuotationFirstDiv">
<div class="QuotationFirstDiv">
<el-row :gutter="40">
<el-col :span="12">
<el-form-item label="线路">
<el-select v-model="subConfig.LineId" :placeholder="$t('pub.pleaseSel')" @change="getLineTeamList(subConfig.LineId)" filterable>
<el-select v-model="postConfig.LineId" :placeholder="$t('pub.pleaseSel')" @change="getLineTeamList(postConfig.LineId)" filterable>
<el-option :label="$t('pub.unlimitedSel')" :value='0'></el-option>
<el-option
v-for="item in LineList"
......@@ -28,7 +29,7 @@
</el-col>
<el-col :span="12">
<el-form-item label="系列">
<el-select v-model="subConfig.LineteamId" :placeholder="$t('pub.pleaseSel')" @change="getCountryId(subConfig.LineteamId)" filterable>
<el-select v-model="postConfig.LineteamId" :placeholder="$t('pub.pleaseSel')" @change="getCountryId(postConfig.LineteamId)" filterable>
<el-option :label="$t('pub.unlimitedSel')" :value='0'></el-option>
<el-option
v-for="item in LineTeamList"
......@@ -43,46 +44,67 @@
<el-row>
<el-col :span="24">
<el-form-item label="团队标题">
<el-input v-model="subConfig.Title" type="textarea" :autosize="{minRows: 1, maxRows: 2 }" resize="none" placeholder="请填写团队标题" maxlength="200"></el-input>
<el-input v-model="postConfig.Title" type="textarea" :autosize="{minRows: 1, maxRows: 2 }" resize="none" placeholder="请填写团队标题" maxlength="200"></el-input>
</el-form-item>
</el-col>
</el-row>
<div class="seat-box">
<div class="left">座位</div>
<div class="right">
<el-row :gutter="20">
<el-col :span="6">
<el-form-item prop="YSeat" >
<el-input placeholder="人数" v-model="subConfig.YSeat" maxlength="2" @keyup.native="checkInteger(subConfig,'YSeat'),calcTotalCount()">
<template slot="prepend">经济舱/上铺</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item prop="CSeat">
<el-input placeholder="人数" v-model="subConfig.CSeat" maxlength="2" @keyup.native="checkInteger(subConfig,'CSeat'),calcTotalCount()">
<template slot="prepend">商务舱/中铺</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item prop="FSeat">
<el-input placeholder="人数" v-model="subConfig.FSeat" maxlength="2" @keyup.native="checkInteger(subConfig,'FSeat'),calcTotalCount()">
<template slot="prepend">头等舱/下铺</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item>
<el-input placeholder="人数" v-model="subConfig.LowNum" maxlength="2" >
<template slot="prepend">最低成团人数</template>
</el-input>
</el-form-item>
</el-col>
<el-row :gutter="20">
<el-col :span="6">
<el-form-item prop="YSeat" >
<el-input placeholder="人数" v-model="postConfig.YSeat" maxlength="2" @keyup.native="checkInteger(postConfig,'YSeat'),calcTotalCount()">
<template slot="prepend">经济舱/上铺</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item prop="CSeat">
<el-input placeholder="人数" v-model="postConfig.CSeat" maxlength="2" @keyup.native="checkInteger(postConfig,'CSeat'),calcTotalCount()">
<template slot="prepend">商务舱/中铺</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item prop="FSeat">
<el-input placeholder="人数" v-model="postConfig.FSeat" maxlength="2" @keyup.native="checkInteger(postConfig,'FSeat'),calcTotalCount()">
<template slot="prepend">头等舱/下铺</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item>
<el-input placeholder="人数" v-model="postConfig.LowNum" maxlength="2" >
<template slot="prepend">最低成团人数</template>
</el-input>
</el-form-item>
</el-col>
</el-row>
</div>
</div>
</div> -->
<div class="seat-box">
<div class="left">行程天数</div>
<div class="right">
<el-row :gutter="20">
<el-col :span="6">
<el-form-item>
<el-input class="w120 LowNum" v-model="postConfig.DayNum" @keyup.native="checkInteger(postConfig,'DayNum');createLineTrip()">
<template slot="append"></template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item>
<el-input class="w120 LowNum" v-model="postConfig.NightNum" @keyup.native="checkInteger(postConfig,'NightNum')">
<template slot="append"></template>
</el-input>
</el-form-item>
</el-col>
</el-row>
</div>
</div>
</div>
<table class="CP_comTable">
<tr>
<td class="CP_comBack" width="170">币种</td>
......@@ -156,6 +178,7 @@
<table class="CostPriceTable">
<tr>
<th rowspan="2" width='100'>Day</th>
<th rowspan="2" width='100'>行程大点</th>
<th rowspan="2" width="200">币种</th>
<th rowspan="2" width='220'>酒店</th>
<th rowspan="2" width='200'></th>
......@@ -169,6 +192,9 @@
</tr>
<tr v-for="subItem in OfferCostPriceObj.CostLocalList" :key="subItem.subCode">
<td align="center">{{subItem.DayNum}}</td>
<td>
<el-input type="textarea" resize="none"></el-input>
</td>
<td>
<el-form-item>
<el-select v-model='subItem.CurrencyId'>
......@@ -490,7 +516,7 @@
</template>
<script>
export default {
props: ["OfferCostPrice", "lineName", "lineTeamName"],
props: ["postConfig","OfferCostPrice", "dayCostPrice"],
data() {
return {
checkedPei: [],
......@@ -834,6 +860,8 @@
});
this.shortPeopleNumber();
this.getSubtotalMoney();
console.log(this.OfferCostPriceObj,'offerobj');
},
//计算领队分摊
getLeaderShare() {
......
......@@ -106,13 +106,13 @@
</style>
<template>
<div v-if="isShow" class="DirectQuotation clearfix">
<el-form label-width="100px" :model="currentOffer" :rules="rules" ref="currentOfferFrom">
<div class="DirectQuotation clearfix">
<el-form label-width="100px" ref="currentOfferFrom">
<div class="switchDiv clearfix" style="width:98%;">
<div class="DirectPriceCenter">
<div class="singlePrice" style="margin-top:20px;">
<div class="singleDiv">
<span class="TMTitle"><i></i>{{currentOffer.OfferName}}</span>
<span class="TMTitle"><i></i>1111111</span>
<div class="DQ_rightDate">
<el-popover
popper-class="salsSetPrice"
......@@ -121,24 +121,23 @@
<div>
<div class="DQ_copyTopDiv">
<ul class="DQ_Ulist">
<li v-for="item in otherTeamInfo" :class="{'DQckedLi':item.IsCheck}" @click="getReference(item)"
:key="item.subCode">
<!-- <li v-for="item in otherTeamInfo" :class="{'DQckedLi':item.IsCheck}" :key="item.subCode">
{{item.title}}
</li>
</li> -->
</ul>
</div>
<div class="clearfix DQ_dateList">
<div class="DQ_left">
<el-form-item label="报价单选择" style="margin-left:-20px;">
<el-select class='w200' v-model="offerId">
<!-- <el-select class='w200' v-model="offerId">
<el-option v-for="item in otherTemObj" :label='item.value' :value='item.offerId'
:key='item.offerId'>
</el-option>
</el-select>
</el-select> -->
</el-form-item>
</div>
<div class="DQ_right DQ_Otcopy">
<input type="button" class="normalBtn" @click="copyDerect" value="复制"/>
<input type="button" class="normalBtn" value="复制"/>
</div>
</div>
</div>
......@@ -157,8 +156,8 @@
</div>
</div>
<div class="singlePrice clearfix">
<CostPrice ref="CostPrice" @headCallBack="setOfferCostPrice" :OfferCostPrice="currentOffer.OfferCostPrice"
:lineName="postData.LineName" :lineTeamName="postData.LtName"></CostPrice>
<CostPrice ref="CostPrice" @headCallBack="setOfferCostPrice" :postConfig="postConfig" :OfferCostPrice="otherPrice"
:dayCostPrice="dayCostPrice"></CostPrice>
</div>
</div>
<div class="DirectRightPrice" style="margin-left:20px;">
......@@ -168,14 +167,14 @@
<div>
<div class="Dleftname"></div>
<div class="DrightList">
<el-checkbox style="margin-left:25px;" v-model="currentOffer.QuotationPrice.IsSupportChildren"
:checked="currentOffer.QuotationPrice.IsSupportChildren===CheckedVaule"
<el-checkbox style="margin-left:25px;" v-model="teamPrice.IsSupportChildren"
:checked="teamPrice.IsSupportChildren===CheckedVaule"
:true-label="CheckedVaule" :false-label="UnCheckedVaule">不支持儿童出游
</el-checkbox>
<el-form-item label="成本人数" style="margin-left:70px;">
<el-select class='w120' v-model='currentOffer.QuotationPrice.PeopleNumber'>
<el-option :label="$t('pub.unlimitedSel')" :value='noLimit'></el-option>
<el-select class='w120' v-model='teamPrice.PeopleNumber'>
<el-option :label="$t('pub.unlimitedSel')" :value='0'></el-option>
<el-option v-for="item in currentOffer.OfferCostPrice.CostNumberList" :label='item.PeopleNumber'
:value='item.PeopleNumber' :key='item.PeopleNumber'>
</el-option>
......@@ -186,39 +185,39 @@
<div class="clearfix">
<div class="Dleftname">标准</div>
<div class="DrightList">
<el-form-item :prop="'QuotationPrice.B2BMemberPrice'" :rules="rules.B2BMemberPrice">
<el-input placeholder="" v-model="currentOffer.QuotationPrice.B2BMemberPrice"
@keyup.native="checkPrice(currentOffer.QuotationPrice,'B2BMemberPrice')" class="w200 ComSeat">
<el-form-item>
<el-input placeholder="" v-model="teamPrice.B2BMemberPrice"
@keyup.native="checkPrice(teamPrice,'B2BMemberPrice')" class="w200 ComSeat">
<template slot="prepend">同行会员</template>
</el-input>
</el-form-item>
<el-form-item :prop="'QuotationPrice.B2BPrice'" :rules="rules.B2BPrice">
<el-input placeholder="" v-model="currentOffer.QuotationPrice.B2BPrice"
@keyup.native="checkPrice(currentOffer.QuotationPrice,'B2BPrice')" class="w200 ComSeat">
<el-form-item>
<el-input placeholder="" v-model="teamPrice.B2BPrice"
@keyup.native="checkPrice(teamPrice,'B2BPrice')" class="w200 ComSeat">
<template slot="prepend">同行</template>
</el-input>
</el-form-item>
<el-form-item :prop="'QuotationPrice.B2CMemberPrice'" :rules="rules.B2CMemberPrice">
<el-input placeholder="" v-model="currentOffer.QuotationPrice.B2CMemberPrice"
@keyup.native="checkPrice(currentOffer.QuotationPrice,'B2CMemberPrice')" class="w200 ComSeat">
<el-form-item>
<el-input placeholder="" v-model="teamPrice.B2CMemberPrice"
@keyup.native="checkPrice(teamPrice,'B2CMemberPrice')" class="w200 ComSeat">
<template slot="prepend">直客会员</template>
</el-input>
</el-form-item>
<el-form-item :prop="'QuotationPrice.B2CPrice'" :rules="rules.B2CPrice">
<el-input placeholder="" v-model="currentOffer.QuotationPrice.B2CPrice"
@keyup.native="checkPrice(currentOffer.QuotationPrice,'B2CPrice')" class="w200 ComSeat">
<el-form-item>
<el-input placeholder="" v-model="teamPrice.B2CPrice"
@keyup.native="checkPrice(teamPrice,'B2CPrice')" class="w200 ComSeat">
<template slot="prepend">直客</template>
</el-input>
</el-form-item>
<el-form-item :prop="'QuotationPrice.BabyPrice'" :rules="rules.BabyPrice">
<el-input placeholder="" v-model="currentOffer.QuotationPrice.BabyPrice"
@keyup.native="checkInteger(currentOffer.QuotationPrice,'BabyPrice')" class="w200 ComSeat">
<el-form-item>
<el-input placeholder="" v-model="teamPrice.BabyPrice"
@keyup.native="checkInteger(teamPrice,'BabyPrice')" class="w200 ComSeat">
<template slot="prepend">婴儿</template>
</el-input>
</el-form-item>
<el-form-item :prop="'QuotationPrice.SingleDMCPrice'" :rules="rules.SingleDMCPrice">
<el-input placeholder="" v-model="currentOffer.QuotationPrice.SingleDMCPrice"
@keyup.native="checkPrice(currentOffer.QuotationPrice,'SingleDMCPrice')" class="w200 ComSeat">
<el-form-item>
<el-input placeholder="" v-model="teamPrice.SingleDMCPrice"
@keyup.native="checkPrice(teamPrice,'SingleDMCPrice')" class="w200 ComSeat">
<template slot="prepend">单地接</template>
</el-input>
</el-form-item>
......@@ -227,49 +226,49 @@
<div class="clearfix">
<div class="Dleftname">增收</div>
<div class="DrightList">
<el-form-item :prop="'QuotationPrice.ChildNeedPrice'" :rules="rules.ChildNeedPrice">
<el-input placeholder="" v-model="currentOffer.QuotationPrice.ChildNeedPrice"
@keyup.native="checkInteger(currentOffer.QuotationPrice,'ChildNeedPrice')"
<el-form-item>
<el-input placeholder="" v-model="teamPrice.ChildNeedPrice"
@keyup.native="checkInteger(teamPrice,'ChildNeedPrice')"
class="w200 ComSeat">
<template slot="prepend">儿童占床</template>
</el-input>
</el-form-item>
<el-form-item :prop="'QuotationPrice.BabyChargePrice'" :rules="rules.BabyChargePrice">
<el-input placeholder="" v-model="currentOffer.QuotationPrice.BabyChargePrice"
@keyup.native="checkPrice(currentOffer.QuotationPrice,'BabyChargePrice')"
<el-form-item>
<el-input placeholder="" v-model="teamPrice.BabyChargePrice"
@keyup.native="checkPrice(teamPrice,'BabyChargePrice')"
class="w200 ComSeat">
<template slot="prepend">儿童附加费</template>
</el-input>
</el-form-item>
<el-form-item :prop="'QuotationPrice.OldManChargePrice'" :rules="rules.OldManChargePrice">
<el-input placeholder="" v-model="currentOffer.QuotationPrice.OldManChargePrice"
@keyup.native="checkInteger(currentOffer.QuotationPrice,'OldManChargePrice')"
<el-form-item>
<el-input placeholder="" v-model="teamPrice.OldManChargePrice"
@keyup.native="checkInteger(teamPrice,'OldManChargePrice')"
class="w200 ComSeat">
<template slot="prepend">老人附加费</template>
</el-input>
</el-form-item>
<el-form-item :prop="'QuotationPrice.VisaPrice'" :rules="rules.VisaPrice">
<el-input placeholder="" v-model="currentOffer.QuotationPrice.VisaPrice"
@keyup.native="checkPrice(currentOffer.QuotationPrice,'VisaPrice')" class="w200 ComSeat">
<el-form-item>
<el-input placeholder="" v-model="teamPrice.VisaPrice"
@keyup.native="checkPrice(teamPrice,'VisaPrice')" class="w200 ComSeat">
<template slot="prepend">签证费</template>
</el-input>
</el-form-item>
<el-form-item :prop="'QuotationPrice.SingleRoomPrice'" :rules="rules.SingleRoomPrice">
<el-input placeholder="" v-model="currentOffer.QuotationPrice.SingleRoomPrice"
@keyup.native="checkPrice(currentOffer.QuotationPrice,'SingleRoomPrice')"
<el-form-item>
<el-input placeholder="" v-model="teamPrice.SingleRoomPrice"
@keyup.native="checkPrice(teamPrice,'SingleRoomPrice')"
class="w200 ComSeat">
<template slot="prepend">单房差</template>
</el-input>
</el-form-item>
<el-form-item :prop="'QuotationPrice.SafeMoney'" :rules="rules.SafeMoney">
<el-input placeholder="" v-model="currentOffer.QuotationPrice.SafeMoney"
@keyup.native="checkPrice(currentOffer.QuotationPrice,'SafeMoney')" class="w200 ComSeat">
<el-form-item>
<el-input placeholder="" v-model="teamPrice.SafeMoney"
@keyup.native="checkPrice(teamPrice,'SafeMoney')" class="w200 ComSeat">
<template slot="prepend">保险</template>
</el-input>
</el-form-item>
<el-form-item :prop="'QuotationPrice.OtherPrice'" :rules="rules.OtherPrice">
<el-input placeholder="" v-model="currentOffer.QuotationPrice.OtherPrice"
@keyup.native="checkPrice(currentOffer.QuotationPrice,'OtherPrice')" class="w200 ComSeat">
<el-form-item>
<el-input placeholder="" v-model="teamPrice.OtherPrice"
@keyup.native="checkPrice(teamPrice,'OtherPrice')" class="w200 ComSeat">
<template slot="prepend">杂费</template>
</el-input>
</el-form-item>
......@@ -278,44 +277,44 @@
<div class="clearfix">
<div class="Dleftname">减免</div>
<div class="DrightList">
<el-form-item :prop="'QuotationPrice.ChildNoNeedPrice'" :rules="rules.ChildNoNeedPrice">
<el-input placeholder="" v-model="currentOffer.QuotationPrice.ChildNoNeedPrice"
@keyup.native="checkInteger(currentOffer.QuotationPrice,'ChildNoNeedPrice')"
<el-form-item>
<el-input placeholder="" v-model="teamPrice.ChildNoNeedPrice"
@keyup.native="checkInteger(teamPrice,'ChildNoNeedPrice')"
class="w200 ComSeat">
<template slot="prepend">儿童不占床</template>
</el-input>
</el-form-item>
<el-form-item style="display:none;">
<el-input placeholder="" v-model="currentOffer.QuotationPrice.RebatePrice"
@keyup.native="checkPrice(currentOffer.QuotationPrice,'RebatePrice')" class="w200 ComSeat">
<el-input placeholder="" v-model="teamPrice.RebatePrice"
@keyup.native="checkPrice(teamPrice,'RebatePrice')" class="w200 ComSeat">
<template slot="prepend">同行返佣</template>
</el-input>
</el-form-item>
<el-form-item style="display:none;">
<el-input placeholder="" v-model="currentOffer.QuotationPrice.DiscountPrice"
@keyup.native="checkPrice(currentOffer.QuotationPrice,'DiscountPrice')" class="w200 ComSeat">
<el-input placeholder="" v-model="teamPrice.DiscountPrice"
@keyup.native="checkPrice(teamPrice,'DiscountPrice')" class="w200 ComSeat">
<template slot="prepend">早鸟优惠</template>
</el-input>
</el-form-item>
<el-form-item :prop="'QuotationPrice.BackVisaPrice'" :rules="rules.BackVisaPrice">
<el-input placeholder="" v-model="currentOffer.QuotationPrice.BackVisaPrice"
@keyup.native="checkPrice(currentOffer.QuotationPrice,'BackVisaPrice')"
<el-form-item>
<el-input placeholder="" v-model="teamPrice.BackVisaPrice"
@keyup.native="checkPrice(teamPrice,'BackVisaPrice')"
class="w200 ComSeat">
<template slot="prepend">退签证费</template>
</el-input>
</el-form-item>
<el-form-item :prop="'QuotationPrice.BackSafeMoney'" :rules="rules.BackSafeMoney" style="display:none">
<el-input placeholder="" v-model="currentOffer.QuotationPrice.BackSafeMoney"
@keyup.native="checkPrice(currentOffer.QuotationPrice,'BackSafeMoney')"
<el-form-item style="display:none">
<el-input placeholder="" v-model="teamPrice.BackSafeMoney"
@keyup.native="checkPrice(teamPrice,'BackSafeMoney')"
class="w200 ComSeat">
<template slot="prepend">退保险费</template>
</el-input>
</el-form-item>
</div>
</div>
<div class="DisDirUp">
<!-- <div class="DisDirUp">
<div class="dingjiaDiv">
<span class="TMTitle"><i></i>地接合同上传</span>
</div>
......@@ -338,28 +337,7 @@
</div>
</el-form-item>
</div>
</div>
<table class="CostPriceTable ScienTicket">
<tr>
<th width="400">景点名</th>
<th>门票名</th>
<th width="200">退款金额</th>
<th width="150">是否退款</th>
</tr>
<tr v-for="item in currentOffer.QuotationPrice.QuotationScenicList" :key="item.subCode">
<td>{{item.CouponsName}}</td>
<td>{{item.CouponsTicketName}}</td>
<td>
<el-form-item v-if="item.CanReundMoney==1">
<el-input type='text' v-model="item.RefundMoney"
@keyup.native="checkPrice(item,'RefundMoney')"></el-input>
</el-form-item>
</td>
<td>
<el-switch v-model="item.CanReundMoney" @change="resetRefundMoney(item)" :active-value="1" :inactive-value="0"></el-switch>
</td>
</tr>
</table>
</div> -->
</div>
</div>
</el-form>
......@@ -369,684 +347,17 @@
import CostPrice from "../TravelNewQuotation/CostNewPrice";
export default {
props: ["postConfig"],
props: ["postConfig","dayCostPrice","otherPrice","teamPrice"],
data() {
var FlightIdValidate = (rule, value, callback) => {
if (value === 0) {
callback(new Error("请选择机票"));
} else {
callback();
}
};
return {
noLimit: 0,
currentOffer: {},
postData: "",
isSubmit: true,
CheckedVaule: 2,
UnCheckedVaule: 1,
uploadList: [],
rules: {
//表单必填验证
B2BMemberPrice: [
{required: true, message: "请填写同业会员价", trigger: "blur"}
],
B2BPrice: [
{required: true, message: "请填写同业价", trigger: "blur"}
],
B2CMemberPrice: [
{required: true, message: "请填写直客会员价", trigger: "blur"}
],
B2CPrice: [
{required: true, message: "请填写直客价", trigger: "blur"}
],
ChildNeedPrice: [
{required: true, message: "请填写占床价", trigger: "blur"}
],
ChildNoNeedPrice: [
{required: true, message: "请填写儿童不占床数", trigger: "blur"}
],
BackVisaPrice: [
{required: true, message: "请填写退签证费", trigger: "blur"}
],
BabyPrice: [
{required: true, message: "请填写婴儿价", trigger: "blur"}
],
BabyChargePrice: [
{required: true, message: "请填写附加费", trigger: "blur"}
],
OldManChargePrice: [
{required: true, message: "请填写占床价", trigger: "blur"}
],
VisaPrice: [
{required: true, message: "请填写签证价", trigger: "blur"}
],
OtherPrice: [
{required: true, message: "请填写杂费", trigger: "blur"}
],
SingleRoomPrice: [
{required: true, message: "请填写单房差", trigger: "blur"}
],
SafeMoney: [
{required: true, message: "请填写保险费", trigger: "blur"}
],
// AirticketMoney: [
// {required: true, message: "请填写机票费", trigger: "blur"}
// ],
SingleDMCPrice: [
{required: true, message: "请填写地接价", trigger: "blur"}
]
// RebatePrice: [
// {required: true, message: "请填写同行返佣", trigger: "blur"}
// ],
// DiscountPrice: [
// {required: true, message: "请填写早鸟优惠", trigger: "blur"}
// ],
},
msg: {
QStartDate: "",
QEndDate: ""
},
QuotationList: [
{
label: "报价单",
Id: 1
},
{
label: "报价单",
Id: 1
}
],
//其他团期信息
otherTeamInfo: "",
otherTemObj: [],
configId: "",
offerId: "",
offerList: [],
isShow: false //数据初始化后再渲染页面
};
},
methods: {
//验证
submitForm(type) {
//提交创建、修改表单
this.modifyTeamValue();
let that = this;
let isSuccess = false;
that.$refs["currentOfferFrom"].validate(valid => {
if (valid) {
isSuccess = valid;
} else {
return false;
}
});
if (isSuccess) {
this.postData.OfferList.forEach(x => {
if (
x.StartDate == null ||
x.StartDate == "" ||
x.EndDate == null ||
x.EndDate == ""
) {
isSuccess = false;
this.Error("请完善【" + x.OfferName + "】日期范围信息");
return;
}
var result = this.validateTeamQuot(
x.OfferCostPrice,
x.QuotationPrice
);
if (result == -1) {
isSuccess = false;
this.Error("请选择【" + x.OfferName + "】的使用成本人数");
return;
} else if (result == 0) {
isSuccess = false;
this.Error("请完善【" + x.OfferName + "】的报价信息");
return;
}
// else if (result == 2) {
// isSuccess = false;
// this.Info(
// "报价单【" +
// x.OfferNumber +
// "】的同业会员价、同业价、直客会员价、直客价不能小于成本价!"
// );
// return;
// }
});
}
if (isSuccess && this.isSubmit) {
this.isSubmit = false;
this.$parent.updateSubmitState(this.isSubmit);
this.doSubmitConfig(type);
}
},
//验证团期定价
validateTeamQuot(offerCostPrice, quotationPrice) {
if (!(quotationPrice.PeopleNumber > 0)) {
return -1; //没有选择成本人数
}
// this.$commonUtils.isNullOrEmpty(quotationPrice.RebatePrice) ||
// this.$commonUtils.isNullOrEmpty(quotationPrice.AirticketMoney) ||
// this.$commonUtils.isNullOrEmpty(quotationPrice.DiscountPrice) ||
// this.$commonUtils.isNullOrEmpty(quotationPrice.BackSafeMoney)
if (
this.$commonUtils.isNullOrEmpty(quotationPrice.B2BMemberPrice) ||
this.$commonUtils.isNullOrEmpty(quotationPrice.B2BPrice) ||
this.$commonUtils.isNullOrEmpty(quotationPrice.B2CMemberPrice) ||
this.$commonUtils.isNullOrEmpty(quotationPrice.B2CPrice) ||
this.$commonUtils.isNullOrEmpty(quotationPrice.BabyChargePrice) ||
this.$commonUtils.isNullOrEmpty(quotationPrice.BabyPrice) ||
this.$commonUtils.isNullOrEmpty(quotationPrice.ChildNeedPrice) ||
this.$commonUtils.isNullOrEmpty(quotationPrice.ChildNoNeedPrice) ||
this.$commonUtils.isNullOrEmpty(quotationPrice.OldManChargePrice) ||
this.$commonUtils.isNullOrEmpty(quotationPrice.OtherPrice) ||
this.$commonUtils.isNullOrEmpty(quotationPrice.SafeMoney) ||
this.$commonUtils.isNullOrEmpty(quotationPrice.SingleRoomPrice) ||
this.$commonUtils.isNullOrEmpty(quotationPrice.SingleDMCPrice) ||
this.$commonUtils.isNullOrEmpty(quotationPrice.PeopleNumber) ||
this.$commonUtils.isNullOrEmpty(quotationPrice.VisaPrice) ||
this.$commonUtils.isNullOrEmpty(quotationPrice.BackVisaPrice)
) {
return 0;
} else {
var flag = 1;
//验证价格不能小于成本价
offerCostPrice.CostNumberList.forEach(item => {
if (flag == 1 && quotationPrice.PeopleNumber === item.PeopleNumber) {
if (
quotationPrice.B2BMemberPrice <
this.$commonUtils.getConvertMoney(item.TotalMoney) ||
quotationPrice.B2BPrice <
this.$commonUtils.getConvertMoney(item.TotalMoney) ||
quotationPrice.B2CMemberPrice <
this.$commonUtils.getConvertMoney(item.TotalMoney) ||
quotationPrice.B2CPrice <
this.$commonUtils.getConvertMoney(item.TotalMoney)
) {
flag = 2;
}
}
});
return flag;
}
},
modifyChangeValue(postDataTemp) {
postDataTemp.OfferList.forEach(x => {
if (x.OfferNumber == this.currentOffer.OfferNumber) {
x.OfferId = this.currentOffer.OfferId;
x.ConfigID = this.currentOffer.ConfigID;
x.StartDate = this.currentOffer.StartDate;
x.EndDate = this.currentOffer.EndDate;
x.OfferCostPrice = JSON.parse(
JSON.stringify(this.currentOffer.OfferCostPrice)
);
x.QuotationPrice = JSON.parse(
JSON.stringify(this.currentOffer.QuotationPrice)
);
let contractUrl = [];
this.uploadList.forEach(y => {
let urlInfo = {Name: y.Name, Url: y.Url};
contractUrl.push(urlInfo);
});
x.QuotationPrice.ContractUrl = JSON.stringify(contractUrl);
x.QuotationPrice.ContractArray = JSON.parse(
JSON.stringify(this.uploadList)
);
}
});
},
modifyTeamValue() {
let postDataTemp = JSON.parse(JSON.stringify(this.postData));
//修改已变动的数据
this.modifyChangeValue(postDataTemp);
this.postData = postDataTemp;
},
doSubmitConfig(travelState) {
this.postData.TravelState = travelState;
this.isSubmit = true;
let comitData = {
ID: this.postData.ID,
OfferList: this.postData.OfferList,
TravelState: this.postData.TravelState,
RemoveChild: this.postData.RemoveChild
};
this.apipost(
"travel_post_SetConfigOfferInfo",
comitData,
res => {
if (res.data.resultCode == 1) {
this.$router.push({path: "quoTation"});
this.isSubmit = true;
this.$parent.updateSubmitState(this.isSubmit);
} else if(res.data.resultCode == 10009){
//表单重复提交不处理
}
else{
this.isSubmit = true;
this.$parent.updateSubmitState(this.isSubmit);
this.Error(res.data.message);
}
},
err => {
}
);
},
firstLoad() {
this.postData.OfferList.forEach((x, index) => {
if (index == 0) {
x.IsCheck = true;
this.currentOffer = JSON.parse(
JSON.stringify(this.postData.OfferList[index])
);
if (
this.currentOffer.QuotationPrice.ContractArray != undefined &&
this.currentOffer.QuotationPrice.ContractArray != null
) {
this.uploadList = this.currentOffer.QuotationPrice.ContractArray;
}
this.initCostLocalHotelSelect(
this.currentOffer.OfferCostPrice,
this.postData
);
} else {
x.IsCheck = false;
}
if (x.QuotationPrice.B2BMemberPrice == null) {
x.QuotationPrice.B2BMemberPrice = "";
}
});
this.isShow = true;
},
setOfferCostPrice(returnValue) {
let offerCostPrice = JSON.parse(JSON.stringify(returnValue));
let currencyNumberList = [];
offerCostPrice.CurrencyNumberListExt.forEach(x => {
if (x.currencyNumberList.length > 0) {
x.currencyNumberList.forEach(y => {
currencyNumberList.push(y);
});
}
});
offerCostPrice.CurrencyNumberList = currencyNumberList;
this.currentOffer.OfferCostPrice = offerCostPrice;
},
uploadFileBtn(file) {
//上传
if (file.file.size > 1024 * 1024 * 100) {
this.$message.warning("文件大小不能超过100M!");
return;
}
let newArr = [];
newArr.push(file.file);
let path = "/Upload/DMC/";
this.$message.info("上传中...");
this.UploadSelfFileT(path, newArr, x => {
let fileSize =
file.file.size < 1024
? file.file.size
: (file.file.size / 1024).toFixed(0);
this.saveMsg = [];
this.saveMsg.push({
Path: x.data.FilePath,
FileName: file.file.name,
MD5Sign: file.file.uid,
FileSize: fileSize
});
this.uploadList.push({
Url: this.domainManager().ViittoFileUrl + x.data.FilePath,
Name: file.file.name
});
});
},
downloadOne(obj) {
var Url = obj.Url;
let reg = /^http(s)?:\/\/(.*?)\//;
this.downloadFileRename(Url.replace(reg, ""), obj.Name);
},
deleteFile(obj) {
if (this.uploadList.findIndex(item => item.Url === obj.Url) != -1) {
this.uploadList.splice(
this.uploadList.findIndex(item => item.Url === obj.Url),
1
);
}
},
//初始化地接数据
initCostLocalHotelSelect(OfferCostPrice, postData) {
let newCostLocalList = [];
for (let i = 1; i <= postData.DayNum; i++) {
OfferCostPrice.CostLocalList.forEach(x => {
if (x.DayNum === i) {
let newCostLocal = JSON.parse(JSON.stringify(x));
let hotelArr = [];
let hotelNameArr = [];
postData.HotelList.forEach(y => {
if (newCostLocal.DayNum === y.DayNum) {
let hotel = {HotelId: y.HotelId, HotelName: y.HotelName};
hotelArr.push(hotel);
hotelNameArr.push(y.HotelName);
}
});
newCostLocal.HotelArr = hotelArr;
if (hotelNameArr.length > 0) {
newCostLocal.HotelName = hotelNameArr.join(",");
}
let TicketNameArr = [];
postData.ScenicList.forEach(y => {
if (y.DayNum === i) {
TicketNameArr.push(y.CouponsName);
}
});
if (TicketNameArr.length > 0) {
newCostLocal.TicketName = TicketNameArr.join(",");
}
newCostLocalList.push(newCostLocal);
}
});
}
OfferCostPrice.CostLocalList = newCostLocalList;
},
//获取成本价对象
getCostPrice(postData) {
let costLocalArr = [];
for (let i = 1; i <= postData.DayNum; i++) {
let costLocal = this.$tripUtils.CostLocal();
costLocal.DayNum = i;
postData.HotelList.forEach(x => {
if (x.DayNum === i) {
costLocal.HotelNameArr.push(x.HotelName);
// costLocal.HotelMoney += x.HotelProductPrice;
}
});
if (costLocal.HotelNameArr.length > 0) {
costLocal.HotelName = costLocal.HotelNameArr.join(",");
}
postData.TrafficList.forEach(x => {
if (x.DayNum === i) {
costLocal.CarMoney += x.TrafficePrice;
}
});
postData.ScenicList.forEach(x => {
if (x.DayNum === i) {
costLocal.TicketNameArr.push(x.CouponsName);
costLocal.TicketMoney += x.CouponsTicketPrice;
}
});
if (costLocal.TicketNameArr.length > 0) {
costLocal.TicketName = costLocal.TicketNameArr.join(",");
}
let morningFood = {foodType: 1, money: 0.0};
let noonFood = {foodType: 2, money: 0.0};
let nightFood = {foodType: 3, money: 0.0};
postData.DinnerList.forEach(x => {
if (x.DayNum === i) {
if (x.UseDinnerType == "1") {
morningFood = {foodType: 1, money: x.DiningPrice};
} else if (x.UseDinnerType == "2") {
noonFood = {foodType: 2, money: x.DiningPrice};
} else if (x.UseDinnerType == "3") {
nightFood = {foodType: 3, money: x.DiningPrice};
}
}
});
costLocal.FoodItem.push(morningFood);
costLocal.FoodItem.push(noonFood);
costLocal.FoodItem.push(nightFood);
costLocalArr.push(costLocal);
}
let offerCostPrice = this.$tripUtils.OfferCostPrice();
offerCostPrice.CostLocalList = costLocalArr;
return offerCostPrice;
},
//获取报价对象
getQuotationPrice(postData) {
let quotationPrice = this.$tripUtils.QuotationPrice();
let quotationScenicArr = [];
postData.ScenicList.forEach(y => {
let quotationScenic = this.$tripUtils.QuotationScenic();
quotationScenic.CouponsId = y.CouponsId;
quotationScenic.CouponsTicketId = y.CouponsTicketId;
quotationScenic.CouponsName = y.CouponsName;
quotationScenic.CouponsTicketName = y.CouponsTicketName;
if (quotationScenic.CouponsTicketId > 0 || (quotationScenic.CouponsTicketId === 0 && quotationScenic.CouponsTicketName.length > 0)) {
quotationScenicArr.push(quotationScenic);
};
});
quotationPrice.QuotationScenicList = quotationScenicArr;
return quotationPrice;
},
//组装报价景点数据
decorationQuotationScenic(postData) {
let isDirect = postData.IsDirect;
postData.OfferList.forEach((x, index) => {
x.OfferNumber = index + 1; //报价单重新排序
if (x.QuotationPrice != null) {
let quotationScenicArr = [];
postData.ScenicList.forEach(y => {
let scenic = "";
if (
x.QuotationPrice != null &&
x.QuotationPrice.QuotationScenicList != null &&
x.QuotationPrice.QuotationScenicList.length > 0
) {
x.QuotationPrice.QuotationScenicList.forEach(z => {
if (scenic === "") {
if (isDirect === 1) {
if (
z.CouponsId == y.CouponsId &&
z.CouponsTicketId == y.CouponsTicketId
) {
let quotationScenic = this.$tripUtils.QuotationScenic();
quotationScenic.CouponsId = z.CouponsId;
quotationScenic.CouponsTicketId = z.CouponsTicketId;
quotationScenic.CouponsName = z.CouponsName;
quotationScenic.CouponsTicketName = z.CouponsTicketName;
quotationScenic.RefundMoney = z.RefundMoney;
quotationScenic.CanReundMoney = z.CanReundMoney;
scenic = quotationScenic;
}
} else {
if (
this.$commonUtils
.getStrValue(z.CouponsName)
.indexOf(
this.$commonUtils.getStrValue(y.CouponsName)
) != -1 &&
this.$commonUtils
.getStrValue(z.CouponsTicketName)
.indexOf(
this.$commonUtils.getStrValue(y.CouponsTicketName)
) != -1
) {
let quotationScenic = this.$tripUtils.QuotationScenic();
quotationScenic.CouponsId = z.CouponsId;
quotationScenic.CouponsTicketId = z.CouponsTicketId;
quotationScenic.CouponsName = z.CouponsName;
quotationScenic.CouponsTicketName = z.CouponsTicketName;
quotationScenic.RefundMoney = z.RefundMoney;
quotationScenic.CanReundMoney = z.CanReundMoney;
scenic = quotationScenic;
}
}
}
});
if (scenic === "") {
let quotationScenic = this.$tripUtils.QuotationScenic();
quotationScenic.CouponsId = y.CouponsId;
quotationScenic.CouponsTicketId = y.CouponsTicketId;
quotationScenic.CouponsName = y.CouponsName;
quotationScenic.CouponsTicketName = y.CouponsTicketName;
scenic = quotationScenic;
}
} else {
let quotationScenic = this.$tripUtils.QuotationScenic();
quotationScenic.CouponsId = y.CouponsId;
quotationScenic.CouponsTicketId = y.CouponsTicketId;
quotationScenic.CouponsName = y.CouponsName;
quotationScenic.CouponsTicketName = y.CouponsTicketName;
scenic = quotationScenic;
}
if (scenic.CouponsTicketId > 0 || (scenic.CouponsTicketId === 0 && scenic.CouponsTicketName.length > 0)) {
quotationScenicArr.push(scenic);
};
});
x.QuotationPrice.QuotationScenicList = quotationScenicArr;
}
});
},
//报价单数据初始化
intiOfficeList(postData) {
this.postData = postData;
this.postData.OfferList.forEach(offer => {
offer.isShow = false;
});
if (this.postData.OfferList.length == 0) {
this.offerListAppend();
} else {
this.decorationQuotationScenic(this.postData);
}
this.firstLoad();
},
//添加报价单
offerListAppend() {
let maxOfferNumber = 0;
this.postData.OfferList.forEach(x => {
if (x.OfferNumber > maxOfferNumber) {
maxOfferNumber = x.OfferNumber;
}
x.isShow = false;
});
let offer = this.$tripUtils.OfferObj();
offer.OfferNumber = maxOfferNumber + 1;
offer.OfferName = "报价单" + (maxOfferNumber + 1);
offer.OfferCostPrice = this.getCostPrice(this.postData);
offer.QuotationPrice = this.getQuotationPrice(this.postData);
this.postData.OfferList.push(offer);
this.postData = JSON.parse(JSON.stringify(this.postData));
},
//复制报价单信息
copyInfo() {
var copyObj = {};
this.postData.OfferList.forEach(x => {
if (x.IsCheck) {
copyObj.ConfigID = x.ConfigID;
copyObj.EndDate = "";
copyObj.IsCheck = false;
copyObj.OfferCostPrice = x.OfferCostPrice;
copyObj.OfferCostPrice.CostId = 0;
copyObj.OfferCostPrice.ConfigID = 0;
copyObj.OfferCostPrice.OfferId = 0;
copyObj.OfferId = 0;
copyObj.OfferNumber = this.postData.OfferList.length + 1;
copyObj.QuotationPrice = x.QuotationPrice;
copyObj.QuotationPrice.QuotationId = 0;
copyObj.QuotationPrice.OfferId = 0;
copyObj.QuotationPrice.ConfigID = 0;
copyObj.StartDate = "";
}
});
this.postData.OfferList.push(copyObj);
},
//点击标题
getReference(item) {
this.otherTeamInfo.forEach(x => {
x.IsCheck = false;
});
item.IsCheck = !item.IsCheck;
if (item.configId != this.configId) {
this.configId = item.configId;
this.offerList = [];
}
this.otherTemObj = [];
item.offerList.forEach(x => {
var obj = {};
obj.configId = item.configId;
obj.offerId = x.offerId;
obj.value = x.startDate + "至" + x.endDate;
this.otherTemObj.push(obj);
});
},
//复制其他团期信息
copyDerect() {
if (this.offerList.length > 0) {
this.copyOffer();
} else {
let msg = {
configId: this.configId
};
this.apipost(
"travel_get_GetTravelOfferInfo",
msg,
res => {
if (res.data.resultCode == 1) {
this.offerList = res.data.data;
this.copyOffer();
}
},
err => {
}
);
}
},
//选择是否退款重置金额
resetRefundMoney(item){
if(item.CanReundMoney==0){
item.RefundMoney = 0;
}
},
//复制信息
copyOffer() {
//let firstPrice = JSON.parse(JSON.stringify(this.postData.OfferList[0]));
this.offerList.forEach(x => {
if (x.OfferId === this.offerId) {
let offer = JSON.parse(JSON.stringify(x));
offer.ConfigID = 0;
offer.configID = 0;
offer.OfferId = 0;
offer.StartDate = "";
offer.EndDate = "";
offer.OfferNumber = this.postData.OfferList.length + 1;
offer.IsCheck = false;
offer.OfferCostPrice.ConfigID = 0;
offer.OfferCostPrice.CostId = 0;
offer.OfferCostPrice.OfferId = 0;
offer.OfferCostPrice.LocalProject="";
offer.OfferCostPrice.CostLocalList =this.getCostPrice(this.postData).CostLocalList;
offer.QuotationPrice.ConfigId = 0;
offer.QuotationPrice.OfferId = 0;
offer.QuotationPrice.QuotationId = 0;
offer.QuotationPrice.QuotationScenicList =this.getQuotationPrice(this.postData).QuotationScenicList;
this.postData.OfferList.push(offer);
}
});
}
},
created() {
this.intiOfficeList(this.postConfig);
},
filters: {
dateFormate(date) {
let dateStr = date.split("-");
return dateStr[1] + "月" + dateStr[2] + "日";
},
offerName(offerNumber) {
return "报价单" + offerNumber;
}
},
watch: {
"postData.OfferList": {
handler: function (val, oldVal) {
val.forEach(x => {
if (x.OfferNumber === this.currentOffer.OfferNumber) {
this.currentOffer.OfferName = x.OfferName;
}
});
},
deep: true
}
},
components: {
CostPrice: CostPrice
......
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