| <!DOCTYPE HTML> | 
| <html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> | 
| <head> | 
| <meta charset="utf-8"> | 
| <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> | 
| <meta name="renderer" content="webkit|ie-comp|ie-stand"> | 
| <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | 
| <meta name="viewport" | 
|     content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" /> | 
| <meta http-equiv="Cache-Control" content="no-siteapp" /> | 
| <LINK rel="Bookmark" href="../images/favicon.ico"> | 
| <!-- 本框架基本脚本和样式 --> | 
| <script type="text/javascript" | 
|     th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> | 
| <script type="text/javascript" | 
|     th:src="@{/js/systools/MBase.js}"></script> | 
| </head> | 
| <body> | 
|   | 
|   | 
|   | 
|   | 
|     <div class="ibox-content"> | 
|         <div class="row"> | 
|               <div class="panel panel-warning"> | 
|                   <div class="panel-heading">线上预约 | 
|                   </div> | 
|                   <div class="panel-body"> | 
|                 <form class="form-inline" id="serchform"> | 
|                         <div class="form-group"> | 
|                             <div class="col-sm-12"> | 
|                                 <label class=" control-label">预约状态  </label> | 
|                                 <select style="width: 200px; display: inline;" onchange="myGrid.serchData();" id="status" class="  form-control autoFull"  | 
|                                 name="status" >  | 
|                                 <option value="">--请选择--</option> | 
|                                 <option value="2" >预约成功</option> | 
|                                 <option  selected="selected" value="1">待处理</option> | 
|                                 <option value="3">预约取消</option> | 
|                                 </select> | 
|                             </div> | 
|                         </div> | 
|                     <button onclick="myGrid.serchData()" type="button" | 
|                             class="btn btn-default btn-sm"> | 
|                         <i class="fa fa-search "></i> 搜索 | 
|                     </button> | 
|                     <button type="reset" class="btn btn-default btn-sm"> | 
|                         <i class="fa fa-refresh "></i> 重置 | 
|                     </button> | 
|                 </form>      | 
|                  <div class="option-bar"  > | 
|                     <button  matrix:btn="onlineBookingClub-exportExcel"   onclick="exportExcel()" type="button" class="btn btn-success btn-sm"><i class="glyphicon glyphicon-export icon-share" ></i> 导出数据</button> | 
|                 </div> | 
|                 <table class="table table-bordered" id="mgrid"> | 
|                 <thead> | 
|                     <tr> | 
|                         <th data-checkbox="true"  ></th> | 
|                         <th data-formatter="MGrid.indexfn" data-align="center"  data-width="30px" >序号</th> | 
|                         <th data-field="orderNo" data-sortable="true">订单号</th> | 
|                         <th data-field="vipInfo.vipName" data-sortable="true">会员姓名</th> | 
|                         <th data-field="tel" data-sortable="true" >联系电话</th> | 
|                         <th data-field="time" data-sortable="true" data-formatter="MGrid.getTime" >预约时间</th> | 
|                         <th data-field="staffInfo.suName" data-sortable="true" >预约美疗师</th> | 
|                         <th data-field="shopProduct.title" data-sortable="true" >预约服务</th> | 
|                         <th data-field="dicMap.status" data-sortable="true" >状态</th> | 
|                         <th data-field="remark" data-sortable="true" >备注</th> | 
|                         <th data-field="createTime" data-formatter="MGrid.getTime" data-sortable="true" >创建时间</th> | 
|                         <th data-field="reason" data-sortable="true" >取消原因</th> | 
|                         <th  data-sortable="true" data-field="id" data-formatter="buidOperate">操作</th> | 
|                     </tr> | 
|                 </thead> | 
|                 </table> | 
|              </div> | 
|           </div> | 
|         </div> | 
|     </div> | 
| </body> | 
| <script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script><script type="text/javascript"> | 
| var myGrid; | 
|     $(function(){ | 
|          myGrid=MGrid.initGrid({ | 
|              url:basePath+"/admin/onlinebooking/showList" | 
|          }); | 
|     }); | 
|   | 
|         var btns=[]; | 
|         btns[0]="",btns[1]="",btns[2]=""; | 
|         function buidOperate(value, row, index){ | 
|             var html=''; | 
|             if(row.status == '1'){ | 
|                 html +=  btns[0].replace('VALUE',value).replace('VIPID',row.vipId); | 
|                 html +=  btns[1].replace('VALUE',value); | 
|                 html +=  btns[2].replace('VALUE',value); | 
|             }      | 
|              | 
|             return html;  | 
|         } | 
|         // 打开添加服务单界面 | 
|         function openAddService(id,onId) { | 
|                 layer.full(layer.open({ | 
|                     type : 2, | 
|                     title : "添加服务单", | 
|                     maxmin : true, | 
|                     area : [ MUI.SIZE_L, '500px' ], | 
|                     content : [ basePath + '/admin/redirect/hive/beautySalon/servicceAddForm?id='+id ] | 
|                 })); | 
|         } | 
|         /** | 
|          *预约成功 | 
|          */ | 
|         function bookingCg(id) { | 
|             $.AjaxProxy({ | 
|                 a : false, | 
|                 c : false, | 
|                 p:{id:id,status:"2"} | 
|             }).invoke(basePath+'/admin/onlinebooking/addOrModify', function(loj) { | 
|                       layer.msg('操作成功!', {icon: 1},function(){ | 
|                           myGrid.serchData(); | 
|                       }); | 
|                   } | 
|             ); | 
|              | 
|         } | 
|         /** | 
|             预约失败 | 
|         */ | 
|         function bookingSb(id){ | 
|              layer.prompt({ | 
|                   formType: 2, | 
|                   title: '取消原因' | 
|                 }, function(value, index, elem){ | 
|                     $.AjaxProxy({ | 
|                         a : false, | 
|                         c : false, | 
|                         p:{id:id,reason:value,status:"3"} | 
|                     }).invoke(basePath+'/admin/onlinebooking/addOrModify' | 
|                             , function(loj) { | 
|                               layer.msg('操作成功!', {icon: 1}); | 
|                               myGrid.serchData(); | 
|                                 layer.close(index); | 
|                           } | 
|                     ); | 
|                 });  | 
|         } | 
|         //导出 | 
|         function exportExcel(){ | 
|             var status = $("#status").val(); | 
|             window.location.href=basePath+"/admin/onlinebooking/exportOnlinebooking?status="+status; | 
|         } | 
|          | 
| </script> | 
|   | 
|   | 
| <script matrix:btn="onlineBookingClub-newService"  > | 
|     btns[0]='<button class="btn btn-default btn-sm mr-5" onClick="openAddService(\'VIPID\',\'VALUE\')"  title="新建服务"><i class="fa fa-plus-square"></i></buttoun>' | 
| </script> | 
|   | 
| <script matrix:btn="onlineBookingClub-flagSuccess"  > | 
|     btns[1]='<button class="btn btn-default btn-sm mr-5" onClick="bookingCg(\VALUE\')"  title="标记成功"><i class="fa fa-check-circle"></i></buttoun>' | 
| </script> | 
|   | 
| <script matrix:btn="onlineBookingClub-flagFail"  > | 
|     btns[2]='<button class="btn btn-default btn-sm mr-5" onClick="bookingSb(\'VALUE\')"  title="标记失败"><i class="fa fa-times-circle"></i></buttoun>' | 
| </script> | 
|   | 
|   | 
| </html> |