123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291 |
- {extend name="common/common2" /}
- {block name="main"}
- <ul class="nav nav-tabs">
- <li {if($orderType == 1)}class="active"{/if}><a href="{:url('Index/ordersList',['mode'=>$mode,'orderType'=>1])}">订单<span id="orderbox1">(0)</span></a></li>
- <li {if($orderType == 2)}class="active"{/if}><a href="{:url('Index/ordersList',['mode'=>$mode,'orderType'=>2])}">投诉<span id="orderbox2">(0)</span></a></li>
- <li {if($orderType == 3)}class="active"{/if}><a href="{:url('Index/ordersList',['mode'=>$mode,'orderType'=>3])}">隐患<span id="orderbox3">(0)</span></a></li>
- <li {if($orderType == 4)}class="active"{/if}><a href="{:url('Index/ordersList',['mode'=>$mode,'orderType'=>4])}">驳回<span id="orderbox4">(0)</span></a></li>
- </ul>
- <div class="ibox">
- <div class="ibox-content">
- <div class="jqGrid_wrapper">
- <table id="table" style="border-collapse: collapse"></table>
- <div id="pager"></div>
- </div>
- </div>
- </div>
- {/block}
- {block name="script"}
- <script src="/static/layDate-v5.0.9/laydate.js"></script>
- <script>
- var orderType = '{$orderType}';
- //导出
- function excel_download(_self){
- var url = $(_self).attr('data-url');
- var param = $('#form-search').serialize();
- window.location.href = url+'?'+param;
- }
- $(function () {
- $(window).bind("resize",function(){
- var width=$(".jqGrid_wrapper").width();
- $("#table").setGridWidth(width);
- });
- let url1 = "{:url('Index/ordersList')}?mode={$mode}&orderType=1";
- $.post(url1,{},function (res) {
- console.log('res',res);
- $('#orderbox1').html('('+res.records+')');
- });
- let url2 = "{:url('Index/ordersList')}?mode={$mode}&orderType=2";
- $.post(url2,{},function (res) {
- console.log('res',res);
- $('#orderbox2').html('('+res.records+')');
- });
- let url3 = "{:url('Index/ordersList')}?mode={$mode}&orderType=3";
- $.post(url3,{},function (res) {
- console.log('res',res);
- $('#orderbox3').html('('+res.records+')');
- });
- let url4 = "{:url('Index/ordersList')}?mode={$mode}&orderType=4";
- $.post(url4,{},function (res) {
- console.log('res',res);
- $('#orderbox4').html('('+res.records+')');
- });
- $.jgrid.defaults.styleUI="Bootstrap";
- if(orderType == 1){
- $("#table").jqGrid({
- url:"{:url('Index/ordersList')}?mode={$mode}&orderType={$orderType}",
- datatype: "json",
- colModel:[
- {label:'编号',name:'id',index:'id', width:30,sortable: false},
- {label:'申请时间',name:'create_time',index:'create_time',width:50,sortable: false},
- {label:'内容',name:'content',index:'content',width:60,sortable: false},
- {label:'所在科室/部门',name:'dep',index:'dep',width:60,sortable: false},
- {label:'来源',name:'source_type_text',index:'source_type_text',width:60,sortable: false},
- {label:'联系方式',name:'mobile',index:'mobile',width:60,sortable: true},
- {label:'状态',name:'order_mode_text',index:'order_mode_text',width:60,sortable: false,formatter:function (a, b, c) {
- if(c.bh_nums >0){
- return '<span style="color: '+c.order_mode_color+'">'+a+"(存在驳回)"+'</span>'
- }else{
- return '<span style="color: '+c.order_mode_color+'">'+a+'</span>'
- }
- }},
- {label:'操作',width:50,sortable: false,formatter: function (a, b, c) {
- var detail_url = "{:url('Index/ordersDetail2',[],'')}/id/"+c.id;
- var del_url = "{:url('Orders/del',[],'')}/id/"+c.id;
- var reject_url = "{:url('Orders/rejectTodoList',[],'')}/orderId/"+c.id;
- var btn = '<a url="'+detail_url+'" href="javascript:;" onclick="layer_open(this,2)"><span class="label label-primary" title="详情">详情</span></a> ';
- // var btn = '<a href="'+detail_url+'" ><span class="label label-primary" onclick="layer_open(this,2)" title="详情">详情</span></a> ';
- if(c.order_mode == 4 && c.bh_nums >0){
- btn += '<a url="'+reject_url+'" href="javascript:;" onclick="layer_open(this,2)" ><span class="label label-success" data-title="驳回工单">驳回工单</span></a> ';
- }
- if(c.order_mode == 5 ||c.order_mode == 6){
- 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>';
- }
- return btn;
- }},
- ],
- rowNum:10,
- rowList:[10,20,30,50,100],
- pager: '#pager',
- sortname: 'id',
- viewrecords: true,
- autowidth:true,
- mtype: 'post',
- height: 'auto',
- emptyrecords: "暂无数据",
- sortorder: "desc",
- caption:"{$m_name}订单列表",
- loadComplete: function (xhr) {
- if(xhr.code==0){
- layer.msg(xhr.msg);
- return false;
- }
- },
- });
- }else if(orderType == 2){
- $("#table").jqGrid({
- url:"{:url('Index/ordersList')}?mode={$mode}&orderType={$orderType}",
- datatype: "json",
- colModel:[
- {label:'编号',name:'id',index:'id', width:30,sortable: false},
- {label:'时间',name:'create_time',index:'create_time',width:60,sortable: false},
- {label:'处理时间',name:'update_time',index:'update_time',width:60,sortable: false},
- {label:'完成时间',name:'finish_time',index:'finish_time',width:60,sortable: false},
- {label:'内容',name:'content',index:'content',width:100,sortable: false},
- {label:'部门',name:'depName',index:'depName',width:60,sortable: false},
- {label:'用户',name:'realName',index:'realName',width:40,sortable: false},
- {label:'状态',name:'statusTxt',index:'statusTxt',width:40,sortable: false},
- // {label:'来源',name:'from',index:'from',width:40,sortable: false,formatter: function (a, b, c) {
- // return '投诉';
- // }},
- // {label:'来源',name:'fromName',index:'fromName',width:40,sortable: false},
- // {label:'订单类型',name:'worktypemode',index:'worktypemode',width:40,sortable: false},
- {label:'操作',width:80,sortable: false,formatter: function (a, b, c) {
- var detail_url = "{:url('Complain/detail',[],'')}/id/"+c.id;
- var edit_url = "{:url('Complain/edit',[],'')}/id/"+c.id;
- var del_url = "{:url('Complain/del',[],'')}/id/"+c.id;
- var send_url = "{:url('Complain/send',[],'')}/id/"+c.id;
- var ts_send_url = "{:url('Complain/ts_send',[],'')}/id/"+c.id;
- var summary_url = "{:url('Complain/summary',[],'')}/id/"+c.id;
- var btn = '';
- // if(c.status===0){
- // btn+= '<a url="'+edit_url+'" href="javascript:;" data-title="直接处理" onclick="layer_open(this,1)"><span class="label label-primary" title="直接处理">直接处理</span></a> ';
- // btn+= '<a url="'+send_url+'" href="javascript:;" data-title="转任务" onclick="layer_open(this,1)"><span class="label label-primary" title="转任务">转任务</span></a> ';
- // btn+= '<a url="'+ts_send_url+'" href="javascript:;" data-title="转单" onclick="layer_open(this,1)"><span class="label label-primary" title="转单">转单</span></a> ';
- //
- // }
- // btn+= '<a href="'+detail_url+'" ><span class="label label-primary" title="详情">详情</span></a> ';
- btn+= '<a url="'+detail_url+'" href="javascript:;" data-title="详情" onclick="layer_open(this,1)"><span class="label label-primary" title="详情">详情</span></a> ';
- 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> ';
- // if((c.status== 1 && c.order_id == 0) || (c.status ==1 && c.order_mode == 3 || c.order_mode == 5 || c.order_mode == 6) ){
- // btn+= '<a url="'+summary_url+'" href="javascript:;" data-title="总结" onclick="layer_open(this,1)"><span class="label label-primary" title="总结">总结</span></a> ';
- // }
- return btn;
- }},
- ],
- rowNum:10,
- rowList:[10,20,30,50,100],
- pager: '#pager',
- sortname: 'id',
- viewrecords: true,
- autowidth:true,
- mtype: 'post',
- height: 'auto',
- emptyrecords: "暂无数据",
- sortorder: "desc",
- caption:"投诉订单列表",
- loadComplete: function (xhr) {
- if(xhr.code==0){
- layer.msg(xhr.msg);
- return false;
- }
- },
- });
- }else if(orderType == 3){
- $("#table").jqGrid({
- url:"{:url('Index/ordersList')}?mode={$mode}&orderType={$orderType}",
- datatype: "json",
- colModel:[
- {label:'编号',name:'id',index:'id', width:30,sortable: false},
- {label:'时间',name:'create_time',index:'create_time',width:50,sortable: false},
- {label:'内容',name:'content',index:'content',width:60,sortable: false},
- {label:'部门',name:'depName',index:'depName',width:60,sortable: false},
- {label:'用户',name:'realName',index:'realName',width:60,sortable: false},
- {label:'状态',name:'statusTxt',index:'statusTxt',width:60,sortable: false},
- // {label:'来源',name:'from',index:'from',width:40,sortable: false,formatter: function (a, b, c) {
- // return '隐患'
- // }},
- // {label:'去向',name:'fromName',index:'fromName',width:40,sortable: false},
- // {label:'来源',name:'fromName',index:'fromName',width:40,sortable: false},
- // {label:'订单类型',name:'worktypemode',index:'worktypemode',width:40,sortable: false},
- {label:'操作',width:120,sortable: false,formatter: function (a, b, c) {
- var detail_url = "{:url('Hiddendanger/detail',[],'')}/id/"+c.id;
- var edit_url = "{:url('Hiddendanger/edit',[],'')}/id/"+c.id;
- var del_url = "{:url('Hiddendanger/del',[],'')}/id/"+c.id;
- var send_url = "{:url('Hiddendanger/send',[],'')}/id/"+c.id;
- var ts_send_url = "{:url('Hiddendanger/ts_send',[],'')}/id/"+c.id;
- var btn = '';
- // if(c.status===0){
- // if(c.order_id < 1 && c.order_mode == 0){
- // btn+= '<a url="'+edit_url+'" href="javascript:;" data-title="直接处理" onclick="layer_open(this,1)"><span class="label label-primary" title="直接处理">直接处理</span></a> ';
- // btn+= '<a url="'+send_url+'" href="javascript:;" data-title="转任务" onclick="layer_open(this,1)"><span class="label label-primary" title="转任务">转任务</span></a> ';
- // btn+= '<a url="'+ts_send_url+'" href="javascript:;" data-title="转单" onclick="layer_open(this,1)"><span class="label label-primary" title="转单">转单</span></a> ';
- // }
- //
- // }
- // btn+= '<a href="'+detail_url+'" ><span class="label label-primary" title="详情">详情</span></a> ';
- btn+= '<a url="'+detail_url+'" href="javascript:;" data-title="详情" onclick="layer_open(this,1)"><span class="label label-primary" title="详情">详情</span></a> ';
- 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> ';
- return btn;
- }},
- ],
- rowNum:10,
- rowList:[10,20,30,50,100],
- pager: '#pager',
- sortname: 'id',
- viewrecords: true,
- autowidth:true,
- mtype: 'post',
- height: 'auto',
- emptyrecords: "暂无数据",
- sortorder: "desc",
- caption:"隐患预警",
- loadComplete: function (xhr) {
- if(xhr.code==0){
- layer.msg(xhr.msg);
- return false;
- }
- },
- });
- }else if(orderType == 4){
- $("#table").jqGrid({
- url:"{:url('Index/ordersList')}?mode={$mode}&orderType={$orderType}",
- datatype: "json",
- colModel:[
- {label:'编号',name:'id',index:'id', width:30,sortable: false},
- {label:'申请时间',name:'create_time',index:'create_time',width:50,sortable: false},
- {label:'内容',name:'content',index:'content',width:60,sortable: false},
- {label:'所在科室/部门',name:'dep',index:'dep',width:60,sortable: false},
- {label:'来源',name:'source_type_text',index:'source_type_text',width:60,sortable: false},
- {label:'联系方式',name:'mobile',index:'mobile',width:60,sortable: false},
- {label:'状态',name:'order_mode_text',index:'order_mode_text',width:60,sortable: false,formatter:function (a, b, c) {
- if(c.bh_nums >0){
- return '<span style="color: '+c.order_mode_color+'">'+a+"(存在驳回)"+'</span>'
- }else{
- return '<span style="color: '+c.order_mode_color+'">'+a+'</span>'
- }
- }},
- {label:'操作',width:50,sortable: false,formatter: function (a, b, c) {
- var detail_url = "{:url('Index/ordersDetail2',[],'')}/id/"+c.id;
- var del_url = "{:url('Orders/del',[],'')}/id/"+c.id;
- var reject_url = "{:url('Orders/rejectTodoList',[],'')}/orderId/"+c.id;
- var btn = '<a url="'+detail_url+'" href="javascript:;" onclick="layer_open(this,2)"><span class="label label-primary" title="详情">详情</span></a> ';
- // var btn = '<a href="'+detail_url+'" ><span class="label label-primary" onclick="layer_open(this,2)" title="详情">详情</span></a> ';
- if(c.order_mode == 4 && c.bh_nums >0){
- btn += '<a url="'+reject_url+'" href="javascript:;" onclick="layer_open(this,2)" ><span class="label label-success" data-title="驳回工单">驳回工单</span></a> ';
- }
- if(c.order_mode == 5 ||c.order_mode == 6){
- 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>';
- }
- return btn;
- }},
- ],
- rowNum:10,
- rowList:[10,20,30,50,100],
- pager: '#pager',
- sortname: 'id',
- viewrecords: true,
- autowidth:true,
- mtype: 'post',
- height: 'auto',
- emptyrecords: "暂无数据",
- sortorder: "desc",
- caption:"{$m_name}订单列表",
- loadComplete: function (xhr) {
- if(xhr.code==0){
- layer.msg(xhr.msg);
- return false;
- }
- },
- });
- }
- });
- </script>
- {/block}
|