123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125 |
- {extend name="common/common2" /}
- {block name="main"}
- <div class="ibox">
- <div class="ibox-content">
- <div class="row">
- <div class="col-xs-3">
- <a class="toback" href="{:url('index')}">
- 返回上一页
- </a>
- </div>
- <div class="col-xs-9" style="text-align: right;">
- <form class="form-inline" id="form-search" action="{:url('detail')}?id={$id}">
- <div class="input-group">
- <input type="text" name="title" class="form-control" 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="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-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="row">
- <div class="col-xs-12" style="margin-bottom: 8px" id="checkNums">
- 盘点人: {$info.userName}
- 应盘数量: {$info.totalNums}
- 实盘数量: {$info.totalCheckNums}
- 数量差异: {$info.totalDiffNums}
- </div>
- </div>
- <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('detail')}?id={$id}",
- datatype: "json",
- colModel:[
- {label:'资产编号',name:'sn',index:'sn', width:70,sortable: false},
- {label:'资产名称',name:'title',index:'title', width:70,sortable: false},
- {label:'使用部门',name:'depName',index:'depName', width:70,sortable: false},
- {label:'使用人员',name:'userName',index:'userName', width:70,sortable: false},
- {label:'原值',name:'price',index:'price', width:70,sortable: false},
- {label:'状态',name:'status',index:'status',width:40,editable: false,sortable: false,formatter:function (a,b,c){
- if(a == 0){
- return '<span >盘亏</span>';
- } else if(a == 1){
- return '<span >已盘</span>';
- } else if(a == 2){
- return '<span >盘盈</span>';
- }
- }},
- {label:'应盘数量',name:'nums',index:'nums', width:70,sortable: false},
- {label:'实盘数量',name:'check_nums',index:'check_nums', width:70,sortable: false},
- {label:'数量差异',name:'diffNums',index:'diffNums', width:70,sortable: false},
- {label:'盘点时间',name:'checkTime',index:'checkTime', width:70,sortable: false},
- {label:'盘点说明',name:'remark',index:'remark', width:70,sortable: false},
- {if $info['status'] == 0}
- {label:'操作',width:100,sortable: false,formatter: function (a, b, c) {
- var finish_url = "{:url('finishItems',[],'')}/id/"+c.id;
- var del_url = "{:url('delItems',[],'')}/id/"+c.id;
- var btn = '';
- if(c.status == 0){
- btn += '<a href="'+finish_url+'" class="confirm ajax-get" data-confirm="确定要手动盘点吗?" data-table="1"><span class="label label-primary" title="手动盘点">手动盘点</span></a> ';
- }
- btn += '<a href="'+del_url+'" class="confirm ajax-get" data-confirm="确定要删除吗?" data-table="1"><span class="label label-warning" title="删除">删除</span></a>';
- return btn;
- }},
- {/if}
- ],
- 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;
- }
- var info = xhr.info;
- $('#checkNums').html('盘点人:'+info.userName+' 应盘数量:'+info.totalNums+' 实盘数量:'+info.totalCheckNums+' 数量差异:'+info.totalDiffNums);
- },
- });
- });
- </script>
- {/block}
|