구 주소조회 삭제

main
이범준 5 months ago
parent 336aba61c6
commit c54c6ebc47

@ -484,130 +484,6 @@ com.setCfsWorkerWorkCode = function(codeOptions, callbackFunc) {
/**
* 코드성 데이터와 컴포넌트의 nodeSet(아이템 리스트)연동 기능을 제공한다.
* code별로 JSON객체를 생성하여 array에 담아 첫번째 파라메터로 넘겨준다.
*
* @date 2018.04.13
* @param {Object} codeOptions {"code" : "코드넘버", "compID" : "적용할 컴포넌트명"}
* @param {requestCallback} callbackFunc 콜백 함수
* @memberOf com
* @author InswaveSystems
* @example
* // 공통코드 조회시 ( localAddress > 시/도 단위, cityAdress > 시/군/구 단위 )
* var codeOptions = [ { code : "", compID : "sbx_localAddress" },
* { code : "0", compID : "sbx_cityAddress" } ];
* com.setCfsAddressCode(codeOptions);
*/
com.setCfsAddressCode = function(codeOptions, callbackFunc) {
var codeOptionsLen = 0;
if (codeOptions) {
codeOptionsLen = codeOptions.length;
} else {
$p.log("=== com.setCfsAddressCode Parameter Type Error ===\nex) com.setCfsAddressCode([{\"code:\":\"ADDR\",\"compID\":\"sbx_localAddress\"}],\"scwin.callbackFunction\")\n===================================");
return;
}
var i, j, codeObj, dltId, dltIdArr = [], paramCode = "", compArr, compArrLen, tmpIdArr;
var dataListOption = _getCodeDataListOptions(gcm.COMMON_CODE_INFO.FILED_ARR);
for (i = 0; i < codeOptionsLen; i++) {
codeObj = codeOptions[i];
try {
if (codeObj.code == '') {
codeObj.code = 'addr';
}
dltId = gcm.DATA_PREFIX + codeObj.code;
if ((typeof $p.top().scwin.commonCodeList[dltId] === "undefined") || (dltId == gcm.DATA_PREFIX+'booth')) {
dltIdArr.push(dltId);
if (i > 0) {
paramCode += ",";
}
paramCode += codeObj.code;
dataListOption.id = dltId;
// 동일한 id의 DataCollection이 존재할 경우, 삭제 후 재생성함
$p.data.create(dataListOption);
} else {
dataListOption.id = dltId;
$p.data.create(dataListOption);
var dataListObj = $p.getComponentById(dataListOption.id);
dataListObj.setJSON(com.getJSON($p.top().scwin.commonCodeList[dltId]));
}
if (codeObj.compID) {
compArr = (codeObj.compID).replaceAll(" ", "").split(",");
compArrLen = compArr.length;
for (j = 0; j < compArrLen; j++) {
tmpIdArr = compArr[j].split(":");
// 기본 컴포넌트에 대한 Node Setting 설정
if (tmpIdArr.length === 1) {
var comp = $p.getComponentById(tmpIdArr[0]);
comp.setNodeSet("data:" + dltId, gcm.COMMON_CODE_INFO.LABEL, gcm.COMMON_CODE_INFO.VALUE);
// gridView 컴포넌트에 대한 Node Setting 설정
} else {
var gridObj = $p.getComponentById(tmpIdArr[0]);
gridObj.setColumnNodeSet(tmpIdArr[1], "data:" + dltId, gcm.COMMON_CODE_INFO.LABEL, gcm.COMMON_CODE_INFO.VALUE);
}
}
if (typeof $p.top().scwin.commonCodeList[dltId] === "undefined") {
} else {
if (typeof callbackFunc === "function") {
callbackFunc();
}
}
}
} catch (ex) {
$p.log("com.setCfsAddressCode Error");
$p.log(JSON.stringify(codeObj));
$p.log(ex);
continue;
}
}
var searchCodeGrpOption = {
id : "sbm_searchCode",
action : "/cfs/com/code/findAddressCodeList.do",
target : "data:json," + com.strSerialize(dltIdArr),
isShowMeg : false };
searchCodeGrpOption.submitDoneHandler = function(e) {
for (codeGrpDataListId in e.responseJSON) {
if (codeGrpDataListId.indexOf(gcm.DATA_PREFIX) > -1) {
$p.top().scwin.commonCodeList[codeGrpDataListId] = com.strSerialize(e.responseJSON[codeGrpDataListId]);
}
}
if (typeof callbackFunc === "function") {
callbackFunc();
}
}
if (paramCode !== "") {
var codeParam = {"dma_commonCode":{"GRP_CD":paramCode, "DATA_PREFIX":gcm.DATA_PREFIX}};
com.executeSubmission_dynamic(searchCodeGrpOption, codeParam);
}
// dataList를 동적으로 생성하기 위한 옵션 정보를 반환한다.
function _getCodeDataListOptions(infoArr) {
var option = {
"type" : "dataList",
"option":{ "baseNode": "list", "repeatNode": "map"},
"columnInfo":[]
};
for (var idx in infoArr) {
option.columnInfo.push({ "id" : infoArr[idx] });
}
return option;
};
};

@ -55,22 +55,10 @@
mediatype="application/json" encoding="UTF-8" instance="" replace="" errorHandler="" customHandler="" mode="asynchronous"
processMsg="조회중입니다." ev:submit="" ev:submitdone="" ev:submiterror="" abortTrigger="">
</xf:submission>
<xf:submission id="sub_delete" ref='data:json,{"id":"delReq","key":"param"}'
target='data:json,{"id":"statList","key":"statList"}' action="/cfs/system/deletePostNo.do" method="post"
mediatype="application/json" encoding="UTF-8" instance="" replace="" errorHandler="" customHandler="" mode="asynchronous"
processMsg="" ev:submit="" ev:submitdone="scwin.sub_delete_submitdone" ev:submiterror="" abortTrigger="">
</xf:submission>
<xf:submission id="sub_codeSido" ref='data:json,{"id":"schReq","key":"param"}'
target='data:json,{"id":"sidoCode","key":"sidoCode"}' action="/cfs/system/findSystemSidoCode.do" method="post"
mediatype="application/json" encoding="UTF-8" instance="" replace="" errorHandler="" customHandler="" mode="asynchronous"
processMsg="" ev:submit="" ev:submitdone="" ev:submiterror="" abortTrigger="">
</xf:submission>
</xf:model>
<script type="text/javascript" lazy="false"><![CDATA[
scwin.onpageload = function() {
var sbxOptions = [{code : "", compID : "sbx_localAddress"}];
//var sbxOptions = [{code : "sido_01", compID : "sbx_localAddress"}]; // 시/군/구 코드 조회시 사용
com.setCfsAddressCode(sbxOptions);
dateFrom.setValue( com.getToday() );
dateTo.setValue( com.getToday() );
};
@ -88,97 +76,7 @@
}
};
scwin.btn_add_onclick = function() {
var param = {'pCrudSe':'C'};
var options = {};
options.id = "findSystemPostNoPopup";
options.popupName = "우편번호 등록/수정";
options.modal = true;
options.resizable = false;
options.width = 850;
com.openPopup(com.getFullPath("/ui/cfs/system/ST003P01.xml"), options, {data:param, callbackFn:"scwin.btn_search_onclick"});
};
// 우편번호 수정 버튼
scwin.btn_mod_onclick = function(e) {
var rowIdx = grd_statList.getCheckedIndex("chk");;
if(rowIdx !='') {
var idxLen = grd_statList.getCheckedIndex("chk").length;
if(idxLen > 1){
alert("수정할 우편번호를 하나만 체크하세요");
return false;
};
scwin.findSystemPostNoPopup(rowIdx);
} else {
com.alert('수정할 우편번호를 체크하십시오. ');
}
};
scwin.findSystemPostNoPopup = function(rowIdx) {
// 우편번호 수정팝업
var param = {
'pCrudSe':'U'
, 'postNo1':grd_statList.getCellData(rowIdx, 'postNo1')
, 'postNo2':grd_statList.getCellData(rowIdx, 'postNo2')
, 'addressSeqno':grd_statList.getCellData(rowIdx, 'addressSeqno')
, 'addressCity':grd_statList.getCellData(rowIdx, 'addressCity')
, 'addressDistrict':grd_statList.getCellData(rowIdx, 'addressDistrict')
, 'addressSame':grd_statList.getCellData(rowIdx, 'addressSame')
, 'addressTown':grd_statList.getCellData(rowIdx, 'addressTown')
, 'addressBunji':grd_statList.getCellData(rowIdx, 'addressBunji')
, 'stBunji':grd_statList.getCellData(rowIdx, 'stBunji')
, 'edBunji':grd_statList.getCellData(rowIdx, 'edBunji')
, 'stNumDong':grd_statList.getCellData(rowIdx, 'stNumDong')
, 'edNumDong':grd_statList.getCellData(rowIdx, 'edNumDong')
, 'stDong':grd_statList.getCellData(rowIdx, 'stDong')
, 'edDong':grd_statList.getCellData(rowIdx, 'edDong')
, 'stAfterBunji':grd_statList.getCellData(rowIdx, 'stAfterBunji')
, 'edAfterBunji':grd_statList.getCellData(rowIdx, 'edAfterBunji')
, 'addressAdminCode':grd_statList.getCellData(rowIdx, 'addressAdminCode')
};
var options = {
id : "findSystemPostNoPopup",
popupName : "우편번호 등록/수정",
modal : true,
resizable : false,
width : 850};
com.openPopup(com.getFullPath("/ui/cfs/system/ST003P01.xml"), options, {data:param, callbackFn:"scwin.btn_search_onclick"});
};
scwin.btn_del_onclick = function() {
if(!confirm("삭제하시겠습니까?")){return;};
var rowIdx = grd_statList.getCheckedIndex("chk");
if(rowIdx !='') {
var idxLen = grd_statList.getCheckedIndex("chk").length;
if(idxLen > 1){
alert("삭제할 우편번호를 하나만 체크하세요");
return false;
};
var postNo1 = grd_statList.getCellData(rowIdx, 'postNo1');
var postNo2 = grd_statList.getCellData(rowIdx, 'postNo2');
var addressSeqno = grd_statList.getCellData(rowIdx, 'addressSeqno');
delReq.set("postNo1",postNo1);
delReq.set("postNo2",postNo2);
delReq.set("addressSeqno",addressSeqno);
com.executeSubmission(sub_delete);
} else {
com.alert('삭제할 우편번호를 체크하십시오. ');
}
}
scwin.sub_delete_submitdone = function(e) {
com.executeSubmission(sbm_statList);
alert("삭제되었습니다.");
};
scwin.btn_excel_down_onclick = function(e) {
if (statList.getRowCount() == 0) {

@ -55,22 +55,10 @@
mediatype="application/json" encoding="UTF-8" instance="" replace="" errorHandler="" customHandler="" mode="asynchronous"
processMsg="조회중입니다." ev:submit="" ev:submitdone="" ev:submiterror="" abortTrigger="">
</xf:submission>
<xf:submission id="sub_delete" ref='data:json,{"id":"delReq","key":"param"}'
target='data:json,{"id":"statList","key":"statList"}' action="/cfs/system/deletePostNo.do" method="post"
mediatype="application/json" encoding="UTF-8" instance="" replace="" errorHandler="" customHandler="" mode="asynchronous"
processMsg="" ev:submit="" ev:submitdone="scwin.sub_delete_submitdone" ev:submiterror="" abortTrigger="">
</xf:submission>
<xf:submission id="sub_codeSido" ref='data:json,{"id":"schReq","key":"param"}'
target='data:json,{"id":"sidoCode","key":"sidoCode"}' action="/cfs/system/findSystemSidoCode.do" method="post"
mediatype="application/json" encoding="UTF-8" instance="" replace="" errorHandler="" customHandler="" mode="asynchronous"
processMsg="" ev:submit="" ev:submitdone="" ev:submiterror="" abortTrigger="">
</xf:submission>
</xf:model>
<script type="text/javascript" lazy="false"><![CDATA[
scwin.onpageload = function() {
var sbxOptions = [{code : "", compID : "sbx_localAddress"}];
//var sbxOptions = [{code : "sido_01", compID : "sbx_localAddress"}]; // 시/군/구 코드 조회시 사용
com.setCfsAddressCode(sbxOptions);
dateFrom.setValue( com.getToday() );
dateTo.setValue( com.getToday() );
};
@ -88,97 +76,7 @@
}
};
scwin.btn_add_onclick = function() {
var param = {'pCrudSe':'C'};
var options = {};
options.id = "findSystemPostNoPopup";
options.popupName = "우편번호 등록/수정";
options.modal = true;
options.resizable = false;
options.width = 850;
com.openPopup(com.getFullPath("/ui/cfs/system/ST003P01.xml"), options, {data:param, callbackFn:"scwin.btn_search_onclick"});
};
// 우편번호 수정 버튼
scwin.btn_mod_onclick = function(e) {
var rowIdx = grd_statList.getCheckedIndex("chk");;
if(rowIdx !='') {
var idxLen = grd_statList.getCheckedIndex("chk").length;
if(idxLen > 1){
alert("수정할 우편번호를 하나만 체크하세요");
return false;
};
scwin.findSystemPostNoPopup(rowIdx);
} else {
com.alert('수정할 우편번호를 체크하십시오. ');
}
};
scwin.findSystemPostNoPopup = function(rowIdx) {
// 우편번호 수정팝업
var param = {
'pCrudSe':'U'
, 'postNo1':grd_statList.getCellData(rowIdx, 'postNo1')
, 'postNo2':grd_statList.getCellData(rowIdx, 'postNo2')
, 'addressSeqno':grd_statList.getCellData(rowIdx, 'addressSeqno')
, 'addressCity':grd_statList.getCellData(rowIdx, 'addressCity')
, 'addressDistrict':grd_statList.getCellData(rowIdx, 'addressDistrict')
, 'addressSame':grd_statList.getCellData(rowIdx, 'addressSame')
, 'addressTown':grd_statList.getCellData(rowIdx, 'addressTown')
, 'addressBunji':grd_statList.getCellData(rowIdx, 'addressBunji')
, 'stBunji':grd_statList.getCellData(rowIdx, 'stBunji')
, 'edBunji':grd_statList.getCellData(rowIdx, 'edBunji')
, 'stNumDong':grd_statList.getCellData(rowIdx, 'stNumDong')
, 'edNumDong':grd_statList.getCellData(rowIdx, 'edNumDong')
, 'stDong':grd_statList.getCellData(rowIdx, 'stDong')
, 'edDong':grd_statList.getCellData(rowIdx, 'edDong')
, 'stAfterBunji':grd_statList.getCellData(rowIdx, 'stAfterBunji')
, 'edAfterBunji':grd_statList.getCellData(rowIdx, 'edAfterBunji')
, 'addressAdminCode':grd_statList.getCellData(rowIdx, 'addressAdminCode')
};
var options = {
id : "findSystemPostNoPopup",
popupName : "우편번호 등록/수정",
modal : true,
resizable : false,
width : 850};
com.openPopup(com.getFullPath("/ui/cfs/system/ST003P01.xml"), options, {data:param, callbackFn:"scwin.btn_search_onclick"});
};
scwin.btn_del_onclick = function() {
if(!confirm("삭제하시겠습니까?")){return;};
var rowIdx = grd_statList.getCheckedIndex("chk");
if(rowIdx !='') {
var idxLen = grd_statList.getCheckedIndex("chk").length;
if(idxLen > 1){
alert("삭제할 우편번호를 하나만 체크하세요");
return false;
};
var postNo1 = grd_statList.getCellData(rowIdx, 'postNo1');
var postNo2 = grd_statList.getCellData(rowIdx, 'postNo2');
var addressSeqno = grd_statList.getCellData(rowIdx, 'addressSeqno');
delReq.set("postNo1",postNo1);
delReq.set("postNo2",postNo2);
delReq.set("addressSeqno",addressSeqno);
com.executeSubmission(sub_delete);
} else {
com.alert('삭제할 우편번호를 체크하십시오. ');
}
}
scwin.sub_delete_submitdone = function(e) {
com.executeSubmission(sbm_statList);
alert("삭제되었습니다.");
};
scwin.btn_excel_down_onclick = function(e) {

Loading…
Cancel
Save