123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333 |
- /**
- * @desc : 화면초기화
- *
- * @param :
- * @return :
- * @author : 경북대학교
- * @---------------------------------------------------
- */
- var PARAM;
- function fIni(){
-
- PARAM = getScreenMenuParameter();
- model.setValue("/root/send/param", PARAM);
- grd_studyprojlist.frozenCols = grd_studyprojlist.colRef("rshnm");
-
- zbcfGetCodeList(new Array("I0010") , new Array("/root/init/status"));
- zbcfGetCodeList(new Array("I0010") , new Array("/root/init/grdstatus"));
- zbcfGetCodeList(new Array("I0011") , new Array("/root/init/kind"));
- zbcfGetCodeList(new Array("C0048") , new Array("/root/init/C0048list"));
-
- //addComboItem("cmb_instcd","전체","","above");
- model.setValue(cmb_instcd.attribute("ref") , getUserInfo("dutplceinstcd"));
- model.setValue("/root/main/cond/rshdeptnm" , getUserInfo("dutplcenm"));
- model.setValue("/root/main/cond/rshdeptcd" , getUserInfo("dutplcecd"));
-
- var len = getNodesetCount("/root/init/status");
- for( i = 1 ; i <= len ; i++){
- model.makeNode("/root/init/grdstatus[" + i + "]");
- model.copyNode("/root/init/grdstatus[" + i + "]", "/root/init/status[" + i + "]");
- }
- //addComboItem("cmb_status","-전체-","","above");
- model.setValue("/root/main/cond/ddfrom" , "20090101");
- model.setValue("/root/main/cond/ddto" , getCurrentDate());
- model.setValue("/root/main/cond/ddflag" , "01");
- model.setValue("/root/main/cond/kind" , "-");
- model.setValue("/root/main/cond/chkstatus" , "P" );
- model.setValue("/root/main/cond/status" , "'P'" );
- if (PARAM == "P" || PARAM == "N") {
- model.setValue("/root/main/cond/rshid" , getUserInfo("userid"));
- model.setValue("/root/main/cond/rshnm" , getUserInfo("usernm"));
-
- btn_useid.attribute("visibility") = "hidden";
- btn_new.attribute("visibility") = "hidden";
- btn_excel.attribute("visibility") = "hidden";
- btn_save.attribute("visibility") = "hidden";
- btn_del.attribute("visibility") = "hidden";
- cpt_rshdept.visible = false;
- btn_rshdept.visible = false;
- ipt_rshdeptnm.visible = false;
-
- if( PARAM == "N" ){
- btn_amt.attribute("visibility")="hidden";
- }
- model.setValue("/root/main/cond/rshdeptnm" , "");
- model.setValue("/root/main/cond/rshdeptcd" , "");
-
- cmb_instcd.disabled= false;
- grd_studyprojlist.colDisabled(1) = true;
- model.refresh();
-
- fSearch();
- }else{
- cpt_rshdept.visible = true;
- btn_rshdept.visible = true;
- ipt_rshdeptnm.visible = true;
- cmb_instcd.disabled= true;
- model.refresh();
- }
- }
- function fSearch(){
- if (PARAM == "P" || PARAM == "N") {
- if ( model.getValue("/root/main/cond/rshid") == "" && model.getValue("/root/main/cond/studycd") == "" ) {
- messageBox("과제번호/책임연구원 둘중에 하나를 입력해주십시오.","I999");
- return;
- }
- }
-
- model.makeValue("/root/send/reqdata/ddflag" , model.getValue("/root/main/cond/ddflag"));
- model.makeValue("/root/send/reqdata/status" , model.getValue("/root/main/cond/status"));
- model.makeValue("/root/send/reqdata/kind" , model.getValue("/root/main/cond/kind"));
- model.makeValue("/root/send/reqdata/ddfrom" , model.getValue("/root/main/cond/ddfrom"));
- model.makeValue("/root/send/reqdata/ddto" , model.getValue("/root/main/cond/ddto"));
- model.makeValue("/root/send/reqdata/rshid" , model.getValue("/root/main/cond/rshid"));
- model.makeValue("/root/send/reqdata/studycd" , model.getValue("/root/main/cond/studycd"));
- model.makeValue("/root/send/reqdata/estatus" , model.getValue("/root/main/cond/estatus"));
- model.makeValue("/root/send/reqdata/instcd" , model.getValue("/root/main/cond/instcd"));
- model.makeValue("/root/send/reqdata/rshdeptcd" , model.getValue("/root/main/cond/rshdeptcd"));
- model.makeValue("/root/send/reqdata/rshdeptnm" , model.getValue("/root/main/cond/rshdeptnm"));
-
- if( submit("TRRIS00101") ){
- for(var a = 1; a <= grd_studyprojlist.rows - grd_studyprojlist.fixedRows ; a++ ){
- if( model.getValue("/root/result/studyprojlist[" + a + "]/status") == "P" ){
- grd_studyprojlist.cellstyle("font-weight", a, 2, a, 2 ) = "bold";
- grd_studyprojlist.cellstyle("color", a, 2, a, 2) = "blue";
- }else{
- grd_studyprojlist.cellstyle("font-weight", a, 2, a, 2 ) = "normal";
- grd_studyprojlist.cellstyle("color", a, 2, a, 2) = "black";
- }
- }
- }
- model.refresh();
- }
- function fNew(){
- modal("SPRIS00201");
- }
- function fCnrt(){
- var selectedRow = grd_studyprojlist.row;
-
- if ( selectedRow < 1) {
- messageBox("선택된 row가 없습니다","I999");
- return;
- }
- var projcd=model.getValue("/root/result/studyprojlist["+selectedRow+"]/projcd");
-
- setParameter("SPRIS00210_projcd",projcd);
- open("SPRIS00210");
- }
- function fDetail() {
- var selectedRow = grd_studyprojlist.row;
-
- if (selectedRow < 1) {
- messageBox("선택된 row가 없습니다","I999");
- return;
- }
-
- var projcd = model.getValue("/root/result/studyprojlist["+selectedRow+"]/projcd");
- var studycd = model.getValue("/root/result/studyprojlist["+selectedRow+"]/studycd");
- var instcd = model.getValue("/root/result/studyprojlist["+selectedRow+"]/instcd");
-
- setParameter( "SMRIS00201_procd" , projcd );
- setParameter( "SMRIS00201_studycd" , studycd );
- setParameter( "SMRIS00201_instcd" , instcd );
-
- modal("SPRIS00201");
-
- }
- function fSetUserinfo(){
- setParameter("search_condition","usernm");
- setParameter("resultref","/root/send/userinfo");
- modal("SPZSU10100");
-
- var userinfo = model.getValue("/root/send/userinfo");
-
- userinfo = userinfo.split("|");
- var rshid = userinfo[2];
- var rshnm = userinfo[3];
-
- model.setValue("/root/main/cond/rshid" , rshid );
- model.setValue("/root/main/cond/rshnm" , rshnm );
-
- model.resetInstanceNode("/root/send/userinfo");
-
- model.refresh();
- }
- // 보고서 관리
- function fManStudyReport() {
-
- var selectedRow = grd_studyprojlist.row;
-
- if (selectedRow < 1) {
- messageBox("선택된 row가 없습니다","I999");
- return;
- }
- var studycd = model.getValue("/root/result/studyprojlist["+selectedRow+"]/studycd");
- var rshid = model.getValue("/root/result/studyprojlist["+selectedRow+"]/rshid");
- var rshnm = model.getValue("/root/result/studyprojlist["+selectedRow+"]/rshnm");
-
-
- setParameter("SMRIF02200_menuparam" , PARAM);
- setParameter("SMRIF02200_studycd" , studycd);
- setParameter("SMRIF02200_rshid" , rshid);
- setParameter("SMRIF02200_rshnm" , rshnm);
-
- open("SMRIF02200");
- }
- //보고서 신청서 작성
- function fManStudyReportWrite() {
-
- var selectedRow = grd_studyprojlist.row;
-
- if (selectedRow < 1) {
- messageBox("선택된 row가 없습니다","I999");
- return;
- }
- var studycd = model.getValue("/root/result/studyprojlist["+selectedRow+"]/studycd");
- var rshid = model.getValue("/root/result/studyprojlist["+selectedRow+"]/rshid");
- var rshnm = model.getValue("/root/result/studyprojlist["+selectedRow+"]/rshnm");
- var workkind = model.getValue("/root/result/studyprojlist["+selectedRow+"]/workkind");
-
- setParameter("SMRIF02100_menuparam" , PARAM );
- setParameter("SMRIF02100_studycd" , studycd );
- setParameter("SMRIF02100_rshid" , rshid );
- setParameter("SMRIF02100_rshnm" , rshnm );
- setParameter("SMRIF02100_workkind" , workkind );
- open("SMRIF02100");
- }
- // 연구원 등록 및 조회
- function fManStudyUser() {
- var viewflag = "true";
- if( PARAM == "P" ){
- // 연구원 참여, 공동
- if( model.getValue("/root/result/studyprojlist[" + grd_studyprojlist.row + "]/workkind") != "C"){
- viewflag = "false";
- }else{ // 연구원 책임
- viewflag = "true";
- }
- }else{ // 연구소
- viewflag = "true";
- }
- if( viewflag == "true"){
- var selectedRow = grd_studyprojlist.row;
-
- if (selectedRow < 1) {
- messageBox("선택된 row가 없습니다","I999");
- return;
- }
-
- var studycd = model.getValue("/root/result/studyprojlist["+selectedRow+"]/studycd");
- var rshid = model.getValue("/root/result/studyprojlist["+selectedRow+"]/rshid");
- var rshnm = model.getValue("/root/result/studyprojlist["+selectedRow+"]/rshnm");
- setParameter("SMRIS00600_menuparam" , PARAM);
- setParameter("SMRIS00600_studycd" , studycd);
- setParameter("SMRIS00600_rshid" , rshid);
- setParameter("SMRIS00600_rshnm" , rshnm);
-
- open("SMRIS00600");
- }else{
- messageBox("해당 화면에 권한이 없습니다.","I999");
- return;
- }
- }
- //입출금 내역조회 및 관리
- function fManAmt() {
- var viewflag = "true";
- if( PARAM == "P" ){
- // 연구원 참여, 공동
- if( model.getValue("/root/result/studyprojlist[" + grd_studyprojlist.row + "]/workkind") != "C"){
- viewflag = "false";
- }else{ // 연구원 책임
- viewflag = "true";
- }
- }else{ // 연구소
- viewflag = "true";
- }
-
- if( viewflag == "true"){
- var selectedRow = grd_studyprojlist.row;
-
- if (selectedRow < 1) {
- messageBox("선택된 row가 없습니다","I999");
- return;
- }
-
- var studycd = model.getValue("/root/result/studyprojlist["+selectedRow+"]/studycd");
- var rshid = model.getValue("/root/result/studyprojlist["+selectedRow+"]/rshid");
- var rshnm = model.getValue("/root/result/studyprojlist["+selectedRow+"]/rshnm");
- setParameter("SMRIS00301_menuparam" , PARAM);
- setParameter("SMRIS00301_studycd" , studycd);
- setParameter("SMRIS00301_rshid" , rshid);
- setParameter("SMRIS00301_rshnm" , rshnm);
-
- open("SMRIS00301");
- }else{
- messageBox("해당 화면에 권한이 없습니다.","I999");
- return;
- }
- }
- // 상태값 변경 (관리자 기능) 2013.05.27 cyw
- function fSave(){
- if( model.getValue("/root/main/cond/btnflag") == "1" ){
- // 관리자만 상태변경 가능하도록 수정 2013.05.27 cyw
- if ( messageBox("연구과제 상태값을","Q002")== 6 ) {
- var updtdata = getGridUpdateData(grd_studyprojlist);
- if (updtdata == "" ) {
- messageBox("변경된 데이터가","I004");
- return;
- }
- model.makeNode("/root/send/reqdata/cond");
- model.copyNode("/root/send/reqdata/cond", "/root/main/cond" );
- model.makeValue("/root/send/reqdata/studyprojlist", grd_studyprojlist.getUpdateData());
- if(submit("TXRIS00303")){
- btn_search.dispatch("DOMActivate");
- }
- model.removeNodeset("/root/send/reqdata");
- }
- }else{
- if ( messageBox("해당과제를 제거하시겠습니까?","Q999 ")== 6 ) {
- var updtdata = grd_studyprojlist.row;
- if (updtdata == "" ) {
- messageBox("선택된 데이터가","I004");
- return;
- }
- model.removeNodeset("/root/send/reqdata");
- model.makeNode("/root/send/reqdata/cond");
- model.copyNode("/root/send/reqdata/cond", "/root/main/cond" );
- grd_studyprojlist.addStatus(grd_studyprojlist.row , "update");
- model.makeValue("/root/send/reqdata/studyprojlist", grd_studyprojlist.getUpdateData());
- if(submit("TXRIS00303")){
- model.removeNodeset("/root/send/reqdata");
- btn_search.dispatch("DOMActivate");
- }
- model.removeNodeset("/root/send/reqdata");
- }
- }
- model.refresh();
-
- }
-
|