SMMRJ00200.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371
  1. /* ---------------------------------------------------------------------
  2. ???????????????????????????? (SMMRJ00200_????????????????????????????.xrw - JScript )
  3. - Version :
  4. 1) : Ver.1.00.01
  5. : Create By taebum
  6. : 2009-12-07 ???? 10:05:51
  7. ---------------------------------------------------------------------- */
  8. /* --------------------------------------------------*/
  9. /* type : function */
  10. /* access : public */
  11. /* desc : xforms-ready?? ???????? */
  12. /* return : */
  13. /* --------------------------------------------------*/
  14. var isFirst = "Y";
  15. function fInit() {
  16. ipt_reqfromstnddd.value = getNewDate().getAddDate(-2, "D").getDateFormat("YYYYMMDD").substr(0, 8);
  17. ipt_reqtostnddd.value = getCurrentDate().substr(0, 8);
  18. emrfGetCodeList(new Array("J000000001","J000000002","J000000003","J000000004","J000000005","J000000010","J000000014"), new Array("/root/init/J000000001","/root/init/J000000002","/root/init/J000000003","/root/init/J000000004","/root/init/J000000005","/root/init/J000000010","/root/init/J000000014"));
  19. // isFirst = "N";
  20. fGetOpenPatInfo();
  21. // fSearchPatNm();
  22. model.refresh();
  23. }
  24. function fInitMainList() {
  25. model.resetInstanceNode("/root/main/educordlists/educordlist");
  26. model.removeNodeset("/root/main/educcntslists/educcntslist");
  27. model.refresh();
  28. }
  29. function fGetOpenPatInfo(){
  30. var pid = "";
  31. var orddd = "";
  32. var cretno = "";
  33. var hngnm = "";
  34. var ioflag= "";
  35. if (isPopup() == true) {
  36. // param ????????
  37. pid = opener.javascript.getParameter("SMMRJ00200_pid");
  38. orddd = opener.javascript.getParameter("SMMRJ00200_orddd");
  39. cretno = opener.javascript.getParameter("SMMRJ00200_cretno");
  40. hngnm = opener.javascript.getParameter("SMMRJ00200_hngnm");
  41. ioflag = opener.javascript.getParameter("SMMRJ00200_ioflag");
  42. }
  43. if ( pid == null ) { pid == ""; }
  44. if ( orddd == null ) { orddd == ""; }
  45. if ( cretno == null ) { cretno == ""; }
  46. if ( hngnm == null ) { hngnm == ""; }
  47. if ( ioflag == null ) { ioflag == ""; }
  48. if ( pid != "" && orddd !="" && cretno!="" && hngnm != "" && ioflag!= "") {
  49. model.setValue("/root/send/reqdata/pid", pid);
  50. model.setValue("/root/send/reqdata/ordtype", ioflag);
  51. input1.refresh();
  52. model.makeValue("/root/init/condition/pid", pid);
  53. model.makeValue("/root/init/condition/orddd", orddd);
  54. model.makeValue("/root/init/condition/cretno", cretno);
  55. model.setValue("/root/send/reqdata/pnm", hngnm);
  56. input2.refresh();
  57. fSearchOrdList();
  58. if(pid != "" && hngnm =="" ){
  59. model.setValue("/root/send/reqdata/pid", pid);
  60. fSearchPatNm();
  61. }
  62. } else {
  63. if(pid != "" && hngnm == ""){
  64. model.setValue("/root/send/reqdata/pid", pid);
  65. fSearchPatNm();
  66. }
  67. }
  68. if ( pid == null || pid == "" ) {
  69. // ???? ????????
  70. var node = getGlobalVariable("paminfo");
  71. model.removeNodeset("/root/init/paminfo/list");
  72. setCSVToNode("/root/init/paminfo", node);
  73. pid = model.getValue("/root/init/paminfo/list/pid");
  74. model.makeValue("/root/send/reqdata/pid", pid);
  75. hngnm = model.getValue("/root/init/paminfo/list/hngnm");
  76. model.makeValue("/root/send/reqdata/pnm", hngnm);
  77. ioflag = model.getValue("/root/init/paminfo/list/ioflag");
  78. if(ioflag == "I"||ioflag == "D"||ioflag == "E"){
  79. ioflag = "I";
  80. }
  81. else if(ioflag == "O"){
  82. ioflag = "O";
  83. }
  84. else{
  85. ioflag = "ALL";
  86. }
  87. if(ioflag == "I"){
  88. orddd = model.getValue("/root/init/paminfo/list/indd");
  89. } else {
  90. orddd = model.getValue("/root/init/paminfo/list/orddd");
  91. }
  92. cretno = model.getValue("/root/init/paminfo/list/cretno");
  93. // orddd = "20060428";
  94. // cretno = "800339501";
  95. if ( pid == null ) { pid == ""; }
  96. if ( hngnm == null ) { hngnm == ""; }
  97. if ( orddd == null ) { orddd == ""; }
  98. if ( cretno == null ) { cretno == ""; }
  99. if ( pid != "" && orddd !="" && cretno!="" && hngnm != "") {
  100. model.makeValue("/root/init/condition/pid", pid);
  101. model.makeValue("/root/init/condition/orddd", orddd);
  102. model.makeValue("/root/init/condition/cretno", cretno);
  103. model.setValue("/root/send/reqdata/ordtype", ioflag);
  104. fSearchOrdList();
  105. } else {
  106. model.setFocus("input1")
  107. }
  108. }
  109. }
  110. function fSearchPatNm(){
  111. if(model.getValue("/root/send/reqdata/pid")==""){
  112. return;
  113. }else{
  114. fGetPid("/root/send/reqdata/pid", "/root/send/reqdata/pnm");
  115. }
  116. input2.refresh();
  117. }
  118. function fSearchOrdList(){
  119. model.removeNodeset("/root/init/ordlists");
  120. fInitMainList();
  121. model.refresh();
  122. var ordtype = radio2.value;
  123. if(!(model.getValue("/root/send/reqdata/pnm")=="")){
  124. model.setValue("/root/send/reqdata/ordtype",ordtype);
  125. submit("TRMRJ00102");
  126. if("" == model.getValue("/root/init/condition/pid") && "" == model.getValue("/root/init/condition/orddd") && "" == model.getValue("/root/init/condition/cretno") ){
  127. combo1.select(0);
  128. } else {
  129. fChangeValueOrdList("open");
  130. }
  131. }
  132. }
  133. function fOtherCheck(source, target){
  134. var inOtherYn = isSearchString(document.controls(source).value, "999");
  135. if(!inOtherYn){
  136. document.controls(target).value = "";
  137. }
  138. document.controls(target).visible=inOtherYn;
  139. }
  140. /**
  141. * @desc : ???????????? ???? ????
  142. * @
  143. * @param : refPid - ???????? ???? node path
  144. * refPnm - ?????? ???? node path
  145. * @return :
  146. * @authur : ?????? 2008.03.18
  147. * @---------------------------------------------------
  148. */
  149. function fGetPid(refPid, refPnm)
  150. {
  151. model.setValue("/root/send/reqdata/pnm","");
  152. input2.refresh();
  153. model.removeNodeset("/root/init/ordlists");
  154. fInitMainList();
  155. combo1.refresh();
  156. model.makeNode("/root/main/patinfo/patinfolist");
  157. //?????????? 1???? ???? ???????? ???? ??????.
  158. model.makeValue("/root/hidden/tmp/pidpopupinfo/checkfnexam", "1");
  159. model.makeValue("/root/hidden/tmp/pidpopupinfo/autoflag", "Y");
  160. model.makeValue("/root/hidden/tmp/pidpopupinfo/pid", model.getValue(refPid));
  161. // model.makeValue("/root/hidden/tmp/pidpopupinfo/hngnm", model.getValue(refPnm));
  162. if( model.getValue("/root/hidden/tmp/pidpopupinfo/srchcond") == '' ){
  163. model.makeValue("/root/hidden/tmp/pidpopupinfo/srchcond", '1');
  164. }
  165. modal("SPPMC02500", "1","150", "150", "SPPMC02500", "/root/hidden/tmp/pidpopupinfo", "/root/send");
  166. model.resetInstanceNode("/root/source");
  167. //???????? copy
  168. var popupendflag = model.getValue("/root/main/popupendflag");
  169. if (popupendflag == "ok")
  170. {
  171. model.makeValue(refPid, model.getValue("/root/main/patinfo/patinfolist/pid"));
  172. if (refPnm == null) { refPnm = "" }
  173. if (refPnm != "") {
  174. model.makeValue(refPnm, model.getValue("/root/main/patinfo/patinfolist/hngnm"));
  175. }
  176. model.refresh();
  177. fSearchOrdList();
  178. }
  179. }
  180. function fChangeValueOrdList(value){
  181. var ordtype = "";
  182. var i = 0;
  183. if( value == "open" && model.getValue("/root/init/condition/pid") !="" && model.getValue("/root/init/condition/orddd") != "" && model.getValue("/root/init/condition/cretno") != ""){
  184. for(i=1;i<=combo1.length; i++ ){
  185. if(model.getValue("/root/init/ordlists/ordlist["+i+"]/suminfo") == model.getValue("/root/init/condition/pid")+model.getValue("/root/init/condition/orddd")+model.getValue("/root/init/condition/cretno")){
  186. model.removenode("/root/init/condition");
  187. combo1.select(i-1);
  188. }
  189. }
  190. }else{
  191. model.setValue("/root/search/pid" , model.getValue("/root/init/ordlists/ordlist["+(combo1.focusIndex+1)+"]/pid"));
  192. model.setValue("/root/search/orddd" , model.getValue("/root/init/ordlists/ordlist["+(combo1.focusIndex+1)+"]/orddd"));
  193. model.setValue("/root/search/cretno" ,model.getValue("/root/init/ordlists/ordlist["+(combo1.focusIndex+1)+"]/cretno"));
  194. model.setValue("/root/search/ordtype" ,model.getValue("/root/init/ordlists/ordlist["+(combo1.focusIndex+1)+"]/ordtype"));
  195. model.setValue("/root/search/fromdd" ,model.getValue("/root/init/ordlists/ordlist["+(combo1.focusIndex+1)+"]/orddd"));
  196. ordtype = model.getValue("/root/init/ordlists/ordlist["+(combo1.focusIndex+1)+"]/ordtype");
  197. if(ordtype == "I"){
  198. checkbox1.deselect(0);
  199. }else{
  200. checkbox1.select(0);
  201. }
  202. fSelectOrdCntsList();
  203. }
  204. }
  205. function fSelectOrdCntsList(){
  206. fInitMainList();
  207. submit("TRMRJ00201");
  208. fCheckOtherYn(ipt_eduwho9 ,chk_eduwho9.value);
  209. fCheckOtherYn(ipt_eduhandcap9 ,chk_eduhandcap9ck.value);
  210. fCheckOtherYn(ipt_eduway9 ,chk_eduway9ck.value);
  211. fCheckOtherYn(ipt_eduneed9 ,chk_eduneed9ck.value);
  212. if(rdo_eduwill.value== "999"){
  213. fCheckOtherYn(ipt_eduwill9,"Y");
  214. }else{
  215. fCheckOtherYn(ipt_eduwill9,"N");
  216. }
  217. fColDisableChk();
  218. }
  219. function fClickDeleteBtn(){
  220. var cur_row = datagrid1.row; // ?? ???? ????????
  221. if (getUserId()!=model.getValue("/root/main/educcntslists/educcntslist["+cur_row+"]/fstrgstrid")&&model.getValue("/root/main/educcntslists/educcntslist["+cur_row+"]/fstrgstrid")!=""){
  222. alert("???? ?????? ?????? ???????? ??????????...!");
  223. return;
  224. }
  225. if (model.getValue("/root/main/educcntslists/educcntslist["+cur_row+"]/linkcd")!="-"&&model.getValue("/root/main/educcntslists/educcntslist["+cur_row+"]/fstrgstrid")!=""){
  226. alert("???? ???????? ?????? ?????????? ???? ?????? ?????? ??????...!");
  227. return;
  228. }
  229. var iStatus = datagrid1.rowstatus(cur_row);
  230. if(cur_row <= 0 || cur_row =="undefined") {
  231. alert("?????? ???? ?????????? ????????...");
  232. return;
  233. }
  234. if (iStatus == 1 || iStatus == 3){ // ???? ?????? ??????
  235. datagrid1.deleteitem(cur_row);
  236. }else if (iStatus == 4){ // ?????? ?????? ??????
  237. datagrid1.removestatus(cur_row, "delete");
  238. }else{
  239. datagrid1.addStatus(cur_row, "delete");
  240. }
  241. }
  242. function fGetAddPopup(){
  243. vPid = model.getValue("/root/search/pid");
  244. vOrddd = model.getValue("/root/search/orddd");
  245. vCretno = model.getValue("/root/search/cretno");
  246. setParameter("SPMRJ00200_pid" ,vPid);
  247. setParameter("SPMRJ00200_orddd" ,vOrddd);
  248. setParameter("SPMRJ00200_cretno",vCretno);
  249. modal("SPMRJ00200");
  250. /*
  251. * ???? ???? ???? ?????? ???? ???? ?????? ????
  252. */
  253. // modal("SPMRJ00200", 1, 0, 0, "", "", "", "left:0; right:0; width:0; height:0; sysmenu:hidden; min:hidden, max:hidden;");
  254. fSelectOrdCntsList();
  255. }
  256. function fCheckOtherYn(ipt, param){
  257. if(param=="Y"){
  258. ipt.visible = true;
  259. }else{
  260. ipt.visible = false;
  261. ipt.value = "";
  262. }
  263. }
  264. function fColDisableChk(){
  265. var rowSize = datagrid1.rows
  266. for (i=1;i <rowSize; i++){
  267. if (getUserId()!=model.getValue("/root/main/educcntslists/educcntslist["+i+"]/fstrgstrid")||model.getValue("/root/main/educcntslists/educcntslist["+i+"]/linkcd")!="-"){
  268. datagrid1.cellAttribute("disabled", i, 1, i, 8) = "true";
  269. datagrid1.cellstyle("background-color", i,1,i,8) = "#E6E6E6";
  270. }
  271. }
  272. }
  273. function fClose(){
  274. window.close();
  275. }
  276. function fGetSearchNeed(row)
  277. {
  278. model.removeNode("root/searchneed");
  279. model.makeNode("root/searchneed");
  280. model.makeValue("root/searchneed/instcd",model.getValue("root/main/educorddaylists/educorddaylist["+row+"]/instcd"));
  281. model.makeValue("root/searchneed/pid",model.getValue("root/main/educorddaylists/educorddaylist["+row+"]/pid"));
  282. model.makeValue("root/searchneed/orddd",model.getValue("root/main/educorddaylists/educorddaylist["+row+"]/orddd"));
  283. model.makeValue("root/searchneed/cretno",model.getValue("root/main/educorddaylists/educorddaylist["+row+"]/cretno"));
  284. model.makeValue("root/searchneed/histno",model.getValue("root/main/educorddaylists/educorddaylist["+row+"]/histno"));
  285. submit("TRMRJ00203");
  286. fCheckOtherYn(ipt_eduwho9 ,chk_eduwho9.value);
  287. fCheckOtherYn(ipt_eduhandcap9 ,chk_eduhandcap9ck.value);
  288. fCheckOtherYn(ipt_eduway9 ,chk_eduway9ck.value);
  289. fCheckOtherYn(ipt_eduneed9 ,chk_eduneed9ck.value);
  290. if(rdo_eduwill.value== "999"){
  291. fCheckOtherYn(ipt_eduwill9,"Y");
  292. }else{
  293. fCheckOtherYn(ipt_eduwill9,"N");
  294. }
  295. }