123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973 |
- <?xml version="1.0" encoding="utf-8"?>
- <FDL version="1.5">
- <TypeDefinition url="..\..\..\default_typedef.xml"/>
- <Form id="SMMMD05300" position="absolute 0 0 345 688" titletext="Medical Reference 색인관리" onload="SMMMD05300_onload">
- <Layouts>
- <Layout>
- <Grid id="treeview1" position="absolute 0 0 345 687" anchor="default" positiontype="position" onlbuttonDown="treeview1_onlbuttonDown" onbuttondown="treeview1_onbuttondown" ondbclick="treeview1_ondbclick" binddataset="ds_data_item" treeinitstatus="collapse,null" treeusecheckbox="false" treeuseimage="true" onrbuttondown="treeview1_onrbuttondown" oncelldblclick="treeview1_oncelldblclick">
- <Formats>
- <Format id="default">
- <Columns>
- <Column size="345"/>
- </Columns>
- <Rows>
- <Row size="24" band="head"/>
- <Row size="24"/>
- </Rows>
- <Band id="head">
- <Cell/>
- </Band>
- <Band id="body">
- <Cell displaytype="tree" edittype="tree" text="bind:indxnm" treestartlevel="0" treelevel="bind:depth" treeitemimage="expr:getColumn(currow,"fileno") != '0' ? 'theme://images/icon_treeitem.png' : 'theme://images/icon_treecollapse.png'"/>
- </Band>
- </Format>
- </Formats>
- </Grid>
- <Div id="group2" position="absolute 105 30 325 30" anchor="default" positiontype="position">
- <Layouts>
- <Layout>
- <Edit id="inpt_srch" class="input_default" position="absolute 67 5 214 25" anchor="default" positiontype="position" imemode="hangul"/>
- <Edit id="input2" class="input_default" visible="false" position="absolute 67 5 214 25" anchor="default" positiontype="position" imemode="hangul"/>
- <Edit id="input3" class="input_default" visible="false" position="absolute 9 27 64 47" anchor="default" positiontype="position" imemode="hangul"/>
- <Button id="btn_ok" class="btn2_letter2" position="absolute 127 28 169 48" anchor="default" positiontype="position" text="확인" onlbuttonup="btn_ok_onlbuttonup" onclick="btn_ok_onclick"/>
- <Button id="btn_modify" class="btn2_letter2" position="absolute 127 28 169 48" anchor="default" positiontype="position" text="확인" onlbuttonup="btn_modify_onlbuttonup" onclick="btn_modify_onclick"/>
- <Static id="cap_menu" class="cell_1" position="absolute 5 5 65 25" style="align:center middle;" anchor="default" positiontype="position" text="색인명"/>
- <Button id="btn_cancle" class="btn2_letter2" position="absolute 172 28 214 48" anchor="default" positiontype="position" text="취소" onlbuttonup="btn_cancle_onlbuttonup" onclick="btn_cancle_onclick"/>
- <Button id="btn_find" class="btn2_letter2" taborder="18" position="absolute 82 28 124 48" anchor="default" positiontype="position" text="찾기" onlbuttonup="btn_find_onlbuttonup" onclick="btn_find_onclick"/>
- </Layout>
- </Layouts>
- </Div>
- <Div id="grp_cond" taborder="2" class="div_Layer" visible="false" position="absolute 59 232 293 337">
- <Layouts>
- <Layout>
- <Shape id="line_isol2" class="line_3" visible="false" position="absolute 10 173 270 173" anchor="default"/>
- <Button id="btn_cls" taborder="12" class="btn_POP_cls" position="absolute 210 10 224 23" anchor="default" onclick="grp_cond_btn_cls_onclick"/>
- <Button id="btn_ok" taborder="13" text="확인" onlbuttonup="btn_copyfolder_onlbuttonup" class="btn2" position="absolute 131 73 175 93" anchor="default" visible="false" onclick="grp_cond_btn_ok_onclick"/>
- <Button id="btn_cancle" taborder="14" text="취소" onlbuttonup="btn_cancle_onlbuttonup" class="btn2" position="absolute 178 73 222 93" anchor="default" onclick="grp_cond_btn_cancle_onclick"/>
- <Edit id="inpt_srch" taborder="15" imemode="hangul" class="input_default" position="absolute 75 48 222 68" anchor="default"/>
- <Static id="cap_menu" text="색인명" class="cell_1" position="absolute 12 46 72 70" anchor="default"/>
- <Edit id="input3" taborder="16" imemode="hangul" class="input_default" visible="false" position="absolute 12 73 72 93" anchor="default"/>
- <Static id="caption00" class="sta_POP_title" position="absolute 12 8 161 28" anchor="default" text="색인추가"/>
- <Button id="btn_find" taborder="17" text="찾기" onlbuttonup="btn_copyfolder_onlbuttonup" class="btn2" position="absolute 84 73 128 93" visible="false" onclick="grp_cond_btn_find_onclick"/>
- <Button id="btn_modify" taborder="18" text="확인" onlbuttonup="btn_copyfolder_onlbuttonup" class="btn2" position="absolute 131 73 175 93" visible="false" onclick="grp_cond_btn_modify_onclick"/>
- </Layout>
- </Layouts>
- </Div>
- </Layout>
- </Layouts>
- <Objects>
- <Dataset id="ds_grid_grd_drugdept" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" reversesubsum="false">
- <ColumnInfo>
- <Column id="deptcd" type="STRING"/>
- <Column id="depthngnm" type="STRING"/>
- </ColumnInfo>
- </Dataset>
- <Dataset id="ds_data_drugdep" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
- <ColumnInfo>
- <Column id="deptcd" type="STRING" size="256"/>
- <Column id="depthngnm" type="STRING" size="256"/>
- </ColumnInfo>
- </Dataset>
- <Dataset id="ds_data_item" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
- <ColumnInfo>
- <Column id="status" type="STRING" size="256"/>
- <Column id="indxno" type="STRING" size="256"/>
- <Column id="indxnm" type="STRING" size="256"/>
- <Column id="supindxno" type="STRING" size="256"/>
- <Column id="indxrefseq" type="STRING" size="256"/>
- <Column id="depth" type="STRING" size="256"/>
- <Column id="indxhistseq" type="STRING" size="256"/>
- <Column id="image" type="STRING" size="256"/>
- <Column id="fileno" type="STRING" size="256"/>
- <Column id="filehistseq" type="STRING" size="256"/>
- <Column id="filenm" type="STRING" size="256"/>
- <Column id="filepath" type="STRING" size="256"/>
- <Column id="orddeptcd" type="STRING" size="256"/>
- </ColumnInfo>
- </Dataset>
- <Dataset id="ds_data_copyitem" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
- <ColumnInfo>
- <Column id="status" type="STRING" size="256"/>
- <Column id="indxno" type="STRING" size="256"/>
- <Column id="indxnm" type="STRING" size="256"/>
- <Column id="supindxno" type="STRING" size="256"/>
- <Column id="indxrefseq" type="STRING" size="256"/>
- <Column id="depth" type="STRING" size="256"/>
- <Column id="indxhistseq" type="STRING" size="256"/>
- <Column id="image" type="STRING" size="256"/>
- <Column id="fileno" type="STRING" size="256"/>
- <Column id="filehistseq" type="STRING" size="256"/>
- <Column id="filenm" type="STRING" size="256"/>
- <Column id="filepath" type="STRING" size="256"/>
- <Column id="orddeptcd" type="STRING" size="256"/>
- </ColumnInfo>
- </Dataset>
- <Dataset id="ds_cond_req" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
- <ColumnInfo>
- <Column id="status" type="STRING" size="256"/>
- <Column id="indxno" type="STRING" size="256"/>
- <Column id="indxhistseq" type="STRING" size="256"/>
- <Column id="fileno" type="STRING" size="256"/>
- <Column id="filehistseq" type="STRING" size="256"/>
- <Column id="indxnm" type="STRING" size="256"/>
- <Column id="supindxno" type="STRING" size="256"/>
- <Column id="indxrefseq" type="STRING" size="256"/>
- <Column id="indxdelyn" type="STRING" size="256"/>
- <Column id="indxtypecd" type="STRING" size="256"/>
- <Column id="drid" type="STRING" size="256"/>
- <Column id="kind" type="STRING" size="256"/>
- <Column id="orddeptcd" type="STRING" size="256"/>
- </ColumnInfo>
- </Dataset>
- <Dataset id="ds_cond_add" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
- <ColumnInfo>
- <Column id="status" type="STRING" size="256"/>
- <Column id="indxno" type="STRING" size="256"/>
- <Column id="indxhistseq" type="STRING" size="256"/>
- <Column id="fileno" type="STRING" size="256"/>
- <Column id="filehistseq" type="STRING" size="256"/>
- <Column id="indxnm" type="STRING" size="256"/>
- <Column id="supindxno" type="STRING" size="256"/>
- <Column id="indxrefseq" type="STRING" size="256"/>
- <Column id="indxdelyn" type="STRING" size="256"/>
- <Column id="indxtypecd" type="STRING" size="256"/>
- <Column id="drid" type="STRING" size="256"/>
- <Column id="kind" type="STRING" size="256"/>
- <Column id="orddeptcd" type="STRING" size="256"/>
- <Column id="depth" type="STRING" size="256"/>
- </ColumnInfo>
- </Dataset>
- <Dataset id="ds_cond_req00" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
- <ColumnInfo>
- <Column id="indxno" type="STRING" size="256"/>
- <Column id="indxhistseq" type="STRING" size="256"/>
- <Column id="fileno" type="STRING" size="256"/>
- <Column id="filehistseq" type="STRING" size="256"/>
- <Column id="indxnm" type="STRING" size="256"/>
- <Column id="supindxno" type="STRING" size="256"/>
- <Column id="indxrefseq" type="STRING" size="256"/>
- <Column id="indxdelyn" type="STRING" size="256"/>
- <Column id="indxtypecd" type="STRING" size="256"/>
- <Column id="drid" type="STRING" size="256"/>
- <Column id="kind" type="STRING" size="256"/>
- <Column id="orddeptcd" type="STRING" size="256"/>
- </ColumnInfo>
- </Dataset>
- <Dataset id="ds_cond_index" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
- <ColumnInfo>
- <Column id="status" type="STRING" size="256"/>
- <Column id="indxno" type="STRING" size="256"/>
- <Column id="indxhistseq" type="STRING" size="256"/>
- <Column id="fileno" type="STRING" size="256"/>
- <Column id="filehistseq" type="STRING" size="256"/>
- <Column id="indxnm" type="STRING" size="256"/>
- <Column id="supindxno" type="STRING" size="256"/>
- <Column id="indxrefseq" type="STRING" size="256"/>
- <Column id="indxdelyn" type="STRING" size="256"/>
- <Column id="indxtypecd" type="STRING" size="256"/>
- <Column id="drid" type="STRING" size="256"/>
- <Column id="kind" type="STRING" size="256"/>
- <Column id="orddeptcd" type="STRING" size="256"/>
- </ColumnInfo>
- </Dataset>
- <Dataset id="ds_notice" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
- <ColumnInfo>
- <Column id="attfilenm" type="STRING" size="256"/>
- <Column id="filenm" type="STRING" size="256"/>
- <Column id="filedata" type="BLOB" size="256"/>
- <Column id="filesize" type="STRING" size="256"/>
- <Column id="filetype" type="STRING" size="256"/>
- </ColumnInfo>
- </Dataset>
- <Dataset id="ds_data_attach" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
- <ColumnInfo>
- <Column id="attfilenm" type="STRING" size="256"/>
- <Column id="file" type="STRING" size="256"/>
- </ColumnInfo>
- </Dataset>
- <Dataset id="ds_attachfile" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
- <ColumnInfo>
- <Column id="filedata" type="BLOB" size="256"/>
- <Column id="filepath" type="STRING" size="256"/>
- </ColumnInfo>
- </Dataset>
- </Objects>
- <Script type="xscript4.0"><![CDATA[/***************************************************************************************
- * System Name :
- * Job Name :
- * File Name : SMMMD05300_MR색인관리.xfdl
- * Creator :
- * Make Date :
- *
- * Description :
- *---------------------------------------------------------------------------------------
- * Modify Date Modifier Modify Description
- *---------------------------------------------------------------------------------------
- *
- *---------------------------------------------------------------------------------------
- ****************************************************************************************/
- //=======================================================================================
- // xjs Include
- //---------------------------------------------------------------------------------------
- include "com_commonxp::comm_main.xjs";
- //=======================================================================================
- // Function
- //---------------------------------------------------------------------------------------
- var kind = "F";
- var newfolder;
- var cpgflagcd = "A";
- var funflag = "1";
- /******************************************************************************************************
- * Argument : 없음
- * Description : 초기화 및 색인을 조회한다.
- ******************************************************************************************************/
- function lf_Initialize() {
- //웹브라우저 초기화
- //parent.WebBrowser00.url="";
- }
- /******************************************************************************************************
- * Argument : 없음
- * Description : 저장, 삭제, 수정 후 재조회
- ******************************************************************************************************/
- function lf_reSetting(){
- var iRow = ds_data_item.rowposition;
- grp_cond.inpt_srch.value="";
- grp_cond.visible = "false";
- lf_GetIndxList("A");
- treeview1.treeinitstatus = "expand,all";
- ds_data_item.rowposition = iRow - 1;
- }
- /******************************************************************************************************
- * Argument : 없음
- * Description : 색인을 조회한다.
- ******************************************************************************************************/
- function lf_GetIndxList(flag){
- var indxnmSch = group5.ipt_indxnm.value; //조회할 색인명
- var orddeptcd = group5.cbm_dept.value;
-
- if( utlf_isNull(orddeptcd) ) return;
-
- var sInDsName = dsf_createDsRow("in_ds_search"
- , [{col: "mode", val: "A"}
- , {col: "indxnm", val: indxnmSch}
- , {col: "orddeptcd", val: orddeptcd}
- ]);
- tranf_submit({
- id: "TRMMD05001"
- , service: "prcpmngtapp.MedRefMngt"
- , method: "reqGetMedRefIndxList"
- , inds : "req="+sInDsName
- , outds: "ds_data_item=item"
- //, callback: "cbf_TRMMD05001"
- , async: false
- });
- }
- /******************************************************************************************************
- * Argument : 없음
- * Description : 색인 추가<색인추가> - 마우스 오른쪽 버튼 목록의 함수
- ******************************************************************************************************/
- function lf_IndxAdd(){
-
- if(!lf_chkFolderAuth("indxnew") ) return;
-
- var iRow = ds_data_item.rowposition;
- var srcLastChildItemIndex = treeview1.getTreeChildRow(iRow, 0, true);
- var lastNodeSeq = ds_data_item.getColumn(srcLastChildItemIndex,"indxrefseq");
- var Num = toNumber(lastNodeSeq,0)+1;
- ds_cond_index.clearData();
- ds_cond_index.addRow(0);
- ds_cond_index.setColumn(0,"indxrefseq",Num );
- ds_cond_index.setColumn(0,"supindxno",ds_data_item.getColumn(iRow,"indxno"));
-
- grp_cond.visible = "true";
- grp_cond.caption00.text = "색인추가";
- grp_cond.cap_menu.text = "색인명";
- grp_cond.btn_ok.visible = "true";
- grp_cond.btn_modify.visible = "false";
- grp_cond.btn_find.visible = "true";
- kind = "i";
- funflag = "0";
- grp_cond.inpt_srch.setFocus();
- }
- /******************************************************************************************************
- * Argument : 없음
- * Description : 색인추가 함수
- ******************************************************************************************************/
- function fSaveIndx(){
-
- if( utlf_isNull(ds_notice.getColumn(0,"filenm")) ){
- sysf_messageBox("첨부할 파일을 선택하지", "E007");
- return;
- }
- ds_cond_index.setColumn(0,"status","i");
- //ds_cond_index.setColumn(0,"filenm",ds_data_item.getColumn(indx,"filenm"));
- //ds_cond_req.setColumn(0,"indxrefseq",ds_data_item.getColumn(iRow,"indxrefseq"));
- ds_cond_index.setColumn(0,"drid",sysf_getUserInfo("userid"));
- ds_cond_index.setColumn(0,"kind",kind);
- ds_cond_index.setColumn(0,"indxtypecd","D");
- ds_cond_index.setColumn(0,"orddeptcd",group5.cbm_dept.value);
- ds_cond_index.setColumn(0,"indxnm",grp_cond.inpt_srch.value);
-
- tranf_submit({
- id: "TXMMD05001"
- , service: "prcpmngtapp.MedRefMngt"
- , method: "reqExeIndxInfo"
- , inds : "req=ds_cond_index"
- , outds: "ds_cond_req00=item"
- , callback: "cbf_TXMMD05001_index"
- , async: false
- });
- //재조회 함수
- lf_reSetting();
- }
- /******************************************************************************************************
- * Argument : 없음
- * Description : 마우스 오른쪽 목록 <폴더명>
- ******************************************************************************************************/
- function lf_FolderSet(){//폴더명 변경
- // 폴더 수정권한 체크
- if ( !lf_chkFolderAuth("set") ) return;
- var iRow = ds_data_item.rowposition;
-
- if( ds_data_item.getColumn(iRow,"supindxno") == "-1" ) {
- sysf_messageBox("최상위 폴더명은 수정", "E001");
- return;
- }
-
- grp_cond.visible = "true";
- grp_cond.caption00.text = "폴더추가";
- grp_cond.cap_menu.text = "폴더명";
- grp_cond.btn_ok.visible = "false";
- grp_cond.btn_modify.visible = "true";
- grp_cond.btn_find.visible = "false";
- grp_cond.inpt_srch.setFocus();
- }
- /******************************************************************************************************
- * Argument : iRow - 현재로우
- status - 현재 상태
- flag - 상태프래그
- * Description : 폴더 저장. 색인, 폴더 삭제
- ******************************************************************************************************/
- function lf_SaveFolderIndx(iRow, status,flag){
- ds_cond_req.addRow(0);
- ds_cond_req.setColumn(0,"status",status);
- ds_cond_req.setColumn(0,"indxrefseq",ds_data_item.getColumn(iRow,"indxrefseq"));
- ds_cond_req.setColumn(0,"indxhistseq",ds_data_item.getColumn(iRow,"indxhistseq"));
- ds_cond_req.setColumn(0,"filehistseq",ds_data_item.getColumn(iRow,"filehistseq"));
- ds_cond_req.setColumn(0,"supindxno",ds_data_item.getColumn(iRow,"supindxno"));
- ds_cond_req.setColumn(0,"indxno",ds_data_item.getColumn(iRow,"indxno"));
- ds_cond_req.setColumn(0,"fileno",ds_data_item.getColumn(iRow,"fileno"));
- ds_cond_req.setColumn(0,"orddeptcd",group5.cbm_dept.value);
- ds_cond_req.setColumn(0,"indxtypecd","D");
- ds_cond_req.setColumn(0,"drid",sysf_getUserInfo("userid"));
- ds_cond_req.setColumn(0,"kind","I");
-
- if( flag =="delete" ){
- ds_cond_req.setColumn(0,"indxnm",ds_data_item.getColumn(iRow,"indxnm"));
- }
- else if( flag == "modify" ){
- ds_cond_req.setColumn(0,"indxnm",grp_cond.inpt_srch.value);
- }
-
- tranf_submit({
- id: "TXMMD05001"
- , service: "prcpmngtapp.MedRefMngt"
- , method: "reqExeIndxInfo"
- , inds : "req=ds_cond_req"
- , outds: "ds_cond_req00=item"
- , callback: "cbf_TXMMD05001_save"
- , async: false
- });
- lf_reSetting();
- }
- /******************************************************************************************************
- * Argument : 없음
- * Description : 폴더를 삭제한다.
- ******************************************************************************************************/
- function lf_FolderDel(){
- var iRow = ds_data_item.rowposition;
-
- var fileno = ds_data_item.getColumn(iRow,"fileno");
- var msg ="";
-
- if ( fileno == "0" ) {
- // 폴더삭제 권한을 체크
- if ( !lf_chkFolderAuth("del") ) return;
- msg = "선택하신 폴더를";
- } else {
- // 색인삭제 권한을 체크
- if ( !lf_chkFolderAuth("indxdel") ) return;
- msg = "선택하신 색인을";
- }
-
- //삭제 확인
- var msgRtn = sysf_messageBox(msg, "Q001");
- if ( msgRtn != "6" ) return;
-
- //바로 데이터를 삭제하는 서브밋 실행
- lf_SaveFolderIndx(iRow,"d","delete");
-
- //재조회
- lf_reSetting();
- }
- /******************************************************************************************************
- * Argument : 없음
- * Description : 색인 다운로드 함수
- ******************************************************************************************************/
- function fFileDown(){
- var iRow = ds_data_item.rowposition;
- var fd = new FileDialog;
- fd.filter = "PDF Files(*.pdf)|*.pdf";//
- var filepath = ds_data_item.getColumn(iRow,"filepath");
- var indxnm = ds_data_item.getColumn(iRow,"indxnm");
- var fileno = ds_data_item.getColumn(iRow,"fileno");
- if( !utlf_isNull(filepath) ){
-
- fGetAttachfile(filepath);
-
- var objVFile = fd.open("FileSave", FileDialog.SAVE, "%MYDOCUMENT%", indxnm); // 단일 파일 선택
- if (objVFile != null) {
- dsf_readFileFromDs(objVFile.fullpath, ds_attachfile, 0, "filedata"); // 파일저장
- }
- }else{
- sysf_messageBox("다운로드 할 파일이 ", "I004");
- return;
- }
- }
- /******************************************************************************************************
- * Argument : 없음
- * Description : 색인의 파일 데이터 조회함수
- ******************************************************************************************************/
- function fGetAttachfile(filepath){
- var sInDsName = dsf_createDsRow("in_ds_search"
- , [{col: "filepath", val: filepath}
- ]);
- tranf_submit({
- id: "TRMMD05002"
- , service: "prcpmngtapp.MedRefMngt"
- , method: "reqGetAttFileData"
- , inds : "req="+sInDsName
- , outds: "ds_attachfile=attachfile"
- //, callback: "cbf_TRMMD05001"
- , async: false
- });
- }
- /******************************************************************************************************
- * Argument : 없음
- * Description : 마우스 오른쪽 목록 - 새폴더
- ******************************************************************************************************/
- function lf_NewFolder(){
- var iRow = ds_data_item.rowposition;
- var fileno = ds_data_item.getColumn(iRow,"fileno");
-
- if( fileno > 0 ){
- sysf_messageBox("색인에는 폴더를 생성할 수", "I004");
- return;
- }
- // 해당부서 찾기(소속 부서코드가 없을 경우 일반부서 사용자는 폴더를 생성할 수 없다)
- if ( !lf_chkFolderAuth("new") )return;
- funflag = "1";
- grp_cond.visible = "true";
- newfolder = "Y"
- grp_cond.caption00.text = "폴더추가";
- grp_cond.cap_menu.text = "폴더명";
- grp_cond.btn_ok.visible = "true";
- grp_cond.btn_modify.visible = "false";
- grp_cond.btn_find.visible = "false";
- grp_cond.inpt_srch.setFocus();
- }
- /******************************************************************************************************
- * Argument : 없음
- * Description : 폴더추가(확인버튼)
- ******************************************************************************************************/
- function lf_Confirm(){//폴더추가(확인버튼)
-
- var iRow = ds_data_item.rowposition;
- ds_cond_add.clearData();
- ds_cond_add.addRow(0);
- ds_cond_add.setColumn(0,"status","i");
- ds_cond_add.setColumn(0,"orddeptcd", sysf_getUserInfo("userid"));
- ds_cond_add.setColumn(0,"indxnm",grp_cond.inpt_srch.value);
- ds_cond_add.setColumn(0,"drid",sysf_getUserInfo("userid"));
- ds_cond_add.setColumn(0,"kind","F");
- ds_cond_add.setColumn(0,"orddeptcd",group5.cbm_dept.value);
- ds_cond_add.setColumn(0,"indxtypecd","D");
- ds_cond_add.setColumn(0,"indxrefseq","1");
- ds_cond_add.setColumn(0,"supindxno",ds_data_item.getColumn(iRow,"indxno"));
- ds_cond_add.setColumn(0,"fileno","0");
-
- if( newfolder == "Y")
- {
- if(ds_data_item.rowcount == 0)
- {
- ds_cond_add.setColumn(0,"indxno", "1");
- }else{
- var nLastChildRow = treeview1.getTreeChildRow(iRow, -1, true);
- ds_cond_add.setColumn(0,"indxno",nLastChildRow+1);
- }
- }
- trace(ds_cond_add.saveXML());
- tranf_submit({
- id: "TXMMD05001"
- , service: "prcpmngtapp.MedRefMngt"
- , method: "reqExeIndxInfo"
- , inds : "req=ds_cond_add"
- , outds: "ds_data_item=item"
- //, callback: "cbf_TXMMD05001"
- , async: false
- });
- //폴더 저장 후 재조회
- lf_reSetting();
- }
- /******************************************************************************************************
- * Argument : 없음
- * Description : 폴더권한체크
- ******************************************************************************************************/
- function lf_chkFolderAuth(mode) {
- var iRow = ds_data_item.rowposition;
-
- // 폴더아래로 신규폴더 생성시 폴더의 부서코드와 사용자 세션 부서 코드가 일치 해야 한다.
- var orddeptcd = ds_data_item.getColumn(iRow,"orddeptcd");
- var depth = ds_data_item.getColumn(iRow,"depth");
- var deptnm = "";
- var msg = "";
- var indxnm = "";
- var duplcecd = sysf_getUserInfo("dutplcecd");
-
- //약제팀 부서 코드에 해당되는지 조사
- var drugdeptYn = "N";
- var drugdeptcd = "";
- var deptcnt = ds_data_drugdep.rowcount;
- for ( var i = 0 ; i<deptcnt ; i++ ) {
- drugdeptcd = ds_data_drugdep.getColumn(i,"deptcd");
- if ( drugdeptcd == duplcecd ) {
- drugdeptYn = "Y";
- break;
- }
- }
-
- if( drugdeptYn == "N" )
- {
- if( orddeptcd != duplcecd ) {
- var deptCnt = ds_cond_instcd.rowcount;//36
- for( var i = 0; i < deptCnt; i++ ){
- if( orddeptcd == ds_cond_instcd.getColumn(i,"deptcd")){
- if( orddeptcd == "DRUGDEPT" ){
- deptnm = "약제 공통";
- }
- else {
- deptnm = ds_cond_instcd.getColumn(i,"depthngnm")
- }
- break;
- }
- }
- if ( deptnm == "" ) {
- for( var i = 0; i < deptCnt; i++){
- drugdeptcd = ds_data_drugdep.getColumn(i,"deptcd");
- if( drugdeptcd == orddeptcd || orddeptcd == "DRUGDEPT" ) {
- deptnm = "약제 공통";
- break;
- }
- }
- }
- indxnm = ds_data_item.getColumn(iRow,"indxnm");
-
- if ( mode == "new" ) {
- msg = indxnm + " 폴더는 [" + deptnm + "] 부서의 폴더입니다. 폴더 생성";
- }else if ( mode == "set" ) {
- msg = indxnm + " 폴더는 [" + deptnm + "] 부서의 폴더입니다. 폴더 수정";
- }else if ( mode == "del" ) {
- msg = indxnm + " 폴더는 [" + deptnm + "] 부서의 폴더입니다. 폴더 삭제";
- }else if ( mode == "del" ) {
- msg = indxnm + " 폴더는 [" + deptnm + "] 부서의 폴더입니다. 폴더 삭제";
- }else if ( mode == "indxdel" ) {
- msg = indxnm + " 색인은 [" + deptnm + "] 부서의 색인입니다. 색인 삭제";
- }else if ( mode == "indxnew" ) {
- msg = indxnm + " 폴더는 [" + deptnm + "] 부서의 폴더입니다. 색인 추가";
- }else if ( mode == "folderorder" ) {
- msg = indxnm + " 폴더는 [" + deptnm + "] 부서의 폴더입니다. 폴더순서정렬";
- }
- sysf_messageBox(msg, "E002");
- return false;
- }
- }
- else {
- drugdeptYn = "N";
- orddeptcd == ds_data_item.getColumn(iRow,"orddeptcd");
-
- for ( var i = 0; i < dpetcnt; i++ ) {
- drugdeptcd = ds_data_drugdep.getColumn(i,"deptcd");
- if ( drugdeptcd == orddeptcd || orddeptcd == "DRUGDEPT" ) {
- drugdeptYn = "Y";
- break;
- }
- }
-
- if ( drugdeptYn == "N" ) { // 선택한 폴더가 약제팀 폴더가 아닌 경우
- var deptCnt = ds_cond_instcd.rowcount;
- for ( var i=0 ; i<deptCnt ; i++ ) {
- if ( orddeptcd == ds_cond_instcd.getColumn(i,"deptcd") ) {
- if ( orddeptcd == "DRUGDEPT" ) {
- deptnm = "약제 공통";
- }
- else {
- deptnm = ds_cond_instcd.getColumn(i,"depthngnm") ;
- }
- break;
- }
- }
- indxnm = ds_data_item.getColumn(iRow,"indxnm");
-
- if ( mode == "new" ) {
- msg = indxnm + " 폴더는 [" + deptnm + "] 부서의 폴더입니다. 폴더 생성";
- }else if ( mode == "set" ) {
- msg = indxnm + " 폴더는 [" + deptnm + "] 부서의 폴더입니다. 폴더 수정";
- }else if ( mode == "del" ) {
- msg = indxnm + " 폴더는 [" + deptnm + "] 부서의 폴더입니다. 폴더 삭제";
- }else if ( mode == "del" ) {
- msg = indxnm + " 폴더는 [" + deptnm + "] 부서의 폴더입니다. 폴더 삭제";
- }else if ( mode == "indxdel" ) {
- msg = indxnm + " 색인은 [" + deptnm + "] 부서의 색인입니다. 색인 삭제";
- }else if ( mode == "indxnew" ) {
- msg = indxnm + " 폴더는 [" + deptnm + "] 부서의 폴더입니다. 색인 추가";
- }else if ( mode == "folderorder" ) {
- msg = indxnm + " 폴더는 [" + deptnm + "] 부서의 폴더입니다. 폴더순서정렬";
- }
- sysf_messageBox(msg, "E002");
- return false;
- }
- }
- return true;
- }
- /******************************************************************************************************
- * Argument : 없음
- * Description : //파일 이름, 크기 등 정보
- ******************************************************************************************************/
- function lf_saveFile(objVFile, nRow)
- {
- var sRowType = ds_notice.getRowType(nRow);
- // 그 파일의 데이터를 데이터셋의 특정 컬럼에 BLOB 형식으로 write 한다.
- var file = dsf_writeFileToDs(objVFile, ds_notice, nRow, "attfiledata");
- ds_notice.setColumn(nRow, "attfilenm", file.filename);
- ds_notice.setColumn(nRow, "attfilesize", file.filesize);
- ds_notice.setColumn(nRow, "attfiletype", file.filetype);
- ds_notice.setColumn(nRow, "attfilepath", file.filepath);
- if (sRowType == Dataset.ROWTYPE_INSERT) {
- ds_notice.setColumn(nRow, "attfiledown", "입력된 파일");
- }
- else {
- ds_notice.setColumn(nRow, "attfiledown", "수정된 파일");
- }
- }
- //=======================================================================================
- // Transaction Callback
- //---------------------------------------------------------------------------------------
- /****************************************************************************************
- * Argument : 01. strSvcID
- * 02. nErrorCode
- * 03. strErrorMsg
- * Description : cbf_TXMMD05001_save 콜백함수
- ****************************************************************************************/
- function cbf_TXMMD05001_save(strSvcID, nErrorCode, strErrorMsg){
- if(nErrorCode == 0){
- ds_cond_req.clearData();
- }
- }
- /****************************************************************************************
- * Argument : 01. strSvcID
- * 02. nErrorCode
- * 03. strErrorMsg
- * Description : cbf_TXMMD05002 콜백함수
- ****************************************************************************************/
- function cbf_TXMMD05002(strSvcID, nErrorCode, strErrorMsg){
- if(nErrorCode == 0){
- ds_notice.clearData();
- }
- }
- /****************************************************************************************
- * Argument : 01. strSvcID
- * 02. nErrorCode
- * 03. strErrorMsg
- * Description : cbf_TXMMD05001_index 콜백함수
- ****************************************************************************************/
- function cbf_TXMMD05001_index(strSvcID, nErrorCode, strErrorMsg){
- if(nErrorCode == 0){
- tranf_submit({
- id: "TXMMD05002"
- , service: "prcpmngtapp.MedRefMngt"
- , method: "reqExeUploadAttFile"
- , inds : "attach=ds_notice"
- , outds: "ds_data_attach=attach"
- , callback: "cbf_TXMMD05002"
- , async: false
- })
- }
- }
- //=======================================================================================
- // Event
- //---------------------------------------------------------------------------------------
- /****************************************************************************************
- * Components :
- * Components ID : SMMMD05300
- * Event : onload
- * Argument : 01.obj : Object Event has occurred
- * : 02.e : Event Object
- * Description :
- ****************************************************************************************/
- function SMMMD05300_onload(obj:Form, e:LoadEventInfo)
- {
- frmf_initForm(obj); // 화면공통
-
- tranf_submit({
- id: "TRMMD05201"
- , service: "prcpmngtapp.MedRefMngt"
- , method: "reqGetInstDrugDeptList"
- //, inds : "req="+sInDsName
- , outds: "ds_data_dept=drugdept"
- //, callback: "cbf_TRMMP02709"
- , async: false
- });
- // 색인초기화
- lf_Initialize();
- //폴더 오른쪽 마우스
- frmf_createPopupMenu("pmn_popupMenu", "pmn_popupMenu_onmenuclick",
- [{id: "new", level: "1", title: "새폴더"},
- {id: "rename", level: "1", title: "이름바꾸기"},
- {id: "delete", level: "1", title: "삭제"},
- //{id: "delete", level: "1", title: "폴더순서변경"},
- {id: "add", level: "1", title: "색인 추가"}
- ]);
- //색인 오른쪽 마우스
- frmf_createPopupMenu("pmn_popupMenu2", "pmn_popupMenu2_onmenuclick2",
- [{id: "down", level: "1", title: "다운로드"},
- {id: "del", level: "1", title: "삭제"}
- ]);
- }
- /****************************************************************************************
- * Components : Button
- * Components ID : btn_cancle
- * Event : onclick
- * Argument : 01.obj : Button
- * : 02.e : ClickEventInfo
- * Description : 색인등록하는 그룹이랑 이름 바꾸는 그룹 안보이도록
- ****************************************************************************************/
- function grp_cond_btn_cancle_onclick(obj:Button, e:ClickEventInfo)
- {
- grp_cond.visible = "false";
- }
- /****************************************************************************************
- * Components : Button
- * Components ID : btn_cls
- * Event : onclick
- * Argument : 01.obj : Button
- * : 02.e : ClickEventInfo
- * Description : 색인등록하는 그룹이랑 이름 바꾸는 그룹 안보이도록(x 버튼)
- ****************************************************************************************/
- function grp_cond_btn_cls_onclick(obj:Button, e:ClickEventInfo)
- {
- grp_cond.visible = "false";
- }
- /****************************************************************************************
- * Components : Button
- * Components ID : btn_ok
- * Event : onclick
- * Argument : 01.obj : Button
- * : 02.e : ClickEventInfo
- * Description : 색인추가하는 확인버튼
- ****************************************************************************************/
- function grp_cond_btn_ok_onclick(obj:Button, e:ClickEventInfo)
- {
- if(funflag == "0"){
- fSaveIndx();//색인 추가
- }else{
- lf_Confirm();//폴더저장
- }
- }
- /****************************************************************************************
- * Components : Button
- * Components ID : btn_modify
- * Event : onclick
- * Argument : 01.obj : Button
- * : 02.e : ClickEventInfo
- * Description : 폴더명 수정 확인버튼
- ****************************************************************************************/
- function grp_cond_btn_modify_onclick(obj:Button, e:ClickEventInfo)
- {
- var iRow = ds_data_item.rowposition;
- lf_SaveFolderIndx(iRow,"u","modify");//폴더명 변경 함수
- }
- /****************************************************************************************
- * Components : Button
- * Components ID : btn_find
- * Event : onclick
- * Argument : 01.obj : Button
- * : 02.e : ClickEventInfo
- * Description : 찾기 버튼
- ****************************************************************************************/
- function grp_cond_btn_find_onclick(obj:Button, e:ClickEventInfo)
- {
- var max = 5242880;//파일 크기 사이즈
- var fd = new FileDialog();
- fd.filter = "All Files (*.*)|*.*";//"PDF Files(*.pdf)|*.pdf";
- var objVFileList = fd.open("FileOpen", FileDialog.LOAD); // 여러파일 선택\
-
- trace(objVFileList.filename);
- if( utlf_isNull(objVFileList.filename)){
- return;
- }else{
- grp_cond.inpt_srch.value = objVFileList.filename;
- var iRow = ds_notice.addRow();
-
- var vfile = dsf_writeFileToDs(objVFileList, ds_notice, iRow, "filedata");
- ds_notice.setColumn(iRow,"attfilenm",objVFileList.filename);
- ds_notice.setColumn(iRow,"filenm",objVFileList.filename);
- ds_notice.setColumn(iRow,"filesize",vfile.filesize);
- ds_notice.setColumn(iRow,"filetype",vfile.filetype);
- }
- //파일 사이즈 처리필요
- if (vfile.filesize > max){
- sysf_messageBox("파일 크기가 최대치("+maxsize+"Byte)를", "E003");
- return;
- }
- }
- /****************************************************************************************
- * Components : Grid
- * Components ID : treeview1
- * Event : onrbuttondown
- * Argument : 01.obj : Grid
- * : 02.e : GridMouseEventInfo
- * Description : 트리뷰 마우스 오른쪽 버튼
- ****************************************************************************************/
- function treeview1_onrbuttondown(obj:Grid, e:GridMouseEventInfo)
- {
- var tmp = ds_data_item.getColumn(e.row, "fileno");
- if( e.row >= 0 && e.row < obj.rowcount ){
- var objDs = eval(obj.binddataset);
- objDs.rowposition = e.row;
- if(tmp == 0) {//폴더일 경우의 오른쪽메뉴
- pmn_popupMenu.trackPopup(e.screenX,e.screenY);
- }
- else{//색인일 경우의 오른쪽 메뉴
- pmn_popupMenu2.trackPopup(e.screenX,e.screenY);
- }
- }
- }
- /****************************************************************************************
- * Components : PopupMenu
- * Components ID : treeview1
- * Event : onmenuclick1
- * Argument : 01.obj : PopupMenu
- * : 02.e : MenuClickEventInfo
- * Description : 폴더일 경우의 마우스 오른쪽 메뉴
- ****************************************************************************************/
- function pmn_popupMenu_onmenuclick(obj:PopupMenu, e:MenuClickEventInfo)
- {
- if(e.id == "new"){
- lf_NewFolder();
- }else if(e.id == "rename"){
- lf_FolderSet()
- }else if(e.id == "delete"){
- lf_FolderDel();
- // }else if(e.id == "seq"){
- // //화면 미존재
- }else if(e.id == "add"){
- lf_IndxAdd();
- }
- }
-
- /****************************************************************************************
- * Components : PopupMenu2
- * Components ID : treeview1
- * Event : onmenuclick2
- * Argument : 01.obj : PopupMenu
- * : 02.e : MenuClickEventInfo
- * Description : 색인일 경우의 마우스 오른쪽 메뉴
- ****************************************************************************************/
- function pmn_popupMenu2_onmenuclick2(obj:PopupMenu, e:MenuClickEventInfo)
- {
- if(e.id == "down"){
- fFileDown();//미개발
- }else if(e.id == "del"){
- lf_FolderDel();
- }
- }
- /****************************************************************************************
- * Components : Grid
- * Components ID : treeview1
- * Event : oncelldblclick
- * Argument : 01.obj : Grid
- * : 02.e : GridClickEventInfo
- * Description : 색인을 더블 클릭 할 경우 파일이 화면옆에 열린다.
- ****************************************************************************************/
- function treeview1_oncelldblclick(obj:Grid, e:GridClickEventInfo)
- {
- var fso;
- var iRow = obj.currentrow;
- var filepath = ds_data_item.getColumn(iRow,"filepath");
- var indxnm = ds_data_item.getColumn(iRow,"indxnm");
- var fileno = ds_data_item.getColumn(iRow,"fileno");
- //임시 디렉토리
- var temp_path = "C:\\temp2\\";
- fso = inff_fileSystemObject();
- // 객체 생성 실패하면 리턴
- if (fso == null) {
- return;
- }
- // 시스템 드라이브가 없다면..
- if (fso.DriveExists("C") == false) {
- return;
- }
- // 임시디렉토리가 없으면 생성
- if (fso.FolderExists(temp_path) == false) {
- folder = fso.CreateFolder(temp_path);
- }
- if( fileno == "0" )//색인이 아니면 리턴
- {
- return;
- }
- if( !utlf_isNull(filepath) ){
- var sInDsName = dsf_createDsRow("in_ds_search"
- , [{col: "filepath", val: filepath}
- ]);
- tranf_submit({
- id: "TRMMD05002"
- , service: "prcpmngtapp.MedRefMngt"
- , method: "reqGetAttFileData"
- , inds : "req="+sInDsName
- , outds: "ds_attachfile=attachfile"
- //, callback: "cbf_TRMMD05001"
- , async: false
- });
- var sFileName = temp_path+indxnm;//
- dsf_readFileFromDs(sFileName, ds_attachfile, 0, "filedata"); // 파일저장
- parent.WebBrowser00.url=sFileName;//화면 열기
- }else{//파일이 없는 경우
- sysf_messageBox("파일이 ", "I004");
- return;
- }
- }
- ]]></Script>
- </Form>
- </FDL>
|