123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461 |
- <?xml version="1.0" encoding="utf-8"?>
- <FDL version="1.5">
- <TypeDefinition url="..\..\..\default_typedef.xml"/>
- <Form id="SMRSD00420" position="absolute 0 0 756 553" titletext="첨부파일조회" onload="SMRSD00420_onload" onclose="SMRSD00420_onclose">
- <Layouts>
- <Layout>
- <Div position="absolute 0 0 755 522" id="group3" scrollbars="autoboth">
- <Layouts>
- <Layout>
- <Static text="첨부파일내역조회" position="absolute 0 8 183 24" id="caption1" class="tit_2" anchor="default"/>
- <Grid position="absolute 0 50 755 522" id="grd_fileinfo" binddataset="ds_main_fileinfo_fileinfolist" anchor="default" cellsizingtype="both" extendsizetype="row" oncelldblclick="group3_grd_fileinfo_oncelldblclick">
- <Formats>
- <Format id="default">
- <Columns>
- <Column size="25" band="left"/>
- <Column size="75"/>
- <Column size="86"/>
- <Column size="246"/>
- <Column size="67"/>
- <Column size="150"/>
- <Column size="71"/>
- <Column size="91"/>
- <Column size="0"/>
- <Column size="0"/>
- <Column size="0"/>
- <Column size="0"/>
- <Column size="0"/>
- <Column size="0"/>
- <Column size="0"/>
- <Column size="0"/>
- <Column size="0"/>
- <Column size="0"/>
- <Column size="0"/>
- <Column size="0"/>
- <Column size="0"/>
- <Column size="0"/>
- <Column size="0"/>
- <Column size="0"/>
- <Column size="0"/>
- </Columns>
- <Rows>
- <Row size="24" band="head"/>
- <Row size="24"/>
- </Rows>
- <Band id="head">
- <Cell/>
- <Cell col="1" text="청구일자"/>
- <Cell col="2" text="첨부파일번호"/>
- <Cell col="3" text="파일이름"/>
- <Cell col="4" text="파일크기"/>
- <Cell col="5" text="파일타입"/>
- <Cell col="6" text="다운로드수"/>
- <Cell col="7" text="부서명"/>
- <Cell col="8" text="파일이름(부모창)"/>
- <Cell col="9"/>
- <Cell col="10"/>
- <Cell col="11"/>
- <Cell col="12"/>
- <Cell col="13"/>
- <Cell col="14"/>
- <Cell col="15"/>
- <Cell col="16"/>
- <Cell col="17"/>
- <Cell col="18"/>
- <Cell col="19"/>
- <Cell col="20"/>
- <Cell col="21"/>
- <Cell col="22"/>
- <Cell col="23"/>
- <Cell col="24"/>
- </Band>
- <Band id="body">
- <Cell celltype="head"/>
- <Cell col="1" displaytype="expr:utlf_isNull(reqdd) ? 'normal' : 'date'" text="bind:reqdd"/>
- <Cell col="2" displaytype="text" text="bind:fileseqno"/>
- <Cell col="3" displaytype="text" text="bind:filenm"/>
- <Cell col="4" displaytype="text" style="align:right;" text="bind:filesize"/>
- <Cell col="5" displaytype="text" text="bind:filetype"/>
- <Cell col="6" text="bind:qrycnt"/>
- <Cell col="7" displaytype="text" text="bind:reqdeptnm"/>
- <Cell col="8" text="bind:attfilenm"/>
- <Cell col="9" text="bind:instcd"/>
- <Cell col="10" text="bind:reqdeptcd"/>
- <Cell col="11" text="bind:goalflag"/>
- <Cell col="12" text="bind:seqno"/>
- <Cell col="13" text="bind:reqpsnid"/>
- <Cell col="14" text="bind:filepath"/>
- <Cell col="15" text="bind:reqflag"/>
- <Cell col="16" text="bind:reqno"/>
- <Cell col="17" text="bind:reqseqno"/>
- <Cell col="18" text="bind:valumdlcd"/>
- <Cell col="19" text="bind:valuclsdetlcd"/>
- <Cell col="20" text="bind:publbaseflag"/>
- <Cell col="21" text="bind:idxcd"/>
- <Cell col="22" text="bind:seqno2"/>
- <Cell col="23" text="bind:wrtedd"/>
- <Cell col="24" text="bind:fileflag"/>
- </Band>
- </Format>
- </Formats>
- </Grid>
- <Button position="absolute 640 2 696 24" id="btn_search" class="btn1" text="조회" anchor="default" onclick="group3_btn_search_onclick"/>
- <Button position="absolute 699 2 755 24" id="btn_save" class="btn4" text="저장" anchor="default" onclick="group3_btn_save_onclick"/>
- <Shape position="absolute 0 24 755 30" linetype="horizontal" id="line2" class="line_10" anchor="default"/>
- <Button position="absolute 702 29 755 49" id="btn_delgrd" class="btn2" text="행삭제" anchor="default" onclick="group3_btn_delgrd_onclick"/>
- </Layout>
- </Layouts>
- </Div>
- <Div position="absolute 0 524 755 551" id="group1" scrollbars="autoboth">
- <Layouts>
- <Layout>
- <Button position="absolute 642 4 698 26" id="btn_confirm" class="btn4" text="확인" anchor="default" onclick="group1_btn_confirm_onclick"/>
- <Button position="absolute 699 4 755 26" id="btn_cancel" class="btn4" text="취소" anchor="default" onclick="group1_btn_cancel_onclick"/>
- <Shape position="absolute 0 0 755 6" linetype="horizontal" id="line32" class="line_6" anchor="default"/>
- </Layout>
- </Layouts>
- </Div>
- </Layout>
- </Layouts>
- <Objects>
- <Dataset id="ds_main_fileinfo_fileinfolist" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false"/>
- <Dataset id="ds_target" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false"/>
- <Dataset id="ds_init" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false"/>
- <Dataset id="ds_send_fileinfo" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
- <ColumnInfo>
- <Column id="instcd" type="STRING" size="256"/>
- <Column id="reqdd" type="STRING" size="256"/>
- <Column id="reqflag" type="STRING" size="256"/>
- <Column id="reqno" type="STRING" size="256"/>
- <Column id="reqseqno" type="STRING" size="256"/>
- <Column id="reqpsnid" type="STRING" size="256"/>
- <Column id="reqdeptcd" type="STRING" size="256"/>
- <Column id="fileseqno" type="STRING" size="256"/>
- </ColumnInfo>
- <Rows>
- <Row>
- <Col id="instcd"/>
- <Col id="reqdd"/>
- <Col id="reqflag"/>
- <Col id="reqno"/>
- <Col id="reqseqno"/>
- <Col id="reqpsnid"/>
- <Col id="reqdeptcd"/>
- <Col id="fileseqno"/>
- </Row>
- </Rows>
- </Dataset>
- <Dataset id="ds_send_save_fileinfolist" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false"/>
- <Dataset id="ds_target_defaultvalue" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false"/>
- <Dataset id="ds_download" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false"/>
- <Dataset id="ds_send_fileupcolumn_fileupload" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="keep">
- <ColumnInfo>
- <Column id="file" type="STRING" size="256"/>
- <Column id="filedata" type="BLOB" size="256"/>
- <Column id="filenm" type="STRING" size="256"/>
- <Column id="filesize" type="STRING" size="256"/>
- <Column id="filetype" type="STRING" size="256"/>
- <Column id="fullpath" type="STRING" size="256"/>
- </ColumnInfo>
- <Rows>
- <Row>
- <Col id="file"/>
- </Row>
- </Rows>
- </Dataset>
- </Objects>
- <Script type="xscript4.0"><![CDATA[/***************************************************************************************
- * System Name :
- * Job Name :
- * Creator :
- * Make Date : 2017-06-19
- * Description :
- *---------------------------------------------------------------------------------------
- * Modify Date Modifier Modify Description
- *---------------------------------------------------------------------------------------
- * 2017-06-19 Live Converter TF->XP
- *
- *---------------------------------------------------------------------------------------
- ****************************************************************************************/
- //=======================================================================================
- // Lib Include
- //---------------------------------------------------------------------------------------
- include "com_commonxp::comm_main.xjs";
- include "mis_miscommonxp::MIS.xjs";
- //=======================================================================================
- // Global Form Variable
- //---------------------------------------------------------------------------------------
- var arErrorCode = new HashArray();
- //=======================================================================================
- // Function
- //---------------------------------------------------------------------------------------
- /****************************************************************************************
- * Argument : N/A
- * Description : 초기화
- ****************************************************************************************/
-
- //=======================================================================================
- // Event
- //---------------------------------------------------------------------------------------
- /****************************************************************************************
- * Components : Form
- * Description : 화면 처음 초기화시 폼초기화
- ****************************************************************************************/
- function SMRSD00420_onload(obj:Form, e:LoadEventInfo)
- {
- frmf_initForm(obj);
- //grdf_initGrid(grd_XXX);
- grdf_setGridSort(group3.grd_fileinfo);
- grdf_setRowTypeIcon(group3.grd_fileinfo, 0);
-
- try{
- ds_target_defaultvalue.copyData(arg_ds_source_defaultvalue);
- }catch(e){}
- misfGridInit(group3.grd_fileinfo);
- misfMsterDetailSet("group3.grd_fileinfo", null, "TRRSD00421" ,"Y");
-
- if( !utlf_isNull(ds_main_fileinfo_fileinfolist.getColumnInfo("reqdeptnm")) ){
- ds_main_fileinfo_fileinfolist.updateColID("reqdeptnm", "deptnm");
- }else{
- ds_main_fileinfo_fileinfolist.addColumn("deptnm", "string");
- }
- if( !utlf_isNull(ds_main_fileinfo_fileinfolist.getColumnInfo("reqpsnnm")) ){
- ds_main_fileinfo_fileinfolist.updateColID("reqpsnnm", "emplnm");
- }else{
- ds_main_fileinfo_fileinfolist.addColumn("emplnm", "string");
- }
- if( !utlf_isNull(ds_main_fileinfo_fileinfolist.getColumnInfo("attfilenm")) ){
- ds_main_fileinfo_fileinfolist.updateColID("attfilenm", "filenm");
- }else{
- ds_main_fileinfo_fileinfolist.addColumn("filenm", "string");
- }
-
- if(!utlf_isNull(ds_target_defaultvalue.getColumn(0, "instcd"))) {
- ds_send_fileinfo.setColumn(0,"instcd", ds_target_defaultvalue.getColumn(0, "instcd"));
- ds_send_fileinfo.setColumn(0,"reqdd", ds_target_defaultvalue.getColumn(0, "reqdd"));
- ds_send_fileinfo.setColumn(0,"reqflag", ds_target_defaultvalue.getColumn(0, "reqflag"));
- ds_send_fileinfo.setColumn(0,"reqno", ds_target_defaultvalue.getColumn(0, "reqno"));
- ds_send_fileinfo.setColumn(0,"reqseqno", ds_target_defaultvalue.getColumn(0, "reqseqno"));
- ds_send_fileinfo.setColumn(0,"reqpsnid", ds_target_defaultvalue.getColumn(0, "reqpsnid"));
- ds_send_fileinfo.setColumn(0,"reqdeptcd", ds_target_defaultvalue.getColumn(0, "reqdeptcd"));
- ds_send_fileinfo.setColumn(0,"fileseqno" , ds_target_defaultvalue.getColumn(0, "attfilepathnm"));
- group3.btn_search.click();
- }
- }
- /****************************************************************************************
- * Components : Form
- * Description : 화면 닫을때 이벤트
- ****************************************************************************************/
- function SMRSD00420_onclose(obj:Form, e:CloseEventInfo)
- {
- var dsUpdate = grdf_getGridUpdateData(group3.grd_fileinfo, "all");
- if (dsUpdate.rowcount > 0) {
- if (group3.btn_save.enable == true) {
- var save_val = sysf_messageBox("삭제 자료가 존재 합니다. ", "Q002");
-
- if (save_val == "6") {
- group3.btn_save.click();
- }
- }
- }
- }
- /****************************************************************************************
- * Components : Grid
- * Description : 첨부파일내역 선택
- ****************************************************************************************/
- function group3_grd_fileinfo_oncelldblclick(obj:Grid, e:GridClickEventInfo) {
- if(e.row < 0) return;
- var idx = e.row;
- var filepath = ds_main_fileinfo_fileinfolist.getColumn(idx, "filepath");
- var filenm = ds_main_fileinfo_fileinfolist.getColumn(idx, "filenm");
- var arrFilenm = filenm.split(".");
-
- // if(!utlf_isNull(objVFile)) {
- // ds_send_fileupcolumn_fileupload.clearData();
- // var nRow = ds_send_fileupcolumn_fileupload.addRow();
- // // 해당 파일을 데이터 셋에 저장한다.
- // lf_saveFile(objVFile, nRow);
- // }
-
- var fd = new FileDialog;
- var objVFile = fd.open("FileSave", FileDialog.SAVE, "%MYDOCUMENT%", filenm); // 단일 파일 선택
- if (objVFile != null)
- {
- ds_send_fileupcolumn_fileupload.clearData();
- var nRow = ds_send_fileupcolumn_fileupload.addRow();
- // 해당 파일을 데이터 셋에 저장한다.
- lf_saveFile(objVFile, nRow);
-
- dsf_createDsRow("ds_req", [{col:"filepath", val:filepath}]);
-
- sysf_setErrorMsg(false); //자바단에서 에러발생시 1.0은 오류리턴을 안해서...
-
- var oParam = {};
- oParam.id = "TRRSD00422";
- oParam.service = "reqapp.ReqMngt";
- oParam.method = "reqGetReqAttfileDownLoad";
- oParam.inds = "req=ds_req";
- oParam.outds = "ds_download=attachfile";
- oParam.async = false;
- oParam.callback = "cf_TRRSD00422";
- tranf_submit(oParam);
-
- sysf_setErrorMsg(true);
-
- if(arErrorCode.pop("TRRSD00422") > -1) {
-
- var temp = dsf_readFileFromDs(objVFile.fullpath, ds_download, 0, "filedata"); // 파일저장
- sleep(1000);
-
- if( !utlf_isNull(temp) )
- {
- var rtn = sysf_messageBox("파일을", "Q004");
- if( rtn == 6 )
- {
- // var text = new String(objVFile.fullpath);
- // var replaceText = text.replace(" ", "");
- // if( text.length != replaceText.length )
- // {
- // sysf_messageBox("공백이 포함된 [파일명/폴더]는 자동열기가 실행되지 않습니다.", "E999", "");
- // return;
- // }
- // else
- // {
- var objExtCommon = new ExtCommon();
- var rtn = objExtCommon.executeProcess(objVFile.fullpath,"","");
- //}
- }
- }
- }
- }
- group3.btn_search.click();
- }
- function lf_saveFile(objVFile, nRow)
- {
- // 그 파일의 데이터를 데이터셋의 특정 컬럼에 BLOB 형식으로 write 한다.
- var file = dsf_writeFileToDs(objVFile, ds_send_fileupcolumn_fileupload, nRow, "filedata");
- ds_send_fileupcolumn_fileupload.setColumn(nRow, "filenm", file.filename);
- ds_send_fileupcolumn_fileupload.setColumn(nRow, "filesize", file.filesize);
- ds_send_fileupcolumn_fileupload.setColumn(nRow, "filetype", file.filetype);
- ds_send_fileupcolumn_fileupload.setColumn(nRow, "fullpath", objVFile.fullpath);
-
- //ds_main_goodreq_goodreqlist.setColumn(0, "attfilenm", file.filename);
-
- if(!utlf_isNull(ds_send_fileupcolumn_fileupload.getColumn(0,"filenm")) ) {
- var qrycnt = utlf_transNullToEmpty(ds_main_fileinfo_fileinfolist.getColumn(ds_main_fileinfo_fileinfolist.rowposition, "qrycnt"));
- //qrycnt 가 빈값일 경우는 숫자로 변환해도 0이 아닌 값으로 변환되므로 조건문으로 처리한다.
- if ( utlf_isNull(qrycnt)) {
- qrycnt = 0;
- }
- cnt = parseInt(qrycnt)+1;
- ds_main_fileinfo_fileinfolist.setColumn( ds_main_fileinfo_fileinfolist.rowposition , "qrycnt", cnt);
- //group3.grd_fileinfo.addStatus(idx,"update");
-
- misfSave("TXRSD00422");
- }
- }
- function cf_TRRSD00422(sSvcId, nErrorCode, sErrorMsg) {
- arErrorCode.push(sSvcId, nErrorCode);
- }
- /****************************************************************************************
- * Components : Button
- * Description : 조회
- ****************************************************************************************/
- function group3_btn_search_onclick(obj:Button, e:ClickEventInfo) {
- misfMsterDetailRetrieve();
-
- if( !utlf_isNull(ds_main_fileinfo_fileinfolist.getColumnInfo("reqdeptnm")) ){
- ds_main_fileinfo_fileinfolist.updateColID("reqdeptnm", "deptnm");
- }else{
- ds_main_fileinfo_fileinfolist.addColumn("deptnm", "string");
- }
- if( !utlf_isNull(ds_main_fileinfo_fileinfolist.getColumnInfo("reqpsnnm")) ){
- ds_main_fileinfo_fileinfolist.updateColID("reqpsnnm", "emplnm");
- }else{
- ds_main_fileinfo_fileinfolist.addColumn("emplnm", "string");
- }
- if( !utlf_isNull(ds_main_fileinfo_fileinfolist.getColumnInfo("attfilenm")) ){
- ds_main_fileinfo_fileinfolist.updateColID("attfilenm", "filenm");
- }else{
- ds_main_fileinfo_fileinfolist.addColumn("filenm", "string");
- }
-
- var reqpsnid = ds_send_fileinfo.getColumn(0,"reqpsnid");
- if (ds_main_fileinfo_fileinfolist.rowcount > 0) {
- if (ds_main_fileinfo_fileinfolist.getColumn(0, "reqpsnid") == reqpsnid) {
- group3.btn_save.enable = true;
- group3.btn_delgrd.enable = true;
- }
- else {
- group3.btn_save.enable = false;
- group3.btn_delgrd.enable = false;
- }
- }
- else {
- group3.btn_save.enable = false;
- group3.btn_delgrd.enable = false;
- }
- }
- /****************************************************************************************
- * Components : Button
- * Description : 저장
- ****************************************************************************************/
- function group3_btn_save_onclick(obj:Button, e:ClickEventInfo) {
- //그리드 for 문 돌려서 삭제인 것만 찾아서 attfilenm 을 다 null로 바꾸어 주고 부모창에 넘기면 된다....
- /*
- for (var i=group3.grd_fileinfo.fixedRows ; i< group3.grd_fileinfo.rows ; i++) {
- if ( group3.grd_fileinfo.rowStatus(i) = 4) {
- model.setValue("/root/main/fileinfo/fileinfolist["+i+"]/attfilenm" , "");
- }
- }
- */
- misfSave("TXRSD00422");
- group3.btn_search.click();
- //부모창 즉 비품청구 등록 창에 첨부파일 항목을 지워주어야 한다.
- //attfilenm 을 빈값으로 만든 다음 넘겨야 한다.
- //즉 노드셋단에서 한번 조작을 가한후 해당 데이터를 부모창에 넘겨주어햐 한다.
- //misfPopUpListReturn(group3.grd_fileinfo);
- }
- /****************************************************************************************
- * Components : Button
- * Description : 행삭제
- ****************************************************************************************/
- function group3_btn_delgrd_onclick(obj:Button, e:ClickEventInfo) {
- misfGridIUD(group3.grd_fileinfo, "D");
- }
- /****************************************************************************************
- * Components : Button
- * Description : 확인
- ****************************************************************************************/
- function group1_btn_confirm_onclick(obj:Button, e:ClickEventInfo) {
- this.close();
- }
- /****************************************************************************************
- * Components : Button
- * Description : 닫기
- ****************************************************************************************/
- function group1_btn_cancel_onclick(obj:Button, e:ClickEventInfo) {
- this.close();
- }
- ]]></Script>
- </Form>
- </FDL>
|