123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
- {extend name="common/common2" /}
- {block name="main"}
- <div class="ibox">
- <div class="ibox-content">
- <div class="row">
- <div class="col-xs-3">
- <a href="{:url('add')}" class="btn btn-sm btn-primary">创建维修单</a>
- </div>
- <div class="col-xs-9" 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="title" placeholder="姓名">
- </div>
- <div class="input-group">
- <input class="form-control" id="start" readonly placeholder="开始时间" name="start" >
- </div>
- <div class="input-group">
- <input class="form-control" id="end" readonly placeholder="结束时间" name="end" >
- </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 src="/static/layDate-v5.0.9/laydate.js"></script>
- <script>
- $(function () {
- laydate.render({
- elem: '#start',
- trigger: 'click' ,
- theme: '#6eb7ff'
- });
- laydate.render({
- elem: '#end',
- trigger: 'click' ,
- theme: '#6eb7ff'
- });
- $(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:'sn',index:'sn', width:70,sortable: false},
- {label:'经办人',name:'user_name',index:'user_name', width:70,sortable: false},
- {label:'经办部门',name:'agent_dep_name',index:'agent_dep_name', width:70,sortable: false},
- {label:'送修单位',name:'company',index:'company', width:70,sortable: false},
- {label:'维修费用',name:'money',index:'money', width:70,sortable: false},
- {label:'单位联系人',name:'name',index:'name', width:70,sortable: false},
- {label:'单位联系方式',name:'phone',index:'phone', width:70,sortable: false},
- {label:'状态',name:'finish',index:'finish',width:40,editable: false,sortable: false,formatter:function (a,b,c){
- if(a == 0){
- return '<span >维修中</span>';
- } else if(a == 1){
- return '<span >已完成</span>';
- }
- }},
- {label:'登记时间',name:'create_time',index:'create_time', width:70,sortable: false},
- {label:'操作',width:100,sortable: false,formatter: function (a, b, c) {
- var report_url = "{:url('report',[],'')}/id/"+c.id;
- var detail_url = "{:url('detail',[],'')}/id/"+c.id;
- var finish_url = "{:url('finish',[],'')}/id/"+c.id;
- var btn = '<a url="'+report_url+'" href="javascript:;" data-title="报表" onclick="layer_open(this,1)" data-width="800px" data-height="600px" ><span class="label label-primary" title="报表">报表</span></a> ';
- btn += '<a href="'+detail_url+'" ><span class="label label-primary" title="详情">详情</span></a> ';
- if(c.finish == 0){
- btn += '<a href="'+finish_url+'" class="confirm ajax-get" data-confirm="确定要标记为维修完成状态吗?" data-table="1"><span class="label label-success" title="维修完成">维修完成</span></a>';
- }
- return btn;
- }},
- ],
- rowNum:10,
- rowList:[10,20,30,50,100],
- pager: '#pager',
- sortname: 'sort',
- viewrecords: true,
- autowidth:true,
- mtype: 'post',
- height: 'auto',
- emptyrecords: "暂无数据",
- sortorder: "asc",
- caption:"维修记录列表",
- loadComplete: function (xhr) {
- if(xhr.code==0){
- layer.msg(xhr.msg);
- return false;
- }
- },
- });
- });
- </script>
- {/block}
|