123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362 |
- /**
- * SMAYA00700_신심단체사목회 회원등록관리.xrw 에서 사용할 js
- * 2007-11-29 최초작성 dhkim
- *
- */
-
- var currentDate = getCurrentDate();
- var currentYear = currentDate.substring(0, 4);
-
- var xTreePath = '/root/main/trvecmtlist/trvecmtinfo'; //트리 인스턴스 xPath
- var xGridPath = '/root/main/cmntlist/cmntlistinfo'; //그리드 인스턴스 xPath
- var xInputPath = '/root/main/iptecmt'; //input 컴포넌트 xPath
- var xCondPath = '/root/main/cond'; //조회조건 인스턴스 xPath
- /*
- * 화면 오픈시 초기화 하는 펑션
- * 신심단체트리리스트를 조회한다.
- * 조건영역의 활동년도를 default 현재년도로 세팅.
- */
- function fInit() {
-
- //대상자 그리드 리스트 초기화
- model.removeNodeset(xGridPath);
-
- //신심단체/사목회 트리구조를 조회
- submit("TRAYA00701");
-
- //활동년도 저장 체크박스 설정 ...
- grd_cmntlist.fixedcellcheckbox(0, 1) = true;
-
- //조회조건영역 활동년도, 재등록 활동년도 초기화 default 현재년도..
- model.setValue(xCondPath + "/actyy", currentYear);
- model.setValue(xCondPath + '/rgstactyy', currentYear);
- model.refresh();
-
- }
-
-
- /**
- * 트리선택시 호출할 펑션
- * 트리선택시 조회조건영역의 사목회명과 대상자등록영역의 단체명에 선택한 사목회를 세팅
- * 조건영역에는 어떤 리스트도 선택될수 있지만 대상자등록영역에는 최하위레벨의 사목회만 세팅되도록 할것
- * 입력영역에 트리에 선택한 값을 세팅하기 전에는 반드시 입력영역을 리프레쉬한 후에 세팅하도록 한다.
- */
- function fSelectedTree() {
-
- var clscd = model.getValue(xTreePath + '[' + (trv_cmntclslist.focusIndex+1) + ']/clscd');
- var clsnm = model.getValue(xTreePath + '[' + (trv_cmntclslist.focusIndex+1) + ']/clsnm');
- var scrncd = model.getValue(xTreePath + '[' + (trv_cmntclslist.focusIndex+1) + ']/scrncd');
- var clsflag = model.getValue(xTreePath + '[' + (trv_cmntclslist.focusIndex+1) + ']/clsflag');
-
-
- //최하위레벨일때 조건영역, 인풋영역에 clscd, clsnm세팅
- if( (scrncd.charAt(0)) == clsflag ){
- //조건영역 값 세팅
- model.setValue(xCondPath + "/clscd", clscd);
- model.setValue(xCondPath + "/clsnm", clsnm);
- model.setValue(xCondPath + "/scrncd", scrncd);
-
- //입력영역 초기화
- model.resetInstanceNode(xInputPath);
- //입력영역 값 세팅
- model.setValue(xInputPath + "/clscd", clscd);
- model.setValue(xInputPath + "/clsnm", clsnm);
- model.setValue(xInputPath + "/status", 'i'); //신규등록구분
- model.setValue(xInputPath + "/actyy", currentYear); //활동년도에 default 현재년도 세팅
- model.setValue(xInputPath + "/rgstdd", currentDate); //등록일자에 default 현재일자 세팅
- }
- //최하위레벨아닐때 조건영역만 clscd, clsnm세팅
- else{
- model.setValue(xCondPath + "/clscd", clscd);
- model.setValue(xCondPath + "/clsnm", clsnm);
- model.setValue(xCondPath + "/scrncd", scrncd);
- }
- ipt_actyy.disabled = false;
- model.refresh();
- }
-
-
- //조회버튼 클릭시
- function fSearch() {
-
- //대상자 그리드 리스트, 입력영역 초기화
- model.removeNodeset(xGridPath);
- model.resetInstanceNode("/root/main/cond/rgstactyy");
- grd_cmntlist.fixedcellischeck(0,1) = false;
-
- var condYear = model.getValue(xCondPath + '/actyy');
-
- //사목회명 미선택시 초기화
- if(model.getValue(xCondPath + "/clscd") == '' || model.getValue(xCondPath + "/clscd") == 'D0000'){
- model.setValue(xCondPath + "/clscd", model.getValue(xTreePath + '[' + 1 + ']/clscd'));
- model.setValue(xCondPath + '/clsnm', model.getValue(xTreePath + '[' + 1 + ']/clsnm'));
- }
- //조회년도 미입력시 초기화
- if(condYear == null || condYear == '' || condYear.length != 4){
- model.setValue(xCondPath + '/actyy', currentYear);
- }
- //체크박스 상태 설정
- //grd_cmntlist.fixedcellischeck(0,1) = false;
- model.makeNode("/root/send/reqdata");
- model.copyNode("/root/send/reqdata", xCondPath + "");
- submit("TRAYA00702");
- }
-
- //리스트에서 선택시 대상자 등록부분에 셋팅
- function fGetCmntTrgtManInfo() {
-
- var idxRow = grd_cmntlist.row; //그리드에서 해당 회원 선택
- if (idxRow < 1)
- return;
-
- //회원정보 수정할 수 있도록 셋팅
-
- model.removenodeset(xInputPath);
- model.makeNode(xInputPath);
- model.copyNode(xInputPath, xGridPath + "[" + idxRow + "]");
- ipt_actyy.disabled =true;
- model.setValue(xInputPath + '/status', 'u');
-
- model.refresh();
-
- }
-
- //사용자 팝업
- function fSearchUser() {
-
- model.resetInstanceNode("/root/main/userpopupinfo");
- model.removeNodeset("/root/main/tempuserinfo");
- model.makeNode("/root/main/tempuserinfo");
-
- model.setValue("/root/main/userpopupinfo/param", "_OneS");
- modal("../../userdeptinfoweb/xrw/SPZSU10103_사용자부서선택조회", "", "200", "200", "SPZSU10103","/root/main/userpopupinfo","/root/main/temp");
-
- var iParam = getParameter("SPZSU10103_");
- setCSVToNode("/root/main/tempuserinfo", iParam);
- clearParameter("SPZSU10103_");
-
- var userid = model.getValue("/root/main/tempuserinfo/list/userid");
- var usernm = model.getValue("/root/main/tempuserinfo/list/usernm");
- var deptnm = model.getValue("/root/main/tempuserinfo/list/dutplcenm");
-
- if(userid == '')//temp에 값이 리턴이 안되었으면 팝업데이터를 원래상태 그대로 냅둔다.
- return;
- //팝업에서 선택된 리턴값을 인풋영역에 세팅하면서 userid에 해당하는
- //데이터중 팝업에서 가져오지 못한 데이터(세례명, 영명축일, 부서전화, 핸드폰번호)를 조회해 오기전
- //원래 있던 데이터를 초기화시킨다.
- model.setValue(xInputPath + '/emplno', userid);
- model.setValue(xInputPath + '/emplnm', usernm);
- model.setValue(xInputPath + '/baptnm', '');
- model.setValue(xInputPath + '/festivday', '');
- model.setValue(xInputPath + '/hpphontel', '');
- model.setValue(xInputPath + '/depttel', '');
- model.setValue(xInputPath + '/deptnm', deptnm);
-
- model.removenodeset('/root/temp');
- var xTempPath = '/root/temp/popdetailinfo';
- if(submit('TRAYA00703')){
-
- model.setValue(xInputPath + '/baptnm', model.getValue(xTempPath + '/baptnm'));
- model.setValue(xInputPath + '/festivday', model.getValue(xTempPath + '/fairnmdd'));
- model.setValue(xInputPath + '/hpphontel', model.getValue(xTempPath + '/mpphontel'));
- model.setValue(xInputPath + '/depttel', model.getValue(xTempPath + '/depttel'));
-
- model.refresh();
-
- }
-
- }
-
- //중복사번 체크
- //update저장버튼 클릭, 재등록 버튼 클릭시 둘다 중복사번체크 해야함..
- function isExsistEmp(emplNo, clscd, actyy){
-
- //입력한 사번 + deldd='00000000'인 사원이 이미 등록되어 있는지 조회한후 경고메세지.
- if(emplNo == null || emplNo == ''){
- emplNo = model.getValue(xInputPath + '/emplno');
- }
- if(clscd == null || clscd == ''){
- clscd = model.getValue(xInputPath + '/clscd');
- }
- if(actyy == null || actyy == ''){
- actyy = model.getValue(xInputPath + '/actyy');
- }
-
- model.removenodeset('/root/send/reqdata');
- model.makeNode('/root/send/reqdata/emplno');
- model.makeNode('/root/send/reqdata/clscd');
- model.makeNode('/root/send/reqdata/actyy');
-
- model.setValue('/root/send/reqdata/emplno', emplNo);
- model.setValue('/root/send/reqdata/clscd', clscd);
- model.setValue('/root/send/reqdata/actyy', actyy);
-
- if(submit('TRAYA00704')){
- return model.getValue('/root/temp/usercnt/cnt');
-
- }
-
- }
-
-
- //신심단체/사목회 대상자 등록 필수 저장여부 체크
- function fIsValid() {
-
- var actYear = model.getValue(xInputPath + '/actyy');
- var emplNo = model.getValue(xInputPath + '/emplno');
- var emplnm = model.getValue(xInputPath + '/emplnm');
- var clscd = model.getValue(xInputPath + '/clscd');
- var status = model.getValue(xInputPath + '/status');
- var rgstdd = model.getValue(xInputPath + '/rgstdd');
-
-
- if (clscd == "") {
- messageBox("단체명을","C002");
- return false;
- }
- if (actYear == "") {
- messageBox("활동년도를","C001");
- model.setFocus("ipt_actyy");
- return false;
- }/*
- if(actYear.lenth != 4 || isNaN(actYear)){
- messageBox("활동년도를 년도형식(예: 2007)에 맞게","C001");
- model.setFocus("ipt_actyy");
- return false;
- }
- if (rgstdd != '' && !isValidDateTime(rgstdd, 'YYYYMMDD')) {
- messageBox("등록일자를 날짜형식(예: 20071225)에 맞게","C001");
- model.setFocus("input6");
- return false;
- }*/
- if(emplNo == ''){
- messageBox("회원을","C002");
- return false;
- }
-
- if(status == 'i' && isExsistEmp() > 0){
- messageBox(emplnm + '님은 ' + actYear + '년에 이미 등록되어 있는 사원이므로 중복등록', 'E001');
- return false;
- }
-
- return true;
- }
- /**========================================================================================================================================
- * 심신단체사목회 회원등록관리 리스트 출력 - 추가 (2008.02.01 김다영)
- =========================================================================================================================================*/
- function fListPrnt(){
- exeReportPreview("RPAYA00701", "XMLSTR");
- }
-
-
-
- //대상자 등록 부분의 저장 버튼 클릭시
- function fSaveCmntRgst() {
-
- if(fIsValid()){
-
- model.copyNode('/root/send', xInputPath);
- if(submit('TXAYA00701')){
- fSearch();//재조회
- fSelectedTree();//저장후 인풋영역을 신규작성상태로 만들어준다.(구현할것)
- }
-
- }
- }
-
- //재등록, 삭제버튼 클릭시...
- //재등록할 때는 활동년도가 입력되어있지 않으면 경고메세지 출력
- function fInsDelCmntList(insDelGbn) {
-
- var actyy = model.getValue('/root/main/cond/rgstactyy');
- var clscd, emplno, emplnm;
- var isChecked = false;
-
- var savedata = 'clscd' //분류코드
- + '▦emplno' //사번
- + '▦actyy' //활동년도
- + '▦status' //상태값
- + '▦seqno' //일련번호
- + '▦jobposnm' //단체직책명
- + '▦rgstdd' //등록일자
- + '▦rem' //비고
- + "▩" ;
-
- for(var i = 1; i <= grd_cmntlist.rows; i++){
-
- clscd = model.getValue(xGridPath +'[' + i + ']/clscd');
- emplno = model.getValue(xGridPath +'[' + i + ']/emplno');
- emplnm = model.getValue(xGridPath +'[' + i + ']/emplnm');
-
- if(model.getValue(xGridPath +'[' + i + ']/chk') == 'true'){
-
- isChecked = true;
-
- //파리채 만들기...
- savedata += clscd;
- savedata += '▦' + emplno;
-
- if(insDelGbn == 'd')
- savedata += '▦' + model.getValue(xGridPath +'[' + i + ']/actyy');
- else if(insDelGbn == 'i')
- savedata += '▦' + actyy;
-
- savedata += '▦' + insDelGbn;
- savedata += '▦' + model.getValue(xGridPath +'[' + i + ']/seqno');
- savedata += '▦' + model.getValue(xGridPath +'[' + i + ']/jobposnm');
- savedata += '▦' + model.getValue(xGridPath +'[' + i + ']/rgstdd');
- savedata += '▦' + model.getValue(xGridPath +'[' + i + ']/rem');
- savedata += '▩';
-
- //insert하기전 사번 중복 체크
- if(insDelGbn == 'i' && isExsistEmp(emplno, clscd, actyy) > 0){
- messageBox(emplnm + '님은 ' + actyy + '년에 이미 등록되어 있는 사원이므로 중복등록', 'E001');
- //break;
- return ;
- }
-
- }
-
- }
-
-
- if(insDelGbn == 'i' && actyy == ''){
- messageBox("재등록할 활동년도를","C001");
- model.setFocus("ipt_rgstactyy");
- return false;
- }
-
- if(!isChecked){
- var msg = (insDelGbn == 'i')? '재등록할' : (insDelGbn == 'd')? '삭제할' : '';
- messageBox(msg + ' 회원을', 'C002');
- return false;
- }
-
- var btn ;
- if(insDelGbn == 'd')
- btn = messageBox("선택한 회원을 ", "Q001");
- else if(insDelGbn == 'i')
- btn = messageBox("선택한 회원을 ", "Q002");
-
- if (btn == '6') {
-
- model.removenodeset("/root/send/removedata");
- model.makeNode("/root/send/removedata");
- model.setValue("/root/send/removedata", savedata);
-
- if(submit("TXAYA00702")){
- fSearch();//재조회
- fSelectedTree();//저장후 인풋영역을 신규작성상태로 만들어준다.(구현할것)
- }
-
- } else if (btn == '7') {
- return;
- }
-
- }
-
|