Commit 52b85042 authored by zhengke's avatar zhengke

增加图片预览

parent 6bb0e749
<style>
.busInfo {
font-size: 12px;
}
.busInfo .bus_Notice {
color: #e95252;
margin: 20px 0;
}
.busInfo .bus_Title {
display: inline-block;
padding-left: 10px;
border-left: 3px solid #e95252;
margin-bottom: 20px;
}
.busInfo .bus_uu li {
float: left;
width: 280px;
}
.busInfo .bo_bus {
width: 100%;
background: #eee;
min-width: 1125px;
margin-bottom: 30px;
}
.busInfo .bo_bus th {
background: #edeef0;
height: 40px;
}
.busInfo .bo_bus tr {
height: 40px;
}
.busInfo .bo_bus td {
height: 50px;
text-align: center;
background-color: #fff;
padding:0 10px;
}
.busInfo .bus_uu em {
font-style: normal;
display: inline-block;
width: 60px;
}
.busInfo .areaInfo li {
width: auto;
margin-bottom: 30px;
}
.busInfo .subName {
padding: 5px 10px;
border: 1px solid #d1d1d1;
border-radius: 14px;
cursor: pointer;
}
.busInfo .spanCked {
border-color: #ff4400;
color: #ff4400;
}
.busInfo .carPlanOne span {
float: left;
margin-right: 3px;
}
.busInfo .otherSpan > span:first-child {
margin-left: 50px;
}
.busInfo .carPlanOne .el-input .el-input__inner,
.el-select .el-input {
height: 28px;
}
.busInfo .upBtnList {
margin: 20px 0 30px 20px;
}
.carInfo .el-input__inner {
height: 34px !important;
}
.disSpan {
background-color: #e4e7ed;
color: #c0c4cc;
}
.busInfoP{
display:inline-block;
}
.busInfoP :hover {
text-decoration: underline;
cursor: pointer;
}
.BusTyleFirst .w150{
margin-right:22px;
}
.busInfo {
font-size: 12px;
}
.busInfo .bus_Notice {
color: #e95252;
margin: 20px 0;
}
.busInfo .bus_Title {
display: inline-block;
padding-left: 10px;
border-left: 3px solid #e95252;
margin-bottom: 20px;
}
.busInfo .bus_uu li {
float: left;
width: 280px;
}
.busInfo .bo_bus {
width: 100%;
background: #eee;
min-width: 1125px;
margin-bottom: 30px;
}
.busInfo .bo_bus th {
background: #edeef0;
height: 40px;
}
.busInfo .bo_bus tr {
height: 40px;
}
.busInfo .bo_bus td {
height: 50px;
text-align: center;
background-color: #fff;
padding: 0 10px;
}
.busInfo .bus_uu em {
font-style: normal;
display: inline-block;
width: 60px;
}
.busInfo .areaInfo li {
width: auto;
margin-bottom: 30px;
}
.busInfo .subName {
padding: 5px 10px;
border: 1px solid #d1d1d1;
border-radius: 14px;
cursor: pointer;
}
.busInfo .spanCked {
border-color: #ff4400;
color: #ff4400;
}
/* .busInfo .carPlanOne span {
display: inline-block;
margin-right: 3px;
margin:5px 4px 5px 0;
} */
.BusinfoSpan{
display: inline-block;
margin-right: 3px;
margin:5px 4px 5px 0;
}
.busInfo .carPlanOne .el-input .el-input__inner,
.el-select .el-input {
height: 28px;
}
.busInfo .upBtnList {
margin: 20px 0 30px 20px;
}
.carInfo .el-input__inner {
height: 34px !important;
}
.disSpan {
background-color: #e4e7ed;
color: #c0c4cc;
}
.busInfoP {
display: inline-block;
}
.busInfoP :hover {
text-decoration: underline;
cursor: pointer;
}
.BusTyleFirst .w150 {
margin-right: 22px;
}
.busAddbtn {
display: inline-block;
width: 30px;
height: 30px;
border: 1px solid #d1d1d1;
text-align: center;
line-height: 30px;
border-radius: 50%;
cursor: pointer;
position: relative;
top: 2px;
}
.busAddbtn:hover i {
color: #e95252;
}
.carPlanOne .w320{
margin:5px 0;
}
</style>
<template>
<div class="flexOne busInfo">
<div class="bus_Notice">注:此处不和任何团队行程做绑定,如需下载车配表,请在车辆绑定团队以后再行下载</div>
<table class="singeRowTable">
<tr>
<td colspan="6">{{title}}</td>
</tr>
<tr>
<th>进出点</th>
<th>订单人数</th>
<th>机位总数</th>
<th>领队</th>
<th>导游</th>
<th>团号</th>
</tr>
<tr>
<td>{{InOut}}</td>
<td>{{RealityNum}}</td>
<td>{{totalFlySeat}}</td>
<td>{{LeaderName}}</td>
<td>{{GuideName}}</td>
<td><p class="busInfoP" @click="goUrlT('TravelControlList',TCNUMS,'团控列表')">{{TCNUMS}}</p></td>
</tr>
<tr>
<td colspan="6">{{title}}</td>
</tr>
<tr>
<th>进出点</th>
<th>订单人数</th>
<th>机位总数</th>
<th>领队</th>
<th>导游</th>
<th>团号</th>
</tr>
<tr>
<td>{{InOut}}</td>
<td>{{RealityNum}}</td>
<td>{{totalFlySeat}}</td>
<td>{{LeaderName}}</td>
<td>{{GuideName}}</td>
<td>
<p class="busInfoP" @click="goUrlT('TravelControlList',TCNUMS,'团控列表')">{{TCNUMS}}</p>
</td>
</tr>
</table>
<div style="width: 100%; overflow-x: auto;margin-top:20px;" class="ownScrollbarStyle">
<el-form :model="PostData" :rules="rules" ref="PostData">
<table class="bo_bus" cellspacing="1">
<tr>
<th width="150">日期</th>
<th width="300">酒店名称</th>
<th width="120">停车场</th>
<th width="280">用车计划</th>
<th width="200">订团号</th>
<th width="120">司机姓名</th>
<th width="120">联系电话</th>
<th width="250">司机住宿</th>
<th width="120">车辆类型</th>
<th width="120">使用人数</th>
<th width="120">车牌号码</th>
<th width="120">供应商</th>
<th>泊车说明</th>
<th>成本价</th>
<th width="120">中转次数</th>
<th width="120">小计</th>
</tr>
<tr v-for="(item,index) in PlanTableData">
<td>
<div class="w100">
{{item.PlanDateStr}}
</div>
</td>
<td>
<div class="w280">
{{item.HotelName}}
</div>
</td>
<td>
<div class="w50">
{{item.IsHavearking=='0'?'无':'有'}}
</div>
</td>
<td class="carPlanOne" :class="{'otherSpan':index!=0&&index!=PlanTableData.length-1}">
<div class="w320">
<!--接机送机-->
<em >
<span @click="item.AirportPickUp==0?item.AirportPickUp=1:item.AirportPickUp=0;getBusPrice(item)" v-if='index==0' class="subName" :class="{'spanCked':item.AirportPickUp==1,'disSpan':forbidInput==true}">{{AirPickUp}}</span>
<span @click="item.AirportPickUp==0?item.AirportPickUp=2:item.AirportPickUp=0;getBusPrice(item)" v-if='index==PlanTableData.length-1' class="subName" :class="{'spanCked':item.AirportPickUp==2,'disSpan':forbidInput==true}">{{AirSend}}</span>
</em>
<em v-if='index!=0&&index!=PlanTableData.length-1'>
<span @click="(item.AirportPickUp==0||item.AirportPickUp==2)?item.AirportPickUp=1:item.AirportPickUp=0;getBusPrice(item)" class="subName" :class="{'spanCked':item.AirportPickUp==1,'disSpan':forbidInput==true}">{{AirPickUp}}</span>
<span @click="(item.AirportPickUp==0||item.AirportPickUp==1)?item.AirportPickUp=2:item.AirportPickUp=0;getBusPrice(item)" class="subName" :class="{'spanCked':item.AirportPickUp==2,'disSpan':forbidInput==true}">{{AirSend}}</span>
</em>
<!--用车类型-->
<span v-for="subItem in UseTypeArray">
<span class="subName" :class="{'spanCked':item.UseType==subItem.Id,'disSpan':forbidInput==true}"
@click="UseTypeClick(subItem.Id,index);getBusPrice(item)">{{subItem.Name}}</span>
<span v-if="subItem.Id==3&& (index==0 || index==PlanTableData.length-1) ">
<el-input class="w50" v-model="item.UseTime" @input='getBusPrice(item)' :disabled="forbidInput"></el-input>
</span>
<span v-else-if="(subItem.Id==3 && item.UseType==3)">
<el-input class="w50" v-model="item.UseTime" @input='getBusPrice(item)' :disabled="forbidInput"></el-input>
</span>
</span>
</div>
</td>
<td>
<div class="w170">
<el-input class='w170' type="text" v-model="item.BookGroup"></el-input>
</div>
</td>
<td>
<el-input class="w135" v-model="item.DriverName"></el-input>
</td>
<td>
<el-input class="w135" v-model="item.DriverTel"></el-input>
</td>
<td class="carPlanOne">
<!--司机住宿类型-->
<div class="w260">
<span v-for="subItem in AccommodationTypeArray">
<span class="subName" :class="{'spanCked':item.AccommodationType==subItem.Id}" @click="AccommodationCLick(subItem.Id,index)">{{subItem.Name}}</span>
<span v-if="subItem.Id==1 && item.AccommodationType==1">
<el-input class="w135" v-model="item.AccommodationRemark" placeholder="请输入外宿地址"></el-input>
</span>
</span>
</div>
</td>
<td>
<div class="w180" :class="{'BusTyleFirst':index==0}">
<el-select clearable class="w150" filterable placeholder="请选择" v-model="item.BusType" :disabled="forbidInput" @change='getBusPrice(item)'>
<el-option v-for="item in BusTypeList" :key="item.Id" :label="item.newName" :value="item.Id">
<tr>
<th width="100">日期</th>
<th width="280">酒店名称</th>
<th width="50">停车场</th>
<th width="400">用车计划</th>
<th width="200">订团号</th>
<th width="100">司机姓名</th>
<th width="100">联系电话</th>
<th width="250">司机住宿</th>
<th>泊车说明</th>
<th width="120">车辆类型</th>
<th width="120">使用人数</th>
<th width="120">车牌号码</th>
<th width="120">供应商</th>
<th>成本价</th>
<th width="120">付款方式</th>
<th width="120">备注</th>
<th width="120">小计</th>
</tr>
<tr v-for="(item,index) in PlanTableData">
<td>
<div class="w100">
{{item.PlanDateStr}}
</div>
</td>
<td>
<div class="w280">
{{item.HotelName}}
</div>
</td>
<td>
<div class="w50">
{{item.IsHavearking=='0'?'无':'有'}}
</div>
</td>
<td class="carPlanOne" :class="{'otherSpan':index!=0&&index!=PlanTableData.length-1}">
<div class="w320" v-for="(subItem,subIndex) in item.DetailList">
<em>
<!--接机送机-->
<el-select class="w150" placeholder="请选择" v-model="subItem.AirportPickUp" :disabled="forbidInput">
<el-option :key="0" :value="0" label="请选择"></el-option>
<el-option v-for="childitem in BusAirportPickUpList" :key="childitem.Id" :label="childitem.Name"
:value="childitem.Id">
</el-option>
</el-select>
<el-tooltip class="item" effect="dark" content="同上" placement="top">
<i class="iconfont icon-tongshang" style="cursor:pointer;" v-if="index!=0" @click="getBeforeInfo(index)"></i>
</el-tooltip>
</div>
</td>
<td>
<div class="w80">
<el-input class="w50" v-model="item.UseNum" @keyup.native="checkPrice(item,'UseNum')"></el-input>
</div>
</td>
<td>
<div class="w150">
<el-input class="w135" v-model="item.BusNum"></el-input>
</div>
</td>
<td>
<div class="w200">
<el-select class="w150" filterable placeholder="请选择" v-model="item.BusCompany">
<el-option v-for="item in SupplierList" :key="item.ID" :label="item.Name" :value="item.ID"></el-option>
</el-select>
</div>
</td>
<td>
<div class="w150">
</em>
<!--用车类型-->
<span v-for="childItem in UseTypeArray" class="BusinfoSpan">
<span v-if="childItem.Id==1" class="subName"
:class="{'spanCked':subItem.UseType==childItem.Id,'disSpan':forbidInput==true}"
@click="UseTypeClick(childItem.Id,index,subIndex);getBusPrice(subItem)">{{childItem.Name}}</span>
</span>
<span style="width:30px;display:inline-block;" >
<a v-if="subIndex>0" @click="DeleteSubItem(item,subIndex)" style="color:blue;cursor:pointer">删除</a>
</span>
<span style="display:inline-block;width:30px;margin-left:5px;">
<span class="busAddbtn" v-if="subIndex==item.DetailList.length-1" @click="AddSubItem(item)" style="margin-bottom:10px;">
<i class="iconfont icon-img_haha"></i>
</span>
</span>
</div>
</td>
<td>
<el-input class='w170' type="text" v-model="item.BookGroup"></el-input>
</td>
<td>
<el-input class="w100" v-model="item.DriverName"></el-input>
</td>
<td>
<el-input class="w100" v-model="item.DriverTel"></el-input>
</td>
<td class="carPlanOne">
<!--司机住宿类型-->
<div class="w260">
<span v-for="subItem in AccommodationTypeArray">
<span class="subName" :class="{'spanCked':item.AccommodationType==subItem.Id}"
@click="AccommodationCLick(subItem.Id,index)">{{subItem.Name}}</span>
<span v-if="subItem.Id==1 && item.AccommodationType==1">
<el-input class="w135" v-model="item.AccommodationRemark" placeholder="请输入外宿地址"></el-input>
</span>
</span>
</div>
</td>
<td>
<div class="w150">
<el-input class="w135" v-model="item.ParkExplain" placeholder="请输入说明"></el-input>
</div>
</td>
<td>
<div class="w100">
</div>
</td>
<td>
<div class="w180" :class="{'BusTyleFirst':index==0}">
<el-select clearable class="w150" filterable placeholder="请选择" v-model="item.BusType"
:disabled="forbidInput" @change='getBusPrice(item)'>
<el-option :key="0" :value="0" label="请选择"></el-option>
<el-option v-for="item in BusTypeList" :key="item.Id" :label="item.newName" :value="item.Id">
</el-option>
</el-select>
<el-tooltip class="item" effect="dark" content="同上" placement="top">
<i class="iconfont icon-tongshang" style="cursor:pointer;" v-if="index!=0"
@click="getBeforeInfo(index)"></i>
</el-tooltip>
</div>
</td>
<td>
<div class="w80">
<el-input class="w50" v-model="item.UseNum" @keyup.native="checkPrice(item,'UseNum')"></el-input>
</div>
</td>
<td>
<div class="w150">
<el-input class="w135" v-model="item.BusNum"></el-input>
</div>
</td>
<td>
<div class="w200">
<el-select class="w150" filterable placeholder="请选择" v-model="item.BusCompany">
<el-option v-for="item in SupplierList" :key="item.ID" :label="item.Name" :value="item.ID">
</el-option>
</el-select>
</div>
</td>
<td>
<div class="w100">
<el-input class="w80" v-model="item.CostPrice" @keyup.native="checkPrice(item,'CostPrice')"
placeholder="请输入成本价"></el-input>
</div>
</td>
<td>
<div class="w80">
<el-input class='w50' type="text" v-model="item.TransferNum" @keyup.native="checkInteger(item,'TransferNum')"></el-input>
</div>
</td>
<td>
<div class="w80">
{{item.CostPrice*(Number(item.TransferNum)+1)}}
</div>
</td>
</tr>
</div>
</td>
<td>
<div class="w120">
<el-select class='w100 sel' v-model='item.PayType' :placeholder="$t('pub.pleaseSel')">
<el-option label='请选择' :value='0'></el-option>
<el-option label='现付' :value='1'></el-option>
<el-option label='公司结算' :value='2'></el-option>
<el-option label='预付' :value='3'></el-option>
</el-select>
</div>
</td>
<td>
<div class="w80">
<el-input class='w80' type="text" v-model="item.Remarks"></el-input>
</div>
</td>
<td>
<div class="w80">
{{item.CostPrice*(Number(item.TransferNum)+1)}}
</div>
</td>
</tr>
</table>
<div class="upBtnList">
<input type="button" class="normalBtn" @click="SaveList(0)" :disabled="disButton" value="保存草稿" />
<input type="button" class="normalBtn" @click="SaveList(0)" :disabled="disButton" value="保存草稿" />
<input type="button" class="normalBtn" @click="SaveList(1)" :disabled="disButton" value="保存" />
</div>
</el-form>
......@@ -253,510 +315,485 @@
</div>
</template>
<script>
export default {
data() {
return {
defaultSelectValue:0,
//车辆类型列表
BusTypeList: [],
/*供应商列表*/
SupplierList: [],
//地址参数
BusId: 0,
//地址参数
parametersData: {
TCID: 0,
StartDate: "",
DayNum: 0,
TotalNumber: 0
},
/*表单json*/
PostData: {
Id: 0,
BusCode: "",
DriverName: "",
DriverTel: "",
BusType: "",
CarrierNum: "",
BusNum: "",
StartDate: "",
UseDays: "",
SupplierId: "",
CostPrice: "",
SalesPrice: "",
Country: 0,
Province: 0,
City: 0,
District: 0,
PlanList: [],
TCID: 0
},
//禁用文本框
diabledValue: true,
/*计划表数据*/
forbidInput: false,
PlanTableData: [],
UseTypeArray: [], //用车类型
//接送机类型
AirPickUp: "",
AirSend: "",
//禁止重复提交禁用按钮
disButton: false,
//司机住宿类型
AccommodationTypeArray: [],
rules: {
//表单必填验证
BusCode: [
{
export default {
data() {
return {
defaultSelectValue: 0,
//车辆类型列表
BusTypeList: [],
/*供应商列表*/
SupplierList: [],
//地址参数
BusId: 0,
//地址参数
parametersData: {
TCID: 0,
StartDate: "",
DayNum: 0,
TotalNumber: 0
},
/*表单json*/
PostData: {
Id: 0,
BusCode: "",
DriverName: "",
DriverTel: "",
BusType: "",
CarrierNum: "",
BusNum: "",
StartDate: "",
UseDays: "",
SupplierId: "",
CostPrice: "",
SalesPrice: "",
Country: 0,
Province: 0,
City: 0,
District: 0,
PlanList: [],
TCID: 0
},
//禁用文本框
diabledValue: true,
/*计划表数据*/
forbidInput: false,
PlanTableData: [],
UseTypeArray: [], //用车类型
BusAirportPickUpList: [], //用车类型
//禁止重复提交禁用按钮
disButton: false,
//司机住宿类型
AccommodationTypeArray: [],
rules: {
//表单必填验证
BusCode: [{
required: true,
message: "请填写车配号",
trigger: "change"
}
],
DriverName: [
{
}],
DriverName: [{
required: true,
message: "请填写司机姓名",
trigger: "change"
}
],
DriverTel: [
{
}],
DriverTel: [{
required: true,
message: "请填写联系电话",
trigger: "change"
}
],
BusType: [
{
}],
BusType: [{
required: true,
message: "请选择车辆类型",
trigger: "change"
}
],
CarrierNum: [
{
required: true,
message: "请填写核载人数",
trigger: "change"
},
{
pattern: this.$commonUtils.Regex.el_isInteger,
message: "请输入正确的数字"
}
],
BusNum: [
{
}],
CarrierNum: [{
required: true,
message: "请填写核载人数",
trigger: "change"
},
{
pattern: this.$commonUtils.Regex.el_isInteger,
message: "请输入正确的数字"
}
],
BusNum: [{
required: true,
message: "请填写车牌号码",
trigger: "change"
}
],
StartDate: [
{
}],
StartDate: [{
required: true,
message: "请选择开始时间",
trigger: "change"
}
],
UseDays: [
{
required: true,
message: "请填写使用天数",
trigger: "change"
},
{
pattern: this.$commonUtils.Regex.el_isInteger,
message: "请输入正确的数字"
}
],
SupplierId: [
{
}],
UseDays: [{
required: true,
message: "请填写使用天数",
trigger: "change"
},
{
pattern: this.$commonUtils.Regex.el_isInteger,
message: "请输入正确的数字"
}
],
SupplierId: [{
required: true,
message: "请选择供应商",
trigger: "change"
}],
CostPrice: [{
pattern: this.$commonUtils.Regex.el_Isdecimal,
message: "请输入正确的价格"
},
{
required: true,
message: "请填写成本价",
trigger: "change"
}
],
SalesPrice: [{
pattern: this.$commonUtils.Regex.el_Isdecimal,
message: "请输入正确的价格"
},
{
required: true,
message: "请填写内部价",
trigger: "change"
}
]
},
//团名
title: '',
//团号
TCNUMS: '',
//进出点
InOut: '',
//订单人数
RealityNum: '',
//机位总数
totalFlySeat: '',
LeaderName: '',
GuideName: '',
};
},
methods: {
/*获取车辆成本价格*/
getBusPrice(obj) {
let money = 0
if (obj.BusType) {
let checkObj = this.BusTypeList.find(item => item.Id === obj.BusType)
if (checkObj) {
if (obj.AirportPickUp == 0) {
switch (obj.UseType) {
case 1:
money = checkObj.AllDayPrice
break;
case 2:
money = checkObj.HalfDayPrice
break;
case 3:
money = checkObj.HourPrice * obj.UseTime
break;
default:
money = 0
break;
}
} else if (obj.AirportPickUp == 1) {
switch (obj.UseType) {
case 1:
money = checkObj.AllDayPrice + checkObj.ReceivePrice
break;
case 2:
money = checkObj.HalfDayPrice + checkObj.ReceivePrice
break;
case 3:
money = checkObj.HourPrice * obj.UseTime + checkObj.ReceivePrice
break;
default:
money = checkObj.ReceivePrice
break;
}
} else {
switch (obj.UseType) {
case 1:
money = checkObj.AllDayPrice + checkObj.SendPrice
break;
case 2:
money = checkObj.HalfDayPrice + checkObj.SendPrice
break;
case 3:
money = checkObj.HourPrice * obj.UseTime + checkObj.SendPrice
break;
default:
money = checkObj.SendPrice
break;
}
}
}
],
CostPrice: [
{
pattern: this.$commonUtils.Regex.el_Isdecimal,
message: "请输入正确的价格"
obj.CostPrice = money
}
},
AddSubItem(item) {
item.DetailList.push({
DetailId: 0,
UseType: 0,
BusPlanId: 0,
AirportPickUp: 0
});
},
DeleteSubItem(item,index)
{
item.DetailList.splice(index,1);
},
/*获取车辆类型列表*/
getBusTypeList() {
this.apipost(
"bus_get_GetBusTypePriceList",
null,
res => {
if (res.data.resultCode == 1) {
this.BusTypeList = res.data.data;
this.BusTypeList.forEach(item => {
item['newName'] = item.AreaTypeStr + '-' + item.BusTypeStr
})
}
},
{
required: true,
message: "请填写成本价",
trigger: "change"
}
],
SalesPrice: [
{
pattern: this.$commonUtils.Regex.el_Isdecimal,
message: "请输入正确的价格"
null
);
},
/*获取供应商列表*/
getSupplierList() {
this.apipost(
"supplier_post_GetAllList", {
Type: 5
},
{
required: true,
message: "请填写内部价",
trigger: "change"
}
]
response => {
if (response.data.resultCode == 1) {
this.SupplierList = response.data.data;
}
},
null
);
},
//团名
title:'',
//团号
TCNUMS:'',
//进出点
InOut:'',
//订单人数
RealityNum:'',
//机位总数
totalFlySeat:'',
LeaderName:'',
GuideName:'',
};
},
methods: {
/*获取车辆成本价格*/
getBusPrice(obj){
let money=0
if(obj.BusType)
{
let checkObj=this.BusTypeList.find(item=>item.Id===obj.BusType)
if(checkObj){
if(obj.AirportPickUp==0)
{
switch (obj.UseType){
case 1:
money=checkObj.AllDayPrice
break;
case 2:
money=checkObj.HalfDayPrice
break;
case 3:
money=checkObj.HourPrice*obj.UseTime
break;
default:
money=0
break;
}
}else if(obj.AirportPickUp==1){
switch (obj.UseType){
case 1:
money=checkObj.AllDayPrice+checkObj.ReceivePrice
break;
case 2:
money=checkObj.HalfDayPrice+checkObj.ReceivePrice
break;
case 3:
money=checkObj.HourPrice*obj.UseTime+checkObj.ReceivePrice
break;
default:
money=checkObj.ReceivePrice
break;
}
}else{
switch (obj.UseType){
case 1:
money=checkObj.AllDayPrice+checkObj.SendPrice
break;
case 2:
money=checkObj.HalfDayPrice+checkObj.SendPrice
break;
case 3:
money=checkObj.HourPrice*obj.UseTime+checkObj.SendPrice
break;
default:
money=checkObj.SendPrice
break;
}
}
}
obj.CostPrice=money
}
},
/*获取车辆类型列表*/
getBusTypeList() {
this.apipost(
"bus_get_GetBusTypePriceList",
null,
res => {
if (res.data.resultCode == 1) {
console.log(res.data.data)
this.BusTypeList = res.data.data;
this.BusTypeList.forEach(item=>{
item['newName']=item.AreaTypeStr+'-'+item.BusTypeStr
})
}
},
null
);
},
/*获取供应商列表*/
getSupplierList() {
this.apipost(
"supplier_post_GetAllList",
{
Type: 5
},
response => {
if (response.data.resultCode == 1) {
this.SupplierList = response.data.data;
}
},
null
);
},
/*生成表格数据*/
createTableData() {
this.apipost(
"bus_get_GetTravelBusDetailsTCIDs",
{
TCIDs: this.parametersData.TCID
},
response => {
if (response.data.resultCode == 1) {
this.PlanTableData = response.data.data;
this.PlanTableData.forEach(x=>{
if(x.BookGroup==''||x.BookGroup==null){
/*生成表格数据*/
createTableData() {
this.apipost(
"bus_get_GetTravelBusDetailsTCIDs", {
TCIDs: this.parametersData.TCID
},
response => {
if (response.data.resultCode == 1) {
this.PlanTableData = response.data.data;
this.PlanTableData.forEach(x => {
if (x.BookGroup == '' || x.BookGroup == null) {
x.BookGroup = this.$route.query.NewCombinationNum;
}
})
console.log(this.PlanTableData,'plandata');
}
},
null
);
},
}
})
}
},
null
);
},
/*保存车辆基本信息*/
SaveData() {
this.PostData.PlanList = this.PlanTableData;
this.PostData.CarrierNum = parseInt(this.PostData.CarrierNum);
this.PostData.UseDays = parseInt(this.PostData.UseDays);
this.disButton = true;
this.PostData.PlanList.forEach(x => {
if (x.CostPrice == "") {
x.CostPrice = 0;
}
});
if (this.PostData.PlanList.length > 0) {
this.PostData.PlanList.forEach((x, index) => {
x.AirportPickUp = 0;
if (index == 0) {
x.AirportPickUp = 1;
} else if (index == this.PostData.PlanList.length - 1) {
x.AirportPickUp = 2;
/*保存车辆基本信息*/
SaveData() {
this.PostData.PlanList = this.PlanTableData;
this.PostData.CarrierNum = parseInt(this.PostData.CarrierNum);
this.PostData.UseDays = parseInt(this.PostData.UseDays);
this.disButton = true;
this.PostData.PlanList.forEach(x => {
if (x.CostPrice == "") {
x.CostPrice = 0;
}
});
}
this.apipost(
"bus_post_Set",
this.PostData,
res => {
this.disButton = false;
if (this.PostData.PlanList.length > 0) {
this.PostData.PlanList.forEach((x, index) => {
x.AirportPickUp = 0;
if (index == 0) {
x.AirportPickUp = 1;
} else if (index == this.PostData.PlanList.length - 1) {
x.AirportPickUp = 2;
}
});
}
this.apipost(
"bus_post_Set",
this.PostData,
res => {
this.disButton = false;
if (res.data.resultCode == 1) {
this.Success("保存成功!");
this.goUrl("busManage");
} else {
this.Error(res.data.message);
}
},
null
);
},
SaveList(type) {
this.PlanTableData.forEach(item => {
item.OrderState = type
})
this.apipost('bus_get_SetPlan', this.PlanTableData, res => {
if (res.data.resultCode == 1) {
this.Success("保存成功!");
this.goUrl("busManage");
} else {
this.Error(res.data.message);
}
},
null
);
},
SaveList(type){
this.PlanTableData.forEach(item=>{
item.OrderState=type
})
this.apipost('bus_get_SetPlan',this.PlanTableData,res=>{
if (res.data.resultCode == 1) {
this.Success("保存成功!");
this.MsgBus.$emit('msg')
} else {
this.Error(res.data.message);
}
},err=>{})
},
//用车类型点击事件
UseTypeClick(value, index) {
if (this.forbidInput == true) {
return;
}
if (
this.PlanTableData[index].UseType == "0" ||
this.PlanTableData[index].UseType != value
) {
this.PlanTableData[index].UseType = value;
} else if (this.PlanTableData[index].UseType == value) {
this.PlanTableData[index].UseType = "0";
}
},
//司机住宿点击事件
AccommodationCLick(value, index) {
if (
this.PlanTableData[index].AccommodationType == "0" ||
this.PlanTableData[index].AccommodationType != value
) {
this.PlanTableData[index].AccommodationType = value;
} else {
this.PlanTableData[index].AccommodationType = "0";
}
},
/*获取用车类型列表*/
GetUseTypeList() {
this.apipost(
"bus_get_GetUseTypeList",
null,
response => {
if (response.data.resultCode == 1) {
this.UseTypeArray = response.data.data;
}
},
null
);
},
/*获取接送机类型列表*/
GetAirportPickUpList() {
this.apipost(
"bus_get_GetAirportPickUpList",
null,
response => {
if (response.data.resultCode == 1) {
this.AirPickUp = response.data.data[0].Name;
this.AirSend = response.data.data[1].Name;
}
},
null
);
},
/*获取司机住宿类型列表*/
GeAccommodationTypeList() {
this.apipost(
"bus_get_GeAccommodationTypeList",
null,
response => {
if (response.data.resultCode == 1) {
this.AccommodationTypeArray = response.data.data;
}
},
null
);
},
getData() {
this.apipost(
"bus_get_Get",
{
ID: this.BusId
},
response => {
if (response.data.resultCode == 1) {
this.PostData = response.data.data;
if (this.PostData.PlanList.length > 0) {
this.PostData.PlanList.forEach((x, index) => {
if (index == this.PostData.PlanList.length - 1) {
x.AirportPickUp = 1;
}
});
}
this.PlanTableData = this.PostData.PlanList;
}
},
null
);
},
goUrl(path) {
this.$router.push({
path: path
});
},
goUrlT(path, TCNUMS, title) {
this.$router.push({
name: path,
query: {
tcmun:TCNUMS,
blank: 'y',
tab: title
}, err => {})
},
//用车类型点击事件
UseTypeClick(value, index,subIndex) {
if (this.forbidInput == true) {
return;
}
})
},
submitForm(addMsg) {
//提交创建、修改表单
let that = this;
that.$refs[addMsg].validate(valid => {
if (valid) {
that.SaveData(addMsg);
if (
this.PlanTableData[index].DetailList[subIndex].UseType == "0" ||
this.PlanTableData[index].DetailList[subIndex].UseType != value
) {
this.PlanTableData[index].DetailList[subIndex].UseType = value;
} else if (this.PlanTableData[index].DetailList[subIndex].UseType == value) {
this.PlanTableData[index].DetailList[subIndex].UseType = "0";
}
},
//司机住宿点击事件
AccommodationCLick(value, index) {
if (
this.PlanTableData[index].AccommodationType == "0" ||
this.PlanTableData[index].AccommodationType != value
) {
this.PlanTableData[index].AccommodationType = value;
} else {
return false;
this.PlanTableData[index].AccommodationType = "0";
}
});
},
resetForm(formName) {
//弹出框取消 初始化谈框内表单
this.$refs[formName].resetFields();
},
//计算总成本
CalculatePrice() {
var CoastPrice = this.$commonUtils.CaluJsonArraySum(
this.PlanTableData,
"CostPrice",
2
);
this.PostData.CostPrice = CoastPrice;
},
/*获取用车类型列表*/
GetUseTypeList() {
this.apipost(
"bus_get_GetUseTypeList",
null,
response => {
if (response.data.resultCode == 1) {
this.UseTypeArray = response.data.data;
}
},
null
);
},
/*获取接送机类型列表*/
GetAirportPickUpList() {
this.apipost(
"bus_get_GetAirportPickUpList",
null,
response => {
if (response.data.resultCode == 1) {
this.BusAirportPickUpList = response.data.data;
}
},
null
);
},
/*获取司机住宿类型列表*/
GeAccommodationTypeList() {
this.apipost(
"bus_get_GeAccommodationTypeList",
null,
response => {
if (response.data.resultCode == 1) {
this.AccommodationTypeArray = response.data.data;
}
},
null
);
},
getData() {
this.apipost(
"bus_get_Get", {
ID: this.BusId
},
response => {
if (response.data.resultCode == 1) {
this.PostData = response.data.data;
if (this.PostData.PlanList.length > 0) {
this.PostData.PlanList.forEach((x, index) => {
if (index == this.PostData.PlanList.length - 1) {
x.AirportPickUp = 1;
}
});
}
this.PlanTableData = this.PostData.PlanList;
}
},
null
);
},
goUrl(path) {
this.$router.push({
path: path
});
},
goUrlT(path, TCNUMS, title) {
this.$router.push({
name: path,
query: {
tcmun: TCNUMS,
blank: 'y',
tab: title
}
})
},
submitForm(addMsg) {
//提交创建、修改表单
let that = this;
that.$refs[addMsg].validate(valid => {
if (valid) {
that.SaveData(addMsg);
} else {
return false;
}
});
},
resetForm(formName) {
//弹出框取消 初始化谈框内表单
this.$refs[formName].resetFields();
},
//计算总成本
CalculatePrice() {
var CoastPrice = this.$commonUtils.CaluJsonArraySum(
this.PlanTableData,
"CostPrice",
2
);
this.PostData.CostPrice = CoastPrice;
},
//获取同上信息
getBeforeInfo(index) {
let oldPlanData = this.PlanTableData[index - 1];
let newPlanData = this.PlanTableData[index];
newPlanData.AirportPickUp = oldPlanData.AirportPickUp;
newPlanData.UseType = oldPlanData.UseType;
newPlanData.UseTime = oldPlanData.UseTime;
newPlanData.BookGroup = oldPlanData.BookGroup;
newPlanData.DriverName = oldPlanData.DriverName;
newPlanData.DriverTel = oldPlanData.DriverTel;
newPlanData.AccommodationType = oldPlanData.AccommodationType;
newPlanData.AccommodationRemark = oldPlanData.AccommodationRemark;
newPlanData.BusType = oldPlanData.BusType;
newPlanData.UseNum = oldPlanData.UseNum;
newPlanData.BusNum = oldPlanData.BusNum;
newPlanData.BusCompany = oldPlanData.BusCompany;
newPlanData.ParkExplain = oldPlanData.ParkExplain;
newPlanData.CostPrice = oldPlanData.CostPrice;
}
},
//获取同上信息
getBeforeInfo(index){
let oldPlanData = this.PlanTableData[index-1];
let newPlanData = this.PlanTableData[index];
// newPlanData.PlanDateStr = oldPlanData.PlanDateStr;
// newPlanData.HotelName = oldPlanData.HotelName;
// newPlanData.IsHavearking = oldPlanData.IsHavearking;
// newPlanData.AirportPickUp = oldPlanData.AirportPickUp;
// newPlanData.UseType = oldPlanData.UseType;
// newPlanData.UseTime = oldPlanData.UseTime;
newPlanData.BookGroup = oldPlanData.BookGroup;
newPlanData.DriverName = oldPlanData.DriverName;
newPlanData.DriverTel = oldPlanData.DriverTel;
newPlanData.AccommodationType = oldPlanData.AccommodationType;
newPlanData.AccommodationRemark = oldPlanData.AccommodationRemark;
newPlanData.BusType = oldPlanData.BusType;
// newPlanData.UseNum = oldPlanData.UseNum;
// newPlanData.BusNum = oldPlanData.BusNum;
// newPlanData.BusCompany = oldPlanData.BusCompany;
// newPlanData.ParkExplain = oldPlanData.ParkExplain;
// newPlanData.CostPrice = oldPlanData.CostPrice;
// newPlanData.TransferNum = oldPlanData.TransferNum;
}
},
mounted() {
this.GetUseTypeList();
this.GetAirportPickUpList();
this.GeAccommodationTypeList();
this.BusId = this.$route.query.id;
this.title = this.$route.query.title;
this.TCNUMS = this.$route.query.TCNUMS,
this.InOut = this.$route.query.InOut,
this.RealityNum = this.$route.query.RealityNum,
this.totalFlySeat = this.$route.query.TotalNumber+'/'+this.$route.query.RealityYSeatNum+'/'+
this.$route.query.RealityESeatNum+'/'+this.$route.query.RealityFSeatNum
this.LeaderName = this.$route.query.LeaderName,
this.GuideName = this.$route.query.GuideName
mounted() {
this.GetUseTypeList();
this.GetAirportPickUpList();
this.GeAccommodationTypeList();
this.BusId = this.$route.query.id;
this.title = this.$route.query.title;
this.TCNUMS = this.$route.query.TCNUMS,
this.InOut = this.$route.query.InOut,
this.RealityNum = this.$route.query.RealityNum,
this.totalFlySeat = this.$route.query.TotalNumber + '/' + this.$route.query.RealityYSeatNum + '/' +
this.$route.query.RealityESeatNum + '/' + this.$route.query.RealityFSeatNum
this.LeaderName = this.$route.query.LeaderName,
this.GuideName = this.$route.query.GuideName
if (this.BusId > 0) {
this.getData();
// this.forbidInput = true;
}
this.parametersData.TCID = this.$route.query.TCID;
this.parametersData.StartDate = this.$route.query.StartDate;
this.parametersData.DayNum = this.$route.query.DayNum;
this.parametersData.TotalNumber = this.$route.query.TotalNumber;
// if (this.parametersData.DayNum > 0) {
// this.PostData.StartDate = this.parametersData.StartDate;
// this.PostData.UseDays = this.parametersData.DayNum;
if (this.BusId > 0) {
this.getData();
}
this.parametersData.TCID = this.$route.query.TCID;
this.parametersData.StartDate = this.$route.query.StartDate;
this.parametersData.DayNum = this.$route.query.DayNum;
this.parametersData.TotalNumber = this.$route.query.TotalNumber;
this.PostData.TCID = this.parametersData.TCID;
this.PostData.CarrierNum = this.parametersData.TotalNumber;
this.createTableData();
// }
this.getBusTypeList();
this.getSupplierList();
}
};
</script>
this.getBusTypeList();
this.getSupplierList();
}
};
</script>
\ No newline at end of file
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