index.html 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. {extend name="common/common2" /}
  2. {block name="main"}
  3. <style>
  4. .av{
  5. background-color: #23c6c8 !important;
  6. border-color: #23c6c8 !important;
  7. }
  8. }
  9. </style>
  10. <div class="ibox">
  11. <div class="ibox-content">
  12. <div class="row">
  13. <div class="col-xs-2" style="margin-bottom: 15px;margin-right: 10px">
  14. <a href="javascript:;" url="{:url('add')}" data-title="创建订单" onclick="layer_open(this,1)" class="btn btn-sm btn-primary">创建订单</a>
  15. </div>
  16. <div class="col-xs-14" style="text-align: left;">
  17. <form class="form-inline" id="form-search" action="{:url('index')}">
  18. <div class="input-group">
  19. <input type="text" class="form-control" name="sn" placeholder="订单编号">
  20. </div>
  21. <!--<div class="input-group">-->
  22. <!--<input type="text" class="form-control" name="title" placeholder="创建人">-->
  23. <!--</div>-->
  24. <!--<div class="input-group">-->
  25. <!--<input type="text" class="form-control" name="title1" placeholder="护工名称">-->
  26. <!--</div>-->
  27. <div class="input-group">
  28. <input type="text" id="date" readonly class="form-control" name="begin" placeholder="开始日期">
  29. </div>
  30. <div class="input-group">
  31. <input type="text" id="date1" readonly class="form-control" name="end" placeholder="结束日期">
  32. </div>
  33. <div class="input-group">
  34. <select name="cateId" class="form-control">
  35. <option value="">选择陪护服务</option>
  36. {volist name="cate" id="v"}
  37. <option value="{$v.id}">{$v.title}</option>
  38. {/volist}
  39. </select>
  40. </div>
  41. <div class="input-group">
  42. <select name="depId" class="form-control">
  43. <option value="">选择科室/部门</option>
  44. {volist name="dep" id="v"}
  45. <option value="{$v.id}">{$v.title}</option>
  46. {/volist}
  47. </select>
  48. </div>
  49. <!--<div class="input-group">-->
  50. <!--<select name="status" class="form-control">-->
  51. <!--<option value="">订单状态</option>-->
  52. <!--{volist name="status" id="v"}-->
  53. <!--<option value="{$key}">{$v}</option>-->
  54. <!--{/volist}-->
  55. <!--</select>-->
  56. <!--</div>-->
  57. <div class="input-group">
  58. <span class="input-group-btn">
  59. <button class="btn-sm btn-primary" type="button" id ="search-btn" ><i class="fa fa-search"></i></button>
  60. </span>
  61. <span class="input-group-btn">
  62. <button class="btn-sm btn-primary " type="button" id="search-clear"><i class="fa fa-undo"></i></button>
  63. </span>
  64. <span class="input-group-btn">
  65. <button data-url="{:url('export')}" title="导出" class="btn-sm btn-primary" onclick="excel_download(this)" type="button" ><i class="fa fa-cloud-download"></i></button>
  66. </span>
  67. </div> <div class="input-group">
  68. <input type="hidden" name="status" id="status" value="">
  69. </div>
  70. </form>
  71. </div>
  72. </div>
  73. </div>
  74. <div class="ibox-content">
  75. {volist name="status" id="v"}
  76. <button class="btn-sm btn-primary ss" onclick="load_index(this,'{$key}')" type="button" ><i class="fa "></i>{$v}</button>
  77. {/volist}
  78. </div>
  79. <div class="ibox-content">
  80. <div class="jqGrid_wrapper">
  81. <table id="table" style="border-collapse: collapse"></table>
  82. <div id="pager"></div>
  83. </div>
  84. </div>
  85. </div>
  86. <script src="/static/layDate-v5.0.9/laydate.js"></script>
  87. {/block}
  88. {block name="script"}
  89. <script>
  90. //导出
  91. function excel_download(_self){
  92. var url = $(_self).attr('data-url');
  93. var param = $('#form-search').serialize();
  94. window.location.href = url+'?'+param;
  95. }
  96. function load_index(self,key){
  97. $(self).addClass('av').siblings().removeClass('av')
  98. $("#status").val(key);
  99. $("#search-btn").click();
  100. }
  101. laydate.render({
  102. elem: '#date',
  103. //设置开始日期、日期日期的 input 选择器
  104. //数组格式为 5.3.0 开始新增,之前版本直接配置 true 或任意分割字符即可
  105. trigger: 'click' ,
  106. theme: '#337ab7'
  107. });
  108. laydate.render({
  109. elem: '#date1',
  110. //设置开始日期、日期日期的 input 选择器
  111. //数组格式为 5.3.0 开始新增,之前版本直接配置 true 或任意分割字符即可
  112. trigger: 'click' ,
  113. theme: '#337ab7'
  114. });
  115. $(function () {
  116. $(window).bind("resize",function(){
  117. var width=$(".jqGrid_wrapper").width();
  118. $("#table").setGridWidth(width);
  119. });
  120. $.jgrid.defaults.styleUI="Bootstrap";
  121. $("#table").jqGrid({
  122. url:"{:url('index')}",
  123. datatype: "json",
  124. colModel:[
  125. {label:'订单编号',name:'sn',index:'sn',width:50,editable: false,sortable: false},
  126. // {label:'创建人',name:'userName',index:'userName',width:30,editable: false,sortable: false},
  127. {label:'患者姓名',name:'name',index:'name',width:30,editable: false,sortable: false},
  128. {label:'联系电话',name:'phone',index:'phone',width:40,editable: false,sortable: false},
  129. {label:'科室/部门',name:'depName',index:'depName',width:40,editable: false,sortable: false},
  130. {label:'预收金',name:'pre_money',index:'pre_money',width:40,editable: false,sortable: false},
  131. {label:'陪护服务',name:'cateName',index:'cateName',width:40,editable: false,sortable: false},
  132. {label:'开始日期',name:'start',index:'start',width:50,editable: false,sortable: false},
  133. {label:'结束日期',name:'end',index:'end',width:50,editable: false,sortable: false},
  134. {label:'订单金额',name:'amount',index:'amount',width:30,editable: false,sortable: false},
  135. {label:'状态',name:'status_text',index:'status_text',width:30,editable: false,sortable: false},
  136. {label:'下单日期',name:'create_time',index:'create_time',width:50,editable: false,sortable: false},
  137. {label:'操作',width:50,sortable: false,formatter: function (a, b, c) {
  138. var editurl = "{:url('detail',[],'')}/id/"+c.id;
  139. var cancel_url = "{:url('cancel',[],'')}/id/"+c.id;
  140. //var btn = '<a href="'+editurl+'"><span class="label label-info" title="详情">详情</span></a>&nbsp;';
  141. var btn = '<a href="'+editurl+'"<span class="label label-primary" title="详情">详情</span></a>&nbsp;';
  142. if(c.is_zf == 0){
  143. if(c.status == 0||c.status == 1){
  144. btn += '<a href="javascript:;" url="'+cancel_url+'" data-title="作废" onclick="layer_open(this,1)"><span class="label label-danger" title="作废">作废</span></a>';
  145. }
  146. }
  147. return btn;
  148. }},
  149. ],
  150. rowNum:10,
  151. rowList:[10,20,30,50,100],
  152. pager: '#pager',
  153. sortname: 'id',
  154. viewrecords: true,
  155. autowidth:true,
  156. mtype: 'post',
  157. height: 'auto',
  158. emptyrecords: "暂无数据",
  159. sortorder: "desc",
  160. caption:"陪护订单列表",
  161. loadComplete: function (xhr) {
  162. if(xhr.code==0){
  163. layer.msg(xhr.msg);
  164. return false;
  165. }
  166. var totalMoney = xhr.totalMoney;
  167. $('#pager_left').html('<span style="color:red;font-size: 10px;">订单总额:'+totalMoney+' 元');
  168. },
  169. });
  170. });
  171. </script>
  172. {/block}