refactor : DatasetControl 이름 수정

main
이범준 4 months ago
parent 7563adf995
commit 830cdcc98f

@ -300,7 +300,7 @@
</template> </template>
<script> <script>
LoadScript("answerWordsScript","/resources/js/fims/cvlc/answerWords.js"); LoadScript("cvlc05010Script","/resources/js/fims/cvlc/cvlc05010.js?ver=${ver}");
/************************************************************************** /**************************************************************************
* Global Variable * Global Variable
**************************************************************************/ **************************************************************************/
@ -319,36 +319,25 @@ $(document).ready(function(){
/************************************************************************** /**************************************************************************
* DatasetControl * DatasetControl
**************************************************************************/ **************************************************************************/
$P.ansBodyControl = new AnswerBodyControl({ $P.ctrl = newCvlc05010Control();
dataGetter : obj => obj["levyCaseList"], urls : {}, formats : {},
keymapper : info => info ? info.VLTN_CASE_ID : ""
},
{
dataGetter : obj => obj["warningCaseList"], urls : {}, formats : {},
keymapper : info => info ? info.LEVY_EXCL_RSN_CD : ""
},
{
dataGetter : obj => obj["nonlevyCaseList"], urls : {}, formats : {},
keymapper : info => info ? info.LEVY_EXCL_RSN_CD : ""
});
/************************************************************************** /**************************************************************************
* pageObject.function * pageObject.function
**************************************************************************/ **************************************************************************/
$P.fnResetAndChangeBiz = (taskSeCd) => { $P.fnResetAndChangeBiz = (taskSeCd) => {
$P.ansBodyControl.urls = {}; $P.ctrl.urls = {};
$P.ansBodyControl.urls.load = wctx.url("/"+taskSeCd+"/cvlc/cvlc05/010/info.do"); $P.ctrl.urls.load = wctx.url("/"+taskSeCd+"/cvlc/cvlc05/010/info.do");
$P.ansBodyControl.urls.update = wctx.url("/"+taskSeCd+"/cvlc/cvlc05/010/save.do"); $P.ctrl.urls.update = wctx.url("/"+taskSeCd+"/cvlc/cvlc05/010/save.do");
$P.ansBodyControl.urls.remove = wctx.url("/"+taskSeCd+"/cvlc/cvlc05/010/remove.do"); $P.ctrl.urls.remove = wctx.url("/"+taskSeCd+"/cvlc/cvlc05/010/remove.do");
$P.fnReset(); $P.fnReset();
} }
$P.fnReset = () => { $P.fnReset = () => {
$('#btnAnsBasicTab--${pageName}').trigger("click"); $('#btnAnsBasicTab--${pageName}').trigger("click");
$P.ansBodyControl.levy.setData([]); $P.ctrl.levy.setData([]);
$P.ansBodyControl.warning.setData([]); $P.ctrl.warning.setData([]);
$P.ansBodyControl.nonlevy.setData([]); $P.ctrl.nonlevy.setData([]);
$P.renderAnsBodyList(0,'levy'); $P.renderAnsBodyList(0,'levy');
$P.renderAnsBodyList(0,'warning'); $P.renderAnsBodyList(0,'warning');
@ -370,31 +359,31 @@ $(document).ready(function(){
var taskSeCd = $("#frmSearch--${pageName}").find("input[name='taskSeCd']:checked").val(); var taskSeCd = $("#frmSearch--${pageName}").find("input[name='taskSeCd']:checked").val();
ajax.get({ ajax.get({
url : $P.ansBodyControl.urls.load, url : $P.ctrl.urls.load,
data : {"taskSeCd" : taskSeCd}, data : {"taskSeCd" : taskSeCd},
success : (resp) => { success : (resp) => {
$("#headerCn--${pageName}").val(resp.headerCn); $("#headerCn--${pageName}").val(resp.headerCn);
$("#footerCn--${pageName}").val(resp.footerCn); $("#footerCn--${pageName}").val(resp.footerCn);
$P.ansBodyControl.levy.setData(resp.levyCaseList); $P.ctrl.levy.setData(resp.levyCaseList);
$P.ansBodyControl.warning.setData(resp.warningCaseList); $P.ctrl.warning.setData(resp.warningCaseList);
$P.ansBodyControl.nonlevy.setData(resp.nonlevyCaseList); $P.ctrl.nonlevy.setData(resp.nonlevyCaseList);
$P.renderAnsBodyList(resp.levyCaseList.length,'levy'); $P.renderAnsBodyList(resp.levyCaseList.length,'levy');
$P.renderAnsBodyList(resp.warningCaseList.length,'warning'); $P.renderAnsBodyList(resp.warningCaseList.length,'warning');
$P.renderAnsBodyList(resp.nonlevyCaseList.length,'nonlevy'); $P.renderAnsBodyList(resp.nonlevyCaseList.length,'nonlevy');
if(resp.levyCaseList.length > 0){ if(resp.levyCaseList.length > 0){
var current = $P.ansBodyControl.levy.getCurrent()["VLTN_CASE_ID"]; var current = $P.ctrl.levy.getCurrent()["VLTN_CASE_ID"];
$P.clickAnsBodyList(current,'levy'); $P.clickAnsBodyList(current,'levy');
} }
if(resp.warningCaseList.length > 0){ if(resp.warningCaseList.length > 0){
var current = $P.ansBodyControl.warning.getCurrent()["LEVY_EXCL_RSN_CD"]; var current = $P.ctrl.warning.getCurrent()["LEVY_EXCL_RSN_CD"];
$P.clickAnsBodyList(current,'warning'); $P.clickAnsBodyList(current,'warning');
} }
if(resp.nonlevyCaseList.length > 0){ if(resp.nonlevyCaseList.length > 0){
var current = $P.ansBodyControl.nonlevy.getCurrent()["LEVY_EXCL_RSN_CD"]; var current = $P.ctrl.nonlevy.getCurrent()["LEVY_EXCL_RSN_CD"];
$P.clickAnsBodyList(current,'nonlevy'); $P.clickAnsBodyList(current,'nonlevy');
} }
} }
@ -422,7 +411,7 @@ $(document).ready(function(){
return; return;
} }
var ansBodyDS = $P.ansBodyControl[renderDataType].dataset; var ansBodyDS = $P.ctrl[renderDataType].dataset;
var empty = ansBodyDS.empty; var empty = ansBodyDS.empty;
var notFound = [document.getElementById(notFoundId).innerHTML]; var notFound = [document.getElementById(notFoundId).innerHTML];
var found = document.getElementById(foundId).innerHTML; var found = document.getElementById(foundId).innerHTML;
@ -448,7 +437,7 @@ $(document).ready(function(){
$P.radioClickAnsBodyList = (dataKey, gridType) => { $P.radioClickAnsBodyList = (dataKey, gridType) => {
$P.ansBodyControl[gridType].setCurrent(dataKey); $P.ctrl[gridType].setCurrent(dataKey);
var tbodyId = ""; var tbodyId = "";
if(gridType == "levy"){ if(gridType == "levy"){
@ -502,11 +491,11 @@ $(document).ready(function(){
var dstrbncYn = ""; var dstrbncYn = "";
if($P.currentDisplay == "levyAnsBody"){ if($P.currentDisplay == "levyAnsBody"){
curData = $P.ansBodyControl.levy.getCurrent(); curData = $P.ctrl.levy.getCurrent();
} else if($P.currentDisplay == "warningAnsBody"){ } else if($P.currentDisplay == "warningAnsBody"){
curData = $P.ansBodyControl.warning.getCurrent(); curData = $P.ctrl.warning.getCurrent();
} else if($P.currentDisplay == "nonlevyAnsBody"){ } else if($P.currentDisplay == "nonlevyAnsBody"){
curData = $P.ansBodyControl.nonlevy.getCurrent(); curData = $P.ctrl.nonlevy.getCurrent();
} }
if(curData == null){ if(curData == null){
@ -544,41 +533,41 @@ $(document).ready(function(){
} }
$P.refreshAnsWordsInfo = () => { $P.refreshAnsWordsInfo = () => {
var cursor1 = $P.ansBodyControl.levy.getCurrent()["VLTN_CASE_ID"]; var cursor1 = $P.ctrl.levy.getCurrent()["VLTN_CASE_ID"];
var cursor2 = $P.ansBodyControl.warning.getCurrent()["LEVY_EXCL_RSN_CD"]; var cursor2 = $P.ctrl.warning.getCurrent()["LEVY_EXCL_RSN_CD"];
var cursor3 = $P.ansBodyControl.nonlevy.getCurrent()["LEVY_EXCL_RSN_CD"]; var cursor3 = $P.ctrl.nonlevy.getCurrent()["LEVY_EXCL_RSN_CD"];
var taskSeCd = $("#frmSearch--${pageName}").find("input[name='taskSeCd']:checked").val(); var taskSeCd = $("#frmSearch--${pageName}").find("input[name='taskSeCd']:checked").val();
ajax.get({ ajax.get({
url : $P.ansBodyControl.urls.load, url : $P.ctrl.urls.load,
data : {"taskSeCd" : taskSeCd}, data : {"taskSeCd" : taskSeCd},
success : (resp) => { success : (resp) => {
$("#headerCn--${pageName}").val(resp.headerCn); $("#headerCn--${pageName}").val(resp.headerCn);
$("#footerCn--${pageName}").val(resp.footerCn); $("#footerCn--${pageName}").val(resp.footerCn);
$P.ansBodyControl.levy.setData(resp.levyCaseList); $P.ctrl.levy.setData(resp.levyCaseList);
$P.ansBodyControl.warning.setData(resp.warningCaseList); $P.ctrl.warning.setData(resp.warningCaseList);
$P.ansBodyControl.nonlevy.setData(resp.nonlevyCaseList); $P.ctrl.nonlevy.setData(resp.nonlevyCaseList);
$P.renderAnsBodyList(resp.levyCaseList.length,'levy'); $P.renderAnsBodyList(resp.levyCaseList.length,'levy');
$P.renderAnsBodyList(resp.warningCaseList.length,'warning'); $P.renderAnsBodyList(resp.warningCaseList.length,'warning');
$P.renderAnsBodyList(resp.nonlevyCaseList.length,'nonlevy'); $P.renderAnsBodyList(resp.nonlevyCaseList.length,'nonlevy');
if(resp.levyCaseList.length > 0){ if(resp.levyCaseList.length > 0){
$P.ansBodyControl.levy.setCurrent(cursor1); $P.ctrl.levy.setCurrent(cursor1);
var current = $P.ansBodyControl.levy.getCurrent()["VLTN_CASE_ID"]; var current = $P.ctrl.levy.getCurrent()["VLTN_CASE_ID"];
$P.clickAnsBodyList(current,'levy'); $P.clickAnsBodyList(current,'levy');
} }
if(resp.warningCaseList.length > 0){ if(resp.warningCaseList.length > 0){
$P.ansBodyControl.warning.setCurrent(cursor2); $P.ctrl.warning.setCurrent(cursor2);
var current = $P.ansBodyControl.warning.getCurrent()["LEVY_EXCL_RSN_CD"]; var current = $P.ctrl.warning.getCurrent()["LEVY_EXCL_RSN_CD"];
$P.clickAnsBodyList(current,'warning'); $P.clickAnsBodyList(current,'warning');
} }
if(resp.nonlevyCaseList.length > 0){ if(resp.nonlevyCaseList.length > 0){
$P.ansBodyControl.nonlevy.setCurrent(cursor3); $P.ctrl.nonlevy.setCurrent(cursor3);
var current = $P.ansBodyControl.nonlevy.getCurrent()["LEVY_EXCL_RSN_CD"]; var current = $P.ctrl.nonlevy.getCurrent()["LEVY_EXCL_RSN_CD"];
$P.clickAnsBodyList(current,'nonlevy'); $P.clickAnsBodyList(current,'nonlevy');
} }
} }
@ -615,7 +604,7 @@ $(document).ready(function(){
onOK: () => { onOK: () => {
ajax.get({ ajax.get({
url : $P.ansBodyControl.urls.update, url : $P.ctrl.urls.update,
data : info, data : info,
success : (resp) => { success : (resp) => {
if(resp.saved){ if(resp.saved){
@ -639,7 +628,7 @@ $(document).ready(function(){
init : function() { focusOK(); }, init : function() { focusOK(); },
onOK: () => { onOK: () => {
ajax.get({ ajax.get({
url : $P.ansBodyControl.urls.remove, url : $P.ctrl.urls.remove,
data : info, data : info,
success : (resp) => { success : (resp) => {
if(resp.saved){ if(resp.saved){

@ -26,8 +26,8 @@
<span id="tempArea--${pageName}" hidden></span> <span id="tempArea--${pageName}" hidden></span>
<script> <script>
LoadScript("sprt01010Script","/resources/js/fims/sprt/sprt01010.js?ver=${ver}");
LoadScript("integrationSearchScript","/resources/js/fims/sprt/integrationSearch.js");
/************************************************************************** /**************************************************************************
* Global Variable * Global Variable
**************************************************************************/ **************************************************************************/
@ -51,72 +51,39 @@ $(document).ready(function() {
/************************************************************************** /**************************************************************************
* DatasetControl * DatasetControl
**************************************************************************/ **************************************************************************/
$P.integrationSearchControl = new IntegrationSearchControl({ $P.ctrl = newSprt01010Control();
dataGetter: obj => Array.isArray(obj) ? obj : [],
appendData: false,
keymapper: data => data ? data.CRDN_ID : "",
urls: {
load: wctx.url("/sprt/sprt01/010/list.do") // 검색
},
formats: {
CRDN_YMD_TM: datetimeFormat
, CRDN_STTS_CHG_YMD: dateFormat
, CVLCPT_RCPT_YMD: dateFormat
, LEVY_EXCL_YMD: dateFormat
, ADVNTCE_DUDT_YMD: dateFormat
, LEVY_YMD: dateFormat
, FRST_DUDT_YMD: dateFormat
, DUDT_YMD: dateFormat
, DUDT_AFTR_YMD: dateFormat
, RCVMT_YMD: dateFormat
, FFNLG_CRDN_AMT: numberFormat
, FFNLG_AMT: numberFormat
, ADVNTCE_AMT: numberFormat
, LEVY_AMT: numberFormat
, LEVY_PCPTAX: numberFormat
, LEVY_ADAMT: numberFormat
, RCVMT_AMT: numberFormat
, RCVMT_PCPTAX: numberFormat
, RCVMT_ADAMT: numberFormat
, SUM_AMT: numberFormat
, MINAP_AMT: numberFormat
, DUDT_AFTR_AMT: numberFormat
, REG_DT: datetimeFormat
, MDFCN_DT: datetimeFormat
}
});
/************************************************************************** /**************************************************************************
* DatasetControl 이벤트 * DatasetControl 이벤트
**************************************************************************/ **************************************************************************/
// Dataset 변경 이벤트 // Dataset 변경 이벤트
$P.integrationSearchControl.upDataset.onDatasetChange = (obj, option) => { $P.ctrl.upDataset.onDatasetChange = (obj, option) => {
var upActiveTab = $("#upGridTabs--${pageName}").find("button.active").text().trim(); var upActiveTab = $("#upGridTabs--${pageName}").find("button.active").text().trim();
$P.renderList("up", upActiveTab); $P.renderList("up", upActiveTab);
}; };
$P.integrationSearchControl.downDataset.onDatasetChange = (obj, option) => { $P.ctrl.downDataset.onDatasetChange = (obj, option) => {
var downActiveTab = $("#downGridTabs--${pageName}").find("button.active").text().trim(); var downActiveTab = $("#downGridTabs--${pageName}").find("button.active").text().trim();
$P.renderList("down", downActiveTab); $P.renderList("down", downActiveTab);
}; };
// 현재 선택 자료 변경 이벤트 // 현재 선택 자료 변경 이벤트
$P.integrationSearchControl.upDataset.onCurrentChange = (DI) => { $P.ctrl.upDataset.onCurrentChange = (DI) => {
if (!DI) return; if (!DI) return;
var key = DI.data.CRDN_ID; var key = DI.data.CRDN_ID;
$("#upTbody--${pageName}").setCurrentRow(key); $("#upTbody--${pageName}").setCurrentRow(key);
}; };
$P.integrationSearchControl.downDataset.onCurrentChange = (DI) => { $P.ctrl.downDataset.onCurrentChange = (DI) => {
if (!DI) return; if (!DI) return;
var key = DI.data.CRDN_ID; var key = DI.data.CRDN_ID;
$("#downTbody--${pageName}").setCurrentRow(key); $("#downTbody--${pageName}").setCurrentRow(key);
}; };
// 선택(체크) 변경 이벤트 // 선택(체크) 변경 이벤트
$P.integrationSearchControl.upDataset.onSelectionChange = (selectedArr) => { $P.ctrl.upDataset.onSelectionChange = (selectedArr) => {
var DS = $P.integrationSearchControl.upDataset; var DS = $P.ctrl.upDataset;
var keys = selectedArr.map(item => DS.getKey(item)); var keys = selectedArr.map(item => DS.getKey(item));
$("#upTbody--${pageName}").find("input[type='checkbox']").each(function() { $("#upTbody--${pageName}").find("input[type='checkbox']").each(function() {
@ -135,8 +102,8 @@ $(document).ready(function() {
}; };
$P.integrationSearchControl.downDataset.onSelectionChange = (selectedArr) => { $P.ctrl.downDataset.onSelectionChange = (selectedArr) => {
var DS = $P.integrationSearchControl.downDataset; var DS = $P.ctrl.downDataset;
var keys = selectedArr.map(item => DS.getKey(item)); var keys = selectedArr.map(item => DS.getKey(item));
$("#downTbody--${pageName}").find("input[type='checkbox']").each(function() { $("#downTbody--${pageName}").find("input[type='checkbox']").each(function() {
@ -161,15 +128,15 @@ $(document).ready(function() {
let id = table[0].id; let id = table[0].id;
if(id.startsWith("up")){ if(id.startsWith("up")){
if(arg2 != null){ if(arg2 != null){
pageObject['${pageName}'].integrationSearchControl.upDataset.select(arg1, arg2); pageObject['${pageName}'].ctrl.upDataset.select(arg1, arg2);
} else { } else {
pageObject['${pageName}'].integrationSearchControl.upDataset.select(arg1); pageObject['${pageName}'].ctrl.upDataset.select(arg1);
} }
} else if(id.startsWith("down")){ } else if(id.startsWith("down")){
if(arg2 != null){ if(arg2 != null){
pageObject['${pageName}'].integrationSearchControl.downDataset.select(arg1, arg2); pageObject['${pageName}'].ctrl.downDataset.select(arg1, arg2);
} else { } else {
pageObject['${pageName}'].integrationSearchControl.downDataset.select(arg1); pageObject['${pageName}'].ctrl.downDataset.select(arg1);
} }
} }
} }
@ -211,8 +178,8 @@ $(document).ready(function() {
} }
$P.fnReset = () => { $P.fnReset = () => {
$P.integrationSearchControl.upDataset.clear(); $P.ctrl.upDataset.clear();
$P.integrationSearchControl.downDataset.clear(); $P.ctrl.downDataset.clear();
} }
// 검색 조건 파라미터 가져오기 // 검색 조건 파라미터 가져오기
@ -227,9 +194,9 @@ $(document).ready(function() {
$P.fnSearchList = () => { $P.fnSearchList = () => {
// 검색조건 // 검색조건
$P.integrationSearchControl.query = $P.getParams(); $P.ctrl.query = $P.getParams();
var query = $P.integrationSearchControl.query; var query = $P.ctrl.query;
var minKeyword = false; var minKeyword = false;
var keys = Object.keys(query); var keys = Object.keys(query);
for(var i=0; i < keys.length; i++){ for(var i=0; i < keys.length; i++){
@ -263,10 +230,10 @@ $(document).ready(function() {
$("#upGridTabs--${pageName}").find("button").eq(0).addClass("active"); $("#upGridTabs--${pageName}").find("button").eq(0).addClass("active");
$("#downGridTabs--${pageName}").find("button").not(":eq(0)").removeClass("active"); $("#downGridTabs--${pageName}").find("button").not(":eq(0)").removeClass("active");
$("#downGridTabs--${pageName}").find("button").eq(0).addClass("active"); $("#downGridTabs--${pageName}").find("button").eq(0).addClass("active");
$P.integrationSearchControl.upDataset.clear(); $P.ctrl.upDataset.clear();
$P.integrationSearchControl.downDataset.clear(); $P.ctrl.downDataset.clear();
$P.integrationSearchControl.load(); $P.ctrl.load();
} }
@ -276,7 +243,7 @@ $(document).ready(function() {
var cellDefs; var cellDefs;
if(updown == "up"){ if(updown == "up"){
if($P.integrationSearchControl.upDataset.empty){ if($P.ctrl.upDataset.empty){
alert("조회된 자료가 없습니다."); alert("조회된 자료가 없습니다.");
return; return;
} }
@ -287,9 +254,9 @@ $(document).ready(function() {
getCellDefsForPrivacyCell getCellDefsForPrivacyCell
); );
$P.integrationSearchControl.query.gridType = "up"; $P.ctrl.query.gridType = "up";
} else { } else {
if($P.integrationSearchControl.downDataset.empty){ if($P.ctrl.downDataset.empty){
alert("조회된 자료가 없습니다."); alert("조회된 자료가 없습니다.");
return; return;
} }
@ -300,12 +267,12 @@ $(document).ready(function() {
getCellDefsForPrivacyCell getCellDefsForPrivacyCell
); );
$P.integrationSearchControl.query.gridType = "down"; $P.ctrl.query.gridType = "down";
} }
$P.integrationSearchControl.query.cellDefs = cellDefs; $P.ctrl.query.cellDefs = cellDefs;
$P.integrationSearchControl.download(); $P.ctrl.download();
} }
@ -318,19 +285,19 @@ $(document).ready(function() {
var DS; var DS;
if(updown == "up"){ if(updown == "up"){
DS = $P.integrationSearchControl.upDataset; DS = $P.ctrl.upDataset;
} else { } else {
DS = $P.integrationSearchControl.downDataset; DS = $P.ctrl.downDataset;
} }
var replacer; var replacer;
if(updown == "up"){ if(updown == "up"){
replacer = (str, dataItem) => str replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].integrationSearchControl.upDataset.setCurrent('" + dataItem.getValue("CRDN_ID") + "');") .replace(/{onclick}/gi, "pageObject['${pageName}'].ctrl.upDataset.setCurrent('" + dataItem.getValue("CRDN_ID") + "');")
.replace(/{ondblclick}/gi, "pageObject['${pageName}'].getInfo('"+ dataItem.getValue("TASK_SE_CD") +"','" + dataItem.getValue("CRDN_ID") + "');") .replace(/{ondblclick}/gi, "pageObject['${pageName}'].getInfo('"+ dataItem.getValue("TASK_SE_CD") +"','" + dataItem.getValue("CRDN_ID") + "');")
} else { } else {
replacer = (str, dataItem) => str replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].integrationSearchControl.downDataset.setCurrent('" + dataItem.getValue("CRDN_ID") + "');") .replace(/{onclick}/gi, "pageObject['${pageName}'].ctrl.downDataset.setCurrent('" + dataItem.getValue("CRDN_ID") + "');")
.replace(/{ondblclick}/gi, "pageObject['${pageName}'].getInfo('"+ dataItem.getValue("TASK_SE_CD") +"','" + dataItem.getValue("CRDN_ID") + "');") .replace(/{ondblclick}/gi, "pageObject['${pageName}'].getInfo('"+ dataItem.getValue("TASK_SE_CD") +"','" + dataItem.getValue("CRDN_ID") + "');")
} }
@ -406,9 +373,9 @@ $(document).ready(function() {
var cur; var cur;
if(updown == "up"){ if(updown == "up"){
cur = $P.integrationSearchControl.upDataset.getCurrent(); cur = $P.ctrl.upDataset.getCurrent();
} else { } else {
cur = $P.integrationSearchControl.downDataset.getCurrent(); cur = $P.ctrl.downDataset.getCurrent();
} }
if(cur != null){ if(cur != null){
@ -424,9 +391,9 @@ $(document).ready(function() {
var cur; var cur;
if(updown == "up"){ if(updown == "up"){
cur = $P.integrationSearchControl.upDataset.getCurrent(); cur = $P.ctrl.upDataset.getCurrent();
} else { } else {
cur = $P.integrationSearchControl.downDataset.getCurrent(); cur = $P.ctrl.downDataset.getCurrent();
} }
if(cur.length <= 0){ if(cur.length <= 0){
@ -441,10 +408,10 @@ $(document).ready(function() {
var cur; var cur;
if(updown == "up"){ if(updown == "up"){
cur = $P.integrationSearchControl.upDataset; cur = $P.ctrl.upDataset;
} else { } else {
cur = $P.integrationSearchControl.downDataset; cur = $P.ctrl.downDataset;
} }
@ -485,8 +452,8 @@ $(document).ready(function() {
//단속내역서,단속확인서 //단속내역서,단속확인서
$P.fnPrintCrdn = () => { $P.fnPrintCrdn = () => {
var upDataset = $P.integrationSearchControl.upDataset; var upDataset = $P.ctrl.upDataset;
var downDataset = $P.integrationSearchControl.downDataset; var downDataset = $P.ctrl.downDataset;
if((upDataset.length <= 0) && (downDataset.length <= 0)){ if((upDataset.length <= 0) && (downDataset.length <= 0)){
dialog.alert("출력할 자료가 없습니다."); dialog.alert("출력할 자료가 없습니다.");
@ -530,7 +497,7 @@ $(document).ready(function() {
//교부청구서,채권신고서 //교부청구서,채권신고서
$P.fnPrintBill = () => { $P.fnPrintBill = () => {
var upDataset = $P.integrationSearchControl.upDataset; var upDataset = $P.ctrl.upDataset;
if(upDataset.length <= 0){ if(upDataset.length <= 0){
dialog.alert("출력할 자료가 없습니다."); dialog.alert("출력할 자료가 없습니다.");
@ -585,7 +552,7 @@ $(document).ready(function() {
//납부확인서 //납부확인서
$P.fnPrintRcvmtConfirm = () => { $P.fnPrintRcvmtConfirm = () => {
var downDataset = $P.integrationSearchControl.downDataset; var downDataset = $P.ctrl.downDataset;
if(downDataset.length <= 0){ if(downDataset.length <= 0){
dialog.alert("출력할 자료가 없습니다."); dialog.alert("출력할 자료가 없습니다.");
@ -607,7 +574,7 @@ $(document).ready(function() {
//사전통지서 //사전통지서
$P.fnPrintAdvntce = () => { $P.fnPrintAdvntce = () => {
var upDataset = $P.integrationSearchControl.upDataset; var upDataset = $P.ctrl.upDataset;
if(upDataset.length <= 0){ if(upDataset.length <= 0){
dialog.alert("출력할 자료가 없습니다."); dialog.alert("출력할 자료가 없습니다.");
@ -662,7 +629,7 @@ $(document).ready(function() {
//고지서 //고지서
$P.fnPrintNht = () => { $P.fnPrintNht = () => {
var upDataset = $P.integrationSearchControl.upDataset; var upDataset = $P.ctrl.upDataset;
if(upDataset.length <= 0){ if(upDataset.length <= 0){
dialog.alert("출력할 자료가 없습니다."); dialog.alert("출력할 자료가 없습니다.");
@ -720,25 +687,25 @@ $(document).ready(function() {
return; return;
} }
var upDataset = $P.integrationSearchControl.upDataset; var upDataset = $P.ctrl.upDataset;
var downDataset = $P.integrationSearchControl.downDataset; var downDataset = $P.ctrl.downDataset;
if(upDataset.length > 0){ if(upDataset.length > 0){
var info = upDataset.getData(crdnId); var info = upDataset.getData(crdnId);
if(info != null){ if(info != null){
$P.integrationSearchControl.flag = "up"; $P.ctrl.flag = "up";
} }
} }
if(downDataset.length > 0){ if(downDataset.length > 0){
var info = downDataset.getData(crdnId); var info = downDataset.getData(crdnId);
if(info != null){ if(info != null){
$P.integrationSearchControl.flag = "down"; $P.ctrl.flag = "down";
} }
} }
var params = { var params = {
callControlName : "pageObject['${pageName}'].integrationSearchControl" callControlName : "pageObject['${pageName}'].ctrl"
, crdnId : crdnId , crdnId : crdnId
} }
@ -763,8 +730,8 @@ $(document).ready(function() {
$P.provide = { $P.provide = {
"getInfo" : function(crdnId){ "getInfo" : function(crdnId){
var upDataset = $P.integrationSearchControl.upDataset; var upDataset = $P.ctrl.upDataset;
var downDataset = $P.integrationSearchControl.downDataset; var downDataset = $P.ctrl.downDataset;
if(upDataset.length > 0){ if(upDataset.length > 0){
var info = upDataset.getData(crdnId); var info = upDataset.getData(crdnId);
@ -784,8 +751,8 @@ $(document).ready(function() {
}, },
"isAllSameTask" : function(crdnIdArr){ "isAllSameTask" : function(crdnIdArr){
var upArr = $P.integrationSearchControl.upDataset.getDataset(); var upArr = $P.ctrl.upDataset.getDataset();
var downArr = $P.integrationSearchControl.downDataset.getDataset(); var downArr = $P.ctrl.downDataset.getDataset();
var unionArr = [...upArr, ...downArr]; var unionArr = [...upArr, ...downArr];
var filtered = unionArr.filter(item => crdnIdArr.includes(item.CRDN_ID)); var filtered = unionArr.filter(item => crdnIdArr.includes(item.CRDN_ID));

@ -1,3 +1,20 @@
function newCvlc05010Control(doctx = ""){
let ctrl = new AnswerBodyControl({
dataGetter : obj => obj["levyCaseList"], urls : {}, formats : {},
keymapper : info => info ? info.VLTN_CASE_ID : ""
},
{
dataGetter : obj => obj["warningCaseList"], urls : {}, formats : {},
keymapper : info => info ? info.LEVY_EXCL_RSN_CD : ""
},
{
dataGetter : obj => obj["nonlevyCaseList"], urls : {}, formats : {},
keymapper : info => info ? info.LEVY_EXCL_RSN_CD : ""
});
return ctrl;
}
class AnswerBodyControl { class AnswerBodyControl {
constructor(levyCaseConf, warningCaseConf, nonlevyCaseConf) { constructor(levyCaseConf, warningCaseConf, nonlevyCaseConf) {
this.levy = new DatasetControl(levyCaseConf); this.levy = new DatasetControl(levyCaseConf);

@ -1,39 +0,0 @@
class IntegrationSearchControl extends DatasetControl {
constructor(conf) {
super(conf);
this.upDataset = new Dataset(conf);
this.downDataset = new Dataset(conf);
}
load(pageNum) {
this.query.pageNum = pageNum;
this._load();
}
_load() {
if (!this.query.pageNum)
this.query.pageNum = 1;
ajax.get({
url:this.urls.load,
data:this.query,
success:(resp) => {
this.setData(resp);
}
});
}
setData(obj) {
this.upDataset.setData(obj.upList);
this.downDataset.setData(obj.downList);
}
set flag(updown) {
if(updown == "up"){
this.dataset = this.upDataset;
} else if(updown == "down"){
this.dataset = this.downDataset;
}
}
}

@ -0,0 +1,77 @@
function newSprt01010Control(doctx = ""){
let ctrl = new IntegrationSearchControl( {
dataGetter: obj => Array.isArray(obj) ? obj : [],
appendData: false,
keymapper: data => data ? data.CRDN_ID : "",
urls: {
load: wctx.url("/sprt/sprt01/010/list.do") // 검색
},
formats: {
CRDN_YMD_TM: datetimeFormat
, CRDN_STTS_CHG_YMD: dateFormat
, CVLCPT_RCPT_YMD: dateFormat
, LEVY_EXCL_YMD: dateFormat
, ADVNTCE_DUDT_YMD: dateFormat
, LEVY_YMD: dateFormat
, FRST_DUDT_YMD: dateFormat
, DUDT_YMD: dateFormat
, DUDT_AFTR_YMD: dateFormat
, RCVMT_YMD: dateFormat
, FFNLG_CRDN_AMT: numberFormat
, FFNLG_AMT: numberFormat
, ADVNTCE_AMT: numberFormat
, LEVY_AMT: numberFormat
, LEVY_PCPTAX: numberFormat
, LEVY_ADAMT: numberFormat
, RCVMT_AMT: numberFormat
, RCVMT_PCPTAX: numberFormat
, RCVMT_ADAMT: numberFormat
, SUM_AMT: numberFormat
, MINAP_AMT: numberFormat
, DUDT_AFTR_AMT: numberFormat
, REG_DT: datetimeFormat
, MDFCN_DT: datetimeFormat
}
});
return ctrl;
}
class IntegrationSearchControl extends DatasetControl {
constructor(conf) {
super(conf);
this.upDataset = new Dataset(conf);
this.downDataset = new Dataset(conf);
}
load(pageNum) {
this.query.pageNum = pageNum;
this._load();
}
_load() {
if (!this.query.pageNum)
this.query.pageNum = 1;
ajax.get({
url:this.urls.load,
data:this.query,
success:(resp) => {
this.setData(resp);
}
});
}
setData(obj) {
this.upDataset.setData(obj.upList);
this.downDataset.setData(obj.downList);
}
set flag(updown) {
if(updown == "up"){
this.dataset = this.upDataset;
} else if(updown == "down"){
this.dataset = this.downDataset;
}
}
}
Loading…
Cancel
Save