|
|
@@ -48,7 +48,7 @@
|
|
|
<td>
|
|
|
<!-- 프로모션 ID 입력 : before -->
|
|
|
<label th:if="${mode == 'N'}">
|
|
|
- <input class="w50p" type="text" id="disTmtbSq1" name="disTmtbSq" maxlength="30" th:value="${params.tmtbSq}" disabled=""/>
|
|
|
+ <input class="w50p" type="text" id="disTmtbSq1" name="disTmtbSq" maxlength="30" th:value="${params.tmtbSq}" disabled=""/> *자동생성
|
|
|
</label>
|
|
|
<label th:if="${mode == 'U'}">
|
|
|
<input class="w50p" type="text" id="disTmtbSq2" name="disTmtbSq" maxlength="30" th:value="${tmtbSeq}" disabled=""/>
|
|
|
@@ -57,18 +57,35 @@
|
|
|
</td>
|
|
|
</tr>
|
|
|
<tr>
|
|
|
- <th>행사 기간<em class="required" title="필수"></em></th>
|
|
|
+ <th>시작일<em class="required" title="필수"></em></th>
|
|
|
<td>
|
|
|
- <input type="text" class="schDate w100" name="tmtbStdt" maxlength="10" required="required" data-valid-name="시작일자"/>
|
|
|
- ~
|
|
|
- <input type="text" class="schDate w100" name="tmtbEddt" maxlength="10" required="required" data-valid-name="종료일자"/>
|
|
|
+ <input type="hidden" name="tmtbStdt" id="tmtbStdt" required="required" data-valid-name="다다익선시작일시">
|
|
|
+ <input type="text" class="schDate w100" name="eventStdt" id="eventStdt" maxlength="10" th:value="${#calendars.format(#calendars.createNow(), 'yyyy-MM-dd')}"/>
|
|
|
+ <select name="eventStHH" data-valid-name="다다익선시작(시)" style="width: 65px;"> <!--th:disabled="${mode == 'U'}"-->
|
|
|
+ <th:block th:each="num, index : ${#numbers.sequence(0,23)}">
|
|
|
+ <option th:value="${#numbers.formatInteger(num,2)}" th:text="|${#numbers.formatInteger(num,2)}시|" th:selected="${tmtbMstInfo.eventStHH == #numbers.formatInteger(num,2)}">시간</option>
|
|
|
+ </th:block>
|
|
|
+ </select>
|
|
|
+ <select name="eventStMM" data-valid-name="다다익선시작(분)" style="width: 65px;">
|
|
|
+ <th:block th:each="num, index : ${#numbers.sequence(0,59)}">
|
|
|
+ <option th:value="${#numbers.formatInteger(num,2)}" th:text="|${#numbers.formatInteger(num,2)}분|" th:selected="${tmtbMstInfo.eventStMM == #numbers.formatInteger(num,2)}">분</option>
|
|
|
+ </th:block>
|
|
|
+ </select>
|
|
|
</td>
|
|
|
- <th>상태<em class="required" title="필수"></em></th>
|
|
|
+ <th>종료일<em class="required" title="필수"></em></th>
|
|
|
<td>
|
|
|
- <!-- 상태 입력 : before
|
|
|
- <input class="w50p" type="text" id="disTmtbStat" name="disTmtbStat" maxlength="30" th:value="${params.tmtbStat}" disabled=""/>-->
|
|
|
- <label class="rdoBtn" th:if="${tmtbStatList}" th:each="oneData, status : ${tmtbStatList}" ><input type="radio" id="disTmtbStat" name="disTmtbStat" th:value="${oneData.cd}" th:text="${oneData.cdNm}" data-valid-name="상태"/></label>
|
|
|
- <input type="hidden" id="tmtbStat" name="tmtbStat"/>
|
|
|
+ <input type="hidden" name="tmtbEddt" id="tmtbEddt" required="required" data-valid-name="다다익선종료일시">
|
|
|
+ <input type="text" class="schDate w100" name="eventEddt" id="eventEddt" maxlength="10" th:value="${#calendars.format(#calendars.createNow(), 'yyyy-MM-dd')}"/>
|
|
|
+ <select name="eventEdHH" data-valid-name="다다익선종료(시)" style="width: 65px;">
|
|
|
+ <th:block th:each="num, index : ${#numbers.sequence(0,23)}">
|
|
|
+ <option th:value="${#numbers.formatInteger(num,2)}" th:text="|${#numbers.formatInteger(num,2)}시|" th:selected="${tmtbMstInfo.eventEdHH == #numbers.formatInteger(num,2)}">시간</option>
|
|
|
+ </th:block>
|
|
|
+ </select>
|
|
|
+ <select name="eventEdMM" data-valid-name="다다익선종료(분)" style="width: 65px;">
|
|
|
+ <th:block th:each="num, index : ${#numbers.sequence(0,59)}">
|
|
|
+ <option th:value="${#numbers.formatInteger(num,2)}" th:text="|${#numbers.formatInteger(num,2)}분|" th:selected="${tmtbMstInfo.eventEdMM == #numbers.formatInteger(num,2)}">분</option>
|
|
|
+ </th:block>
|
|
|
+ </select>
|
|
|
</td>
|
|
|
</tr>
|
|
|
<tr>
|
|
|
@@ -90,12 +107,48 @@
|
|
|
<label class="rdoBtn"><input type="radio" name="multiYn" id="multiYnY" value="Y" checked="checked"/>복합상품</label>
|
|
|
<label class="rdoBtn"><input type="radio" name="multiYn" id="multiYnN" value="N"/>단일상품</label>
|
|
|
</td>
|
|
|
-
|
|
|
+ <th>상태<em class="required" title="필수"></em></th>
|
|
|
+ <td>
|
|
|
+ <!-- 상태 입력 : before
|
|
|
+ <input class="w50p" type="text" id="disTmtbStat" name="disTmtbStat" maxlength="30" th:value="${params.tmtbStat}" disabled=""/>-->
|
|
|
+ <label class="rdoBtn" th:if="${tmtbStatList}" th:each="oneData, status : ${tmtbStatList}" ><input type="radio" id="disTmtbStat" name="disTmtbStat" th:value="${oneData.cd}" th:text="${oneData.cdNm}" data-valid-name="상태" disabled="disabled"/></label>
|
|
|
+ <input type="hidden" id="tmtbStat" name="tmtbStat"/>
|
|
|
+ </td>
|
|
|
</tr>
|
|
|
|
|
|
</table>
|
|
|
</div>
|
|
|
-
|
|
|
+ <div class="panelStyle" style="margin:unset;">
|
|
|
+ <!-- TITLE -->
|
|
|
+ <div class="panelTitle">
|
|
|
+ <h2>할인 구간</h2>
|
|
|
+ <span class="panelControl">
|
|
|
+ <i class="fa inner-fa-chevron-up"></i> <!-- 열림/닫힘 화살표 -->
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ <!-- //TITLE -->
|
|
|
+ <div class="inner-panelContent">
|
|
|
+ <div class="panelContent">
|
|
|
+ <table class="frmStyle">
|
|
|
+ <colgroup>
|
|
|
+ <col width="10%"/>
|
|
|
+ <col width="90%"/>
|
|
|
+ </colgroup>
|
|
|
+ <tr>
|
|
|
+ <th>할인 구간</th>
|
|
|
+ <td>
|
|
|
+ <div class="padding10">
|
|
|
+ <button type="button" class="btn btnRight btn-success btn-lg" id="btnAddSectionRow">행추가</button>
|
|
|
+ <button type="button" class="btn btnRight btn-success btn-lg" id="btnDelSectionRow">행삭제</button>
|
|
|
+ <br/>
|
|
|
+ <div id="gridSectionGbList" style="width:100%; height:200px;" class="ag-theme-balham"></div>
|
|
|
+ </div>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ </table>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
<div class="panelStyle" style="margin:unset;">
|
|
|
<!-- TITLE -->
|
|
|
<div class="panelTitle">
|
|
|
@@ -152,10 +205,10 @@
|
|
|
</div>
|
|
|
</td>
|
|
|
</tr>
|
|
|
- <tr > <!--class="off"-->
|
|
|
+ <tr class="off"> <!---->
|
|
|
<th>업체&브랜드상품</th>
|
|
|
<td>
|
|
|
- <div class="padding10" > <!--style="display: none;"-->
|
|
|
+ <div class="padding10" style="display: none;"> <!---->
|
|
|
<div id="gridDuplicateGoodsList" style="width:100%; height:200px;" class="ag-theme-balham"></div>
|
|
|
</div>
|
|
|
</td>
|
|
|
@@ -200,7 +253,7 @@
|
|
|
<div class="panelStyle" style="margin:unset;">
|
|
|
<!-- TITLE -->
|
|
|
<div class="panelTitle">
|
|
|
- <h2>할인 구간</h2>
|
|
|
+ <h2>업체 분담율</h2>
|
|
|
<span class="panelControl">
|
|
|
<i class="fa inner-fa-chevron-up"></i> <!-- 열림/닫힘 화살표 -->
|
|
|
</span>
|
|
|
@@ -214,13 +267,13 @@
|
|
|
<col width="90%"/>
|
|
|
</colgroup>
|
|
|
<tr>
|
|
|
- <th>할인 구간</th>
|
|
|
+ <th>업체 분담율</th>
|
|
|
<td>
|
|
|
<div class="padding10">
|
|
|
- <button type="button" class="btn btnRight btn-success btn-lg" id="btnAddSectionRow">행추가</button>
|
|
|
- <button type="button" class="btn btnRight btn-success btn-lg" id="btnDelSectionRow">행삭제</button>
|
|
|
+ <button type="button" class="btn btnRight btn-success btn-lg" id="btnAddApplyBurden">업체추가</button>
|
|
|
+ <button type="button" class="btn btnRight btn-success btn-lg" id="btnDelApplyBurden">선택삭제</button>
|
|
|
<br/>
|
|
|
- <div id="gridSectionGbList" style="width:100%; height:200px;" class="ag-theme-balham"></div>
|
|
|
+ <div id="gridApplyBurdenList" style="width:100%; height:200px;" class="ag-theme-balham"></div>
|
|
|
</div>
|
|
|
</td>
|
|
|
</tr>
|
|
|
@@ -229,31 +282,24 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- <div class="panelStyle" style="margin:unset;">
|
|
|
- <!-- TITLE -->
|
|
|
- <div class="panelTitle">
|
|
|
- <h2>업체 분담율</h2>
|
|
|
- <span class="panelControl">
|
|
|
- <i class="fa inner-fa-chevron-up"></i> <!-- 열림/닫힘 화살표 -->
|
|
|
- </span>
|
|
|
- </div>
|
|
|
- <!-- //TITLE -->
|
|
|
+ <div class="panelStyle" style="margin:unset;" th:if="${mode == 'U'}">
|
|
|
<div class="inner-panelContent">
|
|
|
<div class="panelContent">
|
|
|
<table class="frmStyle">
|
|
|
<colgroup>
|
|
|
<col width="10%"/>
|
|
|
- <col width="90%"/>
|
|
|
+ <col width="40%"/>
|
|
|
+ <col width="10%"/>
|
|
|
+ <col width="40%"/>
|
|
|
</colgroup>
|
|
|
<tr>
|
|
|
- <th>업체 분담율</th>
|
|
|
+ <th>등록자</th>
|
|
|
<td>
|
|
|
- <div class="padding10">
|
|
|
- <button type="button" class="btn btnRight btn-success btn-lg" id="btnAddApplyBurden">업체추가</button>
|
|
|
- <button type="button" class="btn btnRight btn-success btn-lg" id="btnDelApplyBurden">선택삭제</button>
|
|
|
- <br/>
|
|
|
- <div id="gridApplyBurdenList" style="width:100%; height:200px;" class="ag-theme-balham"></div>
|
|
|
- </div>
|
|
|
+ <span id="regInfo">등록자이름(연.월.일 시간:분:초)</span>
|
|
|
+ </td>
|
|
|
+ <th>최종수정자</th>
|
|
|
+ <td>
|
|
|
+ <span id="updInfo">수정자이름(연.월.일 시간:분:초)</span>
|
|
|
</td>
|
|
|
</tr>
|
|
|
</table>
|
|
|
@@ -264,15 +310,13 @@
|
|
|
|
|
|
<ul class="panelBar">
|
|
|
<li class="right">
|
|
|
- <!-- <th:block th:if="${sessionInfo.roleCd == 'G001_0000' OR sessionInfo.roleCd == 'G001_A000' OR sessionInfo.roleCd == 'G001_A101' OR sessionInfo.roleCd == 'G001_A100' OR sessionInfo.roleCd == 'G001_A001'}"> -->
|
|
|
- <!--<button type="button" class="btn btnRight btn-success btn-lg" id="btnSearchList">목록</button>-->
|
|
|
- <button type="button" class="btn btnRight btn-success btn-lg" id="btnMorebetterSave">저장</button>
|
|
|
+ <button type="button" class="btn btnRight btn-success btn-lg" id="btnSearchList">목록</button>
|
|
|
+ <button type="button" class="btn btnRight btn-success btn-lg tmtbButton" id="btnMorebetterSave">저장</button>
|
|
|
<!--<button type="button" th:if="${mode == 'N'}" class="btn btnRight btn-success btn-lg" id="btnMorebetterSave">저장</button>
|
|
|
<button type="button" th:if="${mode == 'U'}" class="btn btnRight btn-success btn-lg" id="btnMorebetterUpdate">수정</button>-->
|
|
|
- <!--<button type="button" class="btn btnRight btn-success btn-lg" id="btnChangeStatIng">진행</button>
|
|
|
- <button type="button" class="btn btnRight btn-success btn-lg" id="btnPromotionDelete">삭제</button>
|
|
|
- <button type="button" class="btn btnRight btn-success btn-lg" id="btnPromotionStop">중지</button>-->
|
|
|
- <!-- </th:block> -->
|
|
|
+ <button type="button" class="btn btnRight btn-success btn-lg tmtbButton" id="btnChangeStatIng">진행</button>
|
|
|
+ <button type="button" class="btn btnRight btn-success btn-lg tmtbButton" id="btnMorebetterDelete">삭제</button>
|
|
|
+ <button type="button" class="btn btnRight btn-success btn-lg tmtbButton" id="btnMorebetterStop">중지</button>
|
|
|
</li>
|
|
|
</ul>
|
|
|
</div>
|
|
|
@@ -280,6 +324,7 @@
|
|
|
|
|
|
<script th:inline="javascript">
|
|
|
// 상세 조회시 데이터 리스트
|
|
|
+ let confirmBtnText = ["확인", "취소"];
|
|
|
var mode = [[${mode}]];
|
|
|
var tmtbMstInfo = [[${tmtbMstInfo}]];
|
|
|
var tmtbSectionValList = [[${tmtbSectionValList}]];
|
|
|
@@ -349,6 +394,7 @@
|
|
|
{width: 40, minWidth: 40, cellClass: 'text-center', headerCheckboxSelection: true, checkboxSelection: true, filter: false},
|
|
|
{headerName: "업체ID", field: "tmtbSupplyCd" , width: 120, cellClass: 'text-center'},
|
|
|
{headerName: "분담율(%)", field: "tmtbBurdenRate" , width: 120, cellClass: 'text-center',required: true
|
|
|
+ ,editable: true
|
|
|
,valueFormatter: function(params) {
|
|
|
if(params.value && params.value > 0) {
|
|
|
return params.value.addComma();
|
|
|
@@ -356,7 +402,7 @@
|
|
|
return '0';
|
|
|
}
|
|
|
},
|
|
|
- cellEditor: 'textCellEditor',
|
|
|
+ //cellEditor: 'textCellEditor',
|
|
|
cellEditorParams: { maxlength: 3, validType: 'numeric'}
|
|
|
},
|
|
|
{headerName: "사용여부", field: "useYn" , width: 120, cellClass: 'text-center'},
|
|
|
@@ -368,7 +414,7 @@
|
|
|
{width: 40, minWidth: 40, cellClass: 'text-center', headerCheckboxSelection: true, checkboxSelection: true, filter: false},
|
|
|
{headerName: 'No', width: 60, cellClass: 'text-center', valueGetter: function(params) { return params.node.rowIndex + 1 }},
|
|
|
{headerName: "시퀀스", field: "tmtbSq", width: 100, cellClass: 'text-center', hide: true},
|
|
|
- {headerName: "할인구간", field: "sectionGb", width: 100, cellClass: 'text-center',
|
|
|
+ {headerName: "할인구간", field: "sectionGb", width: 100, cellClass: 'text-center', editable: false,
|
|
|
cellEditor: 'agRichSelectCellEditor',
|
|
|
cellEditorParams: { values: gagaAgGrid.extractValues(sectionGbList), required: true },
|
|
|
valueFormatter: function (params) { return gagaAgGrid.lookupValue(sectionGbList, params.value); },
|
|
|
@@ -382,10 +428,9 @@
|
|
|
return '0';
|
|
|
}
|
|
|
},
|
|
|
- cellEditor: 'textCellEditor',
|
|
|
cellEditorParams: { maxlength: 14, validType: 'numeric'}
|
|
|
},
|
|
|
- {headerName: "할인구분", field: "dcWay", width: 100, cellClass: 'text-center',
|
|
|
+ {headerName: "할인구분", field: "dcWay", width: 100, cellClass: 'text-center', editable: false,
|
|
|
cellEditor: 'agRichSelectCellEditor',
|
|
|
cellEditorParams: { values: gagaAgGrid.extractValues(dcWayList), required: true },
|
|
|
valueFormatter: function (params) { return gagaAgGrid.lookupValue(dcWayList, params.value); },
|
|
|
@@ -394,12 +439,18 @@
|
|
|
{headerName: "할인값", field: "dcVal", width: 100, cellClass: 'text-right', required: true
|
|
|
,valueFormatter: function(params) {
|
|
|
if(params.value && params.value > 0) {
|
|
|
+ if(params.data.dcWay == "G240_11"){
|
|
|
+ if(params.value.length > 2){
|
|
|
+ mcxDialog.alert('할인율은 100이하로 설정해주세요.');
|
|
|
+ params.data.dcVal = '0';
|
|
|
+ return '0';
|
|
|
+ }
|
|
|
+ }
|
|
|
return params.value.addComma();
|
|
|
} else {
|
|
|
return '0';
|
|
|
}
|
|
|
},
|
|
|
- cellEditor: 'textCellEditor',
|
|
|
cellEditorParams: { maxlength: 14, validType: 'numeric'}
|
|
|
},
|
|
|
{headerName: "구간시퀀스", field: "tmtbSectionSq", width: 150, cellClass: 'text-center', hide: true},
|
|
|
@@ -435,9 +486,9 @@
|
|
|
// Grid editable
|
|
|
gridOptionsSectionGbList.defaultColDef.editable = true;
|
|
|
// Add on options
|
|
|
- gridOptionsSectionGbList.suppressRowClickSelection = true;
|
|
|
+ //gridOptionsSectionGbList.suppressRowClickSelection = true;
|
|
|
gridOptionsSectionGbList.rowSelection = "multiple";
|
|
|
- gridOptionsSectionGbList.stopEditingWhenGridLosesFocus = true;
|
|
|
+ //gridOptionsSectionGbList.stopEditingWhenGridLosesFocus = true;
|
|
|
|
|
|
// 다른 다다익선 사용중인 중복상품 엑셀 리스트 설정
|
|
|
var gridOptionsDuplicateGoodsList = gagaAgGrid.getGridOptions(columnDuplicateGoodsList);
|
|
|
@@ -453,6 +504,9 @@
|
|
|
gagaAgGrid.createGrid("gridSectionGbList", gridOptionsSectionGbList);
|
|
|
gagaAgGrid.createGrid("gridDuplicateGoodsList", gridOptionsDuplicateGoodsList);
|
|
|
|
|
|
+ // 일단 버튼 숨김
|
|
|
+ $(".tmtbButton").hide();
|
|
|
+
|
|
|
// 2. 그리드 데이터 바인딩
|
|
|
if(mode == "U"){
|
|
|
gridOptionsFGCompanyList.api.setRowData(tmtbSupplyCompList);
|
|
|
@@ -465,78 +519,30 @@
|
|
|
$('#moreBetterForm input[name=tmtbNm]').val(tmtbMstInfo.tmtbNm);
|
|
|
$('#moreBetterForm input[name=tmtbStdt]').val(tmtbMstInfo.tmtbStdt);
|
|
|
$('#moreBetterForm input[name=tmtbEddt]').val(tmtbMstInfo.tmtbEddt);
|
|
|
+ $('#moreBetterForm #regInfo').text(tmtbMstInfo.regNm + "(" + tmtbMstInfo.regDt + ")");
|
|
|
+ $('#moreBetterForm #updInfo').text(tmtbMstInfo.updNm + "(" + tmtbMstInfo.updDt + ")");
|
|
|
$("input:radio[name='disTmtbStat']:radio[value="+tmtbMstInfo.tmtbStat+"]").prop('checked', true); // 선택하기
|
|
|
$("input:radio[name='sectionGb']:radio[value="+tmtbMstInfo.sectionGb+"]").prop('checked', true); // 선택하기
|
|
|
$("input:radio[name='dcWay']:radio[value="+tmtbMstInfo.dcWay+"]").prop('checked', true); // 선택하기
|
|
|
$("input:radio[name='multiYn']:radio[value="+tmtbMstInfo.multiYn+"]").prop('checked', true); // 선택하기
|
|
|
|
|
|
+ if(tmtbMstInfo.tmtbStat == "G232_10"){
|
|
|
+ $("#btnMorebetterSave").show(); // 저장버튼
|
|
|
+ $("#btnChangeStatIng").show(); // 진행버튼
|
|
|
+ $("#btnMorebetterDelete").show(); // 삭제버튼
|
|
|
+ }else if(tmtbMstInfo.tmtbStat == "G232_11"){
|
|
|
+ $("#btnMorebetterSave").show(); // 저장버튼
|
|
|
+ $("#btnMorebetterStop").show(); // 중지버튼
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
// 구분 -> 대기로 체크
|
|
|
if(mode=="N"){
|
|
|
$("input:radio[name='disTmtbStat']:radio[value='G232_10']").prop('checked', true); // 선택하기
|
|
|
+ $("#btnMorebetterSave").show(); // 저장버튼
|
|
|
}
|
|
|
- cfnCreateCalendar('#tmtbTerms', 'tmtbStdt', 'tmtbEddt', true, '행사기간', 'X');
|
|
|
- });
|
|
|
-
|
|
|
- // 수정 버튼 클릭시
|
|
|
- $('#btnMorebetterUpdate').on('click', function() {
|
|
|
- // validation
|
|
|
- if (!gagajf.validation('#moreBetterForm'))
|
|
|
- return false;
|
|
|
-
|
|
|
- // 행사기간 확인
|
|
|
- let fromDate = $('#moreBetterForm input[name=tmtbStdt]').val();
|
|
|
- let toDate = $('#moreBetterForm input[name=tmtbEddt]').val();
|
|
|
-
|
|
|
- if (gagajf.isNull(fromDate) || gagajf.isNull(toDate)) {
|
|
|
- mcxDialog.alert("행사 기간 시작일자와 종료일자를 입력하세요.");
|
|
|
- $('#moreBetterForm input[name=tmtbStdt]').focus();
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- if (fromDate > toDate) {
|
|
|
- mcxDialog.alert("시작일자는 종료일자 보다 클 수 없습니다.");
|
|
|
- $('#moreBetterForm input[name=tmtbStdt]').focus();
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- // disabled 값 넘겨주기
|
|
|
- $('#moreBetterForm input[name=tmtbSq]').val($('#moreBetterForm input[name=disTmtbSq]').val());
|
|
|
- $('#moreBetterForm input[name=tmtbStat]').val($('input:radio[name="disTmtbStat"]:checked').val());
|
|
|
-
|
|
|
- mcxDialog.confirm('수정하시겠습니까?', {
|
|
|
- cancelBtnText: "취소",
|
|
|
- sureBtnText: "확인",
|
|
|
- sureBtnClick: function(){
|
|
|
- var compAllData = gagaAgGrid.getAllRowData(gridOptionsFGCompanyList); //selectedRowData
|
|
|
- var brandAllData = gagaAgGrid.getAllRowData(gridOptionsFGBrandList);
|
|
|
- var applyAllData = gagaAgGrid.getAllRowData(gridOptionsFGApplyGoodsList);
|
|
|
- var exceptAllData = gagaAgGrid.getAllRowData(gridOptionsFGExceptGoodsList);
|
|
|
- var burdenAllData = gagaAgGrid.getAllRowData(gridOptionsApplyBurdenList);
|
|
|
- var sectionGbAllData = gagaAgGrid.getAllRowData(gridOptionsSectionGbList);
|
|
|
-
|
|
|
- var jsonSupplyCompData = JSON.stringify(compAllData);
|
|
|
- $('#moreBetterForm input[name=supplyCompList]').val(jsonSupplyCompData);
|
|
|
- var jsonBrandData = JSON.stringify(brandAllData);
|
|
|
- $('#moreBetterForm input[name=brandList]').val(jsonBrandData);
|
|
|
- var jsonApplyData = JSON.stringify(applyAllData);
|
|
|
- $('#moreBetterForm input[name=applyGoodsList]').val(jsonApplyData);
|
|
|
- var jsonExceptData = JSON.stringify(exceptAllData);
|
|
|
- $('#moreBetterForm input[name=exceptGoodsList]').val(jsonExceptData);
|
|
|
- var jsonSectionGbData = JSON.stringify(sectionGbAllData);
|
|
|
- $('#moreBetterForm input[name=sectionGbList]').val(jsonSectionGbData);
|
|
|
- var jsonBurdenData = JSON.stringify(burdenAllData);
|
|
|
- $('#moreBetterForm input[name=burdenList]').val(jsonBurdenData);
|
|
|
-
|
|
|
- var jsonData = JSON.stringify($('#moreBetterForm').serializeObject());
|
|
|
- gagajf.ajaxJsonSubmit($('#moreBetterForm').prop('action'), jsonData, function() {
|
|
|
- fnMorebetterFormClose();
|
|
|
- $('#btnInit').trigger('click');
|
|
|
- $('#btnSearch').trigger('click');
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
+ //cfnCreateCalendar('#tmtbTerms', 'tmtbStdt', 'tmtbEddt', true, '행사기간', 'X');
|
|
|
+ cfnCreateCalendar('#tmtbTerms', 'eventStdt', 'eventEddt', true, '행사기간', 'X');
|
|
|
});
|
|
|
|
|
|
var fnGoodsGbCheck = function (){
|
|
|
@@ -547,12 +553,23 @@
|
|
|
checkCnt++;
|
|
|
}
|
|
|
});
|
|
|
- console.log('checkCnt>>'+checkCnt);
|
|
|
+
|
|
|
if(checkCnt < 1){
|
|
|
mcxDialog.alert("기본상품을 1개 이상 지정해주세요.");
|
|
|
return false;
|
|
|
- }else{
|
|
|
- console.log('통과');
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ var fnBurdenValueCheck = function (){
|
|
|
+ let burdenData = gagaAgGrid.getAllRowData(gridOptionsApplyBurdenList);
|
|
|
+ let totalValue = 0;
|
|
|
+ $.each(burdenData, function(idx, item) {
|
|
|
+ totalValue += parseInt(item.tmtbBurdenRate);
|
|
|
+ });
|
|
|
+
|
|
|
+ if(totalValue > 100) {
|
|
|
+ mcxDialog.alert("업체분담율의 합이 100을 넘을수 없습니다.");
|
|
|
+ return false;
|
|
|
}
|
|
|
};
|
|
|
|
|
|
@@ -563,15 +580,23 @@
|
|
|
return false;
|
|
|
|
|
|
// 행사기간 확인
|
|
|
- let fromDate = $('#moreBetterForm input[name=tmtbStdt]').val();
|
|
|
- let toDate = $('#moreBetterForm input[name=tmtbEddt]').val();
|
|
|
-
|
|
|
- if (gagajf.isNull(fromDate) || gagajf.isNull(toDate)) {
|
|
|
+ if (gagajf.isNull($('#moreBetterForm input[name=eventStdt]').val()) || gagajf.isNull($('#moreBetterForm input[name=eventEddt]').val())) {
|
|
|
mcxDialog.alert("행사 기간 시작일자와 종료일자를 입력하세요.");
|
|
|
$('#moreBetterForm input[name=tmtbStdt]').focus();
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
+ var eventStDt = $('#moreBetterForm input[name=eventStdt]').val()+$('#moreBetterForm select[name=eventStHH]').val()+$('#moreBetterForm select[name=eventStMM]').val()+'00';
|
|
|
+ var eventEdDt = $('#moreBetterForm input[name=eventEddt]').val()+$('#moreBetterForm select[name=eventEdHH]').val()+$('#moreBetterForm select[name=eventEdMM]').val()+'59';
|
|
|
+
|
|
|
+ eventStDt = eventStDt.replace(/[^0-9]/g, '');
|
|
|
+ eventEdDt = eventEdDt.replace(/[^0-9]/g, '');
|
|
|
+ console.log('2.eventStDt>>'+eventStDt);
|
|
|
+ console.log('3.eventEdDt>>'+eventEdDt);
|
|
|
+
|
|
|
+ let fromDate = $('#moreBetterForm input[name=tmtbStdt]').val(eventStDt);
|
|
|
+ let toDate = $('#moreBetterForm input[name=tmtbEddt]').val(eventEdDt);
|
|
|
+
|
|
|
if (fromDate > toDate) {
|
|
|
mcxDialog.alert("시작일자는 종료일자 보다 클 수 없습니다.");
|
|
|
$('#moreBetterForm input[name=tmtbStdt]').focus();
|
|
|
@@ -607,6 +632,30 @@
|
|
|
// 적용상품 그리드에 기본상품 1개이상 있는지 체크
|
|
|
fnGoodsGbCheck();
|
|
|
|
|
|
+ // 업체분담율 토탈 100% 넘는지 체크
|
|
|
+ fnBurdenValueCheck();
|
|
|
+
|
|
|
+ // 공급업체+브랜드 상품조회
|
|
|
+ var multiSupplyCompCd = [];
|
|
|
+ $.each(allSupplyCompData, function(idx, item) {
|
|
|
+ multiSupplyCompCd.push(item.supplyCompCd);
|
|
|
+ });
|
|
|
+
|
|
|
+ var multiBrand = [];
|
|
|
+ $.each(allBrandData, function(idx, item) {
|
|
|
+ multiBrand.push(item.brandCd);
|
|
|
+ });
|
|
|
+
|
|
|
+ var multiApplyGoods = [];
|
|
|
+ $.each(allApplyGoodsData, function(idx, item) {
|
|
|
+ multiApplyGoods.push(item.goodsCd);
|
|
|
+ });
|
|
|
+
|
|
|
+ var multiExceptGoods = [];
|
|
|
+ $.each(allExceptGoodsData, function(idx, item) {
|
|
|
+ multiExceptGoods.push(item.goodsCd);
|
|
|
+ });
|
|
|
+
|
|
|
var data = {
|
|
|
mode : $('#moreBetterForm input[name=mode]').val()
|
|
|
, tmtbSq : $('#moreBetterForm input[name=disTmtbSq]').val()
|
|
|
@@ -624,6 +673,10 @@
|
|
|
, exceptGoodsList : allExceptGoodsData
|
|
|
, burdenList : allApplyBurdenData
|
|
|
, sectionGbList : allSectionGbData
|
|
|
+ , multiSupplyCompCd : multiSupplyCompCd
|
|
|
+ , multiBrand : multiBrand
|
|
|
+ , multiApplyGoods : multiApplyGoods
|
|
|
+ , multiExceptGoods : multiExceptGoods
|
|
|
};
|
|
|
|
|
|
var jsonData = JSON.stringify(data);
|
|
|
@@ -643,7 +696,7 @@
|
|
|
|
|
|
return;
|
|
|
}else{
|
|
|
- mcxDialog.alert(result.msg);
|
|
|
+ //mcxDialog.alert(result.message);
|
|
|
fnMorebetterFormClose();
|
|
|
$('#btnInit').trigger('click');
|
|
|
$('#btnSearch').trigger('click');
|
|
|
@@ -742,20 +795,31 @@
|
|
|
goodsGbVal = "G800_30";
|
|
|
}
|
|
|
|
|
|
+ let addCnt = 0;
|
|
|
+ let failCnt = 0;
|
|
|
+ let dupliCnt = 0;
|
|
|
+
|
|
|
for(let i = 0 ; i < result.length ; i++) {
|
|
|
let addChk = true, gridListValue = gagaAgGrid.getAllRowData(OriginGridListOption); // 받아온 모든 데이터
|
|
|
|
|
|
// 받아온 data for
|
|
|
for(let j = 0 ; j < gridListValue.length ; j++) {
|
|
|
- if(gridListValue[j].goodsCd == result[i].goodsCd) { addChk = false; } // 중복체크
|
|
|
+ if(gridListValue[j].goodsCd == result[i].goodsCd) { // 중복체크
|
|
|
+ addChk = false;
|
|
|
+ dupliCnt++;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
// 중복되지 않은 데이터 리스트에 추가
|
|
|
if(addChk) {
|
|
|
//gagaAgGrid.addRowData(OriginGridListOption, result[i], "goodsCd");
|
|
|
gagaAgGrid.addRowData(OriginGridListOption, {"goodsGb": goodsGbVal, "goodsCd" : result[i].goodsCd, "goodsNm" : result[i].goodsNm, "targetGb" : "G260_10"});
|
|
|
+ addCnt++;
|
|
|
}
|
|
|
}
|
|
|
+ uifnPopupClose('popupGoods');
|
|
|
+ failCnt = result.length - addCnt - dupliCnt;
|
|
|
+ mcxDialog.alert("데이터가 적용되었습니다.<br/>" + addCnt + "건 성공, "+ dupliCnt + "건 중복, " + failCnt + "건 실패");
|
|
|
}
|
|
|
|
|
|
// 공급업체 설정 업체 추가 버튼 클릭시
|
|
|
@@ -869,18 +933,19 @@
|
|
|
var dcWayValue = $('input:radio[name="dcWay"]:checked').val();
|
|
|
var loopRowData = gagaAgGrid.getAllRowData(gridOptionsSectionGbList);
|
|
|
|
|
|
- if (loopRowData.length == 0) {
|
|
|
+ /*if (loopRowData.length == 0) {
|
|
|
mcxDialog.alert('ROW 데이터가 없습니다.');
|
|
|
return;
|
|
|
+ }*/
|
|
|
+ if(loopRowData.length > 0) {
|
|
|
+ for (i = 0; i < loopRowData.length; i++) {
|
|
|
+ loopRowData[i].sectionGb = sectionGbValue;
|
|
|
+ loopRowData[i].sectionVal = "";
|
|
|
+ loopRowData[i].dcWay = dcWayValue;
|
|
|
+ loopRowData[i].dcVal = "";
|
|
|
+ }
|
|
|
+ gridOptionsSectionGbList.api.setRowData(loopRowData);
|
|
|
}
|
|
|
-
|
|
|
- for(i=0; i<loopRowData.length; i++){
|
|
|
- loopRowData[i].sectionGb = sectionGbValue;
|
|
|
- loopRowData[i].sectionVal = "";
|
|
|
- loopRowData[i].dcWay = dcWayValue;
|
|
|
- loopRowData[i].dcVal = "";
|
|
|
- }
|
|
|
- gridOptionsSectionGbList.api.setRowData(loopRowData);
|
|
|
});
|
|
|
|
|
|
// 할인구분 선택 시 기본 조건 변경
|
|
|
@@ -889,18 +954,19 @@
|
|
|
var dcWayValue = $(this).val();
|
|
|
var loopRowData = gagaAgGrid.getAllRowData(gridOptionsSectionGbList);
|
|
|
|
|
|
- if (loopRowData.length == 0) {
|
|
|
+ /*if (loopRowData.length == 0) {
|
|
|
mcxDialog.alert('ROW 데이터가 없습니다.');
|
|
|
return;
|
|
|
+ }*/
|
|
|
+ if(loopRowData.length > 0) {
|
|
|
+ for (i = 0; i < loopRowData.length; i++) {
|
|
|
+ loopRowData[i].sectionGb = sectionGbValue;
|
|
|
+ loopRowData[i].sectionVal = "";
|
|
|
+ loopRowData[i].dcWay = dcWayValue;
|
|
|
+ loopRowData[i].dcVal = "";
|
|
|
+ }
|
|
|
+ gridOptionsSectionGbList.api.setRowData(loopRowData);
|
|
|
}
|
|
|
-
|
|
|
- for(i=0; i<loopRowData.length; i++){
|
|
|
- loopRowData[i].sectionGb = sectionGbValue;
|
|
|
- loopRowData[i].sectionVal = "";
|
|
|
- loopRowData[i].dcWay = dcWayValue;
|
|
|
- loopRowData[i].dcVal = "";
|
|
|
- }
|
|
|
- gridOptionsSectionGbList.api.setRowData(loopRowData);
|
|
|
});
|
|
|
|
|
|
// 공급업체 행삭제
|
|
|
@@ -1038,8 +1104,119 @@
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- $(document).ready(function() {
|
|
|
|
|
|
+ // 수정 버튼 클릭시
|
|
|
+ $('#btnMorebetterUpdate').on('click', function() {
|
|
|
+ // validation
|
|
|
+ if (!gagajf.validation('#moreBetterForm'))
|
|
|
+ return false;
|
|
|
+
|
|
|
+ // 행사기간 확인
|
|
|
+ let fromDate = $('#moreBetterForm input[name=tmtbStdt]').val();
|
|
|
+ let toDate = $('#moreBetterForm input[name=tmtbEddt]').val();
|
|
|
+
|
|
|
+ if (gagajf.isNull(fromDate) || gagajf.isNull(toDate)) {
|
|
|
+ mcxDialog.alert("행사 기간 시작일자와 종료일자를 입력하세요.");
|
|
|
+ $('#moreBetterForm input[name=tmtbStdt]').focus();
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (fromDate > toDate) {
|
|
|
+ mcxDialog.alert("시작일자는 종료일자 보다 클 수 없습니다.");
|
|
|
+ $('#moreBetterForm input[name=tmtbStdt]').focus();
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ // disabled 값 넘겨주기
|
|
|
+ $('#moreBetterForm input[name=tmtbSq]').val($('#moreBetterForm input[name=disTmtbSq]').val());
|
|
|
+ $('#moreBetterForm input[name=tmtbStat]').val($('input:radio[name="disTmtbStat"]:checked').val());
|
|
|
+
|
|
|
+ mcxDialog.confirm('수정하시겠습니까?', {
|
|
|
+ cancelBtnText: "취소",
|
|
|
+ sureBtnText: "확인",
|
|
|
+ sureBtnClick: function(){
|
|
|
+ var compAllData = gagaAgGrid.getAllRowData(gridOptionsFGCompanyList); //selectedRowData
|
|
|
+ var brandAllData = gagaAgGrid.getAllRowData(gridOptionsFGBrandList);
|
|
|
+ var applyAllData = gagaAgGrid.getAllRowData(gridOptionsFGApplyGoodsList);
|
|
|
+ var exceptAllData = gagaAgGrid.getAllRowData(gridOptionsFGExceptGoodsList);
|
|
|
+ var burdenAllData = gagaAgGrid.getAllRowData(gridOptionsApplyBurdenList);
|
|
|
+ var sectionGbAllData = gagaAgGrid.getAllRowData(gridOptionsSectionGbList);
|
|
|
+
|
|
|
+ var jsonSupplyCompData = JSON.stringify(compAllData);
|
|
|
+ $('#moreBetterForm input[name=supplyCompList]').val(jsonSupplyCompData);
|
|
|
+ var jsonBrandData = JSON.stringify(brandAllData);
|
|
|
+ $('#moreBetterForm input[name=brandList]').val(jsonBrandData);
|
|
|
+ var jsonApplyData = JSON.stringify(applyAllData);
|
|
|
+ $('#moreBetterForm input[name=applyGoodsList]').val(jsonApplyData);
|
|
|
+ var jsonExceptData = JSON.stringify(exceptAllData);
|
|
|
+ $('#moreBetterForm input[name=exceptGoodsList]').val(jsonExceptData);
|
|
|
+ var jsonSectionGbData = JSON.stringify(sectionGbAllData);
|
|
|
+ $('#moreBetterForm input[name=sectionGbList]').val(jsonSectionGbData);
|
|
|
+ var jsonBurdenData = JSON.stringify(burdenAllData);
|
|
|
+ $('#moreBetterForm input[name=burdenList]').val(jsonBurdenData);
|
|
|
+
|
|
|
+ var jsonData = JSON.stringify($('#moreBetterForm').serializeObject());
|
|
|
+ gagajf.ajaxJsonSubmit($('#moreBetterForm').prop('action'), jsonData, function() {
|
|
|
+ fnMorebetterFormClose();
|
|
|
+ $('#btnInit').trigger('click');
|
|
|
+ $('#btnSearch').trigger('click');
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ // 목록 버튼 클릭
|
|
|
+ $("#moreBetterForm #btnSearchList").on("click", function() {
|
|
|
+ uifnPopupClose('popupMorebetterReg');
|
|
|
});
|
|
|
+
|
|
|
+ // 진행 버튼 클릭
|
|
|
+ $("#moreBetterForm #btnChangeStatIng").on("click", function() {
|
|
|
+ mcxDialog.confirmC("프로모션을 진행하시겠습니까?<br/>진행 후에는 수정이 제한될 수 있습니다.", {
|
|
|
+ btn: confirmBtnText,
|
|
|
+ btnClick: function(index) {
|
|
|
+ if(index == 1) {
|
|
|
+ let data = { tmtbStat : "G232_11" // 진행
|
|
|
+ , tmtbSq : $('#moreBetterForm input[name=disTmtbSq]').val()
|
|
|
+ }
|
|
|
+ var jsonData = JSON.stringify(data);
|
|
|
+ gagajf.ajaxJsonSubmit('/marketing/morebetter/changeStat', jsonData, fnMorebetterFormClose);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ // 진행 버튼 클릭
|
|
|
+ $("#moreBetterForm #btnMorebetterStop").on("click", function() {
|
|
|
+ mcxDialog.confirmC("프로모션을 중지하시겠습니까?<br/>중지 후에는 진행으로 복원하실 수 없습니다.", {
|
|
|
+ btn: confirmBtnText,
|
|
|
+ btnClick: function(index) {
|
|
|
+ if(index == 1) {
|
|
|
+ let data = { tmtbStat : "G232_12" // 중지
|
|
|
+ , tmtbSq : $('#moreBetterForm input[name=disTmtbSq]').val()
|
|
|
+ }
|
|
|
+ var jsonData = JSON.stringify(data);
|
|
|
+ gagajf.ajaxJsonSubmit('/marketing/morebetter/changeStat', jsonData, fnMorebetterFormClose);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ // 삭제 버튼 클릭
|
|
|
+ $("#btnMorebetterDelete").on("click", function() {
|
|
|
+ mcxDialog.confirmC("프로모션을 삭제하시겠습니까?<br/>삭제한 프로모션은 복원하실 수 없습니다.", {
|
|
|
+ btn: confirmBtnText,
|
|
|
+ btnClick: function(index) {
|
|
|
+ if(index == 1) {
|
|
|
+ let data = { tmtbStat: "G232_14" // 삭제
|
|
|
+ , tmtbSq : $('#moreBetterForm input[name=disTmtbSq]').val()
|
|
|
+ }
|
|
|
+ var jsonData = JSON.stringify(data);
|
|
|
+ gagajf.ajaxJsonSubmit('/marketing/morebetter/changeStat', jsonData, fnMorebetterFormClose);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
</script>
|
|
|
</html>
|