123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334 |
- /***********************************************************************************************************************************************
- * create date : 2008.02.12
- * author : dhkim
- * file name : SPMNA02000.js
- * desc : 공여자팝업
- ***********************************************************************************************************************************************/
- var xDnorPath = '/root/main/dnorpopinfo';
- var xCondPath = '/root/cond';
- var xReqPath = '/root/send/reqdata';
- var currentDate = getCurrentDate();
- /*
- * 초기화
- */
- function finit() {
- zbcfGetCodeList(new Array("M0376","L0095"), new Array("/root/init/M0376list","/root/init/L0095list")); //혈액형,직업코드
- //플래그 초기화!
- opener.model.makeNode("/root/main/popupendflag");
- opener.model.setValue("/root/main/popupendflag", "cancel");
-
- fChangeSearchCondition( model.getValue("/root/send/srchcond") );
- model.refresh();
-
- //값이 부모창에서 입력되었을 경우 조회한다.
- if(fInputValueCheckXformsReady() ){
- if( submit("TRMNA02000") ){
- if( grd_dnorinfo.rows == 2 ){
- if( model.getValue("/root/send/autoflag").toUpperCase() == "Y" ){ //조회 내역이 1건일 경우 자동 화면 닫기
- model.setFocus("grd_dnorinfo");
- btn_confirm.dispatch("DOMActivate");
- window.close();
- }
- }
- if( grd_dnorinfo.rows > 1 ){
- model.setFocus("grd_dnorinfo");
- }else{
- if( model.getValue("/root/send/autoflag").toUpperCase() == "NON" ){ //조회 내역이 없을 경우 자동 화면 닫기
- //model.setFocus("grd_dnorinfo");
- btn_cancel.dispatch("DOMActivate");
- //window.close();
- }
- fChangeSearchCondition( cmb_cond.value );
- }
- }
- }
- }
- //창 생성시 부모창으로 부터 받은 입력값의 유효범위 체크
- function fInputValueCheckXformsReady(){
-
- var cond = model.getValue("/root/send/srchcond");
- switch(cond){
-
- case '1':
- //공여자등록번호 체크
- if(ipt_dnorno.currentText.length >= 1 ){
- model.setValue("/root/send/dnorno", ipt_dnorno.currentText);
- return (true);
- }else{
- //messageBox("공여자등록번호를 정확히", "C001");
- return (false);
- }
- break;
-
- case '2':
- //공여자이름 체크
- //if( ipt_dnornm.currentText.length >= 2 ) return (true);
- if(ipt_dnornm.currentText.length >= 2 ){
- model.setValue("/root/send/dnornm", ipt_dnornm.currentText);
- return (true);
- }else{
- //messageBox("공여자이름을 2자리 이상", "C001");
- return (false);
- }
- break;
-
- case '3':
- //공여자 주민번호 체크
- if( ipt_rrgstno1.currentText.length >= 1 || ipt_rrgstno2.currentText.length >= 1){
- model.setValue("/root/send/rrgstno1", ipt_rrgstno1.currentText);
- model.setValue("/root/send/rrgstno2", ipt_rrgstno2.currentText);
- return (true);
- }else{
- //messageBox("공여자 주민번호를", "C001");
- return (false);
- }
- break;
-
- case '4':
- //공여자이름 유효성 체크.
- if(ipt_dnornm.currentText.length >= 2 ){
- model.setValue("/root/send/dnornm", ipt_dnornm.currentText);
- }else{
- //messageBox("공여자이름을 2자리 이상", "C001");
- return (false);
- }
- //공여자 주민번호 체크
- if( ipt_rrgstno1.currentText.length >= 1 || ipt_rrgstno2.currentText.length >= 1){
- model.setValue("/root/send/rrgstno1", ipt_rrgstno1.currentText);
- model.setValue("/root/send/rrgstno2", ipt_rrgstno2.currentText);
- }else{
- //messageBox("공여자 주민번호를", "C001");
- return (false);
- }
-
- return( true );
- break;
- default :
- model.setFocus("cmb_cond");
- return( false );
- break;
- }
- }
- //입력값의 유효범위 체크
- function fInputValueCheck(){
-
- var cond = model.getValue("/root/send/srchcond");
- switch(cond){
-
- case '1':
- //공여자등록번호 체크
- if(ipt_dnorno.currentText.length >= 1 ){
- model.setValue("/root/send/dnorno", ipt_dnorno.currentText);
- return (true);
- }else{
- messageBox("공여자등록번호를 정확히", "C001");
- return (false);
- }
- break;
-
- case '2':
- //공여자이름 체크
- //if( ipt_dnornm.currentText.length >= 2 ) return (true);
- if(ipt_dnornm.currentText.length >= 2 ){
- model.setValue("/root/send/dnornm", ipt_dnornm.currentText);
- return (true);
- }else{
- messageBox("공여자이름을 2자리 이상", "C001");
- return (false);
- }
- break;
-
- case '3':
- //공여자 주민번호 체크
- if( ipt_rrgstno1.currentText.length >= 1 || ipt_rrgstno2.currentText.length >= 1 ){
- model.setValue("/root/send/rrgstno1", ipt_rrgstno1.currentText);
- model.setValue("/root/send/rrgstno2", ipt_rrgstno2.currentText);
- return (true);
- }else{
- messageBox("공여자 주민번호를", "C001");
- return (false);
- }
- break;
-
- case '4':
- //공여자이름 유효성 체크.
- if(ipt_dnornm.currentText.length>= 2 ){
- model.setValue("/root/send/dnornm", ipt_dnornm.currentText);
- }else{
- messageBox("공여자이름을 2자리 이상", "C001");
- return (false);
- }
- //공여자 주민번호 체크
- if( ipt_rrgstno1.currentText.length >= 1 || ipt_rrgstno2.currentText.length >= 1){
- model.setValue("/root/send/rrgstno1", ipt_rrgstno1.currentText);
- model.setValue("/root/send/rrgstno2", ipt_rrgstno2.currentText);
- }else{
- messageBox("공여자 주민번호를", "C001");
- return (false);
- }
- return( true );
- break;
-
- default :
- messageBox("검색조건이 정확히 선택되지 않았습니다. 확인 후 다시 시도해 주십시요.", "E999", "");
- model.setFocus("cmb_cond");
- return( false );
- break;
- }
- }
- //조회 조건에 맞는 input 컨트롤을 세팅해 준다.
- function fChangeSearchCondition( cond){
-
- switch(cond){
-
- case '1':
- model.makeNode("/root/send/dnorno");
-
- ipt_dnorno.attribute("visibility") = "visible";
- ipt_dnorno.attribute("left") = "219px";
- ipt_dnorno.attribute("top") = "8px";
- ipt_dnornm.attribute("visibility") = "hidden";
- ipt_rrgstno1.attribute("visibility") = "hidden";
- ipt_rrgstno2.attribute("visibility") = "hidden";
-
- model.setFocus("ipt_dnorno");
- break;
-
- case '2':
- model.makeNode("/root/send/dnornm");
-
- ipt_dnornm.attribute("visibility") = "visible";
- ipt_dnornm.attribute("left") = "219px";
- ipt_dnornm.attribute("top") = "8px";
- ipt_dnorno.attribute("visibility") = "hidden";
- ipt_rrgstno1.attribute("visibility") = "hidden";
- ipt_rrgstno2.attribute("visibility") = "hidden";
-
- model.setFocus("ipt_dnornm");
- break;
-
- case '3':
- model.makeNode("/root/send/rrgstno1");
- model.makeNode("/root/send/rrgstno2");
-
- ipt_rrgstno1.attribute("visibility") = "visible";
- ipt_rrgstno2.attribute("visibility") = "visible";
- ipt_rrgstno1.attribute("left") = "219px";
- ipt_rrgstno1.attribute("top") = "8px";
- ipt_rrgstno2.attribute("left") = "307px";
- ipt_rrgstno2.attribute("top") = "8px";
- ipt_dnornm.attribute("visibility") = "hidden";
- ipt_dnorno.attribute("visibility") = "hidden";
-
- model.setFocus("ipt_rrgstno1");
- break;
-
- case '4':
- //model.makeNode("/root/send/dnorno");
- model.makeNode("/root/send/dnornm");
- model.makeNode("/root/send/rrgstno1");
- model.makeNode("/root/send/rrgstno2");
-
- ipt_dnornm.attribute("visibility") = "visible";
- ipt_dnornm.attribute("left") = "219px";
- ipt_dnornm.attribute("top") = "8px";
- ipt_dnorno.attribute("visibility") = "hidden";
- ipt_rrgstno1.attribute("visibility") = "visible";
- ipt_rrgstno1.attribute("left") = "352px";
- ipt_rrgstno1.attribute("top") = "8px";
- ipt_rrgstno2.attribute("visibility") = "visible";
- ipt_rrgstno2.attribute("left") = "440px";
- ipt_rrgstno2.attribute("top") = "8px";
-
- model.setFocus("ipt_dnornm");
- break;
-
- default :
- //messageBox("검색조건이 정확히 선택되지 않았습니다. 확인 후 다시 시도해 주십시요.", "E999", "");
- break;
- }
-
- }
- /*
- */
- function fSearch() {
- if( fInputValueCheck() ){
- if( submit("TRMNA02000") ){
- if( grd_dnorinfo.rows > 1 ){
- model.setFocus("grd_dnorinfo");
- }else{
- fChangeSearchCondition( cmb_cond.value );
- }
- }
- }
- }
- function fdblclick() {
- if ( checkOpener() ) {
- row = grd_dnorinfo.row;
-
- if( row > 0 ){
- if( getNodesetCount("/root/main/dnorpopinfo/dnorpoplist") > 0 ){
- opener.model.copyNode("/root/main/dnorpopinfo/dnorpoplist", grd_dnorinfo.getNode( row ));
- opener.model.makeNode("/root/main/popupendflag");
- opener.model.setValue("/root/main/popupendflag", "ok");
-
- opener.model.refresh();
- window.close();
- }
- }
- } else {
- messageBox("상위화면이 변경되어 데이터를 가져올 수", "I004");
- }
- }
- function fOK() {
- if ( checkOpener() ) {
- row = grd_dnorinfo.row;
- opener.model.makeNode("/root/main/popupendflag");
- opener.model.setValue("/root/main/popupendflag", "cancel");
-
- if( row > 0 ){
- if( getNodesetCount("/root/main/dnorpopinfo/dnorpoplist") > 0 ){
- opener.model.copyNode("/root/main/dnorpopinfo/dnorpoplist", grd_dnorinfo.getNode( row ));
- opener.model.makeNode("/root/main/popupendflag");
- opener.model.setValue("/root/main/popupendflag", "ok");
-
- }
- //else{
- // opener.model.setValue("/root/main/popupendflag", "cancel");
- //}
- //opener.model.refresh();
- //window.close();
-
- }else {
- //opener.model.setValue("/root/main/popupendflag", "cancel");
- messageBox("행이 정확히 선택되지", "E007");
- //opener.model.refresh();
- //window.close();
- }
- } else {
- messageBox("상위화면이 변경되어 데이터를 가져올 수", "I004");
- //opener.model.setValue("/root/main/popupendflag", "cancel");
- //opener.model.refresh();
- //window.close();
- }
-
- opener.model.refresh();
- window.close();
-
- }
|