初始化
This commit is contained in:
434
Face.Web/Areas/App/Views/Room/InquireRoomall.cshtml
Normal file
434
Face.Web/Areas/App/Views/Room/InquireRoomall.cshtml
Normal file
@@ -0,0 +1,434 @@
|
||||
@model List<Face.Web.Areas.App.Models.InfoRoomall>
|
||||
@using PagedList.Mvc;
|
||||
@using Face.Web.Areas.App.Models;
|
||||
@using Face.Domain.Entities;
|
||||
@using Face.Domain.Application
|
||||
@{
|
||||
List<Face.Domain.Entities.Hotels> Hotellist = SqlSugarBase.authoriydb.Queryable<Hotels>().ToList();
|
||||
List<AuthItem> authItem = (List<AuthItem>)Session["authItems"];
|
||||
List<TBL_ROOM_BASIC_INFO> ZongRoominfo = (List<TBL_ROOM_BASIC_INFO>)Session["ZongRoominfo"];
|
||||
}
|
||||
<style>
|
||||
.table > thead > tr > th, .table > tbody > tr > th, .table > tfoot > tr > th, .table > thead > tr > td, .table > tbody > tr > td, .table > tfoot > tr > td {
|
||||
padding: 0px;
|
||||
border: 0px;
|
||||
}
|
||||
|
||||
.table > tbody > tr > td, .table > tbody > tr > th, .table > tfoot > tr > td, .table > tfoot > tr > th, .table > thead > tr > td, .table > thead > tr > th {
|
||||
padding: 3px;
|
||||
}
|
||||
|
||||
#order {
|
||||
border-top: solid 2px #ddd;
|
||||
}
|
||||
|
||||
.chaxun {
|
||||
text-indent: 5px;
|
||||
}
|
||||
|
||||
.PagedList-skipToLast page-item {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
<div id="project">
|
||||
<table class="table dataTables-example" border="0" id="order">
|
||||
@if (Model != null && ZongRoominfo != null)
|
||||
{
|
||||
foreach (var item in Model)
|
||||
{
|
||||
|
||||
<tbody class="tbodyList" onclick="Show(this)">
|
||||
<tr>
|
||||
<td rowspan="7" style="margin:0px;padding:0px; ">
|
||||
<input type="hidden" id="ID" value="2">
|
||||
<div class="lightBoxGallery">
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td id="mobile" style="text-align:left; ">酒店: @item.HotelName</td>
|
||||
<td style="" id="mobile2">酒店编码: @item.ExternalHotelCode</td>
|
||||
</tr>
|
||||
<tr></tr>
|
||||
<tr>
|
||||
<td>房间:@item.RoomNumber</td>
|
||||
<td>
|
||||
人脸机:
|
||||
@if (item.bindingStatus)
|
||||
{
|
||||
<span style="color:#0094ff">已绑定</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span style="color:crimson;">未绑定</span>
|
||||
}
|
||||
</td>
|
||||
<td>
|
||||
@if (item.bindingStatus)
|
||||
{
|
||||
<button class="btn btn-xs btn-success" id="btnremoveFaceFromRoom" onclick="removeFaceFromRoom('@item.HotelId','@item.InnerRoomId', '@item.SerialNo')" style="background-color:cornflowerblue">解绑人脸机</button>
|
||||
}
|
||||
else
|
||||
{
|
||||
<button class="btn btn-xs btn-success" id="btnaddFaceToRoom" onclick="addFaceToRoom('@item.HotelId','@item.HotelName','@item.InnerRoomId','@item.RoomNumber')" style="background-color:cornflowerblue">绑定人脸机...</button>
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
人脸机SN号码:
|
||||
@if (item.bindingStatus)
|
||||
{
|
||||
<span style="color:#0094ff">@item.SerialNo</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span style="color:crimson;">--</span>
|
||||
}
|
||||
</td>
|
||||
<td>
|
||||
人脸机生产厂家:
|
||||
@if (item.bindingStatus)
|
||||
{
|
||||
<span style="color:#0094ff">@item.Factory</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span style="color:crimson;">--</span>
|
||||
}
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
人脸机创建时间:
|
||||
@if (item.bindingStatus)
|
||||
{
|
||||
<span style="color:#0094ff">
|
||||
@if (item.CreatedDate != null)
|
||||
{
|
||||
@item.CreatedDate.Value.ToString("yyyy/MM/dd")
|
||||
}
|
||||
</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span style="color:crimson;">--</span>
|
||||
}
|
||||
</td>
|
||||
<td>
|
||||
人脸机绑定时间:
|
||||
@if (item.bindingStatus)
|
||||
{
|
||||
<span style="color:#0094ff">
|
||||
@if (item.bindingDate != null)
|
||||
{
|
||||
@item.bindingDate.Value.ToString("yyyy/MM/dd")
|
||||
}
|
||||
</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span style="color:crimson;">--</span>
|
||||
}
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
人脸机故障状态:
|
||||
@if (item.bindingStatus)
|
||||
{
|
||||
if (item.maintainStatus == 1)
|
||||
{
|
||||
<span style="color:crimson;">故障</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span style="color:#0094ff">正常</span>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<span style="color:crimson;">--</span>
|
||||
}
|
||||
</td>
|
||||
<td>
|
||||
人脸机状态:
|
||||
@if (item.bindingStatus)
|
||||
{
|
||||
if (item.Status)
|
||||
{
|
||||
<span style="color:#0094ff">1</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span style="color:crimson;">0</span>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<span style="color:crimson;">--</span>
|
||||
}
|
||||
</td>
|
||||
<td>
|
||||
@{
|
||||
for (int i = 0; i < authItem.Count; i++)
|
||||
{
|
||||
if (authItem[i].AuthorityId == 4)
|
||||
{
|
||||
if (item.HotelCode != null && item.HotelCode != "")
|
||||
{
|
||||
if (item.Status == true)
|
||||
{
|
||||
<a href="#asd"></a><button class="btn btn-xs btn-success" id="btnaddPLine" onclick="myTransfer('@item.SerialNo','@item.HotelCode')">测试操作</button>
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
开房状态:
|
||||
@if (item.RoomCheckInStatus == 2)
|
||||
{
|
||||
<span> 出租 </span>
|
||||
}
|
||||
else if (item.RoomCheckInStatus == 4)
|
||||
{
|
||||
<span> 待租 </span>
|
||||
}
|
||||
else if (item.RoomCheckInStatus == 8)
|
||||
{
|
||||
<span> 退房 </span>
|
||||
}
|
||||
else if (item.RoomCheckInStatus == 16)
|
||||
{
|
||||
<span> 空房 </span>
|
||||
}
|
||||
</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
|
||||
@{
|
||||
List<CheckInInfo> ci = (List<CheckInInfo>)ViewData["sungo"];
|
||||
foreach (var info in ci)
|
||||
{
|
||||
if (info.Roomid == item.RoomId)
|
||||
{
|
||||
|
||||
<tr class="acet" style="border-top: 1px solid #0b93d5;">
|
||||
<td></td>
|
||||
<td><img id="images" style="height:50px;" src="/ImgServer/FileImage?ftp=1&&url=@info.picture">@info.Name</td>
|
||||
@*<td>开房时间:@info.CheckTime</td>*@
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr class="acet">
|
||||
<td></td>
|
||||
<td>身份证:@info.IdNumber</td>
|
||||
</tr>
|
||||
}
|
||||
}
|
||||
}
|
||||
</tbody>
|
||||
}
|
||||
|
||||
}
|
||||
</table>
|
||||
@*<div id="btn" onclick="tip()"></div>*@
|
||||
<div>
|
||||
<nav style="text-align:center;">
|
||||
<ul class="pagination" id="page" data-totalnum="@ViewBag.count" data-modnum="@ViewBag.modcount" data-curpage="@ViewBag.curpagenum">
|
||||
<li class="first" onclick="myFirstPage('/App/Room/InquireRoomall')"><a>«</a></li>
|
||||
<li class="left"><a>…</a></li>
|
||||
<li class="leftprev"><a onclick="myPrevPage('/App/Room/InquireRoomall')"><</a></li>
|
||||
@for (int i = 0; i < ViewBag.allpage; i++)
|
||||
{
|
||||
<li class="pages" onclick="mySpecifyPage('/App/Room/InquireRoomall',@(i))"><a>@(i + 1)</a></li>
|
||||
}
|
||||
<li class="rightnext"><a onclick="myNextPage('/App/Room/InquireRoomall')">></a></li>
|
||||
<li class="right"><a>…</a></li>
|
||||
<li class="finally"><a onclick="myLastPage('/App/Room/InquireRoomall')">»</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
|
||||
$(".pagination").addClass("pagination pagination-sm");
|
||||
$(".pagination").children("li").addClass("page-item");
|
||||
$(".page-item").children("a").addClass("page-link");
|
||||
|
||||
$('.acet').hide();//隐藏
|
||||
|
||||
|
||||
function Show() {
|
||||
|
||||
}
|
||||
|
||||
function mySpecifyPage(url, page) {
|
||||
var ds = document.querySelector(".pagination").dataset;
|
||||
var totolnum = parseInt(ds.totalnum, 10);
|
||||
var nummod = parseInt(ds.modnum, 10);
|
||||
var curpage = parseInt(ds.curpage, 10);
|
||||
var min = page * 8;
|
||||
var max = (page + 1) * 8;
|
||||
myRoomSearch(url, min, max, page);
|
||||
}
|
||||
|
||||
function myFirstPage(url) {
|
||||
myRoomSearch(url, 0, 8, 0);
|
||||
}
|
||||
function myLastPage(url) {
|
||||
var ds = document.querySelector(".pagination").dataset;
|
||||
var totolnum = parseInt(ds.totalnum,10);
|
||||
var nummod = parseInt(ds.modnum,10);
|
||||
var curpage = parseInt(ds.curpage,10);
|
||||
|
||||
var lastpage = Math.floor(totolnum / 8 + (nummod == 0 ? -1 : 0));
|
||||
var min = lastpage * 8;
|
||||
var max = min + nummod;
|
||||
myRoomSearch(url, min, max, lastpage);//起始显示,显示结束,页数背景色的下标
|
||||
}
|
||||
|
||||
function myNextPage(url) {
|
||||
var ds = document.querySelector(".pagination").dataset;
|
||||
var totolnum = parseInt(ds.totalnum, 10);
|
||||
var nummod = parseInt(ds.modnum, 10);
|
||||
var curpage = parseInt(ds.curpage, 10);
|
||||
var curpage = parseInt(ds.curpage,10);
|
||||
mySpecifyPage(url, curpage+1);
|
||||
}
|
||||
function myPrevPage(url) {
|
||||
var ds = document.querySelector(".pagination").dataset;
|
||||
var totolnum = parseInt(ds.totalnum, 10);
|
||||
var nummod = parseInt(ds.modnum, 10);
|
||||
var curpage = parseInt(ds.curpage, 10);
|
||||
var curpage = parseInt(ds.curpage, 10);
|
||||
mySpecifyPage(url, curpage - 1);
|
||||
}
|
||||
|
||||
function copySnToInput(sn) {
|
||||
$("#faceDeviceSNInDlg").val(sn);
|
||||
}
|
||||
|
||||
function addTableDataToDom(objRef, idTarget, idTargetAll) {
|
||||
let arrRef = objRef.allFreeOfHotel;
|
||||
let arrRef2 = objRef.allFree;
|
||||
let tableBodyDom = null;
|
||||
let tableBodyDom2 = null;
|
||||
let strRows = '';
|
||||
let strRows2 = '';
|
||||
let tableDom = document.querySelector("#" + idTarget);
|
||||
if (tableDom && tableDom.tBodies[0]) {
|
||||
tableBodyDom = tableDom.tBodies[0];
|
||||
|
||||
for (let i = 0; i < arrRef.length; i++) {
|
||||
strRows += '<tr>';
|
||||
strRows += '<td>SN: ' + arrRef[i].SerialNo + " 工厂: " + arrRef[i].Factory + " 创建日期: " + arrRef[i].CreatedDate;
|
||||
strRows += '</td>';
|
||||
strRows += '<td><button class="btn btn-xs btn-success" onclick="copySnToInput(\'' + arrRef[i].SerialNo + '\')">拷贝SN号码</button></td>';
|
||||
strRows += '</tr>'
|
||||
}
|
||||
|
||||
tableBodyDom.innerHTML = strRows;
|
||||
}
|
||||
|
||||
let tableDom2 = document.querySelector("#" + idTargetAll);
|
||||
if (tableDom2 && tableDom2.tBodies[0]) {
|
||||
tableBodyDom2 = tableDom2.tBodies[0];
|
||||
|
||||
for (let i = 0; i < arrRef2.length; i++) {
|
||||
strRows2 += '<tr>';
|
||||
strRows2 += '<td>SN: ' + arrRef2[i].SerialNo + " 工厂: " + arrRef2[i].Factory + " 创建日期: " + arrRef2[i].CreatedDate;
|
||||
strRows2 += '</td>';
|
||||
strRows2 += '<td><button class="btn btn-xs btn-success" onclick="copySnToInput(\'' + arrRef2[i].SerialNo + '\')">拷贝SN号码</button></td>';
|
||||
strRows2 += '</tr>'
|
||||
}
|
||||
|
||||
tableBodyDom2.innerHTML = strRows2;
|
||||
}
|
||||
}
|
||||
|
||||
function addFaceToRoom(innerHotelID, hotelName, innerRoomID, roomName) {
|
||||
|
||||
//transfer the parameters to dialog
|
||||
let hotel = $("#hotelNameInDlg");
|
||||
hotel.data("hotelid", innerHotelID);
|
||||
hotel.text(hotelName);
|
||||
let room = $("#roomNameInDlg");
|
||||
room.data("roomid", innerRoomID);
|
||||
room.text(roomName);
|
||||
|
||||
//transfer the available SN to dialog
|
||||
$.ajax({
|
||||
url: "/App/Room/GetFaceDeviceOfHotel?hotelid=" + innerHotelID,
|
||||
type: "get", // 提交方式
|
||||
success: function (res) {
|
||||
|
||||
if (res)
|
||||
addTableDataToDom(res, "avaialbleFaceDevicesTableInDlg", "avaialbleFaceDevicesAllTableInDlg");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
//clear error message in dialog
|
||||
$("#faceDeviceSNInDlg").removeClass("is-invalid");
|
||||
$("#emptyCheckForFaceDeviceSNInDlg").text("");
|
||||
|
||||
//show dialog
|
||||
$("#bindFaceToRoomDlg").modal({show:true});
|
||||
}
|
||||
|
||||
function removeFaceFromRoom(innerHotelID, innerRoomID, faceDeviceSN) {
|
||||
|
||||
if (!faceDeviceSN || faceDeviceSN.trim() == "") {
|
||||
alert("Error face device ID.")
|
||||
return;
|
||||
}
|
||||
var objects = {
|
||||
hotel: innerHotelID,
|
||||
romm: innerRoomID,
|
||||
faceNo: faceDeviceSN
|
||||
};
|
||||
$.ajax({
|
||||
url: "/App/Room/RemoveFaceDeviceFromRoom",
|
||||
data: objects,
|
||||
type: "post", // 提交方式
|
||||
success: function (res) {
|
||||
if (res.Status == 200) {
|
||||
alert('添加成功')
|
||||
var link = "/App/Room/testRoomall";
|
||||
window.location.href = link;
|
||||
} else {
|
||||
alert('添加失败')
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function myTransfer(sn, hotelcode) {
|
||||
event.stopPropagation();
|
||||
//if ($(document).width() < 764) {
|
||||
// $('html,body').animate({ scrollTop: $('#btn').offset().top }, 1); //页面滚动到底部
|
||||
//}
|
||||
var data = {
|
||||
faceNo: sn,
|
||||
hotel: hotelcode
|
||||
}
|
||||
$.ajax({
|
||||
url: "/App/Face/Facetest",
|
||||
data: { data }, // data为String类型,必须为 Key/Value 格式。
|
||||
type: "post", // 提交方式
|
||||
success: function (res) { // 请求成功后的回调函数,其中的参数data为controller返回的map,也就是说,然后通过data这个参数取JSON数据中的值
|
||||
$("#faceDetailsBox").html(res)
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
</script>
|
||||
296
Face.Web/Areas/App/Views/Room/TestRoomall.cshtml
Normal file
296
Face.Web/Areas/App/Views/Room/TestRoomall.cshtml
Normal file
@@ -0,0 +1,296 @@
|
||||
|
||||
@model PagedList.IPagedList<Face.Domain.Entities.DeviceManage>
|
||||
@using PagedList.Mvc;
|
||||
@using Face.Web.Areas.App.Models;
|
||||
@using Face.Domain.Entities;
|
||||
@using Face.Domain.Application
|
||||
@{
|
||||
ViewBag.Title = "TestFaceall";
|
||||
Layout = "~/Areas/App/Views/Shared/_Layout.cshtml";
|
||||
List<Face.Domain.Entities.Hotels> Hotellist = SqlSugarBase.authoriydb.Queryable<Hotels>().ToList();
|
||||
List<AuthItem> authItem = (List<AuthItem>)Session["authItems"];
|
||||
List<TBL_ROOM_BASIC_INFO> ZongRoominfo = (List<TBL_ROOM_BASIC_INFO>)Session["ZongRoominfo"];
|
||||
int gSelHotelId = Convert.ToInt32(Session["defaultHotelId"]);
|
||||
}
|
||||
@*<script src="~/Scripts/jquery-3.3.1.js"></script>*@
|
||||
<style>
|
||||
.table > thead > tr > th, .table > tbody > tr > th, .table > tfoot > tr > th, .table > thead > tr > td, .table > tbody > tr > td, .table > tfoot > tr > td {
|
||||
padding: 0px;
|
||||
border: 0px;
|
||||
}
|
||||
|
||||
.table > tbody > tr > td, .table > tbody > tr > th, .table > tfoot > tr > td, .table > tfoot > tr > th, .table > thead > tr > td, .table > thead > tr > th {
|
||||
padding: 3px;
|
||||
}
|
||||
|
||||
#order {
|
||||
border-top: solid 2px #ddd;
|
||||
}
|
||||
|
||||
.chaxun {
|
||||
text-indent: 5px;
|
||||
}
|
||||
|
||||
.PagedList-skipToLast page-item {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="content-wrapper">
|
||||
<section class="content" style="padding:0px;">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-sm-8">
|
||||
<!-- Default box -->
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<span style="font-size:30px">所有房间人脸机信息</span>
|
||||
<div class="card-tools">
|
||||
<button type="button" class="btn btn-tool" data-card-widget="collapse" title="Collapse"></button>
|
||||
<button type="button" class="btn btn-tool" data-card-widget="remove" title="Remove">
|
||||
<i class="fas fa-times"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<select class="form-control" id="OrgId" style="width:300px; float:left">
|
||||
<option value="0">
|
||||
所有酒店
|
||||
</option>
|
||||
@{
|
||||
List<int> sum = (List<int>)Session["list"];
|
||||
foreach (int item in sum)
|
||||
{
|
||||
foreach (var iten in Hotellist)
|
||||
{
|
||||
if (iten.Id == item)
|
||||
{
|
||||
<option class="ComboBox" value="@iten.Id" selected="@(iten.Id==gSelHotelId)">@iten.Name</option>
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < authItem.Count; i++)
|
||||
{
|
||||
if (authItem[i].AuthorityId == 3)
|
||||
{
|
||||
<option value="-1">
|
||||
未绑定酒店
|
||||
</option>
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
</select>
|
||||
<select class="form-control" id="OrgId2" style="width:300px; float:left">
|
||||
|
||||
<option value="-1">
|
||||
全部房间
|
||||
</option>
|
||||
|
||||
<option value="0" )>
|
||||
未绑定房间
|
||||
</option>
|
||||
<option value="1">
|
||||
已绑定房间
|
||||
</option>
|
||||
</select>
|
||||
|
||||
<div class="input-group " style="width:300px; float:left;">
|
||||
<input type="search" style="height:40px;" id="txtOpname" value="@ViewData["SnDing"]" class="form-control form-control-lg" placeholder="人脸机筛选">
|
||||
<div class="input-group-append">
|
||||
<button type="submit" class="btn btn-lg btn-default" onclick="myRoomSearch('/App/Room/InquireRoomall')" id=" ">
|
||||
<i class="fa fa-search"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@*条件筛选*@
|
||||
@*内容筛选*@
|
||||
<div class="ibox-content" style="padding:0px;">
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- /.card -->
|
||||
<div class="col-sm-4" id="faceDetailsBox">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- bind/unbind face machine Dialog dom goes here-->
|
||||
<div id="bindFaceToRoomDlg" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="gridSystemModalLabel">
|
||||
<div class="modal-dialog modal-lg" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">绑定人脸机到房间</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="关闭" aria-hidden="true">×</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-md-3">酒店名称:</div>
|
||||
<div class="col-md-9" id="hotelNameInDlg" data-hotelid=""></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-3">房间号码:</div>
|
||||
<div class="col-md-9" id="roomNameInDlg" data-roomid=""></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-3">要绑定的人脸机SN:</div>
|
||||
<div class="col-md-9">
|
||||
<div class="input-group has-validation">
|
||||
<input id="faceDeviceSNInDlg" data-deviceid="" type="text" class="form-control" style="width:360px;" required />
|
||||
<div class="invalid-feedback" id="emptyCheckForFaceDeviceSNInDlg"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div>本酒店空闲人脸机</div>
|
||||
<div style="max-height:200px; overflow-y: scroll;">
|
||||
<table id="avaialbleFaceDevicesTableInDlg" class="table table-sm table-striped table-bordered table-hover" style="max-height:400px;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<!--本酒店空闲人脸机-->
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div>所有空闲人脸机</div>
|
||||
<div style="max-height: 250px; overflow-y: scroll;">
|
||||
<table id="avaialbleFaceDevicesAllTableInDlg" class="table table-sm table-striped table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<!--所有空闲人脸机-->
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-danger" onclick="bindFaceDeviceToRoom();">绑定</button>
|
||||
</div>
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal -->
|
||||
</div>
|
||||
|
||||
<script src="~/Plugin/allPages.js"></script>
|
||||
<script>
|
||||
|
||||
function myRoomSearch(url, dataMin, dataMax, Pages) {//查询SN号按钮
|
||||
Pages = Pages || 0;
|
||||
console.log("123");
|
||||
$("#faceDetailsBox").html("");//bug 操作页面清空
|
||||
var HotelID = $("#OrgId").val();
|
||||
var Status = "-1";
|
||||
var Notbing = $("#OrgId2").val();
|
||||
var FaceName = $("#txtOpname").val();
|
||||
//var RoomStatus = $("#RoomStatus").val();
|
||||
//var RoomDate = $("#startTs").val();
|
||||
//var RoomName = $("#RoomName").val();
|
||||
let data = { "HotelID": HotelID, "Status": Status, "Notbing": Notbing, "FaceName": FaceName, "dataMin": dataMin || 0, "dataMax": dataMax, "Pages": Pages, "RoomStatus": "", "RoomDate": "", "RoomName": "" };
|
||||
$.ajax({
|
||||
url: url,
|
||||
data: data,
|
||||
type: "post", // 提交方式
|
||||
success: function (data) {
|
||||
$(".ibox-content").html(data);
|
||||
|
||||
|
||||
|
||||
$("li.pages").hide();
|
||||
//要显示的页面为中心的7个页面
|
||||
if (Pages >= 5) {
|
||||
var maxPages = Pages + 3
|
||||
var minPages = Pages - 3;
|
||||
for (var i = minPages; i < maxPages; i++) {
|
||||
$("li.pages").eq(i).show();//显示页数
|
||||
}
|
||||
} else {//从0开始的5个页面
|
||||
for (var i = 0; i < 5; i++) {
|
||||
$("li.pages").eq(i).show();//显示页数
|
||||
}
|
||||
}
|
||||
|
||||
//根据总页数处理
|
||||
if ($("li.pages").length != 0) {
|
||||
var pages = $("li.pages").length - 3;//获取页数
|
||||
|
||||
//要显示的页面,比总页数多,那应该是最后一页,不要后面的...
|
||||
if (Pages >= pages) {
|
||||
$("li.right").hide();
|
||||
}
|
||||
|
||||
//要显示的页面,第3页往后,则要前面的...
|
||||
if (Pages > 3) {
|
||||
$("li.left").show();
|
||||
} else {
|
||||
$("li.left").hide();
|
||||
}
|
||||
|
||||
$("li.pages").eq(Pages).addClass("active");
|
||||
/*$("li.pages a").eq(Pages).css("color", "white");//添加选中字体颜色
|
||||
$("li.pages a").eq(Pages).css("background-color", "#00BFFF");//添加选中背景颜色*/
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function bindFaceDeviceToRoom() {
|
||||
let hotelid = $("#hotelNameInDlg").data("hotelid");
|
||||
let roomid = $("#roomNameInDlg").data("roomid");
|
||||
let facesn = $("#faceDeviceSNInDlg").val();
|
||||
|
||||
if (!facesn || facesn.trim() == "") {
|
||||
$("#faceDeviceSNInDlg").addClass("is-invalid");
|
||||
$("#emptyCheckForFaceDeviceSNInDlg").text("请输入人脸机设备SN号码才能绑定。");
|
||||
return;
|
||||
}
|
||||
var objects = {
|
||||
hotel: hotelid,
|
||||
romm: roomid,
|
||||
faceNo: facesn
|
||||
};
|
||||
$.ajax({
|
||||
url: "/App/Room/BindFaceDeviceToRoom",
|
||||
data: objects,
|
||||
type: "post", // 提交方式
|
||||
success: function (res) {
|
||||
if (res.Status == 200) {
|
||||
alert('添加成功')
|
||||
var link = "/App/Room/testRoomall";
|
||||
window.location.href = link;
|
||||
} else {
|
||||
alert('添加失败')
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(function () {
|
||||
myRoomSearch('/App/Room/InquireRoomall');
|
||||
});
|
||||
if ($(document).width() >= 764) {
|
||||
}
|
||||
else {
|
||||
$(".content-wrapper *").css("font-size", "10px");
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user