SPAHB00500_기본코드관리.xrw 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357
  1. <?xml version="1.0" encoding="EUC-KR"?>
  2. <!--
  3. * 제 목 : SPAHB00500.xrw
  4. * 설 명 : 기본코드선택
  5. * 설 계 자 : 손주연
  6. * 작 성 자 : 손주연
  7. * 작 성 일 : 2007.07.01
  8. * 수정이력 :
  9. * 기 타 :
  10. -->
  11. <?xml-stylesheet href="../../../com/commonweb/css/common.css" type="text/css" ?>
  12. <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">
  13. <xhtml:head>
  14. <xhtml:title>기본코드선택</xhtml:title>
  15. <model id="model1">
  16. <instance id="instance1">
  17. <root xmlns="">
  18. <main>
  19. <detlcodelst>
  20. <item>
  21. <sel/>
  22. <etcdetlcd/>
  23. <etcdetlnm/>
  24. <etccd/>
  25. <etcdetlcdkey/>
  26. <etcitemcnts/>
  27. <etcitemcnts2/>
  28. <useyn/>
  29. </item>
  30. </detlcodelst>
  31. <allyn/>
  32. </main>
  33. <send>
  34. <clscd/>
  35. <etccd/>
  36. </send>
  37. <init>
  38. <etclst>
  39. <item>
  40. <etccd/>
  41. <etcdetlnm/>
  42. <etccdkey/>
  43. <useyn/>
  44. </item>
  45. </etclst>
  46. <selectinput>
  47. <item>
  48. <etcdetlnm/>
  49. <etcdetlcd/>
  50. </item>
  51. </selectinput>
  52. </init>
  53. <hidden>
  54. </hidden>
  55. <temp>
  56. <sellst/>
  57. <okflag/>
  58. </temp>
  59. </root>
  60. </instance>
  61. <script type="javascript" src="../../../com/commonweb/js/common.js"/>
  62. <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
  63. <script type="javascript" ev:event="xforms-ready">
  64. <![CDATA[
  65. fInit();
  66. ]]>
  67. </script>
  68. <submission id="TRAHB00601" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" replace="instance" resultref="/root/init/etclst"/>
  69. <submission id="TRAHB00602" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" replace="instance" resultref="/root/main/detlcodelst"/>
  70. <submission id="TRAHB00603" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" replace="instance" resultref="/root/init/selectinput"/>
  71. </model>
  72. <script type="javascript">
  73. <![CDATA[
  74. /**
  75. * SPAHB00500_PARAM1 : 대분류코드
  76. * SPAHB00500_PARAM2 : 중분류코드
  77. * SPAHB00500_PARAM3 : multiyn => Y이면 소분류코드 다중선택입력모드
  78. * SPAHB00500_PARAM4 : 목적노드셋
  79. * SPAHB00500_PARAM5 : 중분류코드 setting여부(Y/N)=>선택형결과의 경우 중분류 선택시 중분류 코드 해당 중분류에 속한 소분류 전코드를 부모창에 copy
  80. */
  81. var sMultyYN = opener.javascript.getParameter("SPAHB00500_PARAM3");
  82. var midFlag = opener.javascript.getParameter("SPAHB00500_PARAM5");
  83. function fInit(){
  84. fGetLargeClassCdList() ;
  85. model.removeNodeset(grd_etcdetllst.nodeset);
  86. model.removeNodeset(grd_etclst.nodeset);
  87. if( sMultyYN == "N" ) {
  88. grd_etcdetllst.colHidden(1) = true;
  89. chk_allyn.visible = false;
  90. }else if(sMultyYN == "Y") {
  91. grd_etcdetllst.colHidden(1) = false;
  92. chk_allyn.visible = true;
  93. }
  94. if( checkOpener() || (midFlag =='Y')){
  95. sMultyYN = opener.javascript.getParameter("SPAHB00500_PARAM3");
  96. model.setValue("/root/send/clscd" , opener.javascript.getParameter("SPAHB00500_PARAM1"));
  97. model.setValue("/root/send/etccd" , opener.javascript.getParameter("SPAHB00500_PARAM2"));
  98. fGetEtcList();
  99. model.makeValue("/root/send/clscd" , opener.javascript.getParameter("SPAHB00500_PARAM1"));
  100. model.makeValue("/root/send/etccd" , opener.javascript.getParameter("SPAHB00500_PARAM2"));
  101. fGetDetlCodeList(true);
  102. opener.model.makeNode("/root/temp/okflag");
  103. opener.model.setValue("/root/temp/okflag" , "");
  104. }
  105. model.refresh();
  106. }
  107. /**==================================================================================================================================
  108. * 대분류 초기화
  109. ==================================================================================================================================*/
  110. function fGetLargeClassCdList(){
  111. var ret = submit("TRAHB00603");
  112. return ret;
  113. }
  114. /**==================================================================================================================================
  115. * 중분류 초기화
  116. ==================================================================================================================================*/
  117. function fGetEtcList(){
  118. var sClscd = model.getValue("/root/send/clscd");
  119. if( sClscd == "" ) return ;
  120. model.removeNodeset("/root/init/etclst/item");
  121. model.removeNodeset("/root/main/detlcodelst/item");
  122. var ret = submit("TRAHB00601");
  123. return ret;
  124. }
  125. /**==================================================================================================================================
  126. * 분류별 상세코드내역 조회
  127. *==================================================================================================================================*/
  128. function fGetDetlCodeList(vFlag){
  129. if (vFlag==false) {
  130. var idx = grd_etclst.row;
  131. if( idx < 1 ) return ;
  132. model.setValue("/root/send/etccd", grd_etclst.valueMatrix(idx, 1) );
  133. }
  134. var sClscd = model.getValue("/root/send/clscd");
  135. if( sClscd == "" ) return ;
  136. sClscd = model.getValue("/root/send/etccd");
  137. if( sClscd == "" ) return ;
  138. model.removeNodeset(grd_etcdetllst.nodeset);
  139. var ret = submit("TRAHB00602");
  140. }
  141. /***==================================================================================================================================
  142. *소분류코드 선택항목 setting
  143. *==================================================================================================================================*/
  144. function fDclSetData(){
  145. if( checkOpener() ){
  146. var sDestXPath = opener.javascript.getParameter("SPAHB00500_PARAM4");
  147. var idx = 0 ;
  148. idx = grd_etcdetllst.row;
  149. if( idx < 1) {
  150. messageBox("항목을 " , "C002");
  151. return -1;
  152. }
  153. grd_etcdetllst.valueMatrix(idx,grd_etcdetllst.colRef("sel")) = "Y";
  154. if(sMultyYN == "Y") {
  155. sDestXPath = sDestXPath + "/item";
  156. }
  157. opener.model.resetInstanceNode(sDestXPath);
  158. copyNodeType( sDestXPath , grd_etcdetllst.nodeset + "[sel='Y']","replace", opener.model, model );
  159. opener.model.setValue("/root/temp/okflag" , "ok");
  160. return 1;
  161. }
  162. }
  163. function fSetData() {
  164. var sDestXPath = opener.javascript.getParameter("SPAHB00500_PARAM4");
  165. if(sMultyYN == "Y") {
  166. opener.model.resetInstanceNode(sDestXPath);
  167. var vNdList = instance1.selectNodes(grd_etcdetllst.nodeset + "[sel='Y']");
  168. var vCsv = getNodeListCSV(vNdList);
  169. setCSVToNode("/root/temp/sellst", vCsv ,"item");
  170. copyNodeType( sDestXPath , "/root/temp/sellst", "replace", opener.model, model );
  171. opener.model.setValue("/root/temp/okflag" , "ok");
  172. }else {
  173. var idx = 0 ;
  174. idx = grd_etcdetllst.row;
  175. if( idx < 1) {
  176. messageBox("항목을 " , "C002");
  177. return -1;
  178. }
  179. grd_etcdetllst.valueMatrix(idx,grd_etcdetllst.colRef("sel")) = "Y";
  180. opener.model.resetInstanceNode(sDestXPath);
  181. copyNodeType( sDestXPath , grd_etcdetllst.nodeset + "[sel='Y']","replace", opener.model, model );
  182. opener.model.setValue("/root/temp/okflag" , "ok");
  183. }
  184. return 1;
  185. }
  186. /***==================================================================================================================================
  187. *소분류코드 선택항목 setting
  188. *==================================================================================================================================*/
  189. function fSetDataEtc(){
  190. var ret = -1;
  191. if( checkOpener() ){
  192. var sDestXPath = opener.javascript.getParameter("SPAHB00500_PARAM4");
  193. var idx = 0 ;
  194. idx = grd_etclst.row;
  195. if( idx < 1) {
  196. messageBox("항목을 " , "C002");
  197. return -1;
  198. }
  199. var sAllYN = opener.javascript.getParameter("SPAHB00500_PARAM5"); //중분류코드 setting여부(Y/N)=>선택형결과의 경우 중분류 선택시 중분류 코드 해당 중분류에 속한 소분류 전코드를 부모창에 copy
  200. if( sAllYN == "Y" ) {
  201. copyNodesetType( sDestXPath , grd_etcdetllst.nodeset , "replace", opener.model, model );
  202. }
  203. ret = 1;
  204. opener.model.setValue("/root/temp/okflag" , "ok");
  205. }
  206. return ret ;
  207. }
  208. /***==================================================================================================================================
  209. * 전체선택
  210. *==================================================================================================================================*/
  211. function fSetChkSel(vAllYN) {
  212. for( var i = 1 ; i < grd_etcdetllst.rows ; i ++){
  213. grd_etcdetllst.valueMatrix( i, 1) = vAllYN;
  214. }
  215. }
  216. ]]>
  217. </script>
  218. </xhtml:head>
  219. <xhtml:body pagewidth="534" pageheight="543" guideline="1,1194;1,517;" style="margin-left:8; margin-top:8; margin-right:8; margin-bottom:8; ">
  220. <group id="group3" scroll="auto" style="left:0px; top:0px; width:518px; height:515px; ">
  221. <datagrid id="grd_etcdetllst" nodeset="/root/main/detlcodelst/item" caption="^코드^명칭^etccd" colsep="^" colwidth="28, 104, 362, 100" dataheight="25" explorerbar="sortshow" extendlastcol="scroll" mergecellsfixedrows="bycolrec" rowheader="seq" rowheight="25" rowsep="|" style="left:0px; top:215px; width:517px; height:298px; ">
  222. <col checkvalue="Y,N" ref="sel" type="checkbox"/>
  223. <col ref="etcdetlcd"/>
  224. <col ref="etcdetlnm"/>
  225. <col ref="etccd" visibility="hidden"/>
  226. <script type="javascript" ev:event="ondblclick">
  227. <![CDATA[
  228. if( fDclSetData() == 1){
  229. window.close();
  230. }
  231. ]]>
  232. </script>
  233. <script type="javascript" ev:event="onaftersort">
  234. <![CDATA[
  235. grd_etcdetllst.gridToInstance();
  236. ]]>
  237. </script>
  238. </datagrid>
  239. <group id="group2" style="left:0px; top:0px; width:517px; height:40px; vertical-align:top; ">
  240. <shape id="roundrect1" appearance="roundrect" ellipsewidth="10" ellipseheight="10" style="left:0px; top:0px; width:517px; height:40px; background-color:#fffbf2; border-color:#ffd799; "/>
  241. <caption id="caption2" class="search_name" style="left:16px; top:12px; width:86px; height:17px; ">대분류 :</caption>
  242. <button id="btn_search" class="btn1_letter2" style="left:445px; top:12px; width:56px; height:22px; ">
  243. <caption>조회</caption>
  244. <script type="javascript" ev:event="DOMActivate">
  245. <![CDATA[
  246. fGetDetlCodeList(false);
  247. ]]>
  248. </script>
  249. </button>
  250. <line id="line13" style="x1:429px; y1:11px; x2:429px; y2:32px; border-color:#ffe4bb; border-left-style:solid; "/>
  251. <select1 id="cmb_clscd" ref="/root/send/clscd" class="combo_s_essential" appearance="minimal" style="left:90px; top:10px; width:120px; height:19px; ">
  252. <choices>
  253. <itemset nodeset="/root/init/selectinput/item">
  254. <label ref="etcdetlnm"/>
  255. <value ref="etcdetlcd"/>
  256. </itemset>
  257. </choices>
  258. <script type="javascript" ev:event="xforms-select">
  259. <![CDATA[
  260. fGetEtcList();
  261. ]]>
  262. </script>
  263. </select1>
  264. </group>
  265. <line id="line1" class="line_1" style="x1:0px; y1:46px; x2:517px; y2:46px; "/>
  266. <select id="chk_allyn" ref="/root/main/allyn" overflow="visible" appearance="full" style="left:26px; top:220px; width:25px; height:20px; text-align:center; vertical-align:middle; border-style:none; ">
  267. <choices>
  268. <item>
  269. <label/>
  270. <value>Y</value>
  271. </item>
  272. </choices>
  273. <script type="javascript" ev:event="xforms-select">
  274. <![CDATA[
  275. fSetChkSel(chk_allyn.value);
  276. ]]>
  277. </script>
  278. <script type="javascript" ev:event="xforms-deselect">
  279. <![CDATA[
  280. fSetChkSel(chk_allyn.value);
  281. ]]>
  282. </script>
  283. </select>
  284. <datagrid id="grd_etclst" nodeset="/root/init/etclst/item" caption="코드^명칭" colsep="^" colwidth="104, 362" dataheight="25" explorerbar="sortshow" extendlastcol="scroll" mergecellsfixedrows="bycolrec" rowheader="seq" rowheight="25" rowsep="|" style="left:0px; top:50px; width:517px; height:158px; ">
  285. <col ref="etccd"/>
  286. <col ref="etcdetlnm"/>
  287. <script type="javascript" ev:event="ondblclick">
  288. <![CDATA[
  289. /*
  290. if( fSetDataEtc() == 1){
  291. window.close();
  292. }*/
  293. ]]>
  294. </script>
  295. <script type="javascript" ev:event="onclick">
  296. <![CDATA[
  297. fGetDetlCodeList(false);
  298. ]]>
  299. </script>
  300. <script type="javascript" ev:event="onaftersort">
  301. <![CDATA[
  302. grd_etclst.gridToInstance();
  303. ]]>
  304. </script>
  305. </datagrid>
  306. <line id="line2" class="line_1" style="x1:0px; y1:210px; x2:517px; y2:210px; "/>
  307. </group>
  308. <group id="group4" scroll="auto" style="left:0px; top:515px; width:517px; height:28px; ">
  309. <button id="btn_cncl" class="btn4_letter2" style="left:461px; top:3px; width:56px; height:22px; ">
  310. <caption>취소</caption>
  311. <script type="javascript" ev:event="DOMActivate">
  312. <![CDATA[
  313. window.close();
  314. ]]>
  315. </script>
  316. </button>
  317. <button id="btn_cfm" class="btn4_letter2" style="left:402px; top:3px; width:56px; height:22px; ">
  318. <caption>확인</caption>
  319. <script type="javascript" ev:event="DOMActivate">
  320. <![CDATA[
  321. if( fSetData() == 1){
  322. window.close();
  323. }
  324. ]]>
  325. </script>
  326. </button>
  327. </group>
  328. </xhtml:body>
  329. </xhtml:html>