SPMMP03400_CPG문진등록.xrw 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628
  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>CPG 문진</xhtml:title>
  6. <model id="model1">
  7. <instance id="instance1">
  8. <root xmlns="">
  9. <main>
  10. <inqrinfo/>
  11. <selectedinfo>
  12. <inqrno/>
  13. <qestno/>
  14. <answno/>
  15. <status/>
  16. </selectedinfo>
  17. </main>
  18. <send/>
  19. <temp>
  20. <fFocusAnsw/>
  21. <fSetAnsw/>
  22. <fSetEssPrcpAnsw/>
  23. </temp>
  24. </root>
  25. </instance>
  26. <script type="javascript" ev:event="xforms-model-construct-done">
  27. <![CDATA[
  28. grd_inqr.mergeCol(2) = false;
  29. grd_inqr.mergeCol(3) = false;
  30. grd_inqr.mergeCol(4) = false;
  31. model.makeNode("/root/send/reqdata");
  32. lastcallyn = opener.javascript.getParameter("SMMMO034_lastcallyn");
  33. cpgappno = opener.javascript.getParameter("SMMMO034_cpgappno");
  34. inqrno = opener.javascript.getParameter("SMMMO034_inqrno");
  35. inqrhistno = opener.javascript.getParameter("SMMMO034_inqrhistno");
  36. inqrnm = opener.javascript.getParameter("SMMMO034_inqrnm");
  37. inqrflag = opener.javascript.getParameter("SMMMO034_inqrflag");
  38. steplistno = opener.javascript.getParameter("SMMMO034_steplistno");
  39. if(!isNull(steplistno)){
  40. steplistno = steplistno.setReplaceWord("|",",");
  41. }
  42. model.makeValue("/root/send/reqdata/lastcallyn" , lastcallyn);
  43. model.makeValue("/root/send/reqdata/cpgappno" , cpgappno);
  44. model.makeValue("/root/send/reqdata/cpgno" , opener.javascript.getParameter("SMMMO034_cpgno"));
  45. model.makeValue("/root/send/reqdata/cpghistseq" , opener.javascript.getParameter("SMMMO034_cpghistseq"));
  46. model.makeValue("/root/send/reqdata/pid" , opener.javascript.getParameter("SMMMO034_pid"));
  47. model.makeValue("/root/send/reqdata/cretno" , opener.javascript.getParameter("SMMMO034_cretno"));
  48. model.makeValue("/root/send/reqdata/orddd" , opener.javascript.getParameter("SMMMO034_orddd"));
  49. model.makeValue("/root/send/reqdata/ordtype" , opener.javascript.getParameter("SMMMO034_ordtype"));
  50. model.makeValue("/root/send/reqdata/appyn" , opener.javascript.getParameter("SMMMO034_appyn"));
  51. model.makeValue("/root/send/reqdata/inqrno" , inqrno);
  52. model.makeValue("/root/send/reqdata/inqrhistno" , inqrhistno);
  53. model.makeValue("/root/send/reqdata/inqrnm" , inqrnm);
  54. model.makeValue("/root/send/reqdata/inqrflag" , inqrflag); //미시행사유 입력용
  55. model.makeValue("/root/send/reqdata/steplistno" , steplistno); //조회 할 스텝 리스트
  56. if( cpgappno != "" ) model.makeValue("/root/send/reqdata/histjoinyn", "Y");
  57. if( cpgappno != "" ) model.makeValue("/root/send/reqdata/pntmflag", opener.javascript.getParameter("SMMMO034_pntmflag"));
  58. /*
  59. model.makeValue("/root/send/reqdata/cpgno", "501");
  60. model.makeValue("/root/send/reqdata/cpghistseq", "16");
  61. model.makeValue("/root/send/reqdata/pid", "1530137");
  62. model.makeValue("/root/send/reqdata/cretno", "800339942");
  63. model.makeValue("/root/send/reqdata/orddd", "20071227");
  64. model.makeValue("/root/send/reqdata/ordtype", "I");
  65. model.makeValue("/root/send/reqdata/inqrflag", "R"); //미시행사유 입력용 (SMMMO034_inqrflag)
  66. */
  67. submit("TRMMP03401", false);
  68. var inqrList = instance1.selectNodes("/root/main/inqrinfo/answlist[answno='0']");
  69. if(inqrList.length <= 0){
  70. btn_cnfm.disabled = true;
  71. }else{
  72. fCreateControl(); //문진표 생성
  73. }
  74. ]]>
  75. </script>
  76. <submission id="TRMMP03401" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send/reqdata" resultref="/root/main/inqrinfo"/>
  77. <submission id="TXMMP03401" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send/savedata" resultref="/root/temp"/>
  78. </model>
  79. <script type="javascript" src="../../../com/commonweb/js/common.js"/>
  80. <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
  81. <script type="javascript" src="../../../com/commonweb/js/stringHelper.js"/>
  82. <script type="javascript">
  83. <![CDATA[
  84. var lastcallyn = "";
  85. var cpgappno = "";
  86. var cpgno = "";
  87. var cpghistseq = "";
  88. var cpgappno = "";
  89. var stepno = "";
  90. var inqrstatcd = "";
  91. var inqroffyn = "";
  92. var inqranswdd = "";
  93. var inqrflag = "";
  94. var inqrno = "";
  95. var inqrhistno = "";
  96. var inqrnm = "";
  97. var steplistno = "";
  98. var pntmflag = "";
  99. /**
  100. * @group :
  101. * @ver : 2009.05
  102. * @by : 전지은
  103. * @---------------------------------------------------
  104. * @type : function
  105. * @access : public
  106. * @desc : 문진표 생성
  107. * @param :
  108. * @return :
  109. * @---------------------------------------------------
  110. */
  111. function fCreateControl() {
  112. var ctrl = null;
  113. var ctrlType = "";
  114. var ctrlCnt = 0;
  115. var ctrlID = "";
  116. var wd = 0;
  117. var ht = 23;
  118. var topPos = 0;
  119. var iNode = null;
  120. var jNode = null;
  121. var nodeIdx = 0;
  122. var nodeIdx_q = 0;
  123. var ref = "/root/main/inqrinfo/answlist";
  124. var inqrList = instance1.selectNodes("/root/main/inqrinfo/answlist[answno='0']"); //질문 instance만 대상
  125. var titleNo = "0"; //문진 제목 번호
  126. var titleHistNo = "0"; //문진 제목 번호
  127. var titleStepNo = "0";
  128. if( inqrList.length <= 0 ) return;
  129. for(var i=0; i<inqrList.length; i++){
  130. iNode = inqrList.item(i);
  131. // 1. 문진정보
  132. var vInqrno = iNode.selectSingleNode("inqrno");
  133. var vInqrnm = iNode.selectSingleNode("inqrnm");
  134. var vInqrhistno = iNode.selectSingleNode("inqrhistno");
  135. var vStepNo = iNode.selectSingleNode("stepno");
  136. if( vInqrno.text != titleNo ){ //|| (vInqrno.text = "9999999999" && titleStepNo != vStepNo.text)
  137. ctrlType = "xforms:caption";
  138. ctrlCnt++;
  139. ctrlID = ctrlType + ctrlCnt;
  140. if( i > 0 ) topPos = topPos + 15;
  141. ht = 23;
  142. ctrl = grp_inqr.createChild(ctrlType, "id:" + ctrlID + ";left:" + 10 + "px; top:" + topPos + "px; width:" + 560 + " px; height:" + ht + "px; font-size:10pt; color:#000000; font-weight:bolder;");
  143. ctrl.attribute("text") = vInqrnm.text;
  144. ctrl.attribute("border-style") = "solid";
  145. ctrl.attribute("autoresize") = true;
  146. topPos = topPos + ht + 5;
  147. //nodeIdx++;
  148. titleNo = vInqrno.text;
  149. titleHistNo = vInqrhistno.text
  150. titleStepNo = vStepNo.text;
  151. }
  152. // 2. 질문
  153. var qestno = iNode.selectSingleNode("qestno");
  154. var qestcnts = iNode.selectSingleNode("qestcnts");
  155. var qestlen = parseInt(iNode.selectSingleNode("qestlen").text);
  156. var qestlines = 0;
  157. var answno = iNode.selectSingleNode("answno");
  158. var answflag = iNode.selectSingleNode("answflag"); //1:다중, 2:단일, 3:입력
  159. var answexistyn = iNode.selectSingleNode("answexistyn");
  160. ht = 23;
  161. wd = 550;
  162. if( qestlen >= 50 ){
  163. qestlines = qestlen / 50;
  164. qestlines = Math.ceil(qestlines * Math.pow(10, -1*(-1)-1)) / Math.pow(10, -1*(-1)-1);
  165. if( qestlen > qestlines * 50 ) qestlines++;
  166. }else qestlines = 1;
  167. ctrlType = "xforms:caption";
  168. ctrlCnt++;
  169. ctrlID = ctrlType + ctrlCnt;
  170. ctrl = grp_inqr.createChild(ctrlType, "id:" + ctrlID + ";left:" + 10 + "px; top:" + topPos + "px; width:" + wd + " px; height:" + (ht*qestlines) + "px; font-size:10pt; color:#000000; font-weight:bolder;");
  171. ctrl.attribute("text") = qestcnts.text;
  172. topPos = topPos + (ht*qestlines); // + 5
  173. nodeIdx++;
  174. nodeIdx_q = nodeIdx;
  175. // 3. 답안
  176. var answList = instance1.selectNodes("/root/main/inqrinfo/answlist[inqrno='"+vInqrno.text+"' and inqrhistno='"+vInqrhistno.text+"' and qestno='"+qestno.text+"' and answno!='0']");
  177. if( answList.length > 0 ){
  178. //답안존재여부 instance 추가 (2010.05.29 JJE)
  179. model.setValue(answexistyn, "Y");
  180. wd = 540;
  181. if( answflag.text == "1" ){ //라디오
  182. ht = 16;
  183. ctrlType = "xforms:select1";
  184. ctrlCnt++;
  185. ctrlID = ctrlType + ctrlCnt;
  186. ctrl = grp_inqr.createChild(ctrlType, "id:" + ctrlID + "; overflow:visible; appearance:full; cursor:pointer; cols:1; left:" + 20 + "px; top:" + topPos + "px; width:" + wd + " px; height:" + 0 + "px; ");
  187. ctrl.attribute("ref") = ref + "[" + nodeIdx_q + "]/answrslt";
  188. var choices = ctrl.createChild("xforms:choices", "");
  189. var itemlines = 0;
  190. var answlines = 0;
  191. for(var j=0; j<answList.length; j++){
  192. jNode = answList.item(j);
  193. var answno = jNode.selectSingleNode("answno");
  194. var answcnts = jNode.selectSingleNode("answcnts").text;
  195. var etcanswcnts = jNode.selectSingleNode("etcanswcnts").text;
  196. var answlen = parseInt(jNode.selectSingleNode("answlen").text);
  197. var itemset = choices.createChild("xforms:item", "");
  198. itemset.createChild("xforms:label", "text:"+answcnts+";");
  199. itemset.createChild("xforms:value", "text:"+answno.text+";");
  200. if( answlen > 60 ){
  201. itemlines = answlen / 61;
  202. itemlines = Math.ceil(itemlines * Math.pow(10, -1*(-1)-1)) / Math.pow(10, -1*(-1)-1);
  203. if( answlen > itemlines * 60 ) itemlines++;
  204. }else itemlines = 1;
  205. answlines = answlines + itemlines;
  206. nodeIdx++;
  207. if( model.getValue(ref + "[" + nodeIdx + "]/answstatcd") == "Y" ){
  208. if( model.getValue(ref + "[" + nodeIdx_q + "]/answrslt") != "" )
  209. model.setValue( ref + "[" + nodeIdx_q + "]/answrslt", model.getValue(ref + "[" + nodeIdx_q + "]/answrslt") + "▦");
  210. model.setValue( ref + "[" + nodeIdx_q + "]/answrslt", model.getValue(ref + "[" + nodeIdx_q + "]/answrslt") + model.getValue(ref + "[" + nodeIdx + "]/answno"));
  211. model.setValue( ref + "[" + nodeIdx_q + "]/organswrslt", model.getValue(ref + "[" + nodeIdx_q + "]/answrslt") + model.getValue(ref + "[" + nodeIdx + "]/answno"));
  212. }
  213. }
  214. ctrl.attribute("height") = ht * answlines;
  215. topPos = topPos + (ht * answlines) ;
  216. //기타상세입력
  217. if( answno.text == "99999" ){
  218. ctrlType = "xforms:input";
  219. ctrlCnt++;
  220. ctrlID = ctrlType + ctrlCnt;
  221. ctrl = grp_inqr.createChild(ctrlType, "id:" + ctrlID + "; left:" + 35 + "px; top:" + topPos + "px; width:" + (wd-10) + " px; height:" + 19 + "px; ");
  222. //nodeIdx++;
  223. ctrl.attribute("text") = etcanswcnts;
  224. ctrl.attribute("ref") = ref + "[" + nodeIdx + "]/etcanswcnts";
  225. topPos = topPos + 19;
  226. }
  227. topPos = topPos + 15;
  228. }else if( answflag.text == "2" ){ //체크박스
  229. ht = 16;
  230. ctrlType = "xforms:select";
  231. ctrlCnt++;
  232. ctrlID = ctrlType + ctrlCnt;
  233. ctrl = grp_inqr.createChild(ctrlType, "id:" + ctrlID + " overflow:visible; appearance:full; cursor:pointer; cols:1; left:" + 20 + "px; top:" + topPos + "px; width:" + wd + " px; height:" + 0 + "px; ");
  234. ctrl.attribute("ref") = ref + "[" + nodeIdx_q + "]/answrslt";
  235. ctrl.attribute("sep") = "▦";
  236. //ctrl.attribute("border-style") = "solid";
  237. var choices = ctrl.createChild("xforms:choices", "");
  238. var itemlines = 0;
  239. var answlines = 0;
  240. for(var j=0; j<answList.length; j++){
  241. jNode = answList.item(j);
  242. var answno = jNode.selectSingleNode("answno");
  243. var answcnts = jNode.selectSingleNode("answcnts").text;
  244. var etcanswcnts = jNode.selectSingleNode("etcanswcnts").text;
  245. var answlen = parseInt(jNode.selectSingleNode("answlen").text);
  246. var itemset = choices.createChild("xforms:item", "");
  247. itemset.createChild("xforms:label", "text:"+answcnts+";");
  248. itemset.createChild("xforms:value", "text:"+answno.text+";");
  249. if( answlen > 60 ){
  250. itemlines = answlen / 61;
  251. itemlines = Math.ceil(itemlines * Math.pow(10, -1*(-1)-1)) / Math.pow(10, -1*(-1)-1);
  252. if( answlen > itemlines * 60 ) itemlines++;
  253. }else itemlines = 1;
  254. answlines = answlines + itemlines;
  255. nodeIdx++;
  256. if( model.getValue(ref + "[" + nodeIdx + "]/answstatcd") == "Y" ){
  257. if( model.getValue(ref + "[" + nodeIdx_q + "]/answrslt") != "" )
  258. model.setValue( ref + "[" + nodeIdx_q + "]/answrslt", model.getValue(ref + "[" + nodeIdx_q + "]/answrslt") + "▦");
  259. model.setValue( ref + "[" + nodeIdx_q + "]/answrslt", model.getValue(ref + "[" + nodeIdx_q + "]/answrslt") + model.getValue(ref + "[" + nodeIdx + "]/answno"));
  260. model.setValue( ref + "[" + nodeIdx_q + "]/organswrslt", model.getValue(ref + "[" + nodeIdx_q + "]/answrslt") + model.getValue(ref + "[" + nodeIdx + "]/answno"));
  261. }
  262. }
  263. ctrl.attribute("height") = ht * answlines;
  264. topPos = topPos + (ht * answlines) ;
  265. //기타상세입력
  266. if( answno.text == "99999" ){
  267. ctrlType = "xforms:input";
  268. ctrlCnt++;
  269. ctrlID = ctrlType + ctrlCnt;
  270. ctrl = grp_inqr.createChild(ctrlType, "id:" + ctrlID + "; left:" + 35 + "px; top:" + topPos + "px; width:" + (wd-10) + " px; height:" + 19 + "px; ");
  271. //nodeIdx++;
  272. ctrl.attribute("text") = etcanswcnts;
  273. ctrl.attribute("ref") = ref + "[" + nodeIdx + "]/etcanswcnts";
  274. topPos = topPos + 19;
  275. }
  276. topPos = topPos + 15;
  277. }else if( answflag.text == "3" ){
  278. ht = 19;
  279. ctrlType = "xforms:textarea";
  280. ctrlCnt++;
  281. ctrlID = ctrlType + ctrlCnt;
  282. ctrl = grp_inqr.createChild(ctrlType, "id:" + ctrlID + "; left:" + 20 + "px; top:" + topPos + "px; width:" + wd + " px; height:" + 32 + "px; ");
  283. nodeIdx++;
  284. ctrl.attribute("text") = etcanswcnts;
  285. ctrl.attribute("ref") = ref + "[" + nodeIdx_q + "]/answrslt";
  286. topPos = topPos + 32 + 15;
  287. if( model.getValue(ref + "[" + nodeIdx + "]/answstatcd") == "Y" ){
  288. model.setValue( ref + "[" + nodeIdx_q + "]/answrslt", model.getValue(ref + "[" + nodeIdx_q + "]/answrslt") + model.getValue(ref + "[" + nodeIdx + "]/etcanswcnts"));
  289. model.setValue( ref + "[" + nodeIdx_q + "]/organswrslt", model.getValue(ref + "[" + nodeIdx_q + "]/answrslt") + model.getValue(ref + "[" + nodeIdx + "]/etcanswcnts"));
  290. }
  291. }
  292. }
  293. }
  294. //문진 구성 후, 하단에 공간 생성
  295. topPos = topPos + 10;
  296. ctrlType = "xforms:caption";
  297. ctrlCnt++;
  298. ctrlID = ctrlType + ctrlCnt;
  299. ht = 23;
  300. ctrl = grp_inqr.createChild(ctrlType, "id:" + ctrlID + ";left:" + 10 + "px; top:" + topPos + "px; width:" + 560 + " px; height:" + ht + "px; font-size:10pt; color:#000000; font-weight:bolder;");
  301. grp_inqr.refresh();
  302. }
  303. /**
  304. * @group :
  305. * @ver : 2010.04
  306. * @by : 전지은
  307. * @---------------------------------------------------
  308. * @type : function
  309. * @access : public
  310. * @desc : 각 답안정보 포커스IN 될 때 답안정보를 별도의 Instance에 setValue
  311. * @param :
  312. * @return :
  313. * @---------------------------------------------------
  314. */
  315. function fFocusAnsw(){
  316. }
  317. /**
  318. * @group :
  319. * @ver : 2010.04
  320. * @by : 전지은
  321. * @---------------------------------------------------
  322. * @type : function
  323. * @access : public
  324. * @desc : 각 답안정보 컨트롤에 value-change 이벤트 동적 생성
  325. * @param :
  326. * @return :
  327. * @---------------------------------------------------
  328. */
  329. function fSetAnsw(){
  330. }
  331. function fSetEssPrcpAnsw(){
  332. }
  333. /**
  334. * @group :
  335. * @ver : 2010.01
  336. * @by : 전지은
  337. * @---------------------------------------------------
  338. * @type : function
  339. * @access : public
  340. * @desc : 각 답안정보 저장
  341. * @param :
  342. * @return :
  343. * @---------------------------------------------------
  344. */
  345. function fSaveInqrAnswList(){
  346. var saveRef = "/root/send/savedata/savelist";
  347. var answflag = "";
  348. var cpgappno = "";
  349. var inqrno = "";
  350. var inqrhistno = "";
  351. var qestno = "";
  352. var answcnts = "";
  353. var etcanswcnts = "";
  354. var answrslt = "";
  355. var stepno = "";
  356. var pntmflag = "";
  357. var inqrflag = "";
  358. var qestcnts = "";
  359. var orgAnswCnts = "";
  360. var orgEtcAnswCnts = "";
  361. var orgAnswrslt = "";
  362. var cngAnswCnts = "";
  363. var cngEtcAnswCnts = "";
  364. var cngAnswrslt = "";
  365. var limno = "";
  366. var limhistno = "";
  367. var limcdno = "";
  368. var setattrno = "";
  369. var setattrhistno = "";
  370. var statusNode = "";
  371. var rowNum = 0;
  372. var answnoNode = null;
  373. var answCnt = null;
  374. var allList = instance1.selectNodes("/root/main/inqrinfo/answlist[answno='0']"); //모든 질문 리스트
  375. var inqrList = instance1.selectNodes("/root/main/inqrinfo/answlist[answno='0' and answexistyn='Y']"); //답안 작성해야하는 질문 리스트
  376. var answList = instance1.selectNodes("/root/main/inqrinfo/answlist[answno='0' and answexistyn='Y' and answrslt!='']"); //답안 수정이 일어난 질문 리스트
  377. if( allList.length <= 0 ){
  378. messageBox ( "저장할 데이터가" , "I004" ); //없습니다.
  379. return;
  380. }
  381. if(inqrList.length > answList.length ){
  382. messageBox ( "입력하지 않은 항목이 존재하여 저장할 수" , "I004" ); //없습니다.
  383. return;
  384. }
  385. model.removeNodeset(saveRef);
  386. model.makeNode("/root/send/savedata");
  387. for( var i=0; i<inqrList.length; i++ ){ //질문 리스트만큼 loop
  388. answnoNode = null;
  389. answCnt = null;
  390. var node = inqrList.item(i);
  391. answflag = node.selectSingleNode("answflag").text;
  392. cpgappno = node.selectSingleNode("cpgappno").text;
  393. inqrno = node.selectSingleNode("inqrno").text;
  394. inqrhistno = node.selectSingleNode("inqrhistno").text;
  395. qestno = node.selectSingleNode("qestno").text;
  396. answcnts = node.selectSingleNode("answcnts").text;
  397. etcanswcnts = node.selectSingleNode("etcanswcnts").text;
  398. qestcnts = node.selectSingleNode("qestcnts").text;
  399. //질문 키
  400. stepno = node.selectSingleNode("stepno").text;
  401. pntmflag = node.selectSingleNode("pntmflag").text;
  402. inqrflag = node.selectSingleNode("inqrflag").text;
  403. statusNode = node.selectSingleNode("status");
  404. // 원래 답안
  405. orgAnswrslt = node.selectSingleNode("organswrslt").text;
  406. orgAnswCnts = node.selectSingleNode("organswcnts").text;
  407. orgEtcAnswCnts = node.selectSingleNode("orgetcanswcnts").text;
  408. // 저장할 답안
  409. answrslt = node.selectSingleNode("answrslt").text;
  410. cngAnswCnts = node.selectSingleNode("answcnts").text;
  411. cngEtcAnswCnts = node.selectSingleNode("etcanswcnts").text;
  412. //필수처방 미발행 사유
  413. limno = node.selectSingleNode("limno").text;
  414. limhistno = node.selectSingleNode("limhistno").text;
  415. limcdno = node.selectSingleNode("limcdno").text;
  416. setattrno = node.selectSingleNode("setattrno").text;
  417. setattrhistno = node.selectSingleNode("setattrhistno").text;
  418. //답안 변경사항이 없으면 그냥 skip
  419. if( answrslt!='' || orgAnswrslt != cngAnswrslt || orgAnswCnts != cngAnswCnts || orgEtcAnswCnts != cngEtcAnswCnts ){
  420. model.setValue(statusNode, "U");
  421. }else{
  422. continue; //변경사항 없다면 다시 저장하지 않는다
  423. }
  424. //(1) 직접 입력형태 답안
  425. if( answflag == "3" ){
  426. rowNum++;
  427. //if( answnoNode == null ) answnoNode = instance1.selectSingleNode("/root/main/inqrinfo/answlist[answrslt='"+answrslt+"' and answno!='0']/answno");
  428. answnoNode = instance1.selectSingleNode("/root/main/inqrinfo/answlist[inqrno='"+inqrno+"' and inqrhistno='"+inqrhistno+"' and qestno='"+qestno+"' and answno!='0' and qestcnts='"+qestcnts+"']/answno");
  429. model.makeValue(saveRef + "[" + rowNum + "]/cpgappno" , cpgappno);
  430. model.makeValue(saveRef + "[" + rowNum + "]/inqrno" , inqrno);
  431. model.makeValue(saveRef + "[" + rowNum + "]/inqrhistno" , inqrhistno);
  432. model.makeValue(saveRef + "[" + rowNum + "]/qestno" , qestno);
  433. model.makeValue(saveRef + "[" + rowNum + "]/answstatcd" , "Y");
  434. model.makeValue(saveRef + "[" + rowNum + "]/answno" , answnoNode.text);
  435. model.makeValue(saveRef + "[" + rowNum + "]/answcnts" , answrslt);
  436. model.makeValue(saveRef + "[" + rowNum + "]/answflag" , answflag);
  437. model.makeValue(saveRef + "[" + rowNum + "]/stepno" , stepno);
  438. model.makeValue(saveRef + "[" + rowNum + "]/pntmflag" , pntmflag);
  439. model.makeValue(saveRef + "[" + rowNum + "]/inqrflag" , inqrflag);
  440. model.makeValue(saveRef + "[" + rowNum + "]/limno" , limno);
  441. model.makeValue(saveRef + "[" + rowNum + "]/limhistno" , limhistno);
  442. model.makeValue(saveRef + "[" + rowNum + "]/limcdno" , limcdno);
  443. model.makeValue(saveRef + "[" + rowNum + "]/setattrno" , setattrno);
  444. model.makeValue(saveRef + "[" + rowNum + "]/setattrhistno" , setattrhistno);
  445. }
  446. //(2) 선택 답안 (단일/다중/기타)
  447. else{
  448. answCnt = answrslt.split("▦"); //개수? 배열?
  449. answnoNode = instance1.selectNodes("/root/main/inqrinfo/answlist[inqrno='"+inqrno+"' and inqrhistno='"+inqrhistno+"' and qestno='"+qestno+"' and answno!='0']"); //답안 전체
  450. if( answnoNode.length > 0 ){ //if( answCnt.length > 0 ){
  451. for( var j=0; j<answnoNode.length; j++ ){ //for( var j=0; j<answCnt; j++ ){
  452. rowNum++;
  453. var jAnswnoNode = null;
  454. var jAnswcntsNode = null;
  455. var jLimnoNode = null;
  456. var jSetattrnoNode = null;
  457. var jAnswstatcd = "N";
  458. var aNode = answnoNode.item(j);
  459. //답안내용 설정 (기타이면 입력내용으로, 그렇지 않으면 보기내용으로)
  460. jAnswnoNode = aNode.selectSingleNode("answno");
  461. jLimnoNode = aNode.selectSingleNode("limno");
  462. jSetattrnoNode = aNode.selectSingleNode("setattrno");
  463. if( !isNull(jLimnoNode.text) || !isNull(jSetattrnoNode.text) ) //if( answCnt[j] == "99999" )
  464. jAnswcntsNode = aNode.selectSingleNode("etcanswcnts"); //answnoNode = instance1.selectSingleNode("/root/main/inqrinfo/answlist[inqrno='"+inqrno+"' and inqrhistno='"+inqrhistno+"' and qestno='"+qestno+"' and answno='"+answCnt[j]+"']/etcanswcnts"); //입력내용
  465. else
  466. jAnswcntsNode = aNode.selectSingleNode("answcnts"); //answnoNode = instance1.selectSingleNode("/root/main/inqrinfo/answlist[inqrno='"+inqrno+"' and inqrhistno='"+inqrhistno+"' and qestno='"+qestno+"' and answno='"+answCnt[j]+"']/answcnts"); //보기내용
  467. //선택여부 설정 (선택값 리스트와 비교하여 Y/N 따져줌)
  468. if( answCnt.length > 0 ){
  469. for( var K=0; K<answCnt.length; K++ ){
  470. if( answCnt[K] == jAnswnoNode.text ){
  471. jAnswstatcd = "Y";
  472. break;
  473. }
  474. }
  475. }
  476. model.makeValue(saveRef + "[" + rowNum + "]/cpgappno" , cpgappno);
  477. model.makeValue(saveRef + "[" + rowNum + "]/inqrno" , inqrno);
  478. model.makeValue(saveRef + "[" + rowNum + "]/inqrhistno" , inqrhistno);
  479. model.makeValue(saveRef + "[" + rowNum + "]/qestno" , qestno);
  480. model.makeValue(saveRef + "[" + rowNum + "]/answstatcd" , jAnswstatcd); //"Y"
  481. model.makeValue(saveRef + "[" + rowNum + "]/answno" , jAnswnoNode.text ); //answCnt[j]
  482. model.makeValue(saveRef + "[" + rowNum + "]/answcnts" , jAnswcntsNode.text); //answnoNode.text
  483. model.makeValue(saveRef + "[" + rowNum + "]/answflag" , answflag);
  484. model.makeValue(saveRef + "[" + rowNum + "]/stepno" , stepno);
  485. model.makeValue(saveRef + "[" + rowNum + "]/pntmflag" , pntmflag);
  486. model.makeValue(saveRef + "[" + rowNum + "]/inqrflag" , inqrflag);
  487. model.makeValue(saveRef + "[" + rowNum + "]/limno" , limno);
  488. model.makeValue(saveRef + "[" + rowNum + "]/limhistno" , limhistno);
  489. model.makeValue(saveRef + "[" + rowNum + "]/limcdno" , limcdno);
  490. model.makeValue(saveRef + "[" + rowNum + "]/setattrno" , setattrno);
  491. model.makeValue(saveRef + "[" + rowNum + "]/setattrhistno" , setattrhistno);
  492. } //end for (answnoNode)
  493. }
  494. }
  495. } //end for
  496. rowNum++;
  497. model.makeValue("/root/send/savedata/info/lastcallyn", model.getValue("/root/send/reqdata/lastcallyn"));
  498. if( instance1.selectNodes(saveRef).length > 0 ){
  499. if( submit("TXMMP03401", false) ){
  500. var mainObj = getMainViewer();
  501. curCpObj = mainObj.javascript.getOpenWindow("SMMMP00800"); //활성화된 CP Main 화면 object loading
  502. if(curCpObj != null) opener.window.javascript.fGetInqrList();
  503. window.close();
  504. }
  505. }
  506. else window.close();
  507. }
  508. ]]>
  509. </script>
  510. </xhtml:head>
  511. <xhtml:body pagewidth="597" pageheight="739" style="margin:0; ">
  512. <group id="group_biz" style="left:0px; top:10px; width:596px; height:685px; ">
  513. <switch id="switch1" style="left:0px; top:0px; width:595px; height:684px; ">
  514. <case id="grd">
  515. <datagrid id="grd_inqr" nodeset="/root/main/monitoringlist/info" autoresize="true" caption="스텝명^문진명^질문^답안 속성^^답안" colsep="^" colwidth="74, 95, 223, 5, 25, 158" mergecells="bycol" rowsep="|" style="left:0px; top:4px; width:593px; height:673px; ">
  516. <col ref="stepnm"/>
  517. <col ref="inqrnm"/>
  518. <col ref="qestcnts"/>
  519. <col disabled="true" ref="answflag" type="combo" visibility="hidden">
  520. <choices>
  521. <itemset nodeset="M0518">
  522. <label/>
  523. <value/>
  524. </itemset>
  525. </choices>
  526. </col>
  527. <col checkvalue="Y,N" ref="checkyn" type="checkbox"/>
  528. <col ref="answcnts" type="input"/>
  529. </datagrid>
  530. </case>
  531. <case id="grp" selected="true">
  532. <group id="grp_inqr" style="left:0px; top:5px; width:590px; height:675px; "/>
  533. </case>
  534. </switch>
  535. <line id="line_top" class="line_1" style="x1:0px; y1:0px; x2:593px; y2:0px; "/>
  536. <line id="line_bottom" class="line_3" style="x1:0px; y1:680px; x2:593px; y2:680px; "/>
  537. </group>
  538. <caption id="cap_inqr" class="tit_2" visibility="hidden" style="left:5px; top:1px; width:121px; height:14px; ">문진 입력</caption>
  539. <button id="btn_cnfm" class="btn4_letter2" style="left:477px; top:705px; width:56px; height:22px; ">
  540. <caption>확인</caption>
  541. <script type="javascript" ev:event="DOMActivate">
  542. <![CDATA[
  543. fSaveInqrAnswList();
  544. ]]>
  545. </script>
  546. </button>
  547. <button id="btn_cncl" class="btn4_letter2" style="left:535px; top:705px; width:56px; height:22px; ">
  548. <caption>취소</caption>
  549. <script type="javascript" ev:event="DOMActivate">
  550. <![CDATA[
  551. /*
  552. if( inqrflag == "R" ){
  553. messageBox ( "필수 입력 문진입니다. 문진 항목을" , "C001" ); //입력하십시오
  554. return;
  555. }
  556. */
  557. window.close();
  558. ]]>
  559. </script>
  560. </button>
  561. </xhtml:body>
  562. </xhtml:html>