index.html 8.8 KB

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