|
|
@@ -22,9 +22,8 @@
|
|
|
<!-- 메뉴 설명 -->
|
|
|
<div class="infoBox menu-desc">
|
|
|
</div>
|
|
|
- <form id="goodsUnregisterListForm" name="goodsUnregisterListForm" action="#" th:action="@{'/goods/wms/incomelot/list'}">
|
|
|
+ <form id="goodsWmsIncomelotForm" name="goodsWmsIncomelotForm" action="#" th:action="@{'/goods/wms/incomelot/list'}">
|
|
|
<input type="hidden" id="searchGb" name="searchGb" />
|
|
|
- <input type="hidden" id="dateGbn" name="dateGbn" value="R" />
|
|
|
<!-- 패널 영역1 -->
|
|
|
<div class="panelStyle" >
|
|
|
<div class="panelTitle">
|
|
|
@@ -72,7 +71,7 @@
|
|
|
<div class="panelStyle">
|
|
|
<ul class="panelBar">
|
|
|
<li class="right">
|
|
|
- <button type="button" class="btn btn-primary btn-lg" id="btnGoodsSetMake">사은품 등록</button>
|
|
|
+ <button type="button" class="btn btn-primary btn-lg" id="btnCreateFreeGoods">사은품 등록</button>
|
|
|
</li>
|
|
|
</ul>
|
|
|
<!-- 검색결과 영역 -->
|
|
|
@@ -91,43 +90,50 @@
|
|
|
<script th:inline="javascript">
|
|
|
/*<![CDATA[*/
|
|
|
var sessRoleCd = [[${sessionInfo.roleCd}]];
|
|
|
- var goodsStatList = gagajf.convertToArray([[${goodsStatList}]]);
|
|
|
- var itemkindList = gagajf.convertToArray([[${itemkindList}]]);
|
|
|
var columnDefs = [
|
|
|
{width: 40, minWidth: 40, cellClass: 'text-right', headerCheckboxSelection: true, checkboxSelection: true, filter: false},
|
|
|
{headerName: 'No', width: 60, cellClass: 'text-center', valueGetter: function(params) { return params.node.rowIndex + 1 }},
|
|
|
{headerName: "브랜드", field: "brandCd", width: 100, cellClass: 'text-center'},
|
|
|
{headerName: "브랜드명", field: "brandEnm", width: 130, cellClass: 'text-center'},
|
|
|
- {headerName: "상품코드", field: "goodsCd", width: 120, cellClass: 'text-center'},
|
|
|
- {headerName: "ERP상품명", field: "erpGoodsNm", width: 200, cellClass: 'text-left'},
|
|
|
- {headerName: "상품명", field: "goodsNm", width: 200, cellClass: 'text-left'},
|
|
|
- //{headerName: "품목코드", field: "itemkindCd", width: 100, cellClass: 'text-center'},
|
|
|
- {headerName: "품목명", field: "itemkindCd" , width: 200, cellClass: 'text-left',
|
|
|
- cellEditorParams: { values: gagaAgGrid.extractValues(itemkindList) },
|
|
|
- valueFormatter: function (params) { return gagaAgGrid.lookupValue(itemkindList, params.value); },
|
|
|
- valueParser: function (params) { return gagaAgGrid.lookupKey(itemkindList, params.newValue); }
|
|
|
- },
|
|
|
+ {headerName: "WMS상품코드", field: "productCode", width: 120, cellClass: 'text-center'},
|
|
|
+ {headerName: "WMS상품명", field: "productName", width: 400, cellClass: 'text-left'},
|
|
|
+ {headerName: "모델번호", field: "modelNo" , width: 200, cellClass: 'text-center'},
|
|
|
{headerName: "등록일시", field: "regDt", width: 150, cellClass: 'text-center',
|
|
|
cellRenderer: function(params) {
|
|
|
return !gagajf.isNull(params.value) ? params.value.toDate("YYYYMMDDHHmmss").format("YYYY-MM-DD HH:mm:ss") : '';
|
|
|
}
|
|
|
},
|
|
|
- {headerName: "등록자", field: "regId", width: 100, cellClass: 'text-center'},
|
|
|
+ {headerName: "등록자", field: "regNm", width: 100, cellClass: 'text-center'
|
|
|
+ ,valueFormatter: function(params) {
|
|
|
+ if (params.data.regNo == 0) {
|
|
|
+ return '배치';
|
|
|
+ }else{
|
|
|
+ return params.value;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
{headerName: "수정일시", field: "updDt", width: 150, cellClass: 'text-center',
|
|
|
cellRenderer: function(params) {
|
|
|
return !gagajf.isNull(params.value) ? params.value.toDate("YYYYMMDDHHmmss").format("YYYY-MM-DD HH:mm:ss") : '';
|
|
|
}
|
|
|
},
|
|
|
- {headerName: "수정자", field: "updId", width: 100, cellClass: 'text-center'}
|
|
|
+ {headerName: "수정자", field: "updNm", width: 100, cellClass: 'text-center'
|
|
|
+ ,valueFormatter: function(params) {
|
|
|
+ if (params.data.updNo == 0) {
|
|
|
+ return '배치';
|
|
|
+ }else{
|
|
|
+ return params.value;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
];
|
|
|
|
|
|
// Get GridOptions
|
|
|
var gridOptions = gagaAgGrid.getGridOptions(columnDefs);
|
|
|
|
|
|
// 중복 선택 가능
|
|
|
- //gridOptions.rowSelection = 'multiple';
|
|
|
+ gridOptions.rowSelection = 'multiple';
|
|
|
gridOptions.suppressRowClickSelection = true;
|
|
|
- //gridOptions.rowHeight = 60; //이미지가 있을경우 높이 지정해야함.
|
|
|
|
|
|
// 초기화 클릭시
|
|
|
$('#btnInit').on('click', function() {
|
|
|
@@ -135,50 +141,48 @@
|
|
|
});
|
|
|
|
|
|
var fnInit = function(){
|
|
|
- $('#goodsUnregisterListForm')[0].reset();
|
|
|
- //$("#goodsUnregisterListForm input[type=radio]").removeClass("checked");
|
|
|
- $("#goodsUnregisterListForm input[type=checkbox]").removeClass("checked");
|
|
|
- //$("#goodsUnregisterListForm input[type=radio]").parent("label").removeClass("checked");
|
|
|
- $("#goodsUnregisterListForm input[type=checkbox]").parent("label").removeClass("checked");
|
|
|
- $("#goodsUnregisterListForm input[type=radio][checked]").parent("label").addClass("checked");
|
|
|
+ $('#goodsWmsIncomelotForm')[0].reset();
|
|
|
+ //$("#goodsWmsIncomelotForm input[type=radio]").removeClass("checked");
|
|
|
+ $("#goodsWmsIncomelotForm input[type=checkbox]").removeClass("checked");
|
|
|
+ //$("#goodsWmsIncomelotForm input[type=radio]").parent("label").removeClass("checked");
|
|
|
+ $("#goodsWmsIncomelotForm input[type=checkbox]").parent("label").removeClass("checked");
|
|
|
+ $("#goodsWmsIncomelotForm input[type=radio][checked]").parent("label").addClass("checked");
|
|
|
}
|
|
|
|
|
|
// 조회클릭시
|
|
|
$('#btnSearch').on('click', function() {
|
|
|
- fnGoodsUnregisterListSearch('BASIC');
|
|
|
+ fnGoodsWmsIncomelotListSearch('BASIC');
|
|
|
});
|
|
|
|
|
|
// 조회
|
|
|
- var fnGoodsUnregisterListSearch = function(gbn) {
|
|
|
+ var fnGoodsWmsIncomelotListSearch = function(gbn) {
|
|
|
|
|
|
if (typeof(gbn) != 'undefined' && gbn == 'EXCEL'){
|
|
|
- $("#goodsUnregisterListForm input[name=searchGb]").val("EXCEL");
|
|
|
- }else if (typeof(gbn) != 'undefined' && gbn == 'EXCELRESULT'){
|
|
|
- $("#goodsUnregisterListForm input[name=searchGb]").val("EXCELRESULT");
|
|
|
+ $("#goodsWmsIncomelotForm input[name=searchGb]").val("EXCEL");
|
|
|
}else{
|
|
|
- $("#goodsUnregisterListForm input[name=searchGb]").val("BASIC");
|
|
|
+ $("#goodsWmsIncomelotForm input[name=searchGb]").val("BASIC");
|
|
|
}
|
|
|
|
|
|
if(!fnConditionCheck()) return;
|
|
|
|
|
|
- gagaAgGrid.fetch($('#goodsUnregisterListForm').prop('action'), gridOptions, '#goodsUnregisterListForm');
|
|
|
+ gagaAgGrid.fetch($('#goodsWmsIncomelotForm').prop('action'), gridOptions, '#goodsWmsIncomelotForm');
|
|
|
}
|
|
|
|
|
|
//검색 조건 확인
|
|
|
var fnConditionCheck = function(){
|
|
|
- var formId = '#goodsUnregisterListForm';
|
|
|
- var form = document.goodsUnregisterListForm;
|
|
|
+ var formId = '#goodsWmsIncomelotForm';
|
|
|
+ var form = document.goodsWmsIncomelotForm;
|
|
|
|
|
|
- if($("#goodsUnregisterListForm input[name=searchGb]").val() == "EXCEL" || $("#goodsUnregisterListForm input[name=searchGb]").val() == "EXCELRESULT") {
|
|
|
+ if($("#goodsWmsIncomelotForm input[name=searchGb]").val() == "EXCEL") {
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
var searchFlag = false;
|
|
|
var cnt = 0;
|
|
|
|
|
|
- /* if( !gagajf.isNull($("#goodsUnregisterListForm select[name=supplyCompCd]").val())
|
|
|
- || !gagajf.isNull($("#goodsUnregisterListForm input[name=condition]").val())
|
|
|
- || (!gagajf.isNull($("#goodsUnregisterListForm input[name=stDate]").val()) && !gagajf.isNull($("#goodsUnregisterListForm input[name=edDate]").val()))
|
|
|
+ /* if( !gagajf.isNull($("#goodsWmsIncomelotForm select[name=supplyCompCd]").val())
|
|
|
+ || !gagajf.isNull($("#goodsWmsIncomelotForm input[name=condition]").val())
|
|
|
+ || (!gagajf.isNull($("#goodsWmsIncomelotForm input[name=stDate]").val()) && !gagajf.isNull($("#goodsWmsIncomelotForm input[name=edDate]").val()))
|
|
|
){
|
|
|
searchFlag = true;
|
|
|
}else{ */
|
|
|
@@ -201,8 +205,8 @@
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
- var fromDate = $('#goodsUnregisterListForm input[name=stDate]').val();
|
|
|
- var toDate = $('#goodsUnregisterListForm input[name=edDate]').val();
|
|
|
+ var fromDate = $('#goodsWmsIncomelotForm input[name=stDate]').val();
|
|
|
+ var toDate = $('#goodsWmsIncomelotForm input[name=edDate]').val();
|
|
|
|
|
|
if (!gagajf.isNull(fromDate) || !gagajf.isNull(toDate)) {
|
|
|
|
|
|
@@ -210,7 +214,7 @@
|
|
|
mcxDialog.alertC("등록일 조회시 시작일자와 종료일자를 입력하세요.", {
|
|
|
sureBtnText: "확인",
|
|
|
sureBtnClick: function() {
|
|
|
- $('#goodsUnregisterListForm input[name=stDate]').focus();
|
|
|
+ $('#goodsWmsIncomelotForm input[name=stDate]').focus();
|
|
|
}
|
|
|
});
|
|
|
return false;
|
|
|
@@ -220,7 +224,7 @@
|
|
|
mcxDialog.alert("노출기간 시작일자는 종료일자 보다 클 수 없습니다.", {
|
|
|
sureBtnText: "확인",
|
|
|
sureBtnClick: function() {
|
|
|
- $('#goodsUnregisterListForm input[name=stDate]').focus();
|
|
|
+ $('#goodsWmsIncomelotForm input[name=stDate]').focus();
|
|
|
}
|
|
|
});
|
|
|
return false;
|
|
|
@@ -231,65 +235,44 @@
|
|
|
}
|
|
|
|
|
|
//업체변경시
|
|
|
- $('#goodsUnregisterListForm select[name=supplyCompCd]').on('change', function() {
|
|
|
+ $('#goodsWmsIncomelotForm select[name=supplyCompCd]').on('change', function() {
|
|
|
var actionUrl = '/renderer/supplyCompany/brand/list/' + $(this).val();
|
|
|
|
|
|
if(sessRoleCd == "B000"){
|
|
|
actionUrl = '/renderer/brand/AuthBrandlist';
|
|
|
}
|
|
|
- $("#goodsUnregisterListForm select[name=brandCd] option:gt(0)").remove();
|
|
|
+ $("#goodsWmsIncomelotForm select[name=brandCd] option:gt(0)").remove();
|
|
|
|
|
|
- cfnCreateCombo(actionUrl, $('#goodsUnregisterListForm select[name=brandCd]'), "[전체]", "");
|
|
|
+ cfnCreateCombo(actionUrl, $('#goodsWmsIncomelotForm select[name=brandCd]'), "[전체]", "");
|
|
|
});
|
|
|
|
|
|
- //엑셀 다운로드 클릭시
|
|
|
- $('#btnGoodsUnregisterExcelDownLoad').on('click', function() {
|
|
|
- //gagaAgGrid.exportToExcel('온라인미등록상품', gridOptions);
|
|
|
- var date = new Date().format("YYYYMMDDHHmmss");
|
|
|
- var params = {
|
|
|
-
|
|
|
- fileName : "온라인미등록상품_"+ date,
|
|
|
- sheetName: "DATA"
|
|
|
+
|
|
|
+ // 사은품 등록 클릭시
|
|
|
+ $('#btnCreateFreeGoods').on('click', function() {
|
|
|
+
|
|
|
+ //선택된 상품
|
|
|
+ var selectedData = gridOptions.api.getSelectedRows();
|
|
|
+
|
|
|
+ if (selectedData.length == 0) {
|
|
|
+ mcxDialog.alert('선택된 행이 없습니다.');
|
|
|
+ return;
|
|
|
}
|
|
|
- gridOptions.excelStyles = [
|
|
|
- {
|
|
|
- id: 'text-center',
|
|
|
- dataType: 'string',
|
|
|
- font: {size : 10, bold: false}
|
|
|
- },
|
|
|
- {
|
|
|
- id: 'text-left',
|
|
|
- dataType: 'string',
|
|
|
- font: {size : 10, bold: false}
|
|
|
- }
|
|
|
- ]
|
|
|
|
|
|
- gridOptions.api.exportDataAsExcel(params);
|
|
|
- });
|
|
|
-
|
|
|
- //엑셀 상품명/품목코드 저장
|
|
|
- $('#btnGoodsExcelSave').on('click', function() {
|
|
|
- cfnExcelUploadPopup('goodsInfoExcelUpload', 'goodsInfoExcelSave');
|
|
|
- });
|
|
|
-
|
|
|
- var goodsInfoExcelSave = function(result){
|
|
|
- mcxDialog.confirm('상품명/품목코드 저장을 진행하시겠습니까?', {
|
|
|
+ mcxDialog.confirm('사은품 등록을 하시겠습니까?', {
|
|
|
cancelBtnText: "취소",
|
|
|
sureBtnText: "확인",
|
|
|
sureBtnClick: function(){
|
|
|
- var data = {procJob : result.procJob
|
|
|
- ,excelFileNm : result.excelFileNm
|
|
|
- };
|
|
|
- var jsonData = JSON.stringify(data);
|
|
|
- gagajf.ajaxJsonSubmit('/goods/unregister/excelupload/save', jsonData, fnGoodsInfoExcelSaveCallBack);
|
|
|
+ var jsonData = JSON.stringify(selectedData);
|
|
|
+ gagajf.ajaxJsonSubmit('/goods/free/goods/save', jsonData, fnCreateFreeGoodsCollback);
|
|
|
}
|
|
|
- });
|
|
|
- }
|
|
|
+ });
|
|
|
+ });
|
|
|
|
|
|
- var fnGoodsInfoExcelSaveCallBack = function(result){
|
|
|
- fnGoodsUnregisterListSearch("EXCELRESULT");
|
|
|
+ var fnCreateFreeGoodsCollback = function(result){
|
|
|
+ fnGoodsWmsIncomelotListSearch('BASIC');
|
|
|
}
|
|
|
|
|
|
+
|
|
|
$(document).ready(function() {
|
|
|
|
|
|
cfnCreateCalendar('#sellTerms', 'stDate', 'edDate', true, '등록일');
|