detail.html 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. {extend name="common/common2" /}
  2. {block name="main"}
  3. <div class="ibox">
  4. <div class="ibox-content">
  5. <div class="row">
  6. <div class="col-xs-3">
  7. <a class="toback" href="{:url('index')}">
  8. 返回上一页
  9. </a>
  10. </div>
  11. <div class="col-xs-9" style="text-align: right;">
  12. <form class="form-inline" id="form-search" action="{:url('detail')}?id={$id}">
  13. <div class="input-group">
  14. <input type="text" name="title" class="form-control" placeholder="输入名称/编号">
  15. </div>
  16. <div class="input-group">
  17. <select name="status" class="form-control">
  18. <option value="">选择状态</option>
  19. <option value="0">盘亏</option>
  20. <option value="1">已盘</option>
  21. <option value="2">盘盈</option>
  22. </select>
  23. </div>
  24. <div class="input-group">
  25. <span class="input-group-btn">
  26. <button class="btn-sm btn-primary" type="button" id ="search-btn" ><i class="fa fa-search"></i></button>
  27. </span>
  28. <span class="input-group-btn">
  29. <button class="btn-sm btn-primary " type="button" id="search-clear"><i class="fa fa-undo"></i></button>
  30. </span>
  31. </div>
  32. </form>
  33. </div>
  34. </div>
  35. </div>
  36. <div class="ibox-content">
  37. <div class="row">
  38. <div class="col-xs-12" style="margin-bottom: 8px" id="checkNums">
  39. 盘点人: {$info.userName} &nbsp;&nbsp;&nbsp;&nbsp;
  40. 应盘数量: {$info.totalNums} &nbsp;&nbsp;&nbsp;&nbsp;
  41. 实盘数量: {$info.totalCheckNums} &nbsp;&nbsp;&nbsp;&nbsp;
  42. 数量差异: {$info.totalDiffNums}
  43. </div>
  44. </div>
  45. <div class="jqGrid_wrapper">
  46. <table id="table" style="border-collapse: collapse"></table>
  47. <div id="pager"></div>
  48. </div>
  49. </div>
  50. </div>
  51. {/block}
  52. {block name="script"}
  53. <script>
  54. $(function () {
  55. $(window).bind("resize",function(){
  56. var width=$(".jqGrid_wrapper").width();
  57. $("#table").setGridWidth(width);
  58. });
  59. $.jgrid.defaults.styleUI="Bootstrap";
  60. $("#table").jqGrid({
  61. url:"{:url('detail')}?id={$id}",
  62. datatype: "json",
  63. colModel:[
  64. {label:'资产编号',name:'sn',index:'sn', width:70,sortable: false},
  65. {label:'资产名称',name:'title',index:'title', width:70,sortable: false},
  66. {label:'使用部门',name:'depName',index:'depName', width:70,sortable: false},
  67. {label:'使用人员',name:'userName',index:'userName', width:70,sortable: false},
  68. {label:'原值',name:'price',index:'price', width:70,sortable: false},
  69. {label:'状态',name:'status',index:'status',width:40,editable: false,sortable: false,formatter:function (a,b,c){
  70. if(a == 0){
  71. return '<span >盘亏</span>';
  72. } else if(a == 1){
  73. return '<span >已盘</span>';
  74. } else if(a == 2){
  75. return '<span >盘盈</span>';
  76. }
  77. }},
  78. {label:'应盘数量',name:'nums',index:'nums', width:70,sortable: false},
  79. {label:'实盘数量',name:'check_nums',index:'check_nums', width:70,sortable: false},
  80. {label:'数量差异',name:'diffNums',index:'diffNums', width:70,sortable: false},
  81. {label:'盘点时间',name:'checkTime',index:'checkTime', width:70,sortable: false},
  82. {label:'盘点说明',name:'remark',index:'remark', width:70,sortable: false},
  83. {if $info['status'] == 0}
  84. {label:'操作',width:100,sortable: false,formatter: function (a, b, c) {
  85. var finish_url = "{:url('finishItems',[],'')}/id/"+c.id;
  86. var del_url = "{:url('delItems',[],'')}/id/"+c.id;
  87. var btn = '';
  88. if(c.status == 0){
  89. btn += '<a href="'+finish_url+'" class="confirm ajax-get" data-confirm="确定要手动盘点吗?" data-table="1"><span class="label label-primary" title="手动盘点">手动盘点</span></a>&nbsp;';
  90. }
  91. btn += '<a href="'+del_url+'" class="confirm ajax-get" data-confirm="确定要删除吗?" data-table="1"><span class="label label-warning" title="删除">删除</span></a>';
  92. return btn;
  93. }},
  94. {/if}
  95. ],
  96. rowNum:10,
  97. rowList:[10,20,30,50,100],
  98. pager: '#pager',
  99. sortname: 'sort',
  100. viewrecords: true,
  101. autowidth:true,
  102. mtype: 'post',
  103. height: 'auto',
  104. emptyrecords: "暂无数据",
  105. sortorder: "asc",
  106. caption:"明细",
  107. loadComplete: function (xhr) {
  108. if(xhr.code==0){
  109. layer.msg(xhr.msg);
  110. return false;
  111. }
  112. var info = xhr.info;
  113. $('#checkNums').html('盘点人:'+info.userName+'&nbsp;&nbsp;&nbsp;&nbsp;应盘数量:'+info.totalNums+'&nbsp;&nbsp;&nbsp;&nbsp; 实盘数量:'+info.totalCheckNums+'&nbsp;&nbsp;&nbsp;&nbsp;数量差异:'+info.totalDiffNums);
  114. },
  115. });
  116. });
  117. </script>
  118. {/block}