Commit 853a810c authored by 华国豪's avatar 华国豪 🙄

解决冲突

parents 9977e6e4 9b7429de
<style>
.BusedHeight {
display: block !important;
height: 450px;
}
.FinaceItem span{
display: inline-block;
color:#3980C8;
margin-right:10px;
padding-right: 10px;
border-right:1px solid #d1d1d1;
}
.FinaceItem span:last-child{
border:0;
}
.BusApportionManagement ._bus_edit {
overflow: auto;
display: none;
position: absolute;
font-family: "PingFangSc-Fine";
bottom: 0;
left: 0;
border-top: 3px solid #38425d;
background-color: #ffffff;
padding: 10px;
width: 100%;
}
.teamNumCon{
width:100%;
min-height:50px;
margin:0 110px;
}
.teamNumList{
display:inline-block;
padding:3px 8px;
border-radius:4px;
font-size:12px;
background-color: #EEEEEE;
position: relative;
margin-right:20px;
}
.teamNumList i{
color:#C5C5C5;
position: absolute;
right:-10px;
top:-10px;
}
.teamNumList i:hover{
color:#CD2929;
cursor: pointer;
}
.exportCompany{
width:450px;
}
.BusApportionManagement ._addUpload_box{
display: block;
margin-top: 15px;
}
.BusApportionManagement ._addUpload_box img{
width: 100%;
}
.BusApportionManagement ._addUpload_box>div{
float: left;
width:138px;
height:92px;
border:1px dashed rgba(210,210,210,1);
border-radius:2px;
cursor: pointer;
padding: 5px;
margin-right: 10px;
position: relative;
}
.BusApportionManagement ._addUpload_box>div:hover{
background-color: #f5f5f5;
}
.BusApportionManagement ._addFile_name{
padding-left: 15px;
max-width: 450px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.BusApportionManagement ._addUpload_box .icon-guanbi1 {
font-size: 12px;
color: white;
display: inline-block;
margin-left: 15px;
position: absolute;
right: -6px;
top: -9px;
background-color: #f56c6c;
border-radius: 50%;
height: 20px;
width: 20px;
text-align: center;
line-height: 20px;
}
.BusApportionManagement ._addUpload_box .icon-guanbi1:hover {
font-size: 12px;
color: #c94052;
}
.BusApportionManagement ._addUpload_box .icon-excel,._addUpload_box .icon-pdf{
text-align: center;
font-size: 38px;
color: green;
line-height: 75px;
}
.BusApportionManagement .el-upload-dragger{
width:126px!important;
height:80px!important;
}
.BusApportionManagement ._show_img_box{
position: fixed;
background: rgba(0,0,0,.6);
left: 0;
top: 0;
width: 100%;
height: 100%;
z-index: 999;
text-align: center;
}
</style>
<template>
<div class="flexOne BusApportionManagement">
<div class="query-box">
<ul>
<li>
<input type="button" class="normalBtn" @click="outerVisible=true" value="车资导出"/>
<input type="button" class="normalBtn" @click="getInfo()" value="新增"/>
</li>
</ul>
</div>
<v-table
v-if="isReady"
is-horizontal-resize
column-width-drag
style="width:100%"
:columns="columns"
:table-data="dataList"
:filter-method="filterMethod"
:total="total"
:pageSize="msg.pageSize"
:pageIndex="msg.pageIndex"
:handleCurrentChange="handleCurrentChanges"
:multiple-sort="multipleSort"
:is-loading="loading"
sort-always
@sort-change="sortChange"
@on-custom-comp='customCompFunc'
></v-table>
<div class="_bus_edit _scrollbar" v-if="addShow" :class="addShow==true?'BusedHeight':''">
<el-row>
<el-col :span="20">
<p class="_tit">添加分摊</p>
</el-col>
<el-col :span="4" class="_add_saveBtn">
<button
type="button"
class="normalBtn"
@click="submitForm('addMsg',1)"
>{{$t('pub.saveBtn')}}</button>
<button
class="hollowFixedBtn"
type="button"
@click="resetForm('addMsg'),addShow=false"
>{{$t('pub.cancelBtn')}}</button>
</el-col>
</el-row>
<el-form
class="_info_box clearfix"
:model="addMsg"
ref="addMsg"
:rules="rules"
label-width="110px"
>
<el-row>
<el-col :span="4" :gutter="35">
<el-form-item label="费用类型">
<el-select v-model="isCked" disabled>
<el-option label="车资" value=1></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="4" :gutter="35">
<el-form-item label="单据类型">
<el-select v-model="isCked" disabled>
<el-option label="参团" value=1></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="4" :gutter="35">
<el-form-item label="供应商">
<el-select v-model="suppierCked" disabled>
<el-option v-for='item in ClientTypeList'
:label='item.Name'
:value='item.ID'
:key='item.ID'>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="4" :gutter="35">
<el-form-item label="客户名称">
<el-select filterable v-model='customId' placeholder="客户名称" @change="GetClientAccountList(customId)" class="w200 _border_b_1">
<el-option :value="0" label="不限"></el-option>
<el-option v-for='item in ClientAccountList'
:label='item.Name'
:value='item.ID'
:key='item.ID'>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="4" :gutter="35">
<el-form-item label="付款账户">
<el-select filterable v-model='addMsg.ClientID' placeholder="请选择付款账户" class="w200 _border_b_1">
<el-option :value="0" label="不限"></el-option>
<el-option v-for='item in ClientAccountListS'
:label='item.allName'
:value='item.ID'
:key='item.ID'>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" :gutter="35">
<el-form-item label="车配号">
<el-date-picker class="w200"
v-model="Year"
type="year"
placeholder="选择年">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="4" :gutter="35">
<el-form-item prop="CarNum">
<el-input v-model="addMsg.CarNum" maxlength="20"></el-input>
</el-form-item>
</el-col>
<el-col :span="4" :gutter="35">
<button type="button" class="normalBtn" style="margin:5px 0 0 50px;" @click="getTeamInfo">筛选团队</button>
</el-col>
</el-row>
<el-row>
<el-col :span="4" :gutter="35">
<el-form-item label="金额" prop="f_UnitPrice">
<el-input v-model="addMsg.f_UnitPrice" placeholder="请输入" @keyup.native="checkPrice(addMsg,'f_UnitPrice'),getTotalMoney()" maxlength="20"></el-input>
</el-form-item>
</el-col>
<el-col :span="4" :gutter="35">
<el-form-item label="汇率">
<el-input v-model="addMsg.f_rate" placeholder="请输入" @keyup.native="checkRate(addMsg,'f_rate')" maxlength="20" class="w90"></el-input>
<el-input disabled class="w100" v-model="TotalMoney"></el-input>
</el-form-item>
</el-col>
<el-col :span="4" :gutter="35">
<el-form-item label="币种">
<el-select filterable v-model='addMsg.f_currency' placeholder="请选择币种" @change="getRate(addMsg.f_currency)" class=" _border_b_1">
<!-- <el-option :value="0" label="不限"></el-option> -->
<el-option v-for='item in coinGetList'
:label='item.Name'
:value='item.ID'
:key='item.ID'>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="4" :gutter="35">
<el-form-item label="总价">
<el-input disabled v-model="TotalMoney"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" :gutter="35">
<el-form-item label="数量" prop="CarNumber">
<el-input v-model="addMsg.CarNumber" placeholder="请输入" @keyup.native="checkInteger(addMsg,'CarNumber'),getSingelePrice()" maxlength="20"></el-input>
</el-form-item>
</el-col>
<el-col :span="4" :gutter="35">
<el-form-item label="单价">
<el-input v-model="addMsg.CarUnitPrice" disabled></el-input>
</el-form-item>
</el-col>
<el-col :span="4" :gutter="35">
<el-form-item label="接机">
<el-input v-model="addMsg.JJPrice" @keyup.native="checkInteger(addMsg,'JJPrice'),getSingelePrice()" placeholder="请输入"></el-input>
</el-form-item>
</el-col>
<el-col :span="4" :gutter="35">
<el-form-item label="回送">
<el-input v-model="addMsg.HSPrice" placeholder="请输入" @keyup.native="checkInteger(addMsg,'HSPrice'),getSingelePrice()"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" :gutter="35">
<el-form-item label="送机">
<el-input v-model="addMsg.SJPrice" placeholder="请输入" @keyup.native="checkInteger(addMsg,'SJPrice'),getSingelePrice()"></el-input>
</el-form-item>
</el-col>
<el-col :span="4" :gutter="35">
<el-form-item label="转机">
<el-input v-model="addMsg.ZJiPrice" placeholder="请输入" @keyup.native="checkInteger(addMsg,'ZJiPrice'),getSingelePrice()"></el-input>
</el-form-item>
</el-col>
<el-col :span="4" :gutter="35">
<el-form-item label="追加">
<el-input v-model="addMsg.ZJPrice" placeholder="请输入" @keyup.native="checkInteger(addMsg,'ZJPrice'),getSingelePrice()"></el-input>
</el-form-item>
</el-col>
<el-col :span="4" :gutter="35">
<el-form-item label="到期结算日" prop="PayDate">
<el-date-picker type="date" class="w200" v-model="addMsg.PayDate" value-format="yyyy-MM-dd"></el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" :gutter="35">
<el-form-item label="团队编号">
<el-input placeholder="请输入" v-model="TCIDS"></el-input>
</el-form-item>
</el-col>
<el-col :span="4" :gutter="35">
<button type="button" class="normalBtn" style="margin:5px 0 0 60px;" @click="checkIsUse">添加团号</button>
</el-col>
<el-col :span="12" :gutter="35">
<el-form-item label="上传凭证">
<div class="_addUpload_box clearfix" >
<template v-for="(file,fIndex) in saveMsg">
<div v-if="file.Type==3">
<div style="width:100%;height:100%;overflow: hidden;">
<img :src="file.Url?file.Url:file.Content" @click="showUpLoadFile(file)">
</div>
<span class="iconfont icon-guanbi1" @click="deleteUploadFile(fIndex)"></span>
</div>
<div v-if="file.Type==1">
<div class="iconfont " :class="file.Content.substring(file.Content.lastIndexOf('.')+1,file.Content.length).toUpperCase()=='PDF'? 'icon-pdf' : 'icon-excel'" @click="showUpLoadFile(file)">
</div>
<span class="iconfont icon-guanbi1" @click="deleteUploadFile(fIndex)"></span>
</div>
<div v-if="file.Type==2">
<div class="iconfont icon-excel" @click="showUpLoadFile(file)">
</div>
<span class="iconfont icon-guanbi1" @click="deleteUploadFile(fIndex)"></span>
</div>
</template>
<div class="_pic_upload">
<el-upload
drag
:http-request="uploadFileBtn"
:multiple="true" :show-file-list="false" action="">
<i class="el-icon-plus avatar-uploader-icon"></i>
<div class="el-upload__text">点击/拖拽上传</div>
</el-upload>
</div>
</div>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="20" :gutter="35">
<div class="teamNumCon">
<span class="teamNumList" v-for="(item,index) in allTeamList">{{item.TCID}} <i @click="removeTeam(index)" class="iconfont icon-quxiao"></i></span>
</div>
</el-col>
</el-row>
</el-form>
</div>
<el-dialog custom-class='exportCompany' title="选择信息" :visible.sync="outerVisible" center>
<el-form label-width="100px">
<el-form-item label="导出月份">
<el-date-picker
v-model="exportInfo.DCDate"
type="month"
value-format="yyyy-MM"
placeholder="选择月">
</el-date-picker>
</el-form-item>
<el-form-item label="制单日期">
<el-date-picker type="date" v-model="exportInfo.StartGroupDate"
:picker-options="pickerBeginDateBefore"
value-format="yyyy-MM-dd" placeholder></el-date-picker>
<el-date-picker type="date" v-model="exportInfo.EndGroupDate"
:picker-options="pickerBeginDateAfter"
value-format="yyyy-MM-dd" placeholder></el-date-picker>
</el-form-item>
<el-form-item label="币种" class='multiple_input countryList'>
<el-select filterable v-model='exportInfo.CurrType' placeholder="请选择币种" class=" _border_b_1">
<el-option v-for='item in coinGetList'
:label='item.Name'
:value='item.ID'
:key='item.ID'>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="客户名称" class='multiple_input countryList'>
<el-select filterable v-model='exportInfo.ClientId' placeholder="请选择客户名称" class="w200 _border_b_1">
<el-option :value="0" label="不限"></el-option>
<el-option v-for='item in ClientAccountList'
:label='item.Name'
:value='item.ID'
:key='item.ID'>
</el-option>
</el-select>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<button class="normalBtn" type="primary" @click="goToExport('BusExport')">{{$t('pub.saveBtn')}}</button> &nbsp;
<button class="hollowFixedBtn" @click="outerVisible = false,clearDialog()">{{$t('pub.cancelBtn')}}</button>
</div>
</el-dialog>
<div v-if='picIsShow' class="_show_img_box" @click="picIsShow=false,picObj=[]">
<div style="position: absolute; width: 800px; height: 600px; left: 50%; top: 50%; margin-left: -400px; margin-top: -300px;">
<el-carousel :initial-index=initialIndex height="600px" :interval="5000" trigger="click">
<el-carousel-item style="height: 600px;overflow:auto;" v-for="(item,index) in picObj" :key="index">
<img :src="item" style=""/>
</el-carousel-item>
</el-carousel>
</div>
</div>
</div>
</template>
<script>
import Vue from 'vue'
export default {
data(){
return {
columns: [],
remoteLoading:false,
total: 0,
isReady: false,
multipleSort: false,
loading: true,
outerVisible:false,
msg: {
pageSize:15,
pageIndex:1,
CarDistribution:'',
StartTime:'',
EndTime:''
},
addMsg:{
TCIDStr:'',
CarNum:'',
f_UnitPrice:'',
CarNumber:'',
CarUnitPrice:'',
JJPrice:'',
HSPrice:'',
ZJPrice:'',
SJPrice:'',
ZJiPrice:'',
f_currency:1,
f_rate:'',
ClientID:0,
PayDate:'',
VorList:[]
},
dataList: [],
total: 0,
currentPage: 1,
loading: true,
text: "",
dialogTitle: "",
noData: false,
addShow: false,
//验证规则
rules:{
f_UnitPrice: [{ required: true, message: "请输入金额", trigger: "blur" }],
CarNumber: [{ required: true, message: "请输入数量", trigger: "blur" }],
PayDate: [{ required: true, message: "请选择到期结算日", trigger: "blur" }],
CarNum: [{ required: true, message: "请填写车配号", trigger: "blur" }],
},
isCked:'1',
//供应商下拉
ClientTypeList:[],
//账户类型
ClientAccountList:[],
//付款账户
ClientAccountListS:[],
//供应商默认选中
suppierCked:4,
//客户名称选中ID
customId:0,
//车配号 年
Year:'',
//币种下拉
coinGetList:[],
//总价
TotalMoney:'',
//全部团队编号
allTeamList:[],
//TCID
TCIDS:'',
//团队编号
TCIDList:{
TCID:'',
TCNUM:""
},
//弹窗导出信息
exportInfo:{
DCDate:'',
StartGroupDate:'',
EndGroupDate:'',
CurrType:3,
ClientId:0
},
//上传数组
saveMsg:[],
picIsShow:false,
picObj:[],
imgList:[],
pickerBeginDateBefore: {
disabledDate: time => {
let endTime = new Date(this.exportInfo.EndGroupDate)
return endTime.getTime() < time.getTime()
}
},
pickerBeginDateAfter: {
disabledDate: time => {
let startTime = new Date(this.exportInfo.StartGroupDate)
return startTime.getTime() >= time.getTime()
}
}
};
},
methods: {
initColums() {
this.isReady = false;
let that = this;
let License = {
title: "车配号",
field: "CarDistribution",
width: 80,
titleAlign: "left",
columnAlign: "left",
isResize: true,
result: "",
filterMultiple: false,
filters: [{}],
type: "text"
};
let ShareDate = {
field: "CreateTime",
title: "分摊日期",
width: 40,
titleAlign: "left",
columnAlign: "left",
isResize: true,
result:{},
filterMultiple:false,
filters: [{}],
type:'datetime'
};
let Details = {
field: "Description",
title: "详情",
width: 80,
titleAlign: "left",
columnAlign: "left",
isResize: true,
// result: "",
// filterMultiple: false,
// filters: [{}],
// type: "text"
};
let ShareTeam = {
field: "TCIDList",
title: "分摊的团",
titleAlign: "left",
columnAlign: "left",
isResize: true,
width: 80,
componentName:'table-teamList'
// orderBy: "desc",
// filterMultiple: false,
// filters: [{}],
// type: "text"
};
let ProductDoc = {
field: "FinanceIdList",
title: "产生单据",
titleAlign: "left",
columnAlign: "left",
isResize: true,
width: 80,
componentName:'table-docment',
// filterMultiple: true,
// result: [],
// filters: [{}],
// type: "text"
};
let operaler = {
title: "操作人员",
field: "CreateByName",
titleAlign: "left",
columnAlign: "left",
width: 80,
isResize: true,
};
let Operate = {
title: "操作",
titleAlign: "left",
columnAlign: "left",
width: 80,
isResize: false,
componentName:'table-operation'
}
this.columns = [];
this.columns.push(License);
this.columns.push(ShareDate);
this.columns.push(Details);
this.columns.push(ShareTeam);
this.columns.push(ProductDoc);
this.columns.push(operaler);
this.columns.push(Operate);
this.isReady = true;
},
customCompFunc(params){
this.financeinfoRemove(params.id,params.text)
},
financeinfoRemove(id, text) {
this.$confirm(
"是否对" + "“" + text + "”" + "进行删除操作?删除后不可恢复!",
"提示",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}
)
.then(() => {
this.apipost(
"bus_post_DelCarfareApportion",
{ CarId: id },
res => {
if (res.data.resultCode == 1) {
this.Success(res.data.message);
this.getList();
} else {
this.Error(res.data.message);
}
this.getList();
},
err => {}
);
})
.catch(() => {
this.$message({
type: "info",
message: "已取消删除"
});
});
},
sortChange(param) {
},
filterMethod(filters) {
this.msg.CarDistribution = filters.CarDistribution;
this.msg.StartTime = filters.CreateTime.beginDate;
this.msg.EndTime = filters.CreateTime.endDate;
if(this.msg.StartTime==null){
this.msg.StartTime='';
}
if(this.msg.EndTime==null){
this.msg.EndTime='';
}
this.msg.pageIndex = 1;
this.getList();
},
handleCurrentChanges(val) {
this.msg.pageIndex = val;
this.getList();
},
getList() {
this.loading = true;
this.apipost(
"bus_get_GetCarfareApportionPageList",
this.msg,
res => {
this.loading = false;
if (res.data.resultCode == 1) {
this.dataList = res.data.data.pageData;
this.total = res.data.data.count;
} else {
this.Error(res.data.message);
}
},
null
);
},
initAddMsg() {
//初始化添加、修改数据
let newMsg = {
TCIDStr:'',
CarNum:'',
f_UnitPrice:'',
CarNumber:'',
CarUnitPrice:'',
JJPrice:'',
HSPrice:'',
ZJPrice:'',
SJPrice:'',
ZJiPrice:'',
f_currency:1,
f_rate:'',
ClientID:0,
PayDate:'',
VorList:[]
};
this.Year = '';
this.TCIDS ='';
this.allTeamList = [];
this.saveMsg = [];
this.addMsg = newMsg;
},
resetForm(formName) {
this.initAddMsg();
this.$refs[formName].resetFields();
},
//获取供应商
financeinfo_post_GetClientTypeList(){ // 获取对象类型
this.apipost('financeinfo_post_GetClientTypeList',{}, res => {
if(res.data.resultCode == 1) {
this.ClientTypeList = res.data.data;
}
}, err => {})
},
//获取客户类型
financeinfo_post_GetClientAccountList(){ //获取付款 对象类型 新增用
let msg = {
ID:0,
Type:4,
ObjID:0,
CardNum:''
}
this.apipost('financeinfo_post_GetClientAccountList',msg, res => {
if(res.data.resultCode == 1) {
let data = res.data.data;
let ClientAccountList = [];
data.forEach(x=>{
let obj = {
ID:x.ID,
Name:x.AccountHolder + `(${x.AccountAlias})`,
Nom:x.CardNum,
OpenBankName:x.OpenBankName,
ObjID:x.ObjID,
}
ClientAccountList.push(obj)
})
this.ClientAccountList = ClientAccountList;
}
}, err => {})
},
GetClientAccountList(i){ //获取客户名称并且根据费用类型和付款对象获取客户账号
let msg = {
ID:i,
Type:4,
ObjID:0,
CardNum:''
}
this.addMsg.ClientID=0;
this.apipost('financeinfo_post_GetClientAccountList',msg, res => {
if(res.data.resultCode == 1) {
let data = res.data.data;
let ClientAccountList = [];
if(i){
data.forEach(x=>{
let obj = {
ID:x.ID,
Name:x.AccountHolder + + `(${x.AccountAlias})`,
Nom:x.CardNum,
OpenBankName:x.OpenBankName,
allName:x.CardNum+" "+x.OpenBankName,
ObjID:x.ObjID,
}
ClientAccountList.push(obj)
})
this.ClientAccountListS = ClientAccountList;
}
}
}, err => {})
},
//获取币种
financeinfo_post_GetList(){
this.apipost('financeinfo_post_GetList',{Name:''}, res => {
if(res.data.resultCode == 1) {
this.coinGetList = res.data.data;
}
}, err => {})
},
getRate(ID){ // 根据选择币种获取汇率
this.coinGetList.forEach(x=>{
if(x.ID==ID){
this.addMsg.f_rate=x.CurrentRate;
}
})
this.getTotalMoney();
},
//点击新增
getInfo(){
this.addShow = true;
var rate = this.addMsg.f_currency;
this.getRate(rate);
this.initAddMsg();
},
//输入金额得到总价
getTotalMoney(){
this.TotalMoney = this.addMsg.f_UnitPrice*this.addMsg.f_rate;
},
//输入数量 得到单价
getSingelePrice(){
if(this.addMsg.f_UnitPrice==''||this.addMsg.CarNumber==''){
this.addMsg.CarUnitPrice=0.00
}else{
if(this.addMsg.JJPrice==''){
this.addMsg.JJPrice=0;
}
if(this.addMsg.HSPrice==''){
this.addMsg.HSPrice=0;
}
if(this.addMsg.ZJPrice==''){
this.addMsg.ZJPrice=0;
}
if(this.addMsg.SJPrice==''){
this.addMsg.SJPrice=0;
}
if(this.addMsg.ZJiPrice==''){
this.addMsg.ZJiPrice=0;
}
var zong = parseFloat(this.addMsg.f_UnitPrice);
var total = parseInt(this.addMsg.JJPrice)+parseInt(this.addMsg.HSPrice)+parseInt(this.addMsg.ZJPrice)+
parseInt(this.addMsg.SJPrice)+parseInt(this.addMsg.ZJiPrice);
this.addMsg.CarUnitPrice = ((zong-total)/this.addMsg.CarNumber).toFixed(2);
}
},
//筛选团队
getTeamInfo(){
var Year = new Date(this.Year);
let msg = {
Year:Year.getFullYear(),
CarNum:this.addMsg.CarNum
}
this.apipost('bus_get_ScreeningTravelForCarNum',msg, res => {
if(res.data.resultCode == 1) {
this.allTeamList = res.data.data;
console.log(this.allTeamList,'allTeamList');
}else{
this.Error(res.data.message);
}
}, err => {})
},
//移除团队
removeTeam(index){
this.allTeamList.splice(index,1);
},
//根据团号 验证该团号是否可以
checkIsUse(){
let msg = {
TCID:this.TCIDS
}
this.apipost('bus_get_ValidataTravelState',msg, res => {
if(res.data.resultCode == 1) {
var obj = {
TCID:'',
TCNUM:""
}
obj.TCID = this.TCIDS
this.allTeamList.push(obj);
}else{
this.Error(res.data.message);
}
this.TCIDS = '';
}, err => {})
},
//保存
submitForm(addMsg) {
//提交创建、修改表单
this.$refs[addMsg].validate(valid => {
if (valid) {
this.saveInfo();
} else {
console.log("error submit!!");
return false;
}
});
},
//保存信息
saveInfo(){
var newArr = [];
this.allTeamList.forEach(x=>{
newArr.push(x.TCID);
})
var str = "";
for(var i=0;i<newArr.length;i++){
str += newArr[i] + ",";
}
//去掉最后一个逗号(如果不需要去掉,就不用写)
if (str.length > 0) {
str = str.substr(0,str.length - 1);
}
this.addMsg.TCIDStr = str;
this.addMsg.CarNumber = parseInt(this.addMsg.CarNumber);
this.addMsg.JJPrice = parseFloat(this.addMsg.JJPrice);
this.addMsg.HSPrice = parseFloat(this.addMsg.HSPrice);
this.addMsg.ZJPrice = parseFloat(this.addMsg.ZJPrice);
this.addMsg.SJPrice = parseFloat(this.addMsg.SJPrice);
this.addMsg.ZJiPrice = parseFloat(this.addMsg.ZJiPrice);
this.addMsg.f_rate = parseFloat(this.addMsg.f_rate);
this.apipost('bus_post_SetCarfareApportion',this.addMsg, res => {
if(res.data.resultCode == 1) {
this.addShow = false;
this.Success(res.data.message);
this.getList();
}else{
this.Error(res.data.message);
}
}, err => {})
},
//清空弹窗
clearDialog(){
this.exportInfo.DCDate='',
this.exportInfo.StartGroupDate='',
this.exportInfo.EndGroupDate=''
},
//跳转打印页面
goToExport(path){
if(this.exportInfo.DCDate==''||this.exportInfo.MakeStartDate==''){
this.Error('请选择导出月份或制单日期');
return;
}
let routeData = this.$router.resolve({
name: path,
query: {
Month: this.exportInfo.DCDate,
MakeStartDate:this.exportInfo.StartGroupDate,
MakeEndDate:this.exportInfo.EndGroupDate,
CurrType:this.exportInfo.CurrType,
ClientId:this.exportInfo.ClientId
}
});
window.open(routeData.href, "_blank");
},
showUpLoadFile(i){ // 预览上传文件
if(i.Type==3){
this.picObj.push(i.Url);
this.imgList.push(i.Url);
this.picIsShow= true;
// this.hideFlashMan = true;
}else{
if(i.Content.substring(i.Content.lastIndexOf('.')+1,i.Content.length).toUpperCase()=='PDF'){
this.previewPDF(i.Url)
}else{
window.open("https://view.officeapps.live.com/op/view.aspx?src="+i.Url)
}
}
},
deleteUploadFile(i){ // 删除上传文件
this.saveMsg.splice(i,1);
this.addMsg.VorList = this.saveMsg;
},
uploadFileBtn(file) { //上传
if(file.file.size > 1024 * 1024 * 10) {
this.Error('文件大小不能超过10M!')
return
}
// 1 文档 2 数据 3 图片
let typeArr=[
{stringArr:'GIF|JPG|JPEG|PNG|BMP',type:3},
{stringArr:'DOCX|DOC|XLSX|XLS|PPT|PPTX|PDF',type:1},
]
let ft=file.file.name.substring(file.file.name.lastIndexOf('.')+1,file.file.name.length).toUpperCase();
let fileTypeNumber = 2;
let typeOk = false;
typeArr.forEach(x=>{
if(x.stringArr.indexOf(ft)!='-1')
{
fileTypeNumber=x.type
typeOk = true;
}
})
if (!typeOk) return this.Error('请上传图片、word、excel类型的文件!');
let newArr = [];
newArr.push(file.file)
let path = "/Upload/Temporary/"
this.$message.info('上传中...')
this.uploadFile(path, newArr, x => {
console.log(x.res.requestUrls[0])
let fileSize = file.file.size<1024? file.file.size:(file.file.size / 1024).toFixed(0);
this.saveMsg.push({
Content: x.name,
ID:0,
Type:fileTypeNumber,
Url:x.res.requestUrls[0].split("?")[0],
})
this.addMsg.VorList = this.saveMsg;
this.Success('上传成功');
});
},
},
mounted(){
this.getList();
this.initColums();
this.financeinfo_post_GetClientTypeList();
this.financeinfo_post_GetClientAccountList();
this.financeinfo_post_GetList();
},
created(){
Vue.component('table-docment',{ //产生单据样式
template:`<div class='FinaceItem'>
<span style='cursor:pointer;' @click='goDocment("FinancialDocumentsDetail",item)' v-for='item in rowData.FinanceIdList'>{{item}}</span>
</div>`,
props:{
rowData:{
type:Object
},
field:{
type:String
},
index:{
type:Number
}
},
methods:{
//跳转财务单据
goDocment(path, id) {
this.$router.push({ name: path, query: { id: id, blank: 'y', tab: '单据详情'} });
}
}
})
Vue.component('table-teamList',{ //分摊的团样式
template:`<div class='FinaceItem'>
<span style='cursor:pointer;' @click='goUrlX("productQuery",item)' v-for='item in rowData.TCIDList'>{{item}}</span>
</div>`,
props:{
rowData:{
type:Object
},
field:{
type:String
},
index:{
type:Number
}
},
methods:{
goUrlX (path, id) {
this.$router.push({
name: path,
query: {id: id, blank: 'y', tab: '产品查询'}
})
},
}
})
//操作按钮
Vue.component('table-operation',{
template:`<div style='width:80px;height:40px;background:#fff;text-align:center;position: relative;
left:-5px;padding-top: 6px;padding-top:6px;'></el-button><el-button type="danger" size='mini' icon="el-icon-delete" circle @click="deleteRow(rowData,index)"></el-button>
</div>`,
props:{
rowData:{
type:Object
},
field:{
type:String
},
index:{
type:Number
}
},
methods:{
deleteRow(){
let params = {type:'delete',id:this.rowData.ID,text:this.rowData.CarDistribution};
this.$emit('on-custom-comp',params);
}
}
})
}
}
</script>
<style>
@import "../../../assets/css/newTravelManager.css";
@import "../../../assets/css/endTravelManager.css";
</style>
<template>
<div>
<div class="clearfix" style="margin:auto;width:1200px;">
<div class="TravelLeftMenu">
<div class="TravelTopTitle">页面导航</div>
<div class="TravelNavList" :class="{'TravelCked':ckedNav==1}" @click.prevent="custormAnchor('firstAnchor',1)">
基础设置
</div>
<div class="TravelLine"></div>
<div class="TravelNavList" :class="{'TravelCked':ckedNav==2}" @click.prevent="custormAnchor('secondAnchor',2)">
线路行程
</div>
<div class="TravelLine"></div>
<div class="TravelNavList" :class="{'TravelCked':ckedNav==3}" @click.prevent="custormAnchor('thirdAnchor',3)">
产品特色
</div>
<div class="TravelLine"></div>
<div class="TravelNavList" :class="{'TravelCked':ckedNav==4}" @click.prevent="custormAnchor('fourAnchor',4)">
补充信息
</div>
<div class="TravelLine"></div>
<div class="TravelNavList" :class="{'TravelCked':ckedNav==5}" @click.prevent="custormAnchor('fiveAnchor',5)">
团期设置
</div>
<div class="TravelLine"></div>
</div>
<div class="newTravelRight" v-loading="loading">
<TravelConfig @headCallBack="getConfig" @setTravelUploadData="setTravelUploadData" :PostConfig="PostConfig"
:TCNUM="TCNUM" id="firstAnchor" :LineList="LineList"></TravelConfig>
<TravelDaysTripDirect id="secondAnchor" @headCallBack="getDaysTrip" :NoticeParameters="NoticeParameters"
:subConfig="journeyList" :isOpenGroup="false" :IsDirect="PostConfig.IsDirect" v-bind:AllCityList="AllCityList"
v-bind:StartCity="StartCity" :UseTypeArray="UseTypeArray" :AirPickUp="AirPickUp" :AirSend="AirSend" @change="handlerChangeData"></TravelDaysTripDirect>
<TravelFeature ref="TravelFeature" id="thirdAnchor" @featureCallBack="getFeature" :FeatureData="FeatureData"
:isNewConfig="isNewConfig" @unlockFormCommit="unlockFormCommit"></TravelFeature>
<TravelNotice ref="TravelNotice" id="fourAnchor" @headCallBack="getNotice" :subArray="NoticeParameters"
:NoticeData="NoticeData" v-bind:PostConfig="PostConfig" v-bind:AllCityList="AllCityList" v-bind:CountryID="PostConfig.CountryID"></TravelNotice>
<TravelPrice ref="TravelPrice" id="fiveAnchor" @headCallBack="getPrice" :priceList="PriceList" v-if="!flagWangYue"
:PostConfig="PostConfig" :modifyTcid="modifyTcid"></TravelPrice>
<TravelPrice2 ref="TravelPrice" id="fiveAnchor" @headCallBack="getPrice" :PostDaysTrip="PostDaysTrip"
:priceList="PriceList" v-else :PostConfig="PostConfig" :modifyTcid="modifyTcid"></TravelPrice2>
<div class="btnFixedDiv">
<div class="toTop" @click="backTop">
<i class="iconfont icon-huidaodingbu"></i>
</div>
<div v-if="modifyType!=2" class="DTSaveBtn" :class="{'disClick':!isSubmit}" @click="submitForm(1)">保存</div>
<div v-if="modifyType!=2" class="DTSaveBtn" :class="{'disClick':!isSubmit}" @click="submitForm(2)">提交</div>
<div v-if="modifyType==2" class="DTSaveBtn" :class="{'disClick':!isSubmit}" @click="submitForm(3)" title="另存为新模板">保存
</div>
<div v-if="ConfigId>0" class="DTSaveBtn" :class="{'disClick':!isSubmit}" @click="goB2B()">预览</div>
</div>
</div>
</div>
</div>
</template>
<script>
import TravelConfig from "../TravelGroupControl/TravelConfig.vue";
import TravelDaysTripDirect from "../travelLineTrip/TravelDaysTrip_Direct";
import TravelFeature from "../TravelGroupControl/TravelFeature";
import TravelNotice from "../TravelGroupControl/TravelNotice";
import TravelPrice from "../TravelGroupControl/TravelPrice";
import TravelPrice2 from "../TravelGroupControl/TravelPrice2";
export default {
provide() {
return {
loadConfigInfo: this.firstLoadConfigInfo
}
},
data() {
return {
ConfigId: 0, //地址栏查询参数
NewConfigId: "", //configID加密后的字符串【预览使用】
TCNUM: '', //团控列表传过来的tcnum
NoticeParameters: {
ConfigId: 0, //配置编号
CountryID: "", //国家
IsDirect: 0, //是否直采
LineId: 0 //线路编号
},
NoticeData: {
FeeInclude: "",
FeeNonInclude: "",
ImportantTip: "",
WarmTip: "",
B2BRemark: "",
ShopRemark: "",
VisaRemark: ""
},
ShopList: [],
SelfpayingList: [],
AllCityList: [],
//基本配置
PostConfig: {
ID: 0,
StartCityId: 0,
LineId: 0,
LineteamId: 0,
Title: "",
//本团卖点
ProductRecommend: "",
//选择的系列的国家编号
CountryID: 0,
RemoveChild: [], //移除的子项
RemoveImg: [], //移除的图片
IsDirect: 0, //是否直采(0-否-1-是)
PriceIsDirect: 0, //是否直采报价(1-否-2-是)
PDFAlias: "", //pdf别名,
FlightList: [], //航班信息
ShopList: [], //购物店信息
SelfpayingList: [], //自费信息
Feature: "", //行程特色
fileList: [],
VideoStr: "", //视频地址
},
//行程
FeatureData: {
ID: 0,
ConfigId: 0,
FeatureType: 3,
FeatureImg: "",
FeatureContent: "", //自定义内容
FeatureHtml: "", //行程特色(html)
FeatureHtmlImage: "", //行程特色(image)
FeatureHtmlJson: "", //行程特色(Json数据)
FeatureHtmlJsonDelete: "", //行程特色删除数据
fileList: [],
Title: "",
Subtitle: "",
LineName: "",
DayList: [],
TemplateId: 1,
IsSave: false //是否保存
},
//线路行程
journeyList: {
DayNum: "", //天数
NightNum: "", //晚上
StartCityId: 0,
ReturnArriveCityId: 0, //返回抵达城市
//交通
TrafficList: [],
//景点
ScenicList: [],
//住宿
HotelList: [],
//餐饮
DinnerList: [],
//自由活动
FreedomList: [],
//温馨提示
WarmTipList: [],
RemoveChild: [], //移除的子项
RemoveImg: [], //移除的图片
//线路行程天数
DayList: [],
isFileUpload: false //是否是一键上传行程
},
PostPrice: "", //报价信息
//线路
LineList: [],
PostFeature: "", //行程特色信息
PostNotice: "", //行程特色其他内容
//配置信息
PostDaysTrip: "", //每天的行程
PriceList: [],
//所有的城市数据
AllCityList: [],
StartCity: [], //出发城市集合城市
UseTypeArray: [], //用车类型
AirPickUp: 0, //接机
AirSend: 0, //送机
isgetPrice: true,
realSave: 1, //1:制作报价单,2保存草稿
outerVisible: false,
tripTitle: "",
isSubmit: true,
//选中的导航
ckedNav: 1,
modifyType: 1, //1:系列团修改,2:单团修改
modifyTcid: 0, //修改单团期id
flagWangYue: null,
loading: false,
isNewConfig: true,
};
},
components: {
TravelConfig: TravelConfig,
TravelDaysTripDirect: TravelDaysTripDirect,
TravelFeature: TravelFeature,
TravelNotice: TravelNotice,
TravelPrice: TravelPrice,
TravelPrice2: TravelPrice2
},
methods: {
/*获取行程特色内容对象*/
getFeature(featureObj) {
this.PostFeature = featureObj;
},
handlerChangeData(data) {
if (
this.FeatureData.FeatureHtmlJson &&
this.FeatureData.FeatureHtmlJson.d &&
this.FeatureData.FeatureHtmlJson.d.length > 0
) {
// console.log("to do something");
} else {
// this.$set(this.FeatureData, "DayList", data);
this.$refs.TravelFeature.setNewDate(data);
}
},
/*获取组件配置信息【回调方法】*/
getConfig(configObj) {
this.PostConfig = configObj;
this.NoticeParameters.ConfigId = this.PostConfig.ConfigId;
this.NoticeParameters.CountryID = this.PostConfig.CountryID;
this.NoticeParameters.IsDirect = this.PostConfig.IsDirect;
this.NoticeParameters.LineId = this.PostConfig.LineId;
if (this.ConfigId == 0) {
this.FeatureData.LineName = this.PostConfig.LineName;
this.FeatureData.Subtitle = this.PostConfig.LineTeamName;
this.FeatureData.Title = this.PostConfig.Title;
}
},
/*获取组件报价信息*/
getPrice(priceObj) {
priceObj.forEach(objItem => {
var SaleBranchId = "";
if (objItem.SaleBranchIdArray.length > 0) {
objItem.SaleBranchIdArray.forEach(subItem => {
SaleBranchId += subItem + ",";
});
}
if (SaleBranchId != "") {
var str = SaleBranchId.substr(0, SaleBranchId.length - 1);
objItem.SaleBranchId = str;
}
});
this.PostPrice = priceObj;
},
//行程回调
getDaysTrip(tripObj) {
this.PostDaysTrip = tripObj;
},
/*获取行程特色内容对象*/
getFeature(featureObj) {
this.PostFeature = featureObj;
},
/*获取行程特色其他内容*/
getNotice(noticeObj) {
this.PostNotice = noticeObj;
},
//解锁表单重复提交
unlockFormCommit(value) {
this.isSubmit = value;
},
//初始化幻灯片
initFileList() {
for (var i = 0; i < 5; i++) {
var fileObj = this.$commonUtils.FileObject();
if (this.PostConfig.fileList.length <= 5) {
this.PostConfig.fileList.push(fileObj);
}
this.FeatureData.fileList.push(fileObj);
}
},
//提交验证
submitForm(SaveType) {
// let travelConfigVal = this.$refs["TravelConfig"].validateForm();
// let travelDaysTripVal = this.$refs["TravelDaysTrip"].validateForm();
// if (!travelConfigVal) {
// this.Error("请完善配置信息");
// }
// if (!travelDaysTripVal) {
// this.Error("请完善行程信息");
// }
//if (travelConfigVal && travelDaysTripVal) {
if (this.isSubmit) {
this.isSubmit = false;
this.SaveData(SaveType);
}
},
/*保存数据*/
SaveData(SaveType) {
this.MsgBus.$emit('saveTravel', true);
this.FeatureData.IsSave = true;
this.submitText = "保存中";
//团队配置
var basicData = {};
basicData.PriceList = this.PostPrice;
//配置编号
basicData.ID = this.ConfigId;
basicData.LineId = this.PostConfig.LineId;
basicData.LineteamId = this.PostConfig.LineteamId;
basicData.Title = this.PostConfig.Title;
basicData.OpRemark = this.PostConfig.OpRemark;
basicData.ProductRecommend = this.PostConfig.ProductRecommend;
basicData.VideoStr = this.PostConfig.VideoStr;
basicData.PDFAlias = this.PostConfig.PDFAlias;
basicData.ImgCover = this.PostConfig.ImgCover;
basicData.PriceIsDirect = this.PostConfig.PriceIsDirect;
basicData.IsDirect = this.PostConfig.IsDirect;
basicData.RemoveChild = this.PostConfig.RemoveChild;
basicData.TeamType = this.PostConfig.TeamType;
basicData.DayNum = (this.PostDaysTrip && this.PostDaysTrip.DayNum != "") ? this.PostDaysTrip.DayNum : 0;
basicData.NightNum = (this.PostDaysTrip && this.PostDaysTrip.NightNum != "") ? this.PostDaysTrip.NightNum : 0;
basicData.StartCityId = (this.PostDaysTrip && this.PostDaysTrip.StartCityId != "") ? this.PostDaysTrip.StartCityId :
0;
basicData.ReturnArriveCityId = (this.PostDaysTrip && this.PostDaysTrip.ReturnArriveCityId != "") ? this.PostDaysTrip
.ReturnArriveCityId : 0;
basicData.SelfpayingList = this.PostConfig.SelfpayingList;
basicData.ShopList = this.PostConfig.ShopList;
basicData.DinnerList = this.PostDaysTrip.DinnerList;
basicData.FreedomList = this.PostDaysTrip.FreedomList;
basicData.HotelList = this.PostDaysTrip.HotelList;
basicData.ScenicList = this.PostDaysTrip.ScenicList;
basicData.TrafficList = this.PostDaysTrip.TrafficList;
basicData.WarmTipList = this.PostDaysTrip.WarmTipList;
basicData.TitleList = this.PostDaysTrip.TitleList;
basicData.RemoveImg = this.PostDaysTrip.RemoveImg;
//行程特色数据
var TripFeature = {};
if (this.PostFeature == "") {
TripFeature = this.FeatureData;
} else {
TripFeature = this.PostFeature;
}
TripFeature.FeatureHtmlJson = TripFeature.FeatureHtmlJson ?
JSON.stringify(TripFeature.FeatureHtmlJson) :
"";
TripFeature.FeatureHtmlJsonDelete = TripFeature.FeatureHtmlJsonDelete ? JSON.stringify(TripFeature.FeatureHtmlJsonDelete) :
"";
TripFeature.FeeInclude = this.PostNotice.FeeInclude;
TripFeature.FeeNonInclude = this.PostNotice.FeeNonInclude;
TripFeature.ImportantTip = this.PostNotice.ImportantTip;
TripFeature.WarmTip = this.PostNotice.WarmTip;
TripFeature.B2BRemark = this.PostNotice.B2BRemark;
TripFeature.ShopRemark = this.PostNotice.ShopRemark;
TripFeature.VisaRemark = this.PostNotice.VisaRemark;
if (
basicData.TrafficList != null &&
basicData.TrafficList.length > 0 &&
basicData.TrafficList[0].SubTraffic != null &&
basicData.TrafficList[0].SubTraffic.length > 0
) {
basicData["ArriveCityId"] =
basicData.TrafficList[0].SubTraffic[0].ArrivalCityId;
}
if (basicData.OpenState == 1) {
basicData["AfterOpenModify"] = true;
}
//"另存"新增团期
if (SaveType == 3) {
basicData.TravelInfoIsCopy = true;
}
//小包团
if (this.flagWangYue) {
basicData.TeamType = 1;
} else {
basicData.TeamType = 0;
}
var postType = 1;
if (postType == 1) {
this.apipost(
"travel_post_SetTravelConfigInfo",
basicData,
res => {
if (res.data.resultCode == 1) {
//配置编号
TripFeature.ConfigId = res.data.data;
this.$refs.TravelFeature.getHtml(TripFeature, SaveType,postType);
} else if (res.data.resultCode == 10009) {
this.FeatureData.IsSave = false;
//表单重复提交
this.isSubmit = true;
} else {
this.FeatureData.IsSave = false;
this.Error(res.data.message);
this.isSubmit = true;
this.submitText = "提交";
this.$refs.TravelFeature.del_show = true;
}
},
err => {}
);
} else {
this.ApiPost2(
"TripSetTravelConfigInfo",
basicData,
res => {
if (res.data.resultCode == 1) {
//配置编号
TripFeature.ConfigId = res.data.data;
this.$refs.TravelFeature.getHtml(TripFeature, SaveType,postType);
} else if (res.data.resultCode == 10009) {
this.FeatureData.IsSave = false;
//表单重复提交
this.isSubmit = true;
} else {
this.FeatureData.IsSave = false;
this.Error(res.data.message);
this.isSubmit = true;
this.submitText = "提交";
this.$refs.TravelFeature.del_show = true;
}
});
}
},
//初始化团的幻灯片
initFileList() {
for (var i = 0; i < 5; i++) {
var fileObj = this.$commonUtils.FileObject();
this.PostConfig.fileList.push(fileObj);
}
},
//初始化行程特色幻灯片
initFeatureFile() {
for (var i = 0; i < 5; i++) {
var fileObj = this.$commonUtils.FileObject();
this.FeatureData.fileList.push(fileObj);
}
},
custormAnchor(anchorName, index) {
// 找到锚点
let anchorElement = document.getElementById(anchorName);
// 如果对应id的锚点存在,就跳转到锚点
if (anchorElement) {
anchorElement.scrollIntoView();
}
this.ckedNav = index;
}, //滚动事件
ScrollMethod() {
var that = this;
var s1, s2, s3, s4, s5;
document
.getElementsByClassName("frame-box")[0]
.addEventListener("scroll", function () {
if (document.getElementById("firstAnchor") != null) {
s1 = document.getElementById("firstAnchor").offsetTop;
}
if (document.getElementById("secondAnchor") != null) {
s2 = document.getElementById("secondAnchor").offsetTop;
}
if (document.getElementById("thirdAnchor") != null) {
s3 = document.getElementById("thirdAnchor").offsetTop;
}
if (document.getElementById("fourAnchor") != null) {
s4 = document.getElementById("fourAnchor").offsetTop;
}
if (document.getElementById("fiveAnchor") != null) {
s5 = document.getElementById("fiveAnchor").offsetTop;
}
if (s1 >= this.scrollTop - 50 && s1 <= this.scrollTop + 50) {
that.ckedNav = 1;
} else if (s2 >= this.scrollTop - 50 && s2 <= this.scrollTop + 50) {
that.ckedNav = 2;
} else if (s3 >= this.scrollTop - 50 && s3 <= this.scrollTop + 50) {
that.ckedNav = 3;
} else if (s4 >= this.scrollTop - 50 && s4 <= this.scrollTop + 50) {
that.ckedNav = 4;
} else if (s5 >= this.scrollTop - 50 && s5 <= this.scrollTop + 50) {
that.ckedNav = 5;
}
});
},
//返回顶部
backTop() {
var timer = setInterval(function () {
var scrollTop = document.getElementsByClassName("frame-box")[0]
.scrollTop;
var ispeed = Math.floor(-scrollTop / 6);
if (scrollTop == 0) {
clearInterval(timer);
}
document.getElementsByClassName("frame-box")[0].scrollTop =
scrollTop + ispeed;
}, 30);
},
/*一键上传数据组装*/
setTravelUploadData(uploadConfig) {
if (uploadConfig != undefined) {
var configData = JSON.parse(uploadConfig);
//基础数据组装
//this.PostConfig.Title = "";
this.PostConfig.IsDirect = 0;
//线路行程组装
let dayList = [];
for (var i = 0; i < configData.Days.length; i++) {
let dayObj = configData.Days[i];
var dayItem = this.$tripUtils.tripDayobj();
dayItem.DayNum = i + 1;
//行程大点
var titleItem = this.$tripUtils.titleObj();
titleItem.DayNum = i + 1;
titleItem.Title = dayObj.Title;
dayItem.TitleObj = titleItem;
//交通对象
var trafficObj = this.$tripUtils.trafficObj();
trafficObj.DayNum = i + 1;
//交通子对象
var subTrafficObj = this.$tripUtils.subTrafficObj();
trafficObj.SubTraffic.push(subTrafficObj);
dayItem.TrafficObj = trafficObj;
//温馨提示
var warmTipObj = this.$tripUtils.warmtipObj();
warmTipObj.DayNum = i + 1;
warmTipObj.Description = dayObj.Tips;
dayItem.WarmTipObj = warmTipObj;
dayItem.isHide = false;
dayItem.isRead = false;
//景点
if (dayObj.ViewSpotList.length > 0) {
dayObj.ViewSpotList.forEach((viewSpot, index) => {
if ((index + 1) <= 5) {
var scenicObj = this.$tripUtils.scenicObj();
scenicObj.DayNum = i + 1;
scenicObj.CouponsName = viewSpot.Name;
scenicObj.Description = viewSpot.Description;
if (viewSpot.Imgs != null && viewSpot.Imgs.length > 0) {
let imaArray = [];
viewSpot.Imgs.forEach(img => {
imaArray.push({
Url: img,
Name: ""
});
});
scenicObj.NewImaArray = imaArray;
scenicObj.NewScenicImg = JSON.stringify(scenicObj.NewImaArray);
} else {
scenicObj.NewImaArray = [];
scenicObj.NewScenicImg = "";
}
dayItem.ScenicArray.push(scenicObj);
}
});
}
//餐厅
dayItem.DinnerArray.push(this.dinnerUploadFactory(i + 1, 1, dayObj.Breakfast));
dayItem.DinnerArray.push(this.dinnerUploadFactory(i + 1, 2, dayObj.Lanuch));
dayItem.DinnerArray.push(this.dinnerUploadFactory(i + 1, 3, dayObj.Dinner));
//酒店
var hotelObj = this.$tripUtils.hotelObj();
hotelObj.DayNum = i + 1;
hotelObj.HotelName = dayObj.Hotel;
dayItem.HotelArray.push(hotelObj);
dayList.push(dayItem);
}
this.journeyList.isFileUpload = true;
this.journeyList.DayNum = configData.Days.length;
this.journeyList.NightNum = this.journeyList.DayNum - 1;
this.journeyList.DayList = dayList;
//产品特色
this.FeatureData.FeatureType = 3;
this.FeatureData.FeatureContent = configData.Feature;
//行程补充信息
this.NoticeData.FeeInclude = configData.PriceInCloub;
this.NoticeData.FeeNonInclude = configData.PriceNoInCloub;
this.NoticeData.ImportantTip = configData.PriceNoInCloub;
this.NoticeData.WarmTip = configData.Tips;
this.NoticeData.ShopRemark = configData.Shopping;
}
},
//餐饮对象上传创建
dinnerUploadFactory(dayNum, useDinnerType, dinnerName) {
let dinnerObj = this.$tripUtils.dinnerObj();
dinnerObj.UseDinnerType = useDinnerType;
dinnerObj.DinnerName = dinnerName;
dinnerObj.BreakfastUseType = 0;
dinnerObj.DayNum = dayNum;
return dinnerObj;
},
firstLoadConfigInfo() {
if (this.$route.query.flag) {
this.flagWangYue = this.$route.query.flag === "false" ? false : true;
} else {
this.flagWangYue = false;
}
let configId = this.$route.query.configId;
this.modifyTcid = this.$route.query.tcid;
this.TCNUM = this.$route.query.TCNUM;
if (this.modifyTcid > 0) {
this.modifyType = 2;
} else {
this.modifyType = 1;
this.modifyTcid = 0;
}
var that = this;
if (configId > 0) {
this.isNewConfig = false;
this.ConfigId = configId;
let msg = {
configId: configId,
isSale: this.flagWangYue
};
this.loading = true;
this.apipost(
"travel_get_GetTravelConfigMakeInfo",
msg,
res => {
if (res.data.resultCode == 1) {
var tempData = res.data.data;
if (tempData.Feature != null) {
this.FeatureData.ID = tempData.Feature.ID;
this.FeatureData.ConfigId = tempData.Feature.ConfigId;
this.FeatureData.FeatureType = tempData.Feature.FeatureType;
this.FeatureData.FeatureImg = tempData.Feature.FeatureImg;
this.FeatureData.TemplateId = tempData.Feature.TemplateId;
this.FeatureData.FeatureContent = tempData.Feature.FeatureContent;
//图片列表
this.FeatureData.fileList = tempData.Feature.FeatureImgList;
this.FeatureData.FeatureHtmlJson =
tempData.Feature.FeatureHtmlJson &&
tempData.Feature.FeatureHtmlJson != "" && tempData.Feature.FeatureType > 3 ?
JSON.parse(tempData.Feature.FeatureHtmlJson) :
null;
this.FeatureData.FeatureHtmlJsonDelete = tempData.Feature.FeatureHtmlJsonDelete &&
tempData.Feature.FeatureHtmlJsonDelete != "" && tempData.Feature.FeatureType > 3 ?
JSON.parse(tempData.Feature.FeatureHtmlJsonDelete) :
null;
this.NoticeData.FeeInclude = tempData.Feature.FeeInclude;
this.NoticeData.FeeNonInclude = tempData.Feature.FeeNonInclude;
this.NoticeData.ImportantTip = tempData.Feature.ImportantTip;
this.NoticeData.WarmTip = tempData.Feature.WarmTip;
this.NoticeData.B2BRemark = tempData.Feature.B2BRemark;
this.NoticeData.ShopRemark = tempData.Feature.ShopRemark;
this.NoticeData.VisaRemark = tempData.Feature.VisaRemark;
}
if (tempData.PDFAlias !== null && tempData.PDFAlias !== "") {
this.FeatureData.Title = tempData.PDFAlias;
} else {
this.FeatureData.Title = tempData.Title;
}
if (tempData.PriceList != null) {
this.PriceList = tempData.PriceList;
}
this.FeatureData.Subtitle = tempData.LtName;
this.FeatureData.LineName = tempData.LineName;
this.FeatureData.DayList = tempData.DayList;
this.ConfigId = tempData.ID;
//HK 2019-01-08添加 NewConfigId B2B预览使用
this.NewConfigId = tempData.NewConfigId;
this.PostConfig.ID = tempData.ID;
this.PostConfig.StartCityId = tempData.StartCityId;
this.PostConfig.LineId = tempData.LineId;
this.PostConfig.LineteamId = tempData.LineteamId;
this.PostConfig.CountryID = tempData.CountryID;
//视频地址
this.PostConfig.VideoStr = tempData.VideoStr;
this.NoticeParameters.ConfigId = tempData.ConfigId;
this.NoticeParameters.CountryID = tempData.CountryID;
this.NoticeParameters.IsDirect = tempData.IsDirect;
this.NoticeParameters.LineId = tempData.LineId;
this.PostConfig.ImgCover = tempData.ImgCover;
this.PostConfig.LtName = tempData.LtName;
this.PostConfig.CreateBy = tempData.CreateBy;
if (tempData.ImgCover != "") {
if (tempData.ImgCoverList.length > 0) {
this.PostConfig.fileList = tempData.ImgCoverList;
}
} else {
this.initFileList();
}
this.PostConfig.Title = tempData.Title;
this.PostConfig.ProductRecommend = tempData.ProductRecommend;
this.PostConfig.IsSubstitution = tempData.IsSubstitution;
this.PostConfig.IsDirect = tempData.IsDirect;
this.PostConfig.PriceIsDirect = tempData.PriceIsDirect;
if (tempData.FlightList != null) {
this.PostConfig.FlightList = tempData.FlightList;
}
if (tempData.ShopList != null) {
this.PostConfig.ShopList = tempData.ShopList;
}
if (tempData.SelfpayingList != null) {
this.PostConfig.SelfpayingList = tempData.SelfpayingList;
}
this.journeyList.DayNum = tempData.DayNum;
this.journeyList.NightNum = tempData.NightNum;
this.journeyList.ReturnArriveCityId = tempData.ReturnArriveCityId;
this.journeyList.StartCityId = tempData.StartCityId;
this.journeyList.DayList = tempData.DayList;
this.journeyList.DayList.forEach(x => {
x["HotelChooseArray"] = [];
x["ChooseScenicArray"] = [];
x["isHide"] = false;
});
if (tempData.OfferList != null) {
this.OfferList = tempData.OfferList;
}
if (tempData.LineList != null) {
this.LineList = tempData.LineList;
}
if (tempData.AllCityList != null) {
this.AllCityList = tempData.AllCityList;
}
if (tempData.StartCity != null) {
this.StartCity = tempData.StartCity;
}
this.UseTypeArray = tempData.UseTypeArray;
this.AirPickUp = tempData.AirPickUp;
this.AirSend = tempData.AirSend;
this.PostConfig["OpenState"] = this.OpenState;
this.PostConfig.PDFAlias = tempData.PDFAlias;
} else {
this.Error(res.data.message);
}
this.loading = false;
},
err => {}
);
} else {
this.initFileList();
this.initFeatureFile();
this.loading = true;
this.apipost(
"travel_get_GetCommonTravelInfo", {
isSale: this.flagWangYue
},
res => {
if (res.data.resultCode == 1) {
var tempData = res.data.data;
if (tempData.LineList != null) {
let data = tempData.LineList;
let dataTwo = [];
if (this.flagWangYue) {
data.forEach(x => {
if (x.Is_PacketGroup == 1) {
dataTwo.push(x);
}
});
this.LineList = dataTwo;
} else {
this.LineList = tempData.LineList;
}
}
if (tempData.AllCityList != null) {
this.AllCityList = tempData.AllCityList;
}
if (tempData.StartCity != null) {
this.StartCity = tempData.StartCity;
}
this.UseTypeArray = tempData.UseTypeArray;
this.AirPickUp = tempData.AirPickUp;
this.AirSend = tempData.AirSend;
} else {
this.Error(res.data.message);
}
this.loading = false;
},
err => {}
);
}
},
goB2B() {
let userInfo = this.getLocalStorage();
var B2BDomain = userInfo.B2BDomain;
let configId = this.NewConfigId;
window.open(
B2BDomain + "/#/detailTwo/" +
encodeURIComponent(configId) + '/' + 0 +
"/preview",
"_blank"
);
},
},
updated: function () {
this.MsgBus.$emit('FeatureDataFlag');
},
watch: {},
mounted() {
this.ScrollMethod();
},
created() {
this.firstLoadConfigInfo();
}
};
</script>
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