SPADB61350_성분조회.xrw 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  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. <mode/>
  11. <grid>
  12. <item>
  13. <comcd/>
  14. <comexcd/>
  15. <comnm/>
  16. <comlevel/>
  17. </item>
  18. </grid>
  19. <selectgrid>
  20. <item>
  21. <chk/>
  22. <comcd/>
  23. <comnm/>
  24. </item>
  25. </selectgrid>
  26. </main>
  27. <send>
  28. <srchcomcd/>
  29. <srchcomnm/>
  30. <data>
  31. <comcd/>
  32. <comexcd/>
  33. <comnm/>
  34. <dddunit/>
  35. <ddd/>
  36. <dddkg/>
  37. <dddchild/>
  38. <childdayno/>
  39. <childage/>
  40. </data>
  41. </send>
  42. <init>
  43. </init>
  44. <hidden>
  45. <temp/>
  46. <receiveref>
  47. <srchtype/>
  48. <comnm/>
  49. <comcd/>
  50. </receiveref>
  51. </hidden>
  52. </root>
  53. </instance>
  54. <submission id="TRADB61301" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" replace="instance" resultref="/root/main/grid"/>
  55. <script type="javascript" ev:event="xforms-ready">
  56. <![CDATA[
  57. grd_temp.fixedcellcheckbox(0,0)=true; // 타이틀에 전체선택 체크박스 추가
  58. model.removeNodeset("/root/main/selectgrid"); // 그리드 내용 초기화
  59. model.refresh();
  60. /*
  61. * 부모창에서 넘겨받은 데이터 체크박스에 세팅
  62. */
  63. var comcd = model.getValue("/root/hidden/receiveref/comcd"); // 성분코드
  64. var comnm = model.getValue("/root/hidden/receiveref/comnm"); // 성분명칭
  65. comcd = comcd.setReplaceWord("'","");
  66. comcd = comcd.split(",");
  67. comnm = comnm.setReplaceWord("'","");
  68. comnm = comnm.split(",");
  69. // 데이터 유무 체크( 구분할 값이 없어도 length는 1이 리턴됨. )
  70. if(comnm[0] != "") {
  71. for(var i = 0; i < comcd.length; ++i) {
  72. grd_temp.addRow(false, false);
  73. grd_temp.valueMatrix(grd_temp.rows - grd_temp.fixedRows, grd_temp.colRef("chk")) = "true";
  74. grd_temp.valueMatrix(grd_temp.rows - grd_temp.fixedRows, grd_temp.colRef("comcd")) = comcd[i];
  75. grd_temp.valueMatrix(grd_temp.rows - grd_temp.fixedRows, grd_temp.colRef("comnm")) = comnm[i];
  76. }
  77. }
  78. grd_temp.refresh();
  79. ]]>
  80. </script>
  81. </model>
  82. <script type="javascript" src="../../../com/hismainweb/js/DocTitle.js"/>
  83. <script type="javascript" src="../../../com/commonweb/js/common.js"/>
  84. <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
  85. <script type="javascript" src="../../../com/commonweb/js/stringHelper.js"/>
  86. <script type="javascript" src="../../../ast/commonweb/js/AST.js"/>
  87. </xhtml:head>
  88. <xhtml:body pagewidth="654" pageheight="586" guideline="1,1194;1,673;2,576;" style="margin-left:8; margin-top:0; margin-right:8; margin-bottom:0; ">
  89. <group id="group3" scroll="auto" style="left:0px; top:0px; width:630px; height:550px; ">
  90. <group id="group2" ref="/root/send/srchcomflag" style="left:0px; top:0px; width:625px; height:35px; vertical-align:top; ">
  91. <shape id="roundrect1" appearance="roundrect" ellipsewidth="10" ellipseheight="10" style="left:0px; top:0px; width:620px; height:35px; background-color:#fffbf2; border-color:#ffd799; "/>
  92. <line id="line13" class="line_4" style="x1:555px; y1:6px; x2:555px; y2:28px; border-color:#ffe4bb; border-left-style:solid; "/>
  93. <button id="btn_sea" class="btn1_letter2" style="left:560px; top:5px; width:56px; height:22px; ">
  94. <caption>조회</caption>
  95. <script type="javascript" ev:event="DOMActivate">
  96. <![CDATA[
  97. submit("TRADB61301");
  98. setTree(grd_com, grd_com.colRef("comlevel"),grd_com.colRef("comcd"), false );
  99. model.refresh();
  100. ]]>
  101. </script>
  102. </button>
  103. <caption id="caption3" class="search_name" style="left:225px; top:8px; width:60px; height:17px; ">명칭</caption>
  104. <caption id="caption4" class="search_name" style="left:5px; top:8px; width:60px; height:17px; ">코드</caption>
  105. <input id="input1" ref="/root/send/srchcomnm" class="input_search" style="left:295px; top:8px; width:210px; height:19px; ">
  106. <script type="javascript" ev:event="onkeyup">
  107. <![CDATA[
  108. if(event.keyCode == "13") {
  109. setInputNodeCurText();
  110. btn_sea.dispatch("DOMActivate");
  111. }
  112. ]]>
  113. </script>
  114. </input>
  115. <input id="input2" ref="/root/send/srchcomcd" class="input_search" style="left:80px; top:8px; width:130px; height:19px; ">
  116. <script type="javascript" ev:event="onkeyup">
  117. <![CDATA[
  118. if(event.keyCode == "13") {
  119. setInputNodeCurText();
  120. btn_sea.dispatch("DOMActivate");
  121. }
  122. ]]>
  123. </script>
  124. </input>
  125. </group>
  126. <caption id="caption1" class="tit_2" style="left:5px; top:46px; width:95px; height:14px; ">성분조회</caption>
  127. <line id="line1" class="line_1" style="x1:0px; y1:61px; x2:625px; y2:61px; "/>
  128. <datagrid id="grd_com" nodeset="/root/main/grid/item" caption="코드^확장^명칭^레벨" colsep="^" colwidth="153, 48, 373, 47" dataheight="25" extendlastcol="scroll" mergecellsfixedrows="bycolrec" rowheight="25" rowsep="|" style="left:0px; top:66px; width:625px; height:284px; ">
  129. <col ref="comcd"/>
  130. <col ref="comexcd"/>
  131. <col ref="comnm"/>
  132. <col ref="comlevel"/>
  133. <script type="javascript" ev:event="ondblclick">
  134. <![CDATA[
  135. var comcd = model.getValue("/root/main/grid/item["+grd_com.row+"]/comcd"); // 성분코드
  136. var comnm = model.getValue("/root/main/grid/item["+grd_com.row+"]/comnm"); // 성분명칭
  137. // 1. 로우 추가
  138. grd_temp.addRow(false, false);
  139. // 2. 코드, 명칭 세팅
  140. grd_temp.valueMatrix(grd_temp.rows - 1, grd_temp.colRef("chk")) = "true";
  141. grd_temp.valueMatrix(grd_temp.rows - 1, grd_temp.colRef("comcd")) = comcd;
  142. grd_temp.valueMatrix(grd_temp.rows - 1, grd_temp.colRef("comnm")) = comnm;
  143. grd_temp.refresh();
  144. ]]>
  145. </script>
  146. </datagrid>
  147. <caption id="caption2" class="tit_2" style="left:5px; top:355px; width:115px; height:13px; ">추가 항목 선택</caption>
  148. <datagrid id="grd_temp" nodeset="/root/main/selectgrid/item" caption="선택^코드^명칭" colsep="^" colwidth="58, 153, 321" mergecellsfixedrows="bycolrec" rowsep="|" style="left:0px; top:375px; width:625px; height:170px; ">
  149. <col ref="chk" type="checkbox"/>
  150. <col ref="comcd"/>
  151. <col ref="comnm"/>
  152. <script type="javascript" ev:event="ondblclick">
  153. <![CDATA[
  154. grd_temp.deleteRow(grd_temp.row, true);
  155. grd_temp.refresh();
  156. ]]>
  157. </script>
  158. </datagrid>
  159. <line id="line2" class="line_1" style="x1:0px; y1:370px; x2:625px; y2:370px; "/>
  160. </group>
  161. <group id="group1" scroll="auto" style="left:0px; top:550px; width:630px; height:27px; ">
  162. <button id="btn_cfm" class="btn4_letter2" style="left:511px; top:4px; width:56px; height:22px; ">
  163. <caption>확인</caption>
  164. <script type="javascript" ev:event="onclick">
  165. <![CDATA[
  166. var comcd = opener.window.javascript.getParameter("comcd"); // 성분코드
  167. var comexcd = opener.window.javascript.getParameter("comexcd"); //
  168. var comnm = opener.window.javascript.getParameter("comnm"); // 성분명칭
  169. /*
  170. * 체크박스에 선택된 값만 부모창으로 세팅
  171. */
  172. var gridRow = grd_temp.rows; // 데이터 로우 종 갯수
  173. var fixedRows = grd_temp.fixedRows; // 고정 데이터 로우 갯수
  174. var isFirst = true;
  175. for(var i = 0; i < gridRow; ++i) {
  176. if(grd_temp.valueMatrix(i + fixedRows, grd_temp.colRef("chk")) == "true") {
  177. // 체크박스에 첫번째 선택된 값
  178. if(isFirst) {
  179. // 체크박스에 선택된 값의 명칭이 없을 경우
  180. comcd = "'" + grd_temp.valueMatrix(i + fixedRows, grd_temp.colRef("comcd")) + "'";
  181. comnm = "'" + grd_temp.valueMatrix(i + fixedRows, grd_temp.colRef("comnm")) + "'";
  182. isFirst = false;
  183. }
  184. // 체크박스에 두번째 이상 선택된 값
  185. else {
  186. comcd += "," + "'" + grd_temp.valueMatrix(i + fixedRows, grd_temp.colRef("comcd")) + "'";
  187. comnm += "," + "'" + grd_temp.valueMatrix(i + fixedRows, grd_temp.colRef("comnm")) + "'";
  188. }
  189. }
  190. }
  191. // 체크박스에 선택된 값이 없을 경우
  192. if(isFirst) {
  193. comcd = "";
  194. comnm = "";
  195. }
  196. opener.window.javascript.setParameter("comcd" , comcd);
  197. opener.window.javascript.setParameter("comexcd" , comexcd);
  198. opener.window.javascript.setParameter("comnm" , comnm);
  199. opener.model.refresh();
  200. window.close();
  201. ]]>
  202. </script>
  203. </button>
  204. <button id="btn_cls" class="btn4_letter2" style="left:570px; top:4px; width:56px; height:22px; ">
  205. <caption>닫기</caption>
  206. <close ev:event="DOMActivate"/>
  207. </button>
  208. </group>
  209. </xhtml:body>
  210. </xhtml:html>