123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425 |
- /*
-
- (carerecweb/xrw/SMMNR024_중증도및위험사정분류도구관리.xrw - JScript )
- - Version :
- 1) : Ver.1.00.01
- */
- var xClsListPath = "/root/main/detlgrup/detlgruplist"
- var xlrgListPath = "/root/main/lrggrup/lrggruplist"
- var xCondPath = "/root/main/cond";
- var xClsListBKPath = "/root/hidden/main/detlgrup/detlgruplist";
- /**
- * @group :
- * @ver : 2007.03.31
- * @by : 정찬성
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 중증도및 위험사정 분류도구 조회
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fSearch(){
- var iRow = grd_detlgrup.row;
- var clsflag = model.getValue("/root/main/cond/clsflag");
- var recflag = model.getValue("/root/main/cond/recflag");
- var prestdt = model.getValue("/root/main/cond/prestdt");
-
-
- if(clsflag == null || clsflag == ''){
- clsflag = '1';
- }
- if(recflag == null || recflag == ''){
- recflag = '1';
- }
- if(prestdt == null || prestdt == ''){
- prestdt = getCurrentDate();
- }
-
- //recflag에 따라 낙상및 욕창의 경우 default clsflag값을 설정한다.
- if(recflag == '2'){//낙상위험사정
- if(clsflag != '1' && clsflag != '2'){//1. 아동, 2. 성인 이 선택되지 않으면 default세팅
- clsflag = '1';
- }
- }else if(recflag == '3'){//욕창위험사정
- clsflag = '1';//욕창은 무조건 1임.
- }
-
- model.removenode("/root/send");
- model.makeValue("/root/main/cond/clsflag", clsflag);
- model.makeValue("/root/main/cond/recflag", recflag);
- model.makeValue("/root/main/cond/prestdt", prestdt);
- model.makeValue("/root/main/cond/supcd", "00000000");
-
- model.makeNode("/root/send");
- model.copyNode("/root/send", xCondPath);
- if(submit("TRMNR02404")){
- model.copyNode("/root/hidden/main", "/root/main");
- fMakeTreeView();
- }
- grd_detlgrup.row = 1;
- }
- /**
- * @group :
- * @ver : 2007.03.27
- * 2008.06.19 dhkim수정
- * @by : 정찬성
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 그리드를 트리구조로 만들어준다.
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fMakeTreeView(){
- var sRowCnt = grd_detlgrup.rows-grd_detlgrup.fixedRows;
- var depth;
-
- for(var i=1; i<= sRowCnt; i++){
-
- depth = model.getValue(xClsListPath+"["+i+"]/depth");
-
- grd_detlgrup.outlinelevel(i) = depth;//depth별로 레벨을 지정한다.
- // grd_detlgrup.colDisabled(11) = true ;//시작일자 컬럼을 Non-Edit처리한다.
- }
-
- grd_detlgrup.OutlineCol = 3; //트리구조로 보여줄 col인덱스설정
- grd_detlgrup.OutlineBar = 4; //트리의 스타일 설정
- grd_detlgrup.TreeColor = "gray"; //트리색 설정
- model.refresh();
- }
- /**
- * @group :
- * @ver : 2007.03.30
- * @by : 정찬성
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 설명
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fSave(){
-
- if(fIsValid()){
-
- model.removenode("/root/send");
- model.makeValue("/root/send/detlgrup", grd_detlgrup.getupdatedataAll("i"));
- model.makeValue("/root/send/lrggrupcd", model.getValue(xCondPath+"/lrggrupcd"));
- model.makeValue("/root/send/clsflag", model.getValue("/root/main/cond/clsflag"));
- model.makeValue("/root/send/recflag", model.getValue("/root/main/cond/recflag"));
- model.makeValue("/root/send/todd2", model.getValue("/root/main/cond/todd"));
-
-
- if(submit("TXMNR02402")){
- model.copyNode("/root/hidden/main","/root/main");
- fSearch();
- }
-
- grd_detlgrup.row = 1;
- }
-
- }
- /**
- * @group :
- * @ver : 2008.06.19
- * @by : dhkim
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 분류도구를 저장하기 전에 유효성을 체크한다.
- * @param :
- * @return : true/false
- * @---------------------------------------------------
- */
- function fIsValid(){
-
- var saveyn = 0 ;
- var sRowCnt = grd_detlgrup.rows-grd_detlgrup.fixedrows;
-
- //추가된 내역 없음
- if(sRowCnt <= 0){
- return false;
- }
-
- var fromdd, todd;
- for(var i=1; i<= sRowCnt; i++){
-
- fromdd = parseInt(model.getValue(xClsListPath+"["+i+"]/fromdd"));
- todd = parseInt(model.getValue(xClsListPath+"["+i+"]/todd"));
-
- if(model.getValue(xClsListPath+"["+i+"]/hngnm") == ""){
- messageBox(i + "번째의 분류도구명을","C001");
- return false;
- }
- if(fromdd > todd){
- messageBox(i + "번째의 시작일자를 종료일자보다 이후날짜로 입력","E001");
- return false;
- }
- if(model.getValue(xClsListPath+"["+i+"]/stat") != "-") {
- saveyn = 1 ;
- }
- }
- //수정된 내역이 없음 리턴
- if(saveyn <= 0 ){
- return false;
- }
-
- return true;
- }
- /**
- * @group :
- * @ver : 2008.06.19
- * @by : dhkim
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @param :
- * @return :
- * @desc : 1차분류를 추가한다.
- * @---------------------------------------------------
- */
- function fAddRowLevelOne(){
- fSetAddRowValues('1');
- grd_detlgrup.topRow = grd_detlgrup.row;
- }
- /**
- * @group :
- * @ver : 2008.06.19
- * @by : dhkim
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @param :
- * @return :
- * @desc : 2차분류를 추가한다.
- * @---------------------------------------------------
- */
- function fAddRowLevelTwo(){
-
- var iRow = grd_detlgrup.row;
- var supcd = model.getValue(xClsListPath+"[" + iRow + "]/supcd");
- var clstlcd = model.getValue(xClsListPath+"[" + iRow + "]/clstlcd");
- if(clstlcd == null){
- clstlcd = '';
- }
- if(iRow < 1 || supcd != "00000000" || (supcd == '00000000' && clstlcd == '')){
- messageBox("1차 분류항목을 선택하지 않아 2차분류를 추가", "E001");
- return;
- }
-
- var curRow = fSetAddRowValues('2');
- fMakeTreeView();
-
- grd_detlgrup.topRow = curRow;
-
- }
- /**
- * @group :
- * @ver : 2008.06.19
- * @by : dhkim
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @param : levelFlag 1 : 1차분류추가할때, 2: 2차분류추가할때
- * @return : curRow 현재 선택된 행
- * @desc : 그리드 행추가후 value를 setting한다.
- * @---------------------------------------------------
- */
- function fSetAddRowValues(levelFlag){
- var clsflag, recflag, depth, clstlcd ;
- var curRow = grd_detlgrup.row;
-
- //1차분류추가할때
- if(levelFlag == '1'){
- clsflag = model.getValue('/root/main/cond/clsflag');
- recflag = model.getValue('/root/main/cond/recflag');
- depth = '1';
- clstlcd = '00000000';
- grd_detlgrup.addRow();
- }
- //2차분류추가할때
- else if(levelFlag == '2'){
- clstlcd = model.getValue(xClsListPath+"["+curRow+"]/clstlcd");
- clsflag = model.getValue(xClsListPath+"["+curRow+"]/clsflag");
- recflag = model.getValue(xClsListPath+"["+curRow+"]/recflag");
- depth = Number(model.getValue(xClsListPath+"["+curRow+"]/depth")) + 1;
- grd_detlgrup.insertItem(curRow, 'after');
- }
-
-
- //행추가후 set
- curRow = grd_detlgrup.row;
- model.setValue('/root/main/detlgrup/detlgruplist[' + curRow + ']/stat', 'i');//그리드상태
- model.setValue('/root/main/detlgrup/detlgruplist[' + curRow + ']/basepnt', '0');//기준점수
- model.setValue('/root/main/detlgrup/detlgruplist[' + curRow + ']/cnfmyn', 'Y');//확인yn
- model.setValue('/root/main/detlgrup/detlgruplist[' + curRow + ']/timsinptyn', 'N');//횟수yn
- model.setValue('/root/main/detlgrup/detlgruplist[' + curRow + ']/cmtinptyn', 'Y');//서술yn
- model.setValue('/root/main/detlgrup/detlgruplist[' + curRow + ']/inptchkflag', 'Y');//필수입력
- model.setValue('/root/main/detlgrup/detlgruplist[' + curRow + ']/sortseq', '0');//정렬순서
- model.setValue('/root/main/detlgrup/detlgruplist[' + curRow + ']/fromdd', getCurrentDate());//시작일자
- model.setValue('/root/main/detlgrup/detlgruplist[' + curRow + ']/todd', '99991231');//종료일자
- model.setValue('/root/main/detlgrup/detlgruplist[' + curRow + ']/recflag', recflag);//recflag
- model.setValue('/root/main/detlgrup/detlgruplist[' + curRow + ']/clsflag', clsflag);//clsflag
- model.setValue('/root/main/detlgrup/detlgruplist[' + curRow + ']/supcd', clstlcd);//supcd
- model.setValue('/root/main/detlgrup/detlgruplist[' + curRow + ']/depth', depth);//depth
-
- return curRow;
- }
- /**
- * @group :
- * @ver : 2007.04.02
- * @by : 정찬성
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 설명 grid
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fCloseGroup(){
- var sDepth = 0;
- for(var i = grd_detlgrup.fixedRows; i <= grd_detlgrup.rows; i++){
- sDepth=model.getValue(xClsListPath+"["+i+"]/depth");
- if(sDepth > 1){
- grd_detlgrup.rowhidden(i)=true
- }
- }
- grd_detlgrup.refresh();
- }
- /**
- * @group :
- * @ver : 2007.04.02
- * @by : 정찬성
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 설명 grid
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fOpenGroup(){
- for(var i = grd_detlgrup.fixedRows; i <= grd_detlgrup.rows; i++){
- grd_detlgrup.rowhidden(i)=false
- }
- grd_detlgrup.refresh();
- }
- /**
- * @group :
- * @ver : 2007.03.28
- * @by : 정찬성
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 설명
- * @param :2차분류추가
- * @return :
- * @---------------------------------------------------
- */
- function fAddInfLevlItem(){
- var iRow = grd_detlgrup.row;
- var supcd = model.getValue(xClsListPath+"["+iRow+"]/supcd");
- if(iRow < 1 || supcd != "00000000" ){
- messageBox("1차 분류 항목이 선택되지 ", "E007");
- return;
- }
- var sDepth = model.getValue(xClsListPath+"["+iRow+"]/depth");
- var sSupCd = model.getValue(xClsListPath+"["+iRow+"]/grupcd");
- var sGrupFlag = model.getValue(xClsListPath+"["+iRow+"]/grupflag");
- if(model.getValue(xClsListPath+"[grupcd='"+sSupCd+"']/stat") == "I"){
- messageBox("1차 분류가 저장되지 ", "E007");
- return;
- }
- /* 2차 분류 추가시 refseq 셋팅 시작 */
- var vargrupcd = model.getValue(xClsListPath+"["+iRow+"]/grupcd");
- var cntgrupcd = 0 ;
- for(var i=1; i<= grd_detlgrup.rows; i++){
- if(vargrupcd == model.getValue(xClsListPath+"["+i+"]/supcd")){
- cntgrupcd++ ;
- }
- }
- /* 2차 분류 추가시 refseq 셋팅 끝 */
- grd_detlgrup.insertitem(iRow,"after");
- iRow++;
- model.setValue(xClsListPath+"["+iRow+"]/refseq",cntgrupcd+1); //2차 분류 reqseq 셋팅
- model.setValue(xClsListPath+"["+iRow+"]/stat","I"); //
- model.setValue(xClsListPath+"["+iRow+"]/depth",++sDepth); // depth
- model.setValue(xClsListPath+"["+iRow+"]/supcd",sSupCd); //
- model.setValue(xClsListPath+"["+iRow+"]/todd", "99991231"); //
- model.setValue(xClsListPath+"["+iRow+"]/grupflag", 1); //
- model.setValue(xClsListPath+"["+iRow+"]/cnfmyn",'Y'); //
- model.setValue(xClsListPath+"["+iRow+"]/timsinptyn", 'Y'); //
- model.setValue(xClsListPath+"["+iRow+"]/cmtinptyn",'Y'); //
- model.setValue(xClsListPath+"["+iRow+"]/inptchkflag", 'Y'); //
- model.setValue(xClsListPath+"["+iRow+"]/fromdd", getCurrentDate());
- model.setValue(xClsListPath+"["+iRow+"]/basepnt", 0); // //
-
- if((iRow-1) <= 0 ) {
- model.setValue(xClsListPath+"["+iRow+"]/clsflag",model.getValue("root/main/cond/clsflag"));
- model.setValue(xClsListPath+"["+iRow+"]/recflag",model.getValue("root/main/cond/recflag"));
- } else {
- model.setValue(xClsListPath+"["+iRow+"]/clsflag",model.getValue("/root/main/detlgrup/detlgruplist"+"["+ (iRow-1) +"]/clsflag"));
- model.setValue(xClsListPath+"["+iRow+"]/recflag",model.getValue("/root/main/detlgrup/detlgruplist"+"["+ (iRow-1) +"]/recflag"));
- }
-
- grd_detlgrup.rebuild();
- fMakeTreeView(); //
-
- }
|