|
|
@@ -45,6 +45,20 @@
|
|
|
</td>
|
|
|
<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>
|
|
|
+ <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" onclick="gagajf.setDate('#terms', 'startDt', 'endDt', 'pm');">지난달</button>
|
|
|
+ <span class="infoTxt cRed"><i class="fa fa-info-circle" aria-hidden="true"></i>(한달 한도)</span>
|
|
|
</td>
|
|
|
</tr>
|
|
|
<tr>
|
|
|
@@ -95,10 +109,10 @@
|
|
|
<script th:inline="javascript">
|
|
|
/*<![CDATA[*/
|
|
|
let columnDefs = [
|
|
|
- {
|
|
|
- width: 40, minWidth: 40, cellClass: 'text-center', headerCheckboxSelection: true, checkboxSelection: true, filter: false,
|
|
|
- checkboxSelection: function (params) { return !gagajf.isNull(params.data.dsError) ? true : false; }
|
|
|
- },
|
|
|
+// {
|
|
|
+// width: 40, minWidth: 40, cellClass: 'text-center', headerCheckboxSelection: true, checkboxSelection: true, filter: false,
|
|
|
+// checkboxSelection: function (params) { return !gagajf.isNull(params.data.dsError) ? true : false; }
|
|
|
+// },
|
|
|
{
|
|
|
headerName: "ERP구분", field: "erpGb", width: 80, cellClass: 'text-center',
|
|
|
cellRenderer: function(params) { return params.value == 'hsmk' ? '한세MK' : '한세드림'; }
|
|
|
@@ -109,8 +123,8 @@
|
|
|
cellRenderer: function(params) { return params.value == '1' ? '판매' : '환불'; }
|
|
|
},
|
|
|
{ headerName: "스타일코드", field: "cdStyle", width: 120, cellClass: 'text-center' },
|
|
|
- { headerName: "색상코드", field: "cdColor", width: 100, cellClass: 'text-center' },
|
|
|
- { headerName: "사이즈코드", field: "cdSize", width: 100, cellClass: 'text-center' },
|
|
|
+ { headerName: "색상코드", field: "cdColor", width: 80, cellClass: 'text-center' },
|
|
|
+ { headerName: "사이즈코드", field: "cdSize", width: 90, cellClass: 'text-center' },
|
|
|
{
|
|
|
headerName: "판매수량", field: "qtSale", width: 100, cellClass: 'text-center',
|
|
|
cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); },
|
|
|
@@ -121,7 +135,7 @@
|
|
|
cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); },
|
|
|
cellStyle : function(params) { if (Number(params.value) < 0) return { 'color' : 'red' } }
|
|
|
},
|
|
|
- { headerName: "I/F번호", field: "ifNo", width: 200, cellClass: 'text-center' },
|
|
|
+ { headerName: "I/F번호", field: "noIf", width: 150, cellClass: 'text-center' },
|
|
|
{ headerName: "판매전표번호", field: "cdSalebill", width: 150, cellClass: 'text-center' },
|
|
|
{
|
|
|
headerName: "실패메시지", field: "dsError", width: 300,
|
|
|
@@ -162,6 +176,21 @@
|
|
|
if (!gagajf.validation('#searchForm'))
|
|
|
return false;
|
|
|
|
|
|
+ let fromDate = $('#searchForm input[name=startDt]').val().toDate('YYYY-MM-DD');
|
|
|
+ let 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 >= 31) {
|
|
|
+ mcxDialog.alert("최대 31일까지 조회할 수 있습니다.");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
gagaAgGrid.fetch($('#searchForm').prop('action'), gridOptions, '#searchForm');
|
|
|
});
|
|
|
|
|
|
@@ -172,7 +201,60 @@
|
|
|
|
|
|
// 실패건업로드
|
|
|
$('#btnResendFailSales').on('click', function() {
|
|
|
+ let allData = gagaAgGrid.getAllRowData(gridOptions);
|
|
|
|
|
|
+ let isFailData = false;
|
|
|
+ allData.forEach(function(item, idx) {
|
|
|
+ if (!gagajf.isNull(item.dsError)) {
|
|
|
+ isFailData = true;
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ if (!isFailData) {
|
|
|
+ mcxDialog.alert("매출반영할 실패건이 없습니다.");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (gagajf.isNull($('#startDt').val())) {
|
|
|
+ mcxDialog.alertC('판매시작일자를 입력해 주세요.', {
|
|
|
+ sureBtnText: "확인",
|
|
|
+ sureBtnClick: function() {
|
|
|
+ $('#startDt').focus();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (gagajf.isNull($('#endDt').val())) {
|
|
|
+ mcxDialog.alertC('판매종료일자를 입력해 주세요.', {
|
|
|
+ sureBtnText: "확인",
|
|
|
+ sureBtnClick: function() {
|
|
|
+ $('#endDt').focus();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ let msg = ($('#searchForm select[name=erpGb]').val() == 'hsmk' ? '한세MK' : '한세드림') + '의'
|
|
|
+ + ' 판매기간 ' + $('#startDt').val().toDate('YYYY-MM-DD').format('YYYY-MM-DD') + '~' + $('#endDt').val().toDate('YYYY-MM-DD').format('YYYY-MM-DD') + ' 동안의 매출반영 실패건을 업로드합니다.<br/>'
|
|
|
+ + '매출반영은 몇 분이 소요될 수 있습니다. 계속 진행하시겠습니까?';
|
|
|
+
|
|
|
+ mcxDialog.confirm(msg, {
|
|
|
+ cancelBtnText: "취소",
|
|
|
+ sureBtnText: "확인",
|
|
|
+ sureBtnClick: function() {
|
|
|
+ let jsonData = JSON.stringify({
|
|
|
+ erpGb : $('#searchForm select[name=erpGb]').val(),
|
|
|
+ startDt : $('#startDt').val(),
|
|
|
+ endDt : $('#endDt').val()
|
|
|
+ });
|
|
|
+
|
|
|
+ gagajf.ajaxJsonSubmit('/settle/hansae/failedSales/upload', jsonData, function() {
|
|
|
+ $('#btnSearch').trigger('click');
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
});
|
|
|
|
|
|
// 엑셀다운로드
|
|
|
@@ -186,8 +268,7 @@
|
|
|
});
|
|
|
|
|
|
$(document).ready(function() {
|
|
|
- cfnCreateCalendar('#terms', 'startDt', 'endDt', true, '판매');
|
|
|
- $('.btnToday').trigger('click');
|
|
|
+ gagajf.setDate('#terms', 'startDt', 'endDt', 't');
|
|
|
|
|
|
// Create a agGrid
|
|
|
gagaAgGrid.createGrid('gridList', gridOptions);
|