SMRFC01100_고정자산 첨부파일.xrw 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  1. <?xml version="1.0" encoding="EUC-KR"?>
  2. <?xml-stylesheet type="text/css" href="../../../com/commonweb/css/common.css" ?>
  3. <xhtml:html xmlns:ex="http://www.comsquare.co.kr/xforms/excel" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:my="http://www.comsquare.co.kr/example" xmlns:ms="urn:schemas-microsoft-com:xslt" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2002/01/xforms" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:cs="http://www.comsquare.co.kr/xforms">
  4. <xhtml:head>
  5. <xhtml:title>첨부파일조회</xhtml:title>
  6. <model id="model1">
  7. <instance id="instance1">
  8. <root xmlns="">
  9. <main>
  10. <fileinfo>
  11. <fileinfolist/>
  12. </fileinfo>
  13. </main>
  14. <target/>
  15. <init>
  16. </init>
  17. <send>
  18. <fileinfo>
  19. <fixasetcd/>
  20. <fixasetnm/>
  21. </fileinfo>
  22. <save>
  23. <fileinfolist/>
  24. </save>
  25. <fileupcolumn>
  26. <refinstcd/>
  27. <refdeptcd/>
  28. <refpsnid/>
  29. <fixasetcd/>
  30. <fileseqno/>
  31. <attfilenm/>
  32. <attfilepathnm/>
  33. <fileupload>
  34. <file>
  35. <filename/>
  36. </file>
  37. </fileupload>
  38. </fileupcolumn>
  39. </send>
  40. </root>
  41. </instance>
  42. <script type="javascript" ev:event="xforms-ready">
  43. <![CDATA[
  44. misfGridInit(grd_fileinfo);
  45. misfMsterDetailSet(grd_fileinfo,null, "TRRFC01101" ,"Y");
  46. if(model.getValue("/root/target/defaultvalue/fixasetcd").length > 0){
  47. model.setValue("/root/send/fileinfo/fixasetcd", model.getValue("/root/target/defaultvalue/fixasetcd"));
  48. model.setValue("/root/send/fileinfo/fixasetnm" , model.getValue("/root/target/defaultvalue/fixasetnm"));
  49. model.refresh();
  50. btn_search.dispatch("DOMActivate");
  51. } else {
  52. messageBox("자산코드가 없는 경우 조회가 불가능 합니다.", "I");
  53. btn_cancel.dispatch("DOMActivate");
  54. }
  55. ]]>
  56. </script>
  57. <script type="javascript" ev:event="xforms-model-destruct">
  58. <![CDATA[
  59. if (getGridUpdateData(grd_fileinfo) != "" ) {
  60. if (btn_save.disabled == false) {
  61. var save_val = messageBox("삭제 자료가 존재 합니다. ", "Q002");
  62. if (save_val == "6") {
  63. btn_save.dispatch("DOMActivate");
  64. }
  65. }
  66. }
  67. ]]>
  68. </script>
  69. <submission id="TRRFC01101" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send/fileinfo" resultref="/root/main/fileinfo"/>
  70. <submission id="TXRFC01101" mediatype="multipart/form-data" method="form-data-post" ref="/root/send/fileupcolumn" resultref="/root/temp"/>
  71. <submission id="TXRFC01102" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send/fileinfo" resultref="/root/main/fileinfo"/>
  72. </model>
  73. <script type="javascript" src="../../../com/commonweb/js/common.js"/>
  74. <script type="javascript" src="../../../mis/miscommonweb/js/MIS.js"/>
  75. <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
  76. <script type="javascript" src="../../../com/commonweb/js/dateHelper.js"/>
  77. <script type="javascript">
  78. <![CDATA[
  79. function fAttfileAdd(){
  80. //파일 다운로드 하는 기능
  81. var maxsize = upd_uploadfile.attribute("filesize");
  82. model.setValue("/root/send/fileupcolumn/refinstcd" , getUserInfo("dutplceinstcd"));
  83. model.setValue("/root/send/fileupcolumn/refdeptcd" , getUserInfo("dutplcecd"));
  84. model.setValue("/root/send/fileupcolumn/refpsnid" , getUserInfo("userid"));
  85. model.setValue("/root/send/fileupcolumn/fixasetcd" , model.getValue(ipt_fixasetcd_search.attribute("ref")));
  86. submit("TXRFC01101");
  87. if (model.getValue(gvErrorMsgPath + "/type") != "error" ){
  88. //messageBox("첨부파일이 업로드" , "I002");
  89. btn_search.dispatch("DOMActivate");
  90. }
  91. //파일 업로드 후 첨부파일 팝업창을 띄워서 해당 파일이 잘 올라갔는지 확인할수 있도록 해준다.?????
  92. }
  93. ]]>
  94. </script>
  95. </xhtml:head>
  96. <xhtml:body pagewidth="800" pageheight="540" style="margin-left:8; margin-top:0; margin-right:8; margin-bottom:0; ">
  97. <group id="group3" scroll="auto" style="left:10px; top:0px; width:755px; height:522px; ">
  98. <caption id="caption1" class="tit_2" style="left:3px; top:11px; width:175px; height:13px; ">첨부파일내역조회</caption>
  99. <line id="line1" class="line_1" style="x1:0px; y1:27px; x2:755px; y2:27px; "/>
  100. <datagrid id="grd_fileinfo" nodeset="/root/main/fileinfo/fileinfolist" scroll="auto" caption="첨부파일번호^자산코드^파일이름^파일크기^파일타입^다운로드^파일경로^첨부기관^첨부기관^첨부부서^첨부부서^등록자^등록자^등록시간" colsep="^" colwidth="84, 100, 350, 67, 150, 60, 100, 43, 100, 80, 100, 60, 70, 80" dataheight="23" defaultrows="0" explorerbar="sortshow" extendlastcol="false" mergecellsfixedrows="byrow" rowheader="update" rowheight="23" rowsep="|" tooltip="true" style="left:0px; top:59px; width:755px; height:440px; ">
  101. <col ref="fileseqno" visibility="hidden"/>
  102. <col ref="fixasetcd" visibility="hidden" style="text-align:left; "/>
  103. <col ref="filenm"/>
  104. <col ref="filesize" format="#,###" style="text-align:right; "/>
  105. <col ref="filetype"/>
  106. <col ref="qrycnt" format="#,###" style="text-align:right; "/>
  107. <col ref="filepath" visibility="hidden"/>
  108. <col ref="refinstcd" visibility="hidden"/>
  109. <col ref="refinstnm" visibility="hidden"/>
  110. <col ref="refdeptcd" visibility="hidden"/>
  111. <col ref="refdeptnm" visibility="hidden"/>
  112. <col ref="refpsnid" visibility="hidden"/>
  113. <col ref="refpsnnm"/>
  114. <col ref="fstrgstdt" style="text-align:center; "/>
  115. <script type="javascript" ev:event="ondblclick">
  116. <![CDATA[
  117. var idx = grd_fileinfo.row;
  118. if(idx >= grd_fileinfo.fixedRows) {
  119. var filepath = model.getValue("/root/main/fileinfo/fileinfolist["+idx+"]/filepath");
  120. var fileseqno = model.getValue("/root/main/fileinfo/fileinfolist["+idx+"]/fileseqno");
  121. var filenm = model.getValue("/root/main/fileinfo/fileinfolist["+idx+"]/filenm");
  122. var fileExt = "*";
  123. if(filenm != null) {
  124. fileExt = filenm.substr(filenm.lastIndexOf('.')+1);
  125. }
  126. var localfile = window.fileDialog("save","|",false,filenm,fileExt,"Files(*." + fileExt + ")|*." + fileExt);
  127. if (localfile != "") {
  128. model.download(getActionURL("TRRFC01102")+"&filepath="+filepath+"&fileseqno="+fileseqno,localfile);
  129. var rtn = messageBox("파일을", "Q004");
  130. if( rtn == 6 ) {
  131. window.exec(localfile);
  132. }
  133. }
  134. btn_search.dispatch("DOMActivate");
  135. }
  136. ]]>
  137. </script>
  138. <script type="javascript" ev:event="onaftersort">
  139. <![CDATA[
  140. grd_fileinfo.gridToInstance();
  141. ]]>
  142. </script>
  143. </datagrid>
  144. <button id="btn_search" class="btn1_letter2" visibility="hidden" style="left:636px; top:4px; width:56px; height:22px; ">
  145. <caption>조회</caption>
  146. <script type="javascript" ev:event="DOMActivate">
  147. <![CDATA[
  148. misfMsterDetailRetrieve();
  149. var reqpsnid = model.getValue("/root/send/fileinfo/reqpsnid");
  150. if (grd_fileinfo.rows - grd_fileinfo.fixedRows > 0) {
  151. if (grd_fileinfo.valueMatrix(grd_fileinfo.fixedRows, grd_fileinfo.colRef("reqpsnid")) == reqpsnid) {
  152. btn_save.disabled = false;
  153. btn_delgrd.disabled = false;
  154. }
  155. else {
  156. btn_save.disabled = true;
  157. btn_delgrd.disabled = true;
  158. }
  159. }
  160. else {
  161. btn_save.disabled = true;
  162. btn_delgrd.disabled = true;
  163. }
  164. ]]>
  165. </script>
  166. </button>
  167. <button id="btn_save" class="btn4_letter2" style="left:696px; top:4px; width:56px; height:22px; ">
  168. <caption>저장</caption>
  169. <script type="javascript" ev:event="DOMActivate">
  170. <![CDATA[
  171. var delCount = 0;
  172. for (var i=grd_fileinfo.fixedRows ; i< grd_fileinfo.rows ; i++) {
  173. if ( grd_fileinfo.rowStatus(i) == 4) {
  174. delCount++;
  175. }
  176. }
  177. var rtn = messageBox(delCount + "건의 파일 삭제를", "Q009");
  178. if( rtn == 6 ) {
  179. misfSave("TXRFC01102");
  180. btn_search.dispatch("DOMActivate");
  181. }
  182. ]]>
  183. </script>
  184. </button>
  185. <line id="line2" class="line_3" style="x1:0px; y1:57px; x2:755px; y2:57px; "/>
  186. <button id="btn_delgrd" class="btn2_letter4" style="left:688px; top:35px; width:64px; height:19px; ">
  187. <caption>파일삭제</caption>
  188. <script type="javascript" ev:event="DOMActivate">
  189. <![CDATA[
  190. misfGridIUD(grd_fileinfo, "D");
  191. ]]>
  192. </script>
  193. </button>
  194. <button id="btn_addfile" class="btn2_letter4" style="left:620px; top:35px; width:64px; height:19px; ">
  195. <caption>파일추가</caption>
  196. <script type="javascript" ev:event="DOMActivate">
  197. <![CDATA[
  198. var files = window.fileDialog("open", "|", false);
  199. var replacepath = "";
  200. if( files.length <= 0 ) return;
  201. model.setValue(ipt_uploadfile.attribute("ref") , files); //전체파일경로와이름을 셋팅
  202. //var filename = files.substring(files.lastIndexOf('\\')+1 , files.length ); //파일이름만 나오게 문자정리
  203. //model.setValue(ipt_attfilenm.attribute("ref") , filename);
  204. if (model.getValue( ipt_uploadfile.attribute("ref") ).length > 0) {
  205. fAttfileAdd(); //첨부파일 서버로 저장하는 메소드 호출
  206. }
  207. ]]>
  208. </script>
  209. </button>
  210. <caption id="cap_fixasetcd_search" class="search_name" style="left:13px; top:36px; width:117px; height:17px; ">자산코드 :</caption>
  211. <input id="ipt_fixasetcd_search" ref="/root/send/fileinfo/fixasetcd" class="output_fix" navindex="16" editable="false" imemode="disabled" _chartype="upper" style="left:105px; top:35px; width:105px; height:19px; ">
  212. <script type="javascript" ev:event="onkeyup">
  213. <![CDATA[
  214. inputEnterKey("btn_search", "DOMActivate");
  215. ]]>
  216. </script>
  217. </input>
  218. <input id="ipt_goodnm_search" ref="/root/send/fileinfo/fixasetnm" class="output_fix" navindex="6" editable="false" style="left:300px; top:35px; width:281px; height:19px; ">
  219. <script type="javascript" ev:event="onkeyup">
  220. <![CDATA[
  221. inputEnterKey("btn_search", "DOMActivate");
  222. ]]>
  223. </script>
  224. </input>
  225. <caption id="cap_goodflaghngnm_search" class="search_name" style="left:218px; top:35px; width:87px; height:17px; ">자 산 명 :</caption>
  226. <upload id="upd_uploadfile" nodeset="/root/send/fileupcolumn/fileupload/file" filecount="5" validate="true" style="left:480px; top:5px; width:25px; height:20px; "/>
  227. <input id="ipt_uploadfile" ref="/root/send/fileupcolumn/fileupload/file" visibility="hidden" style="left:440px; top:5px; width:35px; height:19px; "/>
  228. </group>
  229. <group id="group1" scroll="auto" style="left:10px; top:501px; width:755px; height:27px; ">
  230. <button id="btn_confirm" class="btn4_letter2" style="left:637px; top:2px; width:56px; height:22px; ">
  231. <caption>확인</caption>
  232. <script type="javascript" ev:event="DOMActivate">
  233. <![CDATA[
  234. window.close();
  235. ]]>
  236. </script>
  237. </button>
  238. <button id="btn_cancel" class="btn4_letter2" style="left:694px; top:2px; width:56px; height:22px; ">
  239. <caption>취소</caption>
  240. <script type="javascript" ev:event="DOMActivate">
  241. <![CDATA[
  242. window.close();
  243. ]]>
  244. </script>
  245. </button>
  246. <line id="line32" class="line_6" style="x1:0px; y1:0px; x2:580; y2:0px; "/>
  247. </group>
  248. </xhtml:body>
  249. </xhtml:html>