123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309 |
- /*
-
- 약물계산식관리(SMMNR02200.xfm - JScript )
- - Version :
- 1) : Ver.1.00.01
- */
- var xItemListPath = "/root/main/iteminfo/itemlist"; // SET 그룹 정보
- var xElmtListPath = "/root/main/elmtinfo/elmtlist"; // SET 진술문 정보
- /**
- * @group :
- * @ver : 2007.05.29
- * @by : 이은영
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 화면 초기화
- * @param : pFlag
- * @return :
- * @---------------------------------------------------
- */
- function fInitialize(){
- model.removenodeset(xItemListPath);
- model.removenodeset(xElmtListPath);
- fSrchItemList("item");
- model.refresh();
- }
- /**
- * @group :
- * @ver : 2007.05.29
- * @by : 이은영
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 그리드 팝업메뉴 SETTING
- * @param : pFlag
- * @return :
- * @---------------------------------------------------
- */
- function fSettingPopUpMenu(pFlag){
-
- if(event.button == 3){
- switch(pFlag){
- case "item" :
- if(grd_itemlist.isCell(event.target) && grd_itemlist.mouseRow >= 0){
- window.setPopupMenu(true, "/root/temp/popmenu/iteminfo/menu", "name", "func", false);
- }else{
- window.setPopupMenu(false);
- }
- break;
- case "elmt" :
- if(grd_elmtlist.isCell(event.target) && grd_elmtlist.mouseRow >= 0){
- window.setPopupMenu(true, "/root/temp/popmenu/elmtinfo/menu", "name", "func", false);
- }else{
- window.setPopupMenu(false);
- }
- break;
- }
- }
- }
- /**
- * @group :
- * @ver : 2007.05.29
- * @by : 이은영
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 항목 추가
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fAddItem(){
- grd_itemlist.addRow();
- var iRow = grd_itemlist.rows - grd_itemlist.fixedrows;
- model.setValue(xItemListPath+"["+iRow+"]/supcd","*");
- model.setValue(xItemListPath+"["+iRow+"]/refseq",0);
- }
- /**
- * @group :
- * @ver : 2007.05.29
- * @by : 이은영
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 항목 삭제
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fDelItem(){
- var iRow = grd_itemlist.row;
- if(iRow < 1) return;
- var sStatus = grd_itemlist.rowstatus(iRow);
- if(sStatus != 2 && sStatus != 4){
- grd_itemlist.deleteItem(iRow);
- }else{
- grd_itemlist.rowstatus(iRow) = 4;
- }
-
-
- }
- /**
- * @group :
- * @ver : 2007.05.29
- * @by : 이은영
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 요소 추가
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fAddElmt(){
- var iItemRow = grd_itemlist.row;
- if(iItemRow<1){
- messageBox("항목을 먼저","C002");
- return;
- }
- var sItemCD = model.getValue(xItemListPath+"["+iItemRow+"]/itemcd");
- if(sItemCD == ""){
- messageBox( "계산항목을 먼저 저장해야 합니다. 요소를 추가할 수", "I004");
- return;
- }
- grd_elmtlist.addRow();
- var iRow = grd_elmtlist.rows - grd_elmtlist.fixedrows;
- model.setValue(xElmtListPath+"["+iRow+"]/supcd",sItemCD);
- model.setValue(xElmtListPath+"["+iRow+"]/refseq",0);
- }
- /**
- * @group :
- * @ver : 2007.05.29
- * @by : 이은영
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 요소 삭제
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fDelElmt(){
- var iRow = grd_elmtlist.row;
- if(iRow < 1) return;
- var sStatus = grd_elmtlist.rowstatus(iRow);
- if(sStatus == 1 || sStatus == 3){
- grd_elmtlist.deleteItem(iRow);
- }else{
- grd_elmtlist.rowstatus(iRow) = 4;
- }
- }
- /**
- * @group :
- * @ver : 2007.05.29
- * @by : 이은영
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 항목 조회
- * @param : pFlag (item : 항목, elmt : 요소)
- * @return :
- * @---------------------------------------------------
- */
- function fSrchItemList(pFlag){
- model.removenode("/root/send");
- if(pFlag == "item"){
- model.removenodeset(xElmtListPath);
- grd_elmtlist.rebuild();
- model.makeValue("/root/send/supcd","*");
- if(submit("TRMNR02201")){
- model.setValue("/root/main/itemcalform","");
- tar_calform.refresh();
- }
- }else{
- var iRow = grd_itemlist.row;
- var sItemCD = model.getValue(xItemListPath+"["+iRow+"]/itemcd");
- if(sItemCD == ""){
- model.removenodeset(xElmtListPath);
- grd_elmtlist.rebuild();
- return;
- }
- model.makeValue("/root/send/supcd",model.getValue(xItemListPath+"["+iRow+"]/itemcd"));
- if(submit("TRMNR02202")){
- model.setValue("/root/main/itemcalform",model.getValue(xItemListPath+"["+iRow+"]/calform"));
- model.refresh();
- }
- }
- }
- /**
- * @group :
- * @ver : 2007.05.29
- * @by : 이은영
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 항목 저장
- * @param : pFlag (item : 항목, elmt : 요소)
- * @return :
- * @---------------------------------------------------
- */
- function fSaveItemList(pFlag){
- model.removenode("/root/send");
- switch(pFlag){
- case "item" :
- if(fChkItemInfo(pFlag)) return;
- model.makeValue("/root/send/itemlist", grd_itemlist.getUpdateData());
- model.makeValue("/root/send/supcd","*");
- submit("TXMNR02201");
- break;
- case "elmt" :
- var iItemRow = grd_itemlist.row;
- var sItemCD = model.getValue(xItemListPath+"["+iItemRow+"]/itemcd");
- var sStatus = grd_itemlist.rowstatus(iItemRow);
- var iElmtStatus = 0;
- if(sStatus == 1 || sStatus == 3){
- messageBox( "계산항목을 먼저 저장해야 합니다. 요소 저장을 할 수", "I004");
- return;
- }
- var sItemCalForm = model.getValue("/root/main/itemcalform");
- // 계산식 검증
- var sTmpItemCalForm = sItemCalForm;
- var sElmtNM = "";
- for(var iRow=grd_elmtlist.fixedrows; iRow<= grd_elmtlist.rows-grd_elmtlist.fixedrows; iRow++){
- iElmtStatus = grd_elmtlist.rowstatus(iRow);
- if(iElmtStatus == 4) continue;
- sElmtNM = model.getValue(xElmtListPath+"["+iRow+"]/itemnm");
- while(sTmpItemCalForm.indexOf(sElmtNM) >= 0){
- sTmpItemCalForm = sTmpItemCalForm.replace(sElmtNM,1);
- }
- }
- // 계산식에 사용할 수 있는 특수기호, 숫자 제외하기
- if(sTmpItemCalForm.replace(/[\+,\-,\/,\*,\(,\), ,0-9,\n]/g,"") != ""){
- messageBox( "계산식이 잘못 되었습니다. 다시", "C001");
- return;
- }
- // 계산식에서 줄바꿈 문자 빼주기
- sTmpItemCalForm = sTmpItemCalForm.replace(/\n/g,"");
- if(model.getValue(xItemListPath+"["+iItemRow+"]/calform") != sItemCalForm){
- if(sStatus == 0 || sStatus == 4){
- grd_itemlist.rowstatus(iItemRow) = 2;
- }
- model.setValue(xItemListPath+"["+iItemRow+"]/calform", sItemCalForm);
- }
- model.makeValue("/root/send/itemlist", grd_itemlist.getUpdateData());
- model.makeValue("/root/send/elmtlist", grd_elmtlist.getUpdateData());
- model.makeValue("/root/send/supcd", sItemCD);
- if(submit("TXMNR02202")){
- copyNodesetType(xItemListPath,"/root/temp/iteminfo/itemlist","replace");
- copyNodesetType(xElmtListPath,"/root/temp/iteminfo/elmtlist","replace");
- grd_elmtlist.rebuild();
- grd_itemlist.rebuild();
- iItemRow = grd_itemlist.findRow(sItemCD,1,4);
- grd_itemlist.row = iItemRow;
- model.setValue("/root/main/itemcalform",model.getValue(xItemListPath+"["+iItemRow+"]/calform"));
- tar_calform.refresh();
- }
- break;
- }
- }
- /**
- * @group :
- * @ver : 2007.05.29
- * @by : 이은영
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 빈 항목명이 있는지 체크
- * @param : pFlag (item : 항목, elmt : 요소)
- * @return :
- * @---------------------------------------------------
- */
- function fChkItemInfo(pFlag){
- switch(pFlag){
- case "item" :
- for(var iRow=grd_itemlist.fixedrows; iRow<=grd_itemlist.rows-grd_itemlist.fixedrows; iRow++){
- if(model.getValue(xItemListPath+"["+iRow+"]/itemnm") == ""){
- messageBox("항목명은","I003");
- return true;
- }
- }
- break;
-
- }
- return false;
- }
- function fChangedGridRow(pFlag){
- var iRow = 0;
- var iStatus = 0;
- switch(pFlag){
- case "item" :
- iRow = grd_itemlist.row;
- iStatus = grd_itemlist.rowstatus(iRow);
- if(iStatus == 1 || iStatus == 3) return;
- grd_itemlist.rowstatus(iRow) = 2;
- break;
-
- }
- }
|