projectDepartTablePartChild.jsp 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. <t:datagrid name="projectDepartList" checkbox="false" pagination="false" fitColumns="true" title="" actionUrl="dialogDealController.do?projectDepartDatagridPartChild" idField="id" fit="true" queryMode="group" onLoadSuccess="initCheck">
  12. <t:dgCol title="主键" field="id" hidden="true" queryMode="single" width="120"></t:dgCol>
  13. <t:dgCol title="项目名称" query="true" field="departName" queryMode="single" width="250"></t:dgCol>
  14. <t:dgCol title="项目类型" query="false" field="orgType" dictionary="org_type" queryMode="single" width="50"></t:dgCol>
  15. </t:datagrid>
  16. <script>
  17. $(function() {
  18. var datagrid = $("#projectDepartListtb");
  19. $("#searchColums").attr("style","margin:10px 0 5px 0;");
  20. datagrid.find("div[name='searchColums']").next("div").children("span:first").next("span").attr("style","float:right;margin-bottom:4px;");
  21. });
  22. </script>
  23. </body>
  24. </html>
  25. <script type="text/javascript">
  26. //默认选中
  27. function initCheck(data){
  28. var ids = "${ids}";
  29. var idArr = ids.split(",");
  30. for(var i=0;i<idArr.length;i++){
  31. if(idArr[i]!=""){
  32. $("#projectDepartList").datagrid("selectRecord",idArr[i]);
  33. }
  34. }
  35. }
  36. //编写自定义JS代码获得输入框中的值等父级页面调用取值
  37. function getReason(){
  38. var strPId="";
  39. var strDepartName="";
  40. var selectRows = $("#projectDepartList").datagrid('getSelections');
  41. for(var i=0;i<selectRows.length;i++){
  42. for(var key in selectRows[i]){
  43. //console.log(key+"======="+selectRows[i][key]);
  44. if(key=="id"){
  45. if(strPId.length>0){
  46. strPId+=","+selectRows[i][key];
  47. }else{
  48. strPId=selectRows[i][key];
  49. }
  50. }
  51. if(key=="departName"){
  52. if(strDepartName.length>0){
  53. strDepartName+=","+selectRows[i][key];
  54. }else{
  55. strDepartName=selectRows[i][key];
  56. }
  57. }
  58. }
  59. }
  60. //var strData='[{"strShiftid":"'+strShiftid+'","strShiftName":"'+strShiftName+'","strShiftType":"'+strShiftType+'"}]';
  61. var strData='[{"strPId":"'+strPId+'","strDepartName":"'+strDepartName+'"}]';
  62. return strData;
  63. }
  64. </script>