SMRIS00101.js 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333
  1. /**
  2. * @desc : 화면초기화
  3. *
  4. * @param :
  5. * @return :
  6. * @author : 경북대학교
  7. * @---------------------------------------------------
  8. */
  9. var PARAM;
  10. function fIni(){
  11. PARAM = getScreenMenuParameter();
  12. model.setValue("/root/send/param", PARAM);
  13. grd_studyprojlist.frozenCols = grd_studyprojlist.colRef("rshnm");
  14. zbcfGetCodeList(new Array("I0010") , new Array("/root/init/status"));
  15. zbcfGetCodeList(new Array("I0010") , new Array("/root/init/grdstatus"));
  16. zbcfGetCodeList(new Array("I0011") , new Array("/root/init/kind"));
  17. zbcfGetCodeList(new Array("C0048") , new Array("/root/init/C0048list"));
  18. //addComboItem("cmb_instcd","전체","","above");
  19. model.setValue(cmb_instcd.attribute("ref") , getUserInfo("dutplceinstcd"));
  20. model.setValue("/root/main/cond/rshdeptnm" , getUserInfo("dutplcenm"));
  21. model.setValue("/root/main/cond/rshdeptcd" , getUserInfo("dutplcecd"));
  22. var len = getNodesetCount("/root/init/status");
  23. for( i = 1 ; i <= len ; i++){
  24. model.makeNode("/root/init/grdstatus[" + i + "]");
  25. model.copyNode("/root/init/grdstatus[" + i + "]", "/root/init/status[" + i + "]");
  26. }
  27. //addComboItem("cmb_status","-전체-","","above");
  28. model.setValue("/root/main/cond/ddfrom" , "20090101");
  29. model.setValue("/root/main/cond/ddto" , getCurrentDate());
  30. model.setValue("/root/main/cond/ddflag" , "01");
  31. model.setValue("/root/main/cond/kind" , "-");
  32. model.setValue("/root/main/cond/chkstatus" , "P" );
  33. model.setValue("/root/main/cond/status" , "'P'" );
  34. if (PARAM == "P" || PARAM == "N") {
  35. model.setValue("/root/main/cond/rshid" , getUserInfo("userid"));
  36. model.setValue("/root/main/cond/rshnm" , getUserInfo("usernm"));
  37. btn_useid.attribute("visibility") = "hidden";
  38. btn_new.attribute("visibility") = "hidden";
  39. btn_excel.attribute("visibility") = "hidden";
  40. btn_save.attribute("visibility") = "hidden";
  41. btn_del.attribute("visibility") = "hidden";
  42. cpt_rshdept.visible = false;
  43. btn_rshdept.visible = false;
  44. ipt_rshdeptnm.visible = false;
  45. if( PARAM == "N" ){
  46. btn_amt.attribute("visibility")="hidden";
  47. }
  48. model.setValue("/root/main/cond/rshdeptnm" , "");
  49. model.setValue("/root/main/cond/rshdeptcd" , "");
  50. cmb_instcd.disabled= false;
  51. grd_studyprojlist.colDisabled(1) = true;
  52. model.refresh();
  53. fSearch();
  54. }else{
  55. cpt_rshdept.visible = true;
  56. btn_rshdept.visible = true;
  57. ipt_rshdeptnm.visible = true;
  58. cmb_instcd.disabled= true;
  59. model.refresh();
  60. }
  61. }
  62. function fSearch(){
  63. if (PARAM == "P" || PARAM == "N") {
  64. if ( model.getValue("/root/main/cond/rshid") == "" && model.getValue("/root/main/cond/studycd") == "" ) {
  65. messageBox("과제번호/책임연구원 둘중에 하나를 입력해주십시오.","I999");
  66. return;
  67. }
  68. }
  69. model.makeValue("/root/send/reqdata/ddflag" , model.getValue("/root/main/cond/ddflag"));
  70. model.makeValue("/root/send/reqdata/status" , model.getValue("/root/main/cond/status"));
  71. model.makeValue("/root/send/reqdata/kind" , model.getValue("/root/main/cond/kind"));
  72. model.makeValue("/root/send/reqdata/ddfrom" , model.getValue("/root/main/cond/ddfrom"));
  73. model.makeValue("/root/send/reqdata/ddto" , model.getValue("/root/main/cond/ddto"));
  74. model.makeValue("/root/send/reqdata/rshid" , model.getValue("/root/main/cond/rshid"));
  75. model.makeValue("/root/send/reqdata/studycd" , model.getValue("/root/main/cond/studycd"));
  76. model.makeValue("/root/send/reqdata/estatus" , model.getValue("/root/main/cond/estatus"));
  77. model.makeValue("/root/send/reqdata/instcd" , model.getValue("/root/main/cond/instcd"));
  78. model.makeValue("/root/send/reqdata/rshdeptcd" , model.getValue("/root/main/cond/rshdeptcd"));
  79. model.makeValue("/root/send/reqdata/rshdeptnm" , model.getValue("/root/main/cond/rshdeptnm"));
  80. if( submit("TRRIS00101") ){
  81. for(var a = 1; a <= grd_studyprojlist.rows - grd_studyprojlist.fixedRows ; a++ ){
  82. if( model.getValue("/root/result/studyprojlist[" + a + "]/status") == "P" ){
  83. grd_studyprojlist.cellstyle("font-weight", a, 2, a, 2 ) = "bold";
  84. grd_studyprojlist.cellstyle("color", a, 2, a, 2) = "blue";
  85. }else{
  86. grd_studyprojlist.cellstyle("font-weight", a, 2, a, 2 ) = "normal";
  87. grd_studyprojlist.cellstyle("color", a, 2, a, 2) = "black";
  88. }
  89. }
  90. }
  91. model.refresh();
  92. }
  93. function fNew(){
  94. modal("SPRIS00201");
  95. }
  96. function fCnrt(){
  97. var selectedRow = grd_studyprojlist.row;
  98. if ( selectedRow < 1) {
  99. messageBox("선택된 row가 없습니다","I999");
  100. return;
  101. }
  102. var projcd=model.getValue("/root/result/studyprojlist["+selectedRow+"]/projcd");
  103. setParameter("SPRIS00210_projcd",projcd);
  104. open("SPRIS00210");
  105. }
  106. function fDetail() {
  107. var selectedRow = grd_studyprojlist.row;
  108. if (selectedRow < 1) {
  109. messageBox("선택된 row가 없습니다","I999");
  110. return;
  111. }
  112. var projcd = model.getValue("/root/result/studyprojlist["+selectedRow+"]/projcd");
  113. var studycd = model.getValue("/root/result/studyprojlist["+selectedRow+"]/studycd");
  114. var instcd = model.getValue("/root/result/studyprojlist["+selectedRow+"]/instcd");
  115. setParameter( "SMRIS00201_procd" , projcd );
  116. setParameter( "SMRIS00201_studycd" , studycd );
  117. setParameter( "SMRIS00201_instcd" , instcd );
  118. modal("SPRIS00201");
  119. }
  120. function fSetUserinfo(){
  121. setParameter("search_condition","usernm");
  122. setParameter("resultref","/root/send/userinfo");
  123. modal("SPZSU10100");
  124. var userinfo = model.getValue("/root/send/userinfo");
  125. userinfo = userinfo.split("|");
  126. var rshid = userinfo[2];
  127. var rshnm = userinfo[3];
  128. model.setValue("/root/main/cond/rshid" , rshid );
  129. model.setValue("/root/main/cond/rshnm" , rshnm );
  130. model.resetInstanceNode("/root/send/userinfo");
  131. model.refresh();
  132. }
  133. // 보고서 관리
  134. function fManStudyReport() {
  135. var selectedRow = grd_studyprojlist.row;
  136. if (selectedRow < 1) {
  137. messageBox("선택된 row가 없습니다","I999");
  138. return;
  139. }
  140. var studycd = model.getValue("/root/result/studyprojlist["+selectedRow+"]/studycd");
  141. var rshid = model.getValue("/root/result/studyprojlist["+selectedRow+"]/rshid");
  142. var rshnm = model.getValue("/root/result/studyprojlist["+selectedRow+"]/rshnm");
  143. setParameter("SMRIF02200_menuparam" , PARAM);
  144. setParameter("SMRIF02200_studycd" , studycd);
  145. setParameter("SMRIF02200_rshid" , rshid);
  146. setParameter("SMRIF02200_rshnm" , rshnm);
  147. open("SMRIF02200");
  148. }
  149. //보고서 신청서 작성
  150. function fManStudyReportWrite() {
  151. var selectedRow = grd_studyprojlist.row;
  152. if (selectedRow < 1) {
  153. messageBox("선택된 row가 없습니다","I999");
  154. return;
  155. }
  156. var studycd = model.getValue("/root/result/studyprojlist["+selectedRow+"]/studycd");
  157. var rshid = model.getValue("/root/result/studyprojlist["+selectedRow+"]/rshid");
  158. var rshnm = model.getValue("/root/result/studyprojlist["+selectedRow+"]/rshnm");
  159. var workkind = model.getValue("/root/result/studyprojlist["+selectedRow+"]/workkind");
  160. setParameter("SMRIF02100_menuparam" , PARAM );
  161. setParameter("SMRIF02100_studycd" , studycd );
  162. setParameter("SMRIF02100_rshid" , rshid );
  163. setParameter("SMRIF02100_rshnm" , rshnm );
  164. setParameter("SMRIF02100_workkind" , workkind );
  165. open("SMRIF02100");
  166. }
  167. // 연구원 등록 및 조회
  168. function fManStudyUser() {
  169. var viewflag = "true";
  170. if( PARAM == "P" ){
  171. // 연구원 참여, 공동
  172. if( model.getValue("/root/result/studyprojlist[" + grd_studyprojlist.row + "]/workkind") != "C"){
  173. viewflag = "false";
  174. }else{ // 연구원 책임
  175. viewflag = "true";
  176. }
  177. }else{ // 연구소
  178. viewflag = "true";
  179. }
  180. if( viewflag == "true"){
  181. var selectedRow = grd_studyprojlist.row;
  182. if (selectedRow < 1) {
  183. messageBox("선택된 row가 없습니다","I999");
  184. return;
  185. }
  186. var studycd = model.getValue("/root/result/studyprojlist["+selectedRow+"]/studycd");
  187. var rshid = model.getValue("/root/result/studyprojlist["+selectedRow+"]/rshid");
  188. var rshnm = model.getValue("/root/result/studyprojlist["+selectedRow+"]/rshnm");
  189. setParameter("SMRIS00600_menuparam" , PARAM);
  190. setParameter("SMRIS00600_studycd" , studycd);
  191. setParameter("SMRIS00600_rshid" , rshid);
  192. setParameter("SMRIS00600_rshnm" , rshnm);
  193. open("SMRIS00600");
  194. }else{
  195. messageBox("해당 화면에 권한이 없습니다.","I999");
  196. return;
  197. }
  198. }
  199. //입출금 내역조회 및 관리
  200. function fManAmt() {
  201. var viewflag = "true";
  202. if( PARAM == "P" ){
  203. // 연구원 참여, 공동
  204. if( model.getValue("/root/result/studyprojlist[" + grd_studyprojlist.row + "]/workkind") != "C"){
  205. viewflag = "false";
  206. }else{ // 연구원 책임
  207. viewflag = "true";
  208. }
  209. }else{ // 연구소
  210. viewflag = "true";
  211. }
  212. if( viewflag == "true"){
  213. var selectedRow = grd_studyprojlist.row;
  214. if (selectedRow < 1) {
  215. messageBox("선택된 row가 없습니다","I999");
  216. return;
  217. }
  218. var studycd = model.getValue("/root/result/studyprojlist["+selectedRow+"]/studycd");
  219. var rshid = model.getValue("/root/result/studyprojlist["+selectedRow+"]/rshid");
  220. var rshnm = model.getValue("/root/result/studyprojlist["+selectedRow+"]/rshnm");
  221. setParameter("SMRIS00301_menuparam" , PARAM);
  222. setParameter("SMRIS00301_studycd" , studycd);
  223. setParameter("SMRIS00301_rshid" , rshid);
  224. setParameter("SMRIS00301_rshnm" , rshnm);
  225. open("SMRIS00301");
  226. }else{
  227. messageBox("해당 화면에 권한이 없습니다.","I999");
  228. return;
  229. }
  230. }
  231. // 상태값 변경 (관리자 기능) 2013.05.27 cyw
  232. function fSave(){
  233. if( model.getValue("/root/main/cond/btnflag") == "1" ){
  234. // 관리자만 상태변경 가능하도록 수정 2013.05.27 cyw
  235. if ( messageBox("연구과제 상태값을","Q002")== 6 ) {
  236. var updtdata = getGridUpdateData(grd_studyprojlist);
  237. if (updtdata == "" ) {
  238. messageBox("변경된 데이터가","I004");
  239. return;
  240. }
  241. model.makeNode("/root/send/reqdata/cond");
  242. model.copyNode("/root/send/reqdata/cond", "/root/main/cond" );
  243. model.makeValue("/root/send/reqdata/studyprojlist", grd_studyprojlist.getUpdateData());
  244. if(submit("TXRIS00303")){
  245. btn_search.dispatch("DOMActivate");
  246. }
  247. model.removeNodeset("/root/send/reqdata");
  248. }
  249. }else{
  250. if ( messageBox("해당과제를 제거하시겠습니까?","Q999 ")== 6 ) {
  251. var updtdata = grd_studyprojlist.row;
  252. if (updtdata == "" ) {
  253. messageBox("선택된 데이터가","I004");
  254. return;
  255. }
  256. model.removeNodeset("/root/send/reqdata");
  257. model.makeNode("/root/send/reqdata/cond");
  258. model.copyNode("/root/send/reqdata/cond", "/root/main/cond" );
  259. grd_studyprojlist.addStatus(grd_studyprojlist.row , "update");
  260. model.makeValue("/root/send/reqdata/studyprojlist", grd_studyprojlist.getUpdateData());
  261. if(submit("TXRIS00303")){
  262. model.removeNodeset("/root/send/reqdata");
  263. btn_search.dispatch("DOMActivate");
  264. }
  265. model.removeNodeset("/root/send/reqdata");
  266. }
  267. }
  268. model.refresh();
  269. }