QuotPurPlan.jsp 47 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258
  1. <%--
  2. - Author(s) : Hoonseok choi
  3. - Date : 2023.01.18
  4. - Description: 견적_계획 상세
  5. --%>
  6. <%@ page contentType="text/html; charset=utf-8" %>
  7. <%@page import="kr.co.hsnc.common.config.WAFConfig"%>
  8. <%@ page import="com.udapsoft.waf.system.HandlerStorage" %>
  9. <%@ page import="com.udapsoft.waf.common.ui.*" %>
  10. <%@ page import="kr.co.udapsoft.common.code.*" %>
  11. <%@ page import="kr.co.hsnc.common.util.*"%>
  12. <%@ page import="kr.co.hsnc.common.sql.*" %>
  13. <%@ page import="com.udapsoft.waf.common.util.Formatter2"%>
  14. <%@ page import="com.udapsoft.waf.common.util.StringUtils"%>
  15. <%@ page import="kr.co.udapsoft.common.util.Crosscert"%>
  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. ValueObject filein = storage.getValueObject("DOC_ETC_IN");
  25. ValueObject fileout = storage.getValueObject("DOC_ETC_OUT");
  26. String gwurl = "http://gw.sgcenc.co.kr/";
  27. String isModify = "";
  28. if(Order.get("quot_id").equals("")) {
  29. isModify = "false";
  30. } else {
  31. isModify = "true";
  32. }
  33. String today = DateUtil.formatDateTime(DateUtil.getToday(), "yyyyMMdd", "yyyyMMdd");
  34. //공통코드
  35. CommCodeManager commCodeManager = new CommCodeManager();
  36. InitCombo initCombo = new InitCombo();
  37. initCombo.makeComboData(commCodeManager.getCodeRowSet("QUOT_SUPP_SITEPARTI"), "NAME", "CODE");
  38. String BID_SUPP_SITEPARTI_CD = initCombo.getCode();
  39. String BID_SUPP_SITEPARTI_NM = initCombo.getCodeName();
  40. InitCombo initCombo2 = new InitCombo();
  41. initCombo2.makeComboData(commCodeManager.getCodeRowSet("QUOT_SUPP_SITEPARTI","CHG_CODE01","1"), "DETAILNM", "DETAILCD");
  42. String BID_SUPP_SITEPARTI_CD2 = initCombo2.getCode();
  43. String BID_SUPP_SITEPARTI_NM2 = initCombo2.getCodeName();
  44. %>
  45. <SCRIPT language="JavaScript">
  46. document.body.onresize = addEvent( document.body.onresize, "autoResize()");
  47. /*예약함수*/
  48. var sheet1 = new ibsheetObject();
  49. var sheet1Row;
  50. var sheet1PageNo = 1;
  51. var pageLastRowIndex = 1;
  52. var validationResult = false;
  53. var filterShow = false;
  54. var btn_act = "";
  55. var must_msg = "(은)는 필수 입력 항목입니다.";
  56. function _onReady(){
  57. /**
  58. * IBSheet object initialize
  59. */
  60. gridInit(sheet1);
  61. //견적요청,견적마감 이후에 버튼 숨김..
  62. if("<%=Order.get("STATUS_CD")%>" == "00"){
  63. $("#btn_Save").hide();
  64. $("#btn_Request").hide();
  65. $("#btn_del").hide();
  66. $("#btn_resend").hide();
  67. $("#btn_row_save").hide();
  68. $("#btn_back").hide();
  69. $("#btn_finish").hide();
  70. }else if("<%=Order.get("STATUS_CD")%>" == "01"){
  71. $("#btn_Create").text("견적복사");
  72. $("#btn_resend").hide();
  73. $("#btn_row_save").hide();
  74. $("#btn_back").hide();
  75. $("#btn_finish").hide();
  76. }else if("<%=Order.get("STATUS_CD")%>" == "02" || "<%=Order.get("STATUS_CD")%>" == "10"){
  77. $("#btn_Create").text("견적복사");
  78. $("#btn_Save").hide();
  79. $("#btn_Request").hide();
  80. $("#btn_del").hide();
  81. $("#quot_corp_add").hide();
  82. $("#corp_add").hide();
  83. $("#btn_row_del").hide();
  84. if("<%=Order.get("STATUS_CD")%>" == "10"){
  85. $("#btn_resend").hide();
  86. $("#btn_row_save").hide();
  87. $("#btn_back").hide();
  88. $("#btn_finish").hide();
  89. }
  90. }
  91. /**
  92. * Application Initialize
  93. */
  94. $("#sitedesc_flag_1").click(function() {
  95. $("#QUOT_SITEDESCDATE").attr("disabled",false);
  96. $("#QUOT_SITEDESCDATE_HH").attr("disabled",false);
  97. $("#QUOT_SITEDESCDATE_MI").attr("disabled",false);
  98. $("#QUOT_SITEDESCPLACE").attr("disabled",false);
  99. $("#calendar_sitedescdate").show();
  100. });
  101. $("#sitedesc_flag_2").click(function() {
  102. $("#QUOT_SITEDESCDATE").attr("disabled",true);
  103. $("#QUOT_SITEDESCDATE").val("");
  104. $("#QUOT_SITEDESCDATE_HH").attr("disabled",true);
  105. $("#QUOT_SITEDESCDATE_HH").val("");
  106. $("#QUOT_SITEDESCDATE_MI").attr("disabled",true);
  107. $("#QUOT_SITEDESCDATE_MI").val("");
  108. $("#QUOT_SITEDESCPLACE").attr("disabled",true);
  109. $("#QUOT_SITEDESCPLACE").val("");
  110. $("#calendar_sitedescdate").hide();
  111. });
  112. //라디오 박스 체크 여부 // N 일경우 비활성화
  113. if($("#sitedesc_flag_2").attr("checked") == "checked") $("#sitedesc_flag_2").click();
  114. $("#btn_list").click(function() {
  115. jQuery("#fevent").val("");
  116. jQuery("#form1").attr("action", "/quot/purchase/QuotPurPlanList.screen");
  117. jQuery("#form1").attr("target", "_self");
  118. jQuery("#form1").attr("method", "post");
  119. jQuery("#form1").submit();
  120. });
  121. $("#btn_Create").click(function() {
  122. if(confirm("생성하시겠습니까?")){
  123. if(create_must_ck()){
  124. jQuery("#fevent").val("SAVE_QUOT_DETAIL");
  125. var f = document.form1;
  126. submitXmlRequest("/quot/purchase/QuotPurPlan_form.screen", "SAVE_QUOT_DETAIL", f);
  127. }
  128. }
  129. });
  130. $("#btn_Save").click(function() {
  131. var sRow = sheet1.FindStatusRow("D");
  132. if(sRow != ""){
  133. alert("저장시 업체 선택을 해지해 주십시오.");
  134. return;
  135. }
  136. if(confirm("저장하시겠습니까?")){
  137. if(save_must_ck()){
  138. jQuery("#fevent").val("UPDATE_QUOT_DETAIL");
  139. jQuery("#STATUS_CD").val("01");
  140. var f = document.form1;
  141. submitXmlRequest("/quot/purchase/QuotPurPlan_form.screen", "UPDATE_QUOT_DETAIL", f);
  142. }
  143. }
  144. });
  145. $("#btn_Request").click(function() {
  146. var sRow = sheet1.FindStatusRow("D");
  147. if(sRow != ""){
  148. alert("견적 요청시 업체 선택을 해지해 주십시오.");
  149. return;
  150. }
  151. if(confirm("견적 요청하시겠습니까?")){
  152. if(save_must_ck()){
  153. jQuery("#fevent").val("SEND_QUOT_DETAIL");
  154. jQuery("#STATUS_CD").val("02");
  155. var f = document.form1;
  156. submitXmlRequest("/quot/purchase/QuotPurPlan_form.screen", "SEND_QUOT_DETAIL", f);
  157. }
  158. }
  159. });
  160. $("#btn_del").click(function() {
  161. if (confirm("삭제 하시겠습니까?")){
  162. var f = document.form1;
  163. $("#fevent").val("FORM_DELETE");
  164. submitXmlRequest("/quot/purchase/QuotPurPlan_form.screen", "FORM_DELETE", f);
  165. }
  166. });
  167. $("#btn_back").click(function() {
  168. if(confirm("견적 회수 하시겠습니까?")){
  169. jQuery("#fevent").val("STATUS_QUOT_DETAIL");
  170. jQuery("#STATUS_CD").val("01");
  171. var f = document.form1;
  172. submitXmlRequest("/quot/purchase/QuotPurPlan_form.screen", "STATUS_QUOT_DETAIL", f);
  173. }
  174. });
  175. $("#btn_finish").click(function() {
  176. if(confirm("견적 마감하시겠습니까?")){
  177. if(save_must_ck()){
  178. jQuery("#fevent").val("STATUS_QUOT_DETAIL");
  179. jQuery("#STATUS_CD").val("10");
  180. var f = document.form1;
  181. submitXmlRequest("/quot/purchase/QuotPurPlan_form.screen", "STATUS_QUOT_DETAIL", f);
  182. }
  183. }
  184. });
  185. //견적의뢰일자 변경
  186. $("#REQUEST_DATE").change(function() {
  187. if($("#QUOT_BID_FROM_DT").val().length> 0){
  188. if($("#REQUEST_DATE").val()> $("#QUOT_BID_FROM_DT").val()){
  189. alert("견적의뢰일자는 견적제출일이전이어야 합니다.\n- 견적제출일:"+$("#QUOT_BID_FROM_DT").val());
  190. $("#REQUEST_DATE").val("");
  191. return;
  192. }
  193. }
  194. if($("#QUOT_SITEDESCDATE").val().length> 0){
  195. if($("#REQUEST_DATE").val()> $("#QUOT_SITEDESCDATE").val()){
  196. alert("견적의뢰일자는 견적설명일이전이어야 합니다.\n- 견적설명일:"+$("#QUOT_SITEDESCDATE").val());
  197. $("#REQUEST_DATE").val("");
  198. return;
  199. }
  200. }
  201. });
  202. //견적제출기간 변경
  203. $("#QUOT_BID_FROM_DT").change(function() {
  204. if($("#QUOT_SITEDESCDATE").val().length> 0){
  205. if($("#QUOT_BID_FROM_DT").val() < $("#QUOT_SITEDESCDATE").val()){
  206. alert("견적제출일자는 견적설명일 이전일수 없습니다.\n- 견적설명일:"+$("#QUOT_SITEDESCDATE").val());
  207. $("#QUOT_BID_FROM_DT").val("");
  208. return;
  209. }
  210. }
  211. if($("#REQUEST_DATE").val().length> 0){
  212. if($("#QUOT_BID_FROM_DT").val() < $("#REQUEST_DATE").val()){
  213. alert("견적제출기간은 견적의뢰일 이전 일 수 없습니다.\n- 견적의뢰일:"+$("#REQUEST_DATE").val());
  214. $("#QUOT_BID_FROM_DT").val("");
  215. return;
  216. }
  217. }
  218. if($("#QUOT_BID_TO_DT").val().length> 0){
  219. if($("#QUOT_BID_TO_DT").val() < $("#QUOT_BID_FROM_DT").val()){
  220. alert("시작 또는 종료(마감) 일시가 잘못 입력되었습니다.");
  221. $("#QUOT_BID_FROM_DT").val("");
  222. return;
  223. }
  224. }
  225. });
  226. //견적제출기간 변경
  227. $("#QUOT_BID_TO_DT").change(function() {
  228. if($("#QUOT_SITEDESCDATE").val().length> 0){
  229. if($("#QUOT_BID_TO_DT").val() < $("#QUOT_SITEDESCDATE").val()){
  230. alert("견적제출일자는 견적설명일 이전일수 없습니다.\n- 견적설명일:"+$("#QUOT_SITEDESCDATE").val());
  231. $("#QUOT_BID_TO_DT").val("");
  232. return;
  233. }
  234. }
  235. if($("#QUOT_BID_FROM_DT").val().length> 0){
  236. if($("#QUOT_BID_TO_DT").val() < $("#QUOT_BID_FROM_DT").val()){
  237. alert("시작 또는 종료(마감) 일시가 잘못 입력되었습니다.");
  238. $("#QUOT_BID_TO_DT").val("");
  239. return;
  240. }
  241. }
  242. if($("#REQUEST_DATE").val().length> 0){
  243. if($("#QUOT_BID_TO_DT").val() < $("#REQUEST_DATE").val()){
  244. alert("견적제출기간은 견적의뢰일 이전 일 수 없습니다.\n- 견적의뢰일:"+$("#REQUEST_DATE").val());
  245. $("#QUOT_BID_TO_DT").val("");
  246. return;
  247. }
  248. }
  249. });
  250. $("#QUOT_MAN_EMAIL").change(function() {
  251. if(!checkEmail($("#QUOT_MAN_EMAIL").val())){
  252. alert("이메일 형식이 올바르지 않습니다.");
  253. $("#QUOT_MAN_EMAIL").focus();
  254. }
  255. });
  256. $("#quot_corp_add").click(function(){
  257. var f = document.form1;
  258. if(jQuery("#quot_id").val() == "") {
  259. alert("견적 생성 후 등록 할 수 있습니다.");
  260. return;
  261. }
  262. var win_id = "quot_corp";
  263. var link = "/quot/purchase/QuotSuppChoicePop.screen";
  264. link += "?pop_win_id="+win_id;
  265. fLayerPop(win_id, link, 800,400, '','', 'NO');
  266. });
  267. $("#corp_add").click(function(){
  268. var f = document.form1;
  269. if(jQuery("#quot_id").val() == "") {
  270. alert("견적 생성 후 등록 할 수 있습니다.");
  271. return;
  272. }
  273. var win_id = "corp";
  274. var outitem = "<%=Order.get("OUT_ITEM_CD")%>";
  275. var link = "/common/corp/SuppChoicePop.screen";
  276. link += "?pop_win_id="+win_id+"&MENU=QUOT&OUT_ITEM_CD="+outitem;
  277. fLayerPop(win_id, link, 800,400, '','', 'NO');
  278. });
  279. $.test = function(resultVal)
  280. {
  281. for(var i=0; i < resultVal[0].length; i++)
  282. {
  283. var rowcnt = sheet1.RowCount();
  284. if(rowcnt> 0){
  285. for(var r=0; r < rowcnt; r++)
  286. {
  287. var vendor_cd = sheet1.GetCellValue(r+1,"VENDOR_CD");
  288. if(vendor_cd == resultVal[0][i]){
  289. alert(resultVal[4][i]+"는 이미 등록된 업체입니다.");
  290. return;
  291. }
  292. }
  293. }
  294. //sheetObj.DataAutoTrim = false;
  295. var row = sheet1.DataInsert(-1);
  296. sheet1.SetCellValue(row,"VENDOR_CD",resultVal[0][i]);
  297. sheet1.SetCellValue(row,"VENDOR_NO",resultVal[1][i]);
  298. sheet1.SetCellValue(row,"VENDOR_NAME",resultVal[2][i]);
  299. sheet1.SetCellValue(row,"REPRE_NO",resultVal[3][i]);
  300. sheet1.SetCellValue(row,"CHARGE_NAME",resultVal[4][i]);
  301. sheet1.SetCellValue(row,"TEL_NUM",resultVal[5][i]);
  302. sheet1.SetCellValue(row,"CHAGE_HP",resultVal[6][i]);
  303. sheet1.SetCellValue(row,"CHARGE_EMAIL",resultVal[7][i]);
  304. sheet1.SetCellValue(row,"ON_SUPP_YN","Y");
  305. sheet1.SetCellValue(row,"IN_OUT_DIV",resultVal[8][i]);
  306. sheet1.SetCellValue(row,"SITE_ATTEND_YN","");
  307. sheet1.SetCellValue(row,"SITEPARTI_YN","");
  308. }
  309. setGridSize();
  310. setTimeout(function(){fLayerPopClose('corp');},100);
  311. };
  312. $.test2 = function(resultVal)
  313. {
  314. for(var i=0; i < resultVal[0].length; i++)
  315. {
  316. var rowcnt = sheet1.RowCount();
  317. if(rowcnt> 0){
  318. for(var r=0; r < rowcnt; r++)
  319. {
  320. var vendor_cd = sheet1.GetCellValue(r+1,"VENDOR_CD");
  321. if(vendor_cd == resultVal[0][i]){
  322. alert(resultVal[4][i]+"는 이미 등록된 업체입니다.");
  323. return;
  324. }
  325. }
  326. }
  327. //sheetObj.DataAutoTrim = false;
  328. var row = sheet1.DataInsert(-1);
  329. sheet1.SetCellValue(row,"VENDOR_CD",resultVal[0][i]);
  330. sheet1.SetCellValue(row,"VENDOR_NO",resultVal[1][i]);
  331. sheet1.SetCellValue(row,"VENDOR_NAME",resultVal[2][i]);
  332. sheet1.SetCellValue(row,"REPRE_NO",resultVal[3][i]);
  333. sheet1.SetCellValue(row,"CHARGE_NAME",resultVal[4][i]);
  334. sheet1.SetCellValue(row,"TEL_NUM",resultVal[5][i]);
  335. sheet1.SetCellValue(row,"CHAGE_HP",resultVal[6][i]);
  336. sheet1.SetCellValue(row,"CHARGE_EMAIL",resultVal[7][i]);
  337. sheet1.SetCellValue(row,"ON_SUPP_YN",resultVal[8][i]);
  338. sheet1.SetCellValue(row,"IN_OUT_DIV",resultVal[9][i]);
  339. sheet1.SetCellValue(row,"SITE_ATTEND_YN","");
  340. sheet1.SetCellValue(row,"SITEPARTI_YN","");
  341. }
  342. setGridSize();
  343. setTimeout(function(){fLayerPopClose('quot_corp');},100);
  344. };
  345. $("#btn_row_del").click(function() {
  346. if(confirm("삭제 하시겠습니까?")){
  347. $("#fevent").val("SET_CORP_DELETE");
  348. var url = Modular.model.PageContext.CONTEXT_ROOT + "/quot/purchase/QuotPurPlan_sheet.screen";
  349. var result = Modular.view.IBSheet7.doSave(sheet1, url, $("#form1"), false);
  350. }
  351. });
  352. $("#btn_resend").click(function() {
  353. var sRow = sheet1.FindStatusRow("D");
  354. if(sRow == ""){
  355. alert("업체를 선택하십시오");
  356. return;
  357. }
  358. if(confirm("견적 요청 SMS,E-MAIL을 재발송하시겠습까?")){
  359. jQuery("#fevent").val("RESEND_QUOT_DETAIL");
  360. var url = Modular.model.PageContext.CONTEXT_ROOT + "/quot/purchase/QuotPurPlan_sheet.screen";
  361. var result = Modular.view.IBSheet7.doSave(sheet1, url, $("#form1"), false);
  362. }
  363. });
  364. $("#btn_row_save").click(function() {
  365. var sRow = sheet1.FindStatusRow("D");
  366. if(sRow != ""){
  367. alert("업체를 선택하지 마십시오.");
  368. return;
  369. }
  370. if(confirm("저장 하시겠습까?")){
  371. jQuery("#fevent").val("SAVE_DETAIL");
  372. var url = Modular.model.PageContext.CONTEXT_ROOT + "/quot/purchase/QuotPurPlan_sheet.screen";
  373. var result = Modular.view.IBSheet7.doSave(sheet1, url, $("#form1"), false);
  374. }
  375. });
  376. doSearchSheet();
  377. }
  378. function SearchUser(NAME,CODE,DEPT_YN){
  379. var GB = "";
  380. if(CODE == "REQUEST_MAN_ID"){
  381. CODE = "";
  382. NAME = "";
  383. GB = "REQUEST";
  384. }else if(CODE == "QUOT_MAN_ID"){
  385. CODE = "";
  386. NAME = "";
  387. GB = "QUOT";
  388. }
  389. var win_id = "_searchUserPopup";
  390. var link = "/lib/dlgSearchUserPop.screen";
  391. link += "?pop_win_id="+win_id;
  392. link += "&NAME="+NAME;
  393. link += "&CODE="+CODE;
  394. link += "&GB="+GB;
  395. if(DEPT_YN == "Y")
  396. link += "&deptNameYn=quotation";
  397. fLayerPop(win_id, link, 700,400, '', '', 'NO');
  398. }
  399. function SearchUserClose(result){
  400. if(result[10] == "REQUEST"){
  401. $("#REQUEST_MAN_ID").val(result[9])//ACCT_ID
  402. $("#REQUEST_MAN_NM").val(result[1])//이름
  403. $("#REQUEST_DEPT_CD").val(result[2])//부서코드
  404. $("#REQUEST_DEPT_NM").val(result[3])//부서명
  405. }else if(result[10] == "QUOT"){
  406. $("#QUOT_MAN_ID").val(result[9])//ACCT_ID
  407. $("#QUOT_MAN_NM").val(result[1])//이름
  408. $("#QUOT_MAN_TELNO").val(result[6])//연락처
  409. $("#QUOT_MAN_EMAIL").val(result[8])//이메일
  410. }
  411. setTimeout(function(){fLayerPopClose('_searchUserPopup');},100);
  412. }
  413. function sheet1_OnChange(Row, Col, Value) {
  414. if(Col == 8){//전화번호 형식 체크
  415. if(Value != ""){
  416. if(!checkTelno(Value)){
  417. alert("전화번호 형식이 올바르지 않습니다.");
  418. sheet1.SetCellValue(Row,Col,"");
  419. }
  420. }
  421. }
  422. if(Col == 9){//이메일 형식 체크
  423. if(Value != ""){
  424. if(!checkEmail(Value)){
  425. alert("이메일 형식이 올바르지 않습니다.");
  426. sheet1.SetCellValue(Row,Col,"");
  427. }
  428. }
  429. }
  430. }
  431. function searchAccDept(p_dept_cd, p_dept_nm){
  432. var win_id = "_searchDept";
  433. var link = "/lib/dlgSearchAccDept.screen";
  434. link += "?pop_win_id="+win_id;
  435. //link += "&{{query}}";
  436. fLayerPop(win_id, link, 600,400, '', '', 'NO');
  437. }
  438. function searchAccDeptClose(result){
  439. if( result == null ){
  440. p_dept_cd.value = ""; //부서코드
  441. p_dept_nm.value = ""; //부서명
  442. }else{
  443. p_dept_cd.value = result[0]; //부서코드
  444. p_dept_nm.value = result[1]; //부서명
  445. }
  446. setTimeout(function(){fLayerPopClose('_searchDept');},100);
  447. }
  448. function searchAccDept(p_dept_cd, p_dept_nm){
  449. var win_id = "_searchDept";
  450. var link = "/lib/dlgSearchAccDept.screen";
  451. link += "?pop_win_id="+win_id;
  452. //link += "&{{query}}";
  453. fLayerPop(win_id, link, 600,400, '', '', 'NO');
  454. }
  455. function searchAccDeptClose(result){
  456. if( result == null ){
  457. }else{
  458. sheet1.SetCellValue($("#TEMP_ROW").val(),"RECM_DEPT_ID",result[0]); //부서코드
  459. sheet1.SetCellValue($("#TEMP_ROW").val(),"RECM_DEPT_NM", result[1]); //부서명
  460. }
  461. setTimeout(function(){ fLayerPopClose('_searchDept');},100);
  462. }
  463. function doSearchSheet(){
  464. $("#fevent").val("GET_CORP_LIST");
  465. var url = Modular.model.PageContext.CONTEXT_ROOT + "/quot/purchase/QuotPurPlan_sheet.screen";
  466. Modular.view.IBSheet7.doSearch(sheet1, url, jQuery("#form1"), 30, "");
  467. }
  468. /**
  469. * IBSheet object initialize
  470. */
  471. function gridInit(sheetName){
  472. var init_sheet = {};
  473. if(sheetName.id == "sheet1"){
  474. init_sheet.Cfg = {SearchMode:2, Page:30, MergeSheet:msHeaderOnly};
  475. init_sheet.Cols = [
  476. {Header:'선택', Type:"DelCheck", SaveName:"DEL_CHECK", Width:0, Align:"Center"},
  477. {Header:'Status', Type:"Status", SaveName:"STATUS", Width:0, Align:"Center", Hidden:"True"},
  478. {Header:'No.', Type:"Seq", SaveName:"NO", Width:0, Align:"Center", Hidden:"True"},
  479. {Header:'사업자번호', Type:"Text", SaveName:"VENDOR_NO", Width:100, Align:"Center", Format:"SaupNo", Edit:false},
  480. {Header:'업체명', Type:"Text", SaveName:"VENDOR_NAME", Width:100, Align:"Left", Edit:false},
  481. {Header:'대표자명', Type:"Text", SaveName:"REPRE_NO", Width:100, Align:"Center", Edit:false},
  482. {Header:'담당자명', Type:"Text", SaveName:"CHARGE_NAME", Width:100, Align:"Center"},
  483. {Header:'전화번호', Type:"Text", SaveName:"TEL_NUM", Width:100, Align:"Center", Edit:false},
  484. {Header:'핸드폰', Type:"Text", SaveName:"CHAGE_HP", Width:100, Align:"Center"},
  485. {Header:'이메일', Type:"Text", SaveName:"CHARGE_EMAIL", Width:100, Align:"Left"},
  486. {Header:'참석의사', Type:"Combo", SaveName:"SITE_ATTEND_YN", Width:80, Align:"Center", ComboText:"<%=BID_SUPP_SITEPARTI_NM%>", ComboCode:"<%=BID_SUPP_SITEPARTI_CD%>", Edit:false, Cursor:"Pointer"},
  487. {Header:'참석여부', Type:"Combo", SaveName:"SITEPARTI_YN", Width:80, Align:"Center", ComboText:"<%=BID_SUPP_SITEPARTI_NM2%>", ComboCode:"<%=BID_SUPP_SITEPARTI_CD2%>"},
  488. {Header:'최종견적제출시간', Type:"Text", SaveName:"SUBMIT_DT", Width:100, Align:"Center", Edit:false},
  489. {Header:'견적금액(원)', Type:"Text", SaveName:"ESTI_TOT_AMT", Width:100, Align:"Right", Edit:false, Cursor:'pointer'},
  490. {Header:'파일다운', Type:"Text", SaveName:"FILE_DOWN", Width:50, Align:"Center", Edit:false, Cursor:'pointer'},
  491. {Header:'유형', Type:"Text", SaveName:"ON_SUPP_YN_NM", Width:50, Align:"Center", Edit:false},
  492. {Header:'구분', Type:"Text", SaveName:"IN_OUT_DIV_NM", Width:50, Align:"Center", Edit:false, Cursor:'pointer'},
  493. {Header:'IN_OUT_DIV', Type:"Text", SaveName:"IN_OUT_DIV", Width:0, Align:"Center", Hidden:"True"},
  494. {Header:'ON_SUPP_YN', Type:"Text", SaveName:"ON_SUPP_YN", Width:0, Align:"Center", Hidden:"True"},
  495. {Header:'QUOT_BID_NO', Type:"Text", SaveName:"QUOT_BID_NO", Width:0, Align:"Center", Hidden:"True"},
  496. {Header:'QUOT_BID_DEG', Type:"Text", SaveName:"QUOT_BID_DEG", Width:0, Align:"Center", Hidden:"True"},
  497. {Header:'FILE_GB', Type:"Text", SaveName:"FILE_GB", Width:0, Align:"Center", Hidden:"True"},
  498. {Header:'VENDOR_CD', Type:"Text", SaveName:"VENDOR_CD", Width:0, Align:"Center", Hidden:"True"}
  499. ];
  500. }
  501. init_sheet.HeaderMode = {Sort:1};
  502. IBS_InitSheet(sheetName, init_sheet);
  503. sheetName.SetDataAutoTrim(0);
  504. sheetName.SetImageList(1,"/img/buyer/button/bt_search_right.gif");
  505. //sheetName.SizeMode(0);
  506. setGridSize();
  507. }
  508. /**
  509. * IBSheet Event: Click
  510. */
  511. function sheet1_OnClick(Row, Col, Value, CellX, CellY, CellW, CellH) {
  512. }
  513. /**
  514. * IBSheet Event: Search End(IBSheet 데이터 조회 CallBack)
  515. */
  516. function sheet1_OnSearchEnd(code, message) {
  517. if(code == 0) {
  518. setGridSize();
  519. var rowcnt = sheet1.RowCount();
  520. if(rowcnt> 0){
  521. for(var r=0; r < rowcnt; r++)
  522. {
  523. if(sheet1.GetCellValue(r+1,"SUBMIT_DT") == "미제출"){
  524. sheet1.SetCellFont("FontColor", r+1, 10, r+1, 10, "red");
  525. }
  526. sheet1.SetCellFont("FontColor", r+1, 11, r+1, 11, "blue");
  527. }
  528. }
  529. } else {
  530. //조회 에러 수행
  531. alert(message);
  532. }
  533. }
  534. function save_detail_sheet() {
  535. jQuery("#fevent").val("SAVE_SUPP_DETAIL");
  536. var url = Modular.model.PageContext.CONTEXT_ROOT + "/quot/purchase/QuotPurPlan_sheet.screen";
  537. var result = Modular.view.IBSheet7.doSave(sheet1, url, jQuery("#form1"), false);
  538. }
  539. /**
  540. * IBSheet size setting
  541. */
  542. function setGridSize() {
  543. sheet1.FitColWidth();
  544. }
  545. function create_must_ck(){
  546. if(must_ck_val("QUOT_BID_MASTER_NM","견적명"))return false;
  547. if(must_ck_val("REQUEST_DATE","견적의뢰일자"))return false;
  548. if(must_ck_val("REQUEST_MAN_ID","견적의뢰자"))return false;
  549. if(must_ck_val("DEALER_NM","사업주"))return false;
  550. if(must_ck_val("WORK_PLACE","현장위치"))return false;
  551. if(must_ck_val("START_WORK_DATE","공사시작일"))return false;
  552. if(must_ck_val("END_WORK_DATE","공사마감일"))return false;
  553. if(must_ck_val("ITEM_NM","공종"))return false;
  554. if(must_ck_val("QUOT_BID_FROM_DT","견적제출일"))return false;
  555. if(time_ck("QUOT_BID_FROM_HH","HH"))return false;
  556. if(time_ck("QUOT_BID_FROM_MI","MI"))return false;
  557. if(must_ck_val("QUOT_BID_TO_DT","견적마감일"))return false;
  558. if(time_ck("QUOT_BID_TO_HH","HH"))return false;
  559. if(time_ck("QUOT_BID_TO_MI","MI"))return false;
  560. if(jQuery("#QUOT_BID_FROM_DT").val() == jQuery("#QUOT_BID_TO_DT").val()){
  561. var fromitme = jQuery("#QUOT_BID_FROM_HH").val()+jQuery("#QUOT_BID_FROM_MI").val();
  562. var toitme = jQuery("#QUOT_BID_TO_HH").val()+jQuery("#QUOT_BID_TO_MI").val();
  563. if(toitme <= fromitme){
  564. alert("견적제출기간 시작 또는 종료(마감) 일시가 잘못 입력되었습니다.");
  565. jQuery("#QUOT_BID_FROM_HH").focus();
  566. return false;
  567. }
  568. }
  569. if(must_ck_val("QUOT_MAN_ID","견적담당자"))return false;
  570. if(must_ck_val("QUOT_MAN_TELNO ","담당자 전화번호"))return false;
  571. if(must_ck_val("QUOT_MAN_EMAIL","담당자 E-Mail"))return false;
  572. if(must_ck_radio("QUOT_SITEDESC_FLAG","견적설명여부"))return false;
  573. if($(':radio[name="QUOT_SITEDESC_FLAG"]:checked').val() == "Y"){
  574. if(must_ck_val("QUOT_SITEDESCDATE",""))return false;
  575. if(time_ck("QUOT_SITEDESCDATE_HH","HH"))return false;
  576. if(time_ck("QUOT_SITEDESCDATE_MI","MI"))return false;
  577. if(must_ck_val("QUOT_SITEDESCPLACE",""))return false;
  578. }
  579. return true;
  580. }
  581. function save_must_ck(){
  582. if(must_ck_val("QUOT_BID_MASTER_NM","견적명"))return false;
  583. if(must_ck_val("REQUEST_DATE","견적의뢰일자"))return false;
  584. if(must_ck_val("REQUEST_MAN_ID","견적의뢰자"))return false;
  585. if(must_ck_val("DEALER_NM","사업주"))return false;
  586. if(must_ck_val("WORK_PLACE","현장위치"))return false;
  587. if(must_ck_val("START_WORK_DATE","공사시작일"))return false;
  588. if(must_ck_val("END_WORK_DATE","공사마감일"))return false;
  589. if(must_ck_val("ITEM_NM","공종"))return false;
  590. if(must_ck_val("QUOT_BID_FROM_DT","견적제출일"))return false;
  591. if(time_ck("QUOT_BID_FROM_HH","HH"))return false;
  592. if(time_ck("QUOT_BID_FROM_MI","MI"))return false;
  593. if(must_ck_val("QUOT_BID_TO_DT","견적마감일"))return false;
  594. if(time_ck("QUOT_BID_TO_HH","HH"))return false;
  595. if(time_ck("QUOT_BID_TO_MI","MI"))return false;
  596. if(jQuery("#QUOT_BID_FROM_DT").val() == jQuery("#QUOT_BID_TO_DT").val()){
  597. var fromitme = jQuery("#QUOT_BID_FROM_HH").val()+jQuery("#QUOT_BID_FROM_MI").val();
  598. var toitme = jQuery("#QUOT_BID_TO_HH").val()+jQuery("#QUOT_BID_TO_MI").val();
  599. if(toitme <= fromitme){
  600. alert("견적제출기간 시작 또는 종료(마감) 일시가 잘못 입력되었습니다.");
  601. jQuery("#QUOT_BID_FROM_HH").focus();
  602. return false;
  603. }
  604. }
  605. if(must_ck_val("QUOT_MAN_ID","견적담당자"))return false;
  606. if(must_ck_val("QUOT_MAN_TELNO ","담당자 전화번호"))return false;
  607. if(must_ck_val("QUOT_MAN_EMAIL","담당자 E-Mail"))return false;
  608. if(must_ck_radio("QUOT_SITEDESC_FLAG","견적설명여부"))return false;
  609. if($(':radio[name="QUOT_SITEDESC_FLAG"]:checked').val() == "Y"){
  610. if(must_ck_val("QUOT_SITEDESCDATE",""))return false;
  611. if(time_ck("QUOT_SITEDESCDATE_HH","HH"))return false;
  612. if(time_ck("QUOT_SITEDESCDATE_MI","MI"))return false;
  613. if(must_ck_val("QUOT_SITEDESCPLACE",""))return false;
  614. }
  615. if(must_ck_val("OUTER_REMARKS","특이사항"))return false;
  616. var rowcnt = sheet1.RowCount();
  617. if(rowcnt == 0){
  618. alert("견적 대상 업체가 1개 이상 이어야 합니다.");
  619. $("#sheet1_div").focus();
  620. return false;
  621. }
  622. var out_check = "N";
  623. for(var r=0; r < rowcnt; r++)
  624. {
  625. var in_out_div = sheet1.GetCellValue(r+1,"IN_OUT_DIV");
  626. if(in_out_div == "O"){
  627. out_check = "Y";
  628. continue;
  629. }
  630. }
  631. if(out_check == "Y" && $("#INNER_REMARKS").val().length == 0){
  632. if(!confirm("해외업체가 등록되어 있으나 특이사항(해외업체)가 등록되어 있지 않습니다.\n진행하시겠습니까?")){
  633. return false;
  634. }
  635. }
  636. return true;
  637. }
  638. // value 값 체크
  639. function must_ck_val(obj,desc){
  640. if($("#"+obj).val().length == 0){
  641. if(desc.length> 0){
  642. alert(desc+must_msg);
  643. }else{
  644. alert($("#"+obj).attr("desc")+must_msg);
  645. }
  646. $("#"+obj).focus();
  647. return true;
  648. }
  649. return false;
  650. }
  651. // radio 박스 체크
  652. function must_ck_radio(obj,name){
  653. var value = $(':radio[name='+obj+']:checked').val();
  654. if(value == undefined){
  655. alert(name+must_msg);
  656. $("#"+obj).focus();
  657. return true;
  658. }
  659. return false;
  660. }
  661. function time_ck(obj,type){
  662. if(must_ck_val(obj,""))return true;
  663. if(!isNumber($("#"+obj).val())){
  664. alert("숫자만 입력 가능합니다.");
  665. $("#"+obj).focus();
  666. return true;
  667. }else{
  668. var time = Number($("#"+obj).val());
  669. if(type == "HH"){
  670. if(time < -1 || time> 23){
  671. alert("0~23 까지 입력 가능합니다.");
  672. $("#"+obj).focus();
  673. return true;
  674. }
  675. }else if(type == "MI"){
  676. if(time < -1 || time> 59){
  677. alert("0~59 까지 입력 가능합니다.");
  678. $("#"+obj).focus();
  679. return true;
  680. }
  681. }
  682. }
  683. if($("#"+obj).val().length == 1){
  684. var timelength = $("#"+obj).val();
  685. $("#"+obj).val("0"+timelength);
  686. }
  687. return false;
  688. }
  689. //첨부파일
  690. function doAttachFile(obj,No) {
  691. var file_div = "quot/purchase/"+"<%=Order.get("QUOT_BID_NO")%>"+"/";
  692. var fileName = "견적_";
  693. var upLoadFlg = "Y";
  694. if(<%=Order.get("STATUS_CD")%> == "02" || <%=Order.get("STATUS_CD")%> == "10"){
  695. upLoadFlg = "N";
  696. }
  697. if(obj.value==''){
  698. alert("견적 생성 후, 파일을 첨부할 수가 있습니다.");
  699. }else if(obj != ''){
  700. if(No == 1){
  701. fileName += "내부자료";
  702. viewFileListNew("QUOT_FILE_IN_"+obj.value, obj.value, document.form1.p_AttachFile1, upLoadFlg, file_div, null, null, null, null, "N", fileName);
  703. }else{
  704. fileName += "첨부자료";
  705. viewFileListNew("QUOT_FILE_OUT_"+obj.value, obj.value, document.form1.p_AttachFile2, upLoadFlg, file_div, null, null, null, null, "N", fileName);
  706. }
  707. }
  708. }
  709. function doResult(resultObj) {
  710. try {
  711. if( resultObj.getRequestEvent() == "SAVE_QUOT_DETAIL") {
  712. if( resultObj.getSuccess() ) {
  713. alert("생성 되었습니다.");
  714. $("#btn_list").click();
  715. }
  716. else {
  717. dlgErrorMsg(resultObj);
  718. }
  719. }
  720. if( resultObj.getRequestEvent() == "UPDATE_QUOT_DETAIL") {
  721. if( resultObj.getSuccess() ) {
  722. alert("저장 되었습니다.");
  723. save_detail_sheet();
  724. }
  725. else {
  726. dlgErrorMsg(resultObj);
  727. }
  728. }
  729. if( resultObj.getRequestEvent() == "SEND_QUOT_DETAIL") {
  730. if( resultObj.getSuccess() ) {
  731. alert("전송 되었습니다.");
  732. save_detail_sheet();
  733. }
  734. else {
  735. alert("첨부자료를 등록하시기 바랍니다.");
  736. //dlgErrorMsg(resultObj);
  737. reSearch();
  738. }
  739. }
  740. if( resultObj.getRequestEvent() == "FORM_DELETE") {
  741. if( resultObj.getSuccess() ) {
  742. alert("삭제 되었습니다.");
  743. $("#btn_list").click();
  744. }
  745. else {
  746. dlgErrorMsg(resultObj);
  747. }
  748. }
  749. if( resultObj.getRequestEvent() == "STATUS_QUOT_DETAIL") {
  750. if( resultObj.getSuccess() ) {
  751. alert("견적서 수정이 가능합니다.");
  752. reSearch();
  753. }
  754. else {
  755. dlgErrorMsg(resultObj);
  756. }
  757. }
  758. if( resultObj.getRequestEvent() == "FINISH_QUOT_DETAIL") {
  759. if( resultObj.getSuccess() ) {
  760. alert("견적 마감 되었습니다.");
  761. reSearch();
  762. }
  763. else {
  764. dlgErrorMsg(resultObj);
  765. }
  766. }
  767. } catch(errorObject) {
  768. showErrorDlg("doResult()", errorObject);
  769. }
  770. }
  771. function sheet1_OnSaveEnd(code, msg)
  772. {
  773. var event = $("#fevent").val();
  774. if(event == "SAVE_SUPP_DETAIL"){
  775. if(code>= "0"){
  776. reSearch();
  777. }else{
  778. alert(msg);
  779. }
  780. }else if(event == "SET_CORP_DELETE"){
  781. if(code>= "0"){
  782. alert("삭제 되었습니다.");
  783. reSearch();
  784. }else{
  785. alert(msg);
  786. }
  787. }else if( event == "RESEND_QUOT_DETAIL") {
  788. if(code>= "0"){
  789. alert("재전송 되었습니다.");
  790. reSearch();
  791. }else{
  792. alert(msg);
  793. }
  794. }else if( event == "SAVE_DETAIL") {
  795. if(code>= "0"){
  796. alert("수정 되었습니다.");
  797. reSearch();
  798. }else{
  799. alert(msg);
  800. }
  801. }
  802. else{
  803. if(code>= "0"){
  804. }else{
  805. alert("에러가 발생하였습니다.\n\n"+msg);
  806. }
  807. }
  808. }
  809. function reSearch() {
  810. jQuery("#fevent").val("GET_QUOT_DETAIL");
  811. jQuery("#form1").attr("action", "/quot/purchase/QuotPurPlan.screen");
  812. jQuery("#form1").attr("target", "_self");
  813. jQuery("#form1").attr("method", "post");
  814. jQuery("#form1").submit();
  815. }
  816. function sheet1_OnSmartResize(Width, Height) {
  817. sheet1.FitColWidth();
  818. autoResize();
  819. }
  820. function autoResize(){
  821. sheet1.SetSheetHeight(300);
  822. }
  823. function sheet1_OnDblClick(Row, Col, Value, CellX, CellY, CellW, CellH) {
  824. if(Row == 0)return;
  825. if(sheet1.ColSaveName(Col) == "SITE_ATTEND_YN"){
  826. if(sheet1.GetCellValue(Row,"SITE_ATTEND_YN") == "N") {
  827. $("#fevent").val("GET_QUOT_SUPP_DETAIL");
  828. var win_id = "_QuotAmtPop";
  829. var quot_id = jQuery("#quot_id").val();
  830. var link = "/quot/outside/QuotAmtPop.screen";
  831. link += "?pop_win_id="+win_id;
  832. link += "&ROW="+Row;
  833. link += "&VENDOR_CD="+sheet1.GetCellValue(Row,"VENDOR_CD");
  834. link += "&QUOT_ID="+quot_id;
  835. link += "&QUOT_BID_NO="+sheet1.GetCellValue(Row,"QUOT_BID_NO");
  836. link += "&QUOT_BID_DEG="+sheet1.GetCellValue(Row,"QUOT_BID_DEG");
  837. link += "&FILE_GB="+sheet1.GetCellValue(Row,"FILE_GB");
  838. link += "&VENDOR_NAME="+sheet1.GetCellValue(Row,"VENDOR_NAME");
  839. link += "&ESTI_TOT_AMT="+sheet1.GetCellValue(Row,"ESTI_TOT_AMT");
  840. link += "&SITE_ATTEND_YN="+sheet1.GetCellValue(Row,"SITE_ATTEND_YN");
  841. link += "&sModule=LM";
  842. //fLayerPop(win_id, link, 1000,400, '', '', 'NO');
  843. window.open(link,win_id,"toolbar=no, width=1000, height=460, top=50, left=40, toolbar=no,directories=no,status=no,scrollbars=yes,resize=no,menubar=no,target=new");
  844. }
  845. }
  846. else if(sheet1.ColSaveName(Col) == "ESTI_TOT_AMT"){
  847. if(jQuery("#quot_id").val() == "") {
  848. alert("견적 생성 후 선택 할 수 있습니다.");
  849. return;
  850. }else if(sheet1.GetCellValue(Row,"ON_SUPP_YN") == "N" || sheet1.GetCellValue(Row,"IN_OUT_DIV") == "O"){ //견적용업체 및 해외업체인 경우
  851. //견적용 업체
  852. $("#fevent").val("GET_QUOT_SUPP_DETAIL");
  853. var win_id = "_QuotAmtPop";
  854. var quot_id = jQuery("#quot_id").val();
  855. var link = "/quot/outside/QuotAmtPop.screen";
  856. link += "?pop_win_id="+win_id;
  857. link += "&ROW="+Row;
  858. link += "&VENDOR_CD="+sheet1.GetCellValue(Row,"VENDOR_CD");
  859. link += "&QUOT_ID="+quot_id;
  860. link += "&QUOT_BID_NO="+sheet1.GetCellValue(Row,"QUOT_BID_NO");
  861. link += "&QUOT_BID_DEG="+sheet1.GetCellValue(Row,"QUOT_BID_DEG");
  862. link += "&FILE_GB="+sheet1.GetCellValue(Row,"FILE_GB");
  863. link += "&VENDOR_NAME="+sheet1.GetCellValue(Row,"VENDOR_NAME");
  864. link += "&ESTI_TOT_AMT="+sheet1.GetCellValue(Row,"ESTI_TOT_AMT");
  865. link += "&SITE_ATTEND_YN="+sheet1.GetCellValue(Row,"SITE_ATTEND_YN");
  866. link += "&ON_SUPP_YN="+sheet1.GetCellValue(Row,"ON_SUPP_YN");
  867. link += "&IN_OUT_DIV="+sheet1.GetCellValue(Row,"IN_OUT_DIV");
  868. link += "&sModule=LM";
  869. //fLayerPop(win_id, link, 1000,400, '', '', 'NO');
  870. window.open(link,win_id,"toolbar=no, width=1000, height=460, top=50, left=40, toolbar=no,directories=no,status=no,scrollbars=yes,resize=no,menubar=no,target=new");
  871. }else if(sheet1.GetCellValue(Row,"SUBMIT_DT") == "미제출"){
  872. alert("해당업체는 견적 미제출 상태입니다.");
  873. return;
  874. }else if(sheet1.GetCellValue(Row,"SITE_ATTEND_YN") == "N"){
  875. alert("해당업체는 견적 불참 업체입니다.");
  876. return;
  877. }else{
  878. $("#fevent").val("GET_QUOT_SUPP_DETAIL");
  879. var win_id = "_QuotAmtPop";
  880. var quot_id = jQuery("#quot_id").val();
  881. var link = "/quot/outside/QuotAmtPop.screen";
  882. link += "?pop_win_id="+win_id;
  883. link += "&ROW="+Row;
  884. link += "&VENDOR_CD="+sheet1.GetCellValue(Row,"VENDOR_CD");
  885. link += "&QUOT_ID="+quot_id;
  886. link += "&QUOT_BID_NO="+sheet1.GetCellValue(Row,"QUOT_BID_NO");
  887. link += "&QUOT_BID_DEG="+sheet1.GetCellValue(Row,"QUOT_BID_DEG");
  888. link += "&FILE_GB="+sheet1.GetCellValue(Row,"FILE_GB");
  889. link += "&VENDOR_NAME="+sheet1.GetCellValue(Row,"VENDOR_NAME");
  890. link += "&ESTI_TOT_AMT="+sheet1.GetCellValue(Row,"ESTI_TOT_AMT");
  891. link += "&SITE_ATTEND_YN="+sheet1.GetCellValue(Row,"SITE_ATTEND_YN");
  892. link += "&ON_SUPP_YN="+sheet1.GetCellValue(Row,"ON_SUPP_YN");
  893. link += "&sModule=LM";
  894. //fLayerPop(win_id, link, 1000,400, '', '', 'NO');
  895. window.open(link,win_id,"toolbar=no, width=1000, height=400, top=50, left=40, toolbar=no,directories=no,status=no,scrollbars=yes,resize=no,menubar=no,target=new");
  896. }
  897. }else if(sheet1.ColSaveName(Col) == "FILE_DOWN"){
  898. if(jQuery("#quot_id").val() == "") {
  899. alert("견적 생성 후 선택 할 수 있습니다.");
  900. return;
  901. }else if(sheet1.GetCellValue(Row,"SUBMIT_DT") == "미제출"){
  902. alert("해당업체는 견적 미제출 상태입니다.");
  903. return;
  904. }else{
  905. var file_name = sheet1.GetCellValue(Row,"QUOT_BID_NO")+"("+sheet1.GetCellValue(Row,"VENDOR_NAME")+")";
  906. fileDown(file_name, sheet1.GetCellValue(Row,"FILE_GB"));
  907. }
  908. }
  909. }
  910. function fileDown(file_id, file_gb){
  911. var fileName = file_id;
  912. var url="/common/file/FileDownloadServlet";
  913. url += "?mode=zipDown";
  914. url += "&fileName=" + encodeURIComponent(fileName);
  915. url += "&fileGB=" + file_gb;
  916. url += "&ID=<%=Order.get("quot_id")%>";
  917. 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")
  918. }
  919. function textareaResize(obj) {
  920. obj.style.height = "80px";
  921. obj.style.height = obj.scrollHeight+"px";
  922. }
  923. </SCRIPT>
  924. <modular:search id="form1">
  925. <modular:key id="fevent" />
  926. </modular:search>
  927. <form id="form1" name="form1" method="post" modular:type="search">
  928. <INPUT type='hidden' name="fevent" id="fevent" value="">
  929. <!-- List Search -->
  930. <INPUT type="hidden" name="p_dept_nm" id="p_dept_nm" value="<%= Order.get("dept_nm") %>">
  931. <INPUT type="hidden" name="p_dept_cd" id="p_dept_cd" value="<%= Order.get("dept_cd") %>">
  932. <!-- List Search -->
  933. <INPUT type='hidden' name="QUOT_BID_NO" value="<%=Order.get("QUOT_BID_NO")%>">
  934. <INPUT type='hidden' name="QUOT_BID_DEG" value="<%=Order.get("QUOT_BID_DEG")%>">
  935. <INPUT type='hidden' name="QUOT_TYPE" value="<%=Order.get("QUOT_TYPE")%>">
  936. <INPUT type='hidden' name="STATUS_CD" value="<%=Order.get("STATUS_CD")%>">
  937. <INPUT type="hidden" name="quot_id" value="<%= params.get("quot_id") %>">
  938. <INPUT type='hidden' name="REQUEST_DEPT_CD" value="<%=Order.get("REQUEST_DEPT_CD")%>">
  939. <INPUT type='hidden' name="QUOT_KIND" value="P">
  940. <INPUT type='hidden' name="SAVE" value="">
  941. <INPUT type='hidden' name="DOC_ETC_IN" value="<%=Order.get("DOC_ETC_IN")%>">
  942. <INPUT type='hidden' name="DOC_ETC_OUT" value="<%=Order.get("DOC_ETC_OUT")%>">
  943. <INPUT type='hidden' name="WARR_CONDI" value="견적의뢰일로 부터">
  944. <!-- 제목 및 버튼 -->
  945. <table width="100%">
  946. <colgroup>
  947. <col width="500" />
  948. <col width="*" />
  949. </colgroup>
  950. <tr>
  951. <th>
  952. <div align="left" id="title">
  953. <ul><li>구매_견적 계획 상세<font style="font-size:11px">(<%=Order.get("STATUS_NM")%>)</font></li></ul>
  954. </div>
  955. </th>
  956. <td align="right">
  957. <span class="btnSearch center"><a href="javascript:void(0);" id="btn_Save">저장</a></span>
  958. <span class="btnSearch center"><a href="javascript:void(0);" id="btn_Request">견적요청</a></span>
  959. <span class="btnSearch center"><a href="javascript:void(0);" id="btn_Create">생성</a></span>
  960. <span class="btnSearch center"><a href="javascript:void(0);" id="btn_del">삭제</a></span>
  961. <span class="btnSearch center"><a href="javascript:void(0);" id="btn_back">견적회수</a></span>
  962. <span class="btnSearch center"><a href="javascript:void(0);" id="btn_finish">견적마감</a></span>
  963. <span class="btnSearch center"><a href="javascript:void(0);" id="btn_list">목록</a></span>
  964. </td>
  965. </tr>
  966. </table>
  967. <!-- 견적정보 : 시작 -->
  968. <div class="application-info magT10">
  969. <div class="application-sub-title">
  970. <span class="title">견적의뢰정보</span>
  971. </div>
  972. </div>
  973. <TABLE class="form-table">
  974. <colgroup>
  975. <col width="150"/>
  976. <col width="21%">
  977. <col width="150"/>
  978. <col width="20%">
  979. <col width="160"/>
  980. <col/>
  981. </colgroup>
  982. <TR height="25">
  983. <TH>현장</TH>
  984. <TD><%=Order.get("dept_nm") %></TD>
  985. <TH>견적번호</TH>
  986. <TD><%=Order.get("quot_bid_no") %></TD>
  987. <TH class="required">견적명</TH>
  988. <TD><%= InputText.get("QUOT_BID_MASTER_NM", Order.get("QUOT_BID_MASTER_NM"), 45, 300, "desc=견적명") %> </TD>
  989. </TR>
  990. <TR height="25">
  991. <TH class="required">견적의뢰일자</TH>
  992. <TD><%= InputText.get("REQUEST_DATE", Order.get("REQUEST_DATE"), 10, 10, "desc=견적의뢰일자,center,readOnly") %>
  993. <IMG name="start_img" src="/img/buyer/button/bt_calender.gif" border="0" align="absmiddle" style="cursor:pointer;" onClick="JavaScript:dlgCalendar('REQUEST_DATE');"></TD>
  994. <TH>견적의뢰부서</TH>
  995. <TD><%= InputText.get("REQUEST_DEPT_NM", Order.get("REQUEST_DEPT_NM"), 45, 70, "desc=견적의뢰부서,readOnly") %> </TD>
  996. <TH class="required">견적의뢰자</TH>
  997. <TD><%= InputText.get("REQUEST_MAN_NM", Order.get("REQUEST_MAN_NM"), 21, 50, "desc=견적설명담당자,readOnly") %><INPUT type='hidden' name="REQUEST_MAN_ID" value="<%=Order.get("REQUEST_MAN_ID")%>">
  998. <IMG id="btn_request_man_id" src="/img/buyer/button/bt_search_right.gif" alt="담당자" border="0" align="absmiddle" style="cursor:pointer;" onClick="JavaScript:SearchUser('REQUEST_MAN_NM','REQUEST_MAN_ID','N');">
  999. </TD>
  1000. </TR>
  1001. <TR height="25">
  1002. <TH class="required">사업주</TH>
  1003. <TD><%= InputText.get("DEALER_NM", Order.get("DEALER_NM"), 45, 50, "desc=사업주") %> </TD>
  1004. <TH>CM/감리사</TH>
  1005. <TD><%= InputText.get("SUPERVISOR", Order.get("SUPERVISOR"), 45, 50, "desc=CM/감리사") %> </TD>
  1006. <TH class="required">현장위치</TH>
  1007. <TD><%= InputText.get("WORK_PLACE", Order.get("WORK_PLACE"), 45, 250, "desc=현장위치") %> </TD>
  1008. </TR>
  1009. <TR height="25">
  1010. <TH class="required">공사기간</TH>
  1011. <TD><%= InputText.get("START_WORK_DATE", Order.get("START_WORK_DATE"), 10, 10, "desc=공사기간,readOnly,center") %>
  1012. <IMG name="start_img" src="/img/buyer/button/bt_calender.gif" border="0" align="absmiddle" style="cursor:pointer;" onClick="JavaScript:dlgCalendar('START_WORK_DATE');">
  1013. <%-- <%if(!Order.get("START_WORK_DATE").isEmpty()||!Order.get("END_WORK_DATE").isEmpty()){ %>~<%} %> --%>
  1014. ~
  1015. <%= InputText.get("END_WORK_DATE", Order.get("END_WORK_DATE"), 10, 10, "desc=공사기간,readOnly,center") %>
  1016. <IMG name="start_img" src="/img/buyer/button/bt_calender.gif" border="0" align="absmiddle" style="cursor:pointer;" onClick="JavaScript:dlgCalendar('END_WORK_DATE');">
  1017. </TD>
  1018. <TH>공사규모</TH>
  1019. <TD><%= InputText.get("WORK_SIZE", Order.get("WORK_SIZE"), 45, 250, "desc=공사규모") %> </TD>
  1020. <TH class="required">공종</TH>
  1021. <TD><%= InputText.get("ITEM_NM", Order.get("ITEM_NM"), 45, 150, "desc=공종") %> </TD>
  1022. </TR>
  1023. </TABLE>
  1024. <!-- 견적정보 : 시작 -->
  1025. <div class="application-info magT10">
  1026. <div class="application-sub-title">
  1027. <span class="title">견적기본정보</span>
  1028. </div>
  1029. </div>
  1030. <TABLE class="form-table">
  1031. <colgroup>
  1032. <col width="150"/>
  1033. <col width="21%">
  1034. <col width="150"/>
  1035. <col width="20%">
  1036. <col width="160"/>
  1037. <col/>
  1038. </colgroup>
  1039. <TR height="25">
  1040. <TH class="required">견적제출기간</TH>
  1041. <TD><%= InputText.get("QUOT_BID_FROM_DT", Order.get("QUOT_BID_FROM_DT"), 10, 10, "desc=견적제출기간,readOnly,center") %>
  1042. <IMG name="start_img" src="/img/buyer/button/bt_calender.gif" border="0" align="absmiddle" style="cursor:pointer;" onClick="JavaScript:dlgCalendar('QUOT_BID_FROM_DT');">
  1043. <%= InputText.get("QUOT_BID_FROM_HH", Order.get("QUOT_BID_FROM_HH"), 2, 2, "desc=견적제출기간,Time,center") %> :
  1044. <%= InputText.get("QUOT_BID_FROM_MI", Order.get("QUOT_BID_FROM_MI"), 2, 2, "desc=견적제출기간,Time,center") %>
  1045. ~
  1046. <%= InputText.get("QUOT_BID_TO_DT", Order.get("QUOT_BID_TO_DT"), 10, 10, "desc=견적제출기간,readOnly,center") %>
  1047. <IMG name="start_img" src="/img/buyer/button/bt_calender.gif" border="0" align="absmiddle" style="cursor:pointer;" onClick="JavaScript:dlgCalendar('QUOT_BID_TO_DT');">
  1048. <%= InputText.get("QUOT_BID_TO_HH", Order.get("QUOT_BID_TO_HH"), 2, 2, "desc=견적제출기간,Time,center") %> :
  1049. <%= InputText.get("QUOT_BID_TO_MI", Order.get("QUOT_BID_TO_MI"), 2, 2, "desc=견적제출기간,Time,center") %>
  1050. </TD>
  1051. <TH>견적유효기간</TH>
  1052. <TD><%= InputText.get("QUOT_VALIDATE", Order.get("QUOT_VALIDATE"), 45, 50, "desc=공사규모") %> </TD>
  1053. <TH class="required">견적담당자</TH>
  1054. <TD>
  1055. <%= InputText.get("QUOT_MAN_NM", Order.get("QUOT_MAN_NM"), 21, 30, "desc=견적담당자,readOnly") %><INPUT type='hidden' name="QUOT_MAN_ID" value="<%=Order.get("QUOT_MAN_ID")%>">
  1056. <IMG id="btn_quot_man_id" src="/img/buyer/button/bt_search_right.gif" alt="담당자" border="0" align="absmiddle" style="cursor:pointer;" onClick="JavaScript:SearchUser('QUOT_MAN_NM','QUOT_MAN_ID','Y');">
  1057. </TD>
  1058. </TR>
  1059. <TR height="25">
  1060. <TH class="required">담당자 전화번호</TH>
  1061. <TD><%= InputText.get("QUOT_MAN_TELNO", Order.get("QUOT_MAN_TELNO"), 15, 20, "desc=견적담당자 전화번호") %></TD>
  1062. <TH class="required">담당자 E-Mail</TH>
  1063. <TD><%= InputText.get("QUOT_MAN_EMAIL", Order.get("QUOT_MAN_EMAIL"), 45, 50, "desc=견적담당자 E-Mail") %></TD>
  1064. <TH>담당자 FAX</TH>
  1065. <TD><%= InputText.get("QUOT_MAN_FAX", Order.get("QUOT_MAN_FAX"), 15, 20, "desc=견적담당자 FAX") %>
  1066. </TR>
  1067. <TR height="25">
  1068. <TH class="required">견적설명회 여부</TH>
  1069. <TD>
  1070. <LABEL for="sitedesc_flag_1"><INPUT id="sitedesc_flag_1" type="radio" name="QUOT_SITEDESC_FLAG" value="Y" desc="견적설명여부" <%=Order.get("QUOT_SITEDESC_FLAG").equals("Y") ? "checked=\"checked\"" : "" %>> 예</LABEL>
  1071. <LABEL for="sitedesc_flag_2"><INPUT id="sitedesc_flag_2" type="radio" name="QUOT_SITEDESC_FLAG" value="N" desc="견적설명여부" <%=Order.get("QUOT_SITEDESC_FLAG").equals("N") ? "checked=\"checked\"" : "" %>> 아니오</LABEL>
  1072. </TD>
  1073. <TH>견적설명회 일시</TH>
  1074. <TD>
  1075. <%= InputText.get("QUOT_SITEDESCDATE", Order.get("QUOT_SITEDESCDATE"), 10, 10, "desc=견적설명회,readOnly,center") %>
  1076. <IMG name="calendar_sitedescdate" id="calendar_sitedescdate" src="/img/buyer/button/bt_calender.gif" border="0" align="absmiddle" style="cursor:pointer;" onClick="JavaScript:dlgCalendar('QUOT_SITEDESCDATE');">
  1077. <%= InputText.get("QUOT_SITEDESCDATE_HH", Order.get("QUOT_SITEDESCDATE_HH"), 2, 2, "desc=견적설명회,Time,center") %> :
  1078. <%= InputText.get("QUOT_SITEDESCDATE_MI", Order.get("QUOT_SITEDESCDATE_MI"), 2, 2, "desc=견적설명회,Time,center") %>
  1079. </TD>
  1080. <TH>견적설명회 장소</TH>
  1081. <TD><%= InputText.get("QUOT_SITEDESCPLACE", Order.get("QUOT_SITEDESCPLACE"), 15, 20, "desc=견적설명회 장소") %> </TD>
  1082. </TR>
  1083. </TABLE>
  1084. <div class="application-info magT20">
  1085. <div class="application-sub-title">
  1086. <span class="title">견적조건</span>
  1087. </div>
  1088. </div>
  1089. <TABLE class="form-table" style="margin-top:5px">
  1090. <colgroup>
  1091. <col width="150"/>
  1092. <col width="50%"/>
  1093. <col width="150"/>
  1094. <col width="*"/>
  1095. <!-- <col width="29%"/>
  1096. <col width="145"/>
  1097. <col/> -->
  1098. </colgroup>
  1099. <TR height="100">
  1100. <TH class="required">특이사항</TH>
  1101. <TD>
  1102. <textarea name="OUTER_REMARKS" id="OUTER_REMARKS" style="width:98%; height:80px; overflow-y:auto" maxlength="1000" class="input byteChk ctrlTarget" onkeyup="textareaResize(this)"><%=Order.get("OUTER_REMARKS")%></textarea>
  1103. </TD>
  1104. <TH>특이사항<br>(해외업체)</TH>
  1105. <TD>
  1106. <textarea name="INNER_REMARKS" id="INNER_REMARKS" style="width:98%; height:80px; overflow-y:auto" maxlength="1000" class="input byteChk ctrlTarget" onkeyup="textareaResize(this)"><%=Order.get("INNER_REMARKS")%></textarea>
  1107. </TD>
  1108. </TR>
  1109. <TR height="100">
  1110. <%-- <TH>내부자료</TH>
  1111. <TD colspan="2">
  1112. <TEXTAREA name="p_AttachFile1" id="p_AttachFile1" style="width:85%;height:80px" rows="1" class="input" readOnly><%=filein.get("DOC_ETC_IN") %></TEXTAREA>
  1113. <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;'>
  1114. </TD> --%>
  1115. <TH class="required">첨부자료</TH>
  1116. <TD colspan="3">
  1117. <TEXTAREA name="p_AttachFile2" id="p_AttachFile2" style="width:85%;height:80px" rows="1" class="input" readOnly><%=fileout.get("DOC_ETC_OUT") %></TEXTAREA>
  1118. <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;'>
  1119. </TD>
  1120. </TR>
  1121. <TR height="10">
  1122. <!-- <TH colspan="3">
  1123. </TH> -->
  1124. <TH>대용량파일 link</TH>
  1125. <TD colspan="3"><%= InputText.get("URL_COL", Order.get("URL_COL"), 150, 150, "desc=대용량파일 링크주소") %></TD>
  1126. </TR>
  1127. </TABLE>
  1128. <table id=copr_list width="100%">
  1129. <colgroup>
  1130. <col width="500" />
  1131. <col width="*" />
  1132. </colgroup>
  1133. <tr>
  1134. <th>
  1135. <div class="application-info magT20">
  1136. <div class="application-sub-title">
  1137. <span class="title">견적대상업체</span>
  1138. </div>
  1139. </div>
  1140. </th>
  1141. <td align="right">
  1142. <span class="btnSearch center"><a href="javascript:void(0);" id="quot_corp_add">견적용 업체추가</a></span>
  1143. <span class="btnSearch center"><a href="javascript:void(0);" id="corp_add">추가</a></span>
  1144. <span class="btnSearch center"><a href="javascript:void(0);" id="btn_row_del">삭제</a></span>
  1145. <span class="btnSearch center"><a href="javascript:void(0);" id="btn_row_save">저장</a></span>
  1146. <span class="btnSearch center"><a href="javascript:void(0);" id="btn_resend">재전송</a></span>
  1147. </td>
  1148. </tr>
  1149. </table>
  1150. <div id="sheet1_div" style="padding-top:5px;height: auto; min-height: 200px; overflow: auto;">
  1151. <script>createIBSheet('sheet1','100%', '200px');</script>
  1152. </div>
  1153. </form>