Commit 458ae181 authored by 黄奎's avatar 黄奎

页面修改

parent 631ea768
......@@ -42,6 +42,7 @@
<div class="trip_cover" v-show="pdfLoading" v-loading="pdfLoading"></div>
<el-row style="padding: 0 0 20px 0;box-shadow: 1px 10px 10px#e6e6e6;">
<el-col :span="14" class="row-aic">
<a id="pdfDownLoad" style="display:none;" target="_blank" href="http://www.baidu.com" download="xx.pdf">页面跳转</a>
<div class="el-dropdown-link" style=" height: 30px;
line-height: 30px;
background-color: #E95252;
......@@ -51,10 +52,11 @@
text-align: center;
border-radius: 4px;
cursor: pointer;
margin-left: 20px;"
@click="toPDF_2023(orderMsg.startDate + orderMsg.lineteamName+orderMsg.dayNum+'日游')">
2023版PDF
</div>
margin-left: 20px;" @click="toPDF_2023New(orderMsg.startDate + orderMsg.lineteamName+orderMsg.dayNum+'日游')">
2023版PDF
</div>
<!--&&isopOperation HK 注释 可以让销售修改基本信息-->
<input type="button" v-if="orderId>0" class="travelControlTripBtn" value="修改信息" @click="editMsgShow=true" />
<el-checkbox class="marginL11" v-model="isShowTime">显示行程日期</el-checkbox>
</el-col>
</el-row>
......@@ -84,7 +86,108 @@
</VisaInformation>
</div>
</div>
<el-dialog title="修改信息" custom-class="confirmOrder" :visible.sync="editMsgShow" center>
<el-form :model="editForm" label-width="100px">
<p class="edit_form_box_tit">集合地点&联系人</p>
<div class="edit_form_box">
<div>
<el-form-item label="本团领队">
<el-input v-model="editForm.leaderInfo"></el-input>
</el-form-item>
<el-form-item label="机场服务">
<el-input v-model="editForm.airportService"></el-input>
</el-form-item>
<el-form-item label="紧急联系人">
<el-input v-model="editForm.emergencyContact"></el-input>
</el-form-item>
</div>
<div>
<el-form-item label="集合时间">
<el-input v-model="editForm.gatheringTime"></el-input>
</el-form-item>
<el-form-item label="集合标识">
<el-input v-model="editForm.gatherIdent"></el-input>
</el-form-item>
<el-form-item label="集合地点">
<el-input v-model="editForm.gatheringAddress"></el-input>
</el-form-item>
</div>
</div>
<p class="edit_form_box_tit">航班信息</p>
<div class="TravelFlightList">
<el-form label-width="0">
<table class="TFTable">
<tr>
<th>航空公司</th>
<th>航班</th>
<th>起飞机场/时间</th>
<th>到达机场/时间</th>
<th>出发日期</th>
<th>到达日期</th>
<th>操作</th>
</tr>
<tr v-for="(priceFlight,index) in editForm.travelOrderFlightList" :key="priceFlight.code">
<td>
<el-select class="w120" :placeholder="$t('pub.pleaseSel')" filterable v-model="priceFlight.airLineID"
@change="airLineSelectChange(priceFlight.airLineID,priceFlight,1)">
<el-option :label="$t('pub.unlimitedSel')" :value="defaultSelectValue"></el-option>
<el-option v-for="item in airLineList" :label="item.AlName" :value="item.AirLineId"
:key="item.AirLineId"></el-option>
</el-select>
</td>
<td>
<el-select class="w120" :placeholder="$t('pub.pleaseSel')" filterable v-model="priceFlight.flightID"
@change="flightSelectChange(priceFlight.flightID,priceFlight)">
<el-option :label="$t('pub.unlimitedSel')" :value="defaultSelectValue"></el-option>
<el-option v-for="item in priceFlight.airportNameList" :label="item.Flight_number" :value="item.ID"
:key="item.ID"></el-option>
</el-select>
</td>
<td>{{priceFlight.departureAirPortName}} <template
v-if="priceFlight.departureTime&& priceFlight.departureTime!=''">{{priceFlight.departureTime}}</template>
</td>
<td>
{{priceFlight.arrivalAirPortName}}<template
v-if="priceFlight.arrivalTime && priceFlight.arrivalTime!=''">{{priceFlight.arrivalTime}}</template>
</td>
<td>
<el-date-picker class="w110" :clearable="false" v-model="priceFlight.startDate" type="date"
value-format="yyyy-MM-dd"></el-date-picker>
</td>
<td>
<el-date-picker class="w110" :clearable="false" v-model="priceFlight.arriveDate" type="date"
value-format="yyyy-MM-dd"></el-date-picker>
</td>
<td>
<el-tooltip class="item" effect="dark" content="删除" placement="top-start">
<el-button type="danger" icon="el-icon-delete" @click="removePriceFlight(index,priceFlight,1)"
circle></el-button>
</el-tooltip>
<el-tooltip class="item" v-if="index!=0" style="margin-left:0" effect="dark" content="上移"
placement="top-start">
<el-button type="danger" icon="iconfont icon-shangyi" @click="MoveItem(priceFlight,index,0)" circle>
</el-button>
</el-tooltip>
<el-tooltip class="item" v-if="index!=editForm.travelOrderFlightList.length-1" style="margin-left:0"
effect="dark" content="下移" placement="top-start">
<el-button type="danger" icon="iconfont icon-xiayi1" @click="MoveItem(priceFlight,index,1)" circle>
</el-button>
</el-tooltip>
</td>
</tr>
</table>
</el-form>
<div class="TFAddFlight" @click="addFlight()">
<i class="iconfont icon-img_haha"></i>添加
</div>
</div>
</el-form>
<div slot="footer" class="dialog-footer">
<button class="normalBtn" type="primary" @click="submitForm()">{{$t('pub.saveBtn')}}</button> &nbsp;
<button class="hollowFixedBtn" @click="editMsgShow = false">{{$t('pub.cancelBtn')}}</button>
<button class="normalBtn" type="primary" @click="backForm()">还原</button> &nbsp;
</div>
</el-dialog>
</div>
</template>
......@@ -183,6 +286,7 @@
this.isopOperation = this.$route.query.isopOperation;
this.getWxCode();
this.init();
this.initAirlines();
setTimeout(() => {
this.appendParent()
}, 2000)
......@@ -198,6 +302,102 @@
}
}, err => {})
},
//还原表单
backForm() {
var oldData = JSON.parse(JSON.stringify(this.SourceData));
this.editForm.orderId = this.$route.query.orderId;
this.editForm.leaderInfo = oldData.leaderInfo;
this.editForm.gatheringTime = oldData.gatheringTime;
this.editForm.airportService = oldData.airportService;
this.editForm.gatherIdent = oldData.gatherIdent;
this.editForm.emergencyContact = oldData.emergencyContact;
this.editForm.gatheringAddress = oldData.gatheringAddress;
this.editForm.flightInfoJson = "";
this.editForm.travelOrderFlightList = [];
this.editForm.travelOrderFlightList = oldData.travelOrderFlightList;
this.editForm.travelOrderFlightList.forEach((item) => {
this.airLineSelectChange(item.airLineID, item);
});
},
removePriceFlight: function (index, item, type) {
var that = this
that.Confirm("删除航班后将不能恢复?", function () {
if (index > -1) {
that.editForm.travelOrderFlightList.splice(index, 1)
}
});
},
airLineSelectChange: function (airLineId, item, type) {
item.airLineID = airLineId
this.airLineList.forEach(x => {
if (x.AirLineId == airLineId) {
item.alName = x.AlName
}
});
if (type == 1) {
item.flightID = 0;
item.flightNumber = "";
item.departureAirPortName = "";
item.departureTime = "";
item.arrivalAirPortName = "";
item.arrivalTime = "";
}
let msg = {
airlineID: airLineId
}
this.apipost(
'flight_post_GetAirportNameList',
msg,
res => {
if (res.data.resultCode == 1) {
item.airportNameList = res.data.data;
}
},
err => {}
)
this.$forceUpdate();
},
flightSelectChange(flightId, item) {
item.airportNameList.forEach(x => {
if (x.ID == flightId) {
item.flightNumber = x.Flight_number.split('/')[0];
item.departureAirPortName = x.dName;
item.departureTime = x.DepartureTime;
item.arrivalAirPortName = x.aName;
item.arrivalTime = x.ArrivalTime;
}
});
},
//初始化航空公司下拉
initAirlines: function () {
this.apipost(
'airline_post_GetList', {},
res => {
if (res.data.resultCode == 1) {
this.airLineList = res.data.data
}
},
err => {}
)
},
addFlight: function () {
let obj = {
airLineID: 0,
flightID: 0,
alName: '',
flightNumber: '',
startDate: '',
departureTime: '',
departureAirPortName: '',
arrivalTime: '',
arrivalAirPortName: '',
stopoverAirPortName: '',
flightState: 0,
arriveDate: '',
airportNameList: [],
}
this.editForm.travelOrderFlightList.push(obj)
},
setDate: function (j) {
let stDate = "";
if (this.priceList && this.priceList.length > 0) {
......@@ -294,25 +494,77 @@
"msg": msg
}
}).then(res => {
if (res.data.resultCode === 1&&res.data.data) {
if (res.data.resultCode === 1 && res.data.data) {
let sign = title + "V2"
const a = document.createElement('a');
a.setAttribute('download', '');
let path = res.data.data
a.setAttribute('href', 'https://microservice.oytour.com/task/create/pdf/'+encodeURIComponent(path));
a.setAttribute('href', 'https://microservice.oytour.com/task/create/pdf/' + encodeURIComponent(path));
a.click();
setTimeout(()=>{
setTimeout(() => {
this.pdfLoading = false
},25000)
}, 25000)
} else {
this.pdfLoading = false
this.$message.error('PDF获取失败');
}
}).catch(err => {
})
},
// 生成pdf
toPDF_2023New: function (title) {
var fileName = title + "_2023.pdf";
this.pdfLoading = true;
let urlObj = this.domainManager();
let msg = this.getPostMsg();
this.$http({
headers: {
'Content-Type': 'application/json'
},
method: 'post',
url: urlObj.DomainUrl + '/api/file/DownLoadPdf2023New',
data: {
"msg": msg
},
//responseType: 'arraybuffer'
}).then(res => {
console.log(res, "res");
// let blob = new Blob([res.data], {
// type: "application/pdf"
// })
// let url = URL.createObjectURL(blob);
var newUrl = "http://ocr.oytour.com" + res.data;
let link = document.getElementById('pdfDownLoad');
link.href = newUrl;
link.setAttribute("download", fileName);
link.click();
this.pdfLoading = false;
}).catch(err => {
this.pdfLoading = false
})
},
//保存基础数据
submitForm: function () {
this.editForm.travelOrderFlightList.forEach(x => {
x.airportNameList = [];
});
this.editForm.FlightInfoJson = JSON.stringify(this.editForm.travelOrderFlightList);
this.editForm.travelOrderFlightList = [];
this.apipost('sellorder_post_SetOrderTripDiff',
this.editForm,
res => {
if (res.data.resultCode == 1) {
this.Success(res.data.message);
this.editMsgShow = false;
this.init();
} else {
this.Error(res.data.message);
}
},
err => {}
)
},
DateDiff(sDate1, sDate2) { //sDate1和sDate2是2002-12-18格式
var aDate, oDate1, oDate2, iDays
aDate = sDate1.split("-")
......@@ -337,10 +589,75 @@
}, res => {
if (res.data.resultCode == 1) {
let data = (res.data.data);
this.dataAll = data
this.dataAll = data;
this.orderTripdiff = data.orderTripdiff;
this.lineId = data.lineId;
this.orderMsg = data.orderMsg;
if (this.orderTripdiff && this.orderTripdiff.flightInfoJson) {
this.orderTripdiff.travelOrderFlightList = JSON.parse(this.orderTripdiff.flightInfoJson);
if (this.orderMsg.outNotice == 1) {
if (this.orderTripdiff.travelOrderFlightList != null && this.orderTripdiff.travelOrderFlightList
.length > 0) {
this.orderTripdiff.travelOrderFlightList.forEach(subItem => {
subItem.flightState = 1;
});
}
}
}
//HK新加
this.SourceData.Id = 0;
if (this.$route.query.orderId > 0) {
this.SourceData.orderId = this.$route.query.orderId;
var str = "";
if (this.orderMsg.leaderName) {
str = this.orderMsg.leaderName;
}
if (this.orderMsg.leaderMobile) {
str += "/" + this.orderMsg.leaderMobile;
}
this.SourceData.leaderInfo = str;
this.SourceData.gatheringTime = this.orderMsg.gatheringTime;
this.SourceData.airportService = this.orderMsg.airportServicePerson + "/" + this.orderMsg
.airportServicePhone;
this.SourceData.gatherIdent = this.orderMsg.bName;
this.SourceData.emergencyContact = this.orderMsg.sellName + "/" + this.orderMsg.sellTel;
this.SourceData.gatheringAddress = this.orderMsg.gatheringAddress;
if (data.priceList != null && data.priceList.length > 0) {
var array = JSON.parse(JSON.stringify(data.priceList[0].priceFlight));
this.SourceData.travelOrderFlightList = [];
array.forEach(fItem => {
this.SourceData.travelOrderFlightList.push({
airLineID: fItem.airLineID,
flightID: fItem.flightID,
alName: fItem.alName,
flightNumber: fItem.flightNumber,
startDate: fItem.startDate,
departureTime: fItem.departureTime,
departureAirPortName: fItem.departureAirPortName,
arrivalTime: fItem.arrivalTime,
arrivalAirPortName: fItem.arrivalAirPortName,
stopoverAirPortName: fItem.stopoverAirPortName,
flightState: fItem.flightState,
arriveDate: fItem.arriveDate,
airportNameList: [],
});
});
}
if (this.orderTripdiff) {
this.editForm = JSON.parse(JSON.stringify(this.orderTripdiff));
if (this.orderTripdiff.flightInfoJson) {
this.editForm.travelOrderFlightList = JSON.parse(this.orderTripdiff.flightInfoJson);
}
} else {
this.editForm = JSON.parse(JSON.stringify(this.SourceData));
}
this.editForm.travelOrderFlightList.forEach(fItem => {
fItem.airportNameList = [];
this.airLineSelectChange(fItem.airLineID, fItem);
});
}
this.title = this.orderMsg.startDate + this.orderMsg.lineteamName + this.orderMsg.dayNum + '日游'
document.title = this.title;
//初始化行程
......
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