123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384 |
- var isUpdated = false;
- /**
- * @desc : 화면초기화
- *
- * @param :
- * @return :
- * @author : 경북대학교
- * @---------------------------------------------------
- */
- var studentparam = "";
- function fInit(){
-
- zbcfGetCodeList(new Array("I0010" // 종결/진행/삭제
- ,"I0012"), // 업무구분( 수익, 비용, 첨부)
- new Array("/root/init/status"
- ,"/root/init/bizflaglist"));
-
- if (isPopup()) {
-
- var menuparam = opener.window.javascript.getParameter("SMRIS00301_menuparam");
-
- var rshid = opener.window.javascript.getParameter("SMRIS00301_rshid");
- var rshnm = opener.window.javascript.getParameter("SMRIS00301_rshnm");
- var studycd = opener.window.javascript.getParameter("SMRIS00301_studycd");
-
- model.setValue("/root/send/searchproj/rshid", rshid);
- model.setValue("/root/send/searchproj/rshnm", rshnm);
- model.setValue("/root/send/searchproj/studycd", studycd);
- model.setValue("/root/send/searchproj/estatus", "Y" );
-
- if (menuparam == "P") {
- grp_buttons.attribute("visibility")="hidden";
- btn_useid.attribute("visibility")="hidden";
- button6.attribute("visibility")="hidden";
- btn_comps.attribute("visibility")="hidden";
- btn_docu.attribute("visibility")="hidden";
- studentparam = "P";
- button8.dispatch("DOMActivate");
- }
-
- if (studycd != "") {
- fSearch();
- grd_proj.row = 1;
- fGetamtmaster();
- }
- }
- cbx_e.value = "Y";
- model.refresh();
-
- }
- function fSearch(){
- model.removenode("/root/main/studyprojinfo/studyprojlist");
- model.removenode("/root/main/ioamtinfo/ioamtlist");
- model.removenode("/root/main/ioamtdinfo/ioamtdlist");
- model.removenode("/root/main/attdoculst/attdoculst");
-
- submit("TRRIS00301");
-
- model.refresh();
-
- }
- //금액마스터
- function fGetamtmaster() {
-
- var idx = grd_proj.row;
-
- model.copyNode("/root/main/ioamtmain","/root/main/studyprojinfo/studyprojlist[" + idx + "]");
- model.makeValue("/root/send/reqdata/instcd" , model.getValue("/root/main/studyprojinfo/studyprojlist[" + idx + "]/instcd"));
- model.makeValue("/root/send/reqdata/projcd" , model.getValue("/root/main/studyprojinfo/studyprojlist[" + idx + "]/projcd"));
- model.makeValue("/root/send/reqdata/studentparam" , studentparam);
-
- var totiamt = 0;
- var totoamt = 0;
-
- if( submit("TRRIS00302") ){
- // 입금액, 지출액 계산 2013.05.23 cyw
- for( var i = 1; i <= grd_ioamtlist.rows-grd_ioamtlist.fixedRows; i++ ){
- if( model.getValue("/root/main/ioamtinfo/ioamtlist[" + i + "]/bizflag") == "I" ){
- totiamt = totiamt + parseInt(model.getValue("/root/main/ioamtinfo/ioamtlist[" + i + "]/totamt"));
- }
- if( model.getValue("/root/main/ioamtinfo/ioamtlist[" + i + "]/bizflag") == "O" ){
- totoamt = totoamt + parseInt(model.getValue("/root/main/ioamtinfo/ioamtlist[" + i + "]/totamt"));
- }
- }
- model.makeValue("/root/main/ioamtmain/bstotiamt" , totiamt );
- model.makeValue("/root/main/ioamtmain/bstotoamt" , totoamt );
- model.makeValue("/root/main/ioamtmain/bstotjamt" , totiamt-totoamt );
- }
- if (studentparam == "P") {
- button6.dispatch("DOMActivate");
- }
- model.refresh();
- var master = "event";
- fGetamtdetail(master); //입출금 상세내역 & 첨부파일 상세내역
- MdlLst(); // 첨부파일 중분류값 조회
- }
- function MdlLst(){
- model.makeValue("/root/main/ioamtmain/seqno","");
- model.makeValue("/root/main/ioamtmain/bsdd",getCurrentDate());
-
- model.removeNodeSet("/root/send/reqdata");
-
- model.makeValue("/root/send/reqdata/kind" , model.getValue("/root/main/ioamtmain/kind"));
- model.makeValue("/root/send/reqdata/bsdd" , model.getValue("/root/main/ioamtmain/bsdd"));
-
- submit("TRRIS00309");
-
- model.refresh();
- }
- function fDelMaster(bizflag){
-
- if( bizflag != "A"){
- var projcd = model.getValue("/root/main/ioamtmain/projcd");
- var bizflag = model.getValue("/root/main/ioamtmain/bizflag");
- var seqno = model.getValue("/root/main/ioamtmain/seqno");
- }
- else{
-
- var projcd = model.getValue("/root/main/attdoculst/attdoculst/projcd");
- var bizflag = model.getValue("/root/main/attdoculst/attdoculst/bizflag");
- var seqno = model.getValue("/root/main/attdoculst/attdoculst/seqno");
- }
-
- model.makeValue("/root/send/reqdata/projcd" , projcd);
- model.makeValue("/root/send/reqdata/bizflag" , bizflag);
- model.makeValue("/root/send/reqdata/seqno" ,seqno);
-
-
- if (projcd=="") {
- return;
- }
-
- if (bizflag=="") {
- return;
- }
-
- if (seqno=="") {
- messageBox("삭제대상이 아닙니다","I");
- return;
- }
-
- var vbYes = messageBox("삭제 하시겠습니까?", "Q999");
-
- if(vbYes != 6){
- return;
- }
-
- submit("TXRIS00302");
-
- var cnt = model.getValue("/root/hidden/ioamt/cnt");
-
- if (cnt > 0) {
- messageBox("정상적으로 삭제되었습니다!","I999");
- model.removeNodeset(grd_attdoculst.nodeset);
- }
-
- fGetamtmaster();
- model.refresh();
-
- }
- //금액 detail
- function fGetamtdetail(bizflag) {
-
- var idx = grd_ioamtlist.row;
-
- var projcd = model.getValue("/root/main/ioamtinfo/ioamtlist[" + idx + "]/projcd");
- var bizflag = model.getValue("/root/main/ioamtinfo/ioamtlist[" + idx + "]/bizflag");
- var seqno = model.getValue("/root/main/ioamtinfo/ioamtlist[" + idx + "]/seqno");
- var kind = model.getValue("/root/main/ioamtinfo/ioamtlist[" + idx + "]/kind");
- var bsdd = model.getValue("/root/main/ioamtinfo/ioamtlist[" + idx + "]/bsdd");
- var instcd = model.getValue("/root/main/ioamtinfo/ioamtlist[" + idx + "]/instcd");
- var status = model.getValue("/root/main/ioamtinfo/ioamtlist[" + idx + "]/status");
- var studycd = model.getValue("/root/main/ioamtinfo/ioamtlist[" + idx + "]/studycd");
-
-
- if (bsdd=="") {
- bsdd = getCurrentDate();
- }
-
- model.makeValue("/root/main/ioamtmain/bsdd",getCurrentDate());
- model.makeValue("/root/main/ioamtmain/bizflag",bizflag);
- model.makeValue("/root/main/ioamtmain/seqno",seqno);
- model.makeValue("/root/main/ioamtmain/status",status);
-
-
- model.makeValue("/root/send/reqdata/instcd" , instcd);
- model.makeValue("/root/send/reqdata/projcd" , projcd);
- model.makeValue("/root/send/reqdata/bizflag" , bizflag);
- model.makeValue("/root/send/reqdata/seqno" , seqno);
- model.makeValue("/root/send/reqdata/kind" , kind);
- model.makeValue("/root/send/reqdata/status" , status);
- //model.makeValue("/root/send/reqdata/bsdd" , bsdd);
-
- if (bizflag == "A") {
- submit("TRRIS00310");
- }
- else {
- submit("TRRIS00303");
- }
- model.refresh();
- }
- function fNewDetail(bizflag){
-
- model.makeValue("/root/main/ioamtmain/bizflag",bizflag);
- model.makeValue("/root/main/ioamtmain/seqno","");
-
-
- if (bizflag == "I" || bizflag == "O") {
- model.toggle("case1");
- btn_comps.selected = true;
-
-
- model.removeNodeSet("/root/send/reqdata");
-
- model.makeValue("/root/send/reqdata/kind" , model.getValue("/root/main/ioamtmain/kind"));
- model.makeValue("/root/send/reqdata/bsdd" , model.getValue("/root/main/ioamtmain/bsdd"));
- model.makeValue("/root/send/reqdata/bizflag" ,bizflag);
- model.makeValue("/root/send/reqdata/projcd" ,"");
- model.makeValue("/root/send/reqdata/seqno" ,"");
-
- submit("TRRIS00303"); //reqGetAMTdList
- }
- else if (bizflag=="A") {
- model.toggle("case3");
- btn_docu.selected = true;
-
- model.removeNodeset(grd_attdoculst.nodeset);
- var xreqdesc = "/root/main/attdoculst/attdoculst";
- var maxsize = upload1.attribute("filesize");
-
- //파일을 받아오기 위해 파일열기 팝업창을 띄운다.
- var fileopen = window.fileDialog("open","|","false");
-
- var pos = fileopen.lastIndexOf("\\");
- var filename = fileopen.substring(pos + 1);
-
- model.makeValue(xreqdesc + "/attfilenm", filename);
- model.makeValue(xreqdesc + "/bsdd", model.getValue("/root/main/ioamtmain/bsdd"));
- model.makeValue(xreqdesc + "/projcd",model.getValue("/root/main/ioamtmain/projcd"));
- model.makeValue(xreqdesc + "/kind", model.getValue("/root/main/ioamtmain/kind"));
- model.makeValue(xreqdesc + "/bigo","");
- model.makeValue(xreqdesc + "/bizflag",bizflag);
- model.makeValue(xreqdesc + "/amtcd","-");
- model.makeValue(xreqdesc + "/amt",0);
-
- //선택한 파일이 저장버튼을 눌렀을때 저장이 되게 하기 위해 파일 저장 인스턴스에 파일주소를 저장해 둔다.
- model.makeValue("/root/send/savedata/file", fileopen);
-
- //파일 크기가 너무 큰경우 메세지를 띄운다.
- if (!checkFileSize(upload1)){
- messageBox("파일 크기가 최대치(" + maxsize + "Byte)를", "E003");
- model.removeNodeset(grd_attdoculst.nodeset);
- return;
- }
-
-
- model.refresh();
-
-
- }
-
- model.refresh();
- }
- 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/send/searchproj/rshid",rshid);
- model.setValue("/root/send/searchproj/rshnm",rshnm);
-
- model.resetInstanceNode("/root/send/userinfo");
-
- model.refresh();
-
-
- }
- function fSave(flag) {
- var projcd = model.getValue("/root/main/ioamtmain/projcd");
- var bsdd = model.getValue("/root/main/ioamtmain/bsdd");
- var seqno = model.getValue("/root/main/ioamtmain/seqno");
- var bizflag = model.getValue("/root/main/ioamtmain/bizflag");
- var status = model.getValue("/root/main/ioamtmain/status");
- var kind = model.getValue("/root/main/ioamtmain/kind");
-
- model.makeValue("/root/send/savedata/ioamtlist/bsdd",bsdd);
- model.makeValue("/root/send/savedata/ioamtlist/projcd",projcd);
- model.makeValue("/root/send/savedata/ioamtlist/bizflag",bizflag);
- model.makeValue("/root/send/savedata/ioamtlist/seqno",seqno);
- model.makeValue("/root/send/savedata/ioamtlist/status",status);
- model.makeValue("/root/send/savedata/ioamtlist/kind",kind);
-
- if (flag=="IO") {
- // 입출금 상세내역
- if (grd_ioamtdlist.rows == 1 ) {
- return;
- }
- for (i=1; i<grd_ioamtdlist.rows ; i++) {
- grd_ioamtdlist.addStatus(i, "insert");
- }
- model.makeValue("/root/send/savedata/ioamtdlist", grd_ioamtdlist.getUpdateData());
- }
- else if (flag=="A") {
- // 문서등록내역
- if (grd_attdoculst.rows == 1 ) {
- return;
- }
- for (i=1; i<grd_attdoculst.rows ; i++) {
- grd_attdoculst.addStatus(i, "insert");
- }
- var seqno = model.getValue("/root/main/attdoculst/attdoculst/seqno");
-
- if (seqno !="" ) {
- messageBox("자료수정은 불가합니다","I");
- return;
- }
-
- model.makeValue("/root/send/savedata/attdoculst", grd_attdoculst.getUpdateData());
- }
-
- submit("TXRIS00301");
- fGetamtmaster();
- model.removeNodeSet("/root/send/savedata");
- }
- function fDownLoad(flag) {
-
- if(model.getValue("/root/main/attdoculst/attdoculst/seqno") == "") {
- return;
- }
-
- if(model.getValue("/root/main/attdoculst/attdoculst/attfilenm") == "") {
- messageBox("다운로드 할 파일을 ", "C002");
- return;
- }
-
- //파일명를 받아옴
- var getfilenm = model.getValue("/root/main/attdoculst/attdoculst/attfilenm");
- var getfilepath = model.getValue("/root/main/attdoculst/attdoculst/attfilepath");
-
- model.makeValue("/root/send/reqdata/attfilenm", getfilenm );
- model.makeValue("/root/send/reqdata/attfilepath", getfilepath );
-
- //파일명이 있는 경우 다운로드
- if(getfilenm != ""){
- //파일명을 받아옴
- var filenm = getfilenm;
- //파일명의 확장자만 받아옴
- var fileext = filenm.lastIndexOf(".");
- var ext = filenm.substring(fileext +1);
- //파일을 다운로드 하기 위해 저장할 창을 띄움
- var filesave = window.fileDialog("save","|",false,filenm,ext,"All Files(*.*)|*.*");
-
- //키값을 가지고 DB에 저장된 데이타를 조회하러 간다
- if (filesave != "") {
- model.download(getActionURL("TRRIS00206") + "&attfilepath=" + getfilepath + "&filepathcolnm=attfilepath", filesave);
- }
- }
-
- }
|