SMMNR02300_약물계산기.xrw 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <?xml version="1.0" encoding="EUC-KR"?>
  2. <?xml-stylesheet href="../../../com/commonweb/css/common.css" type="text/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. <iteminfo>
  11. <itemlist>
  12. <itemnm/>
  13. <desccnts/>
  14. <itemcd/>
  15. <calform/>
  16. <supcd/>
  17. </itemlist>
  18. </iteminfo>
  19. <elmtinfo>
  20. <elmtlist>
  21. <itemnm/>
  22. <desccnts/>
  23. <itemval/>
  24. <itemcd/>
  25. <supcd/>
  26. </elmtlist>
  27. </elmtinfo>
  28. <srchinfo>
  29. <itemcalform/>
  30. <rsltval/>
  31. </srchinfo>
  32. </main>
  33. <send/>
  34. </root>
  35. </instance>
  36. <submission id="TRMNR02301" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" replace="instance" resultref="/root/main/iteminfo"/>
  37. <script type="javascript" ev:event="xforms-ready">
  38. <![CDATA[
  39. model.makeValue("/root/send/supcd", "*");
  40. submit("TRMNR02301");
  41. ]]>
  42. </script>
  43. <submission id="TRMNR02302" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" replace="instance" resultref="/root/main/elmtinfo"/>
  44. </model>
  45. <script type="javascript" src="../../../com/commonweb/js/common.js"/>
  46. <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
  47. </xhtml:head>
  48. <xhtml:body guideline="1,1195;" style="margin-left:8; margin-top:0; margin-right:8; margin-bottom:0; ">
  49. <group id="group1" style="left:0px; top:0px; width:1195px; height:13px; ">
  50. <caption id="caption6" class="tit_1" style="left:0px; top:0px; width:160px; height:14px; ">약물계산기</caption>
  51. </group>
  52. <group id="grp_btn" scroll="auto" style="left:0px; top:757px; width:1195px; height:27px; "/>
  53. <group id="group5" scroll="auto" style="left:0px; top:13px; width:1195px; height:742px; ">
  54. <caption id="caption42" class="tit_2" style="left:5px; top:10px; width:170px; height:14px; ">계산항목 리스트</caption>
  55. <line id="line18" class="line_1" style="x1:0px; y1:25px; x2:616px; y2:25px; "/>
  56. <caption id="caption1" class="tit_2" style="left:625px; top:10px; width:157px; height:14px; ">항목별 계산요소 리스트</caption>
  57. <line id="line1" class="line_1" style="x1:620px; y1:25px; x2:1195px; y2:25px; "/>
  58. <caption id="caption2" class="tit_2" style="left:5px; top:380px; width:129px; height:13px; ">항목별 계산식</caption>
  59. <line id="line2" class="line_1" style="x1:0px; y1:395px; x2:616px; y2:395px; "/>
  60. <caption id="caption3" class="tit_2" style="left:625px; top:700px; width:157px; height:13px; ">실행결과</caption>
  61. <line id="line3" class="line_1" style="x1:620px; y1:715px; x2:1195px; y2:715px; "/>
  62. <line id="line4" class="line_3" style="x1:620px; y1:740px; x2:1195px; y2:740px; "/>
  63. <datagrid id="grd_itemlist" nodeset="/root/main/iteminfo/itemlist" caption="항목명^항목설명^itemcd^calform^supcd" colsep="^" colwidth="239, 358, 0, 0, 0" mergecellsfixedrows="bycolrec" rowsep="|" style="left:0px; top:30px; width:616px; height:340px; ">
  64. <col ref="itemnm"/>
  65. <col ref="desccnts"/>
  66. <col ref="itemcd"/>
  67. <col ref="calform"/>
  68. <col ref="supcd"/>
  69. <script type="javascript" ev:event="onclick">
  70. <![CDATA[
  71. var xItemtListPath = "/root/main/iteminfo/itemlist";
  72. var sItemRow = grd_itemlist.row;
  73. if(sItemRow < 1) return;
  74. model.removenode("/root/send");
  75. model.makeValue("/root/send/supcd", model.getValue(xItemtListPath+"["+sItemRow+"]/itemcd"));
  76. if(submit("TRMNR02302")){
  77. model.setValue("/root/main/srchinfo/itemcalform", model.getValue(xItemtListPath+"["+sItemRow+"]/calform"));
  78. model.setValue("/root/main/srchinfo/rsltval","");
  79. tar_calform.refresh();
  80. opt_itemval.refresh();
  81. }
  82. ]]>
  83. </script>
  84. </datagrid>
  85. <datagrid id="grd_elmtlist" nodeset="/root/main/elmtinfo/elmtlist" caption="요소명칭^요소설명^입력값^itemcd^supcd" colsep="^" colwidth="224, 239, 88, 0, 0" mergecellsfixedrows="bycolrec" rowsep="|" style="left:620px; top:30px; width:575px; height:660px; ">
  86. <col ref="itemnm"/>
  87. <col ref="desccnts"/>
  88. <col ref="itemval" type="input" format="####.##"/>
  89. <col ref="itemcd"/>
  90. <col ref="supcd"/>
  91. </datagrid>
  92. <textarea id="tar_calform" ref="/root/main/srchinfo/itemcalform" disabled="true" style="left:0px; top:400px; width:616px; height:339px; font-size:18pt; "/>
  93. <output id="opt_itemval" ref="/root/main/srchinfo/rsltval" class="output_fix" style="left:620px; top:720px; width:575px; height:19px; font-weight:bold; "/>
  94. <button id="btn_exec" class="btn2_letter2" style="left:1153px; top:3px; width:42px; height:19px; ">
  95. <caption>실행</caption>
  96. <script type="javascript" ev:event="DOMActivate">
  97. <![CDATA[
  98. var xElmtListPath = "/root/main/elmtinfo/elmtlist";
  99. var sItemVal = 0;
  100. var sItemNM = "";
  101. var sCalForm = model.getValue("/root/main/srchinfo/itemcalform");
  102. if(sCalForm == ""){
  103. messageBox("계산항목을 먼저","C002");
  104. return;
  105. }
  106. // 입력 여부 체크 및 값 설정
  107. for(var iRow =1; iRow<= grd_elmtlist.rows-grd_elmtlist.fixedRows; iRow++){
  108. if(model.getValue(xElmtListPath+"["+iRow+"]/itemval") == ""){
  109. messageBox("입력값은","I003");
  110. return;
  111. }
  112. sItemNM = model.getValue(xElmtListPath+"["+iRow+"]/itemnm");
  113. sItemVal = model.getValue(xElmtListPath+"["+iRow+"]/itemval");
  114. while(sCalForm.indexOf(sItemNM) >= 0){
  115. sCalForm = sCalForm.replace(sItemNM, sItemVal);
  116. }
  117. }
  118. var sRsltVal = eval(sCalForm);
  119. model.setValue("/root/main/srchinfo/rsltval",sRsltVal);
  120. opt_itemval.refresh();
  121. ]]>
  122. </script>
  123. </button>
  124. </group>
  125. </xhtml:body>
  126. </xhtml:html>