SMRSD00420_물품청구첨부파일조회.xfdl 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <FDL version="1.5">
  3. <TypeDefinition url="..\..\..\default_typedef.xml"/>
  4. <Form id="SMRSD00420" position="absolute 0 0 756 553" titletext="첨부파일조회" onload="SMRSD00420_onload" onclose="SMRSD00420_onclose">
  5. <Layouts>
  6. <Layout>
  7. <Div position="absolute 0 0 755 522" id="group3" scrollbars="autoboth">
  8. <Layouts>
  9. <Layout>
  10. <Static text="첨부파일내역조회" position="absolute 0 8 183 24" id="caption1" class="tit_2" anchor="default"/>
  11. <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">
  12. <Formats>
  13. <Format id="default">
  14. <Columns>
  15. <Column size="25" band="left"/>
  16. <Column size="75"/>
  17. <Column size="86"/>
  18. <Column size="246"/>
  19. <Column size="67"/>
  20. <Column size="150"/>
  21. <Column size="71"/>
  22. <Column size="91"/>
  23. <Column size="0"/>
  24. <Column size="0"/>
  25. <Column size="0"/>
  26. <Column size="0"/>
  27. <Column size="0"/>
  28. <Column size="0"/>
  29. <Column size="0"/>
  30. <Column size="0"/>
  31. <Column size="0"/>
  32. <Column size="0"/>
  33. <Column size="0"/>
  34. <Column size="0"/>
  35. <Column size="0"/>
  36. <Column size="0"/>
  37. <Column size="0"/>
  38. <Column size="0"/>
  39. <Column size="0"/>
  40. </Columns>
  41. <Rows>
  42. <Row size="24" band="head"/>
  43. <Row size="24"/>
  44. </Rows>
  45. <Band id="head">
  46. <Cell/>
  47. <Cell col="1" text="청구일자"/>
  48. <Cell col="2" text="첨부파일번호"/>
  49. <Cell col="3" text="파일이름"/>
  50. <Cell col="4" text="파일크기"/>
  51. <Cell col="5" text="파일타입"/>
  52. <Cell col="6" text="다운로드수"/>
  53. <Cell col="7" text="부서명"/>
  54. <Cell col="8" text="파일이름(부모창)"/>
  55. <Cell col="9"/>
  56. <Cell col="10"/>
  57. <Cell col="11"/>
  58. <Cell col="12"/>
  59. <Cell col="13"/>
  60. <Cell col="14"/>
  61. <Cell col="15"/>
  62. <Cell col="16"/>
  63. <Cell col="17"/>
  64. <Cell col="18"/>
  65. <Cell col="19"/>
  66. <Cell col="20"/>
  67. <Cell col="21"/>
  68. <Cell col="22"/>
  69. <Cell col="23"/>
  70. <Cell col="24"/>
  71. </Band>
  72. <Band id="body">
  73. <Cell celltype="head"/>
  74. <Cell col="1" displaytype="expr:utlf_isNull(reqdd) ? 'normal' : 'date'" text="bind:reqdd"/>
  75. <Cell col="2" displaytype="text" text="bind:fileseqno"/>
  76. <Cell col="3" displaytype="text" text="bind:filenm"/>
  77. <Cell col="4" displaytype="text" style="align:right;" text="bind:filesize"/>
  78. <Cell col="5" displaytype="text" text="bind:filetype"/>
  79. <Cell col="6" text="bind:qrycnt"/>
  80. <Cell col="7" displaytype="text" text="bind:reqdeptnm"/>
  81. <Cell col="8" text="bind:attfilenm"/>
  82. <Cell col="9" text="bind:instcd"/>
  83. <Cell col="10" text="bind:reqdeptcd"/>
  84. <Cell col="11" text="bind:goalflag"/>
  85. <Cell col="12" text="bind:seqno"/>
  86. <Cell col="13" text="bind:reqpsnid"/>
  87. <Cell col="14" text="bind:filepath"/>
  88. <Cell col="15" text="bind:reqflag"/>
  89. <Cell col="16" text="bind:reqno"/>
  90. <Cell col="17" text="bind:reqseqno"/>
  91. <Cell col="18" text="bind:valumdlcd"/>
  92. <Cell col="19" text="bind:valuclsdetlcd"/>
  93. <Cell col="20" text="bind:publbaseflag"/>
  94. <Cell col="21" text="bind:idxcd"/>
  95. <Cell col="22" text="bind:seqno2"/>
  96. <Cell col="23" text="bind:wrtedd"/>
  97. <Cell col="24" text="bind:fileflag"/>
  98. </Band>
  99. </Format>
  100. </Formats>
  101. </Grid>
  102. <Button position="absolute 640 2 696 24" id="btn_search" class="btn1" text="조회" anchor="default" onclick="group3_btn_search_onclick"/>
  103. <Button position="absolute 699 2 755 24" id="btn_save" class="btn4" text="저장" anchor="default" onclick="group3_btn_save_onclick"/>
  104. <Shape position="absolute 0 24 755 30" linetype="horizontal" id="line2" class="line_10" anchor="default"/>
  105. <Button position="absolute 702 29 755 49" id="btn_delgrd" class="btn2" text="행삭제" anchor="default" onclick="group3_btn_delgrd_onclick"/>
  106. </Layout>
  107. </Layouts>
  108. </Div>
  109. <Div position="absolute 0 524 755 551" id="group1" scrollbars="autoboth">
  110. <Layouts>
  111. <Layout>
  112. <Button position="absolute 642 4 698 26" id="btn_confirm" class="btn4" text="확인" anchor="default" onclick="group1_btn_confirm_onclick"/>
  113. <Button position="absolute 699 4 755 26" id="btn_cancel" class="btn4" text="취소" anchor="default" onclick="group1_btn_cancel_onclick"/>
  114. <Shape position="absolute 0 0 755 6" linetype="horizontal" id="line32" class="line_6" anchor="default"/>
  115. </Layout>
  116. </Layouts>
  117. </Div>
  118. </Layout>
  119. </Layouts>
  120. <Objects>
  121. <Dataset id="ds_main_fileinfo_fileinfolist" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false"/>
  122. <Dataset id="ds_target" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false"/>
  123. <Dataset id="ds_init" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false"/>
  124. <Dataset id="ds_send_fileinfo" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
  125. <ColumnInfo>
  126. <Column id="instcd" type="STRING" size="256"/>
  127. <Column id="reqdd" type="STRING" size="256"/>
  128. <Column id="reqflag" type="STRING" size="256"/>
  129. <Column id="reqno" type="STRING" size="256"/>
  130. <Column id="reqseqno" type="STRING" size="256"/>
  131. <Column id="reqpsnid" type="STRING" size="256"/>
  132. <Column id="reqdeptcd" type="STRING" size="256"/>
  133. <Column id="fileseqno" type="STRING" size="256"/>
  134. </ColumnInfo>
  135. <Rows>
  136. <Row>
  137. <Col id="instcd"/>
  138. <Col id="reqdd"/>
  139. <Col id="reqflag"/>
  140. <Col id="reqno"/>
  141. <Col id="reqseqno"/>
  142. <Col id="reqpsnid"/>
  143. <Col id="reqdeptcd"/>
  144. <Col id="fileseqno"/>
  145. </Row>
  146. </Rows>
  147. </Dataset>
  148. <Dataset id="ds_send_save_fileinfolist" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false"/>
  149. <Dataset id="ds_target_defaultvalue" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false"/>
  150. <Dataset id="ds_download" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false"/>
  151. <Dataset id="ds_send_fileupcolumn_fileupload" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="keep">
  152. <ColumnInfo>
  153. <Column id="file" type="STRING" size="256"/>
  154. <Column id="filedata" type="BLOB" size="256"/>
  155. <Column id="filenm" type="STRING" size="256"/>
  156. <Column id="filesize" type="STRING" size="256"/>
  157. <Column id="filetype" type="STRING" size="256"/>
  158. <Column id="fullpath" type="STRING" size="256"/>
  159. </ColumnInfo>
  160. <Rows>
  161. <Row>
  162. <Col id="file"/>
  163. </Row>
  164. </Rows>
  165. </Dataset>
  166. </Objects>
  167. <Script type="xscript4.0"><![CDATA[/***************************************************************************************
  168. * System Name :
  169. * Job Name :
  170. * Creator :
  171. * Make Date : 2017-06-19
  172. * Description :
  173. *---------------------------------------------------------------------------------------
  174. * Modify Date Modifier Modify Description
  175. *---------------------------------------------------------------------------------------
  176. * 2017-06-19 Live Converter TF->XP
  177. *
  178. *---------------------------------------------------------------------------------------
  179. ****************************************************************************************/
  180. //=======================================================================================
  181. // Lib Include
  182. //---------------------------------------------------------------------------------------
  183. include "com_commonxp::comm_main.xjs";
  184. include "mis_miscommonxp::MIS.xjs";
  185. //=======================================================================================
  186. // Global Form Variable
  187. //---------------------------------------------------------------------------------------
  188. var arErrorCode = new HashArray();
  189. //=======================================================================================
  190. // Function
  191. //---------------------------------------------------------------------------------------
  192. /****************************************************************************************
  193. * Argument : N/A
  194. * Description : 초기화
  195. ****************************************************************************************/
  196. //=======================================================================================
  197. // Event
  198. //---------------------------------------------------------------------------------------
  199. /****************************************************************************************
  200. * Components : Form
  201. * Description : 화면 처음 초기화시 폼초기화
  202. ****************************************************************************************/
  203. function SMRSD00420_onload(obj:Form, e:LoadEventInfo)
  204. {
  205. frmf_initForm(obj);
  206. //grdf_initGrid(grd_XXX);
  207. grdf_setGridSort(group3.grd_fileinfo);
  208. grdf_setRowTypeIcon(group3.grd_fileinfo, 0);
  209. try{
  210. ds_target_defaultvalue.copyData(arg_ds_source_defaultvalue);
  211. }catch(e){}
  212. misfGridInit(group3.grd_fileinfo);
  213. misfMsterDetailSet("group3.grd_fileinfo", null, "TRRSD00421" ,"Y");
  214. if( !utlf_isNull(ds_main_fileinfo_fileinfolist.getColumnInfo("reqdeptnm")) ){
  215. ds_main_fileinfo_fileinfolist.updateColID("reqdeptnm", "deptnm");
  216. }else{
  217. ds_main_fileinfo_fileinfolist.addColumn("deptnm", "string");
  218. }
  219. if( !utlf_isNull(ds_main_fileinfo_fileinfolist.getColumnInfo("reqpsnnm")) ){
  220. ds_main_fileinfo_fileinfolist.updateColID("reqpsnnm", "emplnm");
  221. }else{
  222. ds_main_fileinfo_fileinfolist.addColumn("emplnm", "string");
  223. }
  224. if( !utlf_isNull(ds_main_fileinfo_fileinfolist.getColumnInfo("attfilenm")) ){
  225. ds_main_fileinfo_fileinfolist.updateColID("attfilenm", "filenm");
  226. }else{
  227. ds_main_fileinfo_fileinfolist.addColumn("filenm", "string");
  228. }
  229. if(!utlf_isNull(ds_target_defaultvalue.getColumn(0, "instcd"))) {
  230. ds_send_fileinfo.setColumn(0,"instcd", ds_target_defaultvalue.getColumn(0, "instcd"));
  231. ds_send_fileinfo.setColumn(0,"reqdd", ds_target_defaultvalue.getColumn(0, "reqdd"));
  232. ds_send_fileinfo.setColumn(0,"reqflag", ds_target_defaultvalue.getColumn(0, "reqflag"));
  233. ds_send_fileinfo.setColumn(0,"reqno", ds_target_defaultvalue.getColumn(0, "reqno"));
  234. ds_send_fileinfo.setColumn(0,"reqseqno", ds_target_defaultvalue.getColumn(0, "reqseqno"));
  235. ds_send_fileinfo.setColumn(0,"reqpsnid", ds_target_defaultvalue.getColumn(0, "reqpsnid"));
  236. ds_send_fileinfo.setColumn(0,"reqdeptcd", ds_target_defaultvalue.getColumn(0, "reqdeptcd"));
  237. ds_send_fileinfo.setColumn(0,"fileseqno" , ds_target_defaultvalue.getColumn(0, "attfilepathnm"));
  238. group3.btn_search.click();
  239. }
  240. }
  241. /****************************************************************************************
  242. * Components : Form
  243. * Description : 화면 닫을때 이벤트
  244. ****************************************************************************************/
  245. function SMRSD00420_onclose(obj:Form, e:CloseEventInfo)
  246. {
  247. var dsUpdate = grdf_getGridUpdateData(group3.grd_fileinfo, "all");
  248. if (dsUpdate.rowcount > 0) {
  249. if (group3.btn_save.enable == true) {
  250. var save_val = sysf_messageBox("삭제 자료가 존재 합니다. ", "Q002");
  251. if (save_val == "6") {
  252. group3.btn_save.click();
  253. }
  254. }
  255. }
  256. }
  257. /****************************************************************************************
  258. * Components : Grid
  259. * Description : 첨부파일내역 선택
  260. ****************************************************************************************/
  261. function group3_grd_fileinfo_oncelldblclick(obj:Grid, e:GridClickEventInfo) {
  262. if(e.row < 0) return;
  263. var idx = e.row;
  264. var filepath = ds_main_fileinfo_fileinfolist.getColumn(idx, "filepath");
  265. var filenm = ds_main_fileinfo_fileinfolist.getColumn(idx, "filenm");
  266. var arrFilenm = filenm.split(".");
  267. // if(!utlf_isNull(objVFile)) {
  268. // ds_send_fileupcolumn_fileupload.clearData();
  269. // var nRow = ds_send_fileupcolumn_fileupload.addRow();
  270. // // 해당 파일을 데이터 셋에 저장한다.
  271. // lf_saveFile(objVFile, nRow);
  272. // }
  273. var fd = new FileDialog;
  274. var objVFile = fd.open("FileSave", FileDialog.SAVE, "%MYDOCUMENT%", filenm); // 단일 파일 선택
  275. if (objVFile != null)
  276. {
  277. ds_send_fileupcolumn_fileupload.clearData();
  278. var nRow = ds_send_fileupcolumn_fileupload.addRow();
  279. // 해당 파일을 데이터 셋에 저장한다.
  280. lf_saveFile(objVFile, nRow);
  281. dsf_createDsRow("ds_req", [{col:"filepath", val:filepath}]);
  282. sysf_setErrorMsg(false); //자바단에서 에러발생시 1.0은 오류리턴을 안해서...
  283. var oParam = {};
  284. oParam.id = "TRRSD00422";
  285. oParam.service = "reqapp.ReqMngt";
  286. oParam.method = "reqGetReqAttfileDownLoad";
  287. oParam.inds = "req=ds_req";
  288. oParam.outds = "ds_download=attachfile";
  289. oParam.async = false;
  290. oParam.callback = "cf_TRRSD00422";
  291. tranf_submit(oParam);
  292. sysf_setErrorMsg(true);
  293. if(arErrorCode.pop("TRRSD00422") > -1) {
  294. var temp = dsf_readFileFromDs(objVFile.fullpath, ds_download, 0, "filedata"); // 파일저장
  295. sleep(1000);
  296. if( !utlf_isNull(temp) )
  297. {
  298. var rtn = sysf_messageBox("파일을", "Q004");
  299. if( rtn == 6 )
  300. {
  301. // var text = new String(objVFile.fullpath);
  302. // var replaceText = text.replace(" ", "");
  303. // if( text.length != replaceText.length )
  304. // {
  305. // sysf_messageBox("공백이 포함된 [파일명/폴더]는 자동열기가 실행되지 않습니다.", "E999", "");
  306. // return;
  307. // }
  308. // else
  309. // {
  310. var objExtCommon = new ExtCommon();
  311. var rtn = objExtCommon.executeProcess(objVFile.fullpath,"","");
  312. //}
  313. }
  314. }
  315. }
  316. }
  317. group3.btn_search.click();
  318. }
  319. function lf_saveFile(objVFile, nRow)
  320. {
  321. // 그 파일의 데이터를 데이터셋의 특정 컬럼에 BLOB 형식으로 write 한다.
  322. var file = dsf_writeFileToDs(objVFile, ds_send_fileupcolumn_fileupload, nRow, "filedata");
  323. ds_send_fileupcolumn_fileupload.setColumn(nRow, "filenm", file.filename);
  324. ds_send_fileupcolumn_fileupload.setColumn(nRow, "filesize", file.filesize);
  325. ds_send_fileupcolumn_fileupload.setColumn(nRow, "filetype", file.filetype);
  326. ds_send_fileupcolumn_fileupload.setColumn(nRow, "fullpath", objVFile.fullpath);
  327. //ds_main_goodreq_goodreqlist.setColumn(0, "attfilenm", file.filename);
  328. if(!utlf_isNull(ds_send_fileupcolumn_fileupload.getColumn(0,"filenm")) ) {
  329. var qrycnt = utlf_transNullToEmpty(ds_main_fileinfo_fileinfolist.getColumn(ds_main_fileinfo_fileinfolist.rowposition, "qrycnt"));
  330. //qrycnt 가 빈값일 경우는 숫자로 변환해도 0이 아닌 값으로 변환되므로 조건문으로 처리한다.
  331. if ( utlf_isNull(qrycnt)) {
  332. qrycnt = 0;
  333. }
  334. cnt = parseInt(qrycnt)+1;
  335. ds_main_fileinfo_fileinfolist.setColumn( ds_main_fileinfo_fileinfolist.rowposition , "qrycnt", cnt);
  336. //group3.grd_fileinfo.addStatus(idx,"update");
  337. misfSave("TXRSD00422");
  338. }
  339. }
  340. function cf_TRRSD00422(sSvcId, nErrorCode, sErrorMsg) {
  341. arErrorCode.push(sSvcId, nErrorCode);
  342. }
  343. /****************************************************************************************
  344. * Components : Button
  345. * Description : 조회
  346. ****************************************************************************************/
  347. function group3_btn_search_onclick(obj:Button, e:ClickEventInfo) {
  348. misfMsterDetailRetrieve();
  349. if( !utlf_isNull(ds_main_fileinfo_fileinfolist.getColumnInfo("reqdeptnm")) ){
  350. ds_main_fileinfo_fileinfolist.updateColID("reqdeptnm", "deptnm");
  351. }else{
  352. ds_main_fileinfo_fileinfolist.addColumn("deptnm", "string");
  353. }
  354. if( !utlf_isNull(ds_main_fileinfo_fileinfolist.getColumnInfo("reqpsnnm")) ){
  355. ds_main_fileinfo_fileinfolist.updateColID("reqpsnnm", "emplnm");
  356. }else{
  357. ds_main_fileinfo_fileinfolist.addColumn("emplnm", "string");
  358. }
  359. if( !utlf_isNull(ds_main_fileinfo_fileinfolist.getColumnInfo("attfilenm")) ){
  360. ds_main_fileinfo_fileinfolist.updateColID("attfilenm", "filenm");
  361. }else{
  362. ds_main_fileinfo_fileinfolist.addColumn("filenm", "string");
  363. }
  364. var reqpsnid = ds_send_fileinfo.getColumn(0,"reqpsnid");
  365. if (ds_main_fileinfo_fileinfolist.rowcount > 0) {
  366. if (ds_main_fileinfo_fileinfolist.getColumn(0, "reqpsnid") == reqpsnid) {
  367. group3.btn_save.enable = true;
  368. group3.btn_delgrd.enable = true;
  369. }
  370. else {
  371. group3.btn_save.enable = false;
  372. group3.btn_delgrd.enable = false;
  373. }
  374. }
  375. else {
  376. group3.btn_save.enable = false;
  377. group3.btn_delgrd.enable = false;
  378. }
  379. }
  380. /****************************************************************************************
  381. * Components : Button
  382. * Description : 저장
  383. ****************************************************************************************/
  384. function group3_btn_save_onclick(obj:Button, e:ClickEventInfo) {
  385. //그리드 for 문 돌려서 삭제인 것만 찾아서 attfilenm 을 다 null로 바꾸어 주고 부모창에 넘기면 된다....
  386. /*
  387. for (var i=group3.grd_fileinfo.fixedRows ; i< group3.grd_fileinfo.rows ; i++) {
  388. if ( group3.grd_fileinfo.rowStatus(i) = 4) {
  389. model.setValue("/root/main/fileinfo/fileinfolist["+i+"]/attfilenm" , "");
  390. }
  391. }
  392. */
  393. misfSave("TXRSD00422");
  394. group3.btn_search.click();
  395. //부모창 즉 비품청구 등록 창에 첨부파일 항목을 지워주어야 한다.
  396. //attfilenm 을 빈값으로 만든 다음 넘겨야 한다.
  397. //즉 노드셋단에서 한번 조작을 가한후 해당 데이터를 부모창에 넘겨주어햐 한다.
  398. //misfPopUpListReturn(group3.grd_fileinfo);
  399. }
  400. /****************************************************************************************
  401. * Components : Button
  402. * Description : 행삭제
  403. ****************************************************************************************/
  404. function group3_btn_delgrd_onclick(obj:Button, e:ClickEventInfo) {
  405. misfGridIUD(group3.grd_fileinfo, "D");
  406. }
  407. /****************************************************************************************
  408. * Components : Button
  409. * Description : 확인
  410. ****************************************************************************************/
  411. function group1_btn_confirm_onclick(obj:Button, e:ClickEventInfo) {
  412. this.close();
  413. }
  414. /****************************************************************************************
  415. * Components : Button
  416. * Description : 닫기
  417. ****************************************************************************************/
  418. function group1_btn_cancel_onclick(obj:Button, e:ClickEventInfo) {
  419. this.close();
  420. }
  421. ]]></Script>
  422. </Form>
  423. </FDL>