index1.html 11 KB

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