MRF02100.xjs 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <Script type="xscript4.0"><![CDATA[function fInitialize()
  3. {
  4. var indxflag = opener.frmf_getParameter("indxflag");
  5. ds_temp_condition.setColumn(0, "indxflag",indxflag);
  6. ds_init.setColumn(0, "today", utlf_getCurrentDate());
  7. var value = ds_temp_condition.getColumn(0, "indxflag");
  8. if(ds_temp_condition.getColumn(0, "indxflag") == "V")
  9. {
  10. fIndxListSrch();
  11. }
  12. else if(ds_temp_condition.getColumn(0, "indxflag") == "F")
  13. {
  14. fIndxListSrch();
  15. }
  16. else if(ds_temp_condition.getColumn(0, "indxflag") == "P")
  17. {
  18. fIndxListSrch();
  19. }
  20. else if(ds_temp_condition.getColumn(0, "indxflag") == "U")
  21. {
  22. fIndxListSrch();
  23. }
  24. }
  25. function fIndxListSrch()
  26. {
  27. dsf_makeValue(ds_send, "indxflag", "String", ds_temp_condition.getColumn(0, "indxflag"));
  28. var oParam = {};
  29. oParam.id = "TRMRF01901";
  30. oParam.service = "formmngtapp.IndxMngt";
  31. oParam.method = "reqGetIndxList";
  32. oParam.inds = "req=ds_send";
  33. oParam.outds = "ds_main_indxlist_item=item";
  34. oParam.async = false;
  35. //oParam.callback = "cf_TRMRF01901";
  36. tranf_submit(oParam);
  37. }
  38. function fIndxSelect()
  39. {
  40. if(ds_temp_condition.getColumn(0, "indxflag") == "V")
  41. {
  42. //model.toggle("case1");
  43. fIndxListSrch();
  44. }
  45. else if(ds_temp_condition.getColumn(0, "indxflag") == "F")
  46. {
  47. //model.toggle("case2");
  48. fIndxListSrch();
  49. }
  50. else if(ds_temp_condition.getColumn(0, "indxflag") == "P")
  51. {
  52. //model.toggle("case4");
  53. fIndxListSrch();
  54. }
  55. else if(ds_temp_condition.getColumn(0, "indxflag") == "U")
  56. {
  57. //model.toggle("case3");
  58. fIndxListSrch();
  59. }
  60. else if(utlf_isNull(ds_temp_condition.getColumn(0, "indxflag")))
  61. {
  62. //model.toggle("case1");
  63. ds_temp_condition.setColumn(0, "indxflag",'V');
  64. fIndxListSrch();
  65. }
  66. }
  67. function fDeptcdSplit()
  68. {
  69. fTreeSelect();
  70. var deptcd = ds_main_indxlist_item.getColumn(ds_main_indxlist_item.rowposition, "pathcd");
  71. var depth;
  72. depth = String(deptcd).split('.');
  73. var a1 = new Array(depth.length);
  74. var b1 = new Array(depth.length);
  75. var cc = deptcd.size;
  76. var count =0;
  77. for(var i=0; i < depth.length; i++)
  78. {
  79. b1[i]= depth[i];
  80. count++;
  81. }
  82. for(var i = 0; i < count; i++)
  83. {
  84. dsf_makeValue(ds_temp_condition, "depthcd"+(i+1), "Stirng", b1[i]);
  85. dsf_makeValue(ds_temp_condition, "depthcd"+(i+1), "String", b1[i]);
  86. dsf_makeValue(ds_main_indxinfo_imgindx, "depthcd"+(i+1) ,"String", ds_temp_condition.getColumn(0, "depthcd"+(i+1)));
  87. }
  88. ds_temp_condition.setColumn(0, "count",count);
  89. }
  90. function fTreeSelect()
  91. {
  92. fIndxInfoListSrch();
  93. var pathcd = ds_main_indxlist_item.getColumn(ds_main_indxlist_item.rowposition, "pathcd");
  94. var depth = pathcd.split('.');
  95. var a1 = new Array(depth.length);
  96. var b1 = new Array(depth.length);
  97. var cc = pathcd.size;
  98. var count =0;
  99. for(var i = 0; i < depth.length; i++)
  100. {
  101. b1[i]= ds_main_indxlist_item.lookup("itemindxseq", depth[i], "indxnm");
  102. count++;
  103. }
  104. var indx = ds_temp_condition.getColumn(0, "indxflag");
  105. var indxpath = null;
  106. if(indx=="V")
  107. {
  108. indxpath = "ds_main_indxinfo_valindx";
  109. }
  110. else if(indx=="F")
  111. {
  112. indxpath = "ds_main_indxinfo_formindx";
  113. }
  114. else if(indx=="P")
  115. {
  116. indxpath = "ds_main_indxinfo_imgindx";
  117. }
  118. else if(indx=="U")
  119. {
  120. indxpath = "ds_main_indxinfo_unitindx";
  121. }
  122. var ref = eval(indxpath)
  123. for(var i = 0; i < count; i++)
  124. {
  125. dsf_makeValue(ds_temp_condition, "depthnm"+(i+1), "string", b1[i]);
  126. dsf_makeValue(ref, "depthnm"+(i+1), "string" , ds_temp_condition.getColumn(0, "depthnm"+(i+1)));
  127. }
  128. }
  129. function fIndxInfoListSrch()
  130. {
  131. var iIndx = ds_main_indxlist_item.rowposition;
  132. var selIndxCd = ds_main_indxlist_item.getColumn(iIndx, "itemindxseq");
  133. ds_temp_condition.setColumn(0, "rowcnt", iIndx);
  134. ds_temp_condition.setColumn(0, "selectedindx", selIndxCd);
  135. ds_temp_condition.setColumn(0, "focusindx", iIndx);
  136. dsf_makeValue(ds_send, "itemindxseq", "string", selIndxCd );
  137. dsf_makeValue(ds_send, "indxflag", "string", ds_temp_condition.getColumn(0, "indxflag") );
  138. var oParam = {};
  139. oParam.id = "TRMRF01902";
  140. oParam.service = "formmngtapp.IndxMngt";
  141. oParam.method = "reqGetIndxInfo";
  142. oParam.inds = "req=ds_send";
  143. oParam.outds = "ds_main_indxinfo_valindx=valindx ds_main_indxinfo_formindx=formindx ds_main_indxinfo_imgindx=imgindx ds_main_indxinfo_unitindx=unitindx";
  144. oParam.async = false;
  145. //oParam.callback = "cf_TRMRF01902";
  146. tranf_submit(oParam);
  147. }
  148. function findxConfirm()
  149. {
  150. iRow = ds_main_indxlist_item.rowposition;
  151. var indx = ds_temp_condition.getColumn(0, "indxflag");
  152. var indxnm;
  153. var indxpath;
  154. if(indx=="V")
  155. {
  156. indxnm = "valindxnm";
  157. indxpath = "ds_main_indxinfo_valindx";
  158. }
  159. else if(indx=="F")
  160. {
  161. indxnm = "formindxnm";
  162. indxpath = "ds_main_indxinfo_formindx";
  163. }
  164. else if(indx=="P")
  165. {
  166. indxnm = "imgindxnm";
  167. indxpath = "ds_main_indxinfo_imgindx";
  168. }
  169. for(var i=0; i < 5; i++ )
  170. {
  171. opener.frmf_setParameter("depthcd"+(i+1),"");
  172. opener.frmf_setParameter("depthnm"+(i+1),"");
  173. }
  174. var count = ds_temp_condition.getColumn(0, "count");
  175. var indxnm = eval(indxpath).getColumn(0, "indxnm");
  176. for(var i = 0; i < count; i++ )
  177. {
  178. opener.frmf_setParameter("depthnm"+(i+1), eval(indxpath).getColumn(0, "depthnm"+(i+1)));
  179. opener.frmf_setParameter("depthcd"+(i+1), eval(indxpath).getColumn(0, "depthcd"+(i+1)));
  180. }
  181. opener.frmf_setParameter("count",count);
  182. opener.frmf_setParameter("indexcode", ds_main_indxlist_item.getColumn(ds_main_indxlist_item.rowposition, "itemindxseq"));
  183. opener.frmf_setParameter("pathcd", ds_main_indxlist_item.getColumn(ds_main_indxlist_item.rowposition, "pathcd"));
  184. this.close();
  185. }
  186. function fClose()
  187. {
  188. opener.frmf_setParameter("unitnm", "");
  189. this.close();
  190. }
  191. ]]></Script>