429 lines
24 KiB
Plaintext
429 lines
24 KiB
Plaintext
<!-- #include virtual = "include/header.asp" -->
|
|
<!-- #include virtual = "include/left.asp" -->
|
|
<%
|
|
Dim prj_code : prj_code = Request("prj_code")
|
|
Dim prj_name : prj_name = Request("prj_name")
|
|
%>
|
|
<!-- Content Wrapper. Contains page content -->
|
|
<div class="content-wrapper">
|
|
<!-- Content Header (Page header) -->
|
|
<div class="content-header">
|
|
<h1>감청 근무확인</h1>
|
|
</div>
|
|
<!-- /.content-header -->
|
|
<!-- Main content -->
|
|
<div class="content-body">
|
|
<div class="content">
|
|
<div class="container-fluid">
|
|
<div class="row">
|
|
<div class="col-12">
|
|
<% Dim f_menu : f_menu = "nk" %>
|
|
<!-- #include file = "f_menu.asp" -->
|
|
<form name='punchform' id="punchform" method='post'>
|
|
<div id="prj_list"></div>
|
|
<table width="1200px" class="table table-sm table-sm2 table-bordered table-head tr-colors">
|
|
<tr>
|
|
<td align="center" >프로젝트</td>
|
|
<td align="center" id="prj_sel" style="cursor:pointer;">
|
|
<span class="prj_name">프로젝트 선택</span>
|
|
<!--<button type="button" id="prj_sel">프로젝트 선택</button>-->
|
|
</td>
|
|
<td align="center"><button type="button" id="all_cnt" >전체 타수 보기</button></td>
|
|
<td align="center"><button type="button" id="excel_down" >엑셀 다운로드</button></td>
|
|
</tr>
|
|
<tr>
|
|
<td style="text-align:center;">단가 설정</td>
|
|
<td style="text-align:left;"><input type="text" name="all_unit_cost" id="all_unit_cost" value="" /> 원 <button type="button" id="all_unit">일괄 적용</button></td>
|
|
<td style="text-align:center;">Confrim 처리</td>
|
|
<td style="text-align:center;"><button type="button" id="all_check">전체 확인</button></td>
|
|
</tr>
|
|
<tr>
|
|
<td class='text-center' colspan="4">
|
|
<table id="p_list" class="table table-sm table-sm2 table-bordered table-head tr-colors">
|
|
<tr>
|
|
<td align="center" >순번</td>
|
|
<td align="center" >프로젝트 코드</td>
|
|
<td align="center" >펀처</td>
|
|
<td align="center" >생년월일</td>
|
|
<td align="center" >근무일자</td>
|
|
<td align="center" >완료</td>
|
|
<td align="center" >에러</td>
|
|
<td align="center" >재감청</td>
|
|
<td align="center" style="width:15%;">단가</td>
|
|
<td align="center" style="width:10%;">합계</td>
|
|
<td align="center" >비고</td>
|
|
<td align="center" >확인</td>
|
|
</tr>
|
|
<%
|
|
dim no : no = 0
|
|
query = ""
|
|
query = query &" select isnull(cast(BB.Id as varchar),'') as ID, isnull(cast(CC.Id as varchar),'') as Pay_id, AA.*,isnull(BB.job_add_time_memo,'') as job_add_time_memo, isnull(BB.job_confirm_yn,'N') as job_confirm_yn, "&VbCrlf
|
|
query = query &" isnull(CC.s_pay_unit,'0') as s_pay_unit, isnull(CC.s_wan,'0') as s_wan, isnull(CC.s_sum, '0') as s_sum, isnull(CC.insert_user,'') as insert_user, "&VbCrlf
|
|
query = query &" isnull(CC.attribute01,'') as attribute01, isnull(CC.attribute05,'') as attribute05, "&VbCrlf
|
|
query = query &" case when DD.d_order_cnt = '77' then '결재 완료' when DD.d_order_cnt is null then '' else '결재 중' end as d_order_cnt from "&VbCrlf
|
|
query = query &" ( "&VbCrlf
|
|
query = query &" select prj_code, tel_inspection_user as n_name, n_birth, tel_inspection_date as n_date, "&VbCrlf
|
|
query = query &" count(case when b.tel_del_yn='N' and b.tel_result = '1' then '1' end) as t_cnt, "&VbCrlf
|
|
query = query &" count(case when b.tel_del_yn='Y' and b.tel_result = '2' then '2' end) as r_cnt, "&VbCrlf
|
|
query = query &" count(case when b.tel_del_yn='N' and b.tel_result = '2' then '3' end) as e_cnt "&VbCrlf
|
|
query = query &" from "&VbCrlf
|
|
query = query &" ( "&VbCrlf
|
|
query = query &" select (select intranet_project from new_cati.dbo.project where prj_code = a.prj_code) as prj_code, tel_inspection_user, "&VbCrlf
|
|
query = query &" case "&VbCrlf
|
|
query = query &" when len(tel_inspection_uid) = 8 then (select cast(p_no as varchar) as p_no from project2.dbo.person where p_no=tel_inspection_uid) "&VbCrlf
|
|
query = query &" else (select left(m_jumin,6) from project2.dbo.man where id=tel_inspection_uid) "&VbCrlf
|
|
query = query &" end as n_birth, "&VbCrlf
|
|
query = query &" convert(varchar,tel_inspection_date,23) as tel_inspection_date, "&VbCrlf
|
|
query = query &" tel_del_yn, tel_result "&VbCrlf
|
|
query = query &" from new_cati.dbo.T_INSPECTION_CATI as a "&VbCrlf
|
|
query = query &" where a.tel_del_yn <> '' and a.tel_inspection_user <> '' "&VbCrlf
|
|
query = query &" ) as b "&VbCrlf
|
|
query = query &" group by b.prj_code, b.tel_inspection_user, b.n_birth, b.tel_inspection_date "&VbCrlf
|
|
query = query &" ) as AA "&VbCrlf
|
|
query = query &" left join "&VbCrlf
|
|
query = query &" ( "&VbCrlf
|
|
query = query &" select id, p_child_sn, neakeun_name, left(neakeun_jumin,6) as neakeun_jumin, date, job_add_time_memo, job_confirm_yn, workload from project2.dbo.neakeun_work "&VbCrlf
|
|
query = query &" where p_sebu='감청' and ISNULL(workload, '') = '' "&VbCrlf
|
|
query = query &" ) BB on AA.n_name=BB.neakeun_name and AA.n_birth=BB.neakeun_jumin and left(AA.prj_code,11)=BB.p_child_sn and AA.n_date=BB.date "&VbCrlf
|
|
query = query &" left join "&VbCrlf
|
|
query = query &" ( "&VbCrlf
|
|
query = query &" select id, p_sn, m_name, left(m_jumin,6) as m_jumin, s_pay_unit, s_wan, s_sum, insert_user, attribute01, attribute05 from project2.dbo.T_NEAKEUN_PAY "&VbCrlf
|
|
query = query &" where s_gubun='감청' AND ISNULL(attribute02, '') = '' "&VbCrlf
|
|
query = query &" ) CC on AA.n_name=CC.m_name and AA.n_birth=CC.m_jumin and left(AA.prj_code,11)=CC.p_sn and BB.id=CC.attribute01 "&VbCrlf
|
|
query = query &" left join "&VbCrlf
|
|
query = query &" ( "&VbCrlf
|
|
query = query &" select d_no, d_order_cnt from project2.dbo.Document "&VbCrlf
|
|
query = query &" where d_delok='N' "&VbCrlf
|
|
query = query &" ) DD on CC.attribute05=DD.d_no "&VbCrlf
|
|
query = query &" where prj_code = '" & prj_code & "' "&VbCrlf
|
|
query = query &" and (n_birth is not null and len(cast(n_birth as varchar)) <> 8) "&VbCrlf
|
|
query = query &" order by AA.prj_code, AA.n_name, AA.n_birth,AA.n_date "&VbCrlf
|
|
'Response.Write query
|
|
Rs.open query, adoconn, adopenstatic, adlockreadonly
|
|
Dim input_readonly
|
|
while not rs.eof
|
|
If rs("job_confirm_yn") = "Y" Then
|
|
input_readonly = "readonly='reaonldy'"
|
|
else
|
|
input_readonly = ""
|
|
End If
|
|
no = no + 1
|
|
%>
|
|
<tr>
|
|
<td ><%=no %></td>
|
|
<td ><%=rs("prj_code") %></td>
|
|
<td ><%=rs("n_name") %><input type="hidden" name="n_id" class="n_id" value="<%=rs("ID") %>" /><input type="hidden" name="n_pay_id" class="n_pay_id" value="<%=rs("Pay_id") %>" /></td>
|
|
<td ><%=rs("n_birth") %></td>
|
|
<td ><%=rs("n_date") %></td>
|
|
<td ><%=rs("t_cnt") %></td>
|
|
<td ><%=rs("e_cnt") %></td>
|
|
<td ><%=rs("r_cnt") %></td>
|
|
<td style="text-align:right;"><input type="text" name="p_unit" value="<%=rs("s_pay_unit") %>" class="p_unit" tabindex="<%=no %>" <%=input_readonly %>/>원</td>
|
|
<td style="text-align:right;"><%=FormatNumber(rs("s_sum"),0) %>원</td>
|
|
<td ><input type="text" name="p_etc" value="<%=rs("job_add_time_memo") %>" class="p_etc" tabindex="1000+<%=no %>" <%=input_readonly %> style="width:100%;"/></td>
|
|
<td >
|
|
<%If rs("job_confirm_yn") = "N" Then%>
|
|
<button type="button" class="confirm" data-value="save">확인</button>
|
|
<%Else %>
|
|
<%If rs("attribute05") = "" Then %>
|
|
<button type="button" class="confirm" data-value="del" style="background:#CA7C7B;">취소</button>
|
|
<%Else %>
|
|
<b style="color:red;"><%=rs("d_order_cnt") %></b>
|
|
<%End If %>
|
|
<%End If %>
|
|
</td>
|
|
</tr>
|
|
<%
|
|
rs.movenext
|
|
wend
|
|
|
|
rs.Close
|
|
%>
|
|
</table>
|
|
<button type="button" id="pay_go">결재</button>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- /.content -->
|
|
<!-- REQUIRED SCRIPTS -->
|
|
<script>
|
|
var prjDialog;
|
|
$(function () {
|
|
prj_code = "<%=prj_code %>";
|
|
prj_name = "<%=prj_name %>";
|
|
|
|
if (prj_code != "") {
|
|
$(".prj_name").text("(" + prj_code + ") " + prj_name);
|
|
}else{
|
|
$("#p_list").css("display", "none");
|
|
$("#p_list").parent("td").text("프로젝트를 선택하여 주십시오.");
|
|
}
|
|
|
|
//프로젝트 선택
|
|
$("#prj_sel").click(function () {
|
|
var url = "prj_list_modal.asp?gubun=v2";
|
|
modal_open(url, "프로젝트 선택");
|
|
});
|
|
|
|
//전체 타수
|
|
$("#all_cnt").click(function () {
|
|
if (prj_code == "") {
|
|
alert("프로젝트를 선택하여 주십시오.");
|
|
return false;
|
|
} else {
|
|
var url = "cins_cnt.asp?prj_code=" + prj_code + "&prj_name=" + escape(prj_name);
|
|
modal_open(url, "전체 타수 보기");
|
|
}
|
|
});
|
|
|
|
//전체 단가
|
|
$("#all_unit_cost").click(function () {
|
|
unit_evt($(this));
|
|
});
|
|
|
|
//전체 단가 적용
|
|
$("#all_unit").click(function () {
|
|
if($("#all_unit_cost").val() == ""){
|
|
alert("전체 단가를 설정하여 주시기 바랍니다.");
|
|
return false;
|
|
}else{
|
|
if (confirm("일괄 적용시에는 부분 적용한 단가도 변경 됩니다.\n적용 하시겠습니까?")) {
|
|
var all_unit_cost = $("#all_unit_cost").val();
|
|
$(".p_unit").each(function (e) {
|
|
if ($(".p_unit").eq(e).prop("readonly") == false) {
|
|
$(".p_unit").eq(e).val(all_unit_cost);
|
|
|
|
var sum = cnt_sum($(this));
|
|
if (isNaN(sum)) {
|
|
$(this).parent("td").next().text(0 + " 원");
|
|
} else {
|
|
$(this).parent("td").next().text(commify(Math.ceil(sum)));
|
|
}
|
|
}
|
|
});
|
|
} else {
|
|
return false;
|
|
}
|
|
}
|
|
});
|
|
|
|
//전체 Confirm
|
|
$("#all_check").click(function () {
|
|
if (confirm("확인 처리 안된 업무들만 처리 됩니다.\n진행 하시겠습니까?")) {
|
|
$(".confirm").each(function () {
|
|
var gubun = $(this).text();
|
|
if (gubun == "확인") {
|
|
$(this).trigger("click");
|
|
}
|
|
});
|
|
} else {
|
|
return false;
|
|
}
|
|
});
|
|
|
|
//개별 Confirm
|
|
$(".confirm").click(function () {
|
|
var gubun = "v2";
|
|
var obj = $(this);
|
|
var prj_code = $(this).parent("td").siblings().eq(1).text();
|
|
var n_name = $(this).parent("td").siblings().eq(2).text();
|
|
var n_id = $(this).parent("td").siblings().eq(2).children(".n_id").val();
|
|
var n_pay_id = $(this).parent("td").siblings().eq(2).children(".n_pay_id").val();
|
|
var n_birth = $(this).parent("td").siblings().eq(3).text();
|
|
var n_date = $(this).parent("td").siblings().eq(4).text();
|
|
var n_cnt = parseInt($(this).parent("td").siblings().eq(5).text()) + parseInt($(this).parent("td").siblings().eq(6).text()) + parseInt($(this).parent("td").siblings().eq(7).text());
|
|
var p_danga = $(this).parent("td").siblings().eq(8).children($(".p_unit")).val();
|
|
var p_sum = $(this).parent("td").siblings().eq(9).text().replace(/,/g, "");
|
|
p_sum = p_sum.replace('원', '');
|
|
var p_etc = $(this).parent("td").siblings().eq(10).children($(".p_etc")).val();
|
|
|
|
if (p_danga == "" || p_sum == "") {
|
|
alert("금액 설정이 안되어 있습니다.");
|
|
$(this).parent("td").siblings().eq(8).children($(".p_unit")).focus();
|
|
return false
|
|
}
|
|
|
|
if (obj.text() == "확인") {
|
|
url = "neakeun_save_ajax.asp";
|
|
} else {
|
|
url = "neakeun_del_ajax.asp";
|
|
}
|
|
|
|
ajax_confirm(url, gubun, prj_code, escape(n_name), n_id, n_pay_id, n_birth, n_date, n_cnt, p_danga, p_sum, escape(p_etc), obj);
|
|
});
|
|
|
|
//개별 단가
|
|
$(".p_unit").click(function () {
|
|
unit_evt($(this));
|
|
});
|
|
|
|
//단가별 합계
|
|
$(".p_unit").each(function (e) {
|
|
$(this).keyup(function () {
|
|
|
|
var sum = cnt_sum($(this));
|
|
|
|
if (isNaN(sum)) {
|
|
$(this).parent("td").next().text(0+" 원");
|
|
} else {
|
|
$(this).parent("td").next().text(commify(Math.ceil(sum)));
|
|
}
|
|
});
|
|
});
|
|
|
|
$("#pay_go").click(function () {
|
|
var url = "/approval/doc_myun_pay.asp?title=내근직수당지출결의서";
|
|
$("#punchform").attr("action", url);
|
|
$("#punchform").submit();
|
|
});
|
|
|
|
$("#excel_down").click(function () {
|
|
var d = new Date()
|
|
$("#p_list").table2excel({
|
|
name: "<%=prj_code %>_" + d.getFullYear() + d.getMonth() + d.getDate(),
|
|
filename: "<%=prj_code %>_" + d.getFullYear() + d.getMonth() + d.getDate(),
|
|
fileext: ".xls",
|
|
exclude_inputs: true
|
|
|
|
});
|
|
});
|
|
|
|
});
|
|
|
|
//단가, 합계
|
|
function cnt_sum(obj){
|
|
var tok = parseInt(obj.parent("td").siblings().eq(5).text());
|
|
var error = parseInt(obj.parent("td").siblings().eq(6).text());
|
|
var notel = parseInt(obj.parent("td").siblings().eq(7).text());
|
|
var cnt = tok + error + notel;
|
|
var unit_cost = parseFloat(obj.val());
|
|
|
|
return cnt * unit_cost;
|
|
}
|
|
|
|
function modal_open(url, x) {
|
|
$("body").css({
|
|
overflow: 'hidden'
|
|
});
|
|
prjDialog = $("#prj_list").dialog({
|
|
autoOpen: false,
|
|
modal: true,
|
|
resizable: false,
|
|
position: { my: "center", at: "top" },
|
|
show: "blind",
|
|
width: "600",
|
|
height: "500",
|
|
title: x,
|
|
open: function () {
|
|
$(".ui-widget-overlay").css({
|
|
opacity: 0.5,
|
|
filter: "Alpha(Opacity=50)",
|
|
backgroundColor: "gray"
|
|
});
|
|
},
|
|
close: function (event, ui) {
|
|
$("body").css({
|
|
overflow: 'inherit'
|
|
});
|
|
url = "";
|
|
prjDialog.dialog("close");
|
|
}
|
|
});
|
|
|
|
prjDialog.load(url, function () {
|
|
prjDialog.dialog("open");
|
|
});
|
|
}
|
|
|
|
function unit_evt(obj) {
|
|
$(obj).css('imeMode', 'disabled').keypress(function (evt) {
|
|
if (evt.which && (evt.which < 45 || evt.which > 57)) {
|
|
evt.preventDefault();
|
|
}
|
|
|
|
var charCode = (evt.which) ? evt.which : event.keyCode;
|
|
if (charCode != 46 && charCode > 31 && (charCode < 48 || charCode > 57)) {
|
|
return false;
|
|
}
|
|
|
|
var regexp = /^\d*[.]\d*$/;//소수점
|
|
var val = $(this).val();
|
|
|
|
if (regexp.test(val)) {//소수점 Prevent
|
|
if (charCode == 46) {
|
|
return false;
|
|
}
|
|
}
|
|
}).keyup(function (evt) {
|
|
if ($(this).val() != null && $(this).val() != '') {
|
|
$(this).val($(this).val().replace(/[^\.0-9]/g, ''));
|
|
}
|
|
});
|
|
}
|
|
|
|
//Confirm
|
|
function ajax_confirm(url, gubun, prj_code, n_name, n_id, n_pay_id, n_birth, n_date, n_cnt, p_danga, p_sum, p_etc, obj) {
|
|
$.ajax({
|
|
url: url,
|
|
type: "get",
|
|
data:
|
|
{
|
|
"gubun": gubun,
|
|
"n_id": n_id,
|
|
"n_pay_id": n_pay_id,
|
|
"prj_code": prj_code,
|
|
"n_name": n_name,
|
|
"n_birth": n_birth,
|
|
"n_date": n_date,
|
|
"n_cnt": n_cnt,
|
|
"p_danga": p_danga,
|
|
"p_sum": p_sum,
|
|
"p_etc": p_etc,
|
|
},
|
|
dataType:"JSON",
|
|
success: function (data) {
|
|
console.log(data);
|
|
if (data.ok == "1") {
|
|
if (obj.text() == "확인") {
|
|
if (n_pay_id == "") {
|
|
obj.parent("td").siblings().eq(2).children(".n_id").val(data.id);
|
|
obj.parent("td").siblings().eq(2).children(".n_pay_id").val(data.pay_id);
|
|
obj.parent("td").siblings().eq(8).children(".p_unit").prop("readonly",true);
|
|
obj.parent("td").siblings().eq(10).children(".p_etc").prop("readonly", true);
|
|
}
|
|
obj.text("취소");
|
|
obj.css("background", "#CA7C7B");
|
|
} else {
|
|
if (n_pay_id != "") {
|
|
obj.parent("td").siblings().eq(2).children(".n_id").val("");
|
|
obj.parent("td").siblings().eq(2).children(".n_pay_id").val("");
|
|
obj.parent("td").siblings().eq(8).children(".p_unit").prop("readonly", false);
|
|
obj.parent("td").siblings().eq(10).children(".p_etc").prop("readonly", false);
|
|
}
|
|
obj.text("확인");
|
|
obj.css("background", "");
|
|
}
|
|
} else {
|
|
if (data.ok == "2") {
|
|
alert("저장된 정보가 있습니다.\n관리자에게 문의 바랍니다.");
|
|
} else {
|
|
alert("오류!\n 입력 내용을 다시 확인 하여 주시기 바랍니다.");
|
|
}
|
|
|
|
}
|
|
},
|
|
error: function () {
|
|
alert("오류 발생\n관리자에게 문의 하십시오.");
|
|
}
|
|
});
|
|
}
|
|
</script>
|
|
</div>
|
|
<!-- /.content-wrapper -->
|
|
<!-- #include virtual = "include/footer.asp" --> |