123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123 |
- {extend name="common/common2" /}
- {block name="main"}
- <div class="ibox">
- <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')}">
- <div class="input-group">
- <input type="text" class="form-control" name="orderSn" placeholder="订单编号">
- </div>
- <div class="input-group">
- <input type="text" class="form-control" name="name" placeholder="姓名">
- </div>
- <!--<div class="input-group">
- <select name="cate" class="form-control">
- <option value="">选择类型</option>
- <option value="1">早餐</option>
- <option value="2">午餐</option>
- <option value="3">晚餐</option>
- <option value="4">当日餐</option>
- </select>
- </div>-->
- <div class="input-group">
- <select name="status" class="form-control">
- <option value="">选择状态</option>
- <option value="1">已预订</option>
- <option value="2">已取消</option>
- </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>
- </div>
- </form>
- </div>
- </div>
- </div>
- <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>
- $(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:'order_sn',index:'order_sn', width:60,sortable: false},
- {label:'价格',name:'amount',index:'amount', width:40,sortable: false},
- /*{label:'类型',name:'cate',index:'cate', width:40,sortable: false,formatter:function (a,b,c){
- if(a == 1){
- return '早餐';
- } else if(a == 2){
- return '午餐';
- } else if(a == 3){
- return '晚餐';
- } else{
- return '当日餐';
- }
- }},*/
- // {label:'配送时间',name:'delivery_time',index:'delivery_time', width:40,sortable: false},
- {label:'姓名',name:'name',index:'name', width:40,sortable: false},
- {label:'电话',name:'phone',index:'phone', width:40,sortable: false},
- {label:'下单日期',name:'create_time',index:'create_time', width:60,sortable: false},
- {label:'状态',name:'status',index:'status',width:40,editable: false,sortable: false,formatter:function (a,b,c){
- if(a == 1){
- return '已预订';
- } else{
- return '已取消';
- }
- }},
- {label:'操作',width:80,sortable: false,formatter: function (a, b, c) {
- var editurl = "{:url('detail',[],'')}/id/"+c.id;
- var cancelurl = "{:url('cancel',[],'')}/id/"+c.id;
- var delurl = "{:url('del',[],'')}/id/"+c.id;
- var btn = '<a href="'+editurl+'"><span class="label label-primary" title="详情">详情</span></a> ';
- if(c.status == 1){
- btn += '<a href="'+cancelurl+'" class="confirm ajax-get" data-confirm="确定要取消此订单吗?" data-table="1"><span class="label label-warning" title="取消">取消</span></a> ';
- }
- btn += '<a href="'+delurl+'" 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:"{$meta_title}",
- loadComplete: function (xhr) {
- if(xhr.code==0){
- layer.msg(xhr.msg);
- return false;
- }
- },
- });
- });
- </script>
- {/block}
|