123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130 |
- {extend name="common/common2" /}
- {block name="main"}
- <div class="ibox">
- <div class="ibox-content">
- <div class="row">
- <div class="col-xs-3">
- </div>
- <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" style="width: 180px;" name="order_sn" placeholder="订单号">
- </div>
- <div class="input-group">
- <input type="text" class="form-control" style="width: 150px;" name="name" placeholder="收货人姓名">
- </div>
- <div class="input-group">
- <select name="status" class="form-control">
- <option value="">选择状态</option>
- <option value="0">未支付</option>
- <option value="1">已支付</option>
- <option value="3">已取消</option>
- <option value="4">已退款</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-primary " 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:'id',index:'id', width:30,sortable: false},
- {label:'订单号',name:'order_sn',index:'order_sn', width:80,sortable: false},
- {label:'订单金额',name:'amount',index:'amount', width:40,sortable: false},
- {label:'收货人',name:'name',index:'name', width:60,sortable: false},
- {label:'联系方式',name:'phone',index:'phone', width:60,sortable: false},
- {label:'创建时间',name:'create_time',index:'create_time', width:70,sortable: false},
- {label:'支付状态',name:'status',status:'type',width:40,editable: false,sortable: false,formatter:function (a,b,c){
- if(a == 0){
- return '<span title="未支付">未支付</span>';
- }
- if(a == 1){
- return '<span title="已支付">已支付</span>';
- }
- if(a == 2){
- return '<span title="已完成">已完成</span>';
- }
- if(a == 3){
- return '<span title="已取消">已取消</span>';
- }
- if(a == 4){
- return '<span title="已退款">已退款</span>';
- }
- }},
- {label:'是否送货',name:'delivery_type',status:'delivery_type',width:30,editable: false,sortable: false,formatter:function (a,b,c){
- if(a == 0){
- return '<span title="否">否</span>';
- }
- if(a == 1){
- return '<span title="是">是</span>';
- }
- }},
- {label:'送货时间',name:'delivery_date',status:'delivery_date',width:70,editable: false,sortable: false,formatter:function (a,b,c){
- if(a == null){
- return '<span title="无">无</span>';
- }else {
- return '<span title="'+a+'">'+a+'</span>';
- }
- }},
- {label:'操作',width:40,sortable: false,formatter: function (a, b, c) {
- var detailsurl = "{:url('details',[],'')}/id/"+c.id;
- var btn = '<a href="'+detailsurl+'"><span class="label label-info" 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}
|