index0.html 11 KB

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