Commit 14e9eeb4 authored by 黄奎's avatar 黄奎

页面修改

parent 72dc437c
......@@ -36,8 +36,7 @@
</span>
</li>
<li><span><em>日期</em>
<el-date-picker v-model='msg.StartDate' value-format="yyyy-MM-dd" type="date"
:picker-options="beforeCheck">
<el-date-picker v-model='msg.StartDate' value-format="yyyy-MM-dd" type="date" :picker-options="beforeCheck">
</el-date-picker>
<el-date-picker v-model='msg.EndDate' value-format="yyyy-MM-dd" type="date" :picker-options="afterCheck">
</el-date-picker>
......@@ -53,21 +52,11 @@
</el-select> -->
</span>
</li>
<li>
<span>
<em>来源</em>
<el-select v-model="msg.SourceType" :placeholder="$t('pub.pleaseSel')">
<el-option :label="$t('pub.unlimitedSel')" :value='0'></el-option>
<el-option label="ERP" :value='1'></el-option>
<el-option label="PIC" :value='2'></el-option>
</el-select>
</span>
</li>
<li>
<input v-if="HOTEL_memorandum&&!pagesTitle" type="button" class="normalBtn" value="备忘录"
@click="goUrl('memorandumList')" />
<input v-if="!pagesTitle" type="button" class="normalBtn" value="温馨提示"
@click="showNotice=true" />
<input v-if="!pagesTitle" type="button" class="normalBtn" value="温馨提示" @click="showNotice=true" />
<button style="position: relative;" class="hollowFixedBtn" type="primary" @click="rightCarOpen=true">
<i class="el-icon-goods"></i>
购物车
......@@ -92,18 +81,15 @@
<span style="color:#000000;background-color: #808000;padding:2px 4px;border-radius:5px">行前日</span>
</div>
<template v-if="isShow">
<hotelTableList v-loading='loading' :list="dataList"
:tableHeight="tableHeight"
@showOrderSubmitHandler="showOrderSubmitHandler"
@success="success"
@close="close"></hotelTableList>
<hotelTableList v-loading='loading' :list="dataList" :tableHeight="tableHeight"
@showOrderSubmitHandler="showOrderSubmitHandler" @success="success" @close="close"></hotelTableList>
<div class="noDataNotice" v-if="dataList&&dataList.length==0">
<i class="iconfont icon-kong"></i>
<p>{{$t("active.ld_noData")}}</p>
</div>
<el-pagination v-if="dataList.length>0" background @current-change="handleCurrentChange"
:current-page.sync="msg.pageIndex"
layout="total,prev, pager, next, jumper" :page-size='msg.pageSize' :total='total'></el-pagination>
:current-page.sync="msg.pageIndex" layout="total,prev, pager, next, jumper" :page-size='msg.pageSize'
:total='total'></el-pagination>
</template>
</div>
......@@ -122,8 +108,7 @@
</template>
<!-- 暂存购物车 -->
<el-dialog custom-class="w800" title="酒店信息" :visible.sync="showOrderPreview" center @close="removeEditor">
<TableOperation :editorType="editorType" :HotelRow="orderSubmitObj"
:hotelInfor="orderSubmitItemObj"
<TableOperation :editorType="editorType" :HotelRow="orderSubmitObj" :hotelInfor="orderSubmitItemObj"
@close="close"></TableOperation>
</el-dialog>
<!-- 购物车 -->
......@@ -133,8 +118,8 @@
<hotelDetails :hotelId="HotelDetailId"></hotelDetails>
</el-dialog>
</div>
</template>
<script>
</template>
<script>
import SamplePriceList from './components/SamplePriceList'
import TableOperation from './components/TableOperation'
import ListCar from './components/ListCar'
......@@ -143,22 +128,27 @@
import WarmReminder from './components/WarmReminder'
import HotelTipTableList from './components/HotelTipTableList'
export default {
props:['pagesTitle'],
components: { SamplePriceList,
TableOperation,ListCar,
hotelDetails,hotelTableList,
WarmReminder,HotelTipTableList },
props: ['pagesTitle'],
components: {
SamplePriceList,
TableOperation,
ListCar,
hotelDetails,
hotelTableList,
WarmReminder,
HotelTipTableList
},
data() {
return {
showHotelDetails: false,
HotelDetailId: 0,
editorType:0,
editorType: 0,
rightCarOpen: false,
HotelLength: 0,
orderSubmitItemObj: {},
orderSubmitObj: {},
showOrderPreview: false,
total:0,
total: 0,
pickerOptions: {
disabledDate(time) {
return time.getTime() > Date.now();
......@@ -169,8 +159,8 @@
pageSize: 10,
//酒店选择数组
HotelChooseArray: [],
StartDate: this.getBeforeDate(0,new Date().Format("yyyy-MM-dd")),
EndDate: this.getBeforeDate(-30,this.getBeforeDate(0,new Date().Format("yyyy-MM-dd"))),
StartDate: this.getBeforeDate(0, new Date().Format("yyyy-MM-dd")),
EndDate: this.getBeforeDate(-30, this.getBeforeDate(0, new Date().Format("yyyy-MM-dd"))),
//只查询日本
Country: "651",
Province: 0,
......@@ -185,14 +175,14 @@
MaxPrice: 0,
MinPrice: 0,
HotelName: '',
SourceType:'',
SourceType: 1,
IsHotelAddPrice: 1
},
tableHeight: 0,
beforeCheck: {
disabledDate: time => {
if (this.msg.StartDate) {
let endTime = new Date(this.getBeforeDate(-3,new Date().Format("yyyy-MM-dd")));
let endTime = new Date(this.getBeforeDate(-3, new Date().Format("yyyy-MM-dd")));
return time && endTime.getTime() >= time.getTime();
} else {
return false;
......@@ -266,8 +256,8 @@
};
},
watch: {
dataList:{
handler(val, oldVal){
dataList: {
handler(val, oldVal) {
},
deep: true
......@@ -283,42 +273,41 @@
}
});
},
removeEditor(){
removeEditor() {
localStorage.removeItem('editor')
},
// 编辑购物车
editor(x){
this.dataList.forEach((item,index) => {
if(item.HotelId==x.HotelId){
item.subList.forEach((xs,indexs)=>{
if(xs.DateStr==x.Date){
editor(x) {
this.dataList.forEach((item, index) => {
if (item.HotelId == x.HotelId) {
item.subList.forEach((xs, indexs) => {
if (xs.DateStr == x.Date) {
this.rightCarOpen = false
this.showOrderSubmitHandler(item,indexs,1)
this.showOrderSubmitHandler(item, indexs, 1)
}
})
}
})
},
// 提交预约成功
success(){
success() {
this.close()
this.getList()
},
// 取消
close(){
this.HotelLength = localStorage.getItem("HotelLength")?localStorage.getItem("HotelLength"):0
close() {
this.HotelLength = localStorage.getItem("HotelLength") ? localStorage.getItem("HotelLength") : 0
this.showOrderPreview = false
this.rightCarOpen = false
this.showHotelDetails = false
localStorage.removeItem("editor")
},
// 加入购物车
showOrderSubmitHandler(row,index,type){
showOrderSubmitHandler(row, index, type) {
this.orderSubmitObj = row
this.orderSubmitItemObj = row.subList[index]
this.showOrderPreview = true
this.editorType = type?type:0
this.editorType = type ? type : 0
},
com_onresize() {
//clientHeight的值由DIV内容的实际高度和CSS中的padding值决定,
......@@ -333,10 +322,10 @@
getList() {
this.loading = true;
if (this.msg.StartDate == null) {
this.msg.StartDate = this.getBeforeDate(-20,new Date().Format("yyyy-MM-dd"));
this.msg.StartDate = this.getBeforeDate(-20, new Date().Format("yyyy-MM-dd"));
}
if (this.msg.EndDate == null) {
this.msg.EndDate = this.getBeforeDate(-30,this.getBeforeDate(-20,new Date().Format("yyyy-MM-dd")));
this.msg.EndDate = this.getBeforeDate(-30, this.getBeforeDate(-20, new Date().Format("yyyy-MM-dd")));
}
this.apipost("dict_post_HotelOffer_GetClientHotelStatics", this.msg,
res => {
......@@ -414,10 +403,10 @@
},
mounted() {
// crm自动登陆传过来的参数
if(this.$route.query.crmOrderObj){
if (this.$route.query.crmOrderObj) {
this.crmOrderObj = JSON.parse(this.$route.query.crmOrderObj)
}
this.HotelLength = localStorage.getItem("HotelLength")?localStorage.getItem("HotelLength"):0
this.HotelLength = localStorage.getItem("HotelLength") ? localStorage.getItem("HotelLength") : 0
let userinfo = this.getLocalStorage();
let ActionMenuCode = userinfo.ActionMenuCode;
......@@ -434,9 +423,9 @@
}
};
</script>
</script>
<style>
<style>
.Hq_duoge {
cursor: pointer;
text-decoration: underline;
......@@ -466,9 +455,11 @@
.classTe {
background-color: rgb(2, 247, 142);
}
.hotelQueryListclass6 {
background-color:#808000;
background-color: #808000;
}
.HouseTypeList {
background: #ccc;
width: 100%;
......@@ -564,13 +555,12 @@
.HotelQueryList .el-table td {
padding: 0;
}
.CostPriceHover{
height:100%;
float:left;
width:100%;
.CostPriceHover {
height: 100%;
float: left;
width: 100%;
cursor: pointer;
}
</style>
\ No newline at end of file
</style>
<style scoped>
.ModifyHotelOrder-OrderId{
.ModifyHotelOrder-OrderId {
display: flex;
justify-content: space-between;
align-items: center;
......@@ -9,53 +9,66 @@
font-size: 12px;
margin-top: 15px;
}
.ModifyHotelOrder-OrderId>div{
.ModifyHotelOrder-OrderId>div {
display: flex;
align-items: center;
}
.ModifyHotelOrder-OrderId>div:first-child{
.ModifyHotelOrder-OrderId>div:first-child {
color: #9E9E9E;
}
.ModifyHotelOrder-OrderId>div:nth-child(2){
.ModifyHotelOrder-OrderId>div:nth-child(2) {
color: #E76A42;
}
.ModifyHotelOrder-OrderId>div:nth-child(2)>span{
.ModifyHotelOrder-OrderId>div:nth-child(2)>span {
font-weight: bold;
color: #009EF7;
}
.ModifyHotelOrder-OrderId>div:nth-child(2)>span:first-child{
.ModifyHotelOrder-OrderId>div:nth-child(2)>span:first-child {
color: #E65152;
}
.ModifyHotelOrder-OrderId>div:nth-child(3){
.ModifyHotelOrder-OrderId>div:nth-child(3) {
color: #F25971;
}
.ModifyHotelOrder-OrderId>div:nth-child(3)>span:first-child{
.ModifyHotelOrder-OrderId>div:nth-child(3)>span:first-child {
font-size: 16px;
}
.ModifyHotelOrder-OrderId>div:nth-child(3)>b{
.ModifyHotelOrder-OrderId>div:nth-child(3)>b {
font-size: 20px;
}
.ModifyHotelOrder-OrderId>div:last-child{
.ModifyHotelOrder-OrderId>div:last-child {
display: flex;
font-size: 16px;
}
.ModifyHotelOrder-OrderInfor{
.ModifyHotelOrder-OrderInfor {
padding: 10px 15px;
border-radius: 5px;
background: #ffffff;
margin-top: 15px;
}
.ModifyHotelOrder-OrderInfor p{
.ModifyHotelOrder-OrderInfor p {
color: #C1C1C1;
font-size: 14px;
}
.ModifyHotelOrder-content{
.ModifyHotelOrder-content {
display: flex;
align-items: flex-start;
flex-wrap: wrap;
margin-top: 15px;
}
.content-box{
.content-box {
width: 320px;
display: flex;
flex-direction: column;
......@@ -64,24 +77,29 @@
margin: 0 10px 10px 0;
overflow: hidden;
}
.content-header{
.content-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 15px 10px;
}
.content-header span{
.content-header span {
font-size: 17px;
}
.content-header i{
.content-header i {
color: #009EF7;
cursor: pointer;
}
.content-header i:last-child{
.content-header i:last-child {
color: #F1416C;
margin-left: 15px;
}
.content-Car{
.content-Car {
background: #ECEFF1;
border-radius: 5px;
padding: 10px 5px;
......@@ -89,7 +107,8 @@
margin-bottom: 10px;
font-size: 12px;
}
.content-Car-title{
.content-Car-title {
font-size: 14px;
font-weight: 400;
color: #009EF7;
......@@ -98,49 +117,60 @@
justify-content: space-between;
border-bottom: 1px dashed rgba(96, 125, 139, 0.2);
}
.content-Car-title span{
.content-Car-title span {
width: 80%;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.content-Car-title i{
.content-Car-title i {
color: #F1416C;
cursor: pointer;
display: none;
}
.content-Car-title:hover i{
.content-Car-title:hover i {
display: block;
}
.content-Car-num{
.content-Car-num {
padding: 7px 5px;
align-items: center;
}
.content-Car-num>div:last-child .num-roomtype{
.content-Car-num>div:last-child .num-roomtype {
padding: 0;
}
.num-roomtype{
.num-roomtype {
padding: 0 0 15px 0;
color: #181C32;
}
.num-roomtype span{
.num-roomtype span {
color: #6F8A96;
display: block;
padding: 3px 0 0 0;
}
.num-roomnum{
.num-roomnum {
color: #9E9E9E;
}
.num-roomnum span{
.num-roomnum span {
color: #F5831E;
font-weight: bold;
}
.noroomtype{
.noroomtype {
padding: 10px 5px;
color: #6F8A96;
font-size: 12px;
}
.content-Car-shui{
.content-Car-shui {
display: flex;
justify-content: space-between;
align-items: center;
......@@ -151,18 +181,21 @@
padding: 7px 0;
margin: 0 5px;
}
.content-Car-heji{
.content-Car-heji {
padding: 7px 5px 0 0;
display: flex;
justify-content: end;
font-size: 14px;
color: #1CA8F6;
}
.content-Car-heji span span{
.content-Car-heji span span {
font-size: 15px;
font-weight: bold;
}
.content-picker-text{
.content-picker-text {
height: 192px;
display: flex;
flex-direction: column;
......@@ -170,35 +203,43 @@
align-items: center;
font-size: 14px;
}
.content-picker-text>div:first-child span{
.content-picker-text>div:first-child span {
border: 1px solid #47B6F5;
padding: 5px 15px;
border-radius: 3px;
cursor: pointer;
color: #47B6F5;
}
.content-picker-text>div:last-child{
.content-picker-text>div:last-child {
margin-top: 20px;
}
.content-picker-text>div:last-child span{
.content-picker-text>div:last-child span {
color: #A5B5BE;
}
/deep/.content-Car .el-input-number .el-input__inner{
/deep/.content-Car .el-input-number .el-input__inner {
height: 30px;
}
/deep/.content-Car .el-input-number{
/deep/.content-Car .el-input-number {
width: 100%;
line-height: 30px;
}
/deep/.content-Car .el-input-number__increase{
/deep/.content-Car .el-input-number__increase {
width: 25px !important;
height: 28px !important;
}
/deep/.content-Car .el-input-number__decrease{
/deep/.content-Car .el-input-number__decrease {
width: 25px !important;
height: 28px !important;
}
/deep/.content-Car .el-input-number .el-input__inner{
/deep/.content-Car .el-input-number .el-input__inner {
padding-left: 20px;
padding-right: 20px;
}
......@@ -211,8 +252,10 @@
<div>
订单编号 {{ order.OrderNo }}
</div>
<div>本次行程<span v-if="order.DetailList">{{ order.DetailList.length }}</span>天,入住<span>{{ order.HotelCount }}</span>个酒店</div>
<div>订单总金额:<span><!-- ¥ --></span><b v-if="order.Money">{{ moneyFormat(order.Money) }}</b></div>
<div>本次行程<span
v-if="order.DetailList">{{ order.DetailList.length }}</span>天,入住<span>{{ order.HotelCount }}</span>个酒店</div>
<div>订单总金额:<span>
<!-- ¥ --></span><b v-if="order.Money">{{ moneyFormat(order.Money) }}</b></div>
<div>
<button class="hollowFixedBtn" @click="cancelOrder">取消订单</button>
<button class="normalBtn" @click="saveOrderHandler">保存订单</button>
......@@ -285,7 +328,8 @@
<p class="num-roomnum">预计<span>{{ z.Number }}</span>间房</p>
</el-col>
<el-col :span="9">
<el-input-number v-model="z.PeopleNumber" :min="0" :step="1" step-strictly @change="calcPeople"></el-input-number>
<el-input-number v-model="z.PeopleNumber" :min="0" :step="1" step-strictly @change="calcPeople">
</el-input-number>
</el-col>
</el-row>
</div>
......@@ -303,7 +347,8 @@
<span>入汤税: {{ moneyFormat(y.PriceInTangTax) }}/人</span>
</div>
<div class="content-Car-heji">
<span>合计:<span><!-- ¥ -->円{{ moneyFormat(y.HotelMoeny) }}</span></span>
<span>合计:<span>
<!-- ¥ -->円{{ moneyFormat(y.HotelMoeny) }}</span></span>
</div>
</div>
</div>
......@@ -315,7 +360,8 @@
<div class="content-header" style="padding: 9px 10px;">
<span>新日期预定</span>
<div>
<el-date-picker class="w150" v-model="newDate" type="date" value-format="yyyy-MM-dd" placeholder="请选择日期" :picker-options="beforeCheck"></el-date-picker>
<el-date-picker class="w150" v-model="newDate" type="date" value-format="yyyy-MM-dd" placeholder="请选择日期"
:picker-options="beforeCheck"></el-date-picker>
</div>
</div>
<div class="content-Car content-picker-text">
......@@ -332,34 +378,14 @@
<el-dialog v-show="showChosenHotel" custom-class="w800" title="酒店检索" :visible.sync="showChosenHotel" center>
<ChosenHotel :newDate="newDate" @finish="finishHanler"></ChosenHotel>
</el-dialog>
<el-dialog
custom-class="w600"
title="取消订单"
:visible.sync="cancelOrderDialog"
>
<el-dialog custom-class="w600" title="取消订单" :visible.sync="cancelOrderDialog">
<div style="padding-bottom:20px">
<el-input
type="textarea"
autofocus
rows="5"
placeholder="请填写取消订单的缘由"
clear="w300"
v-model="cancelRemark"
></el-input>
<el-input type="textarea" autofocus rows="5" placeholder="请填写取消订单的缘由" clear="w300" v-model="cancelRemark">
</el-input>
<el-row :gutter="20" style="margin-top: 20px;">
<el-col :span="24" style="text-align: right;">
<input
type="button"
class="normalBtn"
value="取消订单"
@click="cancelOrderHandler"
/>
<input
type="button"
class="hollowFixedBtn"
value="关闭"
@click="cancelOrderDialog = false"
/>
<input type="button" class="normalBtn" value="取消订单" @click="cancelOrderHandler" />
<input type="button" class="hollowFixedBtn" value="关闭" @click="cancelOrderDialog = false" />
</el-col>
</el-row>
</div>
......@@ -369,26 +395,33 @@
<script>
import ChosenHotel from './components/ChosenHotel.vue';
export default {
components: { ChosenHotel },
components: {
ChosenHotel
},
data() {
return {
newDate: this.getBeforeDate(-20,new Date().Format("yyyy-MM-dd")),
newDate: this.getBeforeDate(-20, new Date().Format("yyyy-MM-dd")),
orderId: 0,
order: {},//下单信息
order: {}, //下单信息
loading: false,
status: this.getHotelOrderStatus(),//状态
rooms: this.getHotelRoomType(),//房型
status: this.getHotelOrderStatus(), //状态
rooms: this.getHotelRoomType(), //房型
limitGuestNum: [2, 1, 1, 3, 1],
showChosenHotel: false,
tempHotels: {
key: '',
data: []
},
cacheHotels: [
{ Name: '散客', ID: 1 },
{ Name: '团队', ID: 2 }
cacheHotels: [{
Name: '散客',
ID: 1
},
{
Name: '团队',
ID: 2
}
],
rules:{
rules: {
OrderType: [{
required: true,
message: '请选择类型',
......@@ -399,8 +432,11 @@
message: '请输入散客姓名',
trigger: 'blur'
}],
ContactNumber: [
{ required: true, message: "请输入联系电话", trigger: "blur" },
ContactNumber: [{
required: true,
message: "请输入联系电话",
trigger: "blur"
},
{
pattern: this.$commonUtils.Regex.el_ISphone,
message: "请输入正确的电话"
......@@ -414,11 +450,11 @@
},
beforeCheck: {
disabledDate: time => {
let endTime = new Date(this.getBeforeDate(-19,new Date().Format("yyyy-MM-dd")));
let endTime = new Date(this.getBeforeDate(-19, new Date().Format("yyyy-MM-dd")));
return time && endTime.getTime() >= time.getTime();
}
},
pagesTitle:'',
pagesTitle: '',
cancelRemark: '',
cancelOrderDialog: false
};
......@@ -436,16 +472,16 @@
});
},
// 保存订单
saveOrderHandler(){
if(this.loading) return
let detailList=[]
this.order.DetailList.forEach((x)=>{
saveOrderHandler() {
if (this.loading) return
let detailList = []
this.order.DetailList.forEach((x) => {
detailList.push(...x.data)
})
detailList.forEach((x)=>{
x.RoomList = x.RoomList.filter((y)=>y.Number>0)
detailList.forEach((x) => {
x.RoomList = x.RoomList.filter((y) => y.Number > 0)
})
detailList = detailList.filter((x)=>x.RoomList.length>0)
detailList = detailList.filter((x) => x.RoomList.length > 0)
let parameter = JSON.parse(JSON.stringify(this.order))
parameter.DetailList = detailList
this.loading = true
......@@ -455,12 +491,13 @@
if (res.data.resultCode == 1) {
this.Success('保存成功');
let path = ''
if(this.pagesTitle=='销售'){
if (this.pagesTitle == '销售') {
path = 'singleProductHotelOrder'
}if(this.pagesTitle=='OP'){
}
if (this.pagesTitle == 'OP') {
path = 'singleProductHotelOrderOP'
}
if(!this.pagesTitle) return
if (!this.pagesTitle) return
this.$router.push({
name: path
});
......@@ -503,15 +540,14 @@
type: 'warning'
}).then(() => {
this.apipost(
"dict_post_CancelAdminCustomerOrder",
{
"dict_post_CancelAdminCustomerOrder", {
OrderId: this.orderId,
CancelRemark: this.cancelRemark
},res => {
}, res => {
if (res.data.resultCode == 1) {
this.Success(res.data.message);
let path = 'singleProductHotelOrderOP'
if(!this.pagesTitle) return
if (!this.pagesTitle) return
this.$router.push({
name: path
});
......@@ -524,15 +560,15 @@
this.loading = false;
});
}).catch(()=>{
}).catch(() => {
this.loading = false
})
},
// 取消订单
cancelOrder() {
if(this.pagesTitle!='销售'){
if (this.pagesTitle != '销售') {
this.cancelOrderDialog = true
}else{
} else {
if (this.loading) return;
this.loading = true
let that = this
......@@ -543,33 +579,32 @@
}).then(() => {
this.apipost("dict_post_CancelSaleCustomerOrder", {
OrderId: this.orderId
},res => {
this.loading= false
}, res => {
this.loading = false
if (res.data.resultCode == 1) {
this.Success(res.data.message);
let path = 'singleProductHotelOrder'
if(!this.pagesTitle) return
if (!this.pagesTitle) return
this.$router.push({
name: path
});
} else {
this.Error(res.data.message);
}
}).catch(err=>{
}).catch(err => {
this.Error(err.message)
this.loading= false
this.loading = false
})
}).catch(()=>{
}).catch(() => {
this.loading = false
})
}
},
//删除酒店
deleteHotelsHandler(x, y) {
let that = this
that.$confirm(`是否确定删除${this.order.DetailList[x].key}${y > -1 ? this.order.DetailList[x].data[y].HotelName : ''}?`, '提示', {
that.$confirm(
`是否确定删除${this.order.DetailList[x].key}${y > -1 ? this.order.DetailList[x].data[y].HotelName : ''}?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
......@@ -614,7 +649,7 @@
TaxesPrice: hp.TaxesPrice
}
this.rooms.forEach((x) => {
if (hp[x.Field? x.Field:''] > 0) {
if (hp[x.Field ? x.Field : ''] > 0) {
hotel.RoomList.push({
Destription: '',
IsSelf: true,
......@@ -624,7 +659,7 @@
RoomInfo: x,
RoomType: x.TypeId,
RoomName: x.TypeName,
Unit_Price: hp[x.Field ? x.Field:'']
Unit_Price: hp[x.Field ? x.Field : '']
})
}
})
......@@ -650,17 +685,17 @@
this.cancelHotelCount()
},
chosenNewHotel(key) {
if(key){
if (key) {
this.newDate = key
}
if(!this.newDate) return this.Error('请先选择日期')
if (!this.newDate) return this.Error('请先选择日期')
this.showChosenHotel = true
},
// 计算房间
calcPeople(hotel) {
this.order.DetailList.forEach(x=>{
x.data.forEach(y=>{
y.RoomList.forEach(z=>{
this.order.DetailList.forEach(x => {
x.data.forEach(y => {
y.RoomList.forEach(z => {
let t = z
t.Number = Math.ceil(t.PeopleNumber / this.limitGuestNum[t.RoomType - 1])
t.Money = t.PeopleNumber * t.Number
......@@ -687,8 +722,8 @@
this.order.Money = 0
this.order.DetailList.forEach((x) => {
this.order.HotelCount += x.data.length
x.data.forEach((y)=>{
this.order.Money+=y.HotelMoeny
x.data.forEach((y) => {
this.order.Money += y.HotelMoeny
})
})
},
......@@ -700,7 +735,7 @@
this.loading = false;
if (r.data.resultCode == 1) {
this.order = r.data.data
this.order.typeInfo = this.status.find(y => y.StatusId == this.order.OrderStatus)? this.status[1] : {}
this.order.typeInfo = this.status.find(y => y.StatusId == this.order.OrderStatus) ? this.status[1] : {}
this.order.DetailList.forEach((y) => {
let PeopleNum = 0
y.RoomList.forEach((z) => {
......@@ -724,8 +759,8 @@
err => {}
);
},
groupBy(array, f){
const groups= {}
groupBy(array, f) {
const groups = {}
array.forEach((item) => {
const group = JSON.stringify(f(item));
groups[group] = groups[group] || [];
......@@ -733,8 +768,8 @@
});
return Object.keys(groups).map((group) => {
return {
key:group.replace(/\"/g,""),
data:groups[group]
key: group.replace(/\"/g, ""),
data: groups[group]
};
});
},
......@@ -762,14 +797,15 @@
if (r.data.data.pageData.length > 0) {
let temp = r.data.data.pageData[0].subList[0].PriceList[0]
this.rooms.forEach((x) => {
if (hotel.RoomList.findIndex((y) => y.RoomType == x.TypeId) == -1 && temp[x.Field ? x.Field:''] > 0) {
if (hotel.RoomList.findIndex((y) => y.RoomType == x.TypeId) == -1 && temp[x.Field ? x.Field :
''] > 0) {
hotel.RoomList.push({
Description: '',
Money: 0,
PeopleNumber: 0,
RoomType: x.TypeId,
RoomTypeName: x.TypeName,
Unit_Price: temp[x.Field ? x.Field:''],
Unit_Price: temp[x.Field ? x.Field : ''],
RoomInfo: x,
IsSelf: false
})
......@@ -783,37 +819,37 @@
})
},
// 房型
getHotelRoomType(getNormal){
getHotelRoomType(getNormal) {
let rooms = []
if(getNormal){
if (getNormal) {
rooms.push({
TypeId:0,
TypeName:'全部房型'
TypeId: 0,
TypeName: '全部房型'
})
}
let roomLangs=['标准','大床房','自然单间','三人间','司机间']
let roomLangs = ['标准', '大床房', '自然单间', '三人间', '司机间']
let fileds = ['CostPrice', 'BidroomPrice', 'SingleroomPrice', 'AddBedPrice', 'GuideRoomPrice']
roomLangs.forEach((x,i)=>{
roomLangs.forEach((x, i) => {
rooms.push({
TypeId:(i+1),
TypeName:x,
Field:fileds[i]
TypeId: (i + 1),
TypeName: x,
Field: fileds[i]
})
})
return rooms
},
// 状态
getHotelOrderStatus(){
let status=[]
let text = ['全部订单','待确认','已确认','已取消','收损订单']
let color = ['','positive','dark','orange','negative']
let icons = ['','update','done','offline_bolt','cached']
text.forEach((x,i)=>{
getHotelOrderStatus() {
let status = []
let text = ['全部订单', '待确认', '已确认', '已取消', '收损订单']
let color = ['', 'positive', 'dark', 'orange', 'negative']
let icons = ['', 'update', 'done', 'offline_bolt', 'cached']
text.forEach((x, i) => {
status.push({
StatusId:i,
StatusName:x,
Icon:icons[i],
Color:`text-${color[i]}`
StatusId: i,
StatusName: x,
Icon: icons[i],
Color: `text-${color[i]}`
})
})
return status
......
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