QuotPlan.jsp 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488
  1. <%--
  2. - Author(s) : Hoonseok choi
  3. - Date : 2023.02.08
  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="kr.co.hsnc.common.config.WAFConfig"%>
  10. <%@ page import="com.udapsoft.waf.system.HandlerStorage" %>
  11. <%@ page import="com.udapsoft.waf.common.ui.*" %>
  12. <%@ page import="kr.co.udapsoft.common.code.*" %>
  13. <%@ page import="kr.co.hsnc.common.util.*"%>
  14. <%@ page import="kr.co.hsnc.common.sql.*" %>
  15. <%@ page import="com.udapsoft.waf.common.util.Formatter2"%>
  16. <%@ page import="com.udapsoft.waf.common.util.StringUtils"%>
  17. <%@ page import="kr.co.udapsoft.common.util.Crosscert"%>
  18. <%@ include file="/jsp/work/taglib.jsp" %>
  19. <jsp:useBean id="ctx" class="com.udapsoft.waf.system.context.SessionContext" scope="session" />
  20. <%
  21. ctx.init(request, response);
  22. HandlerStorage storage = ctx.getHandlerStorage();
  23. ValueObject params = storage.getParams();
  24. ValueObject user = storage.getUser();
  25. ValueObject Order = storage.getValueObject("Order");
  26. ValueObject fileout = storage.getValueObject("DOC_ETC_OUT");
  27. ValueObject attid = storage.getValueObject("ATT_ID");
  28. String today = DateUtil.formatDateTime(DateUtil.getToday(), "yyyyMMdd", "yyyyMMdd");
  29. SimpleDateFormat sd = new SimpleDateFormat("yyyyMMdd");
  30. SimpleDateFormat sd2 = new SimpleDateFormat("yyyyMMddHHmm");
  31. String nowTime = sd.format(new Date());
  32. String to_yyyy = Order.get("QUOT_BID_TO_DT").substring(0, 4);
  33. String to_MM = Order.get("QUOT_BID_TO_DT").substring(5, 7);
  34. String to_dd = Order.get("QUOT_BID_TO_DT").substring(8, 10);
  35. String to_hh = Order.get("QUOT_BID_TO_DT").substring(11, 13);
  36. String to_mi = Order.get("QUOT_BID_TO_DT").substring(14, 16);
  37. String nowTime_yyyy = nowTime.substring(0, 4);
  38. String nowTime_MM = nowTime.substring(4, 6);
  39. String nowTime_dd = nowTime.substring(6, 8);
  40. SimpleDateFormat SeverTime = new SimpleDateFormat("yyyy-MM-dd");
  41. String str = SeverTime.format(new Date());
  42. to_MM = (Integer.valueOf(to_MM)-1)+""; // 전자조달과 동일하게
  43. nowTime_MM = (Integer.valueOf(nowTime_MM)-1)+"";
  44. %>
  45. <SCRIPT language="JavaScript">
  46. /*예약함수*/
  47. var must_msg = "(은)는 필수 입력 항목입니다.";
  48. function _onReady(){
  49. //견적마감 이후 버튼 숨김..
  50. if("<%=Order.get("STATUS_CD")%>" == "10"){
  51. $("#btn_Save").hide();
  52. $("#btn_finish").hide();
  53. }else if("<%=Order.get("BID_STATUS_CD")%>" == "10"){
  54. $("#btn_Save").hide();
  55. }
  56. /**
  57. * Application Initialize
  58. */
  59. $("#btn_list").click(function() {
  60. jQuery("#fevent").val("");
  61. jQuery("#form1").attr("action", "/portal/quot/QuotPlanList.screen");
  62. jQuery("#form1").attr("target", "_self");
  63. jQuery("#form1").attr("method", "post");
  64. jQuery("#form1").submit();
  65. });
  66. $("#btn_Save").click(function() {
  67. if(confirm("저장하시겠습니까?")){
  68. if(save_must_ck()){
  69. jQuery("#fevent").val("UPDATE_QUOT_DETAIL");
  70. jQuery("#ESTI_TOT_AMT").val($("#ESTI_TOT_AMT").val().replace(/,/gi,""));
  71. jQuery("#BID_STATUS_CD").val("01");
  72. var f = document.form1;
  73. submitXmlRequest("/portal/quot/QuotPlan_form.screen", "UPDATE_QUOT_DETAIL", f);
  74. }
  75. }
  76. });
  77. $("#btn_finish").click(function() {
  78. if(confirm("견적 제출하시겠습니까?")){
  79. if(save_must_ck()){
  80. jQuery("#fevent").val("FINISH_QUOT_DETAIL");
  81. jQuery("#ESTI_TOT_AMT").val($("#ESTI_TOT_AMT").val().replace(/,/gi,""));
  82. jQuery("#BID_STATUS_CD").val("10");
  83. var f = document.form1;
  84. submitXmlRequest("/portal/quot/QuotPlan_form.screen", "FINISH_QUOT_DETAIL", f);
  85. }
  86. }
  87. });
  88. $("#SITE_ATTEND_YN").val("<%=Order.get("SITE_ATTEND_YN")%>");
  89. $("#SITE_ATTEND_YN").change(function() {
  90. if($("#SITE_ATTEND_YN").val() == "N"){
  91. $("#SITE_ATTEND_TABLE").show();//불참 사유 숨김.
  92. $("#SITE_ATTEND_DIV").show();//불참 사유 숨김.
  93. }else{
  94. $("#SITE_ATTEND_TABLE").hide();//불참 사유 숨김.
  95. $("#SITE_ATTEND_DIV").hide();//불참 사유 숨김.
  96. }
  97. });
  98. $("#SITE_ATTEND_YN").change();
  99. }
  100. function save_must_ck(){
  101. if($("#SITE_ATTEND_YN").val() == ""){
  102. alert("견적설명회 참석의사를 선택하세요");
  103. $("#SITE_ATTEND_YN").focus();
  104. return;
  105. }else if($("#SITE_ATTEND_YN").val() == "Y"){
  106. msg = "견적설명회에 참석하시겠습니까?";
  107. if(must_ck_val("ESTI_TOT_AMT","견적금액"))return false;
  108. }else if($("#SITE_ATTEND_YN").val() == "N"){
  109. msg = "견적설명회에 불참하시겠습니까?";
  110. if($("#SITE_ATTEND_REASON").val().length == 0){
  111. alert("견적설명회 불참사유는 필수입니다.");
  112. $("#SITE_ATTEND_REASON").focus();
  113. return;
  114. }
  115. }
  116. return true;
  117. }
  118. // value 값 체크
  119. function must_ck_val(obj,desc){
  120. if($("#"+obj).val().length == 0){
  121. if(desc.length> 0){
  122. alert(desc+must_msg);
  123. }else{
  124. alert($("#"+obj).attr("desc")+must_msg);
  125. }
  126. $("#"+obj).focus();
  127. return true;
  128. }
  129. return false;
  130. }
  131. //첨부파일
  132. function doAttachFile(obj,No) {
  133. var file_div = "quot/outside/"+"<%=Order.get("QUOT_BID_NO")%>"+"/";
  134. var file_div2 = "quot/outside/"+"<%=Order.get("QUOT_BID_NO")%>"+"/"+"<%=Order.get("VENDOR_CD")%>"+"/";
  135. var upLoadFlg = "Y";
  136. if(<%=Order.get("STATUS_CD")%> == "10"){
  137. upLoadFlg = "N";
  138. }
  139. if(obj != ''){
  140. if(No == 1){
  141. var fileName = "견적자료";
  142. viewFileListNew("QUOT_FILE_OUT_"+obj.value, obj.value, document.form1.p_AttachFile, "N", file_div, null, null, null, null, "N", fileName);
  143. }else if(No == 2){
  144. var fileName = "첨부자료";
  145. viewFileListNew("QUOT_SUPP_"+"<%=Order.get("VENDOR_CD")%>"+obj.value, obj.value, document.form1.p_AttachFile2, upLoadFlg, file_div2, null, null, null, null, "N", fileName);
  146. }
  147. }
  148. }
  149. function doResult(resultObj) {
  150. try {
  151. if( resultObj.getRequestEvent() == "UPDATE_QUOT_DETAIL") {
  152. if( resultObj.getSuccess() ) {
  153. alert("저장 되었습니다.");
  154. reSearch();
  155. }
  156. else {
  157. dlgErrorMsg(resultObj);
  158. }
  159. }
  160. if( resultObj.getRequestEvent() == "FINISH_QUOT_DETAIL") {
  161. if( resultObj.getSuccess() ) {
  162. alert("견적 제출하였습니다.\n견적마감 전까지 제출이 가능합니다.");
  163. reSearch();
  164. }
  165. else {
  166. alert("외부자료를 등록하시기 바랍니다.");
  167. reSearch();
  168. //dlgErrorMsg(resultObj);
  169. }
  170. }
  171. } catch(errorObject) {
  172. showErrorDlg("doResult()", errorObject);
  173. }
  174. }
  175. function reSearch() {
  176. jQuery("#fevent").val("GET_QUOT_DETAIL");
  177. jQuery("#form1").attr("action", "QuotPlan.screen");
  178. jQuery("#form1").attr("target", "_self");
  179. jQuery("#form1").attr("method", "post");
  180. jQuery("#form1").submit();
  181. }
  182. function textareaResize(obj) {
  183. obj.style.height = "80px";
  184. obj.style.height = obj.scrollHeight+"px";
  185. }
  186. function dpTime2(){
  187. var now = new Date();
  188. hours = now.getHours();
  189. minutes = now.getMinutes();
  190. seconds = now.getSeconds();
  191. var day2= new Date(<%=to_yyyy%>,<%=to_MM%>,<%=to_dd%>,<%=to_hh%>,<%=to_mi%>,00);
  192. var day1= new Date(<%=nowTime_yyyy%>,<%=nowTime_MM%>,<%=nowTime_dd%>,hours,minutes,seconds);
  193. var ms1 = Date.parse(day1);
  194. // 두번째 날짜를 1/1000 값으로 환산
  195. var ms2 = Date.parse(day2);
  196. var sep = (ms2-ms1)/1000; // 두 날짜간의 시간차 (1/1000 초 이므로 초로 환산)
  197. var min = 60;
  198. var hour= min * 60;
  199. var day = hour * 24;
  200. var sd = parseInt(sep/day);
  201. var sh = parseInt((sep%day)/hour);
  202. var sm = parseInt((sep%hour)/min);
  203. var ss = sep%min+1;
  204. var msg = "";
  205. if(sd > 0){
  206. msg = sd+'일 '+sh+'시간 '+sm+'분 '+ss+'초 남았습니다. / 견적진행중';
  207. }else if(sd <= 0){
  208. if(sh <= 0){
  209. if(sm <= 0){
  210. msg = "입찰마감";
  211. }else{
  212. msg = sm+'분 '+ss+'초 남았습니다. / 견적진행중';
  213. }
  214. }else{
  215. msg = sh+'시간 '+sm+'분 '+ss+'초 남았습니다. / 견적진행중';
  216. }
  217. }else{
  218. msg = "견적마감";
  219. }
  220. document.getElementById('dpTime').innerHTML = msg;
  221. }
  222. setInterval("dpTime2()",1000);
  223. </SCRIPT>
  224. <modular:search id="form1">
  225. <modular:key id="fevent" />
  226. </modular:search>
  227. <form id="form1" name="form1" method="post" modular:type="search">
  228. <INPUT type='hidden' name="fevent" id="fevent" value="">
  229. <!-- List Search -->
  230. <INPUT type="hidden" name="p_dept_nm" id="p_dept_nm" value="<%= Order.get("dept_nm") %>">
  231. <INPUT type="hidden" name="p_dept_cd" id="p_dept_cd" value="<%= Order.get("dept_cd") %>">
  232. <!-- List Search -->
  233. <INPUT type='hidden' name="QUOT_BID_NO" value="<%=Order.get("QUOT_BID_NO")%>">
  234. <INPUT type='hidden' name="QUOT_BID_DEG" value="<%=Order.get("QUOT_BID_DEG")%>">
  235. <INPUT type='hidden' name="STATUS_CD" value="<%=Order.get("STATUS_CD")%>">
  236. <INPUT type='hidden' name="BID_STATUS_CD" value="<%=Order.get("BID_STATUS_CD")%>">
  237. <INPUT type='hidden' name="VENDOR_CD" value="<%=Order.get("VENDOR_CD")%>">
  238. <INPUT type="hidden" name="quot_id" value="<%= params.get("quot_id") %>">
  239. <INPUT type='hidden' name="REQUEST_DEPT_CD" value="<%=Order.get("REQUEST_DEPT_CD")%>">
  240. <INPUT type='hidden' name="SAVE" value="">
  241. <INPUT type='hidden' name="ATT_ID" value="<%=Order.get("ATT_ID")%>">
  242. <INPUT type='hidden' name="DOC_ETC_OUT" value="<%=Order.get("DOC_ETC_OUT")%>">
  243. <!-- 제목 및 버튼 -->
  244. <table width="100%">
  245. <colgroup>
  246. <col width="500" />
  247. <col width="*" />
  248. </colgroup>
  249. <tr>
  250. <th>
  251. <div align="left" id="title">
  252. <ul><li>견적 계획 상세<font style="font-size:11px">(<%=Order.get("SUPP_STATUS_NM")%>)</font></li></ul>
  253. </div>
  254. </th>
  255. <td align="right">
  256. <span class="btnSearch center"><a href="javascript:void(0);" id="btn_Save">저장</a></span>
  257. <span class="btnSearch center"><a href="javascript:void(0);" id="btn_finish">견적제출</a></span>
  258. <span class="btnSearch center"><a href="javascript:void(0);" id="btn_list">목록</a></span>
  259. </td>
  260. </tr>
  261. </table>
  262. <!-- 발주의뢰정보 : 시작 -->
  263. <div class="application-info magT15" id=SITE_ATTEND_DIV>
  264. <div class="application-sub-title">
  265. <span class="title">견적지원 불참사유</span>
  266. </div>
  267. </div>
  268. <TABLE class="form-table" id=SITE_ATTEND_TABLE>
  269. <colgroup>
  270. <col width="160"/>
  271. <col/>
  272. </colgroup>
  273. <TR height="25">
  274. <TH style="text-align:left">불참사유</TH>
  275. <TD><TEXTAREA name="SITE_ATTEND_REASON" id="SITE_ATTEND_REASON" style="width:99%;height:50px" rows="1" class="input" ><%=Order.get("SITE_ATTEND_REASON")%></TEXTAREA></TD>
  276. </TR>
  277. </TABLE>
  278. <!-- 견적정보 : 시작 -->
  279. <div class="application-info magT10">
  280. <div class="application-sub-title">
  281. <span class="title">견적의뢰정보</span>
  282. </div>
  283. </div>
  284. <TABLE class="form-table">
  285. <colgroup>
  286. <col width="150"/>
  287. <col width="21%">
  288. <col width="150"/>
  289. <col width="20%">
  290. <col width="160"/>
  291. <col/>
  292. </colgroup>
  293. <TR height="25">
  294. <TH>현장</TH>
  295. <TD><%=Order.get("dept_nm") %></TD>
  296. <TH>견적번호</TH>
  297. <TD><%=Order.get("quot_bid_no") %></TD>
  298. <TH>견적명</TH>
  299. <TD><%=Order.get("QUOT_BID_MASTER_NM") %></TD>
  300. </TR>
  301. <TR height="25">
  302. <TH>견적의뢰일자</TH>
  303. <TD><%=Order.get("REQUEST_DATE") %></TD>
  304. <TH>견적의뢰부서</TH>
  305. <TD><%=Order.get("REQUEST_DEPT_NM") %></TD>
  306. <TH>견적의뢰자</TH>
  307. <TD><%=Order.get("REQUEST_MAN_NM") %></TD>
  308. </TR>
  309. <TR height="25">
  310. <TH>사업주</TH>
  311. <TD><%=Order.get("DEALER_NM") %></TD>
  312. <TH>CM/감리사</TH>
  313. <TD><%=Order.get("SUPERVISOR") %></TD>
  314. <TH>현장위치</TH>
  315. <TD><%=Order.get("WORK_PLACE") %></TD>
  316. </TR>
  317. <TR height="25">
  318. <TH>공사기간</TH>
  319. <TD><%=Order.get("START_WORK_DATE") %>~<%=Order.get("END_WORK_DATE") %></TD>
  320. <TH>공사규모</TH>
  321. <TD><%=Order.get("WORK_SIZE") %></TD>
  322. <TH>공종</TH>
  323. <TD><%=Order.get("ITEM_NM") %></TD>
  324. </TR>
  325. </TABLE>
  326. <!-- 견적정보 : 시작 -->
  327. <div class="application-info magT10">
  328. <div class="application-sub-title">
  329. <span class="title">견적기본정보</span>
  330. </div>
  331. </div>
  332. <TABLE class="form-table">
  333. <colgroup>
  334. <col width="150"/>
  335. <col width="21%">
  336. <col width="150"/>
  337. <col width="20%">
  338. <col width="160"/>
  339. <col/>
  340. </colgroup>
  341. <TR height="25">
  342. <TH>견적제출기간</TH>
  343. <TD colspan="3"><%=Order.get("QUOT_BID_FROM_DT") %>~<%=Order.get("QUOT_BID_TO_DT") %>&nbsp;<font color='red'><b>( <span id="dpTime"></span>)</b></font></TD>
  344. <TH>견적유효기간</TH>
  345. <TD><%=Order.get("QUOT_VALIDATE") %></TD>
  346. </TR>
  347. <TR height="25">
  348. <TH>견적담당자</TH>
  349. <TD><%=Order.get("QUOT_MAN_NM") %></TD>
  350. <TH>담당자 전화번호</TH>
  351. <TD><%=Order.get("QUOT_MAN_TELNO") %></TD>
  352. <TH>담당자 E-Mail</TH>
  353. <TD><%=Order.get("QUOT_MAN_EMAIL") %></TD>
  354. </TR>
  355. <TR height="25">
  356. <TH>담당자 FAX</TH>
  357. <TD><%=Order.get("QUOT_MAN_FAX") %></TD>
  358. <TH>견적설명회 일시</TH>
  359. <TD><%=Order.get("QUOT_SITEDESCDATE") %></TD>
  360. <TH>견적설명회 장소</TH>
  361. <TD><%=Order.get("QUOT_SITEDESCPLACE") %></TD>
  362. </TR>
  363. <TR height="25">
  364. <TH style="background:#ffe1b5;text-align:center">참석의사</TD>
  365. <TD>
  366. <select id="SITE_ATTEND_YN" >
  367. <option value="">- 선택 -</option>
  368. <option value="Y">참석</option>
  369. <option value="N">불참</option>
  370. </select>
  371. </TD>
  372. <%
  373. String sitedescYn = "";
  374. if(Order.get("SITEDESC_YN_NM").equals("불참"))
  375. {
  376. sitedescYn = "<font color='red'>"+Order.get("SITEDESC_YN_NM")+"</font>";
  377. }
  378. else
  379. {
  380. sitedescYn = "<font color='blue'>"+Order.get("SITEDESC_YN_NM")+"</font>";
  381. }
  382. %>
  383. <TH style="background:#ffe1b5;text-align:center">참여상태</TD>
  384. <TD colspan="3"><B><%=sitedescYn%></B></TD>
  385. </TR>
  386. </TABLE>
  387. <div class="application-info magT20">
  388. <div class="application-sub-title">
  389. <span class="title">견적조건</span>
  390. </div>
  391. </div>
  392. <TABLE class="form-table" style="margin-top:5px">
  393. <colgroup>
  394. <col width="145"/>
  395. <col width="*"/>
  396. <col/>
  397. </colgroup>
  398. <TR height="100">
  399. <TH>특이사항</TH>
  400. <TD><%=StringUtils.cvtHTML(Order.get("OUTER_REMARKS")) %></TD>
  401. </TR>
  402. <TR height="100">
  403. <TH>견적자료</TH>
  404. <TD>
  405. <TEXTAREA name="p_AttachFile" id="p_AttachFile" style="width:85%;height:80px" rows="1" class="input" readOnly><%=fileout.get("DOC_ETC_OUT") %></TEXTAREA>
  406. <IMG id='search_spot_button' onClick="doAttachFile(document.form1.quot_id,1);" src='/img/buyer/button/bt_change.gif' border='0' align="top" align='absmiddle' alt='[Attach File]' style='cursor:pointer;'>
  407. </TD>
  408. </TR>
  409. <TR height="10">
  410. <TH>대용량파일 link</TH>
  411. <%-- <TD><%=Order.get("URL_COL") %></TD> --%>
  412. <TD><a href="<%=Order.get("URL_COL") %>" target="_blank"><%=Order.get("URL_COL") %></a></TD>
  413. </TR>
  414. </TABLE>
  415. <div class="application-info magT20">
  416. <div class="application-sub-title">
  417. <span class="title">견적내역(부가세별도)</span>
  418. </div>
  419. </div>
  420. <TABLE class="form-table">
  421. <colgroup>
  422. <col width="145"/>
  423. <col width="*"/>
  424. <col/>
  425. </colgroup>
  426. <TR height="25">
  427. <TH class="required">견적금액</TH>
  428. <TD><%= InputText.get("ESTI_TOT_AMT", Formatter2.currency(Order.get("ESTI_TOT_AMT"),0), 30, 15, "desc=견적금액,Number,right","Number") %>원</TD>
  429. </TR>
  430. <TR>
  431. <TH>의견</TH>
  432. <TD>
  433. <textarea name="REMARK" id="REMARK" style="width:98%; height:80px; overflow-y:auto" maxlength="1000" class="input byteChk ctrlTarget" onkeyup="textareaResize(this)"><%=Order.get("REMARK")%></textarea>
  434. </TD>
  435. </TR>
  436. <TR height="100">
  437. <TH class="required">첨부파일</TH>
  438. <TD>
  439. <TEXTAREA name="p_AttachFile2" id="p_AttachFile2" style="width:85%;height:80px" rows="1" class="input" readOnly><%=attid.get("ATT_ID") %></TEXTAREA>
  440. <IMG id='search_spot_button' onClick="doAttachFile(document.form1.quot_id,2);" src='/img/buyer/button/bt_change.gif' border='0' align="top" align='absmiddle' alt='[Attach File]' style='cursor:pointer;'>
  441. </TD>
  442. </TR>
  443. </TABLE>
  444. </form>