reservation.jsp 2.7 KB
Newer Older
F
fengjin 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
<%--
  Created by IntelliJ IDEA.
  User: liuxing
  Date: 2021/8/13
  Time: 21:38
  File:person.jsp
  Email: liuxing997@foxmail.com
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@page isELIgnored="false" %>
<%
    String basePath = request.getContextPath();
%>
<html class="x-admin-sm">
<head>
    <meta charset="UTF-8">
F
fengjin 已提交
18
    <title>订单|酒店后台管理系统</title>
F
fengjin 已提交
19 20 21 22 23 24 25 26 27 28
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi"/>
    <jsp:include page="common.jsp"/>
</head>
<body>
<div class="layui-card">
    <div class="layui-card-body">
        <form class="layui-form" id="person">
F
fengjin 已提交
29

F
fengjin 已提交
30
            <div class="layui-form-item">
F
fengjin 已提交
31
                <label for="customerId" class="layui-form-label">顾客id</label>
F
fengjin 已提交
32
                <div class="layui-input-block">
F
fengjin 已提交
33
                    <input type="text" name="customerId" id="customerId" autocomplete="off" placeholder="请输顾客id"
F
fengjin 已提交
34 35 36 37
                           class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
F
fengjin 已提交
38
                <label for="houseName" class="layui-form-label">房间号</label>
F
fengjin 已提交
39
                <div class="layui-input-block">
F
fengjin 已提交
40
                    <input type="text" name="houseName" id="houseName" placeholder="请输房间号" autocomplete="off"
F
fengjin 已提交
41 42 43
                           class="layui-input">
                </div>
            </div>
F
fengjin 已提交
44 45
            <div class="layui-input-block">
                <button type="button" class="layui-btn layui-btn-normal" onclick="reservation()">订房</button></div>>
F
fengjin 已提交
46
        </form>
F
fengjin 已提交
47

F
fengjin 已提交
48 49 50 51 52 53
    </div>
</div>


<script>
    $(function () {
F
fengjin 已提交
54 55 56 57 58
        let house = JSON.parse(localStorage.getItem("house"));


        $("#houseName").val(house.houseName);

F
fengjin 已提交
59
    });
F
fengjin 已提交
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
  function reservation()
  {
      $.ajax({
          url:"house/reservation",
          dataType:"json",
          data:
              {
                  customerId:$("#customerId").val(),
                  name:$("#houseName").val()
              },
          success:function (data){

              alert(data.massage)
              console.log(data.massage)
              var index = parent.layer.getFrameIndex(window.name);
              //表格重载 就相当于 刷新父页面的表格-dataTable是父页面的表格ID属性
              parent.layui.table.reload('dataTable');
              //关闭当前frame
              parent.layer.close(index);

              xadmin.father_reload();

F
fengjin 已提交
82

F
fengjin 已提交
83 84 85
          }
      })
  }
F
fengjin 已提交
86 87 88 89 90 91



</script>
</body>
</html>