SMMNB02800_24시간업무보고조회및수정.xrw 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847
  1. <?xml version="1.0" encoding="EUC-KR"?>
  2. <?xml-stylesheet type="text/css" href="../../../com/commonweb/css/common.css" ?>
  3. <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">
  4. <xhtml:head>
  5. <xhtml:title>업무보고 조회 및 수정</xhtml:title>
  6. <model id="model1">
  7. <instance id="instance1">
  8. <root xmlns="">
  9. <main>
  10. <searchlist>
  11. <deptdelist>
  12. <reptcnts/>
  13. </deptdelist>
  14. <deptn_ngdtlist>
  15. <reptcnts/>
  16. </deptn_ngdtlist>
  17. <psn_edu_etclist>
  18. <reptcnts/>
  19. </psn_edu_etclist>
  20. <noticlist>
  21. <reptcnts/>
  22. </noticlist>
  23. </searchlist>
  24. <editlist>
  25. <patdelist>
  26. <reptcnts/>
  27. <reptflagcd>00</reptflagcd>
  28. </patdelist>
  29. <patnlist>
  30. <reptcnts/>
  31. <reptflagcd>01</reptflagcd>
  32. </patnlist>
  33. <situatdelist>
  34. <reptcnts/>
  35. <reptflagcd>02</reptflagcd>
  36. </situatdelist>
  37. <situatnlist>
  38. <reptcnts/>
  39. <reptflagcd>03</reptflagcd>
  40. </situatnlist>
  41. <psn_edu_etclist>
  42. <reptcnts/>
  43. <reptflagcd>04</reptflagcd>
  44. </psn_edu_etclist>
  45. <noticlist>
  46. <reptcnts/>
  47. <reptflagcd>05</reptflagcd>
  48. </noticlist>
  49. </editlist>
  50. <cond>
  51. <reptdd/>
  52. </cond>
  53. </main>
  54. <send>
  55. </send>
  56. <temp>
  57. <printdata>
  58. </printdata>
  59. <copydata/>
  60. </temp>
  61. <hidden>
  62. <tmplist>
  63. <reptcnts/>
  64. <reptflagcd/>
  65. </tmplist>
  66. <tmplist2>
  67. <reptcnts/>
  68. <reptflagcd/>
  69. <seqno/>
  70. </tmplist2>
  71. <tmplist3>
  72. <staiud/>
  73. </tmplist3>
  74. </hidden>
  75. <init>
  76. </init>
  77. </root>
  78. </instance>
  79. <script type="javascript" src="../../../emr/carecomweb/js/CareCom.js"/>
  80. <script type="javascript" src="../../../com/commonweb/js/common.js"/>
  81. <script type="javascript" src="../../../com/commonweb/js/dateHelper.js"/>
  82. <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
  83. <script type="javascript" src="../../../com/basiccodeweb/js/ZBC001.js"/>
  84. <script type="javascript" src="../../../com/departmentcodeweb/js/ZSD001.js"/>
  85. <script type="javascript" ev:event="xforms-ready">
  86. <![CDATA[
  87. /* 폼 로드 */
  88. dutplcecd = getUserInfo("dutplcecd"); // 세션에서 부서정보 받기
  89. // 폼 로딩시 조회탭과 수정탭에 기본 데이터 뿌려줌
  90. reptdd = getAddDay(getCurrentDate(),-1); // 당일의 전일로 기본설정
  91. model.removenode("/root/send");
  92. model.setValue("/root/main/cond/reptdd",reptdd);
  93. model.makeValue("/root/send/reptdd", model.getValue("/root/main/cond/reptdd"));
  94. // staiud 상태값 받아오기
  95. stateSave();
  96. // 조회해오기
  97. submit("TRMNB02801");
  98. // 조회탭 기본 display
  99. fsearch_searchlist();
  100. // 수정탭 기본 display
  101. if (staiud =="I"){
  102. fsearch_editlist();
  103. }
  104. else if (staiud =="U"){
  105. submit("TRMNB02802");
  106. fsearch_editedlist();
  107. }
  108. fDataCopy(); // 조회시의 초기 데이터 복사
  109. model.refresh();
  110. ]]>
  111. </script>
  112. <script type="javascript" ev:event="xforms-close">
  113. <![CDATA[
  114. var ChangedCnt = fMsgBoxFlag(); // 변경된 여부 체크
  115. // alert("ChangedCnt: " + ChangedCnt);
  116. if(ChangedCnt != "0"){ // 변경 사항 발생 시 팝업
  117. var reply = messageBox("저장하지 않은 수정내용이 있을 수 있습니다.","Q003");
  118. }
  119. else{
  120. var reply = "6";
  121. }
  122. if(reply == "7"){
  123. event.defaultAction = "cancel";
  124. }
  125. ]]>
  126. </script>
  127. <submission id="TRMNB02801" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/hidden"/>
  128. <submission id="TRMNB02802" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/hidden"/>
  129. <submission id="TRMNB02803" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/hidden"/>
  130. <submission id="TXMNB02801" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send"/>
  131. </model>
  132. <script type="javascript">
  133. <![CDATA[
  134. /* 전 역 공 간 */
  135. // 날짜 계산 함수
  136. function getAddDay(inputday,addend){
  137. var backDate ="";
  138. var rt = 0;
  139. var yyyy = inputday.substring(0,4) +"";
  140. var mm = inputday.substring(4,6) +"";
  141. var dd = inputday.substring(6,8) +"";
  142. var startDate = new Date(yyyy,(eval(mm)-1),dd);
  143. startDate.setTime(startDate.getTime()+(86400000*addend));
  144. NowYear = startDate.getYear();// 년
  145. NowMonth = startDate.getMonth()+1;// 월
  146. NowDay = startDate.getDate(); // 일
  147. backDate += NowYear ; //년도
  148. if (NowMonth < 10 ) backDate += "0" + NowMonth ;
  149. else backDate += (startDate.getMonth() + 1);
  150. if (NowDay < 10 ) backDate += "0" + NowDay ;
  151. else backDate += (startDate.getDate());
  152. return backDate ;
  153. }
  154. // 함수들에 쓰이는 전역 변수들
  155. var dutplcecd = "";
  156. var recdeptcd = "";
  157. //var wardcd="";
  158. var staiud ="";
  159. var seqno=new Array();
  160. var comFlag =new Array();
  161. var userid="";
  162. var unitflg = 1;
  163. var reptdd = "";
  164. var recdt = "";
  165. var tmp_str1 ="";
  166. var tmp_str2 ="";
  167. var tmp_str3 ="";
  168. var tmp_str4 ="";
  169. var tmp_str5 ="";
  170. var tmp_str6 ="";
  171. // 상태값 변수 설정 함수
  172. function stateSave(){
  173. model.removenode("/root/send");
  174. model.makeValue("/root/send/reptdd", model.getValue("/root/main/cond/reptdd"));
  175. submit("TRMNB02803");
  176. if(model.getValue("/root/hidden/tmplist3/staiud") == "update"){
  177. staiud = "U"; // update (delete)
  178. }
  179. else{
  180. staiud = "I"; // Insert
  181. }
  182. }
  183. // 조회탭 텍스트에 뿌리는 함수
  184. function fsearch_searchlist(){
  185. tmp_str1 ="[부서보고 / 당직보고 - D / E] \n\n";
  186. tmp_str2 ="[부서보고 / 당직보고 - N] \n\n";
  187. tmp_str3 ="[인사관리 / 교육 및 회의 / 기타] \n\n";
  188. tmp_str4 ="[공지사항] \n\n";
  189. for (var i=1; i<grd_tmplist.rows; i++){
  190. if(grd_tmplist.valuematrix(i, "2") == "00"){ // [부서보고, 당직보고 -D/E]
  191. tmp_str1 = tmp_str1 + grd_tmplist.valuematrix(i, "1") + "\n";
  192. }
  193. else if (grd_tmplist.valuematrix(i, "2") == "01"){ // [부서보고 - N]
  194. tmp_str2 = tmp_str2 + grd_tmplist.valuematrix(i, "1") + "\n";
  195. }
  196. else if (grd_tmplist.valuematrix(i, "2") == "04"){ // [인사관리 / 교육 및 회의 / 기타]
  197. tmp_str3 = tmp_str3 + grd_tmplist.valuematrix(i, "1") + "\n";
  198. }
  199. else if (grd_tmplist.valuematrix(i, "2") == "05"){ // [공지사항] - 가장 최신에 저장한 글만.. (1일 1건)
  200. tmp_str4 = tmp_str4 + grd_tmplist.valuematrix(i, "1") + "\n";
  201. }
  202. }
  203. model.setValue("/root/main/searchlist/deptdelist/reptcnts", tmp_str1);
  204. model.setValue("/root/main/searchlist/deptn_ngdtlist/reptcnts", tmp_str2);
  205. model.setValue("/root/main/searchlist/psn_edu_etclist/reptcnts", tmp_str3);
  206. model.setValue("/root/main/searchlist/noticlist/reptcnts", tmp_str4);
  207. }
  208. // 수정탭 텍스트에 뿌리는 함수
  209. function fsearch_editlist(){
  210. tmp_str1 ="[환자보고 - D / E] \n\n";
  211. tmp_str2 ="[환자보고 - N] \n\n";
  212. tmp_str3 ="[상황보고 - D / E] \n\n";
  213. tmp_str4 ="[상황보고 - N] \n\n";
  214. tmp_str5 ="[인사관리 / 교육 및 회의 / 기타] \n\n";
  215. tmp_str6 ="[공지사항] \n\n";
  216. for (var i=1; i<grd_tmplist.rows; i++){
  217. if(grd_tmplist.valuematrix(i, grd_tmplist.colRef("reptflagcd")) == "00"){ // [환자보고 - D / E]
  218. tmp_str1 = tmp_str1 + grd_tmplist.valuematrix(i, "1") + "\n";
  219. }
  220. else if (grd_tmplist.valuematrix(i, grd_tmplist.colRef("reptflagcd")) == "01"){ // [환자보고 - N]
  221. tmp_str2 = tmp_str2 + grd_tmplist.valuematrix(i, "1") + "\n";
  222. }
  223. else if (grd_tmplist.valuematrix(i, grd_tmplist.colRef("reptflagcd")) == "04"){ // [인사관리 / 교육 및 회의 / 기타]
  224. tmp_str5 = tmp_str5 + grd_tmplist.valuematrix(i, "1") + "\n";
  225. }
  226. else if (grd_tmplist.valuematrix(i, grd_tmplist.colRef("reptflagcd")) == "05"){ // [공지사항] 가장 최신에 저장한 글만.. (1일 1건)
  227. tmp_str6 = tmp_str6 + grd_tmplist.valuematrix(i, "1") + "\n";
  228. }
  229. }
  230. model.setValue("/root/main/editlist/patdelist/reptcnts", tmp_str1);
  231. model.setValue("/root/main/editlist/patnlist/reptcnts", tmp_str2);
  232. model.setValue("/root/main/editlist/situatdelist/reptcnts", tmp_str3); // [상황보고 - D / E]
  233. model.setValue("/root/main/editlist/situatnlist/reptcnts", tmp_str4); // [상황보고 - N]
  234. model.setValue("/root/main/editlist/psn_edu_etclist/reptcnts", tmp_str5);
  235. model.setValue("/root/main/editlist/noticlist/reptcnts", tmp_str6);
  236. }
  237. // 편집 내용 조회 함수
  238. function fsearch_editedlist(){
  239. // 조회 데이터가 존재할 경우
  240. if(getNodesetCount("/root/hidden/tmplist2/reptflagcd") != "0"){
  241. for (var i=1; i<=getNodesetCount("/root/hidden/tmplist2/reptflagcd"); i++){
  242. if(model.getValue("/root/hidden/tmplist2["+ i +"]/reptflagcd") == "00") {// [환자보고 - D / E]
  243. model.setValue("/root/main/editlist/patdelist/reptcnts", model.getValue("/root/hidden/tmplist2["+ i +"]/reptcnts"));
  244. seqno[i-1] = model.getValue("/root/hidden/tmplist2["+ i +"]/seqno");
  245. }
  246. else if(model.getValue("/root/hidden/tmplist2["+ i +"]/reptflagcd") == "01") {// [환자보고 - N]
  247. model.setValue("/root/main/editlist/patnlist/reptcnts", model.getValue("/root/hidden/tmplist2["+ i +"]/reptcnts"));
  248. seqno[i-1] = model.getValue("/root/hidden/tmplist2["+ i +"]/seqno");
  249. }
  250. else if(model.getValue("/root/hidden/tmplist2["+ i +"]/reptflagcd") == "02") {// [상황보고 - D / E]
  251. model.setValue("/root/main/editlist/situatdelist/reptcnts", model.getValue("/root/hidden/tmplist2["+ i +"]/reptcnts"));
  252. seqno[i-1] = model.getValue("/root/hidden/tmplist2["+ i +"]/seqno");
  253. }
  254. else if(model.getValue("/root/hidden/tmplist2["+ i +"]/reptflagcd") == "03") {// [상황보고 - N]
  255. model.setValue("/root/main/editlist/situatnlist/reptcnts", model.getValue("/root/hidden/tmplist2["+ i +"]/reptcnts"));
  256. seqno[i-1] = model.getValue("/root/hidden/tmplist2["+ i +"]/seqno");
  257. }
  258. else if(model.getValue("/root/hidden/tmplist2["+ i +"]/reptflagcd") == "04") {// [인사관리 / 교육 및 회의 / 기타]
  259. model.setValue("/root/main/editlist/psn_edu_etclist/reptcnts", model.getValue("/root/hidden/tmplist2["+ i +"]/reptcnts"));
  260. seqno[i-1] = model.getValue("/root/hidden/tmplist2["+ i +"]/seqno");
  261. }
  262. else if(model.getValue("/root/hidden/tmplist2["+ i +"]/reptflagcd") == "05") {// [공지사항]
  263. model.setValue("/root/main/editlist/noticlist/reptcnts", model.getValue("/root/hidden/tmplist2["+ i +"]/reptcnts"));
  264. seqno[i-1] = model.getValue("/root/hidden/tmplist2["+ i +"]/seqno");
  265. }
  266. }
  267. }
  268. // 조회 데이터가 없을 경우 앞의 조회 결과 가져오기
  269. else {
  270. model.removenode("/root/send");
  271. model.setValue("/root/main/cond/reptdd",reptdd);
  272. model.makeValue("/root/send/reptdd", model.getValue("/root/main/cond/reptdd"));
  273. // 조회해오기
  274. submit("TRMNB02801");
  275. fsearch_editlist();
  276. model.refresh();
  277. }
  278. }
  279. // 편집내용의 저장 함수
  280. function fsave_editedlist(comFlag){
  281. // 각 textarea 구분 name, path
  282. var sReptEditName = new Array("patdelist", "patnlist", "situatdelist", "situatnlist", "psn_edu_etclist", "noticlist");
  283. var xReptEditPath = "/root/main/editlist/";
  284. // 일괄 처리를 위한 path 설정
  285. var sReptEditPath =
  286. "recdeptcd" //01기록부서코드
  287. + "▦reptdd" //02보고일자
  288. + "▦rectdt" //03기록시간
  289. + "▦reptflagcd" //04보고구분
  290. + "▦reptcnts" //05보고내용
  291. + "▦userid" //06기록자
  292. + "▦staiud" //07상태
  293. + "▦seqno" //08시퀀스번호
  294. + "▩" ;
  295. if(staiud =="I"){ // 보고일자 기준으로 저장한 적이 없을 때
  296. for (i=1;i <= sReptEditName.length; i++ ) {
  297. sReptEditPath +=
  298. recdeptcd //01기록부서코드
  299. + "▦" + reptdd //02보고일자
  300. + "▦" + recdt //03기록시간
  301. + "▦" + model.getValue(xReptEditPath + sReptEditName[i-1] + "/reptflagcd" ) //04보고구분
  302. + "▦" + model.getValue(xReptEditPath + sReptEditName[i-1] + "/reptcnts" ) //05보고내용
  303. + "▦" + userid //06기록자
  304. + "▦" + staiud //07상태
  305. + "▦" + (staiud=="U" ? seqno[i-1] : "") //08시퀀스번호
  306. + "▩" ;
  307. }
  308. }
  309. else if(staiud =="U"){ // 보고일자 기준으로 이미 저장한 이력이 있을때
  310. for (i=1;i <= sReptEditName.length; i++ ) {
  311. if(comFlag[i-1] == "Changed"){ // 변경사항이 있는 영역만 수정
  312. sReptEditPath +=
  313. recdeptcd //01기록부서코드
  314. + "▦" + reptdd //02보고일자
  315. + "▦" + recdt //03기록시간
  316. + "▦" + model.getValue(xReptEditPath + sReptEditName[i-1] + "/reptflagcd" ) //04보고구분
  317. + "▦" + model.getValue(xReptEditPath + sReptEditName[i-1] + "/reptcnts" ) //05보고내용
  318. + "▦" + userid //06기록자
  319. + "▦" + staiud //07상태
  320. + "▦" + (staiud=="U" ? seqno[i-1] : "") //08시퀀스번호
  321. + "▩" ;
  322. }
  323. else{
  324. }
  325. }
  326. }
  327. model.removenode("/root/send");
  328. model.makeNode("/root/send");
  329. model.makeValue("/root/send/sReptEditPath" ,sReptEditPath );
  330. submit("TXMNB02801");
  331. model.refresh();
  332. // 저장 후 재조회
  333. stateSave(); // staiud 상태값 받아오기
  334. model.removenode("/root/send"); // 날짜 변경시에 자동으로 재조회해 뿌려줌
  335. reptdd = model.getValue("/root/main/cond/reptdd");
  336. model.makeValue("/root/send/reptdd", model.getValue("/root/main/cond/reptdd"));
  337. submit("TRMNB02802");
  338. fsearch_editedlist();
  339. fDataCopy(); // 저장 후 재조회시의 데이터 재복사
  340. model.refresh();
  341. }
  342. // 문자열의 행수(Enter기준) 반환 함수
  343. function getRow(array_list, array_stmt){
  344. var rowcnt = 1; // 행 수
  345. var wordcnt = 0; // 글자수
  346. var array_rowcnt = new Array(); //
  347. for (i=0; i < array_list.length; i++ ) { // 각 행수 계산
  348. for(var j = 0; j < array_stmt[i].length ; j++){
  349. if(array_stmt[i].charAt(j)=='\n'){ //Enter입력인 경우
  350. rowcnt++;
  351. }
  352. wordcnt++;
  353. }
  354. array_rowcnt[i] = rowcnt;
  355. rowcnt = 1;
  356. wordcnt=0;
  357. }
  358. return array_rowcnt;
  359. }
  360. // Rexpert 출력 함수 (출력요구사항에 맞게 Edit)
  361. function fprintData(){
  362. model.makeValue("/root/temp/printdata","");
  363. // 각 text 영역 name
  364. var array_list = new Array("patdelist", "patnlist", "situatdelist", "situatnlist", "psn_edu_etclist", "noticlist");
  365. var array_list_attach = new Array("patlist", "situatlist", "psn_notlist"); // 출력물 전송용 영역 name
  366. var array_stmt = new Array();
  367. var array_path_attach = new Array();
  368. var array_rowcnt = new Array();
  369. var array_rowcnt_attach = new Array();
  370. for (i=0; i < array_list.length; i++ ) { // 실제 문자열과 해당 경로 저장
  371. array_stmt[i] = model.getValue("/root/main/editlist/" + array_list[i] + "/reptcnts");
  372. if(i<3){ // 출력물 전송위한 attach용
  373. array_path_attach[i] = "/root/temp/printdata/" + array_list_attach[i];
  374. }
  375. }
  376. array_rowcnt = getRow(array_list, array_stmt); // 각 영역 문자열의 행정보 담음
  377. // Rex 데이터 전송위한 attach
  378. fEditStmt_total(array_stmt, array_path_attach, array_rowcnt);
  379. // Rex 출력용 날짜
  380. var rdd = dateModify(model.getValue("/root/main/cond/reptdd"));
  381. model.makeValue("/root/temp/printdata/cond/reptdd", rdd);
  382. exeReportPreview("RPMNB02800_24시간업무보고출력", "XMLSTR", "/root/temp/printdata");
  383. }
  384. // 최종 출력용으로 인스턴스를 편집..
  385. function fEditStmt_total(array_stmt, array_path_attach,array_rowcnt){
  386. var nodenm1 = "reptcnts_A"; // 서브리포트섹션의 앞단 필드
  387. var nodenm2 = "reptcnts_B"; // 서브리포트섹션의 뒷단 필드
  388. //var st = "&lt;![CDATA[";
  389. //var end = "]]&gt";
  390. //array_stmt[0] = st + array_stmt[0] + end;
  391. for (i=0; i<array_rowcnt.length; i=i+2){ // 쌍으로 비교 위한..
  392. if(array_rowcnt[i] > array_rowcnt[i+1]){
  393. // fEditStmt(stmt1, stmt2, path, nodenm1, nodenm2)
  394. fEditStmt(array_stmt[i], array_stmt[i+1], array_path_attach[i/2], nodenm1, nodenm2);
  395. }
  396. else if (array_rowcnt[i+1] > array_rowcnt[i]){
  397. fEditStmt(array_stmt[i+1], array_stmt[i], array_path_attach[i/2], nodenm2, nodenm1);
  398. }
  399. else if (array_rowcnt[i] == array_rowcnt[i+1]){
  400. fEditStmt(array_stmt[i], array_stmt[i+1], array_path_attach[i/2], nodenm1, nodenm2);
  401. }
  402. }
  403. //array_stmt[0] = array_stmt[0].replace("&lt;","<").replace("&gt;",">");
  404. model.refresh();
  405. }
  406. // 서브리포트 섹션에 적용 위해 양쪽 stmt 행을 맞춰주는 함수
  407. function fEditStmt(stmt1, stmt2, path, nodenm1, nodenm2){
  408. var reptcnts1 = "";
  409. var wordcnt1 = 0;
  410. var rowcnt1 = 1;
  411. if(stmt1 != ""){
  412. for(var i = 0; i < stmt1.length ; i++){ // 앞의 긴 문자열 처리
  413. if(stmt1.charAt(i)=='\n'){ //Enter입력인 경우
  414. model.makeNode(path + "[" + rowcnt1 + "]");
  415. model.makeValue(path + "[" + rowcnt1 + "]/" + nodenm1, reptcnts1, true);
  416. reptcnts1 = "";
  417. wordcnt1 = 0;
  418. rowcnt1++;
  419. }else{
  420. reptcnts1 = reptcnts1.concat(stmt1.charAt(i));
  421. wordcnt1++;
  422. }
  423. if((i+1) == stmt1.length){
  424. model.makeNode(path + "[" + rowcnt1 + "]");
  425. model.makeValue(path + "[" + rowcnt1 + "]/" + nodenm1, reptcnts1, true);
  426. reptcnts1 = "";
  427. wordcnt1 = 0;
  428. rowcnt1++;
  429. }
  430. }
  431. var reptcnts2 = "";
  432. var wordcnt2 = 0;
  433. var rowcnt2 = 1;
  434. for(var i = 0; i < stmt2.length ; i++){ // 뒤의 짧은 문자열 처리
  435. if(stmt2.charAt(i)=='\n'){ //Enter입력인 경우
  436. model.makeValue(path + "[" + rowcnt2 + "]/" + nodenm2, reptcnts2, true);
  437. reptcnts2 = "";
  438. wordcnt2 = 0;
  439. rowcnt2++;
  440. }else{
  441. reptcnts2 = reptcnts2.concat(stmt2.charAt(i));
  442. wordcnt2++;
  443. }
  444. if((i+1) == stmt2.length){
  445. model.makeNode(path + "[" + rowcnt2 + "]");
  446. model.makeValue(path + "[" + rowcnt2 + "]/" + nodenm2, reptcnts2, true);
  447. reptcnts2 = "";
  448. wordcnt2 = 0;
  449. rowcnt2++;
  450. }
  451. }
  452. if (rowcnt1 > rowcnt2){
  453. var reptcnts="";
  454. for (i=rowcnt2; i<rowcnt1; i++){
  455. model.makeValue(path + "[" + i + "]/" + nodenm2, reptcnts, true);
  456. }
  457. }
  458. }
  459. // model.makeNode(path + "[" + rowcnt1 + "]");
  460. // model.makeValue(path + "[" + rowcnt1 + "]/" + nodenm1, reptcnts);
  461. // model.makeValue(path + "[" + rowcnt1 + "]/" + nodenm2, reptcnts);
  462. model.refresh();
  463. }
  464. // 날짜 '년,월,일,요일' 출력 함수
  465. function dateModify(rdd){
  466. var year = rdd.substring(0,4) + "년 ";
  467. var month = rdd.substring(4,6) + "월 ";
  468. var day = rdd.substring(6,8) + "일 ";
  469. var day_week = rdd.toDate().getDayOfWeek("K") + "요일";
  470. return year + month + day + day_week;
  471. }
  472. // 조회시 데이터 복사
  473. function fDataCopy(){
  474. var inRef = "/root/main/editlist";
  475. var tmpRef = "/root/temp/copydata";
  476. model.copyNode(tmpRef, inRef);
  477. }
  478. // 조회시의 데이터와 변경 여부 체크 (부분적 I / U 구분)
  479. function fDataCompare(){
  480. var array_nodePath= new Array("patdelist/reptcnts", "patnlist/reptcnts", "situatdelist/reptcnts", "situatnlist/reptcnts", "psn_edu_etclist/reptcnts", "noticlist/reptcnts");
  481. var comFlag = new Array();
  482. var inRef = "/root/main/editlist";
  483. var tmpRef = "/root/temp/copydata";
  484. for(i=0; i<array_nodePath.length; i++){
  485. if(model.getValue(inRef + "/" + array_nodePath[i]) != model.getValue(tmpRef + "/" + array_nodePath[i])){
  486. comFlag[i] = "Changed";
  487. }
  488. else if(model.getValue(inRef + "/" + array_nodePath[i]) == model.getValue(tmpRef + "/" + array_nodePath[i])){
  489. comFlag[i] = "NoChanged";
  490. }
  491. }
  492. return comFlag;
  493. }
  494. // 조회시의 데이터 변경 여부 체크해 팝업 여부 판단
  495. function fMsgBoxFlag(){
  496. var cnt = 0;
  497. comFlag = fDataCompare();
  498. for (i=0; i<comFlag.length; i++){
  499. if(comFlag[i]=="Changed"){
  500. cnt++;
  501. }
  502. }
  503. return cnt;
  504. }
  505. ]]>
  506. </script>
  507. </xhtml:head>
  508. <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; ">
  509. <group id="group1" style="left:0px; top:0px; width:1195px; height:13px; ">
  510. <caption id="caption6" class="tit_1" style="left:0px; top:0px; width:158px; height:14px; ">업무일지 조회 및 수정</caption>
  511. </group>
  512. <group id="group2" style="left:0px; top:13px; width:1195px; height:771px; vertical-align:top; ">
  513. <button id="button1" class="btn_sw" group="tab1" selected="true" style="left:100px; top:58px; width:100px; height:22px; vertical-align:middle; ">
  514. <caption>업무보고(수정)</caption>
  515. <toggle case="case2" ev:event="onclick"/>
  516. <script type="javascript" ev:event="DOMActivate">
  517. <![CDATA[
  518. model.toggle("case2");
  519. unitflg = 2;
  520. ]]>
  521. </script>
  522. </button>
  523. <button id="button19" class="btn_sw" group="tab1" selected="true" style="left:0px; top:58px; width:100px; height:22px; vertical-align:middle; ">
  524. <caption>업무보고(조회)</caption>
  525. <toggle case="case1" ev:event="onclick"/>
  526. <script type="javascript" ev:event="DOMActivate">
  527. <![CDATA[
  528. model.toggle("case1");
  529. unitflg = 1;
  530. // 조회탭 눌렸을때 재조회해 뿌려줌
  531. model.removenode("/root/send");
  532. reptdd = model.getValue("/root/main/cond/reptdd");
  533. model.makeValue("/root/send/reptdd", model.getValue("/root/main/cond/reptdd"));
  534. submit("TRMNB02801");
  535. fsearch_searchlist();
  536. model.refresh();
  537. ]]>
  538. </script>
  539. </button>
  540. <shape id="roundrect1" class="roundrect_search" appearance="roundrect" style="left:0px; top:7px; width:1192px; height:35px; "/>
  541. <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; ">
  542. <script type="javascript" ev:event="xforms-value-changed">
  543. <![CDATA[
  544. var ChangedCnt = fMsgBoxFlag(); // 변경된 여부 체크
  545. // alert("ChangedCnt" + ChangedCnt);
  546. if(ChangedCnt != "0"){ // 변경 사항 발생 시 팝업
  547. var reply = messageBox("저장하지 않은 수정내용이 있을 수 있습니다.","Q003");
  548. }
  549. else{
  550. var reply = "6";
  551. }
  552. if(reply == "6"){
  553. if(unitflg == "1") { // 조회탭 눌렸을 때의 조회
  554. stateSave(); // staiud 상태값 받아오기
  555. // 날짜 변경시에 자동으로 재조회해 뿌려줌
  556. model.removenode("/root/send");
  557. reptdd = model.getValue("/root/main/cond/reptdd");
  558. model.makeValue("/root/send/reptdd", model.getValue("/root/main/cond/reptdd"));
  559. submit("TRMNB02801");
  560. fsearch_searchlist();
  561. submit("TRMNB02802");
  562. fsearch_editedlist();
  563. fDataCopy(); // 저장 후 재조회시의 데이터 재복사
  564. model.refresh();
  565. }
  566. else if(unitflg =="2"){ // 수정탭 눌렸을 때의 조회
  567. stateSave(); // staiud 상태값 받아오기
  568. // 날짜 변경시에 자동으로 재조회해 뿌려줌
  569. model.removenode("/root/send");
  570. reptdd = model.getValue("/root/main/cond/reptdd");
  571. model.makeValue("/root/send/reptdd", model.getValue("/root/main/cond/reptdd"));
  572. submit("TRMNB02802");
  573. fsearch_editedlist();
  574. fDataCopy(); // 저장 후 재조회시의 데이터 재복사
  575. model.refresh();
  576. }
  577. }
  578. else{
  579. model.setValue("/root/main/cond/reptdd", reptdd);
  580. model.refresh();
  581. }
  582. ]]>
  583. </script>
  584. </input>
  585. <caption id="caption8" class="search_name" style="left:5px; top:16px; width:86px; height:17px; ">보고일자 :</caption>
  586. <button id="btn_srch" class="btn1_letter2" navindex="5" style="left:1132px; top:15px; width:56px; height:22px; ">
  587. <caption>조회</caption>
  588. <script type="javascript" ev:event="DOMActivate">
  589. <![CDATA[
  590. /*
  591. 조회탭과 수정탭의 구분에 따라 조회버튼은 다르게 동작되어야..
  592. 조회탭 - 최신의 업무보고 조회결과가 display되어야 함
  593. 수정탭 - 마지막으로 편집/저장했던 결과가 display 되어야함
  594. */
  595. if(unitflg == "1") { // 조회탭 눌렸을 때의 조회
  596. model.removenode("/root/send");
  597. model.makeValue("/root/send/reptdd", model.getValue("/root/main/cond/reptdd"));
  598. submit("TRMNB02801");
  599. fsearch_searchlist();
  600. model.refresh();
  601. }
  602. else if(unitflg =="2"){ // 수정탭 눌렸을 때의 조회
  603. var ChangedCnt = fMsgBoxFlag(); // 변경된 여부 체크
  604. // alert("ChangedCnt: " + ChangedCnt);
  605. if(ChangedCnt != "0"){ // 변경 사항 발생 시 팝업
  606. var reply = messageBox("저장하지 않은 수정내용이 있을 수 있습니다.","Q003");
  607. }
  608. else{
  609. var reply = "6";
  610. }
  611. if(reply == "6"){
  612. model.removenode("/root/send");
  613. model.makeValue("/root/send/reptdd", model.getValue("/root/main/cond/reptdd"));
  614. submit("TRMNB02802");
  615. fsearch_editedlist();
  616. fDataCopy(); // 저장 후 재조회시의 데이터 재복사
  617. model.refresh();
  618. }
  619. else{}
  620. }
  621. ]]>
  622. </script>
  623. </button>
  624. <line id="line5" class="line_4" style="x1:1124px; y1:15px; x2:1124px; y2:37px; "/>
  625. </group>
  626. <switch id="switch1" style="left:0px; top:93px; width:1195px; height:687px; ">
  627. <case id="case1" selected="true">
  628. <caption id="caption1" style="left:110px; top:280px; width:100px; height:20px; ">조회 탭</caption>
  629. <textarea id="textarea5" ref="/root/main/searchlist/deptdelist/reptcnts" scroll="autovscroll" editable="false" style="left:4px; top:25px; width:730px; height:470px; "/>
  630. <caption id="caption2" class="tit_2" style="left:11px; top:6px; width:115px; height:13px; font-size:12pxptpt; ">업무일지(조회)</caption>
  631. <textarea id="textarea6" ref="/root/main/searchlist/deptn_ngdtlist/reptcnts" scroll="autovscroll" editable="false" style="left:738px; top:25px; width:451px; height:470px; "/>
  632. <textarea id="textarea7" ref="/root/main/searchlist/noticlist/reptcnts" scroll="autovscroll" editable="false" style="left:738px; top:500px; width:451px; height:179px; "/>
  633. <textarea id="textarea8" ref="/root/main/searchlist/psn_edu_etclist/reptcnts" scroll="autovscroll" editable="false" style="left:4px; top:500px; width:730px; height:179px; "/>
  634. <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; ">
  635. <col ref="reptcnts" style="left:20px; top:32px; width:100px; height:23px; text-align:left; "/>
  636. <col ref="reptflagcd" style="left:770px; top:32px; width:100px; height:23px; text-align:right; "/>
  637. </datagrid>
  638. </case>
  639. <case id="case2">
  640. <textarea id="textarea1" ref="/root/main/editlist/patdelist/reptcnts" scroll="autovscroll" style="left:4px; top:25px; width:730px; height:292px; "/>
  641. <textarea id="textarea2" ref="/root/main/editlist/patnlist/reptcnts" scroll="autovscroll" style="left:738px; top:25px; width:451px; height:292px; "/>
  642. <textarea id="textarea3" ref="/root/main/editlist/noticlist/reptcnts" scroll="autovscroll" style="left:738px; top:500px; width:451px; height:179px; "/>
  643. <textarea id="textarea4" ref="/root/main/editlist/psn_edu_etclist/reptcnts" scroll="autovscroll" style="left:4px; top:500px; width:730px; height:179px; "/>
  644. <caption id="caption17" class="tit_2" style="left:11px; top:6px; width:115px; height:13px; font-size:12pxptpt; ">업무일지(수정)</caption>
  645. <button id="button10" class="btn2_letter2" style="left:1146px; top:4px; width:42px; height:19px; ">
  646. <caption>출력</caption>
  647. <script type="javascript" ev:event="DOMActivate">
  648. <![CDATA[
  649. var ChangedCnt = fMsgBoxFlag(); // 변경된 여부 체크
  650. // alert("ChangedCnt: " + ChangedCnt);
  651. if(ChangedCnt != "0"){ // 변경 사항 발생 시 팝업
  652. var reply = messageBox("저장하지 않은 수정내용이 있을 수 있습니다.","Q003");
  653. }
  654. else{
  655. var reply = "6";
  656. }
  657. if(reply == "6"){
  658. fprintData();
  659. }
  660. else{}
  661. ]]>
  662. </script>
  663. </button>
  664. <button id="button23" class="btn5_letter3" style="left:1045px; top:4px; width:53px; height:19px; ">
  665. <caption>초기화</caption>
  666. <script type="javascript" ev:event="DOMActivate">
  667. <![CDATA[
  668. var reply = messageBox("", "Q010" );
  669. if(reply == "6"){
  670. model.removenode("/root/send");
  671. model.makeValue("/root/send/reptdd", model.getValue("/root/main/cond/reptdd"));
  672. submit("TRMNB02801");
  673. fsearch_editlist();
  674. model.refresh();
  675. }
  676. else{}
  677. ]]>
  678. </script>
  679. </button>
  680. <button id="button5" class="btn5_letter2" style="left:1101px; top:4px; width:42px; height:19px; ">
  681. <caption>저장</caption>
  682. <script type="javascript" ev:event="DOMActivate">
  683. <![CDATA[
  684. comFlag = fDataCompare(); // 조회시의 데이터와 변경 여부 체크 (Changed / UnChanged)
  685. userid = getUserId() ;
  686. recdeptcd = dutplcecd; // 세션에서 부서정보 받아 처리
  687. // 보고일자 시점으로 저장하기 (기록일시는 현재 시점)
  688. model.removenode("/root/send");
  689. reptdd = model.getValue("/root/main/cond/reptdd");
  690. recdt = getCurrentDate()+getCurrentTime().substring(0,4);
  691. stateSave(); // staiud 상태값 받아오기 (I / U)
  692. fsave_editedlist(comFlag); // 저장
  693. //model.refresh();
  694. ]]>
  695. </script>
  696. </button>
  697. <textarea id="textarea9" ref="/root/main/editlist/situatdelist/reptcnts" scroll="autovscroll" style="left:4px; top:316px; width:730px; height:179px; "/>
  698. <textarea id="textarea10" ref="/root/main/editlist/situatnlist/reptcnts" scroll="autovscroll" style="left:738px; top:316px; width:451px; height:179px; "/>
  699. <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; ">
  700. <col ref="reptcnts"/>
  701. <col ref="reptflagcd"/>
  702. <col ref="seqno"/>
  703. </datagrid>
  704. </case>
  705. </switch>
  706. </xhtml:body>
  707. </xhtml:html>