|
|
@@ -33,7 +33,7 @@
|
|
|
<input type="hidden" id="niClsfNm" name="niClsfNm" />
|
|
|
<input type="hidden" id="uploadGoodsUrl" name="uploadGoodsUrl" th:value="${@environment.getProperty('upload.goods.view')}"/>
|
|
|
<input type="hidden" id="goodsType" name="goodsType" />
|
|
|
- <input type="hidden" id="extmallGoodsPriceList" name="extmallGoodsPriceList" />
|
|
|
+ <input type="hidden" id="codiGoodsList" name="codiGoodsList" />
|
|
|
<input type="hidden" id="GoodsComposeList" name="GoodsComposeList" />
|
|
|
<table class="frmStyle">
|
|
|
<colgroup>
|
|
|
@@ -386,6 +386,9 @@
|
|
|
<div class="panelStyle">
|
|
|
<!-- 내용 삽입 -->
|
|
|
<ul class="panelBar">
|
|
|
+ <li class="left">
|
|
|
+ <button type="button" class="btn btn-danger btn-lg" id="btnCodiGoodsDelete">삭제</button>
|
|
|
+ </li>
|
|
|
<li class="right">
|
|
|
<button type="button" class="btn btn-default btn-lg" onclick="cfnDownloadSampleFile('SF003');">양식다운로드</button>
|
|
|
<button type="button" class="btn btn-success btn-lg" id="btnCodiGoodsExcel">엑셀조회</button>
|
|
|
@@ -403,11 +406,13 @@
|
|
|
<!-- TAB6 CONTENTS AREA -->
|
|
|
<div class="panelStyle">
|
|
|
<!-- 내용 삽입 -->
|
|
|
- <div class="padB20 aR" id="GoodsComposeBtnArea">
|
|
|
- <button type="button" class="btn btn-default btn-lg" onclick="cfnDownloadSampleFile('SF003');">양식다운로드</button>
|
|
|
- <button type="button" class="btn btn-success btn-lg" id="btnGoodsDealSearchExcel">엑셀조회</button>
|
|
|
- <button type="button" class="btn btn-base btn-lg" onclick="fnOpenGoodsDetailPopup()">상품조회</button>
|
|
|
- </div>
|
|
|
+ <ul class="panelBar" id="GoodsComposeBtnArea">
|
|
|
+ <li class="right">
|
|
|
+ <button type="button" class="btn btn-default btn-lg" onclick="cfnDownloadSampleFile('SF003');">양식다운로드</button>
|
|
|
+ <button type="button" class="btn btn-success btn-lg" id="btnGoodsDealSearchExcel">엑셀조회</button>
|
|
|
+ <button type="button" class="btn btn-base btn-lg" onclick="fnOpenGoodsDetailPopup()">상품조회</button>
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
<div id="gridGoodsComposeList" style="height: 550px;" class="ag-theme-balham lh60"></div>
|
|
|
<!-- 내용 삽입 -->
|
|
|
</div>
|
|
|
@@ -575,6 +580,7 @@
|
|
|
|
|
|
// specify the columns - 코디상품
|
|
|
var columnCodiGoodsDefs = [
|
|
|
+ {width: 40, minWidth: 40, cellClass: 'text-center', headerCheckboxSelection: true, checkboxSelection: true, filter: false},
|
|
|
{headerName: "정렬", field: "dispOrd", width: 70 ,hide: false, cellClass: 'text-center', rowDrag: true },
|
|
|
{headerName: "CRUD", field: "crud", width: 75, minWidth: 75, hide: true},
|
|
|
//{headerName: 'No', width: 60, cellClass: 'text-center', valueGetter: function(params) { return params.node.rowIndex + 1 }},
|
|
|
@@ -597,7 +603,7 @@
|
|
|
}
|
|
|
},
|
|
|
{headerName: "상품코드", field: "codiGoodsCd" , width: 130, cellClass: 'text-center'},
|
|
|
- {headerName: "상품명", field: "goodsNm" , width: 250, cellClass: 'text-left'},
|
|
|
+ {headerName: "상품명", field: "goodsNm" , width: 300, cellClass: 'text-left'},
|
|
|
{headerName: "판매가", field: "currPrice" , width: 100, cellClass: 'text-right'
|
|
|
,valueFormatter: function(params) { return Number(params.value).addComma();}
|
|
|
},
|
|
|
@@ -606,18 +612,11 @@
|
|
|
valueFormatter: function (params) { return gagaAgGrid.lookupValue(goodsStatList, params.value); },
|
|
|
valueParser: function (params) { return gagaAgGrid.lookupKey(goodsStatList, params.newValue); }
|
|
|
},
|
|
|
- {headerName: "상품명", field: "goodsNm" , width: 180, cellClass: 'text-left'},
|
|
|
{headerName: "정상이월구분", field: "formalGb" , width: 100, cellClass: 'text-center',
|
|
|
cellEditorParams: { values: gagaAgGrid.extractValues(formalGbList) },
|
|
|
valueFormatter: function (params) { return gagaAgGrid.lookupValue(formalGbList, params.value); },
|
|
|
valueParser: function (params) { return gagaAgGrid.lookupKey(formalGbList, params.newValue); }
|
|
|
},
|
|
|
- {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: "updNm", width: 100, cellClass: 'text-center'},
|
|
|
{headerName: "Master상품코드", field: "goodsCd", width: 150, cellClass: 'text-center', hide: true}
|
|
|
|
|
|
];
|
|
|
@@ -1611,27 +1610,20 @@
|
|
|
$("#goodsDetailForm input[name=chDataYn]").val('N');
|
|
|
}
|
|
|
|
|
|
- /* var changedPriceData = gagaAgGrid.getChangedData(gridGoodsExtmallPriceOptions);
|
|
|
- var jsonDataPrice = JSON.stringify(changedPriceData);
|
|
|
- $('#goodsDetailForm input[name=extmallGoodsPriceList]').val(jsonDataPrice); */
|
|
|
+ // 코디 상품
|
|
|
+ var codiGoodsData = gagaAgGrid.getAllRowData(gridCodiGoodsOptions);
|
|
|
+ var jsonDataCodiGoods = JSON.stringify(codiGoodsData);
|
|
|
+ $('#goodsDetailForm input[name=codiGoodsList]').val(jsonDataCodiGoods);
|
|
|
|
|
|
//구성상품
|
|
|
var allData = gagaAgGrid.getAllRowData(gridGoodsComposeOptions);
|
|
|
- //var allData = gagaAgGrid.getChangedData(gridGoodsComposeOptions);
|
|
|
- /* var changedData = [];
|
|
|
-
|
|
|
- $.each(allData, function(idx, item) {
|
|
|
- //item.dispOrd = idx+1;
|
|
|
- changedData.push(item);
|
|
|
- }); */
|
|
|
-
|
|
|
var jsonData = JSON.stringify(allData);
|
|
|
$('#goodsDetailForm input[name=GoodsComposeList]').val(jsonData);
|
|
|
|
|
|
$('#goodsDetailForm input[name=goodsNm]').val($('#goodsDetailForm input[name=goodsNm]').val().trim().replace(/\n|\r/g, "<br/>").replace(/\"/gi, """).replace(/\'/gi, "'"));
|
|
|
$('#goodsDetailForm input[name=goodsTnm]').val($('#goodsDetailForm input[name=goodsTnm]').val().trim().replace(/\n|\r/g, "<br/>").replace(/\"/gi, """).replace(/\'/gi, "'"));
|
|
|
$('#goodsDetailForm input[name=goodsSnm1]').val($('#goodsDetailForm input[name=goodsSnm1]').val().trim().replace(/\n|\r/g, "<br/>").replace(/\"/gi, """).replace(/\'/gi, "'"));
|
|
|
-
|
|
|
+
|
|
|
gagajf.ajaxFormSubmit("/goods/detail/save", "#goodsDetailForm", fnGoodsSaveCallBack);
|
|
|
}
|
|
|
});
|
|
|
@@ -1916,7 +1908,6 @@
|
|
|
, dispOrd: idx
|
|
|
, delYn: 'N'
|
|
|
, goodsStat : goods.goodsStat
|
|
|
- , useYn: 'Y'
|
|
|
, goodsNm : goods.goodsNm
|
|
|
, currPrice : goods.currPrice
|
|
|
, formalGb : goods.formalGb
|
|
|
@@ -1933,6 +1924,38 @@
|
|
|
gridGoodsComposeOptions.api.refreshCells();
|
|
|
}
|
|
|
|
|
|
+ // 코디 상품 삭제
|
|
|
+ $('#btnCodiGoodsDelete').on('click', function() {
|
|
|
+ var selectedData = gridCodiGoodsOptions.api.getSelectedRows();
|
|
|
+ if (selectedData.length == 0) {
|
|
|
+ mcxDialog.alert('선택된 행이 없습니다.');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ //화면에서 삭제
|
|
|
+ //var removedData_1 = gagaAgGrid.removeRowData(gridCodiGoodsOptions, false);
|
|
|
+
|
|
|
+ var removedData = gagaAgGrid.removeRowData(gridCodiGoodsOptions, false);
|
|
|
+
|
|
|
+ if (removedData.length > 0) {
|
|
|
+
|
|
|
+ mcxDialog.confirm('삭제하시겠습니까?', {
|
|
|
+ cancelBtnText: "취소",
|
|
|
+ sureBtnText: "확인",
|
|
|
+ sureBtnClick: function(){
|
|
|
+ var deleteData = [];
|
|
|
+
|
|
|
+ $.each(removedData, function(idx, item) {
|
|
|
+ deleteData.push(item);
|
|
|
+ });
|
|
|
+
|
|
|
+ var jsonData = JSON.stringify(deleteData);
|
|
|
+ gagajf.ajaxJsonSubmit('/goods/codi/delete', jsonData);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
//엑셀 상품 조회
|
|
|
$('#btnGoodsDealSearchExcel').on('click', function() {
|
|
|
cfnExcelUploadPopup('goodsDetailExcelUpload', 'goodsDetailExcelUpload');
|