123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241 |
- {extend name="common/common2" /}
- {block name="main"}
- <style>
- .av{
- background-color: #23c6c8 !important;
- border-color: #23c6c8 !important;
- }
- .btn-sm{
- color: #ffffff !important;
- }
- .btn-a{
- background-color: #abbac3;
- }
- .pr{
- background-color: #23c6c8 !important;
- border-color: #23c6c8 !important;
- }
- </style>
- <div class="ibox">
- <div class="ibox-content">
- <ul class="nav nav-tabs" id="myTab">
- <li class="active" onclick="load_index(this,0)">
- <a href="javascript:;">
- 预定餐
- </a>
- </li>
- <li onclick="load_index(this,1)">
- <a href="javascript:;">
- 当日餐
- </a>
- </li>
- <li onclick="load_index(this,2)">
- <a href="javascript:;">
- 特殊套餐
- </a>
- </li>
- </ul>
- </div>
- <div class="ibox-content">
- <div class="row">
- <div class="col-xs-12" style="text-align: right;">
- <form class="form-inline" id="form-search" action="{:url('index')}">
- <input type="hidden" name="is_spot" id="is_spot" value="0">
- <input type="hidden" name="is_ok" id="is_ok" value="0">
- <div class="input-group">
- <input type="text" class="form-control" name="title" placeholder="下单人/单号">
- </div>
- <div class="input-group">
- {:widget_view('common/laydate',['name'=>'start','placeholder' => '下单日期','type' => 'date','val'=>$start])}
- </div>
- <div class="input-group">
- <select name="type" class="form-control">
- <option value="">请选择分类</option>
- {foreach $typeList as $k=>$v}
- <option value="{$v.id}">{$v.name}</option>
- {/foreach}
- </select>
- </div>
- <div class="input-group">
- <span class="input-group-btn">
- <button class="btn-sm btn-primary" type="button" id ="search-btn" ><i class="fa fa-search"></i></button>
- </span>
- <span class="input-group-btn">
- <button class="btn-sm btn-warning" type="button" id="search-clear"><i class="fa fa-undo"></i></button>
- </span>
- <span class="input-group-btn">
- <button class="btn-sm btn-primary" data-url="{:url('export')}" type="button" id="down">导出</button>
- </span>
- <span class="input-group-btn">
- <button class="btn-sm btn-warning" data-url="{:url('export')}" type="button" id="down1">发饭表导出</button>
- </span>
-
- <span class="input-group-btn">
- <button class="btn-sm btn-danger" data-url="{:url('print_all')}" type="button" id="down2">发饭表打印</button>
- </span>
- </div>
- </form>
- </div>
- </div>
- </div>
- <div class="ibox-content">
- <div class="row">
- <div class="col-xs-4" style="text-align: left;">
- <span style="color:#ccc;" id="timermsglabel">30秒后自动刷新本页面</span>
- </div>
- <div class="col-xs-8" style="text-align: right;">
- <a href="javascript:;" onclick="load_index1(this,0)" style="padding: 8px 10px;color: white !important;" class="btn-sm btn-a av">
- 待处理</a>
- <a href="javascript:;" onclick="load_index1(this,1)" style="padding: 8px 10px;color: white !important;" class="btn-sm btn-a">
- 已完成</a>
- <a href="javascript:;" onclick="load_index1(this,2)" style="padding: 8px 10px;color: white !important;" class="btn-sm btn-a">
- 已取消</a>
- <a href="javascript:;" onclick="print()" style="padding: 8px 10px;color: white !important;" class="btn-sm btn-a pr">
- 打印</a>
- </div>
- </div>
- </div>
- <div class="ibox-content" id="printer">
- <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/browser.js"></script>
- <script src="/static/jquery.jqprint-0.3.js"></script>
- <script>
- $ppp=30;
- function print(){
- $ppp = 3000;
- $("#printer").jqprint();
- }
- $(document).ready(function() {
- var interval = setInterval(function () {
- if($ppp<1)
- {
- // clearInterval(interval);
- $ppp = 30;
- $("#search-btn").click();
- }else{
- $("#timermsglabel").html($ppp+"秒后自动刷新页面");
- $ppp--;
- }
- },1000);
- });
- function load_index(self,key){
- $(self).addClass('active').siblings().removeClass('active')
- $("#is_spot").val(key);
- $("#search-btn").click();
- }
- function load_index1(self,key){
- $(self).addClass('av').siblings().removeClass('av')
- $("#is_ok").val(key);
- $("#search-btn").click();
- }
- $('#down').click(function () {
- var url = "{:url('export')}";
- var param = $('#form-search').serialize();
- window.location.href = url+'?ex_type=1&'+param;
- })
- $('#down1').click(function () {
- var url = "{:url('export')}";
- var param = $('#form-search').serialize();
- window.location.href = url+'?ex_type=2&'+param;
- })
- //print_all
- $('#down2').click(function () {
- var url = "{:url('print_all')}";
- var param = $('#form-search').serialize();
- // var tempwindow=window.open('_blank'); // 先打开页面
- // tempwindow.location=url+'?'+param;// 后更改页面地址
- window.location.href = url+'?'+param;
- })
- $(function () {
- $(window).bind("resize",function(){
- var width=$(".jqGrid_wrapper").width();
- $("#table").setGridWidth(width);
- });
- $.jgrid.defaults.styleUI="Bootstrap";
- $("#table").jqGrid({
- url:"{:url('index')}",
- datatype: "json",
- colModel:[
- // {label:'编号',name:'id',index:'id',width:100,editable: false,sortable: false,formatter:function (a,b,c){
- // return '<span style="background-color: black;color: white" class="label">#'+a+'</span>'
- // }},
- {label:'订单号',name:'sn',index:'sn',width:150,sortable: false},
- {label:'总价',name:'price',index:'price',width:100,sortable: false},
- {label:'下单人',name:'name',index:'name',width:200,editable: false,sortable: false,formatter:function (a,b,c){
- return ''+c.name+'<br />'+c.mobile+'<br />'+c.address+''
- }},
- {label:'下单时间',name:'pay_time',index:'pay_time',width:150,sortable: false},
- // {label:'类型',name:'tName',index:'tName',width:120,editable: false,sortable: false,formatter:function (a,b,c){
- // return a;
- //
- // }},
- {label:'购买物品',name:'item',index:'item',width:150,editable: false,sortable: false,formatter:function (a,b,c){
- return a;
- }},
- {label:'床号及备注',name:'remark',index:'remark',width:120,sortable: false},
- {label:'操作',width:200,sortable: false,formatter: function (a, b, c) {
- var print = "{:url('print',[],'')}/id/"+c.id;
- var url1 = "{:url('option',[],'')}/fv/1/id/"+c.id;
- var url2 = "{:url('option',[],'')}/fv/2/id/"+c.id;
- var btn = '<a url="'+print+'" href="javascript:;" data-title="打印" onclick="layer_open(this,0)"><span class="label label-primary" title="打印">打印</span></a> ';
- if(c.is_ok==0 && c.cate == 0){
- btn += '<a href="'+url1+'" class="confirm ajax-get" data-confirm="确定要操作此记录吗?" data-table="1"><span class="label label-primary" title="标记为完成">完成</span></a> ';
- btn += '<a href="'+url2+'" class="confirm ajax-get" data-confirm="确定要操作此记录吗?" data-table="1"><span class="label label-primary" title="标记为取消">取消</span></a>';
- }
- if(c.cate == 1){
- var print = "{:url('refund',[],'')}/id/"+c.id;
- btn += '<a url="'+print+'" href="javascript:;" data-title="退餐" onclick="layer_open(this,0)"><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,
- autoScroll: false,
- shrinkToFit: true,
- mtype: 'post',
- height: 'auto',
- emptyrecords: "暂无数据",
- sortorder: "desc",
- caption:"订单列表",
- loadComplete: function (xhr) {
- if(xhr.code==0){
- layer.msg(xhr.msg);
- return false;
- }
- },
- });
- /*固定表头及侧边*/
- $("#table").closest(".ui-jqgrid-bdiv").css({ "overflow-x" : "auto" });
- $("#table").jqGrid('setFrozenColumns');
- });
- </script>
- {/block}
|