projectDepartTableAll.jsp 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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>所有项目(部门)名称列表</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="userWageController.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" queryMode="single" dictionary="ableStatus" width="50"></t:dgCol> --%>
  18. </t:datagrid>
  19. </body>
  20. </html>
  21. <script type="text/javascript">
  22. //默认选中
  23. function initCheck(data){
  24. var ids = "${ids}";
  25. var idArr = ids.split(",");
  26. for(var i=0;i<idArr.length;i++){
  27. if(idArr[i]!=""){
  28. $("#projectDepartList").datagrid("selectRecord",idArr[i]);
  29. }
  30. }
  31. }
  32. //编写自定义JS代码获得输入框中的值等父级页面调用取值
  33. function getReason(){
  34. var strPId="";
  35. var strDepartName="";
  36. var selectRows = $("#projectDepartList").datagrid('getSelections');
  37. for(var i=0;i<selectRows.length;i++){
  38. for(var key in selectRows[i]){
  39. //console.log(key+"======="+selectRows[i][key]);
  40. if(key=="id"){
  41. if(strPId.length>0){
  42. strPId+=","+selectRows[i][key];
  43. }else{
  44. strPId=selectRows[i][key];
  45. }
  46. }
  47. if(key=="departName"){
  48. if(strDepartName.length>0){
  49. strDepartName+=","+selectRows[i][key];
  50. }else{
  51. strDepartName=selectRows[i][key];
  52. }
  53. }
  54. }
  55. }
  56. //var strData='[{"strShiftid":"'+strShiftid+'","strShiftName":"'+strShiftName+'","strShiftType":"'+strShiftType+'"}]';
  57. var strData='[{"strPId":"'+strPId+'","strDepartName":"'+strDepartName+'"}]';
  58. return strData;
  59. }
  60. </script>