123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493 |
- <%--
- - FileName : SYSInputStandardCodeList.jsp
- - Author : gyeongmo an
- - Date : 2014.08.01
- - Copyright : Copyright (c) 2014 www.udapsoft.co.kr, Inc.
- - All rights reserved.
- - Description: 기준코드 등록
- --%>
- <%@ page contentType="text/html; charset=utf-8" %>
- <%@ page import="com.udapsoft.waf.system.HandlerStorage" %>
- <%@ page import="com.udapsoft.waf.common.ui.*" %>
- <%@ page import="kr.co.udapsoft.common.code.*" %>
- <%@ page import="kr.co.hsnc.common.util.*"%>
- <%@ page import="kr.co.hsnc.common.sql.*" %>
- <%@ include file="/jsp/work/taglib.jsp" %>
- <jsp:useBean id="ctx" class="com.udapsoft.waf.system.context.SessionContext" scope="session" />
- <%
- ctx.init(request, response);
- HandlerStorage storage = ctx.getHandlerStorage();
-
- ValueObject params = storage.getParams();
- ValueObject user = storage.getUser();
- String fevent = storage.getEvent();
-
- %>
- <SCRIPT language="javascript" src="/active_x/sheet/IBSheetInfo.js"></SCRIPT>
- <SCRIPT language="JavaScript">
- /*예약함수*/
- var sheet1;
- var sheet1Row;
- var sheet1PageNo = 1;
- var sheet2;
- var sheet2Row;
- var sheet2PageNo = 1;
- var pageLastRowIndex = 1;
- var validationResult = false;
- var filterShow = false;
- //마지막으로 선택된 행의 번호를 기억하고 있음
- var CurMasterRow = 0;
- var CurMasterRow1 = 0;
- function _onReady(){
- grid1Init(sheet1);
- grid2Init(sheet2);
- jQuery("#btnExplanationAdd").click(function() {
-
- /*
- var f = document.form1;
-
- var colNames ="";
- var colTexts ="";
-
- // 컬럼SAVENAME 가져오기 : 숨김컬럼 제외, check이름가진 컬럼 제외, sort_no이름가진 컬럼 제외
- colNames = "DETAILCD|DETAILNM|DETAILSORTNM|CHG_CODE01|CHG_CODE02|CHG_CODE03|CHG_CODE04|CHG_CODE05|"+
- "CHG_CODE06|CHG_CODE07|CHG_CODE08|CHG_CODE09|CHG_CODE10|CHG_CODE11|CHG_CODE12|CHG_CODE13|CHG_CODE14|CHG_CODE15|CHG_CODE16|CHG_CODE17|"+
- "CHG_CODE18|CHG_CODE19|CHG_CODE20|REMARK";
-
- // 컬럼명 가져오기
- colTexts = "내역코드|내역코드명|약어명|변환코드01|변환코드02|변환코드03|변환코드04|변환코드05|변환코드06|변환코드07"+
- "|변환코드08|변환코드09|변환코드10|변환코드11|변환코드12|변환코드13|변환코드14|변환코드15|변환코드16|변환코드17|변환코드18|변환코드19|변환코드20"+
- "|REMARK|기준코드";
-
- var arg = new Array();
-
- arg[0] = this.window; // window
- arg[1] = sheet2; // SHEET 명
- arg[2] = colNames; // ColName
- arg[3] = colTexts; // ConText
-
- var m_result = window.showModalDialog("/sycs/code/CommCodeDescList.screen?fevent=GET_DESC&p_table_nm=COM911T&p_base_cd="+f.p_basecd.value, arg, 'dialogWidth:800px;dialogHeight:450px; center:yes; help:no; status:no; scroll:auto; resizable:yes');
-
- */
- var f = document.form1;
- var win_id = "_searchCommCodeDescList";
- var link = "/sycs/code/CommCodeDescList.screen";
- link += "?pop_win_id="+win_id+"&p_table_nm=COM911T&p_base_cd="+f.p_basecd.value;
- fLayerPop(win_id, link, 800,400, '', '', 'NO');
-
- });
-
- jQuery("#btnSearch").click(function() {
- // 기준코드상세목록 조회
- setWorkGubun('M');
-
- // 기준코드목록 조회
- jQuery("#fevent").val("GET_STANDARDCODE_LIST");
- var url = Modular.model.PageContext.CONTEXT_ROOT + "/sycs/code/SYSInputStandardCodeList_sheet.screen";
- Modular.view.IBSheet7.doSearch(sheet1, url, jQuery("#form1"), 10, "");
- });
-
- jQuery("#btnAdd").click(function() {
- var f = document.form1;
- var msg = '기준코드가 없습니다. 기준코드 목록을 선택하세요.';
- if (f.work_gubun.value == 'M') { // 기준코드목록에 추가
- f.p_basecd.value = "";
- doInsert_code_list(sheet1);
- } else if (f.work_gubun.value == 'D') { // 기준코드상세목록에 추가
- if (f.p_basecd.value == '') {
- alert(msg);
- return;
- }
- doInsert_detail_list(sheet2);
- }
- });
-
- jQuery("#btnSave").click(function() {
- if(sheet1.RowCount("I") > 0 || sheet1.RowCount("U") > 0 || sheet1.RowCount("D") > 0) {
- CurMasterRow1 = sheet1.GetSelectRow();
- doSave1();
- }
-
- if(sheet2.RowCount("I") > 0 || sheet2.RowCount("U") > 0 || sheet2.RowCount("D") > 0) {
- doSave2();
- }
- });
- autoResize();
-
- jQuery("#btnSearch").click();
- }
- function doSave1() {
- jQuery("#fevent").val("SAVE_STANDARDCODE_LIST");
- var url = Modular.model.PageContext.CONTEXT_ROOT + "/sycs/code/SYSInputStandardCodeList_sheet.screen";
- var result = Modular.view.IBSheet7.doSave(sheet1, url, jQuery("#form1"), false);
- }
- function doSave2() {
- //순번 다시 지정
- if(sheet2.RowCount("D") > 0){
- var temp_no = 1;
- for(i=1; i<=sheet2.RowCount(); i++){
- if(sheet2.GetCellValue(i, "STATUS") != "D") {
- if(sheet2.GetCellText(i,"SORT_NO") != temp_no){
- sheet2.SetCellText(i,"SORT_NO", temp_no);
- sheet2.SetCellValue(i, "STATUS", "U");
- }
- temp_no++
- }
- }
- }
-
- jQuery("#fevent").val("SAVE_STANDARDCODEDETAIL_LIST");
- var url = Modular.model.PageContext.CONTEXT_ROOT + "/sycs/code/SYSInputStandardCodeListDetail_sheet.screen";
- var result = Modular.view.IBSheet7.doSave(sheet2, url, jQuery("#form1"), false);
- }
- function searchCommCodeDescList(){
- fLayerPopClose('_searchCommCodeDescList');
- }
- function grid1Init(sheetName){
- var init_sheet = {};
- init_sheet.Cfg = {SearchMode:2, Page:10};
- init_sheet.Cols = [
- {Header:'삭제', Type:"DelCheck", SaveName:"DEL_CHECK", Width:50, Align:"Center"},
- {Header:'순번', Type:"Seq", SaveName:"NO", Width:50, Align:"Center"},
- {Header:'Status', Type:"Status", SaveName:"STATUS", Width:0, Align:"Center", Hidden:"True"},
- {Header:'기준코드', Type:"Text", SaveName:"BASECD", Width:200, Align:"Center", EditLen:20, KeyField:"True"},
- {Header:'기준코드명', Type:"Text", SaveName:"BASENM", Width:350, Align:"Left", EditLen:200},
- {Header:'정렬방법', Type:"Combo", SaveName:"SORT_METHOD", Width:80, Align:"Center", ComboText:"순번|코드명|한글명|영문명|등록일시", ComboCode:"1|2|3|4|5", Hidden:"True"},
- {Header:'길이', Type:"Text", SaveName:"BASELENGTH", Width:60, Align:"Center"},
- {Header:'비고', Type:"Text", SaveName:"REMARK", Width:500, Align:"Left", EditLen:1000}
- ];
- init_sheet.HeaderMode = {Sort:1};
- IBS_InitSheet(sheetName, init_sheet);
- sheetName.SetDataAutoTrim(0);
- //sheetName.SetEditable(false);
-
- setGrid1Size();
- }
- function grid2Init(sheetName){
- var init_sheet = {};
- init_sheet.Cfg = {SearchMode:2, Page:10};
- init_sheet.Cols = [
- {Header:'삭제', Type:"DelCheck", SaveName:"DEL_CHECK", Width:50, Align:"Center"},
- {Header:'순번', Type:"Text", SaveName:"NO", Width:40, Align:"Center", Hidden:"True"},
- {Header:'상태', Type:"Status", SaveName:"STATUS", Width:0, Align:"Center", Hidden:"True"},
- {Header:'순번', Type:"Text", SaveName:"SORT_NO", Width:50, Align:"Center"},
- {Header:'내역코드', Type:"Text", SaveName:"DETAILCD", Width:80, Align:"Center", EditLen:10, KeyField:"True"},
- {Header:'내역코드명', Type:"Text", SaveName:"DETAILNM", Width:200, Align:"Left", EditLen:200, KeyField:"True"},
- {Header:'약어명', Type:"Text", SaveName:"DETAILSORTNM", Width:150, Align:"Left", EditLen:100},
- {Header:'변환코드01', Type:"Text", SaveName:"CHG_CODE01", Width:150, Align:"Left", EditLen:100},
- {Header:'변환코드02', Type:"Text", SaveName:"CHG_CODE02", Width:150, Align:"Left", EditLen:100},
- {Header:'변환코드03', Type:"Text", SaveName:"CHG_CODE03", Width:150, Align:"Left", EditLen:100},
- {Header:'변환코드04', Type:"Text", SaveName:"CHG_CODE04", Width:150, Align:"Left", EditLen:100},
- {Header:'변환코드05', Type:"Text", SaveName:"CHG_CODE05", Width:150, Align:"Left", EditLen:100},
- {Header:'변환코드06', Type:"Text", SaveName:"CHG_CODE06", Width:150, Align:"Left", EditLen:100},
- {Header:'변환코드07', Type:"Text", SaveName:"CHG_CODE07", Width:150, Align:"Left", EditLen:100},
- {Header:'변환코드08', Type:"Text", SaveName:"CHG_CODE08", Width:150, Align:"Left", EditLen:100},
- {Header:'변환코드09', Type:"Text", SaveName:"CHG_CODE09", Width:150, Align:"Left", EditLen:100},
- {Header:'변환코드10', Type:"Text", SaveName:"CHG_CODE10", Width:150, Align:"Left", EditLen:100},
- {Header:'변환코드11', Type:"Text", SaveName:"CHG_CODE11", Width:150, Align:"Left", EditLen:100},
- {Header:'변환코드12', Type:"Text", SaveName:"CHG_CODE12", Width:150, Align:"Left", EditLen:100},
- {Header:'변환코드13', Type:"Text", SaveName:"CHG_CODE13", Width:150, Align:"Left", EditLen:100},
- {Header:'변환코드14', Type:"Text", SaveName:"CHG_CODE14", Width:150, Align:"Left", EditLen:100},
- {Header:'변환코드15', Type:"Text", SaveName:"CHG_CODE15", Width:150, Align:"Left", EditLen:100},
- {Header:'변환코드16', Type:"Text", SaveName:"CHG_CODE16", Width:150, Align:"Left", EditLen:100},
- {Header:'변환코드17', Type:"Text", SaveName:"CHG_CODE17", Width:150, Align:"Left", EditLen:100},
- {Header:'변환코드18', Type:"Text", SaveName:"CHG_CODE18", Width:150, Align:"Left", EditLen:100},
- {Header:'변환코드19', Type:"Text", SaveName:"CHG_CODE19", Width:150, Align:"Left", EditLen:100},
- {Header:'변환코드20', Type:"Text", SaveName:"CHG_CODE20", Width:150, Align:"Left", EditLen:100},
- {Header:'REMARK', Type:"Text", SaveName:"REMARK", Width:150, Align:"Left", EditLen:1000},
- {Header:'기준코드', Type:"Text", SaveName:"BASECD", Width:80, Align:"Center", Hidden:"True", EditLen:20}
- ];
- init_sheet.HeaderMode = {Sort:1};
- IBS_InitSheet(sheetName, init_sheet);
- sheetName.SetDataAutoTrim(0);
- //sheetName.SetEditable(false);
-
- //setGrid2Size();
- }
- function sheet1_OnSearchEnd(code, message) {
- if(code == 0) {
- setGrid1Size();
- // 조회시 기준코드목록의 첫번째 기준코드 코드값을 얻어온다.
- if(CurMasterRow1 < 1) {
- sheet1.SetSelectRow(1);
- getBaseCode(1, 3 );
- } else {
- sheet1.SetSelectRow(CurMasterRow1);
- getBaseCode(CurMasterRow1, 3 );
- }
- CurMasterRow1 = 1;
- //마지막으로 선택된 행이 없음
- CurMasterRow= 0;
- doSearch_detail_list();
- } else {
- //조회 에러 수행
- alert(message);
- }
- }
- function sheet2_OnSearchEnd(code, message) {
- if(code == 0) {
- //setGrid2Size();
- /*
- var title = sheet2.GetEtcData("head_title");
- alert(title);
- var titleSplit = title.split('|');
- for(var i = 0; i < titleSplit.length; i++) {
- sheet2.SetCellText(0, i) = titleSplit[i];
- }
- */
-
- } else {
- //조회 에러 수행
- alert(message);
- }
- }
- function sheet1_OnSaveEnd(code, msg) {
- if(code >= 0) {
- alert("기준코드목록을 처리 완료했습니다.");
- jQuery("#btnSearch").click();
- } else {
- alert(msg);
- }
- }
- function sheet2_OnSaveEnd(code, msg) {
- if(code >= 0) {
- alert("상세내역을 처리 완료했습니다.");
- doSearch_detail_list();
- } else {
- alert(msg);
- }
- }
- /**
- * IBSheet size setting
- */
- function setGrid1Size() {
- sheet1.FitColWidth();
- }
- function setGrid2Size() {
- sheet2.FitColWidth();
- }
- // 선택된 기준코드를 설정
- function getBaseCode(row, col ) {
- var f = document.form1;
- sText = sheet1.GetCellText(row,col);
- f.p_basecd.value = sText;
- }
-
- // 기준코드목록 또는 기준코드상세목록 설정(기준코드목록 : 'M', 기준코드상세목록 : 'D')
- function setWorkGubun(workgubun) {
- var f = document.form1;
- f.work_gubun.value = workgubun;
- }
- // 기준목록에 대한 detail 목록 조회
- function doSearch_detail_list() {
- var f = document.form1;
- f.isSubmit = false;
- jQuery("#fevent").val("GET_STANDARDCODEDETAIL_LIST");
- var url = Modular.model.PageContext.CONTEXT_ROOT + "/sycs/code/SYSInputStandardCodeListDetail_sheet.screen";
- Modular.view.IBSheet7.doSearch(sheet2, url, jQuery("#form1"), 10, "");
- }
-
- // 기준자료 목록 레코드추가
- function doInsert_code_list(sheetObj) {
- var f = document.form1;
- sheetObj.DataAutoTrim = false;
- var rowIndex = sheetObj.DataInsert();
- f.p_basecd.value = "";
- sheet2.RemoveAll();
-
- sheet1.SelectCell(rowIndex, 3, false, false);
-
-
- }
-
- // 기준목록에 대한 detail 목록 레코드추가
- function doInsert_detail_list(sheetObj) {
- var f = document.form1;
- var msg = '기준코드 목록을 기준코드를 등록하세요.';
- if(f.p_basecd.value == "") {
- alert(msg);
- return;
- }
- sheetObj.DataAutoTrim = false;
- var rowIndex = sheetObj.DataInsert();
-
- //경영정보 고도화 코드통합 작업 순번 추가 2010.09.06
- sheetObj.SetCellText(rowIndex,"SORT_NO", sheetObj.RowCount());
- sheetObj.SetCellText(rowIndex,"BASECD", f.p_basecd.value);
- setWorkGubun('D');
- sheet2.SelectCell(rowIndex, 3, false, false);
- }
-
- /*조회조건 에터키 이력시 조회*/
- function check_Enter(sheetObj)
- {
- if (event.keyCode==13){
- jQuery("#btnSearch").click();
- }
- }
-
- function sheet1_OnClick(Row, Col, Value, CellX, CellY, CellW, CellH) {
- // 현재선택한 체크박스이면 이전거는 지우고 현재것만 체크함.
- var sName = sheet1.ColSaveName(0, Col);
- if ( sName == "DEL_CHECK") {
- if (sheet1.CheckedRows(0) > 0) {
- var sRow = sheet1.FindStatusRow("D");
- // 받은 결과를 배열로 생성한다.
- var arRow = sRow.split(";");
-
- for(var i=0; i<arRow.length; i++) {
- if(Row != arRow[i]) {
- sheet1.SetCellValue(arRow[i],0, 0 );
- }
- }
- }
- }
- // 기준코드목록클릭시 해당로우의 기준코드 코드값을 얻어온다.
- getBaseCode(Row, 3 );
-
- setWorkGubun('M');
-
- if (CurMasterRow != Row) {
- // 기준코드 상세목록에 입력/수정/삭제된 데이터가 한건이라도 있으면 저장함수를 호출한다.
- if(sheet2.RowCount("I") > 0 || sheet2.RowCount("U") > 0 || sheet2.RowCount("D") > 0) {
- if( confirm("기준코드 상세목록을 저장하시겠습니까?")) {
- doSave2();
- }
- }
- // 마스터가 세로 생긴로우인지를 체크한다.
- if(sheet1.GetCellValue(Row, "STATUS") != "I") {
- doSearch_detail_list();
- } else {
- sheet2.RemoveAll();
- }
- sheet1.SelectCell(Row, Col, false, Value);
- }
- // 마지막으로 선택된 행을 저장한다.
- CurMasterRow = Row;
- }
-
-
- function sheet2_OnClick(Row, Col, Value, CellX, CellY, CellW, CellH) {
- setWorkGubun('D');
- // 마지막으로 선택된 행을 0 으로 설정한다.
- CurMasterRow = 0;
- }
-
- function sheet2_OnMouseDown(Button, Shift, X, Y) {
- setWorkGubun('D');
- // 마지막으로 선택된 행을 0 으로 설정한다.
- CurMasterRow = 0;
- }
-
- function sheet1_OnChange(Row, Col, Value, OldValue, RaiseFlag) {
- if(sheet1.ColSaveName(0, Col) == "BASECD") {
- if(sheet1.GetCellValue(Row, "STATUS") != "I") {
- alert("기준코드는 수정할 수 없습니다.");
- sheet1.SetCellValue(Row, Col, OldValue, 0);
- return;
-
- }
-
- }
- }
-
- function sheet2_OnChange(Row, Col, Value, OldValue, RaiseFlag) {
- if(sheet2.ColSaveName(0, Col) == "DETAILCD") {
- if(sheet2.GetCellValue(Row, "STATUS") != "I") {
- alert("내역코드는 수정할 수 없습니다.");
- sheet2.SetCellValue(Row, Col, OldValue, 0);
- return;
-
- }
-
- }
- }
-
-
-
- function sheet1_OnSmartResize(Width, Height) {
- sheet1.FitColWidth();
- autoResize();
- }
- function autoResize(){
- var t1_height = document.getElementById("search-table").scrollHeight + document.getElementById("title").scrollHeight + 24;
- var iframeHeight= document.body.scrollHeight - t1_height - 350;
- sheet1.SetSheetHeight(iframeHeight);
- }
-
- document.body.onresize = addEvent( document.body.onresize, "autoResize()");
- </SCRIPT>
- <modular:search id="form1">
- <modular:key id="fevent" />
- </modular:search>
- <form id="form1" name="form1" method="post" modular:type="search" style="width:100%;height:100%;">
- <INPUT type="hidden" name="fevent">
- <input type=hidden name=p_basecd value="">
- <input type=hidden name=work_gubun value='M'>
- <input type=hidden name=work_flag value='F'>
- <input type=hidden name=title value="">
- <INPUT type="hidden" name="p_table_nm" value="COM911T">
- <INPUT type="hidden" name="p_head_nm" value="">
- <INPUT type="hidden" name="p_save_nm" value="">
- <div align="left" id="title">
- <ul>
- <li>기준코드 등록</li>
- </ul>
- </div>
- <!-- 검색조건 시작 -->
- <table id="search-table" class="search-form-table">
- <colgroup>
- <col width="100" />
- <col width="*" />
- <col width="300" />
- </colgroup>
- <tr>
- <th>기준코드명</th>
- <td>
- <INPUT type="text" name='p_basenm' class="input" value="<%= params.get("p_basenm") %>" style="width:60%" >
- </td>
- <td class="button" rowspan="2">
- <span class="btnSearch center"><a href="javascript:void(0);" id="btnExplanationAdd">설명추가</a></span>
- <span class="btnSearch center"><a href="javascript:void(0);" id="btnSearch">검색</a></span>
- <span class="btnSearch center"><a href="javascript:void(0);" id="btnAdd">추가</a></span>
- <span class="btnSearch center"><a href="javascript:void(0);" id="btnSave">저장</a></span>
- </td>
- </tr>
- </table>
- <!-- 검색조건 종료 -->
- <div id="sheet1_div" style="padding-top:5px; height: auto; min-height: 400px; overflow: auto;">
- <script>createIBSheet('sheet1','100%', '400px');</script>
- </div>
- <br/>
- <div id="sheet2_div" style="padding-top:5px; height: auto; min-height: 280px; overflow: auto;">
- <script>createIBSheet('sheet2','100%', '280px');</script>
- </div>
- </FORM>
|