orders.html 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  1. {extend name="common/common2" /}
  2. {block name="main"}
  3. <ul class="nav nav-tabs">
  4. <li {if($orderType == 1)}class="active"{/if}><a href="{:url('Index/ordersList',['mode'=>$mode,'orderType'=>1])}">订单<span id="orderbox1">(0)</span></a></li>
  5. <li {if($orderType == 2)}class="active"{/if}><a href="{:url('Index/ordersList',['mode'=>$mode,'orderType'=>2])}">投诉<span id="orderbox2">(0)</span></a></li>
  6. <li {if($orderType == 3)}class="active"{/if}><a href="{:url('Index/ordersList',['mode'=>$mode,'orderType'=>3])}">隐患<span id="orderbox3">(0)</span></a></li>
  7. <li {if($orderType == 4)}class="active"{/if}><a href="{:url('Index/ordersList',['mode'=>$mode,'orderType'=>4])}">驳回<span id="orderbox4">(0)</span></a></li>
  8. </ul>
  9. <div class="ibox">
  10. <div class="ibox-content">
  11. <div class="jqGrid_wrapper">
  12. <table id="table" style="border-collapse: collapse"></table>
  13. <div id="pager"></div>
  14. </div>
  15. </div>
  16. </div>
  17. {/block}
  18. {block name="script"}
  19. <script src="/static/layDate-v5.0.9/laydate.js"></script>
  20. <script>
  21. var orderType = '{$orderType}';
  22. //导出
  23. function excel_download(_self){
  24. var url = $(_self).attr('data-url');
  25. var param = $('#form-search').serialize();
  26. window.location.href = url+'?'+param;
  27. }
  28. $(function () {
  29. $(window).bind("resize",function(){
  30. var width=$(".jqGrid_wrapper").width();
  31. $("#table").setGridWidth(width);
  32. });
  33. let url1 = "{:url('Index/ordersList')}?mode={$mode}&orderType=1";
  34. $.post(url1,{},function (res) {
  35. console.log('res',res);
  36. $('#orderbox1').html('('+res.records+')');
  37. });
  38. let url2 = "{:url('Index/ordersList')}?mode={$mode}&orderType=2";
  39. $.post(url2,{},function (res) {
  40. console.log('res',res);
  41. $('#orderbox2').html('('+res.records+')');
  42. });
  43. let url3 = "{:url('Index/ordersList')}?mode={$mode}&orderType=3";
  44. $.post(url3,{},function (res) {
  45. console.log('res',res);
  46. $('#orderbox3').html('('+res.records+')');
  47. });
  48. let url4 = "{:url('Index/ordersList')}?mode={$mode}&orderType=4";
  49. $.post(url4,{},function (res) {
  50. console.log('res',res);
  51. $('#orderbox4').html('('+res.records+')');
  52. });
  53. $.jgrid.defaults.styleUI="Bootstrap";
  54. if(orderType == 1){
  55. $("#table").jqGrid({
  56. url:"{:url('Index/ordersList')}?mode={$mode}&orderType={$orderType}",
  57. datatype: "json",
  58. colModel:[
  59. {label:'编号',name:'id',index:'id', width:30,sortable: false},
  60. {label:'申请时间',name:'create_time',index:'create_time',width:50,sortable: false},
  61. {label:'内容',name:'content',index:'content',width:60,sortable: false},
  62. {label:'所在科室/部门',name:'dep',index:'dep',width:60,sortable: false},
  63. {label:'来源',name:'source_type_text',index:'source_type_text',width:60,sortable: false},
  64. {label:'联系方式',name:'mobile',index:'mobile',width:60,sortable: true},
  65. {label:'状态',name:'order_mode_text',index:'order_mode_text',width:60,sortable: false,formatter:function (a, b, c) {
  66. if(c.bh_nums >0){
  67. return '<span style="color: '+c.order_mode_color+'">'+a+"(存在驳回)"+'</span>'
  68. }else{
  69. return '<span style="color: '+c.order_mode_color+'">'+a+'</span>'
  70. }
  71. }},
  72. {label:'操作',width:50,sortable: false,formatter: function (a, b, c) {
  73. var detail_url = "{:url('Index/ordersDetail2',[],'')}/id/"+c.id;
  74. var del_url = "{:url('Orders/del',[],'')}/id/"+c.id;
  75. var reject_url = "{:url('Orders/rejectTodoList',[],'')}/orderId/"+c.id;
  76. var btn = '<a url="'+detail_url+'" href="javascript:;" onclick="layer_open(this,2)"><span class="label label-primary" title="详情">详情</span></a>&nbsp;';
  77. // var btn = '<a href="'+detail_url+'" ><span class="label label-primary" onclick="layer_open(this,2)" title="详情">详情</span></a>&nbsp;';
  78. if(c.order_mode == 4 && c.bh_nums >0){
  79. btn += '<a url="'+reject_url+'" href="javascript:;" onclick="layer_open(this,2)" ><span class="label label-success" data-title="驳回工单">驳回工单</span></a>&nbsp;';
  80. }
  81. if(c.order_mode == 5 ||c.order_mode == 6){
  82. 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>';
  83. }
  84. return btn;
  85. }},
  86. ],
  87. rowNum:10,
  88. rowList:[10,20,30,50,100],
  89. pager: '#pager',
  90. sortname: 'id',
  91. viewrecords: true,
  92. autowidth:true,
  93. mtype: 'post',
  94. height: 'auto',
  95. emptyrecords: "暂无数据",
  96. sortorder: "desc",
  97. caption:"{$m_name}订单列表",
  98. loadComplete: function (xhr) {
  99. if(xhr.code==0){
  100. layer.msg(xhr.msg);
  101. return false;
  102. }
  103. },
  104. });
  105. }else if(orderType == 2){
  106. $("#table").jqGrid({
  107. url:"{:url('Index/ordersList')}?mode={$mode}&orderType={$orderType}",
  108. datatype: "json",
  109. colModel:[
  110. {label:'编号',name:'id',index:'id', width:30,sortable: false},
  111. {label:'时间',name:'create_time',index:'create_time',width:60,sortable: false},
  112. {label:'处理时间',name:'update_time',index:'update_time',width:60,sortable: false},
  113. {label:'完成时间',name:'finish_time',index:'finish_time',width:60,sortable: false},
  114. {label:'内容',name:'content',index:'content',width:100,sortable: false},
  115. {label:'部门',name:'depName',index:'depName',width:60,sortable: false},
  116. {label:'用户',name:'realName',index:'realName',width:40,sortable: false},
  117. {label:'状态',name:'statusTxt',index:'statusTxt',width:40,sortable: false},
  118. // {label:'来源',name:'from',index:'from',width:40,sortable: false,formatter: function (a, b, c) {
  119. // return '投诉';
  120. // }},
  121. // {label:'来源',name:'fromName',index:'fromName',width:40,sortable: false},
  122. // {label:'订单类型',name:'worktypemode',index:'worktypemode',width:40,sortable: false},
  123. {label:'操作',width:80,sortable: false,formatter: function (a, b, c) {
  124. var detail_url = "{:url('Complain/detail',[],'')}/id/"+c.id;
  125. var edit_url = "{:url('Complain/edit',[],'')}/id/"+c.id;
  126. var del_url = "{:url('Complain/del',[],'')}/id/"+c.id;
  127. var send_url = "{:url('Complain/send',[],'')}/id/"+c.id;
  128. var ts_send_url = "{:url('Complain/ts_send',[],'')}/id/"+c.id;
  129. var summary_url = "{:url('Complain/summary',[],'')}/id/"+c.id;
  130. var btn = '';
  131. // if(c.status===0){
  132. // btn+= '<a url="'+edit_url+'" href="javascript:;" data-title="直接处理" onclick="layer_open(this,1)"><span class="label label-primary" title="直接处理">直接处理</span></a>&nbsp;';
  133. // btn+= '<a url="'+send_url+'" href="javascript:;" data-title="转任务" onclick="layer_open(this,1)"><span class="label label-primary" title="转任务">转任务</span></a>&nbsp;';
  134. // btn+= '<a url="'+ts_send_url+'" href="javascript:;" data-title="转单" onclick="layer_open(this,1)"><span class="label label-primary" title="转单">转单</span></a>&nbsp;';
  135. //
  136. // }
  137. // btn+= '<a href="'+detail_url+'" ><span class="label label-primary" title="详情">详情</span></a>&nbsp;';
  138. btn+= '<a url="'+detail_url+'" href="javascript:;" data-title="详情" onclick="layer_open(this,1)"><span class="label label-primary" title="详情">详情</span></a>&nbsp;';
  139. btn += '<a {if !btnAuth(session("user_auth.id"),"Complain/del")} 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;';
  140. // if((c.status== 1 && c.order_id == 0) || (c.status ==1 && c.order_mode == 3 || c.order_mode == 5 || c.order_mode == 6) ){
  141. // btn+= '<a url="'+summary_url+'" href="javascript:;" data-title="总结" onclick="layer_open(this,1)"><span class="label label-primary" title="总结">总结</span></a>&nbsp;';
  142. // }
  143. return btn;
  144. }},
  145. ],
  146. rowNum:10,
  147. rowList:[10,20,30,50,100],
  148. pager: '#pager',
  149. sortname: 'id',
  150. viewrecords: true,
  151. autowidth:true,
  152. mtype: 'post',
  153. height: 'auto',
  154. emptyrecords: "暂无数据",
  155. sortorder: "desc",
  156. caption:"投诉订单列表",
  157. loadComplete: function (xhr) {
  158. if(xhr.code==0){
  159. layer.msg(xhr.msg);
  160. return false;
  161. }
  162. },
  163. });
  164. }else if(orderType == 3){
  165. $("#table").jqGrid({
  166. url:"{:url('Index/ordersList')}?mode={$mode}&orderType={$orderType}",
  167. datatype: "json",
  168. colModel:[
  169. {label:'编号',name:'id',index:'id', width:30,sortable: false},
  170. {label:'时间',name:'create_time',index:'create_time',width:50,sortable: false},
  171. {label:'内容',name:'content',index:'content',width:60,sortable: false},
  172. {label:'部门',name:'depName',index:'depName',width:60,sortable: false},
  173. {label:'用户',name:'realName',index:'realName',width:60,sortable: false},
  174. {label:'状态',name:'statusTxt',index:'statusTxt',width:60,sortable: false},
  175. // {label:'来源',name:'from',index:'from',width:40,sortable: false,formatter: function (a, b, c) {
  176. // return '隐患'
  177. // }},
  178. // {label:'去向',name:'fromName',index:'fromName',width:40,sortable: false},
  179. // {label:'来源',name:'fromName',index:'fromName',width:40,sortable: false},
  180. // {label:'订单类型',name:'worktypemode',index:'worktypemode',width:40,sortable: false},
  181. {label:'操作',width:120,sortable: false,formatter: function (a, b, c) {
  182. var detail_url = "{:url('Hiddendanger/detail',[],'')}/id/"+c.id;
  183. var edit_url = "{:url('Hiddendanger/edit',[],'')}/id/"+c.id;
  184. var del_url = "{:url('Hiddendanger/del',[],'')}/id/"+c.id;
  185. var send_url = "{:url('Hiddendanger/send',[],'')}/id/"+c.id;
  186. var ts_send_url = "{:url('Hiddendanger/ts_send',[],'')}/id/"+c.id;
  187. var btn = '';
  188. // if(c.status===0){
  189. // if(c.order_id < 1 && c.order_mode == 0){
  190. // btn+= '<a url="'+edit_url+'" href="javascript:;" data-title="直接处理" onclick="layer_open(this,1)"><span class="label label-primary" title="直接处理">直接处理</span></a>&nbsp;';
  191. // btn+= '<a url="'+send_url+'" href="javascript:;" data-title="转任务" onclick="layer_open(this,1)"><span class="label label-primary" title="转任务">转任务</span></a>&nbsp;';
  192. // btn+= '<a url="'+ts_send_url+'" href="javascript:;" data-title="转单" onclick="layer_open(this,1)"><span class="label label-primary" title="转单">转单</span></a>&nbsp;';
  193. // }
  194. //
  195. // }
  196. // btn+= '<a href="'+detail_url+'" ><span class="label label-primary" title="详情">详情</span></a>&nbsp;';
  197. btn+= '<a url="'+detail_url+'" href="javascript:;" data-title="详情" onclick="layer_open(this,1)"><span class="label label-primary" title="详情">详情</span></a>&nbsp;';
  198. btn += '<a {if !btnAuth(session("user_auth.id"),"Complain/del")} 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;';
  199. return btn;
  200. }},
  201. ],
  202. rowNum:10,
  203. rowList:[10,20,30,50,100],
  204. pager: '#pager',
  205. sortname: 'id',
  206. viewrecords: true,
  207. autowidth:true,
  208. mtype: 'post',
  209. height: 'auto',
  210. emptyrecords: "暂无数据",
  211. sortorder: "desc",
  212. caption:"隐患预警",
  213. loadComplete: function (xhr) {
  214. if(xhr.code==0){
  215. layer.msg(xhr.msg);
  216. return false;
  217. }
  218. },
  219. });
  220. }else if(orderType == 4){
  221. $("#table").jqGrid({
  222. url:"{:url('Index/ordersList')}?mode={$mode}&orderType={$orderType}",
  223. datatype: "json",
  224. colModel:[
  225. {label:'编号',name:'id',index:'id', width:30,sortable: false},
  226. {label:'申请时间',name:'create_time',index:'create_time',width:50,sortable: false},
  227. {label:'内容',name:'content',index:'content',width:60,sortable: false},
  228. {label:'所在科室/部门',name:'dep',index:'dep',width:60,sortable: false},
  229. {label:'来源',name:'source_type_text',index:'source_type_text',width:60,sortable: false},
  230. {label:'联系方式',name:'mobile',index:'mobile',width:60,sortable: false},
  231. {label:'状态',name:'order_mode_text',index:'order_mode_text',width:60,sortable: false,formatter:function (a, b, c) {
  232. if(c.bh_nums >0){
  233. return '<span style="color: '+c.order_mode_color+'">'+a+"(存在驳回)"+'</span>'
  234. }else{
  235. return '<span style="color: '+c.order_mode_color+'">'+a+'</span>'
  236. }
  237. }},
  238. {label:'操作',width:50,sortable: false,formatter: function (a, b, c) {
  239. var detail_url = "{:url('Index/ordersDetail2',[],'')}/id/"+c.id;
  240. var del_url = "{:url('Orders/del',[],'')}/id/"+c.id;
  241. var reject_url = "{:url('Orders/rejectTodoList',[],'')}/orderId/"+c.id;
  242. var btn = '<a url="'+detail_url+'" href="javascript:;" onclick="layer_open(this,2)"><span class="label label-primary" title="详情">详情</span></a>&nbsp;';
  243. // var btn = '<a href="'+detail_url+'" ><span class="label label-primary" onclick="layer_open(this,2)" title="详情">详情</span></a>&nbsp;';
  244. if(c.order_mode == 4 && c.bh_nums >0){
  245. btn += '<a url="'+reject_url+'" href="javascript:;" onclick="layer_open(this,2)" ><span class="label label-success" data-title="驳回工单">驳回工单</span></a>&nbsp;';
  246. }
  247. if(c.order_mode == 5 ||c.order_mode == 6){
  248. 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>';
  249. }
  250. return btn;
  251. }},
  252. ],
  253. rowNum:10,
  254. rowList:[10,20,30,50,100],
  255. pager: '#pager',
  256. sortname: 'id',
  257. viewrecords: true,
  258. autowidth:true,
  259. mtype: 'post',
  260. height: 'auto',
  261. emptyrecords: "暂无数据",
  262. sortorder: "desc",
  263. caption:"{$m_name}订单列表",
  264. loadComplete: function (xhr) {
  265. if(xhr.code==0){
  266. layer.msg(xhr.msg);
  267. return false;
  268. }
  269. },
  270. });
  271. }
  272. });
  273. </script>
  274. {/block}