실적관리 추가
This commit is contained in:
@@ -27,6 +27,123 @@
|
||||
</div>
|
||||
|
||||
<?= $this->renderSection('modals') ?>
|
||||
|
||||
<script type="text/javascript">
|
||||
const tpl = document.querySelector('.my-loader-template')
|
||||
const usrLevel = <?= session('usr_level') != null ? session('usr_level') : '' ?>
|
||||
|
||||
|
||||
// 실적 조회
|
||||
function goStats() {
|
||||
|
||||
if ($("#statDate").val() === "") {
|
||||
Swal.fire({
|
||||
title: "일자를 선택해 주세요.",
|
||||
icon: "warning",
|
||||
draggable: true
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: '/home/viewStatData',
|
||||
type: 'GET',
|
||||
contentType: 'application/x-www-form-urlencoded;charset=UTF-8',
|
||||
data: { s_date: $("#statDate").val() },
|
||||
beforeSend: function () {
|
||||
blockUI.blockPage({
|
||||
message: tpl
|
||||
});
|
||||
},
|
||||
complete: function () {
|
||||
blockUI.unblockPage();
|
||||
},
|
||||
error: function (xhr) {
|
||||
console.error("에러", xhr);
|
||||
},
|
||||
success: function (data) {
|
||||
var str = "";
|
||||
|
||||
if (String(usrLevel) === "62") {
|
||||
str = '실적 - 홍보확인서 : ' + data.paper_cnt + ' 건';
|
||||
} else if (String(usrLevel) === "61") {
|
||||
str = '실적 - 전화확인 : ' + data.phone_cnt + ' 건';
|
||||
} else if (String(usrLevel) === "8") {
|
||||
var sum = Number(data.reg_open_cnt) + Number(data.reg_tempOpen_cnt) + Number(data.real_top_R) + Number(data.real_top_G);
|
||||
|
||||
var deung = (Number(data.reg_open_cnt) / sum * 100).toFixed(0);
|
||||
var ga = (Number(data.reg_tempOpen_cnt) / sum * 100).toFixed(0);
|
||||
var real = (Number(data.real_top_R) / sum * 100).toFixed(0);
|
||||
var real_ga = (Number(data.real_top_G) / sum * 100).toFixed(0);
|
||||
|
||||
str = '실적 - 등기부등본 : ' + data.reg_open_cnt + ' 건' + ' (' + (deung = + deung || 0) + '%)'
|
||||
+ ' | 가열람 : ' + data.reg_tempOpen_cnt + ' 건' + ' (' + (ga = + ga || 0) + '%)'
|
||||
+ ' | 리얼탑 열람 : ' + data.real_top_R + ' 건' + ' (' + (real = + real || 0) + '%)'
|
||||
+ ' | 리얼탑 기열람 : ' + data.real_top_G + ' 건' + ' (' + (real_ga = + real_ga || 0) + '%)'
|
||||
} else if (String(usrLevel) === "1" || String(usrLevel) === "60") {
|
||||
str = '실적 - 홍보확인서 : ' + data.paper_cnt + ' 건 | 전화확인 : ' + data.phone_cnt + ' 건 | 등기부등본 : ' + data.reg_open_cnt + ' 건 | 가열람 : ' + data.reg_tempOpen_cnt + ' 건 ';
|
||||
}
|
||||
|
||||
$('#statView').text(str);
|
||||
playSlideIn('#statView');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 팩스조회
|
||||
function clickFax() {
|
||||
$.ajax({
|
||||
url: '/home/getHomeFaxCount',
|
||||
type: 'GET',
|
||||
beforeSend: function () {
|
||||
blockUI.blockPage({
|
||||
message: tpl
|
||||
});
|
||||
},
|
||||
complete: function () {
|
||||
blockUI.unblockPage();
|
||||
},
|
||||
error: function (xhr) {
|
||||
console.error("에러", xhr);
|
||||
},
|
||||
success: function (data) {
|
||||
var total = parseInt(data.enfax_count) + parseInt(data.lgfax_count);
|
||||
|
||||
$('#fax1').text(data.base_time + '시 부터 : 엔팩스 ' + data.enfax_count + ' 건 | LG ' + data.lgfax_count + ' 건 | 총 ' + total + ' 건');
|
||||
playSlideIn('#fax1');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function playSlideIn(selector) {
|
||||
const $el = $(selector);
|
||||
|
||||
// 이전 애니메이션 클래스 제거
|
||||
$el.removeClass('slide-in-left');
|
||||
|
||||
// 강제 리플로우(브라우저가 다시 계산하게 해서 애니메이션 재시작되도록)
|
||||
// DOM 객체가 있는 경우에만
|
||||
if ($el.length > 0 && $el[0]) {
|
||||
void $el[0].offsetWidth;
|
||||
}
|
||||
|
||||
// 새로 클래스 추가해서 애니메이션 시작
|
||||
$el.addClass('slide-in-left');
|
||||
|
||||
// 애니메이션 끝나면 클래스 제거 (다음번에도 다시 재생되도록)
|
||||
$el.one('animationend', function () {
|
||||
$(this).removeClass('slide-in-left');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
const today = new Date().toISOString().slice(0, 10);
|
||||
document.getElementById("statDate").value = today;
|
||||
});
|
||||
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user