toTBGoods.jsp 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  2. <%@include file="/context/mytags.jsp"%>
  3. <!DOCTYPE html >
  4. <html>
  5. <head>
  6. <title>根据当前登录用户id查询项目名称列表Part</title>
  7. <t:base type="jquery,easyui,tools"></t:base>
  8. </head>
  9. <body style="overflow-y: hidden" scroll="no">
  10. <input id="ids" type="hidden" value=${ids} >
  11. <input id="row" type="hidden" value=${row} >
  12. <t:datagrid name="goodsInfoList" checkbox="false" pagination="false" fitColumns="true" title="" actionUrl="tBMaterialController.do?goodsdatagrid" idField="id" fit="true" queryMode="group" onLoadSuccess="initCheck">
  13. <t:dgCol title="主键" field="id" hidden="true" queryMode="single" width="120"></t:dgCol>
  14. <t:dgCol title="货品分类" query="false" field="belongCategory" queryMode="single" width="50"></t:dgCol>
  15. <t:dgCol title="货品名称" query="false" field="goodsName" queryMode="single" width="50"></t:dgCol>
  16. <t:dgCol title="计量单位" query="false" field="salesUnit" queryMode="single" width="50"></t:dgCol>
  17. <t:dgCol title="规格型号" query="false" field="specification" queryMode="single" width="50"></t:dgCol>
  18. </t:datagrid>
  19. <script>
  20. $(function() {
  21. datagrid.prepend($("#pinjie1 div[name='pinjie2']").html());
  22. $("#pinjie1").html('');
  23. datagrid.children(".datagrid-toolbar").children("span:first").after($("#pinjiechaxun1 div[name='pinjiechaxun2']").html());
  24. $("#pinjiechaxun1").html('');
  25. });
  26. </script>
  27. </body>
  28. </html>
  29. <div>
  30. <div id="pinjie1">
  31. <div name="pinjie2" style="padding:3px; height: auto;height:70px" class="datagrid-toolbar">
  32. <table style="height:40px;padding:0px" cellpadding="0" cellspacing="1" >
  33. <tbody>
  34. <tr>
  35. <td align="right">
  36. <label class="Validform_label">
  37. 货品分类:
  38. </label>
  39. </td>
  40. <td class="value">
  41. <t:dictSelect id="salesUnit" field="salesUnit" type="list" extendJson="{class:'form-control',style:'width:150px'}"
  42. typeGroupCode="goodsCategory" hasLabel="false" title="货品分类" datatype="*"></t:dictSelect>
  43. </td>
  44. <td align="right">
  45. <label class="goodsName">
  46. 货品名称:
  47. </label>
  48. </td>
  49. <td class="value">
  50. <input id="goodsName" name="goodsName" type="text" style="width: 157px; " class="inputxt" placeholder="">
  51. </td>
  52. <td align="right" style="width: 74px;">
  53. <label class="Validform_label">
  54. 规格型号:
  55. </label>
  56. </td>
  57. <td class="value">
  58. <input id="specification" name="specification" type="text" style="width: 157px; " class="inputxt" placeholder="">
  59. </td>
  60. </tr>
  61. </tbody>
  62. </table>
  63. <div style="float: right;height:20px;">
  64. <span>
  65. <a href="#" class="easyui-linkbutton" plain="true" icon="icon-search" onclick="goodsInfoListsearch()">查询</a>
  66. </span>
  67. <span>
  68. <a href="#" class="easyui-linkbutton" plain="true" icon="icon-reload" onclick="searchReset('goodsInfoList')">重置</a>
  69. </span>
  70. </div>
  71. </div>
  72. </div>
  73. </div>
  74. <script type="text/javascript">
  75. //默认选中
  76. function initCheck(data){
  77. var ids = "${ids}";
  78. var idArr = ids.split(",");
  79. for(var i=0;i<idArr.length;i++){
  80. if(idArr[i]!=""){
  81. $("#goodsInfoList").datagrid("selectRecord",idArr[i]);
  82. }
  83. }
  84. }
  85. //编写自定义JS代码获得输入框中的值等父级页面调用取值
  86. function getReason(){
  87. var strId="";
  88. var strBelongCategory="";
  89. var strGoodsName="";
  90. var strSalesUnit="";
  91. var strSpecification="";
  92. var selectRows = $("#goodsInfoList").datagrid('getSelections');
  93. for(var i=0;i<selectRows.length;i++){
  94. for(var key in selectRows[i]){
  95. if(key=="id"){
  96. if(strId.length>0){
  97. strId+=","+selectRows[i][key];
  98. }else{
  99. strId=selectRows[i][key];
  100. }
  101. }
  102. if(key=="belongCategory"){
  103. if(strBelongCategory.length>0){
  104. strBelongCategory+=","+selectRows[i][key];
  105. }else{
  106. strBelongCategory=selectRows[i][key];
  107. }
  108. }
  109. if(key=="goodsName"){
  110. if(strGoodsName.length>0){
  111. strGoodsName+=","+selectRows[i][key];
  112. }else{
  113. strGoodsName=selectRows[i][key];
  114. }
  115. }
  116. if(key=="salesUnit"){
  117. if(strSalesUnit.length>0){
  118. strSalesUnit+=","+selectRows[i][key];
  119. }else{
  120. strSalesUnit=selectRows[i][key];
  121. }
  122. }
  123. if(key=="specification"){
  124. if(strSpecification.length>0){
  125. strSpecification+=","+selectRows[i][key];
  126. }else{
  127. strSpecification=selectRows[i][key];
  128. }
  129. }
  130. }
  131. }
  132. //var strData='[{"strShiftid":"'+strShiftid+'","strShiftName":"'+strShiftName+'","strShiftType":"'+strShiftType+'"}]';
  133. var strData='[{"strId":"'+strId+'","strBelongCategory":"'+strBelongCategory+'","strGoodsName":"'+strGoodsName+'","strSalesUnit":"'+strSalesUnit+'","strSpecification":"'+strSpecification+'","row":"${row}"}]';
  134. return strData;
  135. }
  136. function getSelectedRow(){
  137. var selectRows = $("#goodsInfoList").datagrid('getSelections');
  138. return selectRows;
  139. }
  140. </script>