123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847 |
- <?xml version="1.0" encoding="EUC-KR"?>
- <?xml-stylesheet type="text/css" href="../../../com/commonweb/css/common.css" ?>
- <xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2002/01/xforms" xmlns:ev="http://www.w3.org/2001/xml-events">
- <xhtml:head>
- <xhtml:title>업무보고 조회 및 수정</xhtml:title>
- <model id="model1">
- <instance id="instance1">
- <root xmlns="">
- <main>
- <searchlist>
- <deptdelist>
- <reptcnts/>
- </deptdelist>
- <deptn_ngdtlist>
- <reptcnts/>
- </deptn_ngdtlist>
- <psn_edu_etclist>
- <reptcnts/>
- </psn_edu_etclist>
- <noticlist>
- <reptcnts/>
- </noticlist>
- </searchlist>
- <editlist>
- <patdelist>
- <reptcnts/>
- <reptflagcd>00</reptflagcd>
- </patdelist>
- <patnlist>
- <reptcnts/>
- <reptflagcd>01</reptflagcd>
- </patnlist>
- <situatdelist>
- <reptcnts/>
- <reptflagcd>02</reptflagcd>
- </situatdelist>
- <situatnlist>
- <reptcnts/>
- <reptflagcd>03</reptflagcd>
- </situatnlist>
- <psn_edu_etclist>
- <reptcnts/>
- <reptflagcd>04</reptflagcd>
- </psn_edu_etclist>
- <noticlist>
- <reptcnts/>
- <reptflagcd>05</reptflagcd>
- </noticlist>
- </editlist>
- <cond>
- <reptdd/>
- </cond>
- </main>
- <send>
- </send>
- <temp>
- <printdata>
- </printdata>
- <copydata/>
- </temp>
- <hidden>
- <tmplist>
- <reptcnts/>
- <reptflagcd/>
- </tmplist>
- <tmplist2>
- <reptcnts/>
- <reptflagcd/>
- <seqno/>
- </tmplist2>
- <tmplist3>
- <staiud/>
- </tmplist3>
- </hidden>
- <init>
- </init>
- </root>
- </instance>
- <script type="javascript" src="../../../emr/carecomweb/js/CareCom.js"/>
- <script type="javascript" src="../../../com/commonweb/js/common.js"/>
- <script type="javascript" src="../../../com/commonweb/js/dateHelper.js"/>
- <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
- <script type="javascript" src="../../../com/basiccodeweb/js/ZBC001.js"/>
- <script type="javascript" src="../../../com/departmentcodeweb/js/ZSD001.js"/>
- <script type="javascript" ev:event="xforms-ready">
- <![CDATA[
- /* 폼 로드 */
- dutplcecd = getUserInfo("dutplcecd"); // 세션에서 부서정보 받기
- // 폼 로딩시 조회탭과 수정탭에 기본 데이터 뿌려줌
- reptdd = getAddDay(getCurrentDate(),-1); // 당일의 전일로 기본설정
- model.removenode("/root/send");
-
- model.setValue("/root/main/cond/reptdd",reptdd);
-
- model.makeValue("/root/send/reptdd", model.getValue("/root/main/cond/reptdd"));
-
- // staiud 상태값 받아오기
- stateSave();
- // 조회해오기
- submit("TRMNB02801");
-
-
- // 조회탭 기본 display
- fsearch_searchlist();
-
- // 수정탭 기본 display
- if (staiud =="I"){
- fsearch_editlist();
- }
- else if (staiud =="U"){
- submit("TRMNB02802");
- fsearch_editedlist();
- }
-
- fDataCopy(); // 조회시의 초기 데이터 복사
- model.refresh();
-
-
-
- ]]>
- </script>
- <script type="javascript" ev:event="xforms-close">
- <![CDATA[
- var ChangedCnt = fMsgBoxFlag(); // 변경된 여부 체크
- // alert("ChangedCnt: " + ChangedCnt);
- if(ChangedCnt != "0"){ // 변경 사항 발생 시 팝업
- var reply = messageBox("저장하지 않은 수정내용이 있을 수 있습니다.","Q003");
- }
- else{
- var reply = "6";
- }
-
- if(reply == "7"){
- event.defaultAction = "cancel";
- }
- ]]>
- </script>
- <submission id="TRMNB02801" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/hidden"/>
- <submission id="TRMNB02802" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/hidden"/>
- <submission id="TRMNB02803" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/hidden"/>
- <submission id="TXMNB02801" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send"/>
- </model>
- <script type="javascript">
- <![CDATA[
- /* 전 역 공 간 */
-
- // 날짜 계산 함수
- function getAddDay(inputday,addend){
- var backDate ="";
- var rt = 0;
- var yyyy = inputday.substring(0,4) +"";
- var mm = inputday.substring(4,6) +"";
- var dd = inputday.substring(6,8) +"";
- var startDate = new Date(yyyy,(eval(mm)-1),dd);
- startDate.setTime(startDate.getTime()+(86400000*addend));
- NowYear = startDate.getYear();// 년
- NowMonth = startDate.getMonth()+1;// 월
- NowDay = startDate.getDate(); // 일
- backDate += NowYear ; //년도
- if (NowMonth < 10 ) backDate += "0" + NowMonth ;
- else backDate += (startDate.getMonth() + 1);
- if (NowDay < 10 ) backDate += "0" + NowDay ;
- else backDate += (startDate.getDate());
- return backDate ;
- }
-
- // 함수들에 쓰이는 전역 변수들
- var dutplcecd = "";
- var recdeptcd = "";
- //var wardcd="";
- var staiud ="";
- var seqno=new Array();
- var comFlag =new Array();
- var userid="";
- var unitflg = 1;
-
-
- var reptdd = "";
- var recdt = "";
-
- var tmp_str1 ="";
- var tmp_str2 ="";
- var tmp_str3 ="";
- var tmp_str4 ="";
- var tmp_str5 ="";
- var tmp_str6 ="";
-
- // 상태값 변수 설정 함수
- function stateSave(){
- model.removenode("/root/send");
-
- model.makeValue("/root/send/reptdd", model.getValue("/root/main/cond/reptdd"));
-
- submit("TRMNB02803");
-
- if(model.getValue("/root/hidden/tmplist3/staiud") == "update"){
- staiud = "U"; // update (delete)
- }
- else{
- staiud = "I"; // Insert
- }
- }
-
-
- // 조회탭 텍스트에 뿌리는 함수
- function fsearch_searchlist(){
-
- tmp_str1 ="[부서보고 / 당직보고 - D / E] \n\n";
- tmp_str2 ="[부서보고 / 당직보고 - N] \n\n";
- tmp_str3 ="[인사관리 / 교육 및 회의 / 기타] \n\n";
- tmp_str4 ="[공지사항] \n\n";
-
- for (var i=1; i<grd_tmplist.rows; i++){
- if(grd_tmplist.valuematrix(i, "2") == "00"){ // [부서보고, 당직보고 -D/E]
- tmp_str1 = tmp_str1 + grd_tmplist.valuematrix(i, "1") + "\n";
- }
- else if (grd_tmplist.valuematrix(i, "2") == "01"){ // [부서보고 - N]
- tmp_str2 = tmp_str2 + grd_tmplist.valuematrix(i, "1") + "\n";
- }
- else if (grd_tmplist.valuematrix(i, "2") == "04"){ // [인사관리 / 교육 및 회의 / 기타]
- tmp_str3 = tmp_str3 + grd_tmplist.valuematrix(i, "1") + "\n";
- }
- else if (grd_tmplist.valuematrix(i, "2") == "05"){ // [공지사항] - 가장 최신에 저장한 글만.. (1일 1건)
- tmp_str4 = tmp_str4 + grd_tmplist.valuematrix(i, "1") + "\n";
- }
- }
- model.setValue("/root/main/searchlist/deptdelist/reptcnts", tmp_str1);
- model.setValue("/root/main/searchlist/deptn_ngdtlist/reptcnts", tmp_str2);
- model.setValue("/root/main/searchlist/psn_edu_etclist/reptcnts", tmp_str3);
- model.setValue("/root/main/searchlist/noticlist/reptcnts", tmp_str4);
-
- }
-
- // 수정탭 텍스트에 뿌리는 함수
- function fsearch_editlist(){
- tmp_str1 ="[환자보고 - D / E] \n\n";
- tmp_str2 ="[환자보고 - N] \n\n";
- tmp_str3 ="[상황보고 - D / E] \n\n";
- tmp_str4 ="[상황보고 - N] \n\n";
- tmp_str5 ="[인사관리 / 교육 및 회의 / 기타] \n\n";
- tmp_str6 ="[공지사항] \n\n";
-
- for (var i=1; i<grd_tmplist.rows; i++){
- if(grd_tmplist.valuematrix(i, grd_tmplist.colRef("reptflagcd")) == "00"){ // [환자보고 - D / E]
- tmp_str1 = tmp_str1 + grd_tmplist.valuematrix(i, "1") + "\n";
- }
- else if (grd_tmplist.valuematrix(i, grd_tmplist.colRef("reptflagcd")) == "01"){ // [환자보고 - N]
- tmp_str2 = tmp_str2 + grd_tmplist.valuematrix(i, "1") + "\n";
- }
- else if (grd_tmplist.valuematrix(i, grd_tmplist.colRef("reptflagcd")) == "04"){ // [인사관리 / 교육 및 회의 / 기타]
- tmp_str5 = tmp_str5 + grd_tmplist.valuematrix(i, "1") + "\n";
- }
- else if (grd_tmplist.valuematrix(i, grd_tmplist.colRef("reptflagcd")) == "05"){ // [공지사항] 가장 최신에 저장한 글만.. (1일 1건)
- tmp_str6 = tmp_str6 + grd_tmplist.valuematrix(i, "1") + "\n";
- }
- }
-
- model.setValue("/root/main/editlist/patdelist/reptcnts", tmp_str1);
- model.setValue("/root/main/editlist/patnlist/reptcnts", tmp_str2);
- model.setValue("/root/main/editlist/situatdelist/reptcnts", tmp_str3); // [상황보고 - D / E]
- model.setValue("/root/main/editlist/situatnlist/reptcnts", tmp_str4); // [상황보고 - N]
- model.setValue("/root/main/editlist/psn_edu_etclist/reptcnts", tmp_str5);
- model.setValue("/root/main/editlist/noticlist/reptcnts", tmp_str6);
-
- }
- // 편집 내용 조회 함수
- function fsearch_editedlist(){
-
- // 조회 데이터가 존재할 경우
- if(getNodesetCount("/root/hidden/tmplist2/reptflagcd") != "0"){
-
- for (var i=1; i<=getNodesetCount("/root/hidden/tmplist2/reptflagcd"); i++){
-
- if(model.getValue("/root/hidden/tmplist2["+ i +"]/reptflagcd") == "00") {// [환자보고 - D / E]
- model.setValue("/root/main/editlist/patdelist/reptcnts", model.getValue("/root/hidden/tmplist2["+ i +"]/reptcnts"));
- seqno[i-1] = model.getValue("/root/hidden/tmplist2["+ i +"]/seqno");
- }
- else if(model.getValue("/root/hidden/tmplist2["+ i +"]/reptflagcd") == "01") {// [환자보고 - N]
- model.setValue("/root/main/editlist/patnlist/reptcnts", model.getValue("/root/hidden/tmplist2["+ i +"]/reptcnts"));
- seqno[i-1] = model.getValue("/root/hidden/tmplist2["+ i +"]/seqno");
- }
- else if(model.getValue("/root/hidden/tmplist2["+ i +"]/reptflagcd") == "02") {// [상황보고 - D / E]
- model.setValue("/root/main/editlist/situatdelist/reptcnts", model.getValue("/root/hidden/tmplist2["+ i +"]/reptcnts"));
- seqno[i-1] = model.getValue("/root/hidden/tmplist2["+ i +"]/seqno");
- }
- else if(model.getValue("/root/hidden/tmplist2["+ i +"]/reptflagcd") == "03") {// [상황보고 - N]
- model.setValue("/root/main/editlist/situatnlist/reptcnts", model.getValue("/root/hidden/tmplist2["+ i +"]/reptcnts"));
- seqno[i-1] = model.getValue("/root/hidden/tmplist2["+ i +"]/seqno");
- }
- else if(model.getValue("/root/hidden/tmplist2["+ i +"]/reptflagcd") == "04") {// [인사관리 / 교육 및 회의 / 기타]
- model.setValue("/root/main/editlist/psn_edu_etclist/reptcnts", model.getValue("/root/hidden/tmplist2["+ i +"]/reptcnts"));
- seqno[i-1] = model.getValue("/root/hidden/tmplist2["+ i +"]/seqno");
- }
- else if(model.getValue("/root/hidden/tmplist2["+ i +"]/reptflagcd") == "05") {// [공지사항]
- model.setValue("/root/main/editlist/noticlist/reptcnts", model.getValue("/root/hidden/tmplist2["+ i +"]/reptcnts"));
- seqno[i-1] = model.getValue("/root/hidden/tmplist2["+ i +"]/seqno");
- }
- }
- }
- // 조회 데이터가 없을 경우 앞의 조회 결과 가져오기
- else {
- model.removenode("/root/send");
-
- model.setValue("/root/main/cond/reptdd",reptdd);
-
- model.makeValue("/root/send/reptdd", model.getValue("/root/main/cond/reptdd"));
-
- // 조회해오기
- submit("TRMNB02801");
-
- fsearch_editlist();
- model.refresh();
- }
- }
-
- // 편집내용의 저장 함수
- function fsave_editedlist(comFlag){
- // 각 textarea 구분 name, path
- var sReptEditName = new Array("patdelist", "patnlist", "situatdelist", "situatnlist", "psn_edu_etclist", "noticlist");
- var xReptEditPath = "/root/main/editlist/";
-
- // 일괄 처리를 위한 path 설정
- var sReptEditPath =
- "recdeptcd" //01기록부서코드
- + "▦reptdd" //02보고일자
- + "▦rectdt" //03기록시간
- + "▦reptflagcd" //04보고구분
- + "▦reptcnts" //05보고내용
- + "▦userid" //06기록자
- + "▦staiud" //07상태
- + "▦seqno" //08시퀀스번호
- + "▩" ;
-
- if(staiud =="I"){ // 보고일자 기준으로 저장한 적이 없을 때
- for (i=1;i <= sReptEditName.length; i++ ) {
- sReptEditPath +=
- recdeptcd //01기록부서코드
- + "▦" + reptdd //02보고일자
- + "▦" + recdt //03기록시간
- + "▦" + model.getValue(xReptEditPath + sReptEditName[i-1] + "/reptflagcd" ) //04보고구분
- + "▦" + model.getValue(xReptEditPath + sReptEditName[i-1] + "/reptcnts" ) //05보고내용
- + "▦" + userid //06기록자
- + "▦" + staiud //07상태
- + "▦" + (staiud=="U" ? seqno[i-1] : "") //08시퀀스번호
- + "▩" ;
- }
- }
- else if(staiud =="U"){ // 보고일자 기준으로 이미 저장한 이력이 있을때
- for (i=1;i <= sReptEditName.length; i++ ) {
- if(comFlag[i-1] == "Changed"){ // 변경사항이 있는 영역만 수정
- sReptEditPath +=
- recdeptcd //01기록부서코드
- + "▦" + reptdd //02보고일자
- + "▦" + recdt //03기록시간
- + "▦" + model.getValue(xReptEditPath + sReptEditName[i-1] + "/reptflagcd" ) //04보고구분
- + "▦" + model.getValue(xReptEditPath + sReptEditName[i-1] + "/reptcnts" ) //05보고내용
- + "▦" + userid //06기록자
- + "▦" + staiud //07상태
- + "▦" + (staiud=="U" ? seqno[i-1] : "") //08시퀀스번호
- + "▩" ;
- }
- else{
- }
- }
- }
-
- model.removenode("/root/send");
- model.makeNode("/root/send");
- model.makeValue("/root/send/sReptEditPath" ,sReptEditPath );
-
- submit("TXMNB02801");
- model.refresh();
-
- // 저장 후 재조회
- stateSave(); // staiud 상태값 받아오기
-
- model.removenode("/root/send"); // 날짜 변경시에 자동으로 재조회해 뿌려줌
-
- reptdd = model.getValue("/root/main/cond/reptdd");
-
- model.makeValue("/root/send/reptdd", model.getValue("/root/main/cond/reptdd"));
-
- submit("TRMNB02802");
- fsearch_editedlist();
- fDataCopy(); // 저장 후 재조회시의 데이터 재복사
- model.refresh();
-
-
- }
-
- // 문자열의 행수(Enter기준) 반환 함수
- function getRow(array_list, array_stmt){
- var rowcnt = 1; // 행 수
- var wordcnt = 0; // 글자수
- var array_rowcnt = new Array(); //
-
- for (i=0; i < array_list.length; i++ ) { // 각 행수 계산
- for(var j = 0; j < array_stmt[i].length ; j++){
- if(array_stmt[i].charAt(j)=='\n'){ //Enter입력인 경우
- rowcnt++;
- }
- wordcnt++;
- }
- array_rowcnt[i] = rowcnt;
- rowcnt = 1;
- wordcnt=0;
- }
- return array_rowcnt;
- }
-
- // Rexpert 출력 함수 (출력요구사항에 맞게 Edit)
- function fprintData(){
-
- model.makeValue("/root/temp/printdata","");
- // 각 text 영역 name
- var array_list = new Array("patdelist", "patnlist", "situatdelist", "situatnlist", "psn_edu_etclist", "noticlist");
- var array_list_attach = new Array("patlist", "situatlist", "psn_notlist"); // 출력물 전송용 영역 name
- var array_stmt = new Array();
- var array_path_attach = new Array();
- var array_rowcnt = new Array();
- var array_rowcnt_attach = new Array();
-
- for (i=0; i < array_list.length; i++ ) { // 실제 문자열과 해당 경로 저장
-
- array_stmt[i] = model.getValue("/root/main/editlist/" + array_list[i] + "/reptcnts");
- if(i<3){ // 출력물 전송위한 attach용
- array_path_attach[i] = "/root/temp/printdata/" + array_list_attach[i];
- }
- }
- array_rowcnt = getRow(array_list, array_stmt); // 각 영역 문자열의 행정보 담음
-
- // Rex 데이터 전송위한 attach
- fEditStmt_total(array_stmt, array_path_attach, array_rowcnt);
-
- // Rex 출력용 날짜
- var rdd = dateModify(model.getValue("/root/main/cond/reptdd"));
- model.makeValue("/root/temp/printdata/cond/reptdd", rdd);
-
- exeReportPreview("RPMNB02800_24시간업무보고출력", "XMLSTR", "/root/temp/printdata");
-
- }
-
- // 최종 출력용으로 인스턴스를 편집..
- function fEditStmt_total(array_stmt, array_path_attach,array_rowcnt){
- var nodenm1 = "reptcnts_A"; // 서브리포트섹션의 앞단 필드
- var nodenm2 = "reptcnts_B"; // 서브리포트섹션의 뒷단 필드
-
- //var st = "<![CDATA[";
- //var end = "]]>";
-
- //array_stmt[0] = st + array_stmt[0] + end;
-
- for (i=0; i<array_rowcnt.length; i=i+2){ // 쌍으로 비교 위한..
-
- if(array_rowcnt[i] > array_rowcnt[i+1]){
- // fEditStmt(stmt1, stmt2, path, nodenm1, nodenm2)
- fEditStmt(array_stmt[i], array_stmt[i+1], array_path_attach[i/2], nodenm1, nodenm2);
- }
- else if (array_rowcnt[i+1] > array_rowcnt[i]){
- fEditStmt(array_stmt[i+1], array_stmt[i], array_path_attach[i/2], nodenm2, nodenm1);
- }
- else if (array_rowcnt[i] == array_rowcnt[i+1]){
- fEditStmt(array_stmt[i], array_stmt[i+1], array_path_attach[i/2], nodenm1, nodenm2);
- }
- }
-
- //array_stmt[0] = array_stmt[0].replace("<","<").replace(">",">");
-
- model.refresh();
- }
-
- // 서브리포트 섹션에 적용 위해 양쪽 stmt 행을 맞춰주는 함수
- function fEditStmt(stmt1, stmt2, path, nodenm1, nodenm2){
-
- var reptcnts1 = "";
- var wordcnt1 = 0;
- var rowcnt1 = 1;
-
- if(stmt1 != ""){
-
- for(var i = 0; i < stmt1.length ; i++){ // 앞의 긴 문자열 처리
- if(stmt1.charAt(i)=='\n'){ //Enter입력인 경우
- model.makeNode(path + "[" + rowcnt1 + "]");
- model.makeValue(path + "[" + rowcnt1 + "]/" + nodenm1, reptcnts1, true);
- reptcnts1 = "";
- wordcnt1 = 0;
- rowcnt1++;
- }else{
- reptcnts1 = reptcnts1.concat(stmt1.charAt(i));
- wordcnt1++;
- }
- if((i+1) == stmt1.length){
- model.makeNode(path + "[" + rowcnt1 + "]");
- model.makeValue(path + "[" + rowcnt1 + "]/" + nodenm1, reptcnts1, true);
- reptcnts1 = "";
- wordcnt1 = 0;
- rowcnt1++;
- }
- }
- var reptcnts2 = "";
- var wordcnt2 = 0;
- var rowcnt2 = 1;
-
- for(var i = 0; i < stmt2.length ; i++){ // 뒤의 짧은 문자열 처리
- if(stmt2.charAt(i)=='\n'){ //Enter입력인 경우
- model.makeValue(path + "[" + rowcnt2 + "]/" + nodenm2, reptcnts2, true);
- reptcnts2 = "";
- wordcnt2 = 0;
- rowcnt2++;
- }else{
- reptcnts2 = reptcnts2.concat(stmt2.charAt(i));
- wordcnt2++;
- }
-
- if((i+1) == stmt2.length){
- model.makeNode(path + "[" + rowcnt2 + "]");
- model.makeValue(path + "[" + rowcnt2 + "]/" + nodenm2, reptcnts2, true);
- reptcnts2 = "";
- wordcnt2 = 0;
- rowcnt2++;
- }
- }
- if (rowcnt1 > rowcnt2){
- var reptcnts="";
-
- for (i=rowcnt2; i<rowcnt1; i++){
- model.makeValue(path + "[" + i + "]/" + nodenm2, reptcnts, true);
- }
- }
- }
-
- // model.makeNode(path + "[" + rowcnt1 + "]");
- // model.makeValue(path + "[" + rowcnt1 + "]/" + nodenm1, reptcnts);
- // model.makeValue(path + "[" + rowcnt1 + "]/" + nodenm2, reptcnts);
-
- model.refresh();
- }
-
- // 날짜 '년,월,일,요일' 출력 함수
- function dateModify(rdd){
-
- var year = rdd.substring(0,4) + "년 ";
- var month = rdd.substring(4,6) + "월 ";
- var day = rdd.substring(6,8) + "일 ";
- var day_week = rdd.toDate().getDayOfWeek("K") + "요일";
-
- return year + month + day + day_week;
-
- }
-
- // 조회시 데이터 복사
- function fDataCopy(){
- var inRef = "/root/main/editlist";
- var tmpRef = "/root/temp/copydata";
- model.copyNode(tmpRef, inRef);
- }
-
- // 조회시의 데이터와 변경 여부 체크 (부분적 I / U 구분)
- function fDataCompare(){
- var array_nodePath= new Array("patdelist/reptcnts", "patnlist/reptcnts", "situatdelist/reptcnts", "situatnlist/reptcnts", "psn_edu_etclist/reptcnts", "noticlist/reptcnts");
- var comFlag = new Array();
- var inRef = "/root/main/editlist";
- var tmpRef = "/root/temp/copydata";
-
- for(i=0; i<array_nodePath.length; i++){
- if(model.getValue(inRef + "/" + array_nodePath[i]) != model.getValue(tmpRef + "/" + array_nodePath[i])){
- comFlag[i] = "Changed";
- }
- else if(model.getValue(inRef + "/" + array_nodePath[i]) == model.getValue(tmpRef + "/" + array_nodePath[i])){
- comFlag[i] = "NoChanged";
- }
- }
- return comFlag;
- }
-
- // 조회시의 데이터 변경 여부 체크해 팝업 여부 판단
- function fMsgBoxFlag(){
- var cnt = 0;
- comFlag = fDataCompare();
- for (i=0; i<comFlag.length; i++){
- if(comFlag[i]=="Changed"){
- cnt++;
- }
- }
- return cnt;
- }
-
- ]]>
- </script>
- </xhtml:head>
- <xhtml:body guideline="1,1195;2,821;1,1216;2,7;1,738;2,595;2,779;1,1190;2,117;2,589;2,410;1,619;" style="font-family:돋움체, Arial; margin-left:8; margin-top:0; margin-right:8; margin-bottom:0; ">
- <group id="group1" style="left:0px; top:0px; width:1195px; height:13px; ">
- <caption id="caption6" class="tit_1" style="left:0px; top:0px; width:158px; height:14px; ">업무일지 조회 및 수정</caption>
- </group>
- <group id="group2" style="left:0px; top:13px; width:1195px; height:771px; vertical-align:top; ">
- <button id="button1" class="btn_sw" group="tab1" selected="true" style="left:100px; top:58px; width:100px; height:22px; vertical-align:middle; ">
- <caption>업무보고(수정)</caption>
- <toggle case="case2" ev:event="onclick"/>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- model.toggle("case2");
- unitflg = 2;
- ]]>
- </script>
- </button>
- <button id="button19" class="btn_sw" group="tab1" selected="true" style="left:0px; top:58px; width:100px; height:22px; vertical-align:middle; ">
- <caption>업무보고(조회)</caption>
- <toggle case="case1" ev:event="onclick"/>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- model.toggle("case1");
- unitflg = 1;
-
- // 조회탭 눌렸을때 재조회해 뿌려줌
- model.removenode("/root/send");
-
- reptdd = model.getValue("/root/main/cond/reptdd");
-
- model.makeValue("/root/send/reptdd", model.getValue("/root/main/cond/reptdd"));
-
- submit("TRMNB02801");
- fsearch_searchlist();
- model.refresh();
- ]]>
- </script>
- </button>
- <shape id="roundrect1" class="roundrect_search" appearance="roundrect" style="left:0px; top:7px; width:1192px; height:35px; "/>
- <input id="ipt_orddd" ref="/root/main/cond/reptdd" class="input_default" navindex="1" inputtype="date" style="left:95px; top:15px; width:100px; height:19px; ">
- <script type="javascript" ev:event="xforms-value-changed">
- <![CDATA[
-
- var ChangedCnt = fMsgBoxFlag(); // 변경된 여부 체크
- // alert("ChangedCnt" + ChangedCnt);
- if(ChangedCnt != "0"){ // 변경 사항 발생 시 팝업
- var reply = messageBox("저장하지 않은 수정내용이 있을 수 있습니다.","Q003");
- }
- else{
- var reply = "6";
- }
-
- if(reply == "6"){
-
- if(unitflg == "1") { // 조회탭 눌렸을 때의 조회
- stateSave(); // staiud 상태값 받아오기
-
- // 날짜 변경시에 자동으로 재조회해 뿌려줌
- model.removenode("/root/send");
-
- reptdd = model.getValue("/root/main/cond/reptdd");
-
- model.makeValue("/root/send/reptdd", model.getValue("/root/main/cond/reptdd"));
-
- submit("TRMNB02801");
- fsearch_searchlist();
-
- submit("TRMNB02802");
- fsearch_editedlist();
- fDataCopy(); // 저장 후 재조회시의 데이터 재복사
- model.refresh();
- }
-
- else if(unitflg =="2"){ // 수정탭 눌렸을 때의 조회
- stateSave(); // staiud 상태값 받아오기
-
- // 날짜 변경시에 자동으로 재조회해 뿌려줌
- model.removenode("/root/send");
-
- reptdd = model.getValue("/root/main/cond/reptdd");
-
- model.makeValue("/root/send/reptdd", model.getValue("/root/main/cond/reptdd"));
-
- submit("TRMNB02802");
- fsearch_editedlist();
- fDataCopy(); // 저장 후 재조회시의 데이터 재복사
- model.refresh();
- }
- }
- else{
- model.setValue("/root/main/cond/reptdd", reptdd);
- model.refresh();
- }
-
- ]]>
- </script>
- </input>
- <caption id="caption8" class="search_name" style="left:5px; top:16px; width:86px; height:17px; ">보고일자 :</caption>
- <button id="btn_srch" class="btn1_letter2" navindex="5" style="left:1132px; top:15px; width:56px; height:22px; ">
- <caption>조회</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- /*
- 조회탭과 수정탭의 구분에 따라 조회버튼은 다르게 동작되어야..
- 조회탭 - 최신의 업무보고 조회결과가 display되어야 함
- 수정탭 - 마지막으로 편집/저장했던 결과가 display 되어야함
- */
-
- if(unitflg == "1") { // 조회탭 눌렸을 때의 조회
- model.removenode("/root/send");
- model.makeValue("/root/send/reptdd", model.getValue("/root/main/cond/reptdd"));
- submit("TRMNB02801");
- fsearch_searchlist();
- model.refresh();
- }
-
- else if(unitflg =="2"){ // 수정탭 눌렸을 때의 조회
-
- var ChangedCnt = fMsgBoxFlag(); // 변경된 여부 체크
- // alert("ChangedCnt: " + ChangedCnt);
- if(ChangedCnt != "0"){ // 변경 사항 발생 시 팝업
- var reply = messageBox("저장하지 않은 수정내용이 있을 수 있습니다.","Q003");
- }
- else{
- var reply = "6";
- }
-
- if(reply == "6"){
- model.removenode("/root/send");
-
- model.makeValue("/root/send/reptdd", model.getValue("/root/main/cond/reptdd"));
-
- submit("TRMNB02802");
- fsearch_editedlist();
- fDataCopy(); // 저장 후 재조회시의 데이터 재복사
- model.refresh();
- }
- else{}
-
- }
-
- ]]>
- </script>
- </button>
- <line id="line5" class="line_4" style="x1:1124px; y1:15px; x2:1124px; y2:37px; "/>
- </group>
- <switch id="switch1" style="left:0px; top:93px; width:1195px; height:687px; ">
- <case id="case1" selected="true">
- <caption id="caption1" style="left:110px; top:280px; width:100px; height:20px; ">조회 탭</caption>
- <textarea id="textarea5" ref="/root/main/searchlist/deptdelist/reptcnts" scroll="autovscroll" editable="false" style="left:4px; top:25px; width:730px; height:470px; "/>
- <caption id="caption2" class="tit_2" style="left:11px; top:6px; width:115px; height:13px; font-size:12pxptpt; ">업무일지(조회)</caption>
- <textarea id="textarea6" ref="/root/main/searchlist/deptn_ngdtlist/reptcnts" scroll="autovscroll" editable="false" style="left:738px; top:25px; width:451px; height:470px; "/>
- <textarea id="textarea7" ref="/root/main/searchlist/noticlist/reptcnts" scroll="autovscroll" editable="false" style="left:738px; top:500px; width:451px; height:179px; "/>
- <textarea id="textarea8" ref="/root/main/searchlist/psn_edu_etclist/reptcnts" scroll="autovscroll" editable="false" style="left:4px; top:500px; width:730px; height:179px; "/>
- <datagrid id="grd_tmplist" nodeset="/root/hidden/tmplist" class="datagrid2" visibility="hidden" scroll="auto" allowuserresize="true" caption="내용^구분자^seqno^indd^cretno^instcd" colsep="^" colwidth="469, 50" ellipsis="true" extendlastcol="scroll" mergecellsfixedrows="bycolrec" rowheader="seq" rowheight="32" rowsep="|" tooltip="true" style="left:467px; top:64px; width:538px; height:421px; text-align:center; vertical-align:middle; ">
- <col ref="reptcnts" style="left:20px; top:32px; width:100px; height:23px; text-align:left; "/>
- <col ref="reptflagcd" style="left:770px; top:32px; width:100px; height:23px; text-align:right; "/>
- </datagrid>
- </case>
- <case id="case2">
- <textarea id="textarea1" ref="/root/main/editlist/patdelist/reptcnts" scroll="autovscroll" style="left:4px; top:25px; width:730px; height:292px; "/>
- <textarea id="textarea2" ref="/root/main/editlist/patnlist/reptcnts" scroll="autovscroll" style="left:738px; top:25px; width:451px; height:292px; "/>
- <textarea id="textarea3" ref="/root/main/editlist/noticlist/reptcnts" scroll="autovscroll" style="left:738px; top:500px; width:451px; height:179px; "/>
- <textarea id="textarea4" ref="/root/main/editlist/psn_edu_etclist/reptcnts" scroll="autovscroll" style="left:4px; top:500px; width:730px; height:179px; "/>
- <caption id="caption17" class="tit_2" style="left:11px; top:6px; width:115px; height:13px; font-size:12pxptpt; ">업무일지(수정)</caption>
- <button id="button10" class="btn2_letter2" style="left:1146px; top:4px; width:42px; height:19px; ">
- <caption>출력</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- var ChangedCnt = fMsgBoxFlag(); // 변경된 여부 체크
- // alert("ChangedCnt: " + ChangedCnt);
- if(ChangedCnt != "0"){ // 변경 사항 발생 시 팝업
- var reply = messageBox("저장하지 않은 수정내용이 있을 수 있습니다.","Q003");
- }
- else{
- var reply = "6";
- }
-
- if(reply == "6"){
-
- fprintData();
- }
- else{}
- ]]>
- </script>
- </button>
- <button id="button23" class="btn5_letter3" style="left:1045px; top:4px; width:53px; height:19px; ">
- <caption>초기화</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
-
- var reply = messageBox("", "Q010" );
-
- if(reply == "6"){
- model.removenode("/root/send");
- model.makeValue("/root/send/reptdd", model.getValue("/root/main/cond/reptdd"));
-
- submit("TRMNB02801");
- fsearch_editlist();
- model.refresh();
- }
- else{}
-
- ]]>
- </script>
- </button>
- <button id="button5" class="btn5_letter2" style="left:1101px; top:4px; width:42px; height:19px; ">
- <caption>저장</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
-
- comFlag = fDataCompare(); // 조회시의 데이터와 변경 여부 체크 (Changed / UnChanged)
- userid = getUserId() ;
-
- recdeptcd = dutplcecd; // 세션에서 부서정보 받아 처리
-
- // 보고일자 시점으로 저장하기 (기록일시는 현재 시점)
- model.removenode("/root/send");
- reptdd = model.getValue("/root/main/cond/reptdd");
- recdt = getCurrentDate()+getCurrentTime().substring(0,4);
- stateSave(); // staiud 상태값 받아오기 (I / U)
-
- fsave_editedlist(comFlag); // 저장
- //model.refresh();
-
- ]]>
- </script>
- </button>
- <textarea id="textarea9" ref="/root/main/editlist/situatdelist/reptcnts" scroll="autovscroll" style="left:4px; top:316px; width:730px; height:179px; "/>
- <textarea id="textarea10" ref="/root/main/editlist/situatnlist/reptcnts" scroll="autovscroll" style="left:738px; top:316px; width:451px; height:179px; "/>
- <datagrid id="grd_tmplist2" nodeset="/root/hidden/tmplist2" visibility="hidden" caption="caption1^caption2^caption3" colsep="^" mergecellsfixedrows="bycolrec" rowsep="|" style="left:737px; top:85px; width:288px; height:170px; ">
- <col ref="reptcnts"/>
- <col ref="reptflagcd"/>
- <col ref="seqno"/>
- </datagrid>
- </case>
- </switch>
- </xhtml:body>
- </xhtml:html>
|