|
|
@@ -381,6 +381,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();
|
|
|
@@ -388,7 +389,7 @@
|
|
|
return '0';
|
|
|
}
|
|
|
},
|
|
|
- cellEditor: 'textCellEditor',
|
|
|
+ //cellEditor: 'textCellEditor',
|
|
|
cellEditorParams: { maxlength: 3, validType: 'numeric'}
|
|
|
},
|
|
|
{headerName: "사용여부", field: "useYn" , width: 120, cellClass: 'text-center'},
|
|
|
@@ -400,7 +401,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); },
|
|
|
@@ -414,10 +415,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); },
|
|
|
@@ -426,12 +426,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},
|
|
|
@@ -467,9 +473,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);
|
|
|
@@ -520,12 +526,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;
|
|
|
}
|
|
|
};
|
|
|
|
|
|
@@ -588,6 +605,9 @@
|
|
|
// 적용상품 그리드에 기본상품 1개이상 있는지 체크
|
|
|
fnGoodsGbCheck();
|
|
|
|
|
|
+ // 업체분담율 토탈 100% 넘는지 체크
|
|
|
+ fnBurdenValueCheck();
|
|
|
+
|
|
|
var data = {
|
|
|
mode : $('#moreBetterForm input[name=mode]').val()
|
|
|
, tmtbSq : $('#moreBetterForm input[name=disTmtbSq]').val()
|
|
|
@@ -609,7 +629,7 @@
|
|
|
|
|
|
var jsonData = JSON.stringify(data);
|
|
|
|
|
|
- gagajf.ajaxJsonSubmit($('#moreBetterForm').prop('action'), jsonData, fnMorebetterSaveCollback);
|
|
|
+ //gagajf.ajaxJsonSubmit($('#moreBetterForm').prop('action'), jsonData, fnMorebetterSaveCollback);
|
|
|
});
|
|
|
|
|
|
var fnMorebetterSaveCollback = function(result){
|
|
|
@@ -861,18 +881,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);
|
|
|
});
|
|
|
|
|
|
// 할인구분 선택 시 기본 조건 변경
|
|
|
@@ -881,18 +902,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);
|
|
|
});
|
|
|
|
|
|
// 공급업체 행삭제
|