0
0

index3.html 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  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-1">
  7. {if $mode!=15 && in_array($mode,$auths)}
  8. <a href="javascript:;" url="{:url('dispatchAdd',[],'')}/mode/{$mode}" data-title="创建{$m_name}订单" onclick="layer_open(this,1)" class="btn btn-sm btn-primary">创建{$m_name}订单</a>
  9. {/if}
  10. &nbsp;
  11. </div>
  12. <div class="col-xs-11" style="text-align: right;">
  13. <form class="form-inline" id="form-search" action="{:url('index')}?mode={$mode}">
  14. <div class="input-group">
  15. <input type="text" class="form-control" name="sn" placeholder="订单编号">
  16. </div>
  17. <div class="input-group">
  18. <input type="text" class="form-control" name="content" placeholder="内容">
  19. </div>
  20. <div class="input-group">
  21. <input class="form-control" id="start" readonly placeholder="开始时间" name="start" >
  22. </div>
  23. <div class="input-group">
  24. <input class="form-control" id="end" readonly placeholder="结束时间" name="end" >
  25. </div>
  26. <div class="input-group">
  27. <select name="dep_id" class="form-control">
  28. <option value="">所在科室/部门</option>
  29. {foreach $dep_list as $k=>$v}
  30. <option value="{$v['id']}">{$v['title']}</option>
  31. {/foreach}
  32. </select>
  33. </div>
  34. <div class="input-group">
  35. <select name="order_mode" class="form-control">
  36. <option value="">选择状态</option>
  37. {foreach $order_mode_list as $k=>$v}
  38. <option value="{$v['id']}">{$v['in_content']}</option>
  39. {/foreach}
  40. </select>
  41. </div>
  42. <div class="input-group">
  43. <select name="from" class="form-control">
  44. <option value="">来源</option>
  45. <option value="1">一键呼叫</option>
  46. <option value="4">报修</option>
  47. <option value="5">保洁</option>
  48. <option value="6">运送</option>
  49. <option value="7">应急</option>
  50. <option value="2">隐患</option>
  51. <option value="3">投诉</option>
  52. </select>
  53. </div>
  54. <br/>
  55. <br/>
  56. <!-- <div class="input-group">-->
  57. <!-- <select name="dep_cate" class="form-control">-->
  58. <!-- <option value="">部门分类</option>-->
  59. <!-- {foreach $dep_cate as $k=>$v}-->
  60. <!-- <option value="{$v['id']}">{$v['title']}</option>-->
  61. <!-- {/foreach}-->
  62. <!-- </select>-->
  63. <!-- </div>-->
  64. <div class="input-group">
  65. <span class="input-group-btn">
  66. <button class="btn-sm btn-primary" type="button" id ="search-btn" ><i class="fa fa-search"></i></button>
  67. </span> &nbsp;
  68. <span class="input-group-btn">
  69. <button class="btn-sm btn-warning" type="button" id="search-clear"><i class="fa fa-undo"></i></button>
  70. </span>
  71. &nbsp;
  72. <span class="input-group-btn">
  73. <button data-url="{:url('export',[],'')}/mode/{$mode}" title="导出" class="btn-sm btn-primary" onclick="excel_download(this)" type="button" ><i class="fa fa-cloud-download"></i></button>
  74. </span>
  75. </div>
  76. </form>
  77. </div>
  78. </div>
  79. </div>
  80. <div class="ibox-content">
  81. <div class="jqGrid_wrapper">
  82. <table id="table" style="border-collapse: collapse"></table>
  83. <div id="pager"></div>
  84. </div>
  85. </div>
  86. </div>
  87. {/block}
  88. {block name="script"}
  89. <script src="/static/layDate-v5.0.9/laydate.js"></script>
  90. <script>
  91. //导出
  92. function excel_download(_self){
  93. var url = $(_self).attr('data-url');
  94. var param = $('#form-search').serialize();
  95. window.location.href = url+'?'+param;
  96. }
  97. $(function () {
  98. laydate.render({
  99. elem: '#start',
  100. trigger: 'click' ,
  101. theme: '#148d8f'
  102. });
  103. laydate.render({
  104. elem: '#end',
  105. trigger: 'click' ,
  106. theme: '#148d8f'
  107. });
  108. $(window).bind("resize",function(){
  109. var width=$(".jqGrid_wrapper").width();
  110. $("#table").setGridWidth(width);
  111. });
  112. $.jgrid.defaults.styleUI="Bootstrap";
  113. $("#table").jqGrid({
  114. url:"{:url('index')}?mode={$mode}",
  115. datatype: "json",
  116. colModel:[
  117. {label:'编号',name:'sn',index:'sn', width:80,sortable: false},
  118. {label:'申请时间',name:'create_time',index:'create_time',width:50,sortable: true},
  119. {label:'开始地点',name:'start_name',index:'start_name',width:40,sortable: true},
  120. {label:'内容',name:'content',index:'content',width:60,sortable: true},
  121. {label:'所在科室/部门',name:'dep',index:'dep',width:60,sortable: true},
  122. // {label:'部门分类',name:'dep_cate_name',index:'dep_cate_name',width:60,sortable: true},
  123. {label:'来源',name:'source_type_text',index:'source_type_text',width:60,sortable: true},
  124. {label:'联系方式',name:'mobile',index:'mobile',width:60,sortable: true},
  125. {label:'状态',name:'order_mode_text',index:'order_mode_text',width:60,sortable: true,formatter:function (a, b, c) {
  126. if(c.bh_nums >0){
  127. return '<span style="color: '+c.order_mode_color+'">'+a+"(存在驳回)"+'</span>'
  128. }else{
  129. return '<span style="color: '+c.order_mode_color+'">'+a+'</span>'
  130. }
  131. }},
  132. {label:'操作',width:50,sortable: false,formatter: function (a, b, c) {
  133. var detail_url = "{:url('detail2',[],'')}/id/"+c.id;
  134. var del_url = "{:url('del',[],'')}/id/"+c.id;
  135. var reject_url = "{:url('rejectTodoList',[],'')}/orderId/"+c.id;
  136. // var btn = '<a href="'+detail_url+'" ><span class="label label-primary" title="详情">详情</span></a>&nbsp;';
  137. var btn = '<a url="'+detail_url+'" href="javascript:;" data-title="详情" onclick="layer_open(this,1)"><span class="label label-primary" title="详情">详情</span></a>&nbsp;';
  138. if(c.order_mode == 4 && c.bh_nums >0){
  139. btn += '<a url="'+reject_url+'" href="javascript:;" onclick="layer_open(this,1)" ><span class="label label-success" data-title="驳回工单">驳回工单</span></a>&nbsp;';
  140. }
  141. // if(c.order_mode == 5 ||c.order_mode == 6){
  142. // btn += '<a {if !btnAuth(session("user_auth.id"),"Orders/del?mode=$mode")} style="display:none" {/if} href="'+del_url+'" class="confirm ajax-get" data-confirm="确定要删除吗?" data-table="1"><span class="label label-danger" title="删除">删除</span></a>';
  143. // }
  144. btn += '<a {if !btnAuth(session("user_auth.id"),"Orders/del?mode=$mode")} style="display:none" {/if} href="'+del_url+'" class="confirm ajax-get" data-confirm="确定要删除吗?" data-table="1"><span class="label label-danger" title="删除">删除</span></a>';
  145. return btn;
  146. }},
  147. ],
  148. rowNum:10,
  149. rowList:[10,20,30,50,100],
  150. pager: '#pager',
  151. sortname: 'id',
  152. viewrecords: true,
  153. autowidth:true,
  154. mtype: 'post',
  155. height: 'auto',
  156. emptyrecords: "暂无数据",
  157. sortorder: "desc",
  158. caption:"{$m_name}订单列表",
  159. loadComplete: function (xhr) {
  160. if(xhr.code==0){
  161. layer.msg(xhr.msg);
  162. return false;
  163. }
  164. },
  165. });
  166. });
  167. </script>
  168. {/block}