651 lines
21 KiB
Plaintext
651 lines
21 KiB
Plaintext
<!-- #include virtual = "include/header.asp" -->
|
||
<!-- #include virtual = "include/left.asp" -->
|
||
<%
|
||
Dim query, p_no : p_no = session("User_Number")
|
||
%>
|
||
<!-- Content Wrapper. Contains page content -->
|
||
<div class="content-wrapper">
|
||
<style>
|
||
#ufile{
|
||
width:100%;
|
||
}
|
||
#regPrjDialog table tr td {
|
||
padding:2px;
|
||
text-align:center;
|
||
}
|
||
#regPrjDialog table tr:nth-child(n+2) td:nth-child(2) {
|
||
text-align:left;
|
||
}
|
||
#historyTb > tbody > tr > td{
|
||
text-align:center;
|
||
letter-spacing: 0px;
|
||
}
|
||
#historyTb > tbody > tr:first-child > td{
|
||
text-align:left;
|
||
}
|
||
#historyTb > tbody > tr:nth-child(-n+2) > td{
|
||
font-weight:bold;
|
||
}
|
||
.delPay_btn{
|
||
cursor: pointer;
|
||
}
|
||
#resTb > tbody > tr > td{
|
||
text-align:center;
|
||
letter-spacing: 0px;
|
||
}
|
||
#resTb > tbody > tr > td:nth-child(1){ width:160px; }
|
||
#resTb > tbody > tr > td:nth-child(2){ width:135px; }
|
||
#resTb > tbody > tr > td:nth-child(3){ width:135px; }
|
||
#resTb > tbody > tr > td:nth-child(4){ width:90px; }
|
||
#resTb > tbody > tr > td:nth-child(5){ width:110px; }
|
||
#resTb > tbody > tr > td:nth-child(6){ width:170px; }
|
||
#resTb > tbody > tr:nth-child(n+2) > td:nth-child(2), #resTb > tbody > tr > td:nth-child(3){
|
||
text-align:right;
|
||
padding-right:15px;
|
||
}
|
||
#resTb > tbody > tr:nth-child(-n+2) > td{
|
||
font-weight:bold;
|
||
}
|
||
#resTb input[type='checkbox']{
|
||
transform: scale(1.2);
|
||
}
|
||
#loadingBar{
|
||
position: absolute;
|
||
width: 100%;
|
||
height: 100%;
|
||
top: 0px;
|
||
left: 0px;
|
||
background-color: rgba(255,255,255,0.5);
|
||
z-index: 5001;
|
||
}
|
||
#loadingBar img{
|
||
position: absolute;
|
||
left: 50%;
|
||
top: 50%;
|
||
width: 100px;
|
||
height: 100px;
|
||
}
|
||
#resTb input[name='calcPay'], #confirmTb input[name='resultCalcPay']{
|
||
cursor: default;
|
||
border: 0;
|
||
width: 100px;
|
||
font-size:12px;
|
||
text-align: center;
|
||
outline: none;
|
||
background-color:transparent;
|
||
}
|
||
|
||
input{
|
||
letter-spacing: 0px;
|
||
}
|
||
|
||
#confirmTb > tbody > tr > td{
|
||
text-align:center;
|
||
letter-spacing: 0px;
|
||
}
|
||
#confirmTb > tbody > tr:nth-child(-n+2) > td{
|
||
font-weight:bold;
|
||
}
|
||
|
||
#lastSumTb > tbody > tr > td{
|
||
text-align:center;
|
||
letter-spacing: 0px;
|
||
}
|
||
#lastSumTb > tbody > tr:nth-child(-n+2) > td{
|
||
font-weight:bold;
|
||
}
|
||
</style>
|
||
<!-- Content Header (Page header) -->
|
||
<div class="content-header">
|
||
<h1><3E>ڵ<EFBFBD> <20>ٹ<EFBFBD>Ȯ<EFBFBD><C8AE></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" -->
|
||
<div id="loadingBar" style="display: none;"><img src="/images/loadingBar.gif"></div>
|
||
<table>
|
||
<tr>
|
||
<td style="padding:5px 0px 10px 0px;">
|
||
<input type="button" id="fudialog_btn" value="<22>ڵ<EFBFBD> <20>۾<EFBFBD><DBBE><EFBFBD> EXCEL <20><><EFBFBD><EFBFBD>"/>
|
||
<div id="fileUploadDialog">
|
||
<form id='codingform' method='post' enctype="multipart/form-data" action="">
|
||
<input type="file" id="ufile" name="ufile" />
|
||
</form>
|
||
</div>
|
||
<input type="button" id="history_btn" value="<22><><EFBFBD>ϳ<EFBFBD><CFB3><EFBFBD> <20><><EFBFBD><EFBFBD>"/>
|
||
<div id="historyDialog">
|
||
<table id="historyTb" class="table table-sm table-sm2 table-bordered table-head tr-colors">
|
||
<tr>
|
||
<td colspan="8"><3E><><EFBFBD><EFBFBD><EFBFBD>Ϸ<EFBFBD><CFB7><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>Ͽ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ʽ<EFBFBD><CABD>ϴ<EFBFBD>.</td>
|
||
</tr>
|
||
<tr>
|
||
<td>Excel<65><6C><EFBFBD><EFBFBD><EFBFBD><EFBFBD></td>
|
||
<td><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ<EFBFBD>ڵ<EFBFBD></td>
|
||
<td><3E>ڵ<EFBFBD><DAB5>ٹ<EFBFBD><D9B9><EFBFBD></td>
|
||
<td><3E><><EFBFBD><EFBFBD></td>
|
||
<td><3E>ܰ<EFBFBD></td>
|
||
<td><3E><><EFBFBD><EFBFBD> <20><> <20>ܰ<EFBFBD></td>
|
||
<td><3E><><EFBFBD><EFBFBD></td>
|
||
<td> </td>
|
||
</tr>
|
||
<%
|
||
Query = " SELECT NP.attribute01, NP.p_sn, NP.m_name, LEFT(NP.m_jumin, 6) AS m_jumin, "
|
||
Query = Query & " NP.work_dt, NP.s_wan, NP.s_pay_unit, NP.s_sum, "
|
||
Query = Query & " ISNULL(NP.attribute05, '') AS attribute05, "
|
||
Query = Query & " ISNULL(D.d_order_cnt, 0) AS d_order_cnt "
|
||
Query = Query & " FROM project2.dbo.neakeun_work NW "
|
||
Query = Query & " LEFT JOIN project2.dbo.T_NEAKEUN_PAY NP ON CONVERT(varchar, NW.id) = NP.attribute01"
|
||
Query = Query & " LEFT JOIN project2.dbo.Document D ON NP.attribute05 = D.d_no AND D.d_delok = 'N'"
|
||
Query = Query & " WHERE NW.p_sebu = '<27>ڵ<EFBFBD>' "
|
||
Query = Query & " AND NW.in_time + NW.out_time = '00000000' "
|
||
Query = Query & " AND ISNULL(D.d_order_cnt, 0) <> 77"
|
||
Query = Query & " ORDER BY NP.work_dt DESC, NP.p_sn DESC, NP.m_name, NP.s_sum "
|
||
|
||
Rs.Open Query, adoConn, 1
|
||
for i = 1 to Rs.RecordCount
|
||
%>
|
||
<tr>
|
||
<td ><%=Rs("work_dt")%></td>
|
||
<td ><%=Rs("p_sn")%></td>
|
||
<td ><%=Rs("m_name")%> (<%=Rs("m_jumin")%>)</td>
|
||
<td ><%=formatNumber(Rs("s_wan"), 0)%></td>
|
||
<td ><%=formatNumber(Rs("s_pay_unit"), 0)%></td>
|
||
<td ><%=formatNumber(Rs("s_sum"), 0)%></td>
|
||
<td ><%
|
||
if Rs("d_order_cnt") = "0" then
|
||
Response.Write "<22>̰<EFBFBD><CCB0><EFBFBD> <20>Ǵ<EFBFBD> <20>ݷ<EFBFBD>"
|
||
else
|
||
Response.Write "<22><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||
end if
|
||
%></td>
|
||
<td ><%
|
||
if Rs("d_order_cnt") = "0" then
|
||
%>
|
||
<input type="button" value="<22><><EFBFBD><EFBFBD>" id="delPay_<%=Rs("attribute01")%>" class="delPay_btn" />
|
||
<%
|
||
end if
|
||
%></td>
|
||
</tr>
|
||
<%
|
||
Rs.MoveNext
|
||
next
|
||
Rs.Close
|
||
%>
|
||
</table>
|
||
</div>
|
||
<input type="button" id="confirm_btn" style="display:none;" value="Confirm <20><><EFBFBD><EFBFBD>"/>
|
||
<div id="confirmDialog">
|
||
<table id="confirmTb" class="table table-sm table-sm2 table-bordered table-head tr-colors">
|
||
<tr>
|
||
<td colspan="4"><3E>ܰ<EFBFBD> <20><> <20>ڵ<EFBFBD><DAB5>ٹ<EFBFBD><D9B9>ں<EFBFBD> <20><><EFBFBD><EFBFBD></td>
|
||
</tr>
|
||
<tr>
|
||
<td><3E><><EFBFBD><EFBFBD>(<28><>)</td>
|
||
<td><3E>ܰ<EFBFBD></td>
|
||
<td><3E><><EFBFBD><EFBFBD>(<28><>) <20><> <20>ܰ<EFBFBD></td>
|
||
<td><3E>ڵ<EFBFBD><DAB5>ٹ<EFBFBD><D9B9><EFBFBD></td>
|
||
</tr>
|
||
</table>
|
||
</div>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<table id="resTb" style="display:none;width:1000px;" class="table table-sm table-sm2 table-bordered table-head tr-colors">
|
||
<tr>
|
||
<td><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ</td>
|
||
<td colspan="5">
|
||
<input type="hidden" id="p_child_sn" /><input type="text" id="p_subject" style="cursor:pointer; width:100%;" palceHolder="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ<EFBFBD><C6AE> <20><><EFBFBD><EFBFBD><EFBFBD>Ͽ<EFBFBD> <20>ּ<EFBFBD><D6BC><EFBFBD>" readonly/>
|
||
<div id="regPrjDialog">
|
||
<table class="table table-sm table-sm2 table-bordered table-head tr-colors">
|
||
<tr>
|
||
<td style="width:8%"><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ <20>ڵ<EFBFBD></td>
|
||
<td style="width:37%"><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ <20><></td>
|
||
<td style="width:15%"><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD></td>
|
||
<td style="width:15%"><3E><><EFBFBD><EFBFBD><EFBFBD>μ<EFBFBD></td>
|
||
</tr>
|
||
<%
|
||
Query = " SELECT p_child_sn, p_subject, p_method_nm, p_intention, ISNULL(D.T_name, '') as d_name "
|
||
Query = Query & " FROM V_PROJECT_METHOD VPM LEFT OUTER JOIN v_Department D "
|
||
Query = Query & " ON VPM.p_rsch_dept = D.before_t_cd1 "
|
||
Query = Query & " WHERE ISNULL(p_child_sn, '') <> '' "
|
||
Query = Query & " AND p_progress_status >= '006' "
|
||
Query = Query & " AND (p_research_complete + p_field_complete + p_dp_complete) IS NULL "
|
||
Query = Query & " AND ( "
|
||
Query = Query & " p_rsch_1_a = '" & p_no & "' OR p_rsch_2_a = '" & p_no & "' OR p_rsch_3_a = '" & p_no & "' OR p_rsch_4_a = '" & p_no & "' OR "
|
||
Query = Query & " p_rsch_1_b = '" & p_no & "' OR p_rsch_2_b = '" & p_no & "' OR p_rsch_3_b = '" & p_no & "' OR p_rsch_4_b = '" & p_no & "' OR "
|
||
Query = Query & " p_rsch_1_c = '" & p_no & "' OR p_rsch_2_c = '" & p_no & "' OR p_rsch_3_c = '" & p_no & "' OR p_rsch_4_c = '" & p_no & "' OR "
|
||
Query = Query & " p_sv_1 = '" & p_no & "' OR p_sv_2 = '" & p_no & "' OR p_sv_3 = '" & p_no & "' OR p_sv_4 = '" & p_no & "' OR "
|
||
Query = Query & " p_code_1 = '" & p_no & "' OR p_code_2 = '" & p_no & "' OR p_code_3 = '" & p_no & "' OR p_code_4 = '" & p_no & "' OR "
|
||
Query = Query & " p_verify_1 = '" & p_no & "' OR p_verify_2 = '" & p_no & "' OR p_verify_3 = '" & p_no & "' OR p_verify_4 = '" & p_no & "' OR "
|
||
Query = Query & " p_dp_1 = '" & p_no & "' OR p_dp_2 = '" & p_no & "' OR p_dp_3 = '" & p_no & "' OR p_dp_4 = '" & p_no & "' OR "
|
||
Query = Query & " p_it_1 = '" & p_no & "' OR p_it_2 = '" & p_no & "' OR p_it_3 = '" & p_no & "' OR p_it_4 = '" & p_no & "' OR "
|
||
Query = Query & " p_supp_1 = '" & p_no & "' OR p_supp_2 = '" & p_no & "' OR p_supp_3 = '" & p_no & "' OR p_supp_4 = '" & p_no & "' "
|
||
Query = Query & " ) "
|
||
Query = Query & " ORDER BY p_child_sn "
|
||
|
||
Rs.Open Query, adoConn, 1
|
||
for i = 1 to Rs.RecordCount
|
||
%>
|
||
<tr>
|
||
<td ><%=Rs("p_child_sn")%></td>
|
||
<td ><a href="javascript:selectPrj('<%=Rs("p_child_sn")%>','<%=Rs("p_subject")%>')"><%=Rs("p_subject")%></a></td>
|
||
<td ><%=Rs("p_method_nm")%></td>
|
||
<td ><%=Rs("d_name")%></td>
|
||
</tr>
|
||
<%
|
||
Rs.MoveNext
|
||
next
|
||
Rs.Close
|
||
%>
|
||
</table>
|
||
</div>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td><3E><><EFBFBD><EFBFBD></td>
|
||
<td><3E>ڵ<EFBFBD><DAB5><EFBFBD><EFBFBD><EFBFBD>(ù<><C3B9>) <input type="checkbox" id="firstChkAll" value="fir" /></td>
|
||
<td><3E>ڵ<EFBFBD><DAB5><EFBFBD><EFBFBD><EFBFBD>(<28>հ<EFBFBD>) <input type="checkbox" id="allChkAll" value="all" /></td>
|
||
<td><3E>ܰ<EFBFBD></td>
|
||
<td><3E><><EFBFBD><EFBFBD> <20><> <20>ܰ<EFBFBD></td>
|
||
<td><3E>ڵ<EFBFBD><DAB5>ٹ<EFBFBD><D9B9><EFBFBD></td>
|
||
</tr>
|
||
</table>
|
||
</tr>
|
||
</table>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<!-- /.content -->
|
||
<!-- REQUIRED SCRIPTS -->
|
||
<script>
|
||
$(function () {
|
||
fileUploadDialog = $("#fileUploadDialog").dialog({
|
||
autoOpen: false,
|
||
modal: true,
|
||
resizable: false,
|
||
height: 170,
|
||
width: 400,
|
||
title: 'EXCEL <20><><EFBFBD><EFBFBD>',
|
||
close: function(){
|
||
var $el = $('#ufile');
|
||
$el.wrap('<form>').closest('form').get(0).reset();
|
||
$el.unwrap();
|
||
},
|
||
buttons: {
|
||
"<22><><EFBFBD><EFBFBD>": uploadOk,
|
||
"<22><><EFBFBD><EFBFBD>": uploadCancel
|
||
}
|
||
});
|
||
|
||
fileUploadDialog.dialog("option", "position", {
|
||
my: 'center',
|
||
at: 'center',
|
||
of: window
|
||
});
|
||
|
||
$("#fudialog_btn").click(function () {
|
||
fileUploadDialog.dialog("open");
|
||
});
|
||
|
||
historyDialog = $("#historyDialog").dialog({
|
||
autoOpen: false,
|
||
modal: true,
|
||
resizable: false,
|
||
height: 600,
|
||
width: 600,
|
||
title: '<27><><EFBFBD>ϳ<EFBFBD><CFB3><EFBFBD> <20><><EFBFBD><EFBFBD>',
|
||
close: function(){
|
||
|
||
}
|
||
});
|
||
|
||
historyDialog.dialog("option", "position", {
|
||
my: 'center',
|
||
at: 'center',
|
||
of: window
|
||
});
|
||
|
||
$("#history_btn").click(function () {
|
||
historyDialog.dialog("open");
|
||
});
|
||
|
||
$(".delPay_btn").click(function(){
|
||
var neakeunWorkID = $(this).prop("id").split("_")[1];
|
||
if(!confirm("<22>ش<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Ͻðڽ<C3B0><DABD>ϱ<EFBFBD>?")){
|
||
return;
|
||
}
|
||
$.ajax({
|
||
url:'./coding_confirm_delete.asp',
|
||
data:{"id" : neakeunWorkID},
|
||
type:'POST',
|
||
success:function(res){
|
||
if(res == "1"){
|
||
alert("<22><><EFBFBD><EFBFBD>ó<EFBFBD><C3B3><EFBFBD>Ǿ<EFBFBD><C7BE><EFBFBD><EFBFBD>ϴ<EFBFBD>.");
|
||
$("#delPay_"+neakeunWorkID).parents("tr").eq(0).remove();
|
||
}else{
|
||
alert("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><DFBB>Ͽ<EFBFBD><CFBF><EFBFBD><EFBFBD>ϴ<EFBFBD>.\n<><6E><EFBFBD><EFBFBD><EFBFBD>ڿ<EFBFBD><DABF><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Ͻñ<CFBD><C3B1>ٶ<EFBFBD><D9B6>ϴ<EFBFBD>.");
|
||
}
|
||
}
|
||
});
|
||
});
|
||
|
||
confirmDialog = $("#confirmDialog").dialog({
|
||
autoOpen: false,
|
||
modal: true,
|
||
resizable: false,
|
||
height: 500,
|
||
width: 500,
|
||
title: 'Confirm <20><><EFBFBD><EFBFBD>',
|
||
close: function(){
|
||
$("#confirmTb > tbody > tr:nth-child(n+3)").remove();
|
||
},
|
||
buttons: {
|
||
"<22><><EFBFBD><EFBFBD>": confirmOK,
|
||
"<22><><EFBFBD><EFBFBD>": confirmCancel
|
||
}
|
||
});
|
||
|
||
confirmDialog.dialog("option", "position", {
|
||
my: 'center',
|
||
at: 'center',
|
||
of: window
|
||
});
|
||
|
||
$("#confirm_btn").click(function () {
|
||
if($("#p_child_sn").val() == ""){
|
||
alert("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ<EFBFBD><C6AE> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ּ<EFBFBD><D6BC><EFBFBD>.");
|
||
return;
|
||
}
|
||
if($("input[name='allChk']").length != ($("input[name='allChk']:checked").length + $("input[name='firstChk']:checked").length)){
|
||
alert("<22>ڵ<EFBFBD><DAB5><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ּ<EFBFBD><D6BC><EFBFBD>.");
|
||
return;
|
||
}
|
||
calcTotalSum();
|
||
confirmDialog.dialog("open");
|
||
});
|
||
|
||
regPrjDialog = $("#regPrjDialog").dialog({
|
||
autoOpen: false,
|
||
modal: true,
|
||
resizable: false,
|
||
height: 600,
|
||
width: 800,
|
||
title: '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ <20><><EFBFBD><EFBFBD>'
|
||
});
|
||
|
||
$("#p_subject").click(function(){
|
||
regPrjDialog.dialog("open");
|
||
});
|
||
|
||
$("#firstChkAll").click(function(){
|
||
if($(this).is(":checked")){
|
||
$("input[name='allChk']").prop("checked", false);
|
||
$("#allChkAll").prop("checked", false);
|
||
$("input[name='firstChk']").prop("checked", true);
|
||
}else{
|
||
$(this).prop("checked", false);
|
||
$("input[name='firstChk']").prop("checked", false);
|
||
}
|
||
calcPayAll();
|
||
});
|
||
|
||
$("#allChkAll").click(function(){
|
||
if($(this).is(":checked")){
|
||
$("input[name='allChk']").prop("checked", true);
|
||
$("#firstChkAll").prop("checked", false);
|
||
$("input[name='firstChk']").prop("checked", false);
|
||
}else{
|
||
$(this).prop("checked", false);
|
||
$("input[name='allChk']").prop("checked", false);
|
||
}
|
||
calcPayAll();
|
||
});
|
||
|
||
$(document).on("click", "input[name='firstChk']", function(){
|
||
var idx = $("input[name='firstChk']").index($(this));
|
||
if($(this).prop("checked") == true){
|
||
$("input[name='allChk']").eq(idx).prop("checked", false);
|
||
}
|
||
chkControl();
|
||
});
|
||
|
||
$(document).on("click", "input[name='allChk']", function(){
|
||
var idx = $("input[name='allChk']").index($(this));
|
||
if($(this).prop("checked") == true){
|
||
$("input[name='firstChk']").eq(idx).prop("checked", false);
|
||
}
|
||
chkControl();
|
||
});
|
||
});
|
||
|
||
var coderJsonArr = new Array();
|
||
|
||
function chkControl(){
|
||
if($("input[name='allChk']:not(:checked)").length == 0){
|
||
$("#allChkAll").prop("checked", true);
|
||
}else{
|
||
$("#allChkAll").prop("checked", false);
|
||
}
|
||
if($("input[name='firstChk']:not(:checked)").length == 0){
|
||
$("#firstChkAll").prop("checked", true);
|
||
}else{
|
||
$("#firstChkAll").prop("checked", false);
|
||
}
|
||
calcPayAll();
|
||
}
|
||
|
||
function calcPayAll(){
|
||
$.each($("input[name='calcPay']"), function(idx, obj){
|
||
var calcPay = 0;
|
||
var CodingCount = 0;
|
||
if($("input[name='firstChk']").eq(idx).prop("checked")){
|
||
CodingCount = $("input[name='firstCount']").eq(idx).val()*1;
|
||
}
|
||
if($("input[name='allChk']").eq(idx).prop("checked")){
|
||
CodingCount = $("input[name='totalCount']").eq(idx).val()*1;
|
||
}
|
||
calcPay = CodingCount * $("input[name='unitPay']").eq(idx).val()*1;
|
||
|
||
$(obj).val(commify(calcPay));
|
||
});
|
||
}
|
||
|
||
function uploadOk(){
|
||
var frm = $("#codingform")[0];
|
||
var frmData = new FormData(frm);
|
||
if($("#ufile")[0].files.length == 0){
|
||
alert("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ּ<EFBFBD><D6BC><EFBFBD>.");
|
||
return;
|
||
}
|
||
$.ajax({
|
||
url:'./coding_confirm_fileupload.asp',
|
||
processData:false,
|
||
contentType:false,
|
||
data:frmData,
|
||
type:'POST',
|
||
beforeSend:function(){
|
||
$("#loadingBar").show();
|
||
},
|
||
success:function(res){
|
||
if(res == "1"){
|
||
excelReadFunc($("#ufile")[0].files[0].name);
|
||
}
|
||
}
|
||
});
|
||
}
|
||
|
||
function uploadCancel(){
|
||
fileUploadDialog.dialog("close");
|
||
}
|
||
|
||
function calcTotalSum(){
|
||
var calcArr = new Array();
|
||
$.each($("input[name='calcPay']"), function(idx, obj){
|
||
var calcObj = new Object();
|
||
calcObj.codingCount = $("input[name='firstChk']").eq(idx).prop("checked") ? $("input[name='firstCount']").eq(idx).val() : $("input[name='totalCount']").eq(idx).val();
|
||
calcObj.unitPay = $("input[name='unitPay']").eq(idx).val();
|
||
calcObj.coderID = $("input[name='coderID']").eq(idx).val();
|
||
calcArr.push(calcObj);
|
||
});
|
||
var calcArrUnique = $.unique(calcArr.map(function(obj, idx){
|
||
return obj.unitPay + "|" + obj.coderID;
|
||
}).sort());
|
||
|
||
var resultArr = new Array();
|
||
$.each(calcArrUnique, function(idx, obj){
|
||
var groupBy = obj.split("|");
|
||
var groupUnitPay = groupBy[0];
|
||
var groupCoderID = groupBy[1];
|
||
var sumCodingCount = 0;
|
||
$.each(calcArr, function(i, o){
|
||
if(o.unitPay == groupUnitPay && o.coderID == groupCoderID){
|
||
sumCodingCount = sumCodingCount + o.codingCount*1;
|
||
}
|
||
});
|
||
var tmpObj = new Object();
|
||
tmpObj.codingCount = sumCodingCount;
|
||
tmpObj.unitPay = groupUnitPay;
|
||
tmpObj.coderID = groupCoderID;
|
||
resultArr.push(tmpObj);
|
||
});
|
||
resultArr.sort(function(a, b){ return a.coderID < b.coderID ? -1 : a.coderID > b.coderID ? 1 : 0; });
|
||
$.each(resultArr, function(idx, obj){
|
||
var coderInfo = $.grep(coderJsonArr, function(v, i){ return v.id == obj.coderID; })[0];
|
||
$("#confirmTb tbody").append("<tr>"+
|
||
"<td class='tit7'><input type='hidden' name='resultCount' value='" + obj.codingCount + "'/>" + commify(obj.codingCount) + "</td>"+
|
||
"<td class='tit7'><input type='hidden' name='resultUnitPay' value='" + obj.unitPay + "'/>" + commify(obj.unitPay) + "</td>"+
|
||
"<td class='tit7'><input type='text' name='resultCalcPay' value='0' tabindex='-1' readOnly /></td>"+
|
||
"<td class='tit7'><input type='hidden' name='resultCoderID' value='" + obj.coderID + "'/>[" + obj.coderID + "] " + coderInfo.name + "(" + coderInfo.birth + ")</td>"+
|
||
"</tr>");
|
||
var calcPay = 0;
|
||
var CodingCount = 0;
|
||
CodingCount = $("input[name='resultCount']").eq(idx).val()*1;
|
||
calcPay = CodingCount * $("input[name='resultUnitPay']").eq(idx).val()*1;
|
||
$("input[name='resultCalcPay']").eq(idx).val(commify(calcPay));
|
||
});
|
||
$("#lastSumTb").remove();
|
||
$("#confirmDialog").append(
|
||
"<table id='lastSumTb' style='width:70%;margin-top:15px;padding:3px;' class='table table-sm table-sm2 table-bordered table-head tr-colors'>"+
|
||
"<tr>"+
|
||
"<td class='tit8' colspan='2'><3E>ڵ<EFBFBD><DAB5>ٹ<EFBFBD><D9B9>ں<EFBFBD> <20><><EFBFBD><EFBFBD></td>"+
|
||
"</tr>"+
|
||
"<tr>"+
|
||
"<td class='tit8'><3E>ڵ<EFBFBD><DAB5>ٹ<EFBFBD><D9B9><EFBFBD></td>"+
|
||
"<td class='tit8'><3E><><EFBFBD><EFBFBD></td>"+
|
||
"</tr>"+
|
||
"</table>"
|
||
);
|
||
|
||
$.each($.unique(resultArr.map(function(obj){ return obj.coderID; })), function(idx, coderID){
|
||
var coderInfo = $.grep(coderJsonArr, function(v, i){ return v.id == coderID; })[0];
|
||
var codingCountTotal = 0;
|
||
$.each(resultArr, function(i, o){
|
||
if(o.coderID == coderID){
|
||
codingCountTotal = codingCountTotal + (o.codingCount*o.unitPay);
|
||
}
|
||
});
|
||
$("#lastSumTb tbody").append(
|
||
"<tr>"+
|
||
"<td class='tit7'>[" + coderID + "] " + coderInfo.name + "(" + coderInfo.birth + ")</td>"+
|
||
"<td class='tit7'>" + commify(codingCountTotal) + "</td>"+
|
||
"</tr>"
|
||
);
|
||
});
|
||
}
|
||
|
||
function confirmOK(){
|
||
$("#loadingBar").show();
|
||
var resultArr = new Array();
|
||
$.each($("input[name='resultCalcPay']"), function(idx, obj){
|
||
var resultObj = new Object();
|
||
resultObj.codingCount = $("input[name='resultCount']").eq(idx).val();
|
||
resultObj.unitPay = $("input[name='resultUnitPay']").eq(idx).val();
|
||
resultObj.coderID = $("input[name='resultCoderID']").eq(idx).val();
|
||
resultArr.push(resultObj);
|
||
});
|
||
|
||
$.ajax({
|
||
url:'./coding_confirm_approval.asp',
|
||
data:{
|
||
"result" : JSON.stringify(resultArr),
|
||
"p_child_sn" : $("#p_child_sn").val()
|
||
},
|
||
dataType:'json',
|
||
type:'POST',
|
||
success:function(res){
|
||
if(res == "1"){
|
||
if(confirm("Confirm<72><6D> <20>Ϸ<EFBFBD><CFB7>Ǿ<EFBFBD><C7BE><EFBFBD><EFBFBD>ϴ<EFBFBD>.\n<><6E><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> Page<67><65> <20>̵<EFBFBD><CCB5>ұ<EFBFBD><D2B1><EFBFBD>?")){
|
||
location.href = "/approval/doc_myun_pay.asp";
|
||
}
|
||
}else{
|
||
alert("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><DFBB>Ͽ<EFBFBD><CFBF><EFBFBD><EFBFBD>ϴ<EFBFBD>.\n<><6E><EFBFBD><EFBFBD><EFBFBD>ڿ<EFBFBD><DABF><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Ͻñ<CFBD><C3B1>ٶ<EFBFBD><D9B6>ϴ<EFBFBD>.");
|
||
}
|
||
},
|
||
complete:function(){
|
||
$("#loadingBar").hide();
|
||
}
|
||
});
|
||
}
|
||
|
||
function confirmCancel(){
|
||
confirmDialog.dialog("close");
|
||
}
|
||
|
||
function excelReadFunc(excelFileName){
|
||
$.ajax({
|
||
url:'./coding_confirm_excelRead.asp',
|
||
data:{"excelName" : encodeURIComponent(excelFileName)},
|
||
type:'POST',
|
||
success:function(resJson){
|
||
excelResValSetting(eval(resJson));
|
||
$("#confirm_btn").css("display", "");
|
||
}
|
||
});
|
||
}
|
||
|
||
function selectPrj(p_child_sn, p_subject){
|
||
$("#p_child_sn").val(p_child_sn);
|
||
$("#p_subject").val("["+p_child_sn+"]"+p_subject);
|
||
regPrjDialog.dialog("close");
|
||
}
|
||
|
||
function excelResValSetting(resJson){
|
||
uploadCancel();
|
||
$("#resTb").css("display", "");
|
||
var coderIDs = $.unique(resJson.map(function(obj){ return obj.coderID }).sort()).join(",");
|
||
$.ajax({
|
||
url:'./manJson.asp',
|
||
data:{"mans" : coderIDs},
|
||
type:'POST',
|
||
async:false,
|
||
success:function(coderJson){
|
||
coderJsonArr = eval(coderJson);
|
||
}
|
||
});
|
||
$.each(resJson, function(idx, obj){
|
||
var coderInfo = $.grep(coderJsonArr, function(v, i){ return v.id == obj.coderID; })[0];
|
||
if(obj.unitPay * 1 > 0){
|
||
$("#resTb tbody").append("<tr>"+
|
||
"<td class='tit7'>" + obj.qusNo + "</td>"+
|
||
"<td class='tit7'><input type='hidden' name='firstCount' value='" + obj.firstCount + "'/>" + commify(obj.firstCount) + " <input type='checkbox' name='firstChk' value='fir' /></td>"+
|
||
"<td class='tit7'><input type='hidden' name='totalCount' value='" + obj.totalCount + "'/>" + commify(obj.totalCount) + " <input type='checkbox' name='allChk' value='all' /></td>"+
|
||
"<td class='tit7'><input type='hidden' name='unitPay' value='" + obj.unitPay + "'/>" + commify(obj.unitPay) + "</td>"+
|
||
"<td class='tit7'><input type='text' name='calcPay' value='0' tabindex='-1' readOnly /></td>"+
|
||
"<td class='tit7'><input type='hidden' name='coderID' value='" + obj.coderID + "'/>[" + obj.coderID + "] " + coderInfo.name + "(" + coderInfo.birth + ")</td>"+
|
||
"</tr>");
|
||
}
|
||
});
|
||
$("#loadingBar").hide();
|
||
}
|
||
</script>
|
||
</div>
|
||
<!-- /.content-wrapper -->
|
||
<!-- #include virtual = "include/footer.asp" --> |