<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%>
<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%>

<!-- Page Body -->
<div class="content-wrapper">
	<!-- 화면 분할 -->
	<div class="d-flex flex-row justify-content-evenly">
		<!-- 감경 정보 -->
		<div class="col-xl-6 mx-1">
			<div class="card">
				<!-- 업무 버튼 -->
				<div class="container-page-btn">
					<label class="w-px-120 bg-label-danger pe-2 col-form-label text-sm-center">감경 정보</label>
					<!-- 버튼 우측 정렬 -->
					<span class="container-window-btn-right">
						<button type="button" class="btn btn-primary" id="btnCreate--${pageName}${pageDataName1}" title="감경 등록" onclick="fnCreate${pageName}${pageDataName1}();">
							감경 등록
						</button>
						<button type="button" class="btn btn-primary" id="btnUpdate--${pageName}${pageDataName1}" title="감경 수정" onclick="fnUpdate${pageName}${pageDataName1}();">
							감경 수정
						</button>
						<button type="button" class="btn btn-primary" id="btnRemove--${pageName}${pageDataName1}" title="감경 삭제" onclick="fnRemove${pageName}${pageDataName1}();">
							감경 삭제
						</button>
					</span>
				</div> <!-- <div class="container-page-btn"> -->
				<!-- 입력 영역 -->
				<form id="frmEdit--${pageName}${pageDataName1}" name="frmEdit${pageDataName1}">
					<!-- hidden -->
					<input type="hidden" id="rductId--${pageName}${pageDataName1}" name="rductId" data-map="RDUCT_ID" />

					<div class="row g-1">
						<!-- 감경 일자 -->
						<div class="col-md-6">
							<label for="rductYmd--${pageName}${pageDataName1}" class="w-px-120 bg-lighter pe-2 col-form-label text-sm-end">감경 일자</label>
							<input type="text" class="form-control w-30" id="rductYmd--${pageName}${pageDataName1}" name="rductYmd" data-map="RDUCT_YMD" readonly />
						</div>
						<!--  -->
						<div class="col-md-6">
						</div>
						<!-- 감경 사유 명 -->
						<div class="col-md-6">
							<label for="rductRsnNm--${pageName}${pageDataName1}" class="w-px-120 bg-lighter pe-2 col-form-label text-sm-end">감경 사유</label>
							<input type="text" class="form-control w-50" id="rductRsnNm--${pageName}${pageDataName1}" name="rductRsnNm" data-map="RDUCT_RSN_NM" readonly />
						</div>
						<!-- 감경 금액 -->
						<div class="col-md-6">
							<label for="rductAmt--${pageName}${pageDataName1}" class="w-px-120 bg-lighter pe-2 col-form-label text-sm-end">감경 금액</label>
							<input type="text" class="form-control w-30 text-end" id="rductAmt--${pageName}${pageDataName1}" name="rductAmt" data-map="RDUCT_AMT" readonly />
						</div>
						<!-- 기타 내용 -->
						<div class="col-md-12">
							<label for="etcCn--${pageName}${pageDataName1}" class="w-px-120 bg-lighter pe-2 col-form-label text-sm-end">기타 내용</label>
							<textarea type="text" class="form-control w-80" id="etcCn--${pageName}${pageDataName1}" name="etcCn" data-map="ETC_CN" rows="3" data-maxlengthb="1000" readonly>
							</textarea>
						</div>
						<!-- 등록 일시 -->
						<div class="col-md-6">
							<label for="regDt--${pageName}${pageDataName1}" class="w-px-120 bg-lighter pe-2 col-form-label text-sm-end">등록 일시</label>
							<input type="text" class="form-control w-45" id="regDt--${pageName}${pageDataName1}" name="regDt" data-map="REG_DT" readonly />
						</div>
						<!-- 등록자 -->
						<div class="col-md-6">
							<label for="rgtrNm--${pageName}${pageDataName1}" class="w-px-120 bg-lighter pe-2 col-form-label text-sm-end">등록자</label>
							<input type="text" class="form-control w-40" id="rgtrNm--${pageName}${pageDataName1}" name="rgtrNm" data-map="RGTR_NM" readonly />
						</div>
					</div> <!-- <div class="row g-1"> -->
				</form>
			</div> <!-- <div class="card"> -->
		</div> <!-- 감경 정보 <div class="col-xl-6 mx-1"> -->

		<!-- 부과제외 정보 -->
		<div class="col-xl-6 mx-1">
			<div class="card">
				<!-- 업무 버튼 -->
				<div class="container-page-btn">
					<label class="w-px-120 bg-label-danger pe-2 col-form-label text-sm-center">부과제외 정보</label>
					<!-- 버튼 우측 정렬 -->
					<span class="container-window-btn-right">
						<button type="button" class="btn btn-primary" id="btnCreate--${pageName}${pageDataName2}" title="부과제외 등록" onclick="fnCreate${pageName}${pageDataName2}();">
							부과제외 등록
						</button>
						<button type="button" class="btn btn-primary" id="btnUpdate--${pageName}${pageDataName2}" title="부과제외 수정" onclick="fnUpdate${pageName}${pageDataName2}();">
							부과제외 수정
						</button>
						<button type="button" class="btn btn-primary" id="btnRemove--${pageName}${pageDataName2}" title="부과제외 삭제" onclick="fnRemove${pageName}${pageDataName2}();">
							부과제외 삭제
						</button>
					</span>
				</div> <!-- <div class="container-page-btn"> -->

				<!-- 입력 영역 -->
				<form id="frmEdit--${pageName}${pageDataName2}" name="frmEdit${pageDataName2}">
					<!-- hidden -->
					<input type="hidden" id="levyExclId--${pageName}${pageDataName2}" name="levyExclId" data-map="LEVY_EXCL_ID" />

					<div class="row g-1">
						<!-- 부과제외 일자 -->
						<div class="col-md-6">
							<label for="levyExclYmd--${pageName}${pageDataName2}" class="w-px-120 bg-lighter pe-2 col-form-label text-sm-end">부과제외 일자</label>
							<input type="text" class="form-control w-30" id="levyExclYmd--${pageName}${pageDataName2}" name="levyExclYmd" data-map="LEVY_EXCL_YMD" readonly />
						</div>
						<!--  -->
						<div class="col-md-6">
						</div>
						<!-- 부과제외 구분 명 -->
						<div class="col-md-6">
							<label for="levyExclSeNm--${pageName}${pageDataName2}" class="w-px-120 bg-lighter pe-2 col-form-label text-sm-end">부과제외 구분</label>
							<input type="text" class="form-control w-30" id="levyExclSeNm--${pageName}${pageDataName2}" name="levyExclSeNm" data-map="LEVY_EXCL_SE_NM" readonly />
						</div>
						<!-- 부과제외 사유 명 -->
						<div class="col-md-6">
							<label for="levyExclRsnNm--${pageName}${pageDataName2}" class="w-px-120 bg-lighter pe-2 col-form-label text-sm-end">부과제외 사유</label>
							<input type="text" class="form-control w-60" id="levyExclRsnNm--${pageName}${pageDataName2}" name="levyExclRsnNm" data-map="LEVY_EXCL_RSN_NM" readonly />
						</div>
						<!-- 기타 내용 -->
						<div class="col-md-12">
							<label for="etcCn--${pageName}${pageDataName2}" class="w-px-120 bg-lighter pe-2 col-form-label text-sm-end">기타 내용</label>
							<textarea type="text" class="form-control w-80" id="etcCn--${pageName}${pageDataName2}" name="etcCn" data-map="ETC_CN" rows="3" data-maxlengthb="1000" readonly>
							</textarea>
						</div>
						<!-- 등록 일시 -->
						<div class="col-md-6">
							<label for="regDt--${pageName}${pageDataName2}" class="w-px-120 bg-lighter pe-2 col-form-label text-sm-end">등록 일시</label>
							<input type="text" class="form-control w-45" id="regDt--${pageName}${pageDataName2}" name="regDt" data-map="REG_DT" readonly />
						</div>
						<!-- 등록자 -->
						<div class="col-md-6">
							<label for="rgtrNm--${pageName}${pageDataName2}" class="w-px-120 bg-lighter pe-2 col-form-label text-sm-end">등록자</label>
							<input type="text" class="form-control w-40" id="rgtrNm--${pageName}${pageDataName2}" name="rgtrNm" data-map="RGTR_NM" readonly />
						</div>
					</div> <!-- <div class="row g-1"> -->
				</form>
			</div> <!-- <div class="card"> -->
		</div> <!-- 부과제외 정보 <div class="col-xl-6 mx-1"> -->
	</div> <!-- <div class="d-flex flex-row justify-content-evenly"> -->

	<p></p>

	<div class="d-flex flex-row justify-content-evenly">
		<!-- 처리 상태 이력 -->
		<div class="col-xl-6 mx-1">
			<div class="card">
				<!-- 업무 버튼 -->
				<div class="container-page-btn">
					<label class="w-px-120 bg-label-danger pe-2 col-form-label text-sm-center">처리 상태 이력</label>
				</div>
				<div class="row g-1">
					<!-- DataTables(그리드) -->
					<div class="card-datatable text-nowrap">
						<div id="DataTables_Table_0_wrapper--${pageName}${pageDataName3}" class="dataTables_wrapper dt-bootstrap5 no-footer">
							<div id="table-responsive--${pageName}${pageDataName3}" class="table-responsive" style="overflow-x:scroll; height:340px; overflow-y:scroll;" >
								<table class="dataTable datatables-ajax table table-bordered no-footer" id="DataTables_Table_0--${pageName}${pageDataName3}" aria-describedby="DataTables_Table_0_info">
									<thead>
										<tr id="theadTr--${pageName}${pageDataName3}">
											<th>등록일시</th>
											<th>등록사용자</th>
											<th>단속상태</th>
											<th>기타내용</th>
										</tr>
									</thead>
									<tbody id="tbody--${pageName}${pageDataName3}">
									</tbody>
									<template id="${infoPrefix}Row--${pageName}${pageDataName3}">
										<tr data-key="{STTS_HSTRY_ID}">
											<td class="text-center" onclick="{onclick}">{REG_DT}</td>
											<td class="text-center" onclick="{onclick}">{RGTR_NM}</td>
											<td class="text-center" onclick="{onclick}">{CRDN_STTS_NM}</td>
											<td class="text-center" onclick="{onclick}">{ETC_CN}</td>
										</tr>
									</template>
									<template id="${infoPrefix}NotFound--${pageName}${pageDataName3}">
										<tr class="odd">
											<td valign="top" colspan="6" class="dataTables_empty text-center">처리상태 이력 정보를 찾지 못했습니다.</td>
										</tr>
									</template>
								</table>
							</div>
						</div>
					</div> <!-- / DataTables(그리드) -->
				</div> <!-- <div class="row g-1"> -->
			</div> <!-- <div class="card"> -->
		</div> <!-- 처리 상태 이력 <div class="col-xl-6 mx-1"> -->

		<!-- 주소 변동 이력 -->
		<div class="col-xl-6 mx-1">
			<div class="card">
				<!-- 업무 버튼 -->
				<div class="container-page-btn">
					<label class="w-px-120 bg-label-danger pe-2 col-form-label text-sm-center">주소 변동 이력</label>
				</div>
				<div class="row g-1">
					<!-- DataTables(그리드) -->
					<div class="card-datatable text-nowrap">
						<div id="DataTables_Table_0_wrapper--${pageName}${pageDataName4}" class="dataTables_wrapper dt-bootstrap5 no-footer">
							<div id="table-responsive--${pageName}${pageDataName4}" class="table-responsive" style="overflow-x:scroll; height:340px; overflow-y:scroll;" >
								<table class="dataTable datatables-ajax table table-bordered no-footer" id="DataTables_Table_0--${pageName}${pageDataName4}" aria-describedby="DataTables_Table_0_info">
									<thead>
										<tr id="theadTr--${pageName}${pageDataName4}">
											<th>등록일시</th>
											<th>등록사용자</th>
											<th>납부자명</th>
											<th>우편번호</th>
											<th>전체주소</th>
										</tr>
									</thead>
									<tbody id="tbody--${pageName}${pageDataName4}">
									</tbody>
									<template id="${infoPrefix}Row--${pageName}${pageDataName4}">
										<tr data-key="{CHG_HSTRY_ID}">
											<td class="text-center" onclick="{onclick}">{REG_DT}</td>
											<td class="text-center" onclick="{onclick}">{RGTR_NM}</td>
											<td class="text-center" onclick="{onclick}">{RTPYR_NM}</td>
											<td class="text-center" onclick="{onclick}">{ZIP}</td>
											<td class="text-center" onclick="{onclick}">{WHOL_ADDR}</td>
										</tr>
									</template>
									<template id="${infoPrefix}NotFound--${pageName}${pageDataName4}">
										<tr class="odd">
											<td valign="top" colspan="5" class="dataTables_empty text-center">주소변동 이력 정보를 찾지 못했습니다.</td>
										</tr>
									</template>
								</table>
							</div>
						</div>
					</div> <!-- / DataTables(그리드) -->
				</div> <!-- <div class="row g-1"> -->
			</div> <!-- <div class="card"> -->
		</div> <!-- 주소 변동 이력 <div class="col-xl-6 mx-1"> -->
	</div> <!-- <div class="d-flex flex-row justify-content-evenly"> -->
