index3.html 11 KB

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