123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399 |
- <%@ 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.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);
- ValueObject user = ctx.getUser();
- String USER_ID = user.get("USER_ID");
- HandlerStorage storage = ctx.getHandlerStorage();
- ValueObject params = storage.getParams();
-
- String sect_id = (String) storage.getObject("sect_id");
- String level = (String) storage.getObject("level");
-
- String code = (String) storage.getObject("code");
- String kind_big = (String) params.get("kind_big");
- String kind_mid = (String) params.get("kind_mid");
- String kind_small = (String) params.get("kind_small");
-
- //중점관리여부
- String stock_flag_yn = (String) storage.getObject("selectStockText");
- String stock_flag_yn_code = (String) storage.getObject("selectStockValue");
-
- stock_flag_yn = stock_flag_yn.substring(0, stock_flag_yn.lastIndexOf("|"));
- stock_flag_yn_code = stock_flag_yn_code.substring(0, stock_flag_yn_code.lastIndexOf("|"));
-
-
- //사용여부
- String is_use_yn = "사용|미사용";
- String is_use_yn_code = "Y|N";
-
- //입고계획여부
- String stock_plan_flag_yn = "사용|미사용";
- String stock_plan_flag_yn_code = "Y|N";
-
- //단위
- String selectText = (String) storage.getObject("selectText");
- String selectValue = (String) storage.getObject("selectValue");
-
- //price_flag
- String price_flg_yn = "예|아니오";
- String price_flg_yn_code = "Y|N";
-
- String pay_div_yn = "납품정산|계획분할";
- String pay_div_yn_code = "1|2";
-
- %>
- <script type="text/javascript">
- <!--
- /*예약함수*/
- var sheet1 = new ibsheetObject();
- var sheet1Row;
- var sheet1PageNo = 1;
- var pageLastRowIndex = 1;
- var validationResult = false;
- var filterShow = false;
- $(function(){
-
- $.gridInit = function(sheetName)
- {
- var init_sheet = {};
-
- init_sheet.Cfg = {SearchMode:2, Page:30, MergeSheet:msHeaderOnly};
- init_sheet.Cols = [
- {Header:"Status", Type:"Status", SaveName:"STATUS", Width:0, Align:"Center", Hidden:"True"},
- {Header:"삭제", Type:"DelCheck", SaveName:"DEL_CHECK", Width:50, Align:"Center", Hidden:"True"},
- {Header:"No.", Type:"Seq", SaveName:"NO", Width:30, Align:"Center"},
- {Header:"자재코드", Type:"Text", SaveName:"MATERIAL_CD", Width:60, Align:"Center", KeyField:"True",InsertEdit:"False", UpdateEdit:"False"},
- {Header:"자재명", Type:"Text", SaveName:"MATERIAL_NAME", Width:150, Align:"Left", KeyField:"True"},
- {Header:"규격", Type:"Text", SaveName:"MATERIAL_SPEC", Width:150, Align:"Left", KeyField:"True"},
- {Header:"단위", Type:"Combo", SaveName:"UNIT_KIND", Width:40, Align:"Left", ComboText:"<%=selectText%>", ComboCode:"<%=selectValue%>", KeyField:"True"},
- {Header:"leadTime", Type:"Text", SaveName:"LEAD_TIME", Width:60, Align:"Center", KeyField:"True"},
- {Header:"중점관리여부", Type:"Combo", SaveName:"STOCK_FLAG", Width:80, Align:"Center", ComboText:"<%=stock_flag_yn%>", ComboCode:"<%=stock_flag_yn_code%>", KeyField:"True"},
- {Header:"사용여부", Type:"Combo", SaveName:"IS_USE", Width:60, Align:"Center", ComboText:"<%=is_use_yn%>", ComboCode:"<%=is_use_yn_code%>", KeyField:"True"},
- {Header:"입고계획여부", Type:"Combo", SaveName:"STOCK_PLAN_FLAG", Width:80, Align:"Center", ComboText:"<%=stock_plan_flag_yn%>", ComboCode:"<%=stock_plan_flag_yn_code%>", KeyField:"True"},
- {Header:"가입고여부", Type:"Combo", SaveName:"PRICE_FLG", Width:70, Align:"Center", ComboText:"<%=price_flg_yn%>", ComboCode:"<%=price_flg_yn_code%>", KeyField:"True"},
- {Header:"지급구분", Type:"Combo", SaveName:"PAY_DIV", Width:70, Align:"Center", ComboText:"<%=pay_div_yn%>", ComboCode:"<%=pay_div_yn_code%>", KeyField:"True"}
- ];
-
-
- init_sheet.HeaderMode = {Sort:1};
- IBS_InitSheet(sheetName, init_sheet);
- sheetName.SetDataAutoTrim(0);
- sheetName.SetEditable(true);
- sheetName.SetDataLinkMouse("MATERIAL_NAME");
- // sheetName.SetColFontColor("CORP_KOR", "#0000ff");
- sheetName.FitColWidth();
- }
-
-
-
-
- $(document).on("keyup", "input:text", function(e) {
-
- if (e.keyCode == 13)
- {
- $.searchList();
- }
-
- });
-
-
- $.searchList = function()
- {
- $("#fevent").val("GET_CODE_LIST");
-
- var url = Modular.model.PageContext.CONTEXT_ROOT + "/common/CommMatlCodeList_data.screen";
- Modular.view.IBSheet7.doSearch(sheet1, url, $("#form1"), 30, "");
- }
-
- $("#btn_search").click(function(){
- $.searchList();
- });
-
- $("#btn_save").click(function(){
- $("#fevent").val("SAVE_CODE_LIST");
-
- var url = Modular.model.PageContext.CONTEXT_ROOT + "/common/CommMatlCodeList_process.screen";
- var result = Modular.view.IBSheet7.doSave(sheet1, url, $("#form1"), false);
- });
-
-
- $("#btn_add").click(function(){
- var level = "<%=level%>";
- var kind_small = "<%=kind_small%>";
- var material_cd = "";
- var material_cd1 = "";
- var seq = "";
- if(level == "3")
- {
- if (sheet1.SearchRows() == 0 && (sheet1.RowCount("I") == 0))
- {
- sheet1.SetDataAutoTrim(0);
- var rowIndex = sheet1.DataInsert(-1);
- sheet1.SetCellValue(rowIndex, "MATERIAL_CD", kind_small + leadingZeros("001",3));
- }
- else
- {
- sheet1.SetDataAutoTrim(0);
- var rowIndex = sheet1.DataInsert(-1);
- //2020.01.10 코드가 9자리 10자리가 같이 사용되면서 문자타입으로 최대값 비교가 안되는 문제 발생하여 수정
- //material_cd = sheet1.GetCellValue(rowIndex -1, "MATERIAL_CD");
- material_cd = sheet1.GetCellValue(1, "MATERIAL_CD");
- for (var i = 2; i <= sheet1.RowCount(); i++){
- if(Number(material_cd) < Number(sheet1.GetCellValue(i, "MATERIAL_CD"))){
- material_cd = sheet1.GetCellValue(i, "MATERIAL_CD");
- }
- }
- material_cd1 = material_cd.substring(0, material_cd.length -3);
- seq = Number(material_cd.substring(material_cd.length -3, material_cd.length)) + 1;
- sheet1.SetCellValue(rowIndex, "MATERIAL_CD", material_cd1 + leadingZeros(seq,3));
- }
- sheet1.SetCellValue(rowIndex, "LEAD_TIME", "1");
- sheet1.SetCellValue(rowIndex, "PRICE_FLG", "N");
- }else{
- alert("소분류를 선택하세요.");
- }
- });
-
-
- $("#btn_category_reg").click(function(){
-
- var level = "<%=level%>";
- var kind_big = "<%=kind_big%>";
- var kind_mid = "<%=kind_mid%>";
- var kind_small = "<%=kind_small%>";
-
- if(level == "3")
- {
- alert("더이상 하위 카테고리를 등록할 수 없습니다.");
- return;
- }else{
- var win_id = "_categoryReg";
- var url = "/common/MatlCategoryAddPopup.screen?cate_gubun=L&level="+level+"&kind_big="+kind_big+"&kind_mid="+kind_mid+"&kind_small="+kind_small+"&pop_win_id="+win_id;
-
- fLayerPop(win_id, url, 550, 100, '', '', 'NO');
-
- }
- });
-
-
- $("#btn_category_del").click(function(){
-
- var level = "<%=level%>";
- var kind_big = "<%=kind_big%>";
- var kind_mid = "<%=kind_mid%>";
- var kind_small = "<%=kind_small%>";
-
- var f = document.form1;
- if(level != "")
- {
- if (confirm("삭제 하시겠습니까?") )
- {
- submitXmlRequest( "/common/CommMatlCodeDelete_form.screen", "DELETE_CODE_LIST", f, "ROWSET" ); //xmlhttp.js
- }
- }
- else
- {
- alert("분류코드가 선택되지 않았습니다.");
- return;
- }
- });
-
-
- $("#btn_excel").click(function(){
-
- var params = {FileName:"공통자재코드.xls",SheetName:"공통자재코드",Merge:1,SheetDesign:1, HiddenColumn:1 };
- sheet1.Down2Excel (params);
-
- });
-
-
- $("#btn_treeList").click(function(){
-
- var win_id = "_treeList";
- var url = "/common/CommMatlCodeTreeList.screen?pop_win_id="+win_id;
- fLayerPop(win_id, url, 620, 470, '', '', 'NO');
-
-
- });
-
-
- $("#btn_reset").click(function(){
- $("input:text").val("");
- });
-
- });
- $(document).ready(function(){
-
- $.gridInit(sheet1);
- $.searchList();
-
- autoResize();
-
-
- });
- function autoResize(){
- var t1_height = document.getElementById("search-table").scrollHeight + document.getElementById("title").scrollHeight + 24;
- var iframeHeight= document.body.scrollHeight - t1_height;
- var iframeWidth= document.body.scrollWidth;
-
-
- sheet1.SetSheetHeight(iframeHeight);
- }
- function leadingZeros(n, digits) {
- var zero = '';
- n = n.toString();
-
- if (n.length < digits) {
- for (var i = 0; i < digits - n.length; i++)
- zero += '0';
- }
- return zero + n;
- }
- function sheet1_OnSearchEnd(code, message)
- {
- sheet1.FitColWidth();
- }
- function sheet1_OnSaveEnd(code, msg)
- {
- var event = $("#fevent").val();
- var f = document.form1;
-
- document.form1.isSubmit = false;
-
- try {
- if(event == "SAVE_CODE_LIST")
- {
- if(code >= "0")
- {
- alert("저장되었습니다.");
- $.searchList();
- }
- else
- {
-
- }
- }
- }
- catch(errorObject) {
- showErrorDlg("doResult()", errorObject);
- }
- }
-
-
- function doResult(resultObj) {
- try {
- if( resultObj.getRequestEvent() == "DELETE_CODE_LIST" ) {
- if( resultObj.getSuccess() ) {
- alert("삭제되었습니다.");
- parent.tree.location.reload(true);
- }
- else {
- alert(resultObj);
- }
- document.form1.isSubmit = false;
- }
- }
- catch(errorObject) {
- showErrorDlg("doResult()", errorObject);
- }
- }
-
- //-->
- </script>
- <modular:search id="form1">
- <modular:key id="fevent" />
- </modular:search>
- <form id="form1" name="form1" method="post" modular:type="search">
- <input type="hidden" name="fevent" id="fevent" value="">
- <input type="hidden" name="USER_ID" value="<%=USER_ID%>"/>
- <input type="hidden" name="sect_id" value = "<%=sect_id %>" />
- <input type="hidden" name="level" value = "<%=level %>" />
- <input type="hidden" name="code" value = "<%=code %>" />
- <input type="hidden" name="kind_big" value = "<%=kind_big %>" />
- <input type="hidden" name="kind_mid" value = "<%=kind_mid %>" />
- <input type="hidden" name="kind_small" value = "<%=kind_small %>" />
- <div align="left" id="title">
- <ul>
- <li>공통자재코드</li>
- </ul>
- </div>
-
-
- <table border="0" cellspacing="0" cellpadding="0" width="98%" id="search-table">
- <!-- 검색조건 영역 : 시작 -->
- <tr>
- <td height="1">
- <table cellspacing="1" cellpadding="0" class="search-form-table">
- <col width="10%">
- <col width="30%">
- <col width="60%">
- <tr height="25">
- <!-- 검색조건 타이틀 1 -->
- <th>
- 자재코드/명
- </th>
- <td>
- <input type='text' name="pgm_name2" class="input" style="width:90%" />
- </td>
- <td rowspan="2" class="search_button" align="center">
- <span class="btnSearch center"><a href="javascript:void(0);" id="btn_search">검색</a></span>
- <span class="btnSearch center"><a href="javascript:void(0);" id="btn_add">추가</a></span>
- <span class="btnSearch center"><a href="javascript:void(0);" id="btn_save">저장</a></span>
- <span class="btnSearch center"><a href="javascript:void(0);" id="btn_category_reg">분류코드</a></span>
- <span class="btnSearch center"><a href="javascript:void(0);" id="btn_category_del">분류코드 삭제</a></span>
- <span class="btnSearch center"><a href="javascript:void(0);" id="btn_reset">초기화</a></span>
- <span class="btnSearch center"><a href="javascript:void(0);" id="btn_excel">엑셀다운</a></span>
- <span class="btnSearch center"><a href="javascript:void(0);" id="btn_treeList">양식다운</a></span>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <!-- 검색조건 영역 : 종료 -->
- <!-- 검색조건 영역, 테이터 영역 구분 여백 : 시작 -->
- <tr>
- <td height="1">
- </td>
- </tr>
- <!-- 검색조건 영역, 테이터 영역 구분 여백 : 종료 -->
- </table>
- <div id="sheet1_div" style="padding-top:5px; width:98%; height: 400px">
- <script>createIBSheet("sheet1","100%", "400px");</script>
- </div>
- </form>
|