SMRPB01701_인사조건항목HELP.xrw 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  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. <target/>
  11. <init>
  12. <operator>
  13. <code>=</code>
  14. <cdnm>=</cdnm>
  15. </operator>
  16. <conector>
  17. <code>AND</code>
  18. <cdnm>AND</cdnm>
  19. <code>OR</code>
  20. <cdnm>OR</cdnm>
  21. </conector>
  22. <condvalu1/>
  23. <condvalu2/>
  24. </init>
  25. <send>
  26. <captitle/>
  27. <operator/>
  28. <conector/>
  29. <condvalu1/>
  30. <condvalu2/>
  31. </send>
  32. </root>
  33. </instance>
  34. <script type="javascript" ev:event="xforms-ready">
  35. <![CDATA[
  36. fSettingControl();
  37. ]]>
  38. </script>
  39. </model>
  40. <script type="javascript" src="../../../com/commonweb/js/common.js"/>
  41. <script type="javascript" src="../../../mis/miscommonweb/js/MIS.js"/>
  42. <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
  43. <script type="javascript" src="../../../com/commonweb/js/dateHelper.js"/>
  44. <script type="javascript" src="../../../com/commonweb/js/stringHelper.js"/>
  45. <script type="javascript">
  46. <![CDATA[
  47. function fSettingControl()
  48. {
  49. var itemkind = model.getValue("/root/target/defaultvalue/itemkind");
  50. var operator = model.getValue("/root/target/defaultvalue/operator");
  51. var conector = model.getValue("/root/target/defaultvalue/conector");
  52. var condvalu1 = model.getValue("/root/target/defaultvalue/condvalu1");
  53. var condvalu2 = model.getValue("/root/target/defaultvalue/condvalu2");
  54. var itemnm = model.getValue("/root/target/defaultvalue/itemnm");
  55. condvalu1 = condvalu1.setReplaceWord("'","");
  56. condvalu2 = condvalu2.setReplaceWord("'","");
  57. if((operator == "IN" || operator == "NOT IN")){
  58. if(itemkind != "INT" && itemkind != "FLOAT" && itemkind != "MONEY" ){
  59. var tmpcondvalua = condvalu1.split(",");
  60. var tmpcondvalub = "";
  61. for ( var i =0 ; i< tmpcondvalua.length;i++){
  62. tmpcondvalub = tmpcondvalub + tmpcondvalua[i] + ",";
  63. }
  64. condvalu1 = tmpcondvalub.substr(0,tmpcondvalub.length-1);
  65. tmpcondvalua = condvalu2.split(",");
  66. tmpcondvalub = "";
  67. for ( var i =0 ; i< tmpcondvalua.length;i++){
  68. tmpcondvalub = tmpcondvalub + tmpcondvalua[i] + ",";
  69. }
  70. condvalu2 = tmpcondvalub.substr(0,tmpcondvalub.length-1);
  71. }
  72. }
  73. if(itemkind.length> 0 && itemkind.substr(0, 2) == "YY"){
  74. if(itemkind == "YYMM"){
  75. // ipt_condvalu1.attribute("maxlength") = "4";
  76. // ipt_condvalu2.attribute("maxlength") = "4";
  77. ipt_condvalu1.attribute("format") = "yyyy-mm";
  78. ipt_condvalu2.attribute("format") = "yyyy-mm";
  79. }
  80. else if(itemkind == "YYMMDD"){
  81. // ipt_condvalu1.attribute("maxlength") = "8";
  82. // ipt_condvalu2.attribute("maxlength") = "8";
  83. ipt_condvalu1.attribute("format") = "yyyy-mm-dd";
  84. ipt_condvalu2.attribute("format") = "yyyy-mm-dd";
  85. }
  86. addGridComboItemAll("cmb_operator","BETWEEN","BETWEEN","above");
  87. addGridComboItemAll("cmb_operator",">",">","above");
  88. addGridComboItemAll("cmb_operator",">=",">=","above");
  89. addGridComboItemAll("cmb_operator","<","<","above");
  90. addGridComboItemAll("cmb_operator","<=","<=","above");
  91. }
  92. else{
  93. addGridComboItemAll("cmb_operator","<>","<>","above");
  94. addGridComboItemAll("cmb_operator","BETWEEN","BETWEEN","above");
  95. addGridComboItemAll("cmb_operator","IN","IN","above");
  96. addGridComboItemAll("cmb_operator","NOT IN","NOT IN","above");
  97. }
  98. if (operator == null || operator == "" ) {
  99. model.setValue(cmb_operator.attribute("ref"),"=");
  100. }
  101. else {
  102. model.setValue(cmb_operator.attribute("ref"),operator);
  103. }
  104. model.setValue(ipt_condvalu1.attribute("ref"),condvalu1);
  105. model.setValue(ipt_condvalu2.attribute("ref"),condvalu2);
  106. if(conector.length == 0){
  107. model.setValue(cmb_conector.attribute("ref"),"AND");
  108. }
  109. else{
  110. model.setValue(cmb_conector.attribute("ref"),conector);
  111. }
  112. if(operator == "BETWEEN"){
  113. ipt_condvalu2.disabled = false;
  114. }
  115. else{
  116. ipt_condvalu2.disabled = true;
  117. }
  118. model.setValue(opt_title.attribute("ref"),itemnm);
  119. model.refresh();
  120. }
  121. function fChkReturn(){
  122. var operator = model.getValue(cmb_operator.attribute("ref"));
  123. var condvalu1 = model.getValue(ipt_condvalu1.attribute("ref"));
  124. var condvalu2 = model.getValue(ipt_condvalu2.attribute("ref"));
  125. var itemkind = model.getValue("/root/target/defaultvalue/itemkind");
  126. if(operator.length == 0){
  127. messageBox("연산자는","I003");
  128. model.setFocus("cmb_operator");
  129. return false;
  130. }
  131. if(condvalu1.length == 0){
  132. messageBox("조건값1은","I003");
  133. model.setFocus("ipt_condvalu1");
  134. return false;
  135. }
  136. if((operator == "BETWEEN") && (condvalu2.length == 0)){
  137. messageBox("조건값2는","I003");
  138. model.setFocus("ipt_condvalu2");
  139. return false;
  140. }
  141. var curdate = getCurrentDate();
  142. if(itemkind == "YYMMDD"){
  143. if(condvalu1.length != 8){
  144. messageBox("조건값1의 입력값을[ex:" + curdate.substr(0, 8) + "]를 잘못입력하셨습니다.처리","E001");
  145. model.setFocus("ipt_condvalu1");
  146. return false;
  147. }
  148. if((operator == "BETWEEN") && condvalu2.length != 8){
  149. messageBox("조건값2의 입력값을[ex:" + curdate.substr(0, 8) + "]를 잘못입력하셨습니다.처리","E001");
  150. model.setFocus("ipt_condvalu2");
  151. return false;
  152. }
  153. }
  154. else if(itemkind == "YYMM"){
  155. if(condvalu1.length != 6){
  156. messageBox("조건값1의 입력값을[ex:" + curdate.substr(0, 6) + "]를 잘못입력하셨습니다.처리","E001");
  157. model.setFocus("ipt_condvalu1");
  158. return false;
  159. }
  160. if((operator == "BETWEEN") && condvalu2.length != 6){
  161. messageBox("조건값2의 입력값을[ex:" + curdate.substr(0, 6) + "]를 잘못입력하셨습니다.처리","E001");
  162. model.setFocus("ipt_condvalu2");
  163. return false;
  164. }
  165. }
  166. /*
  167. if(itemkind == "TEXT"){
  168. var condvalu1 = model.getValue(ipt_condvalu1.attribute("ref"));
  169. var condvalu2 = model.getValue(ipt_condvalu2.attribute("ref"));
  170. if(condvalu1.length > 0 ) model.setValue(ipt_condvalu1.attribute("ref"),"'" + condvalu1 + "'");
  171. if(condvalu2.length > 0 ) model.setValue(ipt_condvalu2.attribute("ref"),"'" + condvalu1 + "'");
  172. }
  173. */
  174. var condvalu1 = model.getValue(ipt_condvalu1.attribute("ref"));
  175. var condvalu2 = model.getValue(ipt_condvalu2.attribute("ref"));
  176. if((operator == "IN" || operator == "NOT IN")){
  177. if(itemkind != "INT" && itemkind != "FLOAT" && itemkind != "MONEY" ){
  178. var tmpcondvalua = condvalu1.split(",");
  179. var tmpcondvalub = "";
  180. for ( var i =0 ; i< tmpcondvalua.length;i++){
  181. tmpcondvalub = tmpcondvalub + "'" + tmpcondvalua[i] + "',";
  182. }
  183. condvalu1 = tmpcondvalub.substr(0,tmpcondvalub.length-1);
  184. tmpcondvalua = condvalu2.split(",");
  185. tmpcondvalub = "";
  186. for ( var i =0 ; i< tmpcondvalua.length;i++){
  187. tmpcondvalub = tmpcondvalub + "'" + tmpcondvalua[i] + "',";
  188. }
  189. condvalu2 = tmpcondvalub.substr(0,tmpcondvalub.length-1);
  190. }
  191. }
  192. else{
  193. if(itemkind != "INT" && itemkind != "FLOAT" && itemkind != "MONEY" && operator != "IN" && operator != "NOT IN"){
  194. if(condvalu1.length > 0 ) condvalu1 = "'" + condvalu1 + "'";
  195. if(condvalu2.length > 0 ) condvalu2 = "'" + condvalu2 + "'";
  196. }
  197. }
  198. model.setValue(ipt_condvalu1.attribute("ref"),condvalu1);
  199. model.setValue(ipt_condvalu2.attribute("ref"),condvalu2);
  200. //model.refresh();
  201. return true;
  202. }
  203. ]]>
  204. </script>
  205. </xhtml:head>
  206. <xhtml:body pagewidth="450" pageheight="160" guideline="1,155;" style="margin-left:8; margin-top:0; margin-right:8; margin-bottom:0; ">
  207. <group id="group3" scroll="auto" style="left:10px; top:0px; width:385px; height:110px; ">
  208. <line id="line30" class="line_2" style="x1:4px; y1:55px; x2:385px; y2:55px; "/>
  209. <caption id="caption50" class="cell_1" style="left:3px; top:31px; width:56px; height:23px; vertical-align:middle; ">연산자</caption>
  210. <caption id="caption52" class="cell_1" style="left:3px; top:56px; width:56px; height:23px; vertical-align:middle; ">조건값1</caption>
  211. <select1 id="cmb_operator" ref="/root/send/operator" appearance="minimal" style="left:60px; top:33px; width:132px; height:19px; ">
  212. <choices>
  213. <itemset nodeset="/root/init/operator">
  214. <label ref="code"/>
  215. <value ref="cdnm"/>
  216. </itemset>
  217. </choices>
  218. <script type="javascript" ev:event="xforms-value-changed">
  219. <![CDATA[
  220. var operation = model.getValue(cmb_operator.attribute("ref"));
  221. if(operation == "BETWEEN"){
  222. ipt_condvalu2.disabled = false;
  223. }
  224. else{
  225. ipt_condvalu2.disabled = true;
  226. model.setValue(ipt_condvalu2.attribute("ref"),"");
  227. ipt_condvalu2.refresh();
  228. }
  229. ]]>
  230. </script>
  231. </select1>
  232. <caption id="caption1" class="cell_1" style="left:195px; top:30px; width:56px; height:23px; vertical-align:middle; ">연결자</caption>
  233. <select1 id="cmb_conector" ref="/root/send/conector" appearance="minimal" style="left:252px; top:33px; width:132px; height:19px; ">
  234. <choices>
  235. <itemset nodeset="/root/init/conector">
  236. <label ref="cdnm"/>
  237. <value ref="code"/>
  238. </itemset>
  239. </choices>
  240. </select1>
  241. <input id="ipt_condvalu1" ref="/root/send/condvalu1" style="left:60px; top:58px; width:324px; height:19px; "/>
  242. <caption id="caption2" class="cell_1" style="left:3px; top:81px; width:56px; height:23px; vertical-align:middle; ">조건값2</caption>
  243. <input id="ipt_condvalu2" ref="/root/send/condvalu2" style="left:60px; top:83px; width:324px; height:19px; "/>
  244. <line id="line1" class="line_2" style="x1:4px; y1:80px; x2:385px; y2:80px; "/>
  245. <line id="line2" class="line_2" style="x1:3px; y1:104px; x2:384px; y2:104px; "/>
  246. <line id="line3" class="line_1" style="x1:3px; y1:25px; x2:385px; y2:25px; "/>
  247. <caption id="cap_title" class="tit_2" style="left:3px; top:10px; width:15px; height:13px; vertical-align:middle; "/>
  248. <output id="opt_title" ref="/root/send/captitle" style="left:13px; top:5px; width:360px; height:19px; font-weight:bold; "/>
  249. </group>
  250. <group id="group1" scroll="auto" style="left:10px; top:110px; width:386px; height:27px; ">
  251. <button id="btn_confirm" class="btn4_letter2" style="left:267px; top:2px; width:56px; height:22px; ">
  252. <caption>확인</caption>
  253. <script type="javascript" ev:event="DOMActivate">
  254. <![CDATA[
  255. if(!fChkReturn())return;
  256. var rtnvalue = "operator▦conector▦condvalu1▦condvalu2▩" + cmb_operator.value + "▦" + cmb_conector.value + "▦" +ipt_condvalu1.value+ "▦" + ipt_condvalu2.value +"▩";
  257. if ( checkOpener() ) {
  258. opener.javascript.setParameter("SMRPB01701_", rtnvalue);
  259. } else {
  260. var rtn = messageBox("상위화면을 찾을 수", "E001");
  261. }
  262. window.close();
  263. ]]>
  264. </script>
  265. </button>
  266. <button id="btn_cancel" class="btn4_letter2" style="left:324px; top:2px; width:56px; height:22px; ">
  267. <caption>취소</caption>
  268. <script type="javascript" ev:event="DOMActivate">
  269. <![CDATA[
  270. window.close();
  271. ]]>
  272. </script>
  273. </button>
  274. <line id="line32" class="line_6" style="x1:0px; y1:0px; x2:384; y2:0px; "/>
  275. </group>
  276. </xhtml:body>
  277. </xhtml:html>