Commit 087fe6ce authored by 黄奎's avatar 黄奎

新增订房查询页面

parent df0a4a45
<template>
<div>
<div class="query-box" style="border-bottom: none;">
<ul>
<li>
<span><em>出团公司</em>
<el-select filterable v-model='msg.RB_Branch_id' :placeholder="$t('pub.unlimitedSel')">
<el-option :label="$t('pub.unlimitedSel')" :value='-1'></el-option>
<el-option v-for='item in companyList' :label='item.BName' :value='item.Id' :key="item.Id">
</el-option>
</el-select>
</span>
</li>
<li><span><em>系列</em>
<el-select v-model="msg.LineteamId" filterable :placeholder="$t('pub.pleaseSel')">
<el-option label="不限" value='-1'></el-option>
<el-option v-for="item in LineTeamList" :label='item.LtName' :value='item.LtID' :key='item.LtID'>
</el-option>
</el-select>
</span>
</li>
<li>
<span>
<em>订团号</em>
<el-input v-model='msg.TCNUM' class='w135'></el-input>
</span>
</li>
<li>
<span>
<em>团号</em>
<el-input v-model='msg.NewCombinationNum' class='w135'></el-input>
</span>
</li>
<li><span><em>出发日期</em>
<el-date-picker v-model='msg.StartDate' class='w135' value-format="yyyy-MM-dd" type="date"></el-date-picker>
-
<el-date-picker v-model='msg.EndDate' class='w135' value-format="yyyy-MM-dd" type="date"></el-date-picker>
</span>
</li>
<li>
<span>
<em>酒店</em>
<el-select v-model="msg.HotelId" :placeholder="$t('pub.pleaseSel')" filterable>
<el-option :label="$t('pub.unlimitedSel')" :value='0'></el-option>
<el-option v-for="item in HotelList" :key="item.ID" :label="item.Name" :value="item.ID"></el-option>
</el-select>
</span>
</li>
<li>
<input type="button" class="normalBtn" value="查询" @click="getList();resetPageIndex()" />
</li>
</ul>
</div>
<div style="width: 100%; overflow-x: auto;padding-bottom: 10px; " class="ownScrollbarStyle">
<table border="0" cellspacing="1" cellpadding="0" class="roomReservationsTalbe" v-loading='loading'>
<tr>
<th width="w100">序号</th>
<th width="120">出发地</th>
<th width="80">公司团号</th>
<th width="120">机位总数<br/>(Y/E/F)</th>
<th></th>
<th v-for='item in thLengthTitle'>{{item}}</th>
<th></th>
</tr>
<tr v-if="list.length==0">
<td colspan="10">暂无数据</td>
</tr>
<tbody v-for="(outItem,outindex) in list" :class="{roomReservationsSplitTrCss:outindex%2!=0}">
<template v-for="(item,index) in outItem.StaticsReportList">
<tr>
<td :rowspan="outItem.StaticsReportList.length" v-if='index==0'>
<div style="max-width: 100px; min-width: 50px;margin:auto;">{{outindex+1}}</div>
<div v-if='outItem.StaticsReportList.length>0' class="w150">{{outItem.NewCombinationNum}}</div>
</td>
<td>
<div class="w80">
{{item.StartCityNames}}
</div>
</td>
<td>
<div class="w120 link">
<p @click="goUrlT('productQuery',item.TCNUMS,'产品查询')">{{item.TCNUMS}}</p>
</div>
</td>
<td>
<div class="w120 link">
<p @click="goUrlT('RegistrationList',item.TCIDS,'报名清单')">
{{item.TotalSeat}}/{{item.CommonReport.HouseStatistics.RealityYSeatNum}}/{{item.CommonReport.HouseStatistics.RealityESeatNum}}/{{item.CommonReport.HouseStatistics.RealityFSeatNum}}
</p>
</div>
</td>
<td style="vertical-align: top;">
<div class="w260">
<p class="pDateStyle">时间</p>
<p class="pDateStyle" style="height: 50px!important; line-height: 50px;">酒店名称</p>
</div>
</td>
<td style="vertical-align: top;">
<div :style="{width:150*item.CommonReport.newHotel.length+'px'}">
<div class="w150" v-for="childItem in item.CommonReport.newHotel"
style="float:left;border-right:1px solid #d1d1d1;">
<p class="pDateStyle">{{childItem.CheckInDateStr}}</p>
<p @click="goUrlR('HotelManagement',childItem.HotelId,'酒店管理')"
class="pDateStyle phoverStype ownScrollbarStyle" style="height: 50px!important; overflow:auto;">
<span v-if='childItem.HotelOrderState==0'
class="colorE95252">(待定)</span>{{childItem.NewHotelName}}
</p>
</div>
</div>
</td>
</tr>
</template>
</tbody>
</table>
</div>
<el-pagination background @current-change="handleCurrentChange" :current-page.sync="currentPage"
layout="total,prev, pager, next, jumper" :page-size="msg.pageSize" :total="total"></el-pagination>
</div>
</template>
<script>
export default {
data() {
return {
loading: false,
currentPage: 1,
total: 0,
msg: {
pageIndex: 1,
pageSize: 5,
SelectType: 1,
LineId: 14,
LineteamId: "-1",
StartDate: '',
EndDate: '',
//酒店编号
HotelId: 0,
//日期
DateStr: "",
RB_Branch_id:-1,
//订团号
NewCombinationNum:""
},
//分公司类表
companyList:[],
//酒店类表
HotelList: [],
LineList: [],
LineTeamList: [],
thLengthTitle: [],
list: [],
colspanTotal: 0,
}
},
methods: {
getLineList() {
this.apipost("line_post_GetAllList", {}, res => {
if (res.data.resultCode == 1) {
this.LineList = res.data.data;
}
});
},
//获取系列列表
getLineTeamList(lineId) {
this.LineTeamList = [];
this.apipost(
"team_post_GetList", {
lineID: 14,
isTOOP: 1
},
res => {
if (res.data.resultCode == 1) {
this.msg.LineteamId = "-1";
this.LineTeamList = res.data.data;
}
}
);
},
goUrlR(path, obj, title) {
this.$router.push({
name: path,
query: {
"ID": obj,
blank: 'y',
tab: title
}
})
},
goUrlT(path, obj, title) {
this.$router.push({
name: path,
query: {
"id": obj,
blank: 'y',
tab: title
}
})
},
goUrl(path, obj, outItem, title) {
this.$router.push({
name: path,
query: {
"id": obj.TCIDS,
'TCNUM': obj.TCNUMS,
'flightTotal': obj.TotalSeat,
'GuestNum': obj.CommonReport.HouseStatistics.RealityNum,
'NewCombinationNum': outItem.NewCombinationNum,
blank: 'y',
tab: title
}
})
},
handleCurrentChange(val) {
this.msg.pageIndex = val;
this.getList();
},
resetPageIndex() {
this.msg.pageIndex = 1;
this.currentPage = 1;
},
getList() {
this.loading = true
this.apipost('dmcstatistics_post_GetUniteCombinationNumService', this.msg, res => {
if (res.data.resultCode == 1) {
this.loading = false
this.total = res.data.data.count;
this.list = res.data.data.pageData.data;
this.thLengthArr = []
this.thLengthTitle = []
this.colspanTotal = res.data.data.pageData.columnsCount + 9
for (let i = 1; i <= res.data.data.pageData.columnsCount; i++) {
this.thLengthTitle.push('第' + i + '晚')
}
this.list.forEach(x => {
x.StaticsReportList.forEach(y => {
y.CommonReport.newHotel = [];
if (y.CommonReport.HotelOrderListReport != null && y.CommonReport.HotelOrderListReport
.length > 0) {
y.CommonReport.HotelOrderListReport.forEach(z => {
z.HotelOrderList.forEach(q => {
y.CommonReport.newHotel.push(q);
})
})
}
y.colNum = 9 + y.CommonReport.newHotel.length;
})
})
} else {
this.loading = false
this.$message.error(res.data.message)
}
}, err => {})
},
//获取酒店列表
GetHotelList() {
this.apipost(
"hotel_post_GetHasStockHotelList", {
Country: 651,
IsMoreThanZero: 1
},
res => {
if (res.data.resultCode == 1) {
this.HotelList = res.data.data;
}
},
err => {}
);
},
getBranchList() {
this.apipost('admin_get_BranchGetList', {
RB_Group_Id: '2',
Status: 0,
}, res => {
if (res.data.resultCode == 1) {
this.companyList = res.data.data;
}
}, err => {})
},
},
mounted() {
let myDate = new Date();
let nowDate =
myDate.getFullYear() +
"-" +
parseInt(myDate.getMonth() + 1) +
"-" +
myDate.getDate();
if (this.$route.query.hotelId) {
this.msg.HotelId = this.$route.query.hotelId;
}
if (this.$route.query.dateStr) {
this.msg.DateStr = this.$route.query.dateStr;
}
if (this.$route.query.hotelId || this.$route.query.dateStr) {
this.msg.StartDate = "";
} else {
this.msg.StartDate = nowDate;
}
this.GetHotelList();
this.getList();
this.getLineTeamList();
},
}
</script>
<style>
.roomReservationsSplitTrCss td {
background: #eee !important;
}
.roomReservationsTalbe {
background: #ccc;
}
.roomReservationsTalbe tr th {
background: #E6E6E6;
height: 40px;
font-size: 12px;
color: #333;
}
.roomReservationsTalbe tr {
background: #fff;
text-align: center;
height: 40px;
}
.roomReservationsTalbe tr td {
font-size: 12px;
}
.roomReservationsTalbe tr td .pDateStyle {
border-bottom: 1px solid #ccc;
min-height: 24px;
line-height: 24px;
margin-top: 0;
box-sizing: content-box;
padding: 0 10px;
}
.roomReservationsTalbe tr td .pDateStyle:last-child {
border-bottom: none;
}
.roomReservationsTalbe tr td .pDateStyle>span:after {
content: '/';
}
.roomReservationsTalbe tr td .pDateStyle>span:last-child:after {
content: ''
}
.roomReservationsTalbe tr td .link p:hover {
text-decoration: underline;
cursor: pointer;
}
.roomReservationsTalbe tr td .phoverStype:hover {
text-decoration: underline;
cursor: pointer;
}
.roomReservations_tripDetails {
padding: 0;
box-shadow: 0px 1px 3px 0px #dedede;
max-height: 400px;
overflow-y: auto;
}
.roomReservations_tripDetails .popper__arrow::after {
border-bottom-color: #ededed !important;
}
.roomReservations_tripDetails table {
padding: 10px 0 0 20px;
background-color: #ededed;
border-collapse: collapse;
border: 1px solid #d2d2d2;
font-size: 12px;
}
.roomReservations_tripDetails table th {
background-color: #ededed;
padding: 5px;
}
.roomReservations_tripDetails table td {
background-color: #ffffff;
padding: 9px 15px;
color: #333333;
border: 1px solid #d2d2d2;
}
.roomReservations_tripDetails table td._d_name {
background-color: #ededed;
}
.roomReservations_tripDetails table ._color_666 {
color: #666666;
}
.roomReservations_tripDetails table tr._color_666 th {
padding: 9px 15px;
}
</style>
<style>
</style>
<template>
<div class="flexOne">
<div class="query-box">
<ul>
<li>
<span><em>名称</em><el-input v-model='msg.MenuName' class="permiss-input" placeholder="请输入内容"></el-input></span>
</li>
<li>
<span><em>权限层级</em><el-select v-model='msg.Tier' placeholder="请选择">
<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>
</span>
</li>
<li>
<span><em>上级权限</em><el-select filterable v-model='msg.ParentId' filterable placeholder="请选择">
<el-option label="不限" value="0"></el-option>
<el-option
v-for="item in getParentNodeData"
:key="item.MenuId"
:label="item.MenuName"
:value="item.MenuId">
</el-option>
</el-select>
</span>
</li>
<li>
<span><em>状态</em><el-select v-model="msg.MenuStatus" placeholder="请选择">
<el-option label="不限" value="-1"></el-option>
<el-option label="开启" value="0"></el-option>
<el-option label="关闭" value="1"></el-option>
</el-select>
</span>
</li>
<li>
<input type="button" class="hollowFixedBtn" name="" id="" value="查询" @click="resetPageIndex(),getList()" />
<input type="button" @click="outerVisible = true,dialogTitle='新增权限菜单',clearMessage();" class="normalBtn" value="新增" />
</li>
</ul>
</div>
<table class="singeRowTable" border="0" cellspacing="0" cellpadding="0">
<tr>
<th width="300">名称</th>
<th width="500">菜单地址</th>
<th>层级</th>
<th>状态</th>
<th width="200">分组名称</th>
<th width="100">排序</th>
<th width="100">操作</th>
</tr>
<tr v-for="(item,index) in DataList">
<td>{{item.MenuName}}</td>
<td>{{item.MenuUrl}}</td>
<td>{{item.Tier | tierFormat(item.Tier)}}</td>
<td>{{item.MenuStatus==0?'开启':'关闭'}}</td>
<td>
{{item.GroupingCode}}
</td>
<td>
{{item.Sort}}
</td>
<td>
<el-row>
<el-tooltip class="item" effect="dark" content="修改" placement="top-start">
<el-button @click="outerVisible = true,dialogTitle='修改权限菜单',updateData(index,item.MenuId)" type="primary" icon="el-icon-edit" circle></el-button>
</el-tooltip>
</el-row>
</td>
</tr>
</table>
<el-pagination
background
@current-change="handleCurrentChange"
:current-page.sync="currentPage"
layout="total,prev, pager, next, jumper"
:page-size=msg.pageSize
:total='total'>
</el-pagination>
<div class="flexOne">
<div class="query-box">
<ul>
<li>
<span><em>名称</em>
<el-input v-model='msg.MenuName' class="permiss-input" placeholder="请输入内容"></el-input>
</span>
</li>
<li>
<span><em>权限层级</em>
<el-select v-model='msg.Tier' placeholder="请选择">
<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>
</span>
</li>
<li>
<span><em>上级权限</em>
<el-select filterable v-model='msg.ParentId' filterable placeholder="请选择">
<el-option label="不限" value="0"></el-option>
<el-option v-for="item in getParentNodeData" :key="item.MenuId" :label="item.MenuName"
:value="item.MenuId">
</el-option>
</el-select>
</span>
</li>
<li>
<span><em>状态</em>
<el-select v-model="msg.MenuStatus" placeholder="请选择">
<el-option label="不限" value="-1"></el-option>
<el-option label="开启" value="0"></el-option>
<el-option label="关闭" value="1"></el-option>
</el-select>
</span>
</li>
<li>
<input type="button" class="hollowFixedBtn" name="" id="" value="查询" @click="resetPageIndex(),getList()" />
<input type="button" @click="outerVisible = true,dialogTitle='新增权限菜单',clearMessage();" class="normalBtn"
value="新增" />
</li>
</ul>
</div>
<table class="singeRowTable" border="0" cellspacing="0" cellpadding="0">
<tr>
<th width="300">名称</th>
<th width="500">菜单地址</th>
<th>层级</th>
<th>状态</th>
<th width="200">分组名称</th>
<th width="100">排序</th>
<th width="100">操作</th>
</tr>
<tr v-for="(item,index) in DataList">
<td>{{item.MenuName}}</td>
<td>{{item.MenuUrl}}</td>
<td>{{item.Tier | tierFormat(item.Tier)}}</td>
<td>{{item.MenuStatus==0?'开启':'关闭'}}</td>
<td>
{{item.GroupingCode}}
</td>
<td>
{{item.Sort}}
</td>
<td>
<el-row>
<el-tooltip class="item" effect="dark" content="修改" placement="top-start">
<el-button @click="outerVisible = true,dialogTitle='修改权限菜单',updateData(index,item.MenuId)" type="primary"
icon="el-icon-edit" circle></el-button>
</el-tooltip>
</el-row>
</td>
</tr>
</table>
<el-pagination background @current-change="handleCurrentChange" :current-page.sync="currentPage"
layout="total,prev, pager, next, jumper" :page-size="msg.pageSize" :total='total'>
</el-pagination>
<el-dialog custom-class='w750' :title="dialogTitle" :visible.sync="outerVisible" center :before-close="closeChangeMachie">
<el-form :model="addMsg" :rules="rules" ref="addMsg" label-width="120px" >
<table class="layerNoIcon">
<tr>
<td>
<el-form-item label="名称" prop="MenuName"><el-input maxlength='50' class='w200' type="text" v-model="addMsg.MenuName" :placeholder="$t('pub.pleaseImport')"></el-input>
</el-form-item>
</td>
<td>
<el-form-item label="菜单URL" prop="MenuUrl">
<el-input maxlength='50' class='w200' type="text" v-model="addMsg.MenuUrl" :placeholder="$t('pub.pleaseImport')"></el-input>
</el-form-item>
</td>
</tr>
<tr>
<td>
<el-form-item label="权限层级" prop="Tier">
<el-select class='w200' v-model="addMsg.Tier" @change='getChildMenu' placeholder="请选择">
<el-option label="一级" value="1" ></el-option>
<el-option label="二级" value="2" ></el-option>
<el-option label="三级" value="3" ></el-option>
</el-select>
</el-form-item>
</td>
<td>
<el-form-item label="上级权限" prop="ParentId">
<el-select filterable class='w200' v-model='addMsg.ParentId' :placeholder="$t('pub.pleaseSel')">
<el-option v-for="item in layerGetParentNodeData" :key="item.MenuId" :label="item.MenuName" :value="item.MenuId">
</el-option>
</el-select>
</el-form-item>
</td>
</tr>
<tr>
<td>
<el-form-item label="分组名称">
<el-input maxlength='50' class='w200' type="text" v-model="addMsg.GroupingCode" :placeholder="$t('pub.pleaseImport')"></el-input>
</el-form-item>
</td>
<td>
<el-form-item label="排序" prop='Sort'>
<el-input maxlength='50' class='w200' @keyup.native="checkInteger(addMsg,'Sort')" type="text" v-model="addMsg.Sort" :placeholder="$t('pub.pleaseImport')"></el-input>
</el-form-item>
</td>
</tr>
<tr>
<td>
<el-form-item label="菜单图标" >
<el-input class='w200' type="text" maxlength='50' v-model="addMsg.MenuStyleIcon" :placeholder="$t('pub.pleaseImport')"></el-input>
</el-form-item>
</td>
<td>
<el-form-item label="菜单背景配置">
<el-color-picker style='vertical-align: middle;' :predefine="predefineColors" v-model="addMsg.MenuStyleColor"></el-color-picker>
</el-form-item>
</td>
</tr>
<tr>
<td>
<el-form-item label="状态">
<el-switch v-model="addMsg.MenuStatus" active-value="0" inactive-value="1"></el-switch>
</el-form-item>
</td>
</tr>
</table>
</el-form>
<div slot="footer" class="dialog-footer">
<button class="hollowFixedBtn" @click="outerVisible = false,resetForm('addMsg'),getList()">{{$t('pub.cancelBtn')}}</button> &nbsp;
<button class="normalBtn" type="primary" @click="submitForm('addMsg'),getList()">{{$t('pub.saveBtn')}}</button>
</div>
</el-dialog>
</div>
<el-dialog custom-class='w750' :title="dialogTitle" :visible.sync="outerVisible" center
:before-close="closeChangeMachie">
<el-form :model="addMsg" :rules="rules" ref="addMsg" label-width="120px">
<table class="layerNoIcon">
<tr>
<td>
<el-form-item label="名称" prop="MenuName">
<el-input maxlength='50' class='w200' type="text" v-model="addMsg.MenuName"
:placeholder="$t('pub.pleaseImport')"></el-input>
</el-form-item>
</td>
<td>
<el-form-item label="菜单URL" prop="MenuUrl">
<el-input maxlength='50' class='w200' type="text" v-model="addMsg.MenuUrl"
:placeholder="$t('pub.pleaseImport')"></el-input>
</el-form-item>
</td>
</tr>
<tr>
<td>
<el-form-item label="权限层级" prop="Tier">
<el-select class='w200' v-model="addMsg.Tier" @change='getChildMenu' placeholder="请选择">
<el-option label="一级" value="1"></el-option>
<el-option label="二级" value="2"></el-option>
<el-option label="三级" value="3"></el-option>
</el-select>
</el-form-item>
</td>
<td>
<el-form-item label="上级权限" prop="ParentId">
<el-select filterable class='w200' v-model='addMsg.ParentId' :placeholder="$t('pub.pleaseSel')">
<el-option v-for="item in layerGetParentNodeData" :key="item.MenuId" :label="item.MenuName"
:value="item.MenuId">
</el-option>
</el-select>
</el-form-item>
</td>
</tr>
<tr>
<td>
<el-form-item label="分组名称">
<el-input maxlength='50' class='w200' type="text" v-model="addMsg.GroupingCode"
:placeholder="$t('pub.pleaseImport')"></el-input>
</el-form-item>
</td>
<td>
<el-form-item label="排序" prop='Sort'>
<el-input maxlength='50' class='w200' @keyup.native="checkInteger(addMsg,'Sort')" type="text"
v-model="addMsg.Sort" :placeholder="$t('pub.pleaseImport')"></el-input>
</el-form-item>
</td>
</tr>
<tr>
<td>
<el-form-item label="菜单图标">
<el-input class='w200' type="text" maxlength='50' v-model="addMsg.MenuStyleIcon"
:placeholder="$t('pub.pleaseImport')"></el-input>
</el-form-item>
</td>
<td>
<el-form-item label="菜单背景配置">
<el-color-picker style='vertical-align: middle;' :predefine="predefineColors"
v-model="addMsg.MenuStyleColor"></el-color-picker>
</el-form-item>
</td>
</tr>
<tr>
<td>
<el-form-item label="状态">
<el-switch v-model="addMsg.MenuStatus" active-value="0" inactive-value="1"></el-switch>
</el-form-item>
</td>
</tr>
</table>
</el-form>
<div slot="footer" class="dialog-footer">
<button class="hollowFixedBtn"
@click="outerVisible = false,resetForm('addMsg'),getList()">{{$t('pub.cancelBtn')}}</button> &nbsp;
<button class="normalBtn" type="primary" @click="submitForm('addMsg'),getList()">{{$t('pub.saveBtn')}}</button>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
data() {
let validateParent=(rule, value, callback)=>{
if(this.addMsg.Tier!='1'&&this.addMsg.Tier!=''&&value==''){
return callback(new Error('请选择上级层级'));
}else{
callback();
}
}
let validateUrl=(rule, value, callback)=>{
if(this.addMsg.Tier=='3'&&this.addMsg.Tier!=''&&value==''){
return callback(new Error('请输入菜单URL'));
}else{
callback();
}
}
return {
dialogTitle: '',
DataList: '',
total: 0,
pageSize: '',
currentPage: 1,
thisColor: '#E95252',
predefineColors: [
'#ff4500',
'#ff8c00',
'#ffd700',
'#90ee90',
'#00ced1',
'#1e90ff',
'#c71585',
],
outerVisible: false,
addStatus: [{
value: '0',
label: '开启'
}, {
value: '1',
label: '关闭'
}],
msg: { //列表查询请求数据
"pageIndex": 1,
'pageSize': 15,
'MenuName': '',
'ParentId': '',
'MenuStatus': '0',
'Tier':''
},
addMsg: {
'MenuId':'0',
'Tier':'',
'MenuName': '',
'MenuUrl': '',
'ParentId': '0',
'MenuStyle': '',
'MenuStatus': '0',
MenuStyleIcon:'',
MenuStyleColor:'',
Sort:0
},
rules:{
Sort:[
{ required: true, message: '请输入排序', trigger: 'blur' }
],
MenuName:[
{ required: true, message: '请输入菜单名称', trigger: 'blur' }
],
Tier:[
{ required: true, message: '请选择菜单层级', trigger: 'change' }
],
ParentId:[
{validator: validateParent, trigger: 'change' }
],
MenuUrl:[
{validator: validateUrl, trigger: 'blur' }
],
},
getParentNodeMsg: {
'Tier':'0',
"ParentId": '0',
"MenuStatus": '0',
"MenuName": '',
},
layerGetParentNodeData:[],
getParentNodeData: [],
currentUpdateIndex:-1
}
},
mounted() {
this.getList();
this.getParentNode()
},
filters:{
tierFormat(value){
if(value=='1')
return '一级'
if(value=='2')
return '二级'
if(value=='3')
return '三级'
}
},
methods: {
getParentNode() { //上级权限
this.apipost('admin_get_SysMenuGetList', this.getParentNodeMsg, res => {
if(this.outerVisible){
this.layerGetParentNodeData = res.data.data;
}else{
this.getParentNodeData = res.data.data;
}
}, err => {})
},
getList() { //列表查询
this.apipost('admin_get_SysMenuGetPageList', this.msg, res => {
if(res.data.resultCode == 1) {
this.DataList = res.data.data.pageData;
console.log(this.DataList)
this.total = res.data.data.count;
}
}, err => {})
},
getChildMenu(){
this.addMsg.ParentId='';
if(this.addMsg.Tier==1){
this.layerGetParentNodeData=null;
//this.addMsg.ParentId=0
}else{
this.getParentNodeMsg.Tier=this.addMsg.Tier-1;
this.getParentNode();
}
},
addData() { //新增数据
if(this.addMsg.MenuName==''){
this.$message.error('菜单名不能为空');
return
}
let mStyle={"icon":"","color":""};
mStyle.icon=this.addMsg.MenuStyleIcon;
mStyle.color=this.addMsg.MenuStyleColor;
this.addMsg.MenuStyle=JSON.stringify(mStyle);
if(this.addMsg.Tier==1)
this.addMsg.ParentId=0
this.apipost('admin_post_SysMenuSet', this.addMsg, res => {
if(res.data.resultCode == 1){
this.outerVisible=false;
this.$message.success(res.data.message)
if(this.currentUpdateIndex>-1){
this.DataList[this.currentUpdateIndex]=this.addMsg
}
}else{
this.$message.error(res.data.message);
}
}, err => {})
export default {
data() {
let validateParent = (rule, value, callback) => {
if (this.addMsg.Tier != '1' && this.addMsg.Tier != '' && value == '') {
return callback(new Error('请选择上级层级'));
} else {
callback();
}
}
let validateUrl = (rule, value, callback) => {
if (this.addMsg.Tier == '3' && this.addMsg.Tier != '' && value == '') {
return callback(new Error('请输入菜单URL'));
} else {
callback();
}
}
},
updateData(index,id) { //修改
this.apipost('admin_get_SysMenuGet',{MenuId:id},res=>{
let updateList=res.data.data
console.log(updateList)
this.addMsg.MenuId=id
this.addMsg.MenuName=updateList.MenuName
this.addMsg.Tier=updateList.Tier.toString()
this.addMsg.ParentId=updateList.ParentId
this.addMsg.Sort=updateList.Sort
this.addMsg.GroupingCode=updateList.GroupingCode
this.addMsg.MenuUrl=updateList.MenuUrl
this.addMsg.MenuStatus=updateList.MenuStatus.toString()
let style=JSON.parse(updateList.MenuStyle)
this.addMsg.MenuStyleIcon=style.icon
this.addMsg.MenuStyleColor=style.color
this.currentUpdateIndex=index
},err=>{})
this.getChildMenu();
// this.addMsg = this.DataList[index]
// this.addMsg.ParentId=this.addMsg.ParentId.toString();
// this.addMsg.Tier=this.DataList[index].Tier.toString();
// this.addMsg.MenuStatus=this.addMsg.MenuStatus.toString();
// //console.log(this.DataList[index])
if(this.addMsg.MenuStyle && this.addMsg.MenuStyle!=""){
let style=JSON.parse(this.DataList[index].MenuStyle)
this.addMsg.MenuStyleIcon=style.icon
this.addMsg.MenuStyleColor=style.color
}
this.currentUpdateIndex=index
},
handleCurrentChange(val) {
this.msg.pageIndex = val;
this.getList();
},
clearMessage() {
this.addMsg = {
'Tier':'',
'MenuName': '',
'MenuUrl': '',
'ParentId': '',
'MenuStyle': '',
'MenuStatus': '0',
MenuStyleIcon:'',
MenuStyleColor:''
}
},
resetPageIndex() {
this.msg.pageIndex = 1
this.currentPage = 1
},
submitForm(addMsg) {//提交创建、修改表单
this.$refs[addMsg].validate((valid) => {
if (valid) {
this.addData()
} else {
return false;
}
});
},
closeChangeMachie(done){//弹出框关闭初始化弹框内表单
done();
this.resetForm('addMsg');
},
resetForm(formName) {//弹出框取消 初始化谈框内表单
this.$refs[formName].resetFields();
}
}
return {
dialogTitle: '',
DataList: '',
total: 0,
pageSize: '',
currentPage: 1,
thisColor: '#E95252',
predefineColors: [
'#ff4500',
'#ff8c00',
'#ffd700',
'#90ee90',
'#00ced1',
'#1e90ff',
'#c71585',
],
outerVisible: false,
addStatus: [{
value: '0',
label: '开启'
}, {
value: '1',
label: '关闭'
}],
msg: { //列表查询请求数据
"pageIndex": 1,
'pageSize': 15,
'MenuName': '',
'ParentId': '',
'MenuStatus': '0',
'Tier': ''
},
addMsg: {
'MenuId': '0',
'Tier': '',
'MenuName': '',
'MenuUrl': '',
'ParentId': '0',
'MenuStyle': '',
'MenuStatus': '0',
MenuStyleIcon: '',
MenuStyleColor: '',
Sort: 0
},
rules: {
Sort: [{
required: true,
message: '请输入排序',
trigger: 'blur'
}],
MenuName: [{
required: true,
message: '请输入菜单名称',
trigger: 'blur'
}],
Tier: [{
required: true,
message: '请选择菜单层级',
trigger: 'change'
}],
ParentId: [{
validator: validateParent,
trigger: 'change'
}],
MenuUrl: [{
validator: validateUrl,
trigger: 'blur'
}],
},
getParentNodeMsg: {
'Tier': '0',
"ParentId": '0',
"MenuStatus": '0',
"MenuName": '',
},
layerGetParentNodeData: [],
getParentNodeData: [],
currentUpdateIndex: -1
}
},
mounted() {
this.getList();
this.getParentNode()
},
filters: {
tierFormat(value) {
if (value == '1')
return '一级'
if (value == '2')
return '二级'
if (value == '3')
return '三级'
}
},
methods: {
getParentNode() { //上级权限
this.apipost('admin_get_SysMenuGetList', this.getParentNodeMsg, res => {
if (this.outerVisible) {
this.layerGetParentNodeData = res.data.data;
} else {
this.getParentNodeData = res.data.data;
}
}, err => {})
},
}
getList() { //列表查询
this.apipost('admin_get_SysMenuGetPageList', this.msg, res => {
if (res.data.resultCode == 1) {
this.DataList = res.data.data.pageData;
this.total = res.data.data.count;
}
}, err => {})
},
getChildMenu() {
this.addMsg.ParentId = '';
if (this.addMsg.Tier == 1) {
this.layerGetParentNodeData = null;
} else {
this.getParentNodeMsg.Tier = this.addMsg.Tier - 1;
this.getParentNode();
}
},
addData() { //新增数据
if (this.addMsg.MenuName == '') {
this.$message.error('菜单名不能为空');
return
}
let mStyle = {
"icon": "",
"color": ""
};
mStyle.icon = this.addMsg.MenuStyleIcon;
mStyle.color = this.addMsg.MenuStyleColor;
this.addMsg.MenuStyle = JSON.stringify(mStyle);
if (this.addMsg.Tier == 1)
this.addMsg.ParentId = 0
this.apipost('admin_post_SysMenuSet', this.addMsg, res => {
if (res.data.resultCode == 1) {
this.outerVisible = false;
this.$message.success(res.data.message)
if (this.currentUpdateIndex > -1) {
this.DataList[this.currentUpdateIndex] = this.addMsg
}
} else {
this.$message.error(res.data.message);
}
}, err => {})
},
updateData(index, id) { //修改
this.apipost('admin_get_SysMenuGet', {
MenuId: id
}, res => {
let updateList = res.data.data
this.addMsg.MenuId = id
this.addMsg.MenuName = updateList.MenuName
this.addMsg.Tier = updateList.Tier.toString()
this.addMsg.ParentId = updateList.ParentId
this.addMsg.Sort = updateList.Sort
this.addMsg.GroupingCode = updateList.GroupingCode
this.addMsg.MenuUrl = updateList.MenuUrl
this.addMsg.MenuStatus = updateList.MenuStatus.toString()
let style = JSON.parse(updateList.MenuStyle)
this.addMsg.MenuStyleIcon = style.icon
this.addMsg.MenuStyleColor = style.color
this.currentUpdateIndex = index
}, err => {})
this.getChildMenu();
if (this.addMsg.MenuStyle && this.addMsg.MenuStyle != "") {
let style = JSON.parse(this.DataList[index].MenuStyle)
this.addMsg.MenuStyleIcon = style.icon
this.addMsg.MenuStyleColor = style.color
}
this.currentUpdateIndex = index
},
handleCurrentChange(val) {
this.msg.pageIndex = val;
this.getList();
},
clearMessage() {
this.addMsg = {
'Tier': '',
'MenuName': '',
'MenuUrl': '',
'ParentId': '',
'MenuStyle': '',
'MenuStatus': '0',
MenuStyleIcon: '',
MenuStyleColor: ''
}
},
resetPageIndex() {
this.msg.pageIndex = 1
this.currentPage = 1
},
submitForm(addMsg) { //提交创建、修改表单
this.$refs[addMsg].validate((valid) => {
if (valid) {
this.addData()
} else {
return false;
}
});
},
closeChangeMachie(done) { //弹出框关闭初始化弹框内表单
done();
this.resetForm('addMsg');
},
resetForm(formName) { //弹出框取消 初始化谈框内表单
this.$refs[formName].resetFields();
}
}
}
</script>
\ No newline at end of file
......@@ -856,6 +856,14 @@ export default {
title: '订房管理'
},
},
{
path: '/roomQuery', //订房查询
name: 'roomQuery',
component: resolve => require(['@/components/Hotel/roomQuery'], resolve),
meta: {
title: '订房查询'
},
},
{
path: '/roomReservationsDetails', //订房管理详情
name: 'roomReservationsDetails',
......
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