개별총정보 - 민원상담 수정.

main
JoJH 1 week ago
parent 669ed9392d
commit fad222608c

@ -96,6 +96,7 @@
$P.callPurpose = "${callPurpose}"; $P.callPurpose = "${callPurpose}";
// datasetControl // datasetControl
$P.ctrl = newExcl01020Control("${pageName}", "[data-doctx=${pageName}]"); $P.ctrl = newExcl01020Control("${pageName}", "[data-doctx=${pageName}]");
// //
$P.saveCallbackFuncName = "${saveCallbackFuncName}"; $P.saveCallbackFuncName = "${saveCallbackFuncName}";
$P.savedCallbackFuncName = "${savedCallbackFuncName}"; $P.savedCallbackFuncName = "${savedCallbackFuncName}";
@ -154,7 +155,7 @@
AppSupport.initDatepicker($P.findn("frmEdit")); AppSupport.initDatepicker($P.findn("frmEdit"));
// 기본 데이터 설정 // 기본 데이터 설정
$P.$findn("levyExclYmd").datepicker("setDate", TODAY()); // 달력 초기화 $P.$findn("levyExclYmd").datepicker("setDate", TODAY()); // 부과 제외 일자
// 화면 호출(callPurpose)이 view라면 버튼 비활성화 disabled = true // 화면 호출(callPurpose)이 view라면 버튼 비활성화 disabled = true
if ($P.callPurpose == "view") { if ($P.callPurpose == "view") {

@ -12,13 +12,13 @@
<label class="col-form-label bg-label-danger pe-2 w-px-120 text-sm-center">민원상담 이력</label> <label class="col-form-label bg-label-danger pe-2 w-px-120 text-sm-center">민원상담 이력</label>
<!-- 버튼 우측 정렬 --> <!-- 버튼 우측 정렬 -->
<span class="container-window-btn-right"> <span class="container-window-btn-right">
<button type="button" class="btn btn-primary w-px-120" name="btnCreateCvlcptDscsn" title="민원상담 등록"> <button type="button" class="btn btn-primary w-px-120" name="btnCreateCvlcptDscsn" title="민원상담 등록" disabled>
민원상담 등록 민원상담 등록
</button> </button>
<button type="button" class="btn btn-primary w-px-120" name="btnUpdateCvlcptDscsn" title="민원상담 수정"> <button type="button" class="btn btn-primary w-px-120" name="btnUpdateCvlcptDscsn" title="민원상담 수정" disabled>
민원상담 수정 민원상담 수정
</button> </button>
<button type="button" class="btn btn-primary w-px-120" name="btnRemoveCvlcptDscsn" title="민원상담 삭제"> <button type="button" class="btn btn-primary w-px-120" name="btnRemoveCvlcptDscsn" title="민원상담 삭제" disabled>
민원상담 삭제 민원상담 삭제
</button> </button>
</span> <!-- <span class="container-window-btn-right"> --> </span> <!-- <span class="container-window-btn-right"> -->
@ -36,7 +36,7 @@
<div class="table-responsive ox-scroll oy-scroll h-px-400" name="tableRspnsCvlcptDscsn"> <div class="table-responsive ox-scroll oy-scroll h-px-400" name="tableRspnsCvlcptDscsn">
<table class="table-layout-fixed dataTable datatables-ajax table table-bordered no-footer" aria-describedby="DataTables_Table_0_info"> <table class="table-layout-fixed dataTable datatables-ajax table table-bordered no-footer" aria-describedby="DataTables_Table_0_info">
<thead class="sticky-thead"> <thead class="sticky-thead">
<tr name="theadTrCvlcptDscsn"> <tr name="theadTrCvlcptDscsn" data-search-target="[data-doctx='${pageName}']">
<th class="cmn sorting" style="width: 180px" data-field="MDFCN_DT">수정일시</th> <th class="cmn sorting" style="width: 180px" data-field="MDFCN_DT">수정일시</th>
<th class="cmn sorting" style="width: 100px" data-field="WEEK_NM">요일</th> <th class="cmn sorting" style="width: 100px" data-field="WEEK_NM">요일</th>
<th class="cmn sorting" style="width: 140px" data-field="MDFR_NM">수정사용자</th> <th class="cmn sorting" style="width: 140px" data-field="MDFR_NM">수정사용자</th>
@ -52,7 +52,7 @@
<tbody name="tbodyCvlcptDscsnList"> <tbody name="tbodyCvlcptDscsnList">
</tbody> </tbody>
<template is="curly-brackets" name="tmpltCvlcptDscsnRows"> <template is="curly-brackets" name="tmpltCvlcptDscsnRows">
<tr data-key="CVLCPT_DSCSN_ID"> <tr data-key="{data-index}">
<td class="text-center" onclick>{REG_DT}</td> <td class="text-center" onclick>{REG_DT}</td>
<td class="text-center" onclick>{WEEK_NM}</td> <td class="text-center" onclick>{WEEK_NM}</td>
<td class="text-center" onclick>{RGTR_NM}</td> <td class="text-center" onclick>{RGTR_NM}</td>
@ -89,6 +89,8 @@
</div> <!-- <div class="content-pop"> --> </div> <!-- <div class="content-pop"> -->
<script> <script>
LoadScript("sprt02080Script", wctx.url("/webjars/js/fims/sprt/sprt02080.js?ver=${ver}"));
/************************************************************************** /**************************************************************************
* Global Variable * Global Variable
**************************************************************************/ **************************************************************************/
@ -101,133 +103,42 @@
// pageObject // pageObject
let $P = pageObject["${pageName}"]; let $P = pageObject["${pageName}"];
// FormFields // datasetControl
$P.formFields = new FimsFormFields($P.selectorn("frmEditCvlcptDscsn")); $P.ctrlCvlcptDscsn = newSprt02080Control("${pageName}", "[data-doctx=${pageName}]", "${pageNameMain}");
/**************************************************************************
* DatasetControl
**************************************************************************/
$P.ctrlCvlcptDscsn = new DatasetControl({
prefix: "cvlcptDscsn"
, prefixName: "민원상담"
, keymapper: info => info ? info.CVLCPT_DSCSN_ID : ""
, dataGetter: obj => obj.cvlcptDscsns
, appendData: true
, infoSize: "lg"
, formats: {
REG_DT: datetimeFormat
, MDFCN_DT: datetimeFormat
}
});
/************************************************************************** /**************************************************************************
* DatasetControl 이벤트 * 사용자 함수(function)
**************************************************************************/ **************************************************************************/
// Dataset 변경 이벤트 // 사유 callback
$P.ctrlCvlcptDscsn.onDatasetChange = (obj, option) => { $P.callbackRsn = (obj) => {
$P.renderList(); // 서버에 전송할 data(파라미터) 생성
}; let params = {
callPurpose: "remove"
// 현재 선택 자료 변경 이벤트 , sggCd: $P.ctrlCvlcptDscsn.getValue("SGG_CD") // 시군구 코드
$P.ctrlCvlcptDscsn.onCurrentChange = (item) => { , taskSeCd: $P.ctrlCvlcptDscsn.getValue("TASK_SE_CD") // 업무 구분 코드
if (!item) return; , cvlcptDscsnId: $P.ctrlCvlcptDscsn.getValue("CVLCPT_DSCSN_ID") // 민원상담 ID
, btnTitle: obj.btnTitle // 버튼 title
$P.formFields.set($P.ctrlCvlcptDscsn, item); // 화면에 자료 셋팅 , delRsn: obj.reason // 삭제 사유
};
let key = item.data.CVLCPT_DSCSN_ID;
$P.$findn("tbodyCvlcptDscsnList").setCurrentRow(key); // datatable에 자료 셋팅
};
// 민원 상담 내용 Dialog
$P.ctrlCvlcptDscsn.getInfo = (params) => {
if (!params) return;
ajax.get({
url: wctx.url("/" + params.taskSeCd +"/sprt/sprt04/020/info.do")
, data: params || {}
, success: (resp) => {
let dialogName = $P.ctrlCvlcptDscsn.prefixed("Dialog");
let dialogId = dialogName + "-" + uuid();
dialog.open({
id: dialogId
, title: params.btnTitle
, size: "lg"
, content: resp
, init: () => {
$("#" + dialogId).attr("name", dialogName);
$("#" + dialogId).attr("data-ref-doctx", "${pageName}");
AppSupport.setDialogZindex();
}
, onClose: () => { $P.fnRefreshDataInfo(); } // 자료 재조회
});
}
});
}
// 민원 상담 삭제 callback
$P.ctrlCvlcptDscsn.onRemove = (params, resp) => {
let showMessage = resp.rtnMsg.replace(/[S]|[F]/g, params.btnTitle);
dialog.alert({
content: showMessage
, init: () => { AppSupport.setDialogZindex(); }
, onOK: () => { }
, onClose: () => {
if (resp.saved) { $P.fnRefreshDataInfo(); } // 자료 재조회
}
});
}
// 민원 상담 삭제
$P.ctrlCvlcptDscsn.remove = (params) => {
if (!params) return;
ajax.post({
url: wctx.url("/" + params.taskSeCd + "/sprt/sprt04/010/remove.do")
, data: params || {}
, success: (resp) => {
$P.ctrlCvlcptDscsn.onRemove(params, resp);
}
});
}
/************************************************************************** $P.ctrlCvlcptDscsn.remove(params);
* DataTables 이벤트
**************************************************************************/
// DataTables에 click, dbclick 이벤트
$P.renderList = (totalSize, option) => {
let cvlcptDscsnList = $P.ctrlCvlcptDscsn.dataset;
let empty = cvlcptDscsnList.empty;
let trs = empty ? [$P.findn("tmpltNotFoundCvlcptDscsn").innerHTML] :
cvlcptDscsnList.inStrings($P.findn("tmpltCvlcptDscsnRows").innerHTML
, (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].ctrlCvlcptDscsn.setCurrent('" + dataItem.getValue("CVLCPT_DSCSN_ID") + "');")
);
$P.$findn("tbodyCvlcptDscsnList").html(trs.join());
} }
/************************************************************************** // 정보 새로고침
* 사용자 함수(function) $P.fnRefresh = () => {
**************************************************************************/ let ctrlMain = pageObject["${pageNameMain}"].ctrlMain;
// 자료 재조회
$P.fnRefreshDataInfo = () => {
let crdnId = pageObject["${mainPageName}"].mainCtrl.getValue("CRDN_ID"); // 단속 ID
// 단속 ID 가 없다면.. return // 단속 ID 가 없다면.. return
let crdnId = ctrlMain.getValue("CRDN_ID"); // 단속 ID
if (!crdnId) return; if (!crdnId) return;
let params = { let params = {
callPurpose: "refresh" callPurpose: "refresh"
, inquiryCondition: "crdnId_vhrno" , inquiryCondition: "crdnId_vhrno"
, sggCd: pageObject["${mainPageName}"].mainCtrl.getValue("SGG_CD") , sggCd: ctrlMain.getValue("SGG_CD")
, taskSeCd: pageObject["${mainPageName}"].mainCtrl.getValue("TASK_SE_CD") , taskSeCd: ctrlMain.getValue("TASK_SE_CD")
, crdnId: pageObject["${mainPageName}"].mainCtrl.getValue("CRDN_ID") , crdnId: ctrlMain.getValue("CRDN_ID")
, vhrno: pageObject["${mainPageName}"].mainCtrl.getValue("VHRNO") , vhrno: ctrlMain.getValue("VHRNO")
, delYn: "N" , delYn: "N"
}; };
@ -237,46 +148,34 @@
, data: params || {} , data: params || {}
, success: (resp) => { , success: (resp) => {
// 초기화 // 초기화
$P.findn("frmEditCvlcptDscsn").reset(); // 화면 초기화 $P.findn("frmEditCvlcptDscsn").reset(); // 민원상담 화면
$P.ctrlCvlcptDscsn.dataset.clear(); // 수납 Dataset 초기화 $P.ctrlCvlcptDscsn.dataset.clear(); // 민원상담 Dataset
// Dataset 셋팅 // sprt02010-main 단속 정보
$P.ctrlCvlcptDscsn.setData(resp.cvlcptDscsns); // 민원상담 정보 ctrlMain.setData([resp.totalInfo]);
// 민원상담 정보
$P.ctrlCvlcptDscsn.setData(resp.cvlcptDscsns);
} }
}); });
} }
// 사유 callback
$P.callbackRsn = (obj) => {
// 서버에 전송할 data(파라미터) 생성
let params = {
callPurpose: "remove"
, sggCd: $P.ctrlCvlcptDscsn.getValue("SGG_CD") // 시군구 코드
, taskSeCd: $P.ctrlCvlcptDscsn.getValue("TASK_SE_CD") // 업무 구분 코드
, cvlcptDscsnId: $P.ctrlCvlcptDscsn.getValue("CVLCPT_DSCSN_ID") // 민원상담 ID
, btnTitle: obj.btnTitle // 버튼 title
, delRsn: obj.reason // 삭제 사유
};
$P.ctrlCvlcptDscsn.remove(params);
}
/************************************************************************** /**************************************************************************
* 버튼 clickEvent * 버튼 clickEvent
**************************************************************************/ **************************************************************************/
// 민원 상담 내용 등록 // 민원 상담 내용 등록
$P.fnCreateCvlcptDscsn = (btnTitle) => { $P.fnCreateCvlcptDscsn = (btnTitle) => {
let crdnId = pageObject["${mainPageName}"].mainCtrl.getValue("CRDN_ID"); // 단속 ID
// 단속 ID 가 없다면.. return // 단속 ID 가 없다면.. return
let ctrlMain = pageObject["${pageNameMain}"].ctrlMain; // sprt02010 control
let crdnId = ctrlMain.getValue("CRDN_ID"); // 단속 ID
if (!crdnId) return; if (!crdnId) return;
let params = { let params = {
callPurpose: "create" callPurpose: "create"
, btnTitle: btnTitle , btnTitle: btnTitle
, sggCd: pageObject["${mainPageName}"].mainCtrl.getValue("SGG_CD") // 시군구 코드 , sggCd: ctrlMain.getValue("SGG_CD") // 시군구 코드
, taskSeCd: pageObject["${mainPageName}"].mainCtrl.getValue("TASK_SE_CD") // 업무 구분 코드 , taskSeCd: ctrlMain.getValue("TASK_SE_CD") // 업무 구분 코드
, crdnId: pageObject["${mainPageName}"].mainCtrl.getValue("CRDN_ID") // 단속 ID , crdnId: ctrlMain.getValue("CRDN_ID") // 단속 ID
}; };
$P.ctrlCvlcptDscsn.getInfo(params); $P.ctrlCvlcptDscsn.getInfo(params);
@ -284,9 +183,8 @@
// 민원 상담 내용 수정 // 민원 상담 내용 수정
$P.fnUpdateCvlcptDscsn = (btnTitle) => { $P.fnUpdateCvlcptDscsn = (btnTitle) => {
let cvlcptDscsnId = $P.ctrlCvlcptDscsn.getValue("CVLCPT_DSCSN_ID"); // 민원 상담 ID
// 민원 상담 ID 가 없다면.. return // 민원 상담 ID 가 없다면.. return
let cvlcptDscsnId = $P.ctrlCvlcptDscsn.getValue("CVLCPT_DSCSN_ID"); // 민원 상담 ID
if (!cvlcptDscsnId) return; if (!cvlcptDscsnId) return;
let params = { let params = {
@ -303,9 +201,8 @@
// 민원상담 내용 삭제 // 민원상담 내용 삭제
$P.fnRemoveCvlcptDscsn = (btnTitle) => { $P.fnRemoveCvlcptDscsn = (btnTitle) => {
let cvlcptDscsnId = $P.ctrlCvlcptDscsn.getValue("CVLCPT_DSCSN_ID"); // 민원 상담 ID
// 민원 상담 ID 가 없다면.. return // 민원 상담 ID 가 없다면.. return
let cvlcptDscsnId = $P.ctrlCvlcptDscsn.getValue("CVLCPT_DSCSN_ID"); // 민원 상담 ID
if (!cvlcptDscsnId) return; if (!cvlcptDscsnId) return;
// 삭제 메세지 확인 // 삭제 메세지 확인
@ -344,7 +241,7 @@
$P.fnCreateCvlcptDscsn($P.$findn("btnCreateCvlcptDscsn").attr("title")); // 민원상담 등록 $P.fnCreateCvlcptDscsn($P.$findn("btnCreateCvlcptDscsn").attr("title")); // 민원상담 등록
}); });
$P.$findn("btnUpdateCvlcptDscsn").on("click", function() { $P.$findn("btnUpdateCvlcptDscsn").on("click", function() {
$P.fnCreateCvlcptDscsn($P.$findn("btnUpdateCvlcptDscsn").attr("title")); // 민원상담 수정 $P.fnUpdateCvlcptDscsn($P.$findn("btnUpdateCvlcptDscsn").attr("title")); // 민원상담 수정
}); });
$P.$findn("btnRemoveCvlcptDscsn").on("click", function() { $P.$findn("btnRemoveCvlcptDscsn").on("click", function() {
$P.fnRemoveCvlcptDscsn($P.$findn("btnRemoveCvlcptDscsn").attr("title")); // 민원상담 삭제 $P.fnRemoveCvlcptDscsn($P.$findn("btnRemoveCvlcptDscsn").attr("title")); // 민원상담 삭제
@ -355,17 +252,14 @@
} }
// 초기 화면 설정 // 초기 화면 설정
$P.initForm = () => { $P.fnReset = () => {
// 초기화 // 화면 초기화
$P.findn("frmEditCvlcptDscsn").reset(); // 화면 초기화 $P.findn("frmEditCvlcptDscsn").reset();
$P.ctrlCvlcptDscsn.dataset.clear(); // 수납 Dataset 초기화 // Dataset 초기화
$P.ctrlCvlcptDscsn.dataset.clear(); // 수납 Dataset
// 화면 호출(callPurpose)이 view라면 버튼 비활성화 disabled = true // 화면 호출(callPurpose)이 view라면 버튼 비활성화 disabled = true
if (pageObject['${mainPageName}'].callPurpose == "view") { if (pageObject['${pageNameMain}'].callPurpose != "view") {
$P.$findn("btnCreateCvlcptDscsn").prop("disabled", true);
$P.$findn("btnUpdateCvlcptDscsn").prop("disabled", true);
$P.$findn("btnRemoveCvlcptDscsn").prop("disabled", true);
} else {
$P.$findn("btnCreateCvlcptDscsn").prop("disabled", false); $P.$findn("btnCreateCvlcptDscsn").prop("disabled", false);
$P.$findn("btnUpdateCvlcptDscsn").prop("disabled", false); $P.$findn("btnUpdateCvlcptDscsn").prop("disabled", false);
$P.$findn("btnRemoveCvlcptDscsn").prop("disabled", false); $P.$findn("btnRemoveCvlcptDscsn").prop("disabled", false);
@ -379,7 +273,7 @@
$P.setEvent(); $P.setEvent();
// 2. 초기 화면 설정 // 2. 초기 화면 설정
$P.initForm(); $P.fnReset();
// 3. Dataset 설정 // 3. Dataset 설정
$P.ctrlCvlcptDscsn.setData(${cvlcptDscsns}); // 민원 상담 정보 $P.ctrlCvlcptDscsn.setData(${cvlcptDscsns}); // 민원 상담 정보

@ -1,217 +1,162 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%> <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%>
<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%> <%@ include file="/WEB-INF/jsp/include/taglib.jsp"%>
<c:set var="prefixName" scope="request">민원 상담 내용 정보</c:set> <c:set var="prefixName" scope="request">민원상담 상세 정보</c:set>
<!-- inner page html --> <!-- inner page html -->
<div class="content-pop"> <div class="content-pop" data-doctx="${pageName}">
<!-- Content --> <!-- Content -->
<div class="container flex-grow-1 px-0"> <div class="container flex-grow-1 px-0">
<div class="card"> <div class="card">
<!-- 입력 영역 --> <!-- 입력 영역 -->
<form id="frmEdit--${pageName}" name="frmEdit"> <form name="frmEdit">
<!-- hidden --> <!-- hidden -->
<input type="hidden" id="sggCd--${pageName}" name="sggCd" data-map="SGG_CD" /> <input type="hidden" name="sggCd" data-map="SGG_CD" />
<input type="hidden" id="taskSeCd--${pageName}" name="taskSeCd" data-map="TASK_SE_CD" /> <input type="hidden" name="taskSeCd" data-map="TASK_SE_CD" />
<input type="hidden" id="crdnId--${pageName}" name="crdnId" data-map="CRDN_ID" /> <input type="hidden" name="crdnId" data-map="CRDN_ID" />
<input type="hidden" id="cvlcptDscsnId--${pageName}" name="cvlcptDscsnId" data-map="CVLCPT_DSCSN_ID" /> <input type="hidden" name="cvlcptDscsnId" data-map="CVLCPT_DSCSN_ID" />
<input type="hidden" id="vhrno--${pageName}" name="vhrno" data-map="VHRNO" /> <input type="hidden" name="vhrno" data-map="VHRNO" />
<input type="hidden" id="rtpyrNo--${pageName}" name="rtpyrNo" data-map="RTPYR_NO" /> <input type="hidden" name="rtpyrNo" data-map="RTPYR_NO" />
<div class="row g-1"> <div class="row g-1">
<!-- 민원 접수 구분 코드 --> <div class="col-md-6">
<div class="col-md-12"> <label is="name-label" class="col-form-label bg-lighter pe-2 w-px-120 text-sm-end required" for="cvlcptRcptSeCd">접수구분</label>
<label for="cvlcptRcptSeCd--${pageName}" class="w-px-120 bg-lighter pe-2 col-form-label text-sm-end required">접수구분</label> <select is="id-select" class="form-select" name="cvlcptRcptSeCd" data-map="CVLCPT_RCPT_SE_CD" required>
<select class="form-select" id="cvlcptRcptSeCd--${pageName}" name="cvlcptRcptSeCd" data-map="CVLCPT_RCPT_SE_CD" required> <option value="">선택하세요</option>
<option value="">선택하세요</option> <c:forEach items="${FIM065List}" var="item">
<c:forEach items="${FIM065List}" var="item"> <option value="${item.code}">${item.value}</option>
<option value="${item.code}">${item.value}</option> </c:forEach>
</c:forEach> </select>
</select> </div>
</div> <div class="col-md-6">
<!-- 민원인명 --> <label is="name-label" class="col-form-label bg-lighter pe-2 w-px-120 text-sm-end required" for="dscsnYmd">상담일자</label>
<div class="col-md-6"> <input is="id-input" type="text" class="form-control form-date" name="dscsnYmd" data-map="DSCSN_YMD"
<label for="cvlprNm--${pageName}" class="w-px-120 bg-lighter pe-2 col-form-label text-sm-end">민원인명</label> data-fmt-type="day" autocomplete="off" title="날짜 선택" maxlength="10" required />
<input type="text" class="form-control w-px-160" id="cvlprNm--${pageName}" name="cvlprNm" data-map="CVLPR_NM" autocomplete="off" /> <button type="button" class="bx bx-lg bx-calendar bg-white" name="btnLevyExclYmd"></button>
</div> </div>
<!-- 민원인 연락처 --> <div class="col-md-6">
<div class="col-md-6"> <label is="name-label" class="col-form-label bg-lighter pe-2 w-px-120 text-sm-end" for="cvlprNm">민원인명</label>
<label for="cvlprCttpc--${pageName}" class="w-px-120 bg-lighter pe-2 col-form-label text-sm-end">연락처</label> <input is="id-input" type="text" class="form-control w-px-160" name="cvlprNm" data-map="CVLPR_NM" autocomplete="off" />
<input type="text" class="form-control w-px-160" id="cvlprCttpc--${pageName}" name="cvlprCttpc" data-map="CVLPR_CTTPC" autocomplete="off" /> </div>
</div> <div class="col-md-6">
<!-- 상담 내용 --> <label is="name-label" class="col-form-label bg-lighter pe-2 w-px-120 text-sm-end" for="cvlprCttpc">연락처</label>
<div class="col-md-12"> <input is="id-input" type="text" class="form-control w-px-160" name="cvlprCttpc" data-map="CVLPR_CTTPC" autocomplete="off" />
<label for="dscsnCn--${pageName}" class="w-px-120 bg-lighter pe-2 col-form-label text-sm-end">상담 내용</label> </div>
<textarea type="text" class="form-control w-85" id="dscsnCn--${pageName}" name="dscsnCn" data-map="DSCSN_CN" rows="5" data-maxlengthb="4000"></textarea> <div class="col-md-12">
</div> <label is="name-label" class="col-form-label bg-lighter pe-2 w-px-120 text-sm-end" for="dscsnCn">상담내용</label>
</div> <textarea is="id-textarea" type="text" class="form-control w-85" name="dscsnCn" data-map="DSCSN_CN" rows="5" data-maxlengthb="4000"></textarea>
</form> </div>
<!-- 입력 영역 --> </div>
</form>
<!-- 업무 버튼 및 건수 표시 --> <!-- 입력 영역 -->
<div> </div> <!-- <div class="card"> -->
<span class="container-page-btn">
<!-- 업무 버튼 --> <!-- 업무 버튼 및 건수 표시 -->
<span class="container-window-btn-right"> <div>
<button type="button" class="btn btn-primary w-px-80" id="btnSave--${pageName}" title="저장"> <span class="container-page-btn">
저장 <!-- 업무 버튼 -->
</button> <span class="container-window-btn-right">
</span> <button type="button" class="btn btn-primary w-px-120" name="btnSave" title="저장">
</span> 저장
</div> </button>
<!-- 업무 버튼 및 건수 표시 --> </span>
</div> <!-- <div class="card"> --> </span>
</div> <!-- <div class="container flex-grow-1 px-0"> --> </div>
<!-- Content --> <!-- 업무 버튼 및 건수 표시 -->
</div> <!-- / inner page html <div class="content-pop"> --> </div> <!-- <div class="container flex-grow-1 px-0"> -->
<!-- Content -->
</div>
<!-- / inner page html <div class="content-pop"> -->
<script> <script>
/************************************************************************** LoadScript("sprt04020Script", wctx.url("/webjars/js/fims/sprt/sprt04020.js?ver=${ver}"));
* Global Variable
**************************************************************************/ /**************************************************************************
pageObject["${pageName}"] = {}; * Global Variable
**************************************************************************/
/************************************************************************** pageObject["${pageName}"] = newDoctxFinder("${pageName}");
* script 진입
**************************************************************************/ /**************************************************************************
$(document).ready(function() { * script 진입
// pageObject **************************************************************************/
let $P = pageObject["${pageName}"]; $(document).ready(function() {
// pageObject
// infoDialog 호출 용도(view 조회(편집불가), create 등록, update 수정) let $P = pageObject["${pageName}"];
$P.callPurpose = "${callPurpose}";
// FormFields // URL
$P.formFields = new FimsFormFields("#frmEdit--${pageName}"); $P.prefixUrl = "${prefixUrl}"
// infoDialog 호출 용도(view 조회(편집불가), create 등록, update 수정)
/************************************************************************** $P.callPurpose = "${callPurpose}";
* DatasetControl // datasetControl
**************************************************************************/ $P.ctrl = newSprt04020Control("${pageName}", "[data-doctx=${pageName}]");
$P.control = new DatasetControl({
prefix: "cvlcptDscsn" /**************************************************************************
, prefixName: "민원상담" * 사용자 함수(function)
, keymapper: info => info ? info.CVLCPT_DSCSN_ID : "" **************************************************************************/
, dataGetter: obj => obj.${infoPrefix}Info
});
/**************************************************************************
/************************************************************************** * 버튼 clickEvent
* DatasetControl 이벤트 **************************************************************************/
**************************************************************************/ // 저장
// 현재 선택 자료 변경 이벤트 $P.fnSave = () => {
$P.control.onCurrentChange = item => { // validate 확인
if (!item) return; if (!AppSupport.customValidate($P.$findn("frmEdit").find("input,select,textarea"))) return;
// Dataset 셋팅 // formFields
$P.formFields.set($P.control,item); let params = new FimsFormFields($P.selectorn("frmEdit")).get();
// 업무구분에 따른 URL 변경 dialog.alert({
$P.fnSetURL(item.data.TASK_SE_CD); content : "현재 " + $P.ctrl.prefixName + " 정보를 저장하시겠습니까?"
} , init: () => { AppSupport.setDialogZindex(); }
, onOK: () => { $P.ctrl.save(params); } // formFields
// 저장 callback });
$P.control.onSave = (resp) => { }
let dialogTitle = $("#" + $P.control.prefix + "Dialog--${openerPageName}").find("h5.modal-title").html();
let showMessage = resp.rtnMsg.replace(/[S]|[F]/g, dialogTitle); /**************************************************************************
* 초기 셋팅
// 메시지 출력 **************************************************************************/
dialog.alert({ // 이벤트 설정
content: showMessage $P.setEvent = () => {
, init: () => { AppSupport.setDialogZindex(); } // 버튼 이벤트
, onOK: () => { } $P.$findn("btnSave").on("click", () => { $P.fnSave() }); // 저장
}); }
if (resp.saved) { // 초기 화면 설정
dialog.close($P.control.prefix + "Dialog--${openerPageName}"); $P.fnReset = () => {
} // 초기화
} $P.findn("frmEdit").reset(); // 화면 초기화
// 저장 // 달력 초기화
$P.control.save = (info) => { AppSupport.initDatepicker($P.findn("frmEdit"));
if (!info) return;
// 기본 데이터 설정
let create = ($P.callPurpose == "create"); $P.$findn("dscsnYmd").datepicker("setDate", TODAY()); // 상담 일자
ajax.post({ // 화면 호출(callPurpose)이 view라면 버튼 비활성화 disabled = true
url: !create ? $P.control.urls.update : $P.control.urls.create if ($P.callPurpose == "view") {
, data: info // input 요소들을 disabled
, success: resp => $P.control.onSave(resp) $P.$findn("frmEdit").find("input,textarea,select").prop("disabled", true);
});
} // button 요소들을 disabled
$P.$findn("btnLevyExclYmd").prop("disabled", true); // 부과제외 일자 달력 버튼
/************************************************************************** $P.$findn("btnSave").prop("disabled", true); // 저장 버튼
* 사용자 함수(function) } else if ($P.callPurpose == "update") {
**************************************************************************/ $P.$findn("cvlcptRcptSeCd").prop("disabled", true); // 민원 접수 구분 코드
// 업무구분에 따른 URL 설정 }
$P.fnSetURL = (taskSeCd) => { }
$P.control.urls.create = wctx.url("/" + taskSeCd + "${infoPrefixUrl}" + "/020/create.do"); // 등록
$P.control.urls.update = wctx.url("/" + taskSeCd + "${infoPrefixUrl}" + "/020/update.do"); // 수정 /**************************************************************************
} * 최초 실행 함수
**************************************************************************/
/************************************************************************** // 1. 이벤트 설정
* 버튼 clickEvent $P.setEvent();
**************************************************************************/
// 저장 // 2. 초기 화면 설정
$P.fnSave = () => { $P.fnReset();
// validate 확인
if (!AppSupport.customValidate($("#frmEdit--${pageName}").find("input, select, textarea"))) return; // 3. Dataset 설정
$P.ctrl.setData([${info}]);
dialog.alert({ });
content : "현재 " + $P.control.prefixName + " 정보를 저장하시겠습니까?"
, init: () => { AppSupport.setDialogZindex(); }
, onOK: () => {
$P.control.save($P.formFields.get()); // formFields
}
});
}
/**************************************************************************
* 초기 셋팅
**************************************************************************/
// 이벤트 설정
$P.setEvent = () => {
// form-date 항목에서 키보드로 입력시 날짜 포맷팅 적용
$("#frmEdit--${pageName}").find(".form-date").each(function() {
$(this).on("input",function() {
let value = this.value.replaceAll("-", "");
if (value.length > 7) {
this.value = value.substring(0,4) + "-" + value.substring(4,6) + "-" + value.substring(6);
} else if(value.length > 5) {
this.value = value.substring(0,4) + "-" + value.substring(4);
}
});
});
// 버튼 이벤트
$("#btnSave--${pageName}").on("click", () => $P.fnSave()); // 저장
}
// 초기 화면 설정
$P.initForm = () => {
// 달력 초기화
AppSupport.initDatepicker("frmEdit--${pageName}");
// View로 호출
if ($P.callPurpose == "view") {
// input 요소들을 disabled
$("#frmEdit--${pageName}").find("input,textarea,select").prop("disabled", true);
// button 요소들을 disabled
$("btnSave--${pageName}").prop("disabled", true);
} else if ($P.callPurpose == "update") {
$("#cvlcptRcptSeCd--${pageName}").prop("disabled", true);
}
}
/**************************************************************************
* 최초 실행 함수
**************************************************************************/
// 1. 이벤트 설정
$P.setEvent();
// 2. 초기 화면 설정
$P.initForm();
// 3. Dataset 설정
$P.control.setData([${cvlcptDscsnInfo}]);
});
</script> </script>

@ -1,46 +1,84 @@
function newSprt02030Control(pageName, doctx="[data-doctx='sprt02030']") { function newSprt02080Control(pageName, doctx="[data-doctx='sprt02080']", mainPageName="sprt02010") {
let ctrl = new DatasetControl({ let ctrlCvlcptDscsn = new DatasetControl({
doctx: doctx doctx: doctx
, prefix: "levyExcl" , prefix: "cvlcptDscsn"
, prefixName: "부과제외" , prefixName: "민원상담"
, dataGetter: obj => obj["Info"] , dataGetter: obj => obj["cvlcptDscsns"]
, keys: ["LEVY_EXCL_ID"] , keys: ["CVLCPT_DSCSN_ID"]
, appendData: true
, infoSize: "lg"
, urls: { , urls: {
load: "/list.do" load: "/list.do"
, getInfo: "/info.do" , getInfo: "/info.do"
, create: "/create.do" }
, update: "/update.do" , formats: {
, remove: "/remove.do" REG_DT: datetimeFormat
, MDFCN_DT: datetimeFormat
} }
}); });
/************************************************************************** /**************************************************************************
* DatasetControl Events * DatasetControl Events
**************************************************************************/ **************************************************************************/
// Dataset 변경 이벤트
ctrlCvlcptDscsn.onDatasetChange = (obj, option) => {
// 데이터 셋
let dataList = ctrlCvlcptDscsn.dataset;
let empty = dataList.empty;
let replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['" + pageName + "'].ctrlCvlcptDscsn.setCurrent('{data-index}');")
let trs = empty ?
[ctrlCvlcptDscsn.find("[name='tmpltNotFoundCvlcptDscsn']").innerHTML]
: dataList.inStrings(ctrlCvlcptDscsn.find("[name='tmpltCvlcptDscsnRows']").innerHTML, replacer);
// dataTables(그리드)에 자료 표시 td
$(ctrlCvlcptDscsn.find("[name='tbodyCvlcptDscsnList']")).html(trs.join());
};
// 현재 선택 자료 변경 이벤트 // 현재 선택 자료 변경 이벤트
ctrl.onCurrentChange = (item) => { ctrlCvlcptDscsn.onCurrentChange = (item) => {
Apply.fromDataset.currentRow(ctrlCvlcptDscsn.dataset, item, ctrlCvlcptDscsn.find("[name='tbodyCvlcptDscsnList']"));
if (!item) return; if (!item) return;
// 화면에 단속 Dataset 셋팅 // 화면에 단속 Dataset 셋팅
let formFields = new FimsFormFields(ctrl.selector("[name='frmEdit']")); let formFields = new FimsFormFields(ctrlCvlcptDscsn.selector("[name='frmEditCvlcptDscsn']"));
formFields.set(ctrl, item); formFields.set(ctrlCvlcptDscsn, item);
};
// 업무구분에 따른 URL 변경 // 상세 정보 dialog
pageObject[pageName].fnSetURL(item.data.TASK_SE_CD); ctrlCvlcptDscsn.getInfo = (params) => {
if (!params) return;
// 부과제외구분에 따른 부과제외사유 설정 ajax.get({
pageObject[pageName].fnSetFim021(item.data.LEVY_EXCL_SE_CD, item.data.LEVY_EXCL_RSN_CD); url: wctx.url("/" + params.taskSeCd +"/sprt/sprt04/020/info.do")
, data: params || {}
, success: (resp) => {
let dialogName = ctrlCvlcptDscsn.prefixed("Dialog");
let dialogId = dialogName + "-" + uuid();
// 부과제외일자 dialog.open({
if (item.data.LEVY_EXCL_YMD == "") { id: dialogId
$(ctrl.find("[name='levyExclYmd']")).datepicker("setDate", TODAY()); , title: params.btnTitle
} , size: ctrlCvlcptDscsn.infoSize
}; , content: resp
, init: () => {
$("#" + dialogId).attr("name", dialogName);
$("#" + dialogId).attr("data-ref-doctx", pageName);
AppSupport.setDialogZindex();
}
, onClose: () => { pageObject[pageName].fnRefresh(); } // 정보 새로고침
});
}
});
}
// 저장 callback // 삭제 callback
ctrl.onSave = (params, resp) => { ctrlCvlcptDscsn.onRemove = (params, resp) => {
let showMessage = resp.rtnMsg.replace(/[S]|[F]/g, ctrl.prefixName); let showMessage = resp.rtnMsg.replace(/[S]|[F]/g, params.btnTitle);
let modalId = $(document.querySelector(doctx)).parents(".modal")[0].id;
// 메시지 출력 // 메시지 출력
dialog.alert({ dialog.alert({
@ -48,33 +86,21 @@ function newSprt02030Control(pageName, doctx="[data-doctx='sprt02030']") {
, init: () => { AppSupport.setDialogZindex(); } , init: () => { AppSupport.setDialogZindex(); }
, onOK: () => { } , onOK: () => { }
, onClose: () => { , onClose: () => {
if (pageObject[pageName].savedCallbackFuncName != "") { if (resp.saved) { pageObject[pageName].fnRefresh(); } // 정보 새로고침
pageObject[pageName].savedCallbackFuncName(resp.saved);
}
if (resp.saved) { dialog.close(modalId); }
} }
}); });
} }
// 저장 // 삭제
ctrl.save = (params) => { ctrlCvlcptDscsn.remove = (params) => {
if (!params) return; if (!params) return;
let create = (params.callPurpose == "create"); ajax.post({
url: wctx.url("/" + params.taskSeCd + "/sndb/sndb01/220/remove.do")
// 민원 접수 관리에서 호출했다면.. , data: params || {}
if (create && pageObject[pageName].saveCallbackFuncName != "") { , success: (resp) => { ctrlCvlcptDscsn.onRemove(params, resp); }
pageObject[pageName].saveCallbackFuncName(info); });
} else {
ajax.post({
url: !create ? ctrl.urls.update : ctrl.urls.create
, data: params || {}
, success: (resp) => { ctrl.onSave(params, resp); }
});
}
} }
return ctrl; return ctrlCvlcptDscsn;
} }

@ -0,0 +1,61 @@
function newSprt04020Control(pageName, doctx="[data-doctx='sprt04020']") {
let ctrl = new DatasetControl({
doctx: doctx
, prefix: "cvlcptDscsn"
, prefixName: "민원상담"
, dataGetter: obj => obj["info"]
, keys: ["CVLCPT_DSCSN_ID"]
, urls: {
create: "/create.do"
, update: "/update.do"
}
});
/**************************************************************************
* DatasetControl Events
**************************************************************************/
// 현재 선택 자료 변경 이벤트
ctrl.onCurrentChange = (item) => {
if (!item) return;
// 화면에 단속 Dataset 셋팅
let formFields = new FimsFormFields(ctrl.selector("[name='frmEdit']"));
formFields.set(ctrl, item);
// 업무구분에 따른 URL 변경
ctrl.urls.create = wctx.url("/" + item.data.TASK_SE_CD + pageObject[pageName].prefixUrl + "/020/create.do"); // 등록
ctrl.urls.update = wctx.url("/" + item.data.TASK_SE_CD + pageObject[pageName].prefixUrl + "/020/update.do"); // 수정
};
// 저장 callback
ctrl.onSave = (params, resp) => {
let modalId = $(document.querySelector(doctx)).parents(".modal")[0].id;
let dialogTitle = $("#" + modalId).find("h5.modal-title").html();
let showMessage = resp.rtnMsg.replace(/[S]|[F]/g, dialogTitle);
// 메시지 출력
dialog.alert({
content: showMessage
, init: () => { AppSupport.setDialogZindex(); }
, onOK: () => { }
, onClose: () => {
if (resp.saved) { dialog.close(modalId); }
}
});
}
// 저장
ctrl.save = (params) => {
if (!params) return;
let create = (params.cvlcptDscsnId == "");
ajax.post({
url: !create ? ctrl.urls.update : ctrl.urls.create
, data: params || {}
, success: (resp) => { ctrl.onSave(params, resp); }
});
}
return ctrl;
}
Loading…
Cancel
Save