</div>

<script>
	/**************************************************************************
	 * Global Variable
	 **************************************************************************/
	// URL
	var ${pageName}PrefixUrl = "/sprt/sprt02";
	var ${pageName}${pageDataName1}PrefixUrl = "/levy/levy02";
	var ${pageName}${pageDataName2}PrefixUrl = "/excl/excl01";

	// FormFields
 	var ${pageName}${pageDataName1}Fields = new FormFields("#frmEdit--${pageName}${pageDataName1}");
 	var ${pageName}${pageDataName2}Fields = new FormFields("#frmEdit--${pageName}${pageDataName2}");

	/**************************************************************************
	 * DatasetControl
	 **************************************************************************/
	// 감경 Dataset
	var ${pageName}${pageDataName1}Control = new DatasetControl({
		  prefix : "rduct"
		, prefixName : "감경"
		, keymapper : info => info ? info.RDUCT_ID : ""
		, formats : {
			  RDUCT_YMD : dateFormat
			, RDUCT_AMT : numberFormat
			, REG_DT : datetimeFormat
		}
	});

	// 부과제외 Dataset
	var ${pageName}${pageDataName2}Control = new DatasetControl({
		  prefix : "levyExcl"
		, prefixName : "부과제외"
		, keymapper : info => info ? info.LEVY_EXCL_ID : ""
		, formats : {
			  LEVY_EXCL_YMD : dateFormat
			, REG_DT : datetimeFormat
		}
	});

	// 단속상태이력 Dataset
	var ${pageName}${pageDataName3}Dataset = new Dataset({
		  prefix : "crdnSttsHstry"
		, prefixName : "단속상태이력"
		, keymapper : info => info ? info.STTS_HSTRY_ID : ""
		, dataGetter : obj => obj.crdnSttsHstryList
		, appendData : true
		, formats : {
			REG_DT : datetimeFormat
		}
		, onDatasetChange : obj => {
			renderList${pageName}${pageDataName3}();
		}
 		, onCurrentChange : item => {
 			if (!item) return;

 			let key = item.data.STTS_HSTRY_ID;

 			$("#tbody--${pageName}${pageDataName3}").setCurrentRow(key);
 		}
	});

	// 단속납부자이력 Dataset
	var ${pageName}${pageDataName4}Dataset = new Dataset({
		  prefix : "crdnPayerHstry"
		, prefixName : "단속납부자이력"
		, keymapper : info => info ? info.CHG_HSTRY_ID : ""
		, dataGetter : obj => obj.crdnPayerHstryList
		, appendData : true
		, formats : {
			REG_DT : datetimeFormat
		}
		, onDatasetChange : obj => {
			renderList${pageName}${pageDataName4}();
		}
		, onCurrentChange : item => {
			if (!item) return;

			let key = item.data.CHG_HSTRY_ID;

			$("#tbody--${pageName}${pageDataName4}").setCurrentRow(key);
		}
	});

	/**************************************************************************
	 * DatasetControl 이벤트
	 **************************************************************************/
	// 감경 선택 자료 변경 이벤트
	${pageName}${pageDataName1}Control.onCurrentChange = item => {
		${pageName}${pageDataName1}Fields.set(item);
	}

	// 감경 dialog
	${pageName}${pageDataName1}Control.getInfo = (params) => {
		let dialogTitle = "";

		if (params.callPurpose == "create") {
			dialogTitle = ${pageName}${pageDataName1}Control.prefixName + " 등록";
		} else if (params.callPurpose == "update") {
			dialogTitle = ${pageName}${pageDataName1}Control.prefixName + " 수정";
		} else {
			return;
		}

		ajax.get({
			  url : wctx.url("/" + params.taskSeCd + ${pageName}${pageDataName1}PrefixUrl + "/020/info.do")
			, data : params || {}
			, success : resp => {
				if ((typeof resp) != "string") {
					if (resp.retMessage != "") {
						dialog.alert(resp.retMessage);
						return;
					}
				}

				dialog.open({
					  id : ${pageName}${pageDataName1}Control.prefixed("Dialog")
					, title : dialogTitle
					, content : resp
					, size : "lg"
					, init : () => { }
					, onClose : () => { refreshDataInfo${pageName}(); }			// callback 자료 재조회
				});
			}
		});
	}

	// 삭제 callback
	${pageName}${pageDataName1}Control.onRemove = (resp) => {
 		let btnTitle = $("#btnRemove--${pageName}${pageDataName1}").attr("title");
  		let showMessage = resp.retMessage.replace(/[S]|[F]/g, btnTitle);

		dialog.alert(showMessage);

		if (resp.saved) {
			refreshDataInfo${pageName}();										// 자료 재조회
		}
	}

	// 삭제
	${pageName}${pageDataName1}Control.remove = (params) => {
		ajax.post({
			  url : wctx.url("/" + params.taskSeCd + ${pageName}${pageDataName1}PrefixUrl + "/010/remove.do")
			, data : params || {}
			, success : resp => ${pageName}${pageDataName1}Control.onRemove(resp)		// 삭제 callback
		});
	}

	// 부과제외 선택 자료 변경 이벤트
	${pageName}${pageDataName2}Control.onCurrentChange = item => {
		${pageName}${pageDataName2}Fields.set(item);

		// 계고는 수정하지 않는다..
		let levyExclSeCd = item.data.LEVY_EXCL_SE_CD;

		if (levyExclSeCd == "2") {
			$("#btnUpdateLevyExcl--${pageName}").prop("disabled", true);
		} else {
			$("#btnUpdateLevyExcl--${pageName}").prop("disabled", false);
		}
	}

	// 부과제외 dialog
	${pageName}${pageDataName2}Control.getInfo = (params) => {
		let dialogTitle = "";

		if (params.callPurpose == "create") {
			dialogTitle = ${pageName}${pageDataName2}Control.prefixName + " 등록";
		} else if (params.callPurpose == "update") {
			dialogTitle = ${pageName}${pageDataName2}Control.prefixName + " 수정";
		} else {
			return;
		}

		ajax.get({
			  url : wctx.url("/" + params.taskSeCd + ${pageName}${pageDataName2}PrefixUrl + "/020/info.do")
			, data : params || {}
			, success : resp => {
				if ((typeof resp) != "string") {
					if (resp.retMessage != "") {
						dialog.alert(resp.retMessage);

						return;
					}
				}

				dialog.open({
					  id : ${pageName}${pageDataName2}Control.prefixed("Dialog")
					, title : dialogTitle
					, content : resp
					, size : "lg"
					, init : () => { }
					, onClose : () => { refreshDataInfo${pageName}(); }			// callback 자료 재조회
				});
			}
		});
	}

	// 삭제 callback
	${pageName}${pageDataName2}Control.onRemove = (resp) => {
  		let btnTitle = $("#btnRemove--${pageName}${pageDataName2}").attr("title");
  		let showMessage = resp.retMessage.replace(/[S]|[F]/g, btnTitle);

		dialog.alert(showMessage);

		if (resp.saved) {
			refreshDataInfo${pageName}();										// 자료 재조회
		}
	}

	// 삭제
	${pageName}${pageDataName2}Control.remove = (params) => {
		ajax.post({
			  url : wctx.url("/" + params.taskSeCd + ${pageName}${pageDataName2}PrefixUrl + "/010/remove.do")
			, data : params || {}
			, success : resp => ${pageName}${pageDataName2}Control.onRemove(resp)		// 삭제 callback
		});
	}

	/**************************************************************************
	 * function
	 **************************************************************************/
	// 단속 상태 이력 DataTables에 click 이벤트
	renderList${pageName}${pageDataName3} = () => {
		let ${infoPrefix}List = ${pageName}${pageDataName3}Dataset;
		let empty = ${infoPrefix}List.empty;

		let trs = empty ?
			[document.getElementById("${infoPrefix}NotFound--${pageName}${pageDataName3}").innerHTML] : <%-- from template#${infoPrefix}NotFound --%>
			${infoPrefix}List.inStrings(
				document.getElementById("${infoPrefix}Row--${pageName}${pageDataName3}").innerHTML, <%-- from template#${infoPrefix}Row --%>
				(str, dataItem) => str
					.replace(/{onclick}/gi, "${pageName}${pageDataName3}Dataset.setCurrent('" + dataItem.getValue("STTS_HSTRY_ID") + "');")
			);

		$("#tbody--${pageName}${pageDataName3}").html(trs.join());
	}

	// 단속 납부자 이력 DataTables에 click 이벤트
	renderList${pageName}${pageDataName4} = () => {
		let ${infoPrefix}List = ${pageName}${pageDataName4}Dataset;
		let empty = ${infoPrefix}List.empty;

		let trs = empty ?
			[document.getElementById("${infoPrefix}NotFound--${pageName}${pageDataName4}").innerHTML] : <%-- from template#${infoPrefix}NotFound --%>
			${infoPrefix}List.inStrings(
				document.getElementById("${infoPrefix}Row--${pageName}${pageDataName4}").innerHTML, <%-- from template#${infoPrefix}Row --%>
				(str, dataItem) => str
					.replace(/{onclick}/gi, "${pageName}${pageDataName4}Dataset.setCurrent('" + dataItem.getValue("CHG_HSTRY_ID") + "');")
			);

		$("#tbody--${pageName}${pageDataName4}").html(trs.join());
	}

	// 자료 재조회
	refreshDataInfo${pageName} = () => {
		let crdnId = $("#crdnId--${pageNameMain}").val();

		// 단속 ID 가 없다면.. return
		if (crdnId == null || crdnId == "") {
			return;
		}

		let params = {
			  callPurpose : "view"
			, crdnId : crdnId
			, delYn : "N"
		};

		ajax.get({
			  url : wctx.url("/sprt/sprt02/050/info.do")
			, headers: { Accept: "application/json; charset=utf-8" }			// json
			, data : params || {}
			, success : resp => {
				${pageName}${pageDataName3}Dataset.clear();
				${pageName}${pageDataName4}Dataset.clear();

				// 감경 정보 Data 셋팅
				if (resp.rduct) {
					${pageName}${pageDataName1}Control.setData([resp.rduct]);
				} else {
					$("#frmEdit--${pageName}${pageDataName1}")[0].reset();
				}

				// 부과제외 정보 Data 셋팅
				if (resp.levyExcl) {
					${pageName}${pageDataName2}Control.setData([resp.levyExcl]);
				} else {
					$("#frmEdit--${pageName}${pageDataName2}")[0].reset();
				}

				// 처리 상태 이력 Data 셋팅
				${pageName}${pageDataName3}Dataset.setData(resp.crdnSttsHstryList);

				// 주소 변동 이력 Data 셋팅
				${pageName}${pageDataName4}Dataset.setData(resp.crdnPayerHstryList);

				// 최상단 단속 Data 셋팅
				if (resp.totalInfo) {
					${pageNameMain}Control.setData([resp.totalInfo]);
				}
			}
		});
	}

	/**************************************************************************
	 * 초기 셋팅
	 **************************************************************************/
	// 검색조건 초기값 셋팅
	initForm${pageName} = () => {

	}

	// 이벤트 설정
	setEvent${pageName} = () => {

	}

	/**************************************************************************
	 * 버튼 clickEvent
	 **************************************************************************/
	// 감경 등록
	fnCreate${pageName}${pageDataName1} = () => {
		let crdnId = $("#crdnId--${pageNameMain}").val();
		let sggCd = $("#sggCd--${pageNameMain}").val();
		let taskSeCd = $("#taskSeCd--${pageNameMain}").val();

		// 단속 ID 가 없다면.. return
		if (crdnId == undefined || crdnId == "") {
			return;
		}

		let params = {
			  callPurpose : "create"
			, crdnId : crdnId
			, sggCd : sggCd
			, taskSeCd : taskSeCd
			, levyExclSeCd : "1"
		};

		${pageName}${pageDataName1}Control.getInfo(params);
	}

	// 감경 수정
	fnUpdate${pageName}${pageDataName1} = () => {
		let crdnId = $("#crdnId--${pageNameMain}").val();
		let sggCd = $("#sggCd--${pageNameMain}").val();
		let taskSeCd = $("#taskSeCd--${pageNameMain}").val();
		let rductId = ${pageName}${pageDataName1}Control.dataset.getValue("RDUCT_ID");

		// 감경 ID 가 없다면.. return
		if (rductId == undefined || rductId == "") {
			return;
		}

		let params = {
			  callPurpose : "update"
			, crdnId : crdnId
			, sggCd : sggCd
			, taskSeCd : taskSeCd
			, rductId : rductId
		};

		${pageName}${pageDataName1}Control.getInfo(params);
	}

	// 감경 삭제
	fnRemove${pageName}${pageDataName1} = () => {
		let crdnId = $("#crdnId--${pageNameMain}").val();
		let sggCd = $("#sggCd--${pageNameMain}").val();
		let taskSeCd = $("#taskSeCd--${pageNameMain}").val();
		let rductId = ${pageName}${pageDataName1}Control.dataset.getValue("RDUCT_ID");

		// 감경 ID 가 없다면.. return
		if (rductId == undefined || rductId == "") {
			return;
		}

		let params = {
			  callPurpose : "remove"
			, crdnId : crdnId
			, sggCd : sggCd
			, taskSeCd : taskSeCd
			, rductId : rductId
		};

		dialog.alert({
			  content : "선택한 " + ${pageName}${pageDataName1}Control.prefixName + " 내용을 삭제하시겠습니까?"
			, onOK : () => {
				${pageName}${pageDataName1}Control.remove(params);
			}
		});
	}

	// 부과제외 등록
	fnCreate${pageName}${pageDataName2} = () => {
		let crdnId = $("#crdnId--${pageNameMain}").val();
		let sggCd = $("#sggCd--${pageNameMain}").val();
		let taskSeCd = $("#taskSeCd--${pageNameMain}").val();

		// 단속 ID 가 없다면.. return
		if (crdnId == undefined || crdnId == "") {
			return;
		}

		let params = {
			  callPurpose : "create"
			, crdnId : crdnId
			, sggCd : sggCd
			, taskSeCd : taskSeCd
			, levyExclSeCd : "1"
		};

		${pageName}${pageDataName2}Control.getInfo(params);
	}

	// 부과제외 수정
	fnUpdate${pageName}${pageDataName2} = () => {
		let crdnId = $("#crdnId--${pageNameMain}").val();
		let sggCd = $("#sggCd--${pageNameMain}").val();
		let taskSeCd = $("#taskSeCd--${pageNameMain}").val();
		let levyExclId = ${pageName}${pageDataName2}Control.dataset.getValue("LEVY_EXCL_ID");

		// 부과 제외 ID 가 없다면.. return
		if (levyExclId == undefined || levyExclId == "") {
			return;
		}

		let params = {
			  callPurpose : "update"
			, crdnId : crdnId
			, sggCd : sggCd
			, taskSeCd : taskSeCd
			, levyExclId : levyExclId
		};

		${pageName}${pageDataName2}Control.getInfo(params);
	}

	// 부과제외 삭제
	fnRemove${pageName}${pageDataName2} = () => {
		let crdnId = $("#crdnId--${pageNameMain}").val();
		let sggCd = $("#sggCd--${pageNameMain}").val();
		let taskSeCd = $("#taskSeCd--${pageNameMain}").val();
		let levyExclId = ${pageName}${pageDataName2}Control.dataset.getValue("LEVY_EXCL_ID");

		// 부과제외 ID 가 없다면.. return
		if (levyExclId == undefined || levyExclId == "") {
			return;
		}

		let params = {
			  callPurpose : "remove"
			, crdnId : crdnId
			, sggCd : sggCd
			, taskSeCd : taskSeCd
			, levyExclId : levyExclId
		};

		dialog.alert({
			  content : "선택한 " + ${pageName}${pageDataName2}Control.prefixName + " 내용을 삭제하시겠습니까?"
			, onOK : () => {
				${pageName}${pageDataName2}Control.remove(params);
			}
		});
	}

	/**************************************************************************
	 * script 진입
	 **************************************************************************/
	$(document).ready(function() {
		// 이벤트 설정
		setEvent${pageName}();

		// 화면 초기 설정
		initForm${pageName}();

		// 감경 정보 Data 셋팅
		let rduct = ${rduct};
		if (rduct) {
			${pageName}${pageDataName1}Control.setData([rduct]);
		}

		// 부과제외 정보 Data 셋팅
		let levyExcl = ${levyExcl};
		if (levyExcl) {
			${pageName}${pageDataName2}Control.setData([levyExcl]);
		}

		// 처리 상태 이력 Data 셋팅
		${pageName}${pageDataName3}Dataset.setData(${crdnSttsHstryList});

		// 주소 변동 이력 Data 셋팅
		${pageName}${pageDataName4}Dataset.setData(${crdnPayerHstryList});
	});

// #sourceURL=sprt02050-info.jsp
</script>
