928 lines
31 KiB
PHP
928 lines
31 KiB
PHP
<?= $this->extend('layouts/main') ?>
|
|
|
|
<?= $this->section('content') ?>
|
|
|
|
<div class="col-md-12 col-xl-12">
|
|
<div class="main-card mb-3 card">
|
|
<div class="card-header bg-white border-bottom shadow-sm">
|
|
<div class="d-flex flex-wrap align-items-center gap-3 card-header-tab">
|
|
<div>
|
|
<h4 class="mb-0 fw-bold text-dark">배정매물 현황</h4>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="card-body">
|
|
<form id="frm_srch_info" method="get" onsubmit="return false;">
|
|
<input type="hidden" name="m" id="m" value="M801" />
|
|
<input type="hidden" name="todo" id="todo" value="inq" />
|
|
<input type="hidden" name="usr_id" value="" />
|
|
<!-- 검색 폼 -->
|
|
<div class="row g-3">
|
|
|
|
<!-- 매물번호 -->
|
|
<div class="col-md-1">
|
|
<label class="form-label mb-1">
|
|
매물번호
|
|
<i class="pe-7s-info info-tooltip" data-bs-toggle="tooltip" data-bs-placement="top"
|
|
title="매물번호를 입력하면 다른 조건은 무시됩니다"></i>
|
|
</label>
|
|
<input type="text" name="atcl_no" class="form-control form-control-sm" placeholder="매물번호" maxlength="10"
|
|
data-bs-toggle="tooltip" data-bs-placement="top" title="매물번호를 입력하면 다른 조건은 무시됩니다"
|
|
onkeypress="atcl_no_enter(event)">
|
|
</div>
|
|
|
|
<!-- 현재상태 -->
|
|
<div class="col-md-2">
|
|
<label class="form-label mb-1">현재상태</label>
|
|
<select name="stat_cd" class="form-select form-select-sm">
|
|
<option value="">-선택-</option>
|
|
<?php foreach ($codes as $c): ?>
|
|
<?php if ($c['category'] === "STEP_VERIFICATION"): ?>
|
|
<option value="<?= $c['cd'] ?>"><?= $c['cd_nm'] ?></option>
|
|
<?php endif; ?>
|
|
<?php endforeach; ?>
|
|
</select>
|
|
</div>
|
|
|
|
<!-- 중개소 -->
|
|
<div class="col-md-1">
|
|
<label class="form-label mb-1">중개소</label>
|
|
<input type="text" name="realtor_nm" class="form-control form-control-sm" placeholder="중개소">
|
|
</div>
|
|
|
|
<!-- 배정여부 (2개 셀렉트) -->
|
|
<div class="col-md-3">
|
|
<label class="form-label mb-1">배정여부</label>
|
|
<div class="d-flex gap-2">
|
|
<select name="charger_gbn" id="code_charger_gbn" class="form-select form-select-sm">
|
|
<option value="1">전화/서류담당자</option>
|
|
<option value="2">등기부등본담당자</option>
|
|
</select>
|
|
<select name="assign_yn" id="assign_yn" class="form-select form-select-sm">
|
|
<option value="A">-전체-</option>
|
|
<option value="Y">배정</option>
|
|
<option value="N">미배정</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="row g-3">
|
|
<!-- 접수기간 -->
|
|
<div class="col-md-3">
|
|
<label class="form-label mb-1">접수기간</label>
|
|
<div class="input-group input-group-sm">
|
|
<input type="date" class="form-control" name="receipt_sdate" id="receipt_sdate" placeholder="시작일">
|
|
<span class="input-group-text">~</span>
|
|
<input type="date" class="form-control" name="receipt_edate" id="receipt_edate" placeholder="종료일">
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 완료기간 -->
|
|
<div class="col-md-3">
|
|
<label class="form-label mb-1">완료기간</label>
|
|
<div class="input-group input-group-sm">
|
|
<input type="text" class="form-control" name="complete_sdate" id="complete_sdate" placeholder="시작일">
|
|
<span class="input-group-text">~</span>
|
|
<input type="text" class="form-control" name="complete_edate" id="complete_edate" placeholder="종료일">
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 지역구분 -->
|
|
<div class="col-md-4">
|
|
<label class="form-label mb-1">지역구분</label>
|
|
<div class="d-flex gap-2">
|
|
<select name="srcSido" id="srcSido" class="form-select form-select-sm">
|
|
<option value="">-시/도-</option>
|
|
<?php foreach ($sido as $s): ?>
|
|
<option value="<?= $s['region_cd'] ?>"><?= $s['region_nm'] ?></option>
|
|
<?php endforeach; ?>
|
|
</select>
|
|
<select name="srcGugun" id="srcGugun" class="form-select form-select-sm">
|
|
<option value="">-시/군/구-</option>
|
|
</select>
|
|
<select name="srcDong" id="srcDong" class="form-select form-select-sm">
|
|
<option value="">-읍/면/동-</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="row g-3">
|
|
<!-- 담당자 (본부/팀/담당 3셀렉트) -->
|
|
<div class="col-md-3">
|
|
<label class="form-label mb-1">담당자</label>
|
|
<div class="d-flex gap-2">
|
|
<select name="bonbu" id="bonbu" class="form-select form-select-sm">
|
|
<option value="">-본부-</option>
|
|
<?php foreach ($bonbu as $d): ?>
|
|
<option value="<?= $d['dept_sq'] ?>"><?= $d['dept_nm'] ?></option>
|
|
<?php endforeach; ?>
|
|
</select>
|
|
<select name="team" id="team" class="form-select form-select-sm">
|
|
<option value="">-팀-</option>
|
|
</select>
|
|
<select name="damdang" id="damdang" class="form-select form-select-sm">
|
|
<option value="">-담당자-</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 검증방식 -->
|
|
<div class="col-md-2">
|
|
<label class="form-label mb-1">검증방식</label>
|
|
<div class="d-flex gap-2">
|
|
<select name="vrfcreq_way" id="vrfcreq_way" class="form-select form-select-sm">
|
|
<option value="">-검증방식-</option>
|
|
<?php foreach ($codes as $c): ?>
|
|
<?php if ($c['category'] === "VRFCREQ_WAY"): ?>
|
|
<option value="<?= $c['cd'] ?>"><?= $c['cd_nm'] ?></option>
|
|
<?php endif; ?>
|
|
<?php endforeach; ?>
|
|
</select>
|
|
<select name="vrfc_type_sub" id="vrfc_type_sub" class="form-select form-select-sm">
|
|
<option value="">-선택-</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 매체사 -->
|
|
<div class="col-md-1">
|
|
<label class="form-label mb-1">매체사</label>
|
|
<select name="rcpt_cpid" class="form-select form-select-sm">
|
|
<option value="">-전체-</option>
|
|
<?php foreach ($codes as $c): ?>
|
|
<?php if ($c['category'] === "CP_ID"): ?>
|
|
<option value="<?= $c['cd'] ?>"><?= $c['cd_nm'] ?></option>
|
|
<?php endif; ?>
|
|
<?php endforeach; ?>
|
|
</select>
|
|
</div>
|
|
|
|
<!-- 매물종류 -->
|
|
<div class="col-md-1">
|
|
<label class="form-label mb-1">매물종류</label>
|
|
<select name="rlet_type_cd" class="form-select form-select-sm">
|
|
<option value="">-매물종류-</option>
|
|
<?php foreach ($codes as $c): ?>
|
|
<?php if ($c['category'] === "ARTICLE_TYPE"): ?>
|
|
<option value="<?= $c['cd'] ?>"><?= $c['cd_nm'] ?></option>
|
|
<?php endif; ?>
|
|
<?php endforeach; ?>
|
|
</select>
|
|
</div>
|
|
|
|
<!-- 법인소유 -->
|
|
<div class="col-md-1">
|
|
<label class="form-label mb-1">법인소유</label>
|
|
<select name="corp_own" class="form-select form-select-sm">
|
|
<option value="">-전체-</option>
|
|
<option value="Y">Y</option>
|
|
<option value="N">N</option>
|
|
</select>
|
|
</div>
|
|
|
|
|
|
<div class="col-md-1 d-grid">
|
|
<label class="form-label mb-1 invisible">검색</label>
|
|
<button type="button" class="btn btn-primary" id="btnSearch">
|
|
<i class="pe-7s-search me-1"></i>검색
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-md-12 col-xl-12">
|
|
<div class="main-card mb-3 card">
|
|
<div class="card-body">
|
|
<table id="resultList" class="table table-hover table-striped table-bordered">
|
|
<thead>
|
|
<tr>
|
|
<th class="text-center">
|
|
<input type="checkbox" class="form-check-input" name="chkAll" id="chkAll" />
|
|
</th>
|
|
<th>매물번호</th>
|
|
<th>진행상태</th>
|
|
<th>접수시간</th>
|
|
<th>검증방식</th>
|
|
<th>주소</th>
|
|
<th>상세주소</th>
|
|
<th>매체사</th>
|
|
<th>중개소</th>
|
|
<th>서류/전화<br />담당자</th>
|
|
<th>서류/전화<br />확인완료시간</th>
|
|
<th>등기부등본<br />담당자</th>
|
|
<th>검증완료<br />일시</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<!-- 여기는 비워둠: AJAX로 채움 -->
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<?= $this->endSection() ?>
|
|
|
|
<?= $this->section('page_styles') ?>
|
|
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/2.0.7/css/dataTables.dataTables.min.css" />
|
|
<link href="https://unpkg.com/dropzone@6.0.0-beta.1/dist/dropzone.css" rel="stylesheet" type="text/css" />
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
|
|
<?= $this->endSection() ?>
|
|
|
|
<?= $this->section('page_scripts') ?>
|
|
<script src="https://cdn.datatables.net/2.0.7/js/dataTables.min.js"></script>
|
|
<script defer src="/architectui/assets/js/datatable.kor.js"></script>
|
|
<script type="text/javascript" src="https://oapi.map.naver.com/openapi/v3/maps.js?ncpKeyId=dtounkwjc5"></script>
|
|
<script type="text/javascript">
|
|
|
|
const date = new Date();
|
|
const bonbuArr = <?= json_encode($bonbu, JSON_UNESCAPED_UNICODE); ?>;
|
|
const teamArr = <?= json_encode($team, JSON_UNESCAPED_UNICODE); ?>;
|
|
const userArr = <?= json_encode($user, JSON_UNESCAPED_UNICODE); ?>;
|
|
|
|
var table;
|
|
|
|
// 검색 조건 저장
|
|
function saveSearchForm() {
|
|
const data = $("#frm_srch_info").serializeArray();
|
|
localStorage.setItem("m702_search", JSON.stringify(data));
|
|
}
|
|
|
|
// 검색 조건 복원
|
|
function restoreSearchForm() {
|
|
const saved = localStorage.getItem("m702_search");
|
|
if (!saved) return;
|
|
const data = JSON.parse(saved);
|
|
data.forEach(function(item) {
|
|
$("[name='" + item.name + "']").val(item.value);
|
|
});
|
|
// 주요 select에 대해 change 이벤트 트리거
|
|
$("#srcSido, #srcGugun, #bonbu, #team, #vrfcreq_way").trigger("change");
|
|
}
|
|
|
|
$(function () {
|
|
// referrer에 '/m702'가 없으면 검색 조건 초기화
|
|
if (!document.referrer.includes('/m702')) {
|
|
localStorage.removeItem("m702_search");
|
|
}
|
|
restoreSearchForm();
|
|
|
|
$("#bonbu").on("change", function (e) {
|
|
|
|
const value = e.target.value
|
|
|
|
$("#dept_sq").empty()
|
|
|
|
var str = "<option value=''>선택</option>"
|
|
if (teamArr != null) {
|
|
|
|
for (var i = 0; i < teamArr.length; i++) {
|
|
if (value === teamArr[i].pdept_sq) {
|
|
str += "<option value='" + teamArr[i].dept_sq + "'>" + teamArr[i].dept_nm + "</option>"
|
|
}
|
|
}
|
|
}
|
|
|
|
$("#dept_sq").append(str)
|
|
|
|
});
|
|
|
|
$("#srcSido, #srcGugun, #srcSido2, #srcGugun2").on("change", function (e) {
|
|
|
|
const targetId = this.id;
|
|
|
|
const isSecond = this.id.endsWith("2");
|
|
|
|
const params = {
|
|
srcSido: isSecond
|
|
? $("#srcSido2").val()
|
|
: $("#frm_srch_info [name=srcSido]").val(),
|
|
|
|
srcGugun: isSecond
|
|
? $("#srcGugun2").val()
|
|
: $("#frm_srch_info [name=srcGugun]").val(),
|
|
};
|
|
|
|
|
|
$.ajax({
|
|
url: "/manage/areas/getAreaList",
|
|
method: "POST",
|
|
dataType: "json",
|
|
data: params,
|
|
beforeSend: function () {
|
|
blockUI.blockPage({
|
|
message: tpl
|
|
})
|
|
},
|
|
complete: function () {
|
|
blockUI.unblockPage()
|
|
},
|
|
success: function (result) {
|
|
|
|
switch (targetId) {
|
|
case "srcSido":
|
|
$("#srcGugun").empty()
|
|
var str = "";
|
|
str += "<option value=''>시/군/구</option>";
|
|
|
|
if ($("#srcSido").val() !== "") {
|
|
if (result.length > 0) {
|
|
for (var i = 0; i < result.length; i++) {
|
|
str += "<option value='" + result[i]['region_cd'] + "'>" + result[i].region_nm + "</option>";
|
|
}
|
|
}
|
|
}
|
|
|
|
$("#srcGugun").append(str);
|
|
|
|
break;
|
|
|
|
case "srcGugun":
|
|
$("#srcDong").empty()
|
|
var str = "";
|
|
str += "<option value=''>읍/면/동</option>";
|
|
|
|
if (result.length > 0) {
|
|
for (var i = 0; i < result.length; i++) {
|
|
str += "<option value='" + result[i]['region_cd'] + "'>" + result[i].region_nm + "</option>";
|
|
}
|
|
}
|
|
|
|
$("#srcDong").append(str);
|
|
break;
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
$(document).on("change", "#bonbu, #team, #bonbu2, #team2", function (e) {
|
|
const targetId = this.id;
|
|
|
|
|
|
var str = "";
|
|
var str2 = `<option value="">-담당자-</option>`;
|
|
if (targetId === "bonbu" || targetId === "bonbu2") {
|
|
const dept_sq = $("#" + targetId).val();
|
|
|
|
str += `<option value="">-팀-</option>`;
|
|
if (teamArr.length > 0) {
|
|
for (var i = 0; i < teamArr.length; i++) {
|
|
|
|
// 이 팀이 현재 본부에 속한 팀인지 체크
|
|
if (String(teamArr[i].pdept_sq) === String(dept_sq)) {
|
|
str += `
|
|
<option value="${teamArr[i].dept_sq}">${teamArr[i].dept_nm}</option>
|
|
`;
|
|
}
|
|
}
|
|
}
|
|
|
|
if (targetId === "bonbu") {
|
|
$("#team").html(str);
|
|
$("#damdang").html(str2);
|
|
} else if (targetId === "bonbu2") {
|
|
$("#team2").html(str);
|
|
$("#damdang2").html(str2);
|
|
}
|
|
|
|
} else if (targetId === "team" || targetId === "team2") {
|
|
const dept_sq = $("#" + targetId).val();
|
|
|
|
str += `<option value="">-담당자-</option>`;
|
|
if (userArr.length > 0) {
|
|
for (var i = 0; i < userArr.length; i++) {
|
|
|
|
// 이 팀이 현재 본부에 속한 팀인지 체크
|
|
if (String(userArr[i].dept_sq) === String(dept_sq)) {
|
|
str += `
|
|
<option value="${userArr[i].usr_id}">${userArr[i].usr_nm}</option>
|
|
`;
|
|
}
|
|
}
|
|
}
|
|
|
|
if (targetId === "team") {
|
|
$("#damdang").html(str);
|
|
} else if (targetId === "team2") {
|
|
$("#damdang2").html(str);
|
|
}
|
|
}
|
|
|
|
});
|
|
|
|
|
|
// 검증방식 onchange
|
|
$("#vrfcreq_way").on("change", function (e) {
|
|
const val = e.target.value;
|
|
|
|
var str = "";
|
|
str += `<option value="">-선택-</option>`;
|
|
if (e.val !== "") {
|
|
$.getJSON("/common/common/getVrfcCode?type=" + val, function (result) {
|
|
var total = result.length;
|
|
for (var i = 0; i < total; i++) {
|
|
var cateNm = result[i].cd_nm;
|
|
|
|
if (total == 1) {
|
|
str += "<option value=\"" + result[i].cd + "\" selected>" + cateNm + "</option>";
|
|
} else {
|
|
str += "<option value=\"" + result[i].cd + "\">" + cateNm + "</option>";
|
|
}
|
|
}
|
|
|
|
$("#vrfc_type_sub").html(str);
|
|
});
|
|
} else {
|
|
$("#vrfc_type_sub").html(str);
|
|
}
|
|
|
|
|
|
});
|
|
|
|
initReceiptDate();
|
|
table = $('#resultList').DataTable({
|
|
layout: {
|
|
topStart: function() {
|
|
const container = document.createElement('div');
|
|
container.className = 'd-flex align-items-center flex-wrap';
|
|
container.style.cssText = 'gap:8px; flex:1;';
|
|
|
|
// 담당자 유형
|
|
const damdangT = document.createElement('select');
|
|
damdangT.id = 'damdangT';
|
|
damdangT.className = 'form-control form-control-sm';
|
|
damdangT.style.width = '150px';
|
|
damdangT.innerHTML = `
|
|
<option value="1">전화/서류 담당자</option>
|
|
<option value="2">등기부등본 담당자</option>
|
|
`;
|
|
|
|
// 본부
|
|
const bonbu2 = document.createElement('select');
|
|
bonbu2.id = 'bonbu2';
|
|
bonbu2.className = 'form-control form-control-sm';
|
|
bonbu2.style.width = '140px';
|
|
bonbu2.innerHTML = '<option value="">-본부-</option>';
|
|
// bonbuArr 배열을 사용하여 옵션 추가
|
|
bonbuArr.forEach(function(d) {
|
|
const opt = document.createElement('option');
|
|
opt.value = d.dept_sq;
|
|
opt.textContent = d.dept_nm;
|
|
bonbu2.appendChild(opt);
|
|
});
|
|
|
|
// 팀
|
|
const team2 = document.createElement('select');
|
|
team2.id = 'team2';
|
|
team2.className = 'form-control form-control-sm';
|
|
team2.style.width = '160px';
|
|
team2.innerHTML = '<option value="">-팀-</option>';
|
|
|
|
// 담당자
|
|
const damdang2 = document.createElement('select');
|
|
damdang2.id = 'damdang2';
|
|
damdang2.className = 'form-control form-control-sm';
|
|
damdang2.style.width = '160px';
|
|
damdang2.innerHTML = '<option value="">-담당자-</option>';
|
|
|
|
// 배정변경 버튼
|
|
const btnChange = document.createElement('button');
|
|
btnChange.type = 'button';
|
|
btnChange.id = 'btn_part_change';
|
|
btnChange.className = 'btn btn-sm btn-outline-light';
|
|
btnChange.textContent = '배정변경';
|
|
|
|
// 서류누락 버튼
|
|
const btnOmit = document.createElement('button');
|
|
btnOmit.type = 'button';
|
|
btnOmit.id = 'btn_part_omit';
|
|
btnOmit.className = 'btn btn-sm btn-outline-light';
|
|
btnOmit.textContent = '서류누락';
|
|
|
|
container.append(damdangT, bonbu2, team2, damdang2, btnChange, btnOmit);
|
|
return container;
|
|
},
|
|
topEnd: function () {
|
|
const container = document.createElement('div');
|
|
container.className = 'd-flex';
|
|
container.style.gap = '8px';
|
|
container.style.justifyContent = 'flex-end';
|
|
|
|
// 등기부등본 전송 버튼
|
|
const btnSend = document.createElement('button');
|
|
btnSend.className = 'btn btn-sm btn-outline-light';
|
|
btnSend.textContent = '등기부등본 전송';
|
|
|
|
// 엑셀 다운로드 버튼
|
|
const btnExcel = document.createElement('button');
|
|
btnExcel.id = 'excel-download';
|
|
btnExcel.className = 'btn btn-sm btn-outline-success';
|
|
btnExcel.innerHTML = '<i class="fa fa-fw fa-file-excel-o" aria-hidden="true"></i> 엑셀다운로드';
|
|
|
|
container.append(btnSend, btnExcel);
|
|
return container;
|
|
}
|
|
},
|
|
language: lang_kor,
|
|
serverSide: true,
|
|
processing: true,
|
|
ajax: {
|
|
url: '/m702/m702a/getResultList',
|
|
type: 'GET',
|
|
beforeSend: function () {
|
|
blockUI.blockPage({
|
|
message: tpl
|
|
})
|
|
},
|
|
complete: function () {
|
|
blockUI.unblockPage()
|
|
},
|
|
data: function (d) {
|
|
d.atcl_no = $("#frm_srch_info [name=atcl_no]").val(); // 매물번호
|
|
d.stat_cd = $("#frm_srch_info [name=stat_cd]").val(); // 현재상태
|
|
d.realtor_nm = $("#frm_srch_info [name=realtor_nm]").val(); // 중개소
|
|
d.charger_gbn = $("#frm_srch_info [name=charger_gbn]").val(); // 배정여부
|
|
d.assign_yn = $("#frm_srch_info [name=assign_yn]").val(); // 배정여부2
|
|
d.receipt_sdate = $("#frm_srch_info [name=receipt_sdate]").val(); // 접수기간1
|
|
d.receipt_edate = $("#frm_srch_info [name=receipt_edate]").val(); // 접수기간2
|
|
d.complete_sdate = $("#frm_srch_info [name=complete_sdate]").val(); // 완료기간1
|
|
d.complete_edate = $("#frm_srch_info [name=complete_edate]").val(); // 완료기간2
|
|
d.srcSido = $("#frm_srch_info [name=srcSido]").val(); // 시도
|
|
d.srcGugun = $("#frm_srch_info [name=srcGugun]").val(); // 시군구
|
|
d.srcDong = $("#frm_srch_info [name=srcDong]").val(); // 읍면동
|
|
d.bonbu = $("#frm_srch_info [name=bonbu]").val(); // 본부
|
|
d.team = $("#frm_srch_info [name=team]").val(); // 팀
|
|
d.damdang = $("#frm_srch_info [name=damdang]").val(); // 담당
|
|
d.vrfcreq_way = $("#frm_srch_info [name=vrfcreq_way]").val(); // 검증방식1
|
|
d.vrfc_type_sub = $("#frm_srch_info [name=vrfc_type_sub]").val(); // 검증방식2
|
|
d.rcpt_cpid = $("#frm_srch_info [name=rcpt_cpid]").val(); // 매체사
|
|
d.rlet_type_cd = $("#frm_srch_info [name=rlet_type_cd]").val(); // 매물종류
|
|
d.corp_own = $("#frm_srch_info [name=corp_own]").val(); // 법인
|
|
|
|
d.start = d.start || 0
|
|
d.length = d.length || 10
|
|
},
|
|
},
|
|
"columnDefs": [
|
|
{ className: 'text-center', targets: '_all' },
|
|
{ 'targets': '_all', "defaultContent": "" },
|
|
],
|
|
columns: [
|
|
{ data: null, render: fn_chk_render, className: "dt-no-rowclick tw-50" },
|
|
{ data: 'atcl_no' , function(data, type, row) {
|
|
return `<a href='<?php echo site_url('m702/m702a/detail') ?>/${row.vr_sq}' class='text-decoration-none'>${data}</a>`;
|
|
}, className:'tw-90' },
|
|
{ data: 'pre_stat' },
|
|
{ data: 'insert_tm' },
|
|
{ data: 'vrfc_type' },
|
|
{ data: null, render: fn_region_render , className: 'tw-200' },
|
|
{ data: null, render: fn_addr_render , className: 'tw-180' },
|
|
{ data: 'cpid' },
|
|
{ data: 'realtor_nm' },
|
|
{ data: 'usr_nm', width: "80px" },
|
|
{ data: null, render: fn_tm_render },
|
|
{ data: 'reg_charger' },
|
|
{ data: 'result_tm' },
|
|
|
|
],
|
|
// 옵션들 예시
|
|
paging: true,
|
|
searching: false,
|
|
ordering: false,
|
|
});
|
|
|
|
$('#resultList tbody').on('click', 'tr', function (e) {
|
|
if ($(e.target).closest('td.dt-no-rowclick').length) return;
|
|
|
|
const rowData = table.row(this).data();
|
|
if (!rowData) return;
|
|
|
|
const vr_sq = rowData.vr_sq;
|
|
window.open("<?= site_url('m702/m702a/detail') ?>/" + vr_sq, '_blank');
|
|
});
|
|
|
|
$('#btnSearch').on('click', function () {
|
|
saveSearchForm();
|
|
table.ajax.reload()
|
|
});
|
|
|
|
// 엑셀 다운로드 click
|
|
$("#excel-download").on("click", function () {
|
|
$.ajax({
|
|
url: "/m702/m702a/excel",
|
|
method: "GET",
|
|
dataType: "json",
|
|
data: $("#frm_srch_info").serialize(),
|
|
beforeSend: function () {
|
|
blockUI.blockPage({
|
|
message: tpl
|
|
})
|
|
},
|
|
complete: function () {
|
|
blockUI.unblockPage()
|
|
},
|
|
success: function (result) {
|
|
downloadExcel(result.data);
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
$(document).on('change', '#chkAll', function () {
|
|
const checked = this.checked;
|
|
|
|
$(table.rows({ page: 'current' }).nodes())
|
|
.find('input.row-chk')
|
|
.prop('checked', checked);
|
|
});
|
|
|
|
$(document).on('change', '#resultList tbody input.row-chk', function () {
|
|
const $rows = $(table.rows({ page: 'current' }).nodes());
|
|
const total = $rows.find('input.row-chk').length;
|
|
const checkedCnt = $rows.find('input.row-chk:checked').length;
|
|
|
|
$('#chkAll').prop('checked', total > 0 && total === checkedCnt);
|
|
});
|
|
|
|
|
|
// 전체 선택
|
|
$(document).on('change', '#depChkAll', function () {
|
|
$('.depChk').prop('checked', this.checked);
|
|
});
|
|
|
|
// 개별 체크 시 전체 체크 동기화
|
|
$(document).on('change', '.depChk', function () {
|
|
const total = $('.depChk').length;
|
|
const checked = $('.depChk:checked').length;
|
|
$('#depChkAll').prop('checked', total === checked);
|
|
});
|
|
|
|
table.on('draw', function () {
|
|
$('#chkAll').prop('checked', false);
|
|
});
|
|
|
|
|
|
// 배정변경 click
|
|
$("#btn_part_change").on("click", function () {
|
|
|
|
const damdangT = $("#damdangT").val();
|
|
if (damdangT == "") {
|
|
Swal.fire({
|
|
title: "담당자 유형을 선택해 주세요.",
|
|
icon: "warning"
|
|
});
|
|
|
|
return;
|
|
}
|
|
|
|
const damdang = $("#damdang2").val();
|
|
if (damdang == "") {
|
|
Swal.fire({
|
|
title: "담당자를 선택해 주세요.",
|
|
icon: "warning"
|
|
});
|
|
|
|
return;
|
|
}
|
|
|
|
var arr = new Array();
|
|
$('#resultList tbody .row-chk:checked').each(function () {
|
|
const rowData = table.row($(this).closest('tr')).data();
|
|
arr.push(rowData);
|
|
});
|
|
|
|
if (arr.length === 0) {
|
|
Swal.fire({
|
|
title: "선택된 데이터가 없습니다.",
|
|
icon: "warning"
|
|
});
|
|
|
|
return;
|
|
}
|
|
|
|
|
|
swal.fire({
|
|
text: "선택한 매물의 담당자를 배정 변경 하시겠습니까?",
|
|
type: "warning",
|
|
showCancelButton: true,
|
|
confirmButtonText: "예",
|
|
cancelButtonText: "아니오",
|
|
closeOnConfirm: false,
|
|
closeOnCancel: true,
|
|
confirmButtonColor: "#3085d6",
|
|
cancelButtonColor: "#d33",
|
|
}).then((result) => {
|
|
if (result.isConfirmed) {
|
|
const param = {
|
|
'type': damdangT,
|
|
'damdang': damdang,
|
|
'rows': JSON.stringify(arr),
|
|
};
|
|
|
|
$.ajax({
|
|
url: '/m702/m702a/updateAssign',
|
|
contentType: 'application/x-www-form-urlencoded;charset=UTF-8',
|
|
method: 'POST',
|
|
data: param,
|
|
beforeSend: function () {
|
|
blockUI.blockPage({
|
|
message: tpl
|
|
})
|
|
},
|
|
complete: function () {
|
|
blockUI.unblockPage()
|
|
},
|
|
error: function (xhr, error, thrown) {
|
|
blockUI.unblockPage()
|
|
var msg = "";
|
|
if (xhr.responseText != null) {
|
|
msg = xhr.responseText
|
|
} else {
|
|
msg = "잠시후 다시 시도해 주세요."
|
|
}
|
|
|
|
Swal.fire({
|
|
title: msg,
|
|
icon: "error"
|
|
})
|
|
},
|
|
success: function (result) {
|
|
|
|
if (result.code == '0') {
|
|
$("#btnSearch").trigger('click')
|
|
Swal.fire({
|
|
title: '정상 처리되었습니다.',
|
|
icon: "success"
|
|
|
|
})
|
|
} else {
|
|
Swal.fire({
|
|
title: result.msg,
|
|
icon: "error"
|
|
})
|
|
}
|
|
}
|
|
});
|
|
}
|
|
});
|
|
|
|
|
|
});
|
|
|
|
|
|
// 서류누락 click
|
|
$("#btn_part_omit").on("click", function () {
|
|
|
|
|
|
});
|
|
|
|
|
|
});
|
|
|
|
// 접수기간 초기화
|
|
function initReceiptDate() {
|
|
|
|
const before3 = new Date();
|
|
before3.setDate(date.getDate() - 2);
|
|
|
|
const fmt = d => d.toISOString().slice(0, 10);
|
|
|
|
$('#receipt_sdate').val(fmt(before3));
|
|
$('#receipt_edate').val(fmt(date));
|
|
|
|
}
|
|
|
|
function atcl_no_enter(event) {
|
|
if (event.keyCode == 13) {
|
|
table.ajax.reload()
|
|
}
|
|
}
|
|
|
|
function fn_chk_render(data, type, row, meta) {
|
|
const rowIndex = meta.row;
|
|
var str = "";
|
|
|
|
str = `<input class="form-check-input row-chk" type="checkbox" id="row_${rowIndex}" value="Y">`;
|
|
|
|
|
|
return str;
|
|
}
|
|
|
|
function fn_region_render(data, type, row) {
|
|
var str = "";
|
|
|
|
str = row.region_nm + " " + row.rm_no;
|
|
|
|
return str;
|
|
}
|
|
|
|
// 주소 render
|
|
function fn_addr_render(data, type, row) {
|
|
var str = "";
|
|
|
|
if (row.address2b == null) {
|
|
str = row.address2 + " " + row.address3;
|
|
} else {
|
|
str = row.address2b + " " + row.address3;
|
|
}
|
|
|
|
return str;
|
|
}
|
|
|
|
function fn_tm_render(data, type, row) {
|
|
var str = "";
|
|
|
|
if (row.update_res_tm == null) {
|
|
str = row.stat_39_tm;
|
|
} else {
|
|
str = row.update_res_tm;
|
|
}
|
|
|
|
return str;
|
|
}
|
|
|
|
// 엑셀 다운로드
|
|
function downloadExcel(data) {
|
|
const ws = XLSX.utils.json_to_sheet(data);
|
|
ws['!cols'] = [
|
|
{ wpx: 100 },
|
|
{ wpx: 100 },
|
|
{ wpx: 100 },
|
|
{ wpx: 100 },
|
|
{ wpx: 100 },
|
|
{ wpx: 100 },
|
|
{ wpx: 100 },
|
|
{ wpx: 100 },
|
|
{ wpx: 100 },
|
|
{ wpx: 100 },
|
|
{ wpx: 100 },
|
|
{ wpx: 100 },
|
|
];
|
|
|
|
const wb = XLSX.utils.book_new();
|
|
XLSX.utils.book_append_sheet(wb, ws, "Sheet1");
|
|
|
|
const wbout = XLSX.write(wb, { bookType: 'xlsx', type: 'array' });
|
|
|
|
const blob = new Blob([wbout], { type: 'application/octet-stream' });
|
|
|
|
const link = document.createElement("a");
|
|
link.href = URL.createObjectURL(blob);
|
|
link.download = "배정매물_현황" + getDateTimeString() + ".xlsx";
|
|
link.click();
|
|
URL.revokeObjectURL(link.href);
|
|
}
|
|
|
|
|
|
function getDateTimeString() {
|
|
const d = new Date();
|
|
const yyyy = d.getFullYear();
|
|
const mm = String(d.getMonth() + 1).padStart(2, '0');
|
|
const dd = String(d.getDate()).padStart(2, '0');
|
|
const hh = String(d.getHours()).padStart(2, '0');
|
|
const mi = String(d.getMinutes()).padStart(2, '0');
|
|
const ss = String(d.getSeconds()).padStart(2, '0');
|
|
return `${yyyy}${mm}${dd}${hh}${mi}${ss}`;
|
|
}
|
|
|
|
function extractCode(code) {
|
|
|
|
var codeArr = new Array();
|
|
|
|
if (codes.length) {
|
|
|
|
for (var i = 0; i < codes.length; i++) {
|
|
|
|
if (code === codes[i].category) {
|
|
codeArr.push(codes[i]);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return codeArr;
|
|
}
|
|
|
|
|
|
// 이미지 프리뷰
|
|
function fn_preview(src) {
|
|
const $img = $('#imgPreview');
|
|
|
|
// 이미지 표시
|
|
$img.attr('src', src).show();
|
|
|
|
$('#previewTitle').text('이미지 미리보기');
|
|
|
|
|
|
const modal = new bootstrap.Modal(document.getElementById('previewModal'));
|
|
modal.show();
|
|
}
|
|
</script>
|
|
<?= $this->endSection() ?>
|