SMRAD09900_기준코드관리.xrw 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  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. <codeinfo>
  11. <codelist>
  12. <cdid/>
  13. <cdnm/>
  14. <detldesc/>
  15. <useyn/>
  16. <cntlcd1/>
  17. <cntlcd2/>
  18. <grupcdid/>
  19. </codelist>
  20. </codeinfo>
  21. </main>
  22. <send>
  23. <reqdata>
  24. <grupcdid/>
  25. <srcd/>
  26. <gb/>
  27. </reqdata>
  28. </send>
  29. <senddata>
  30. <execdata>
  31. <codelist/>
  32. </execdata>
  33. </senddata>
  34. <popdata>
  35. <cdgrupid/>
  36. </popdata>
  37. <init/>
  38. </root>
  39. </instance>
  40. <script type="javascript" ev:event="xforms-ready">
  41. <![CDATA[
  42. model.refresh();
  43. ]]>
  44. </script>
  45. <script type="javascript" ev:event="xforms-model-destruct">
  46. <![CDATA[
  47. //window.close();
  48. ]]>
  49. </script>
  50. <submission id="TRRWC02202" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send/reqdata" resultref="/root/main/codeinfo"/>
  51. <submission id="TXRWC02201" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/senddata/execdata" resultref="/root/hidden"/>
  52. </model>
  53. <script type="javascript" src="../../../com/commonweb/js/common.js"/>
  54. <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
  55. <script type="javascript" src="../../../ast/tumorelctweb/js/combolist.js"/>
  56. <script type="javascript">
  57. <![CDATA[
  58. function readfunc(){ // 해당 조건에 대한 사용자 권한내역을 조회한다.
  59. if (model.getValue("/root/send/reqdata/grupcdid") == ""){
  60. messageBox("구분코드를 선택한 후 조회하시기 바랍니다.", "E999", "");
  61. return;
  62. }
  63. model.removeNodeset("/root/main/codeinfo/codelist");
  64. btn_save.disabled = false;
  65. if (submit("TRRWC02202")){
  66. }
  67. model.refresh();
  68. }
  69. function datacheck(){
  70. var scdid1 = "";
  71. var scdid2 = "";
  72. for (var i = 1; i < datagrid1.rows; i ++){
  73. if (model.getValue("/root/main/codeinfo/codelist[" + i + "]/cdid") == ""){
  74. messageBox("코드는 필수 입력항목입니다.", "E999", "");
  75. return false;
  76. }
  77. /*
  78. if (model.getValue("/root/main/codeinfo/codelist[" + i + "]/cdnm") == ""){
  79. messageBox("코드명은 필수 입력항목입니다.", "E999", "");
  80. return false;
  81. }
  82. */
  83. scdid1 = model.getValue("/root/main/codeinfo/codelist[" + i + "]/cdid");
  84. var k = i + 1;
  85. for (var j = k; j < datagrid1.rows; j++){
  86. scdid2 = model.getValue("/root/main/codeinfo/codelist[" + j + "]/cdid");
  87. if (i != j){
  88. if (scdid1 == scdid2){
  89. messageBox(j + "번째에서 중복된 자료가 존재합니다", "E999", "");
  90. return false;
  91. }
  92. }
  93. }
  94. }
  95. return true;
  96. }
  97. function ExecData(){
  98. var update = getGridUpdateData(datagrid1);
  99. model.setValue("/root/senddata/execdata/codelist", update);
  100. if (submit("TXRWC02201")){
  101. readfunc();
  102. }
  103. }
  104. function isDate(str) { // 날짜 형식에 대한 적합여부 체크
  105. if (str == "") return true; // 빈건 체크안함
  106. if (trim(str) == "") return true; // 빈건 체크안함
  107. if (isNaN(parseInt(str))) return false; // 숫자가 아니면 false
  108. if (str.length != 8) return false; // 8자리(yyyymmdd)가 아니면 false
  109. var yy = new Number(str.substring(0, 4));
  110. var mm = new Number(str.substring(4, 6)) - 1;
  111. var dd = new Number(str.substring(6, 8));
  112. var date = new Date(yy, mm, dd);
  113. //alert(date.getFullYear() +"-" + (date.getMonth()+1) + "-" + date.getDate());
  114. if (yy != date.getFullYear() ||
  115. mm != date.getMonth() ||
  116. dd != date.getDate()) {
  117. return false; // 존재하지 않는 날짜
  118. }
  119. return true; // 존재하는 날짜
  120. }
  121. function trim(data){ // 문자에 대한 TRIM 작업
  122. return data.replace(/(^\s*)|(\s*$)/g, "");
  123. }
  124. ]]>
  125. </script>
  126. </xhtml:head>
  127. <xhtml:body pagewidth="895px" pageheight="580px" style="margin-left:8; margin-top:8; margin-right:8; margin-bottom:8; ">
  128. <caption id="caption1" class="tit_1" style="left:0px; top:0px; width:252px; height:14px; ">기준코드관리</caption>
  129. <shape id="rectangle1" appearance="roundrect" style="left:3px; top:18px; width:867px; height:35px; background-color:#fffbf2; border-color:#ffd799; "/>
  130. <caption id="caption11" class="search_name" visibility="hidden" style="left:404px; top:26px; width:94px; height:17px; ">코드명검색:</caption>
  131. <input id="input13" ref="/root/send/reqdata/srcd" class="input_search" visibility="hidden" style="left:506px; top:25px; width:109px; height:19px; "/>
  132. <button id="btn_sea" class="btn1_letter2" style="left:797px; top:24px; width:56px; height:22px; ">
  133. <caption>조회</caption>
  134. <script type="javascript" ev:event="DOMActivate">
  135. <![CDATA[
  136. readfunc();
  137. ]]>
  138. </script>
  139. </button>
  140. <line id="line6" style="x1:687px; y1:24px; x2:687px; y2:46px; border-color:#ffe4bb; border-left-style:solid; "/>
  141. <line id="line7" class="line_1" style="x1:3px; y1:81px; x2:868px; y2:81px; "/>
  142. <datagrid id="datagrid1" nodeset="/root/main/codeinfo/codelist" autoresize="true" caption="코드^코드명^코드상세정보^사용여부^구분1^구분2^caption1" colsep="^" colwidth="101, 198, 316, 72, 74, 65, 39" explorerbar="sortshow" mergecellsfixedrows="bycolrec" rowheader="seq" rowsep="|" style="left:3px; top:85px; width:867px; height:450px; ">
  143. <col disabled="true" ref="cdid" type="input" maxlength="10" style="text-align:center; "/>
  144. <col ref="cdnm" type="input" style="text-align:left; "/>
  145. <col ref="detldesc" type="input"/>
  146. <col ref="useyn" type="combo">
  147. <choices>
  148. <item>
  149. <label>사용</label>
  150. <value>Y</value>
  151. </item>
  152. <item>
  153. <label>사용안함</label>
  154. <value>N</value>
  155. </item>
  156. </choices>
  157. </col>
  158. <col ref="cntlcd1" type="input"/>
  159. <col ref="cntlcd2" type="input"/>
  160. <col ref="grupcdid" visibility="hidden"/>
  161. <script type="javascript" ev:event="xforms-value-changed">
  162. <![CDATA[
  163. /*
  164. var scol = datagrid1.col;
  165. datagrid1.col = scol;
  166. datagrid1.dispatch("onentercell");
  167. datagrid1.editCell();
  168. */
  169. ]]>
  170. </script>
  171. <script type="javascript" ev:event="onaftersort">
  172. <![CDATA[
  173. datagrid1.gridToInstance();
  174. ]]>
  175. </script>
  176. </datagrid>
  177. <caption id="caption4" class="tit_2" style="left:3px; top:65px; width:113px; height:13px; ">코드별 상세정보</caption>
  178. <button id="btn_grdadd" class="btn2_letter3" style="left:759px; top:61px; width:53px; height:19px; ">
  179. <caption>행추가</caption>
  180. <script type="javascript" ev:event="DOMActivate">
  181. <![CDATA[
  182. if (model.getValue("/root/send/reqdata/grupcdid") == ""){
  183. messageBox("구분코드를 선택한 후 작업하시기 바랍니다.", "E999", "");
  184. return;
  185. }
  186. datagrid1.addRow();
  187. var irow = datagrid1.row;
  188. model.setValue("/root/main/codeinfo/codelist[" + irow + "]/grupcdid", model.getValue("/root/send/reqdata/grupcdid"));
  189. //model.setValue("/root/main/codeinfo/codelist[" + irow + "]/useyn", "Y");
  190. model.setFocus("datagrid1");
  191. datagrid1.row = irow;
  192. datagrid1.col = 1;
  193. datagrid1.dispatch("onentercell");
  194. datagrid1.editCell();
  195. datagrid1.refresh();
  196. ]]>
  197. </script>
  198. </button>
  199. <button id="btn_grddel" class="btn2_letter3" style="left:814px; top:61px; width:53px; height:19px; ">
  200. <caption>행삭제</caption>
  201. <script type="javascript" ev:event="DOMActivate">
  202. <![CDATA[
  203. datagrid1.deleteRow(datagrid1.row);
  204. ]]>
  205. </script>
  206. </button>
  207. <button id="button27" class="btn2_letter3" visibility="hidden" style="left:704px; top:61px; width:53px; height:19px; ">
  208. <caption>행복사</caption>
  209. </button>
  210. <button id="btn_save" class="btn4_letter2" style="left:816px; top:540px; width:56px; height:22px; ">
  211. <caption>저장</caption>
  212. <script type="javascript" ev:event="DOMActivate">
  213. <![CDATA[
  214. if (datacheck() == false){
  215. return;
  216. }
  217. ExecData();
  218. ]]>
  219. </script>
  220. </button>
  221. <line id="line1" class="line_3" style="x1:3px; y1:536px; x2:868px; y2:536px; "/>
  222. <caption id="caption2" class="search_name" style="left:24px; top:26px; width:63px; height:17px; ">구분:</caption>
  223. <select1 id="combo1" ref="/root/send/reqdata/grupcdid" appearance="minimal" style="left:86px; top:25px; width:309px; height:19px; ">
  224. <choices>
  225. <item>
  226. <label>보조비계좌관리</label>
  227. <value>A0001</value>
  228. </item>
  229. <item>
  230. <label>원가비용코드</label>
  231. <value>A0003</value>
  232. </item>
  233. <item>
  234. <label>프로젝트별코드관리</label>
  235. <value>A0004</value>
  236. </item>
  237. <item>
  238. <label>관리항목 필수입력 계정과목</label>
  239. <value>A0005</value>
  240. </item>
  241. </choices>
  242. <script type="javascript" ev:event="xforms-value-changed">
  243. <![CDATA[
  244. if (model.getValue("/root/send/reqdata/grupcdid") == "A0004"){
  245. caption3.visible = true;
  246. combo2.visible = true;
  247. btn_grdadd.disabled = false;
  248. btn_grddel.disabled = false;
  249. btn_save.disabled = false;
  250. model.refresh();
  251. }else{
  252. caption3.visible = false;
  253. combo2.visible = false;
  254. btn_grdadd.disabled = false;
  255. btn_grddel.disabled = false;
  256. btn_save.disabled = false;
  257. readfunc();
  258. }
  259. ]]>
  260. </script>
  261. </select1>
  262. <caption id="caption3" class="search_name" visibility="hidden" style="left:625px; top:26px; width:64px; height:17px; ">구분:</caption>
  263. <select1 id="combo2" ref="/root/send/reqdata/gb" visibility="hidden" appearance="minimal" style="left:685px; top:25px; width:85px; height:19px; ">
  264. <choices>
  265. <item>
  266. <label>전체</label>
  267. <value/>
  268. </item>
  269. <item>
  270. <label>A</label>
  271. <value>A</value>
  272. </item>
  273. <item>
  274. <label>B</label>
  275. <value>B</value>
  276. </item>
  277. <item>
  278. <label>C</label>
  279. <value>C</value>
  280. </item>
  281. <item>
  282. <label>D</label>
  283. <value>D</value>
  284. </item>
  285. </choices>
  286. </select1>
  287. </xhtml:body>
  288. </xhtml:html>