promiseDocList.jsp 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  1. <%--
  2. - Author(s) : 최훈석
  3. - Date : 2022.11.08
  4. - Description: 서약서
  5. --%>
  6. <%@ page contentType="text/html; charset=utf-8" %>
  7. <%@ page import="com.udapsoft.waf.system.HandlerStorage" %>
  8. <%@ page import="com.udapsoft.waf.common.ui.*" %>
  9. <%@ page import="com.udapsoft.waf.common.ui.InitCombo" %>
  10. <%@ page import="kr.co.hsnc.common.util.*"%>
  11. <%@ page import="kr.co.hsnc.common.sql.*" %>
  12. <%@ page import="kr.co.udapsoft.common.code.CommCodeManager" %>
  13. <%-- <%@ include file="/jsp/work/taglib.jsp" %>
  14. <jsp:useBean id="ctx" class="com.udapsoft.waf.system.context.SessionContext" scope="session" /> --%>
  15. <%
  16. //CommCodeManager commCodeManager = new CommCodeManager();
  17. RowSet proGbRow = CommCodeManager.getCodeRowsetStatic("PROMISE_DOC_TYPE");
  18. InitCombo initCombo2 = new InitCombo();
  19. initCombo2.makeComboData(CommCodeManager.getCodeRowsetStatic("PROMISE_DOC_TYPE", "CHG_CODE01", "Y"), "DETAILNM", "DETAILCD");
  20. /* initCombo.makeComboData(commCodeManager.getCodeRowSet("STAMP_DUTY_ISSUE_GB"), "NAME", "CODE"); */
  21. String PROMISE_DOC_CD = initCombo2.getCode();
  22. String PROMISE_DOC_NM = initCombo2.getCodeName();
  23. %>
  24. <SCRIPT language="JavaScript">
  25. /*예약함수*/
  26. var sheet3;
  27. var sheet3Row;
  28. var sheet3PageNo = 1;
  29. var pageLastRowIndex = 1;
  30. var validationResult = false;
  31. var filterShow = false;
  32. /* function _onReady(){
  33. } */
  34. /**
  35. * IBSheet object initialize
  36. */
  37. function gridInit3(sheetName){
  38. var init_sheet = {};
  39. init_sheet.Cfg = {SearchMode:2, Page:10};
  40. init_sheet.Cols = [
  41. {Header:'Del', Type:"DelCheck", SaveName:"DEL_CHECK", Width:30, Align:"Center"},
  42. {Header:'Status', Type:"Status", SaveName:"STATUS", Width:0, Align:"Center", Hidden:"true"},
  43. {Header:'서약서ID', Type:"Text", SaveName:"PROMISE_DOC_ID", Width:0, Align:"Center", Hidden:"true"},
  44. {Header:'서약서종류', Type:"Combo", SaveName:"PROMISE_DOC_TYPE_GB", Width:80, Align:"Center", ComboText:"<%=PROMISE_DOC_NM%>", ComboCode:"<%=PROMISE_DOC_CD%>"},
  45. {Header:'비고', Type:"Text", SaveName:"REMARK", Width:150, Align:"Left", EditLen:"500"},
  46. {Header:'☞사본', Type:"Text", SaveName:"FILE_YN", Width:30, Align:"center", Edit:"false", Cursor:'pointer'},
  47. {Header:'FILE_ID', Type:"Text", SaveName:"FILE_ID", Width:0, Align:"center", Hidden:"true"},
  48. ];
  49. init_sheet.HeaderMode = {Sort:1};
  50. IBS_InitSheet(sheetName, init_sheet);
  51. sheetName.SetDataAutoTrim(0);
  52. sheetName.SetImageList(1,"/img/buyer/button/bt_change.gif");
  53. if(jQuery("#STATUS_CD").val() == '50'){
  54. sheet3.SetEditable(0);
  55. }
  56. //sheetName.SetActionMenu("ExcelDown");
  57. setGridSize3();
  58. }
  59. function doSearchPromise() {
  60. jQuery("#fevent").val("FORM_PROMISE_SELECT");
  61. var url = Modular.model.PageContext.CONTEXT_ROOT + "/cont/purchase/PromiseList_sheet.screen";
  62. Modular.view.IBSheet7.doSearch(sheet3, url, jQuery("#form1"), 30, "");
  63. }
  64. function doSavePromise() {
  65. jQuery("#fevent").val("SAVE_PROMISE_LIST");
  66. var url = Modular.model.PageContext.CONTEXT_ROOT + "/cont/purchase/PromiseList_sheet.screen";
  67. Modular.view.IBSheet7.doSave(sheet3, url, jQuery("#form1"), false);
  68. }
  69. /**
  70. * IBSheet Event: Search End(IBSheet 데이터 조회 CallBack)
  71. */
  72. function sheet3_OnSearchEnd(code, message) {
  73. var info = {Type: "Image"};
  74. if(code == 0) {
  75. setGridSize3();
  76. sheet3.SetColFontColor("FILE_YN", "#0000ff");
  77. for(i=1; i <= sheet3.RowCount(); i++){
  78. if(sheet3.GetCellValue(i, "FILE_ID")!=""){
  79. sheet3.InitCellProperty(i, "FILE_YN", info);
  80. }
  81. }
  82. } else {
  83. //조회 에러 수행
  84. alert(message);
  85. }
  86. }
  87. function sheet3_OnSaveEnd(code, msg) {
  88. if(code >= 0) {
  89. if(jQuery("#save_gb").val() != 'Y'){
  90. alert("서약서가 정상적으로 처리 되었습니다.");
  91. }
  92. } else {
  93. //alert(msg);
  94. alert("서약서 등록에 실패 하였습니다.");
  95. }
  96. doSearchPromise();
  97. }
  98. /**
  99. * IBSheet Event Change
  100. */
  101. function sheet3_OnChange(Row, Col, Value, OldValue, RaiseFlag) {
  102. if (sheet3.ColSaveName(Col) == "REMARK") {
  103. if(stringByteSize4UTF(sheet3.GetCellValue(Row, "REMARK")) > 500){
  104. alert("비고는 500자까지 입력하실 수 있습니다.");
  105. sheet3.SetCellValue(Row, "REMARK", "");
  106. return;
  107. }
  108. }
  109. }
  110. /*
  111. IBSheet Event : Mouse Right Menu
  112. */
  113. function sheet3_OnSelectMenu(Text, Code) {
  114. // text 또는 code값으로 Action수행
  115. switch(Text) {
  116. case "ExcelDown":
  117. jQuery("#btnExcel").click();
  118. break;
  119. }
  120. }
  121. function sheet3_OnDblClick(Row, Col, Value, CellX, CellY, CellW, CellH) {
  122. if(Row == 0)return;
  123. if (sheet3.ColSaveName(Col) == "FILE_YN") {
  124. if(sheet3.GetCellValue(Row, "PROMISE_DOC_ID")=='' || sheet3.GetCellValue(Row, "STATUS")=="I" || sheet3.GetCellValue(Row, "STATUS")=="U"){
  125. alert("입력한 내용을 저장을 한 후 파일을 첨부할 수 있습니다.");
  126. }
  127. else{
  128. var PROMISE_DOC_ID = sheet3.GetCellValue(Row, "PROMISE_DOC_ID")
  129. var modify = 'Y';
  130. if(jQuery("#STATUS_CD").val() =='50' || jQuery("#p_promise_gb").val() == '00'){
  131. modify ='N'
  132. }
  133. viewFileListNew2('PUR_PROMISE_DOC', PROMISE_DOC_ID, "", modify, "cont/purchase/promise/"+PROMISE_DOC_ID, "", "", "", "N");
  134. }
  135. }
  136. }
  137. function viewFileListNew2(fileGB, id, obj, isModify, isDrectory, iframeID, user_filename, file_size, multi_yn) {
  138. var win_id = "_promiseFileList";
  139. var link = "/common/file/FileListNew.screen";
  140. link += "?pop_win_id="+win_id;
  141. link += "&file_gb=" + fileGB;
  142. link += "&id=" + id;
  143. if( obj.id != null )
  144. link += "&obj_id=" + obj.id;
  145. if( iframeID != null )
  146. link += "&iframeID=" + iframeID;
  147. if( isModify != null )
  148. link += "&is_modify=" + isModify;
  149. if( isDrectory != null )
  150. link += "&sys_gb=" + isDrectory;
  151. if( file_size != null )
  152. link += "&file_size=" + file_size;
  153. if( multi_yn != null )
  154. link += "&multi_yn=" + multi_yn;
  155. if( user_filename != null )
  156. link += "&user_filename=" + encodeURIComponent(user_filename);
  157. fLayerPop(win_id, link, 750,430, '', '', 'NO', '200');
  158. }
  159. function fLayerPopClose(layerID){
  160. var oNode = document.getElementById(layerID);
  161. if(oNode != null)
  162. {
  163. $('#'+layerID+ '_divcontent').empty();
  164. $('#'+layerID).bPopup().close();
  165. document.body.removeChild(oNode);
  166. }
  167. if(layerID == "_promiseFileList"){
  168. doSearchPromise();
  169. }
  170. }
  171. function promiseRowCheck() {
  172. for(i=1; i <= sheet3.RowCount(); i++){
  173. if(sheet3.GetCellValue(i, "STATUS")!="R"){
  174. alert("서약서중 저장되지 않은 행이 존재합니다.");
  175. return false;
  176. }
  177. }
  178. return true;
  179. }
  180. function promise_gb_chg() {
  181. if(jQuery("#p_promise_gb").val()=="00"||jQuery("#p_promise_gb").val()==""){
  182. jQuery("#btnPromiseAdd").hide();
  183. }else{
  184. jQuery("#btnPromiseAdd").show();
  185. }
  186. }
  187. /* function stampDesc()
  188. {
  189. var win_id = "_stampPopup";
  190. var link = "/cont/purchase/stampDescPopup.screen";
  191. link += "?pop_win_id="+win_id;
  192. fLayerPop(win_id, link, 400,210, '', '', 'NO');
  193. } */
  194. function downPromiseFile(){
  195. var url="/common/file/FileDownloadServlet?mode=fpDown";
  196. url += "&mode=fpDown";
  197. url += "&filePath=/promiseDoc";
  198. url += "&fileName=" + encodeURI("서약서 양식.zip");
  199. url += "&fileRealName=promise_doc.zip";
  200. document.getElementById("fileDown").src=url;
  201. }
  202. /**
  203. * IBSheet size setting
  204. */
  205. function setGridSize3() {sheet3.FitColWidth();}
  206. document.body.onresize = addEvent( document.body.onresize, "setGridSize3()");
  207. </SCRIPT>
  208. <div class="application-info magT10">
  209. <div class="application-sub-title">
  210. <span class="title">서약서</span><font color="red"></font> <a href="javascript:downPromiseFile()"><IMG src='/img/buyer/button/bt_change.gif' align="absmiddle"></a>
  211. </div>
  212. </div>
  213. <!-- 검색조건 시작 -->
  214. <table id="search-table" class="search-form-table">
  215. <tr height="25">
  216. <td>서약서 구분:&nbsp;&nbsp;<%= HTMLMaker.getSelectTag(proGbRow, "CODE", "NAME", "p_promise_gb", "style='width:200px;' onChange='promise_gb_chg();'", "", ContInfo.get("STAMP_DUTY_GB")) %></td>
  217. <td class="button" align="right" style="text-align: center;width: 95px">
  218. <span class="btnSearch center" id="btnPromiseAdd" style="display: none;"><a href="javascript:void(0);">추가</a></span>
  219. <%-- <%if(isViewWrite != "W"){ %> --%>
  220. <span class="btnSearch center" id="btnSavePromise" ><a href="javascript:void(0);">저장</a></span>
  221. <%-- <%} %> --%>
  222. </td>
  223. </tr>
  224. </table>
  225. <div id="sheet3_div" style="padding-top:5px; height: 157px; min-height: 157px; overflow: auto;">
  226. <!-- <div id="sheet3_div" style="padding-top:5px; height: auto; min-height: 100px; overflow: auto;"> -->
  227. <script>createIBSheet('sheet3','100%', '157px');</script>
  228. </div>
  229. <iframe id="fileDown" name="fileDown" style="display:none"></iframe>