| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308 |
- <!DOCTYPE html>
- <html lang="ko"
- xmlns:th="http://www.thymeleaf.org">
- <!--
- *******************************************************************************
- * @source : DailyTradingForm.html
- * @desc : 일일거래내역 Page
- *============================================================================
- * STYLE24
- * Copyright(C) 2020 TSIT, All rights reserved.
- *============================================================================
- * VER DATE AUTHOR DESCRIPTION
- * === =========== ========== =============================================
- * 1.0 2021.08.31 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="@{'/statistics/daily/trading/list'}" onsubmit="$('#btnSearch').trigger('click'); return false;">
- <table class="frmStyle" aria-describedby="검색조건">
- <colgroup>
- <col style="width:10%;"/>
- <col/>
- </colgroup>
- <tr>
- <th>발생일<i class="required" title="필수" aria-hidden="true"></i></th>
- <td id="terms">
- <span class="nowrap">
- <input name="startDt" id="startDt" type="text" class="w80 schDate" maxlength="8" required="required" data-valid-name="발생시작일"/>
- ~
- <input name="endDt" id="endDt" type="text" class="w80 schDate" maxlength="8" required="required" data-valid-name="발생종료일"/>
- </span>
- <button type="button" class="btn btn-default btn-sm btnToday" onclick="gagajf.setDate('#terms', 'startDt', 'endDt', 't');">오늘</button>
- <button type="button" class="btn btn-default btn-sm btnYesterday" onclick="gagajf.setDate('#terms', 'startDt', 'endDt', 'y');">어제</button>
- <button type="button" class="btn btn-default btn-sm" onclick="gagajf.setDate('#terms', 'startDt', 'endDt', '7d');">최근한주</button>
- <button type="button" class="btn btn-default btn-sm" onclick="gagajf.setDate('#terms', 'startDt', 'endDt', 'tw');">이번주</button>
- <button type="button" class="btn btn-default btn-sm" onclick="gagajf.setDate('#terms', 'startDt', 'endDt', 'pw');">지난주</button>
- <span class="infoTxt cRed marL10"><i class="fa fa-info-circle" aria-hidden="true"></i>(일주일 한도)</span>
- <!-- <input type="text" class="schDate w80" name="occurDt" maxlength="10" th:value="${#calendars.format(#calendars.createNow(), 'yyyy-MM-dd')}" required="required" data-valid-type="calendar" data-valid-name="발생일"/> -->
- </td>
- </tr>
- </table>
-
- <ul class="panelBar">
- <li class="center">
- <button type="button" class="btn btn-base btn-lg" id="btnSearch">조회</button>
- </li>
- </ul>
- </form>
- </div>
- <!-- 검색조건 영역 -->
-
- <!-- 리스트 영역 -->
- <div class="panelStyle">
- <!-- 버튼 배치 영역 -->
- <ul class="panelBar">
- <li class="left">
- <span class="infoTxt cBlue">* 항목 설명</span>
- <!-- 아이콘 툴팁 -->
- <div class="iconTooltip marL10">
- <i class="fa fa-info" aria-hidden="true"></i>
- <span class="left" style="width: 600px;">
- <strong>1.판매구분</strong>: 판매, 취소, 품절, 반품, 교환<br/>
- <strong>2.판매금액</strong>: 판매가 * 판매수량<br/>
- <strong>3.쿠폰할인금액</strong>: 즉시할인쿠폰금액 + 상품쿠폰할인금액 <br/>
- <strong>4.수수료</strong>: 실판매금액(쿠폰할인금액과 다다익선할인금액만 차감. 포인트와 상품권은 포함) * 판매수수료율(%)<br/>
- </span>
- </div>
- <!-- //아이콘 툴팁 -->
- </li>
- <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>
- <script th:inline="javascript">
- /*<![CDATA[*/
- let columnDefs = [
- { headerName: "주문번호", field: "ordNo", width: 100, cellClass: 'text-center' },
- { headerName: "주문상세번호", field: "ordDtlNo", width: 150, cellClass: 'text-center' },
- { headerName: "판매구분", field: "sellGb", width: 80, cellClass: 'text-center' },
- { headerName: "몰구분", field: "mallGbNm", width: 100, cellClass: 'text-center' },
- { headerName: "제휴몰주문번호", field: "extmallOrderId", width: 150, cellClass: 'text-center' },
- { headerName: "제휴몰명", field: "extmallNm", width: 150, cellClass: 'text-center' },
- { headerName: "상위제휴채널", field: "afChannelNm", width: 150, cellClass: 'text-center' },
- { headerName: "제휴채널", field: "afLinkNm", width: 150, cellClass: 'text-center' },
- { headerName: "유통구분", field: "distributionGbNm", width: 100, cellClass: 'text-center'},
- { headerName: "공급업체", field: "supplyCompNm", width: 150, cellClass: 'text-center' },
- { headerName: "공급벤더", field: "supplyVendorNm", width: 150, cellClass: 'text-center' },
- { headerName: "주문일시", field: "ordDt", width: 150, cellClass: 'text-center' },
- { headerName: "발생일시", field: "occurDt", width: 150, cellClass: 'text-center' },
- { headerName: "브랜드", field: "brandEnm", width: 100, cellClass: 'text-center' },
- { headerName: "상품코드", field: "goodsCd", width: 120, cellClass: 'text-center' },
- { headerName: "상품명", field: "goodsNm", width: 300 },
- { headerName: "단품코드", field: "itemCd", width: 120, cellClass: 'text-center' },
- { headerName: "옵션1", field: "optCd1", width: 100, cellClass: 'text-center' },
- { headerName: "옵션2", field: "optCd2", width: 100, cellClass: 'text-center' },
- {
- headerName: "품목", field: "itemkindNm", width: 200,
- cellRenderer: function (params) { return gagajf.isNull(params.value) ? '' : params.value.replaceAll('>','>'); }
- },
- { headerName: "품목1", field: "itemkindNm1", width: 100 },
- { headerName: "품목2", field: "itemkindNm2", width: 100 },
- { headerName: "품목3", field: "itemkindNm3", width: 100 },
- { headerName: "품목4", field: "itemkindNm4", width: 100 },
- {
- headerName: "판매가", field: "sellPrice", width: 100, cellClass: 'text-right',
- cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); }
- },
- {
- headerName: "판매수량", field: "sellQty", width: 100, cellClass: 'text-center',
- cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); },
- cellStyle : function(params) { if (Number(params.value) < 0) return { 'color' : 'red' } }
- },
- {
- headerName: "판매금액", field: "sellAmt", width: 100, cellClass: 'text-right',
- cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); },
- cellStyle : function(params) { if (Number(params.value) < 0) return { 'color' : 'red' } }
- },
- {
- headerName: "쿠폰할인금액", field: "cpnDcAmt", width: 120, cellClass: 'text-right',
- valueGetter: function (params) { return gagaAgGrid.toAddComma(params.data.cpn1DcAmt + params.data.goodsCpnDcAmt); }
- },
- {
- headerName: "즉시사용쿠폰금액", field: "cpn1DcAmt", width: 120, cellClass: 'text-right',
- cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); }
- },
- {
- headerName: "상품쿠폰사용금액", field: "goodsCpnDcAmt", width: 120, cellClass: 'text-right',
- cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); }
- },
- {
- headerName: "주문서쿠폰사용금액", field: "cartCpnDcAmt", width: 130, cellClass: 'text-right',
- cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); }
- },
- {
- headerName: "포인트사용금액", field: "pntDcAmt", width: 120, cellClass: 'text-right',
- cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); }
- },
- {
- headerName: "다다익선할인금액", field: "tmtbDcAmt", width: 120, cellClass: 'text-right',
- cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); }
- },
- {
- headerName: "자사다다익선분담액", field: "selfTmtbDcAmt", width: 150, cellClass: 'text-right',
- cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); }
- },
- {
- headerName: "입점다다익선분담액", field: "supplyCompTmtbDcAmt", width: 150, cellClass: 'text-right',
- cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); }
- },
- {
- headerName: "상품권사용금액", field: "gfcdUseAmt", width: 120, cellClass: 'text-right',
- cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); }
- },
- {
- headerName: "자사쿠폰분담액", field: "selfCpnDcAmt", width: 120, cellClass: 'text-right',
- cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); }
- },
- {
- headerName: "입점쿠폰분담액", field: "supplyCompCpnDcAmt", width: 120, cellClass: 'text-right',
- cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); }
- },
- {
- headerName: "실판매가", field: "realSellPrice", width: 100, cellClass: 'text-right',
- cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); }
- },
- {
- headerName: "실판매금액", field: "realSellAmt", width: 100, cellClass: 'text-right',
- cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); },
- cellStyle : function(params) { if (Number(params.value) < 0) return { 'color' : 'red' } }
- },
- {
- headerName: "수수료율(%)", field: "sellFeeRate", width: 120, cellClass: 'text-center',
- cellRenderer: function (params) { return gagajf.isNull(params.value) ? '' : params.value + '%'; }
- },
- {
- headerName: "수수료", field: "sellFeeAmt", width: 100, cellClass: 'text-right',
- cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); },
- cellStyle : function(params) { if (Number(params.value) < 0) return { 'color' : 'red' } }
- },
- { headerName: "담당MD", field: "mdNm", width: 100, cellClass: 'text-center' },
- ];
- let gridOptions = gagaAgGrid.getGridOptions(columnDefs);
- // 검색
- $('#btnSearch').on('click', function() {
- // 입력 값 체크
- if (!gagajf.validation($('#searchForm')))
- return false;
-
- var fromDate = $('#searchForm input[name=startDt]').val().toDate('YYYY-MM-DD');
- var toDate = $('#searchForm input[name=endDt]').val().toDate('YYYY-MM-DD');
-
- if (fromDate > toDate) {
- mcxDialog.alert("시작일자는 종료일자 보다 클 수 없습니다.");
- $('#searchForm input[name=endDt]').focus();
- return false;
- }
-
- var iDays = Math.ceil((toDate - fromDate) / (60 * 60 * 24 * 1000));
- if (iDays >= 7) {
- mcxDialog.alert("최대 7일까지 조회할 수 있습니다.");
- return;
- }
-
- gagaAgGrid.fetch($('#searchForm').prop('action'), gridOptions, '#searchForm', fnCreateTotal);
- });
-
- // 합계 생성
- var fnCreateTotal = function() {
- // var sellPrice = 0; // 판매가
- var sellQty = 0; // 판매수량
- var sellAmt = 0; // 판매금액
- var cpnDcAmt = 0; // 쿠폰할인금액
- var cpn1DcAmt = 0; // 즉시사용쿠폰금액
- var goodsCpnDcAmt = 0; // 상품쿠폰사용금액
- var cartCpnDcAmt = 0; // 주문서쿠폰사용금액
- var pntDcAmt = 0; // 포인트사용금액
- var tmtbDcAmt = 0; // 다다익선할인금액
- var selfTmtbDcAmt = 0; // 자사다다익선분담액
- var supplyCompTmtbDcAmt = 0; // 입점다다익선분담액
- var gfcdUseAmt = 0; // 상품권사용금액
- var selfCpnDcAmt = 0; // 자사쿠폰분담액
- var supplyCompCpnDcAmt = 0; // 입점쿠폰분담액
- var realSellPrice = 0; // 실판매가
- var realSellAmt = 0; // 실판매금액
- var sellFeeAmt = 0; // 수수료
- var settleAmt = 0; // 정산대상액
- gridOptions.api.forEachNode(function(rowNode, index) {
- if (!rowNode.group) {
- // if (typeof rowNode.data.sellPrice =='number') { sellPrice += rowNode.data.sellPrice; }
- if (typeof rowNode.data.sellQty =='number') { sellQty += rowNode.data.sellQty; }
- if (typeof rowNode.data.sellAmt =='number') { sellAmt += rowNode.data.sellAmt; }
- if (typeof rowNode.data.cpnDcAmt =='number') { cpnDcAmt += rowNode.data.cpnDcAmt; }
- if (typeof rowNode.data.cpn1DcAmt =='number') { cpn1DcAmt += rowNode.data.cpn1DcAmt; }
- if (typeof rowNode.data.goodsCpnDcAmt =='number') { goodsCpnDcAmt += rowNode.data.goodsCpnDcAmt; }
- if (typeof rowNode.data.cartCpnDcAmt =='number') { cartCpnDcAmt += rowNode.data.cartCpnDcAmt; }
- if (typeof rowNode.data.pntDcAmt =='number') { pntDcAmt += rowNode.data.pntDcAmt; }
- if (typeof rowNode.data.tmtbDcAmt =='number') { tmtbDcAmt += rowNode.data.tmtbDcAmt; }
- if (typeof rowNode.data.selfTmtbDcAmt =='number') { selfTmtbDcAmt += rowNode.data.selfTmtbDcAmt; }
- if (typeof rowNode.data.supplyCompTmtbDcAmt =='number') { supplyCompTmtbDcAmt += rowNode.data.supplyCompTmtbDcAmt; }
- if (typeof rowNode.data.gfcdUseAmt =='number') { gfcdUseAmt += rowNode.data.gfcdUseAmt; }
- if (typeof rowNode.data.selfCpnDcAmt =='number') { selfCpnDcAmt += rowNode.data.selfCpnDcAmt; }
- if (typeof rowNode.data.supplyCompCpnDcAmt =='number') { supplyCompCpnDcAmt += rowNode.data.supplyCompCpnDcAmt; }
- if (typeof rowNode.data.realSellPrice =='number') { realSellPrice += rowNode.data.realSellPrice; }
- if (typeof rowNode.data.realSellAmt =='number') { realSellAmt += rowNode.data.realSellAmt; }
- if (typeof rowNode.data.sellFeeAmt =='number') { sellFeeAmt += rowNode.data.sellFeeAmt; }
- if (typeof rowNode.data.settleAmt =='number') { settleAmt += rowNode.data.settleAmt; }
- }
- });
- var data = {
- ordNo: null, ordDtlNo: null, sellGb: null,
- mallGbNm: null, extmallOrderId: null, extmallNm: null,
- afChannelNm: null, afLinkNm: null,
- distributionGbNm: null, supplyCompNm: null, supplyVendorNm: null,
- ordDt: null, occurDt: null,
- brandEnm: null, goodsCd: null, goodsNm: null, itemCd: null, optCd1: null, optCd2: null,
- itemkindNm: null, itemkindNm1: null, itemkindNm2: null, itemkindNm3: null, itemkindNm4: '합계',
- // sellPrice: sellPrice,
- sellPrice: null,
- sellQty: sellQty, sellAmt: sellAmt,
- cpnDcAmt: cpnDcAmt, cpn1DcAmt: cpn1DcAmt, goodsCpnDcAmt: goodsCpnDcAmt, cartCpnDcAmt: cartCpnDcAmt,
- pntDcAmt: pntDcAmt, tmtbDcAmt: tmtbDcAmt, selfTmtbDcAmt: selfTmtbDcAmt, supplyCompTmtbDcAmt: supplyCompTmtbDcAmt,
- gfcdUseAmt: gfcdUseAmt, selfCpnDcAmt: selfCpnDcAmt, supplyCompCpnDcAmt: supplyCompCpnDcAmt,
- realSellPrice: realSellPrice, realSellAmt: realSellAmt,
- sellFeeRate: null, sellFeeAmt: sellFeeAmt, settleAmt: settleAmt,
- mdNm: null
- };
- gagaAgGrid.setPinnedRowData(gridOptions, data, 'top');
- }
-
- // 엑셀다운로드
- $('#btnExcel').on('click', function() {
- gagaAgGrid.exportToExcel('일일거래내역', gridOptions);
- });
-
- $(document).ready(function() {
- gagajf.setDate('#terms', 'startDt', 'endDt', 't');
-
- // Create a agGrid
- gagaAgGrid.createGrid('gridList', gridOptions);
- });
- /*]]>*/
- </script>
- </html>
|