rock_goods_pandian.php 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <?php if(!defined('HOST'))die('not access');?>
  2. <script >
  3. $(document).ready(function(){
  4. var lbefe = false;
  5. var at = $('#optionview_{rand}').bootstree({
  6. url:js.getajaxurl('gettreedata','option','system',{'num':'goodstype'}),
  7. columns:[{
  8. text:'物品分类',dataIndex:'name',align:'left',xtype:'treecolumn',width:'79%'
  9. },{
  10. text:'ID',dataIndex:'id',width:'20%'
  11. }],
  12. load:function(d){
  13. c.loadfile('0','所有物品');
  14. },
  15. itemdblclick:function(d){
  16. c.loadfile(d.id,d.name);
  17. }
  18. });
  19. var columns = [{
  20. text:'编号',dataIndex:'num'
  21. },{
  22. text:'名称',dataIndex:'name',align:'left'
  23. },{
  24. text:'分类',dataIndex:'typeid',align:'left'
  25. },{
  26. text:'单价',dataIndex:'price',sortable:true
  27. },{
  28. text:'单位',dataIndex:'unit'
  29. },{
  30. text:'规格',dataIndex:'guige'
  31. },{
  32. text:'型号',dataIndex:'xinghao'
  33. },{
  34. text:'ID',dataIndex:'id',sortable:true
  35. },{
  36. text:'总库存',dataIndex:'stock',sortable:true
  37. }];
  38. var a = $('#view_{rand}').bootstable({
  39. tablename:'goods',celleditor:true,fanye:true,modenum:'goods',autoLoad:false,
  40. url:publicstore('{mode}','{dir}'),params:{'atype':'pan'},storebeforeaction:'beforeshow',storeafteraction:'aftershow',
  41. columns:columns,
  42. loadbefore:function(d){
  43. if(!lbefe && d.depotarr){
  44. for(var i=0;i<d.depotarr.length;i++)columns.push({text:d.depotarr[i].namea,dataIndex:'stockdepotid'+d.depotarr[i].id+''});
  45. a.setColumns(columns);
  46. }
  47. lbefe = true;
  48. },
  49. itemdblclick:function(d){
  50. openxiangs('【'+d.name+'】详情','goods',d.id);
  51. }
  52. });
  53. var c = {
  54. search:function(){
  55. var s=get('key_{rand}').value;
  56. a.setparams({key:s,dt:get('dt1_{rand}').value},true);
  57. },
  58. daochu:function(o1){
  59. new publicdaochuobj({
  60. 'objtable':a,
  61. 'modename':'物品盘点',
  62. 'btnobj':o1
  63. });
  64. },
  65. loadfile:function(spd,nsd){
  66. $('#megss{rand}').html(nsd);
  67. a.setparams({'typeid':spd}, true);
  68. },
  69. genmu:function(){
  70. this.loadfile('0','所有物品');
  71. },
  72. del:function(){
  73. a.del({checked:true,url:js.getajaxurl('delxiang','{mode}','{dir}')});
  74. }
  75. };
  76. js.initbtn(c);
  77. $('#optionview_{rand}').css('height',''+(viewheight-45)+'px');
  78. });
  79. </script>
  80. <table width="100%">
  81. <tr valign="top">
  82. <td width="220">
  83. <div style="border:1px #cccccc solid;width:220px">
  84. <div id="optionview_{rand}" style="height:400px;overflow:auto;"></div>
  85. </div>
  86. </td>
  87. <td width="10" nowrap>&nbsp;</td>
  88. <td>
  89. <div>
  90. <table width="100%"><tr>
  91. <td align="left" nowrap>
  92. <button class="btn btn-default" click="genmu" type="button">所有物品</button>&nbsp;
  93. </td>
  94. <td nowrap style="padding-left:10px">
  95. <input placeholder="日期" style="width:120px" onclick="js.changedate(this)" readonly class="form-control datesss" id="dt1_{rand}" >
  96. </td>
  97. <td style="padding-left:10px">
  98. <input class="form-control" style="width:200px" id="key_{rand}" placeholder="物品名/型号/规格">
  99. </td>
  100. <td style="padding-left:10px">
  101. <button class="btn btn-default" click="search" type="button">搜索</button>
  102. </td>
  103. <td width="90%">
  104. &nbsp;&nbsp;<span id="megss{rand}"></span>
  105. </td>
  106. <td align="right" nowrap>
  107. <button class="btn btn-default" click="daochu,1" type="button">导出 <i class="icon-angle-down"></i></button>
  108. </td>
  109. </tr></table>
  110. </div>
  111. <div class="blank10"></div>
  112. <div id="view_{rand}"></div>
  113. </td>
  114. </tr>
  115. </table>
粤ICP备19079148号