index.html 7.7 KB

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