민원 원본보기 팝업 화면 수정

main
이범준 1 year ago
parent dcce8af4bd
commit 38bc7678f3

@ -4,6 +4,7 @@ import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
@ -75,11 +76,14 @@ public class Crdn01Controller extends ApplicationController {
* @return fims/crdn/crdn01050-info
*/
@RequestMapping(name="민원내역 원본 보기", value="/050/info.do")
public ModelAndView getCivilComplaintOriginalInfo(CrdnQuery req) {
public ModelAndView getCivilComplaintOriginalInfo(CrdnQuery req, HttpServletRequest request) {
boolean json = jsonResponse();
ModelAndView mav = new ModelAndView(json ? "jsonView" : "fims/crdn/crdn01050-info");
mav.addObject("pageName", "crdn01050-info");
String urlTaskSeCd = request.getServletPath().split("/")[1];
mav.addObject("taskSeCd", urlTaskSeCd);
Map<String, List<CommonCode>> commonCodes = getCodesOf("FIM039");
mav.addObject("FIM039List", commonCodes.get("FIM039"));

@ -386,16 +386,59 @@ $(document).ready(function(){
var taskSeCd = $("#frmSearch--${pageName} input[name='taskSeCd']:checked").val();
var dialogId = "cvlcptOrgnlDialog--${pageName}";
ajax.get({
url : wctx.url("/"+taskSeCd+"/crdn/crdn01/050/info.do"),
data : { crdnId : cur["CRDN_ID"] },
success : resp => {
dialog.open({
id : "cvlcptOrgnlDialog--${pageName}"
, title : "민원내역 원본"
, content : resp
, size : "xl"
, init : () => {}
id : dialogId,
title : "민원내역 원본",
content : resp,
size : "xl",
init : () => {
var parentRes = new Object();
var childReq = pageObject.childReq.pop();
for(var reqKey in childReq) {
if(reqKey == "getCountStatus"){
parentRes[reqKey] = function(currentKey){
var ds = $P.crdnControl.dataset.getDataset();
var index = ds.findIndex(item => item.CRDN_ID == currentKey);
return (index+1) + " of " + ds.length;
};
}
if(reqKey == "getNextKey"){
parentRes[reqKey] = function(currentKey){
var ds = $P.crdnControl.dataset.getDataset();
var index = ds.findIndex(item => item.CRDN_ID == currentKey);
if(ds.length > index+1){
return ds[index+1]["CRDN_ID"];
} else {
return "";
}
};
}
if(reqKey == "getPrevKey"){
parentRes[reqKey] = function(currentKey){
var ds = $P.crdnControl.dataset.getDataset();
var index = ds.findIndex(item => item.CRDN_ID == currentKey);
if(index != 0 && ds.length > 1){
return ds[index-1]["CRDN_ID"];
} else {
return "";
}
};
}
if(reqKey == "selectRow"){
parentRes[reqKey] = function(currentKey){
$P.clickCrdnList(currentKey);
};
}
}
pageObject.parentRes.push(parentRes);
}
});
}
});

@ -59,41 +59,107 @@
</c:forEach>
</select>
</div>
<div class="col-md-6">
<input type="text" id="countStauts--${pageName}" class="form-control w-px-150 text-center fw-bold" readonly />
<button type="button" class="w-px-50" id="btnPrev--${pageName}">◀</button>
<button type="button" class="w-px-50" id="btnNext--${pageName}">▶</button>
</div>
</div>
</form>
</div>
</div>
<script>
pageObject["${pageName}"] = {};
pageObject["${pageName}"].parentRes = {};
pageObject.childReq = [];
pageObject.childReq.push({
getCountStatus : function(){},
getNextKey : function(){},
getPrevKey : function(){},
selectRow : function(){}
});
$(document).ready(function() {
var $P = pageObject["${pageName}"];
$P.taskSeCd = "${taskSeCd}";
if(pageObject.parentRes.length > 0){
$P.parentRes = pageObject.parentRes.pop();
} else {
$P.parentRes = pageObject.childReq.pop();
}
/**************************************************************************
* DatasetControl, Dataset, FormFields
**************************************************************************/
$P.formFields = new FimsFormFields("#frmEdit--${pageName}");
$P.cvlcptControl = new DatasetControl({
$P.cvlcptControl = new DatasetControl({
prefix:"cvlcpt", prefixName:"민원", infoSize:"xl",
urls : { load : "" },
urls : { load : "", getInfo : wctx.url("/"+$P.taskSeCd+"/crdn/crdn01/050/info.do") },
keymapper:info => info ? info.CRDN_ID : "",
dataGetter:obj => obj.cvlcptInfo,
formats: { }
formats: {
CVLCPT_RCPT_YMD : dateFormat,
CVLCPT_PRCS_PRNMNT_DT : dateFormat
}
});
/**************************************************************************
* DatasetControl.on, Dataset.on
**************************************************************************/
$P.cvlcptControl.onCurrentChange = (item) => {
$P.cvlcptControl.onCurrentChange = (item) => {
$P.formFields.set(item);
}
/**************************************************************************
* pageObject.function
**************************************************************************/
$P.fnPrev = () => {
var prevKey = $P.parentRes.getPrevKey($("#crdnId--${pageName}").val());
if(prevKey != ""){
$P.fnGo(prevKey);
}
}
$P.fnNext = () => {
var nextKey = $P.parentRes.getNextKey($("#crdnId--${pageName}").val());
if(nextKey != ""){
$P.fnGo(nextKey);
}
}
$P.fnGo = (crdnId) => {
ajax.get({
url: $P.cvlcptControl.urls.getInfo,
data: { "crdnId" : crdnId },
headers: {
Accept: "application/json; charset=utf-8"
},
success : resp => {
$P.cvlcptControl.setData([resp.cvlcptInfo]);
var cs = $P.parentRes.getCountStatus($("#crdnId--${pageName}").val());
$("#countStauts--${pageName}").val(cs);
$P.parentRes.selectRow(crdnId);
}
});
}
/**************************************************************************
* element.on
**************************************************************************/
$("#btnPrev--${pageName}").on("click", () => $P.fnPrev() );
$("#btnNext--${pageName}").on("click", () => $P.fnNext() );
/**************************************************************************
* 초기화
**************************************************************************/
$P.cvlcptControl.setData([${cvlcptInfo}]);
var cs = $P.parentRes.getCountStatus($("#crdnId--${pageName}").val());
$("#countStauts--${pageName}").val(cs);
});
</script>

@ -41,6 +41,8 @@
<script>
var pageObject = {};
pageObject.childReq = [];
pageObject.parentRes = [];
function getBrowserName() {
var agent = navigator.userAgent.toUpperCase();

Loading…
Cancel
Save