SPMNP00001.xjs 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <Script type="xscript4.0"><![CDATA[/* ---------------------------------------------------------------------
  3. 수술 사용자정보조회 (SMMNP00001.xfm - JScript )
  4. - Version :
  5. 1) : Ver.1.00.01
  6. : Create By Francis Choi
  7. : 2007.05.02
  8. ---------------------------------------------------------------------- */
  9. var xPathUser = "ds_UserData_list_userlist";
  10. var xPathUserPop = "/root/main/list";
  11. /* ------------------------------------------------- */
  12. /* desc : 사용자이름 불러오기 */
  13. /* param : pNodeID - UserId Node */
  14. /* pNodeNM - UserNm Node */
  15. /* return : */
  16. /* -------------------------------------------------- */
  17. function fUserEnter(pPath, pRow, pNodeID ,pNodeNM, pNodeDept, pNodeDeptNM, pData, pDOC, pRefCls, pDeptFlag, pSearchdd) {
  18. frmf_setParameter("SendData_Searchdd", pSearchdd);
  19. frmf_setParameter("SendData_SearchNM", "");
  20. //alert("pSearchdd : "+pSearchdd);
  21. var pParam = fUseridPopupData("TRMNP00001","SPMNP00001", pData, pRefCls, pDeptFlag, pSearchdd);
  22. fUserDataSet(pParam, pPath, pRow, pNodeID, pNodeNM, pNodeDept, pNodeDeptNM, pDOC, pSearchdd);
  23. }
  24. function fUseridPopup(pPath, iRow, pNodeID, pNodeNM, pNodeDept, pNodeDeptNM, pDOC, pDeptFlag, pSearchdd, pSearchNM) {
  25. frmf_setParameter("SendData_Searchdd", pSearchdd);
  26. if( !utlf_isNull(pSearchNM) ){
  27. frmf_setParameter("SendData_SearchNM", pSearchNM);
  28. }else{
  29. frmf_setParameter("SendData_SearchNM", "");
  30. }
  31. var pParam = fShowModal("SPMNP00001");
  32. //alert("pSearchdd : "+pSearchdd);
  33. fUserDataSet(pParam, pPath, iRow, pNodeID, pNodeNM, pNodeDept, pNodeDeptNM, pDOC, pSearchdd);
  34. }
  35. /* --------------------------------------------------------*/
  36. /* model.getValue(); 를 함수로 만들었습니다. */
  37. /* param1 : node는 grid의 xPath입니다. */
  38. /* param2 : row는 grid에서 선택한 row값입니다. */
  39. /* param3 : element는 getvalue할 해당 element 명입니다. */
  40. /* */
  41. /* 해당 getvalue값을 return 해줍니다. */
  42. /* return 하지 않으면 해당값을 가져올 수 없습니다. */
  43. /* --------------------------------------------------------*/
  44. function fGetValue(node, row, element) {
  45. var rtnValue = node.getColumn(row, element).replace(/(^\s*)|(\s*$)/g, "");
  46. return rtnValue;
  47. }
  48. /* ------------------------------------------------- */
  49. /* desc : 사용자이름 불러오기 */
  50. /* param : pNodeID - UserId Node */
  51. /* pNodeNM - UserNm Node */
  52. /* return : */
  53. /* -------------------------------------------------- */
  54. function fUseridPopupData(pMapID, pProgID, pData, pRefCls, pDeptFlag, pSearchdd) { // userid, usernm, all
  55. var iParam="";
  56. if( utlf_isNull(pData) ){
  57. return iParam;
  58. }
  59. if( utlf_isNull(pRefCls) ){
  60. pRefCls = "all"; // userid, usernm, all
  61. }
  62. dsf_createDs("ds_temp_send", [{col:"searchitem", type:"string", size:256}
  63. ,{col:"flag", type:"string", size:256}
  64. ,{col:"deptflag", type:"string", size:256}
  65. ,{col:"searchdd", type:"string", size:256}]);
  66. ds_temp_send.addRow();
  67. if( this.objects[xPathUser] == null )
  68. dsf_createDs(xPathUser);
  69. eval(xPathUser).clearData();
  70. ds_temp_send.setColumn(0, "searchitem", pData);
  71. ds_temp_send.setColumn(0, "flag", pRefCls);
  72. ds_temp_send.setColumn(0, "deptflag", pDeptFlag);
  73. ds_temp_send.setColumn(0, "searchdd", pSearchdd);
  74. //alert(pMapID);
  75. var oParam = {};
  76. oParam.id = "TRMNP00001";
  77. oParam.service = "opanstapp.OpAnstRec";
  78. oParam.method = "reqGetUserList";
  79. oParam.inds = "req=ds_temp_send";
  80. oParam.outds = "ds_UserData_list_userlist=userlist";
  81. oParam.async = false;
  82. //oParam.callback = "cf_TRMNP00001";
  83. tranf_submit(oParam);
  84. var NodeCnt = ds_UserData_list_userlist.rowcount;
  85. var iNode = ds_UserData_list_userlist;
  86. switch(NodeCnt) {
  87. case 0 : sysf_messageBox(pData + "에 해당하는 자료가", "I004");
  88. break;
  89. case 1 : iParam = fGetValue(iNode, 0, "userid" ) + "|"
  90. + fGetValue(iNode, 0, "usernm" ) + "|"
  91. + fGetValue(iNode, 0, "posinstcd") + "|"
  92. + fGetValue(iNode, 0, "posinstnm") + "|"
  93. + fGetValue(iNode, 0, "posdeptcd") + "|"
  94. + fGetValue(iNode, 0, "posdeptnm") ;
  95. break;
  96. default : iParam = fShowModal(pProgID);
  97. }
  98. return iParam;
  99. }
  100. function fShowModal(pProgID) {
  101. var xpos = system.clientToScreenX(this, this.position.left)-100;
  102. var ypos = system.clientToScreenY(this, this.position.top)-100;
  103. //2008-09-04 오후 10:31:18 taebum 주석처리함.
  104. //modal(pProgID, 1, xpos, ypos,pProgID, xPathUser, xPathUserPop);
  105. frmf_modal(pProgID,pProgID,null,"",1,xpos,ypos,"","","","","","M"); //yjh : SPMNP00001화면 개발
  106. var iProperties = frmf_getParameter("SendData");
  107. // alert(iProperties);
  108. return iProperties;
  109. }
  110. function fUserDataSet(pData, pPath, pRow, pNodeID,pNodeNM, pNodeDept, pNodeDeptNM, pDoc, pSearchdd) {
  111. if( utlf_isNull(pData) ){
  112. return;
  113. }
  114. // iParam_userid 0 사용자ID
  115. // iParam_usernm 1 사용자명
  116. // iParam_posinstnm 2 소속기관명
  117. // iParam_posinstcd 3 소속기관코드
  118. // iParam_posdeptcd 4 소속부서코드
  119. // iParam_posdeptnm 5 소속부서명
  120. var iSplit_Value = pData.split("|");
  121. var sUserid = ""; // 사용자ID
  122. var sUsernm = ""; // 사용자명
  123. var sPosdeptcd = ""; // 소속부서코드
  124. var sPosdeptnm = ""; // 소속부서명
  125. if( iSplit_Value.length > 0 ){
  126. sUserid = iSplit_Value[0].replace(/(^\s*)|(\s*$)/g, ""); // 사용자ID
  127. sUsernm = iSplit_Value[1].replace(/(^\s*)|(\s*$)/g, ""); // 사용자명
  128. sPosdeptcd = iSplit_Value[4].replace(/(^\s*)|(\s*$)/g, ""); // 소속부서코드
  129. sPosdeptnm = iSplit_Value[5].replace(/(^\s*)|(\s*$)/g, ""); // 소속부서명
  130. }
  131. pPath.updatecontrol = false;
  132. pPath.enableevent = false;
  133. pPath.setColumn(pRow, pNodeID, sUserid); // 사용자ID
  134. pPath.setColumn(pRow, pNodeNM, sUsernm); // 사용자명
  135. //group3.switch1.case1.grd_opeu1.showEditor(false);
  136. if( !utlf_isNull(pNodeDept) && !utlf_isNull(pPath.getColumnInfo(pNodeDept)) ){
  137. pPath.setColumn(pRow, pNodeDept, sPosdeptcd); // 소속부서코드
  138. pPath.setColumn(pRow, pNodeDeptNM, sPosdeptnm); // 소속부서명
  139. }
  140. if( pPath.getRowType(pRow) != 2 && pPath.getRowType(pRow) != 8 ){
  141. pPath.setRowType(pRow, 4);
  142. }
  143. pPath.updatecontrol = true;
  144. pPath.enableevent = true;
  145. if( !utlf_isNull(pDoc) ){
  146. pDoc.showEditor(false);
  147. pDoc.showEditor(true);
  148. }
  149. }
  150. ]]></Script>