| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325 |
- <!DOCTYPE html>
- <html lang="ko"
- xmlns:th="http://www.thymeleaf.org">
- <!--
- *******************************************************************************
- * @source : SupplyVendorForm.html
- * @desc : 공급벤더관리 Page
- *============================================================================
- * STYLE24
- * Copyright(C) 2020 TSIT, All rights reserved.
- *============================================================================
- * VER DATE AUTHOR DESCRIPTION
- * === =========== ========== =============================================
- * 1.0 2021.01.18 gagamel 최초 작성
- *******************************************************************************
- -->
- <div id="main">
- <!-- 메인타이틀 영역 -->
- <div class="main-title">
- </div>
- <!-- //메인타이틀 영역 -->
-
- <!-- 메뉴 설명 -->
- <div class="infoBox menu-desc">
- </div>
- <!-- //메뉴 설명 -->
-
- <!-- 검색조건 영역 -->
- <div class="panelStyle">
- <form id="searchForm" name="searchForm" action="#" th:action="@{'/business/supply/vendor/list'}" onsubmit="$('#btnSearch').trigger('click'); return false;">
- <table class="frmStyle" aria-describedby="검색조건">
- <colgroup>
- <col style="width:10%;"/>
- <col/>
- </colgroup>
- <tr>
- <th>검색어</th>
- <td>
- <select name="searchGb">
- <option value="NAME">벤더명</option>
- <option value="OWNER">대표자명</option>
- </select>
- <input type="text" name="searchTxt" class="w300" maxlength="20"/>
- </td>
- </tr>
- </table>
-
- <ul class="panelBar">
- <li class="center">
- <button type="button" class="btn btn-base btn-lg" id="btnSearch">조회</button>
- <button type="button" class="btn btn-gray btn-lg" onclick="$('#searchForm')[0].reset();">초기화</button>
- </li>
- </ul>
- </form>
- </div>
- <!-- 검색조건 영역 -->
- <!-- 리스트 영역 -->
- <div class="panelStyle">
- <!-- 버튼 배치 영역 -->
- <ul class="panelBar">
- <li class="right">
- <button type="button" class="btn btn-default btn-lg" id="btnExcel">엑셀다운로드</button>
- </li>
- </ul>
- <!-- //버튼 배치 영역 -->
-
- <div id="gridList" style="width: 100%; height: 470px" class="ag-theme-balham"></div>
- </div>
- <!-- //리스트 영역 -->
-
- <!-- 등록/수정 -->
- <div class="panelStyle">
- <form id="detailForm" name="detailForm" action="#" th:action="@{'/business/supply/vendor/save'}">
- <table class="frmStyle" aria-describedby="등록/수정 폼">
- <colgroup>
- <col style="width:10%;"/>
- <col style="width:15%;"/>
- <col style="width:10%;"/>
- <col style="width:15%;"/>
- <col style="width:10%;"/>
- <col style="width:15%;"/>
- <col style="width:10%;"/>
- <col style="width:15%;"/>
- </colgroup>
- <tr>
- <th>벤더코드</th>
- <td>
- <input type="text" class="w150" name="supplyVendorCd" placeholder="자동생성" maxlength="6" data-valid-name="벤더코드" readonly="readonly"/>
- </td>
- <th>벤더명<i class="required" title="필수"></i></th>
- <td>
- <input type="text" name="supplyVendorNm" maxlength="100" required="required" data-valid-name="벤더명"/>
- </td>
- <th>사업자구분<i class="required" title="필수"></i></th>
- <td>
- <label class="rdoBtn"><input type="radio" name="bizGb" value="C" checked="checked"/>법인<span></span></label>
- <label class="rdoBtn"><input type="radio" name="bizGb" value="P"/>개인<span></span></label>
- </td>
- <th>사업자등록번호<i class="required" title="필수"></i></th>
- <td>
- <input type="text" class="w150" name="bizNo" maxlength="20" required="required" data-valid-name="사업자등록번호"/>
- <button type="button" class="btn btn-info btn-sm" onclick="fnCertifyBizNo();">인증</button>
- </td>
- </tr>
- <tr>
- <th>업종<i class="required" title="필수"></i></th>
- <td>
- <input type="text" name="bizKind" maxlength="100" required="required" data-valid-name="업종"/>
- </td>
- <th>업태<i class="required" title="필수"></i></th>
- <td>
- <input type="text" name="bizType" maxlength="100" required="required" data-valid-name="업태"/>
- </td>
- <th>대표자명<i class="required" title="필수"></i></th>
- <td>
- <input type="text" name="ownerNm" maxlength="50" required="required" data-valid-name="대표자명"/>
- </td>
- <th>대표전화<i class="required" title="필수"></i></th>
- <td>
- <input type="text" name="mainTelno" placeholder="02-0000-0000" maxlength="20" required="required" data-valid-name="대표전화"/>
- </td>
- </tr>
- <tr>
- <th>대표팩스번호</th>
- <td>
- <input type="text" name="mainFaxno" placeholder="02-0000-0000" maxlength="20" data-valid-name="대표팩스번호"/>
- </td>
- <th>사업장주소<i class="required" title="필수"></i></th>
- <td colspan="5">
- <input type="text" name="bizZipcode" class="w100" data-valid-name="우편번호" readonly="readonly"/>
- <button type="button" class="btn btn-info btn-sm" onclick="fnOpenDaumAddr();">우편번호찾기</button>
- <input type="text" name="bizBaseAddr" class="w300" maxlength="200" required="required" data-valid-name="사업장주소" readonly="readonly"/>
- <input type="text" name="bizDtlAddr" class="w300" maxlength="200"/>
- </td>
- </tr>
- <tr>
- <th>홈페이지URL</th>
- <td colspan="5">
- <input type="text" class="w300" name="homepageUrl" data-valid-name="홈페이지URL"/>
- </td>
- <th>사용여부<i class="required" title="필수"></i></th>
- <td>
- <label class="rdoBtn"><input type="radio" name="useYn" value="Y" checked="checked"/>Yes<span></span></label>
- <label class="rdoBtn"><input type="radio" name="useYn" value="N"/>No<span></span></label>
- </td>
- </tr>
- </table>
- </form>
-
- <!-- 버튼 배치 영역 -->
- <ul class="panelBar">
- <li class="right">
- <button type="button" class="btn btn-info btn-lg" id="btnNew">신규</button>
- <button type="button" class="btn btn-success btn-lg" id="btnSave">저장</button>
- </li>
- </ul>
- <!-- //버튼 배치 영역 -->
- </div>
- <!-- 등록/수정 -->
- </div>
- <script th:inline="javascript">
- /*<![CDATA[*/
- let columnDefs = [
- { headerName: "벤더코드", field: "supplyVendorCd", width: 100, cellClass: 'text-center' },
- {
- headerName: "벤더명", field: "supplyVendorNm", width: 150, cellClass: 'text-center',
- cellRenderer: function(params) {
- return '<a href="javascript:void(0);">' + params.value + '</a>';
- }
- },
- {
- headerName: "사업자구분", field: "bizGb", width: 100, cellClass: 'text-center',
- valueGetter: function (params) { return params.data.bizGb == 'C' ? '법인' : '개인'; }
- },
- { headerName: "사업자등록번호", field: "bizNo", width: 120, cellClass: 'text-center' },
- { headerName: "업종", field: "bizKind", width: 150, cellClass: 'text-center' },
- { headerName: "업태", field: "bizType", width: 150, cellClass: 'text-center' },
- { headerName: "대표자명", field: "ownerNm", width: 100, cellClass: 'text-center' },
- { headerName: "대표전화번호", field: "mainTelno", width: 120, cellClass: 'text-center' },
- { headerName: "대표팩스번호", field: "mainFaxno", width: 120, cellClass: 'text-center' },
- { headerName: "우편번호", field: "bizZipcode", width: 80, cellClass: 'text-center' },
- { headerName: "기본주소", field: "bizBaseAddr", width: 250 },
- { headerName: "상세주소", field: "bizDtlAddr", width: 150 },
- { headerName: "홈페이지URL", field: "homepageUrl", width: 200 }
- ];
- let gridOptions = gagaAgGrid.getGridOptions(columnDefs);
- // Cell click
- gridOptions.onCellClicked = function(event) {
- if (event.colDef.field != 'supplyVendorNm')
- return;
-
- $('#detailForm input[name=supplyVendorCd]').val(event.data.supplyVendorCd);
- $('#detailForm input[name=supplyVendorNm]').val(event.data.supplyVendorNm);
-
- if (event.data.bizGb == 'C') {
- $('#detailForm input:radio[name=bizGb]').eq(0).trigger('click');
- } else {
- $('#detailForm input:radio[name=bizGb]').eq(1).trigger('click');
- }
-
- $('#detailForm input[name=bizNo] ').val(event.data.bizNo);
- $('#detailForm input[name=bizKind]').val(event.data.bizKind);
- $('#detailForm input[name=bizType]').val(event.data.bizType);
- $('#detailForm input[name=ownerNm]').val(event.data.ownerNm);
- $('#detailForm input[name=mainTelno]').val(event.data.mainTelno);
- $('#detailForm input[name=mainFaxno]').val(event.data.mainFaxno);
- $('#detailForm input[name=bizZipcode]').val(event.data.bizZipcode);
- $('#detailForm input[name=bizBaseAddr]').val(event.data.bizBaseAddr);
- $('#detailForm input[name=bizDtlAddr]').val(event.data.bizDtlAddr);
- $('#detailForm input[name=homepageUrl]').val(event.data.homepageUrl);
-
- if (event.data.useYn == 'Y') {
- $('#detailForm input:radio[name=useYn]').eq(0).trigger('click');
- } else {
- $('#detailForm input:radio[name=useYn]').eq(1).trigger('click');
- }
- fnUnEscapeHtml(); //XSS변환
- }
- // 검색
- $('#btnSearch').on('click', function() {
- gagaAgGrid.fetch($('#searchForm').prop('action'), gridOptions, '#searchForm',fnChangeGrid);
- });
-
- // 신규버튼
- $('#btnNew').on('click', function() {
- $("#detailForm")[0].reset();
- });
- // 저장
- $("#btnSave").on("click", function() {
- // 필수값 체크
- if (!gagajf.validation('#detailForm'))
- return false;
- mcxDialog.confirm("저장하시겠습니까?", {
- cancelBtnText: "취소",
- sureBtnText: "확인",
- sureBtnClick: function() {
- gagajf.ajaxFormSubmit($('#detailForm').prop('action'), '#detailForm', function() {
- $('#btnNew').trigger('click');
- $('#btnSearch').trigger('click');
- });
- }
- });
- });
-
- // 엑셀다운로드
- $('#btnExcel').on('click', function() {
- gagaAgGrid.exportToExcel('공급벤더 목록', gridOptions);
- });
- /**
- * DAUM을 이용한 우편번호 팝업 레이어
- */
- var fnOpenDaumAddr = function() {
- let daumZip = new daum.Postcode({
- oncomplete: function(data) {
- // 우편번호와 주소 정보를 해당 필드에 넣는다.
- $('#detailForm input[name=bizZipcode]').val(data.zonecode);
- $('#detailForm input[name=bizBaseAddr]').val(cfnGetDaumRoadAddr(data));
- $('#detailForm input[name=bizDtlAddr]').focus();
-
- cfnCloseDaumAddr();
- },
- width: '100%'
- });
-
- cfnOpenDaumAddr(daumZip);
- }
-
- var fnUnEscapeHtml = function(){ //XSS 변환
- $('#detailForm input[name=supplyVendorNm]').val($('#detailForm input[name=supplyVendorNm]').val().replaceXSS());
- $('#detailForm input[name=bizNo]').val($('#detailForm input[name=bizNo]').val().replaceXSS());
- $('#detailForm input[name=bizKind]').val($('#detailForm input[name=bizKind]').val().replaceXSS());
- $('#detailForm input[name=bizType]').val($('#detailForm input[name=bizType]').val().replaceXSS());
- $('#detailForm input[name=ownerNm]').val($('#detailForm input[name=ownerNm]').val().replaceXSS());
- $('#detailForm input[name=mainTelno]').val($('#detailForm input[name=mainTelno]').val().replaceXSS());
- $('#detailForm input[name=mainFaxno]').val($('#detailForm input[name=mainFaxno]').val().replaceXSS());
- $('#detailForm input[name=bizDtlAddr]').val($('#detailForm input[name=bizDtlAddr]').val().replaceXSS());
- $('#detailForm input[name=homepageUrl]').val($('#detailForm input[name=homepageUrl]').val().replaceXSS());
- };
-
-
- var fnChangeGrid = function(){ //XSS 그리드 내 변환
- var data = gagaAgGrid.getAllRowData(gridOptions);
- let modifyList = [];
- $.each(data, function(idx, item) {
- if(item.bizDtlAddr != null && item.bizDtlAddr != '' && item.bizDtlAddr != 'undefined'){
- let bizDtlAddr = item.bizDtlAddr;
- item.bizDtlAddr = bizDtlAddr.replaceXSS();
-
- }
- let bizNo = item.bizNo;
- let bizKind = item.bizKind;
- let bizType = item.bizType;
- let ownerNm = item.ownerNm;
- let mainTelno = item.mainTelno;
- let mainFaxno = item.mainFaxno;
- let homepageUrl = item.homepageUrl;
- item.bizNo = bizNo.replaceXSS();
- item.bizKind = bizKind.replaceXSS();
- item.bizType = bizType.replaceXSS();
- item.ownerNm = ownerNm.replaceXSS();
- item.mainTelno = mainTelno.replaceXSS();
- item.mainFaxno = mainFaxno.replaceXSS();
- item.homepageUrl = homepageUrl.replaceXSS();
- modifyList.push(item);
- });
- gridOptions.api.setRowData(modifyList);
- };
-
- $(document).ready(function() {
- // Create a agGrid
- gagaAgGrid.createGrid('gridList', gridOptions);
- });
- /*]]>*/
- </script>
- </html>
|