|
@@ -36,24 +36,36 @@
|
|
|
<col style="width:10%;"/>
|
|
<col style="width:10%;"/>
|
|
|
</colgroup>
|
|
</colgroup>
|
|
|
<tr>
|
|
<tr>
|
|
|
- <th>기간<i class="required" title="필수" aria-hidden="true"></i></th>
|
|
|
|
|
|
|
+ <th>구분<i class="required" title="필수" aria-hidden="true"></i></th>
|
|
|
<td>
|
|
<td>
|
|
|
<select name="termGb">
|
|
<select name="termGb">
|
|
|
|
|
+ <option value="SETTLE_YM">정산월</option>
|
|
|
<option value="REG_DT">등록일</option>
|
|
<option value="REG_DT">등록일</option>
|
|
|
<option value="EXPIRE_DT">사용만료일</option>
|
|
<option value="EXPIRE_DT">사용만료일</option>
|
|
|
</select>
|
|
</select>
|
|
|
- <span id="terms">
|
|
|
|
|
|
|
+ <span id="spanSettle">
|
|
|
|
|
+ <input type="text" class="schMonth w60" name="settleYm" id="settleYm" maxlength="7"/>
|
|
|
|
|
+ <button type="button" class="btn icn schBtn" data-id="useYm"><i class="fa fa-calendar" aria-hidden="true"></i></button>
|
|
|
|
|
+ </span>
|
|
|
|
|
+ <span id="terms" style="display: none;">
|
|
|
|
|
+ <span class="nowrap">
|
|
|
|
|
+ <input name="startDt" id="startDt" type="text" class="w80 schDate" maxlength="8"/>
|
|
|
|
|
+ ~
|
|
|
|
|
+ <input name="endDt" id="endDt" type="text" class="w80 schDate" maxlength="8"/>
|
|
|
|
|
+ </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>
|
|
|
|
|
+ <button type="button" class="btn btn-default btn-sm" onclick="gagajf.setDate('#terms', 'startDt', 'endDt', '1m');">최근한달</button>
|
|
|
|
|
+ <button type="button" class="btn btn-default btn-sm" onclick="gagajf.setDate('#terms', 'startDt', 'endDt', 'tm');">이번달</button>
|
|
|
|
|
+ <button type="button" class="btn btn-default btn-sm btnYesterMonth" onclick="gagajf.setDate('#terms', 'startDt', 'endDt', 'pm');">지난달</button>
|
|
|
|
|
+ <button type="button" class="btn btn-default btn-sm" onclick="gagajf.setDate('#terms', 'startDt', 'endDt', '3m');">최근3개월</button>
|
|
|
</span>
|
|
</span>
|
|
|
</td>
|
|
</td>
|
|
|
- <th>사용월<i class="required" title="필수" aria-hidden="true"></i></th>
|
|
|
|
|
- <td>
|
|
|
|
|
- <input type="text" class="schMonth w60" name="useYm" id="useYm" maxlength="7" required="required"/>
|
|
|
|
|
- <button type="button" class="btn icn schBtn" data-id="useYm"><i class="fa fa-calendar" aria-hidden="true"></i></button>
|
|
|
|
|
- </td>
|
|
|
|
|
- </tr>
|
|
|
|
|
- <tr>
|
|
|
|
|
<th>유효상품권</th>
|
|
<th>유효상품권</th>
|
|
|
- <td colspan="3">
|
|
|
|
|
|
|
+ <td>
|
|
|
<select name="availYn">
|
|
<select name="availYn">
|
|
|
<option value="">[전체]</option>
|
|
<option value="">[전체]</option>
|
|
|
<option value="Y">Yes</option>
|
|
<option value="Y">Yes</option>
|
|
@@ -66,7 +78,7 @@
|
|
|
<ul class="panelBar">
|
|
<ul class="panelBar">
|
|
|
<li class="center">
|
|
<li class="center">
|
|
|
<button type="button" class="btn btn-base btn-lg" id="btnSearch">조회</button>
|
|
<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>
|
|
|
|
|
|
|
+ <button type="button" class="btn btn-gray btn-lg" id="btnInit">초기화</button>
|
|
|
</li>
|
|
</li>
|
|
|
</ul>
|
|
</ul>
|
|
|
</form>
|
|
</form>
|
|
@@ -97,43 +109,123 @@
|
|
|
{ headerName: "유효여부", field: "availYn", width: 100, cellClass: 'text-center' },
|
|
{ headerName: "유효여부", field: "availYn", width: 100, cellClass: 'text-center' },
|
|
|
{ headerName: "회원ID", field: "custId", width: 100, cellClass: 'text-center' },
|
|
{ headerName: "회원ID", field: "custId", width: 100, cellClass: 'text-center' },
|
|
|
{
|
|
{
|
|
|
- headerName: "최초등록금액", field: "chgGfcdAmt", width: 120, cellClass: 'text-right',
|
|
|
|
|
- cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); },
|
|
|
|
|
- cellStyle : function(params) { if (Number(params.value) < 0) return { 'color' : 'red' } }
|
|
|
|
|
|
|
+ headerName: "최초등록금액", field: "chgGfcdAmt", width: 150, cellClass: 'text-right',
|
|
|
|
|
+ cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); }
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- headerName: "사용월사용금액", field: "uymGfcdAmt", width: 120, cellClass: 'text-right',
|
|
|
|
|
- cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); },
|
|
|
|
|
- cellStyle : function(params) { if (Number(params.value) < 0) return { 'color' : 'red' } }
|
|
|
|
|
|
|
+ headerName: "누적사용금액", field: "usGfcdAmt", width: 150, cellClass: 'text-right', hide: true,
|
|
|
|
|
+ cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); }
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- headerName: "누적사용금액", field: "usGfcdAmt", 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: "useGfcdAmt", width: 150, cellClass: 'text-right',
|
|
|
|
|
+ cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); }
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- headerName: "잔액", field: "rmGfcdAmt", width: 120, cellClass: 'text-right',
|
|
|
|
|
- cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); },
|
|
|
|
|
- cellStyle : function(params) { if (Number(params.value) < 0) return { 'color' : 'red' } }
|
|
|
|
|
|
|
+ headerName: "정산월 취소금액", field: "cnclGfcdAmt", width: 150, cellClass: 'text-right',
|
|
|
|
|
+ cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); }
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ headerName: "잔액", field: "rmGfcdAmt", width: 150, cellClass: 'text-right',
|
|
|
|
|
+ cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); }
|
|
|
}
|
|
}
|
|
|
];
|
|
];
|
|
|
|
|
|
|
|
let gridOptions = gagaAgGrid.getGridOptions(columnDefs);
|
|
let gridOptions = gagaAgGrid.getGridOptions(columnDefs);
|
|
|
|
|
|
|
|
|
|
+ let gb = 'SETTLE_YM';
|
|
|
|
|
+
|
|
|
// 검색
|
|
// 검색
|
|
|
$('#btnSearch').on('click', function() {
|
|
$('#btnSearch').on('click', function() {
|
|
|
- gagaAgGrid.fetch($('#searchForm').prop('action'), gridOptions, '#searchForm');
|
|
|
|
|
|
|
+ if (gb == 'SETTLE_YM') { // 정산월
|
|
|
|
|
+ if (gagajf.isNull($('#searchForm input[name=settleYm]').val())) {
|
|
|
|
|
+ mcxDialog.alertC('정산월을 입력해 주세요.', {
|
|
|
|
|
+ sureBtnText: "확인",
|
|
|
|
|
+ sureBtnClick: function() {
|
|
|
|
|
+ $('#searchForm input[name=settleYm]').focus();
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (gagajf.isNull($('#searchForm input[name=startDt]').val())) {
|
|
|
|
|
+ mcxDialog.alertC('시작일자를 입력해 주세요.', {
|
|
|
|
|
+ sureBtnText: "확인",
|
|
|
|
|
+ sureBtnClick: function() {
|
|
|
|
|
+ $('#searchForm input[name=startDt]').focus();
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (gagajf.isNull($('#searchForm input[name=endDt]').val())) {
|
|
|
|
|
+ mcxDialog.alertC('종료일자를 입력해 주세요.', {
|
|
|
|
|
+ sureBtnText: "확인",
|
|
|
|
|
+ sureBtnClick: function() {
|
|
|
|
|
+ $('#searchForm input[name=endDt]').focus();
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ 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;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ gagaAgGrid.fetch($('#searchForm').prop('action'), gridOptions, '#searchForm', function() {
|
|
|
|
|
+ fnShowOrHideColumn();
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // 초기화 클릭시
|
|
|
|
|
+ $('#btnInit').on('click', function() {
|
|
|
|
|
+ $('#searchForm')[0].reset();
|
|
|
|
|
+ $('#settleYm').val((new Date()).before(0, 1, 0).format("YYYY-MM"));
|
|
|
|
|
+ $('.btnYesterMonth').trigger('click');
|
|
|
|
|
+ $('#searchForm select[name=termGb]').trigger('change');
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
// 엑셀다운로드
|
|
// 엑셀다운로드
|
|
|
$('#btnExcel').on('click', function() {
|
|
$('#btnExcel').on('click', function() {
|
|
|
- gagaAgGrid.exportToExcel('상품권정산 목록', gridOptions);
|
|
|
|
|
|
|
+ gagaAgGrid.exportToExcel('상품권 목록', gridOptions);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+ // 구분 선택 시
|
|
|
|
|
+ $('#searchForm select[name=termGb]').on('change', function() {
|
|
|
|
|
+ gb = $('#searchForm select[name=termGb]').val();
|
|
|
|
|
+
|
|
|
|
|
+ if (gb == 'SETTLE_YM') { // 정산월
|
|
|
|
|
+ $('#spanSettle').show();
|
|
|
|
|
+ $('#terms').hide();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ $('#spanSettle').hide();
|
|
|
|
|
+ $('#terms').show();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ fnShowOrHideColumn();
|
|
|
|
|
+ gridOptions.api.setRowData();
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ var fnShowOrHideColumn = function() {
|
|
|
|
|
+ if (gb == 'SETTLE_YM') { // 정산월
|
|
|
|
|
+ gagaAgGrid.showOrHideColumn(gridOptions, 'usGfcdAmt', false);
|
|
|
|
|
+ gagaAgGrid.showOrHideColumn(gridOptions, 'useGfcdAmt', true);
|
|
|
|
|
+ gagaAgGrid.showOrHideColumn(gridOptions, 'cnclGfcdAmt', true);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ gagaAgGrid.showOrHideColumn(gridOptions, 'usGfcdAmt', true);
|
|
|
|
|
+ gagaAgGrid.showOrHideColumn(gridOptions, 'useGfcdAmt', false);
|
|
|
|
|
+ gagaAgGrid.showOrHideColumn(gridOptions, 'cnclGfcdAmt', false);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
$(document).ready(function() {
|
|
$(document).ready(function() {
|
|
|
- cfnCreateCalendar('#terms', 'startDt', 'endDt', true);
|
|
|
|
|
- $('.btnThisMonth').trigger('click');
|
|
|
|
|
- $('#useYm').val((new Date()).before(0, 1, 0).format("YYYY-MM"));
|
|
|
|
|
|
|
+ $('#settleYm').val((new Date()).before(0, 1, 0).format("YYYY-MM"));
|
|
|
|
|
+ $('.btnYesterMonth').trigger('click');
|
|
|
|
|
|
|
|
// Create a agGrid
|
|
// Create a agGrid
|
|
|
gagaAgGrid.createGrid('gridList', gridOptions);
|
|
gagaAgGrid.createGrid('gridList', gridOptions);
|