TBECheckDetail.jsp 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376
  1. <%--
  2. - Author(s) : Hyung min Son
  3. - Date : 2014.07.22
  4. - Description: 구매_업체별기술문서
  5. --%>
  6. <%@ page contentType="text/html; charset=utf-8" %>
  7. <%@ page import="java.text.SimpleDateFormat" %>
  8. <%@ page import="java.util.Date" %>
  9. <%@ page import="com.udapsoft.waf.system.HandlerStorage" %>
  10. <%@ page import="com.udapsoft.waf.common.ui.*" %>
  11. <%@ page import="kr.co.udapsoft.common.code.*" %>
  12. <%@ page import="kr.co.hsnc.common.util.*"%>
  13. <%@ page import="kr.co.hsnc.common.sql.*" %>
  14. <%@ page import="com.udapsoft.waf.common.util.Formatter2"%>
  15. <%@ page import="com.udapsoft.waf.common.util.StringUtils"%>
  16. <%@ include file="/jsp/work/taglib.jsp" %>
  17. <jsp:useBean id="ctx" class="com.udapsoft.waf.system.context.SessionContext" scope="session" />
  18. <%
  19. ctx.init(request, response);
  20. HandlerStorage storage = ctx.getHandlerStorage();
  21. ValueObject params = storage.getParams();
  22. ValueObject user = storage.getUser();
  23. ValueObject Order = storage.getValueObject("Order");
  24. RowSet Tbe_info = storage.getRowSet("TBE_INFO");
  25. %>
  26. <SCRIPT language="JavaScript">
  27. document.body.onresize = addEvent( document.body.onresize, "autoResize()");
  28. /*예약함수*/
  29. var sheet1 = new ibsheetObject();
  30. var sheet1Row;
  31. var sheet1PageNo = 1;
  32. var pageLastRowIndex = 1;
  33. var validationResult = false;
  34. var filterShow = false;
  35. function _onReady(){
  36. gridInit(sheet1);
  37. $("#btn_back").click(function() {
  38. $("#fevent").val("FORM_SELECT");
  39. $("#form1").attr("action", "/bid/purchase/TBECheck.screen");
  40. $("#form1").attr("target", "_self");
  41. $("#form1").attr("method", "post");
  42. $("#form1").submit();
  43. });
  44. $("#btn_save").click(function() {//저장
  45. if(file_ck()){
  46. alert("문서를 선택해 주세요.");
  47. return;
  48. }
  49. if (confirm("저장 하시겠습니까?")){
  50. $("#fevent").val("SAVE");
  51. var url = Modular.model.PageContext.CONTEXT_ROOT + "/bid/purchase/TBECheckDetail_sheet.screen";
  52. Modular.view.IBSheet7.doSave(sheet1, url, jQuery("#form1"), 30, "");
  53. }
  54. });
  55. $("#btn_review").click(function() {//검토완료
  56. if(file_ck()){
  57. alert("문서를 선택해 주세요.");
  58. return;
  59. }
  60. if (confirm("검토완료 처리 하시겠습니까?")){
  61. sheet_status_update("10");
  62. $("#fevent").val("REVIEW");
  63. var url = Modular.model.PageContext.CONTEXT_ROOT + "/bid/purchase/TBECheckDetail_sheet.screen";
  64. Modular.view.IBSheet7.doSave(sheet1, url, jQuery("#form1"), 30, "");
  65. }
  66. });
  67. $("#btn_recall").click(function() {//재요청
  68. if(file_ck()){
  69. alert("문서를 선택해 주세요.");
  70. return;
  71. }
  72. if (confirm("재요청 처리 하시겠습니까?")){
  73. $("#TBE_STATUS_CD").val("02");
  74. $("#EDIT").val("N");
  75. sheet_status_update("02");
  76. $("#fevent").val("RECALL");
  77. var url = Modular.model.PageContext.CONTEXT_ROOT + "/bid/purchase/TBECheckDetail_sheet.screen";
  78. Modular.view.IBSheet7.doSave(sheet1, url, jQuery("#form1"), 30, "");
  79. }
  80. });
  81. if( '<%=user.get("ACCT_ID")%>' != '<%=Order.get("EVAL_EMPID")%>'){
  82. $("#btn_review").hide();
  83. $("#btn_recall").hide();
  84. $("#btn_save").hide();
  85. }
  86. doSearchSheet();
  87. }
  88. /**
  89. * IBSheet object initialize
  90. */
  91. function gridInit(sheetName){
  92. var init_sheet = {};
  93. init_sheet.Cfg = {SearchMode:2, Page:30};
  94. init_sheet.Cols = [
  95. {Header:'요청차수', Type:"Int", SaveName:"REQ_DEG", Width:40, Align:"Center", Edit:false, ColMerge:true},
  96. {Header:'선택', Type:"CheckBox", SaveName:"CHECK", Width:30, Align:"Center", ColMerge:false},
  97. {Header:'Status', Type:"Status", SaveName:"STATUS", Width:0, Align:"Center", Hidden:"True", ColMerge:false},
  98. {Header:'No.', Type:"Seq", SaveName:"NO", Width:0, Align:"Center", Hidden:"True", ColMerge:false},
  99. {Header:'문서명', Type:"Text", SaveName:"DOC_NM", Width:200, Align:"Left", Edit:false, ColMerge:false},
  100. {Header:'파일명', Type:"Text", SaveName:"FILE_NAME", Width:200, Align:"Left", Edit:false, Cursor:"pointer", ColMerge:false},
  101. {Header:'상태', Type:"Text", SaveName:"STATUS_NM", Width:60, Align:"Center", Edit:false, ColMerge:false},
  102. {Header:'문서요청일', Type:"Text", SaveName:"REG_DT", Width:80, Align:"Center", Edit:false, ColMerge:false},
  103. {Header:'문서제출일', Type:"Text", SaveName:"DOC_DT", Width:80, Align:"Center", Edit:false, ColMerge:false},
  104. {Header:'비고', Type:"Text", SaveName:"NOTI", Width:100, Align:"Left", ColMerge:true},
  105. {Header:'STATUS_CD', Type:"Text", SaveName:"STATUS_CD", Width:0, Align:"Center", Hidden:"True", ColMerge:false},
  106. {Header:'EVAL_FILE_GB', Type:"Text", SaveName:"EVAL_FILE_GB", Width:0, Align:"Center", Hidden:"True", ColMerge:false},
  107. {Header:'EVAL_FILE_ID', Type:"Text", SaveName:"EVAL_FILE_ID", Width:0, Align:"Center", Hidden:"True", ColMerge:false},
  108. {Header:'FILE_PATH', Type:"Text", SaveName:"FILE_PATH", Width:0, Align:"Center", Hidden:"True", ColMerge:false},
  109. {Header:'REAL_FILE_NAME', Type:"Text", SaveName:"REAL_FILE_NAME", Width:0, Align:"Center", Hidden:"True", ColMerge:false},
  110. {Header:'FILE_ID', Type:"Text", SaveName:"FILE_ID", Width:0, Align:"Center", Hidden:"True", ColMerge:false},
  111. {Header:'TBE_STATUS_CD', Type:"Text", SaveName:"TBE_STATUS_CD", Width:0, Align:"Center", Hidden:"True", ColMerge:false}
  112. ];
  113. init_sheet.HeaderMode = {Sort:0};
  114. IBS_InitSheet(sheetName, init_sheet);
  115. sheetName.SetDataAutoTrim(0);
  116. sheetName.SetMergeSheet(msBaseColumnMerge);
  117. //sheetName.SizeMode(0);
  118. setGridSize();
  119. }
  120. /*
  121. 체크된 문서가 있는지 확인.
  122. */
  123. function file_ck(){
  124. var rowcnt = sheet1.RowCount();
  125. if(rowcnt> 0){
  126. for(var r=1; r < rowcnt+1; r++)
  127. {
  128. if(sheet1.GetCellValue(r,"CHECK") == "1"){
  129. return false;
  130. }
  131. }
  132. }
  133. return true;
  134. }
  135. function doSearchSheet(){
  136. $("#fevent").val("GET_FILE_LIST");
  137. var url = Modular.model.PageContext.CONTEXT_ROOT + "/bid/purchase/TBECheckDetail_sheet.screen";
  138. Modular.view.IBSheet7.doSearch(sheet1, url, jQuery("#form1"), 30, "");
  139. }
  140. /**
  141. * IBSheet Event: Search End(IBSheet 데이터 조회 CallBack)
  142. */
  143. function sheet1_OnSearchEnd(code, message) {
  144. if(code == 0) {
  145. sheet1.SetRowMerge(2, true);
  146. setGridSize();
  147. var rowcnt = sheet1.RowCount();
  148. var filedeg = Number(sheet1.GetCellValue(1,"REQ_DEG"));
  149. if(rowcnt> 0){
  150. for(var r=1; r < rowcnt+1; r++)
  151. {
  152. sheet1.SetCellFontColor(r,"FILE_NAME", "#0000ff");
  153. if(filedeg > Number(sheet1.GetCellValue(r,"REQ_DEG"))){
  154. sheet1.SetRowEditable(r,false);
  155. }
  156. if(sheet1.GetCellValue(r,"STATUS_CD")== "10" ||sheet1.GetCellValue(r,"STATUS_CD")== "02"){//검토완료 & 재요청 일경우 체크 불가능
  157. //sheet1.SetRowEditable(r,false); 2015.3.5 완료된 문서 재검토 요청 가능.
  158. }
  159. if(sheet1.GetCellValue(r,"TBE_STATUS_CD")== "10" ){//검토완료 & 재요청 일경우 체크 불가능
  160. $("#btn_save").hide();
  161. $("#btn_review").hide();
  162. //$("#btn_recall").hide(); 2015.3.5 TBE완료전 완료된 문서재검토 요청 가능
  163. }
  164. //TBE완료되지 않은상태에서 완료문서 재요청 가능.
  165. if ('<%=Order.get("UPPER_STATUS_CD")%>' == "10"){
  166. $("#btn_recall").hide(); //2015.3.5 TBE완료전 완료된 문서재검토 요청 가능
  167. }
  168. }
  169. }
  170. //sheet1.SetDataRowMerge(true);
  171. } else {
  172. //조회 에러 수행
  173. alert(message);
  174. }
  175. }
  176. function sheet_status_update(status_cd){
  177. var rowcnt = sheet1.RowCount();
  178. if(rowcnt> 0){
  179. for(var r=1; r < rowcnt+1; r++)
  180. {
  181. if(sheet1.GetCellValue(r,"CHECK") == 1){
  182. sheet1.SetCellValue(r,"STATUS_CD",status_cd);
  183. }
  184. }
  185. }
  186. }
  187. //첨부파일
  188. function doAttachFile(obj,No) {
  189. if(obj==''){
  190. alert("After you have saved, you can attach a file.");
  191. }
  192. else if(obj != ''){
  193. if(No == 1){
  194. viewFileListNew('<%=Order.get("DOC_ETC_IN")%>', obj.value, document.form1.p_AttachFile1, "N", "BD-001");
  195. }else if(No == 2){
  196. viewFileListNew('<%=Order.get("DOC_ETC_OUT")%>', obj.value, document.form1.p_AttachFile2, "N", "BD-001");
  197. }
  198. }
  199. }
  200. function sheet1_OnSaveEnd(code, msg)
  201. {
  202. var event = $("#fevent").val();
  203. if(code>= "0"){
  204. if(event == "SAVE"){
  205. alert("저장되었습니다.");
  206. doSearchSheet();
  207. }else if(event == "REVIEW"){
  208. alert("검토완료 되었습니다.");
  209. doSearchSheet();
  210. }else if(event == "RECALL"){
  211. alert("재요청 되었습니다.");
  212. doSearchSheet();
  213. }
  214. }else{
  215. alert("에러가 발생하였습니다.\n"+msg);
  216. }
  217. }
  218. /**
  219. * IBSheet Event: DBLCLICK
  220. */
  221. function sheet1_OnDblClick(Row, Col, Value, CellX, CellY, CellW, CellH) {
  222. if(Row == 0)return;
  223. if(Col == 5)
  224. fileDown(sheet1.GetCellValue(Row,"FILE_ID"));
  225. }
  226. /**
  227. * 첨부파일 예약 함수
  228. */
  229. function fileDown(file_id){
  230. var url="/common/file/FileDownloadServlet";
  231. url += "?file_id=" + file_id;
  232. window.open(url, "_fileDown", "toolbar=no, width=400, height=100, top=500, left=400, toolbar=no,directories=no,status=no,scrollbars=yes,resize=no,menubar=no,target=new")
  233. }
  234. /**
  235. * IBSheet size setting
  236. */
  237. function setGridSize() {
  238. sheet1.FitColWidth();
  239. }
  240. function sheet1_OnSmartResize(Width, Height) {
  241. sheet1.FitColWidth();
  242. autoResize();
  243. }
  244. function autoResize(){
  245. var t1_height = document.getElementById("form-table").scrollHeight + document.getElementById("title").scrollHeight + 24;
  246. var iframeHeight= document.body.scrollHeight - t1_height;
  247. var iframeWidth= document.body.scrollWidth;
  248. sheet1.SetSheetHeight(iframeHeight);
  249. }
  250. </SCRIPT>
  251. <modular:search id="form1">
  252. <modular:key id="fevent" />
  253. </modular:search>
  254. <form id="form1" name="form1" method="post" modular:type="search">
  255. <!-- List Search -->
  256. <INPUT type="hidden" name="P_BID_MASTER_NM" id="P_BID_MASTER_NM" value="<%= params.get("P_BID_MASTER_NM") %>">
  257. <INPUT type="hidden" name="p_demanded_status" id="p_demanded_status" value="<%= params.get("p_demanded_status") %>">
  258. <INPUT type="hidden" name="p_dept_nm" id="p_dept_nm" value="<%= params.get("p_dept_nm") %>">
  259. <INPUT type="hidden" name="p_dept_cd" id="p_dept_cd" value="<%= params.get("p_dept_cd") %>">
  260. <INPUT type="hidden" name="p_list" id="p_list" value="<%= params.get("p_list") %>">
  261. <!-- List Search -->
  262. <INPUT type='hidden' name="fevent" id="fevent" value="">
  263. <INPUT type='hidden' name="VENDOR_CD" value="<%=Order.get("VENDOR_CD")%>">
  264. <INPUT type='hidden' name="BID_NO" value="<%=Order.get("BID_NO")%>">
  265. <INPUT type='hidden' name="BID_DEG" value="<%=Order.get("BID_DEG")%>">
  266. <INPUT type='hidden' name="TBE_STATUS_CD" value="<%=Order.get("TBE_STATUS_CD")%>">
  267. <INPUT type='hidden' name="EDIT" value="">
  268. <table width="100%" id="title">
  269. <colgroup>
  270. <col width="*" />
  271. <col width="250" />
  272. </colgroup>
  273. <tr>
  274. <th>
  275. <div align="left" id="title">
  276. <ul><li>구매_업체별기술문서<font style="font-size:11px">(<%=Order.get("TBE_STATUS_NM")%>)</font></li></ul>
  277. </div>
  278. </th>
  279. <td align="right">
  280. <span class="btnSearch center" id="btn_back"><a href="javascript:void(0);">이전</a></span>
  281. </td>
  282. </tr>
  283. </table>
  284. <div class="application-info">
  285. <div class="application-sub-title">
  286. <span class="title">업체정보</span>
  287. </div>
  288. </div>
  289. <TABLE class="form-table">
  290. <colgroup>
  291. <col width="150"/>
  292. <col width="21%">
  293. <col width="150"/>
  294. <col width="20%">
  295. <col width="160"/>
  296. <col/>
  297. </colgroup>
  298. <TR height="25">
  299. <TH>사업자번호</TH>
  300. <TD>
  301. <%=StringUtils.getBizNo(Order.get("CORP_REG_NO"))%>
  302. </TD>
  303. <TH>업체명</TH>
  304. <TD colspan="3">
  305. <%=Order.get("CORP_KOR")%>
  306. </TD>
  307. </TR>
  308. <TR height="25">
  309. <TH>작성자</TH>
  310. <TD>
  311. <%=Order.get("REG_NM")%>
  312. </TD>
  313. <TH>연락처</TH>
  314. <TD>
  315. <%=Order.get("REG_TEL")%>
  316. </TD>
  317. <TH>이메일</TH>
  318. <TD>
  319. <%=Order.get("REG_EMAIL")%>
  320. </TD>
  321. </TR>
  322. </table>
  323. <table width="100%" style="padding-top:5px;">
  324. <colgroup>
  325. <col width="*" />
  326. </colgroup>
  327. <tr>
  328. <td align="right">
  329. <span class="btnSearch center" id="btn_save"><a href="javascript:void(0);">저장</a></span>
  330. <span class="btnSearch center" id="btn_review"><a href="javascript:void(0);">검토완료</a></span>
  331. <span class="btnSearch center" id="btn_recall"><a href="javascript:void(0);">재요청</a></span>
  332. </td>
  333. </tr>
  334. </table>
  335. <div id="sheet1_div" style="padding-top:5px;height: auto; min-height: 200px; overflow: auto;">
  336. <script>createIBSheet('sheet1','100%', '450px');</script>
  337. </div>
  338. </form>