projectDepartTableAll.jsp 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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>所有项目名称列表All</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?projectDepartDatagridAll" 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="编码" field="orgCode" queryMode="single" dictionary="subsiType" width="50"></t:dgCol>--%>
  14. <t:dgCol title="项目名称" query="true" field="departName" queryMode="single" width="250"></t:dgCol>
  15. <t:dgCol title="项目类型" query="false" field="orgType" dictionary="org_type" queryMode="single" width="50"></t:dgCol>
  16. <%-- <t:dgCol title="是否兼职组织" query="false" field="ifpluralism" dictionary="shifou_01" queryMode="single" width="50"></t:dgCol>
  17. <t:dgCol title="状态" query="false" field="status" style="text-align: center;" queryMode="single" dictionary="ableStatus" width="50"></t:dgCol>--%>
  18. </t:datagrid>
  19. <script>
  20. $(function() {
  21. var datagrid = $("#projectDepartListtb");
  22. datagrid.parent("div").parent("div").attr("style","margin-bottom:10px;");
  23. $("#searchColums").attr("style","margin:12px 0 9px 0;");
  24. datagrid.find("div[name='searchColums']").next("div").children("span:first").next("span").attr("style","float:right;margin-bottom:4px;");
  25. });
  26. </script>
  27. </body>
  28. </html>
  29. <script type="text/javascript">
  30. //默认选中
  31. function initCheck(data){
  32. var ids = "${ids}";
  33. var idArr = ids.split(",");
  34. for(var i=0;i<idArr.length;i++){
  35. if(idArr[i]!=""){
  36. $("#projectDepartList").datagrid("selectRecord",idArr[i]);
  37. }
  38. }
  39. }
  40. //编写自定义JS代码获得输入框中的值等父级页面调用取值
  41. function getReason(){
  42. var strPId="";
  43. var strDepartName="";
  44. var selectRows = $("#projectDepartList").datagrid('getSelections');
  45. for(var i=0;i<selectRows.length;i++){
  46. for(var key in selectRows[i]){
  47. //console.log(key+"======="+selectRows[i][key]);
  48. if(key=="id"){
  49. if(strPId.length>0){
  50. strPId+=","+selectRows[i][key];
  51. }else{
  52. strPId=selectRows[i][key];
  53. }
  54. }
  55. if(key=="departName"){
  56. if(strDepartName.length>0){
  57. strDepartName+=","+selectRows[i][key];
  58. }else{
  59. strDepartName=selectRows[i][key];
  60. }
  61. }
  62. }
  63. }
  64. //var strData='[{"strShiftid":"'+strShiftid+'","strShiftName":"'+strShiftName+'","strShiftType":"'+strShiftType+'"}]';
  65. var strData='[{"strPId":"'+strPId+'","strDepartName":"'+strDepartName+'"}]';
  66. return strData;
  67. }
  68. function getSelectedRow(){
  69. var selectRows = $("#projectDepartList").datagrid('getSelections');
  70. return selectRows;
  71. }
  72. </script>