SMAYA02500.js 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  1. /************************************************************************************************************************************************
  2. * @project name : ast/fthcnstweb *
  3. * @create date : 2008.01.15 *
  4. * @author : dhkim *
  5. * @see : SMAYA02500_교직원종교현황조회.xrw *
  6. * @desc : 원목/교직원관리/교직원종교현황조회에서 사용하는 스크립트이다. *
  7. *************************************************************************************************************************************************/
  8. var xSendPath = '/root/send/reqdata'; //request xPath
  9. var xCondPath = '/root/cond'; //조회조건 xPath
  10. var xTreePath = '/root/main/tree'; //부서tree xPath
  11. var xGridPath = '/root/main/religinfo/relist'; //환자추가정보Grid xPath
  12. var currentdate = getCurrentDate();
  13. /**
  14. * @date : 2008.01.15
  15. * @author : dhkim
  16. * @desc : 모든 조회조건 및 조회결과내역을 초기화한다.
  17. * 조회조건 - 종교 default는 전체
  18. * 구분 defult는 해당없음
  19. */
  20. function fInit(){
  21. //인스턴스초기화
  22. model.removeNodeset(xGridPath); //교직원종교현황리스트그리드
  23. model.makeNode(xGridPath);
  24. //종교정보로드
  25. model.removeNode('/root/hidden/relign');
  26. model.makeNode('/root/hidden/relign');
  27. zbcfGetCodeList(new Array("R0137"), new Array("/root/hidden/relign"), true);
  28. addComboItem('cmb_relign', '전체', '', 'above');//콤보에 전체조회조건 추가
  29. //tree 초기화
  30. model.removeNodeset(xTreePath);
  31. model.makeNode(xTreePath);
  32. submit('TRAYA02502');
  33. //조회조건 초기화
  34. model.removeNodeset(xCondPath);
  35. model.makeNode(xCondPath + '/deptnm'); //부서명
  36. model.makeNode(xCondPath + '/deptcd'); //부서코드
  37. model.makeNode(xCondPath + '/deptupcd'); //상위부서코드
  38. model.makeValue(xCondPath + '/deptdownyn', 'Y');//하위부서존재여부
  39. model.makeNode(xCondPath + '/depth'); //부서레벨
  40. model.makeValue(xCondPath + '/relicd', ''); //종교코드
  41. model.makeNode(xCondPath + '/emplnm'); //사원명
  42. model.makeNode(xCondPath + '/emplcd'); //사원번호
  43. model.makeValue(xCondPath + '/ddflag', 'none'); //일자구분
  44. model.makeNode(xCondPath + '/fromdd'); //조회시작일
  45. model.makeNode(xCondPath + '/todd'); //조회종료일
  46. model.refresh();
  47. }
  48. /**
  49. * @date : 2008.01.13
  50. * @author : dhkim
  51. * ------------------------------------------------------------------------------------------------------------------------------------------------------------
  52. * @type : function
  53. * @access : public
  54. * @desc : 조회조검의 구분라디오버튼이 해당없음일때는 조회시작,종료일을 disabled처리, 셰례일,견진일,영명축일,생일일때는 enable처리
  55. * 영명축일, 생일을 선택한 경우에는 날짜 조건을 월/일만 조회하도록 input component변경처리
  56. * 세례일:bapt, 견진일:conf, 영명축일:fest, 생일: birth
  57. * ------------------------------------------------------------------------------------------------------------------------------------------------------------
  58. */
  59. function fIsEnableDate(ddflag){
  60. //해당없음 선택
  61. if(ddflag == 'none'){
  62. ipt_fromdd.disabled = true;
  63. ipt_todd.disabled = true;
  64. ipt_fromdd.attribute("width") = "95";
  65. ipt_todd.attribute("width") = "95";
  66. ipt_fromdd.attribute('format') = 'yyyy-mm-dd';
  67. ipt_todd.attribute('format') = 'yyyy-mm-dd';
  68. model.setValue(xCondPath + '/fromdd', '');
  69. model.setValue(xCondPath + '/todd', '');
  70. }
  71. //영명축일 or 생일선택
  72. else if(ddflag == 'fest' || ddflag == 'birth'){
  73. ipt_fromdd.disabled = false;
  74. ipt_todd.disabled = false;
  75. ipt_fromdd.attribute("width") = "60";
  76. ipt_todd.attribute("width") = "60";
  77. ipt_fromdd.attribute('format') = 'mm-dd';
  78. ipt_todd.attribute('format') = 'mm-dd';
  79. model.setValue(xCondPath + '/fromdd', currentdate.substring(4));
  80. model.setValue(xCondPath + '/todd', currentdate.substring(4));
  81. }
  82. else{
  83. ipt_fromdd.disabled = false;
  84. ipt_todd.disabled = false;
  85. ipt_fromdd.attribute("width") = "95";
  86. ipt_todd.attribute("width") = "95";
  87. ipt_fromdd.attribute('format') = 'yyyy-mm-dd';
  88. ipt_todd.attribute('format') = 'yyyy-mm-dd';
  89. model.setValue(xCondPath + '/fromdd', currentdate);
  90. model.setValue(xCondPath + '/todd', currentdate);
  91. }
  92. model.refresh();
  93. }
  94. /**
  95. * @date : 2008.01.13
  96. * @author : dhkim
  97. * ------------------------------------------------------------------------------------------------------------------------------------------------------------
  98. * @type : function
  99. * @access : public
  100. * @desc : 트리에서 선택한 부서의 하위에 팀이 존재할 경우 하위에 속한 직원도 조회되도록 한다.
  101. * 부서를 선택하지 않고 조회하는 경우에 라디오구분을 생일을 선택하거나 교직원명을 입력한 경우가 아니라면 부서선택은 필수조건으로 체크한다.
  102. * 조회조건 시작,종료일은 한달이상을 넘지 않도록 한다.
  103. * 영명축일/생일 선택의 경우에는 조회조건을 mm-dd 로 검색한다.
  104. * ------------------------------------------------------------------------------------------------------------------------------------------------------------
  105. */
  106. function fSearch(){
  107. var deptcd = model.getValue(xCondPath + '/deptcd'); //부서코드
  108. if(deptcd == ''){
  109. var idx = 1;
  110. model.setValue(xCondPath + '/deptcd', model.getValue(xTreePath + "/item[" + idx + "]/deptcd"));
  111. model.setValue(xCondPath + '/deptnm', model.getValue(xTreePath + "/item[" + idx + "]/deptnm"));
  112. model.setValue(xCondPath + '/depth', model.getValue(xTreePath + "/item[" + idx + "]/depth"));
  113. model.refresh();
  114. }
  115. var depth = model.getValue(xCondPath + '/depth'); //레베루
  116. var deptdownyn = model.getValue(xCondPath + '/deptdownyn'); //하위부서존재여부
  117. var religioncd = model.getValue(xCondPath + '/religioncd'); //종교
  118. var emplnm = model.getValue(xCondPath + '/emplnm'); //사원명
  119. var ddflag = model.getValue(xCondPath + '/ddflag'); //구분
  120. var fromdd = model.getValue(xCondPath + '/fromdd'); //시작일
  121. var todd = model.getValue(xCondPath + '/todd'); //종료일
  122. // if(depth < 3 && ddflag == 'none' && emplnm == ''){
  123. if(depth < 2 && ddflag == 'none' && emplnm == ''){
  124. messageBox('교직원명을 입력하시거나 하위부서를', 'C002');
  125. return false;
  126. }
  127. if(ddflag == 'bapt' || ddflag == 'conf'){
  128. if(fromdd == '' || !isValidDateTime(fromdd, 'YYYYMMDD')){
  129. messageBox('조회시작일을 날짜형식(예:2008-01-01)에 맞게', 'C001');
  130. return false;
  131. }
  132. if(todd == '' || !isValidDateTime(todd, 'YYYYMMDD')){
  133. messageBox('조회종료일을 날짜형식(예:2008-01-01)에 맞게', 'C001');
  134. return false;
  135. }
  136. if(fromdd > todd){
  137. messageBox('시작일이 종료일보다 클 수' , 'I004');
  138. return false;
  139. }
  140. if(getDateInterval(fromdd, todd) > 30){
  141. messageBox('시작일, 종료일의 구간을 한달단위로', 'C001');
  142. return false;
  143. }
  144. }else if(ddflag == 'fest' || ddflag == 'birth'){
  145. if(fromdd == '' || !isValidDateTime(fromdd, 'MMDD')){
  146. messageBox('조회시작일을 날짜형식(예:01-01)에 맞게', 'C001');
  147. return false;
  148. }
  149. if(todd == '' || !isValidDateTime(todd, 'MMDD')){
  150. messageBox('조회종료일을 날짜형식(예:01-01)에 맞게', 'C001');
  151. return false;
  152. }
  153. if(fromdd > todd){
  154. messageBox('시작일이 종료일보다 클 수' , 'I004');
  155. return false;
  156. }
  157. if(getDateInterval('0000'+fromdd, '0000'+todd) > 30){
  158. messageBox('시작일, 종료일의 구간을 한달단위로', 'C001');
  159. return false;
  160. }
  161. }
  162. model.removenode(xSendPath);
  163. model.makeNode(xSendPath);
  164. model.copyNode(xSendPath, xCondPath);
  165. if(!submit('TRAYA02501')){
  166. messageBox('조회를', 'E009');
  167. }
  168. }
  169. /**
  170. * @date : 2008.01.15
  171. * @author : dhkim
  172. * ------------------------------------------------------------------------------------------------------------------------------------------------------------
  173. * @type : function
  174. * @access : public
  175. * @desc : Excel파일로 저장
  176. * ------------------------------------------------------------------------------------------------------------------------------------------------------------
  177. */
  178. function fSaveExcel(){
  179. var file = window.fileDialog("save","","true","","xls","All Files (*.*)|*.*|Excel Files(*.xls)|*.xls");
  180. if(file != "") {
  181. grd_religion.saveExcel(file);
  182. }
  183. }
  184. /**
  185. * @date : 2008.01.15
  186. * @author : dhkim
  187. * ------------------------------------------------------------------------------------------------------------------------------------------------------------
  188. * @type : function
  189. * @access : public
  190. * @desc : 그리드에 조회된 교직원종교현황결과를 rexpert로 출력
  191. * ------------------------------------------------------------------------------------------------------------------------------------------------------------
  192. */
  193. function fPrint(){
  194. //그리드에 조회된 행사일정 결과를 rexpert를 이용해 출력
  195. exeReportPreview("RPAYA02501", "XMLSTR"); //미리보기
  196. }
  197. /**
  198. * @date : 2008.01.15
  199. * @author : dhkim
  200. * ------------------------------------------------------------------------------------------------------------------------------------------------------------
  201. * @type : function
  202. * @access : public
  203. * @desc : 부서선택팝업을 호출
  204. * ------------------------------------------------------------------------------------------------------------------------------------------------------------
  205. */
  206. function fPopDeptCode(){
  207. var search_condition = "deptnm";
  208. var search_term = model.getValue("/root/cond/deptnm");
  209. var receive_deptcd_path = "/root/cond/deptcd";
  210. var receive_deptnm_path = "/root/cond/deptnm";
  211. var standard_yn = "orduseyn";
  212. var ord_deptflag = "D";
  213. zbcfOpenInstDeptCodeList(search_condition, search_term, receive_deptcd_path, receive_deptnm_path, standard_yn, ord_deptflag, new Array("deptcd", "depthngnm"));
  214. //기관별 부서정보 검색 팝업을 호출
  215. }