ปรับปรุงให้แก้ไขแบบ inline

This commit is contained in:
LAPTOP-KB8JC2K2\acer
2021-04-11 13:20:11 +07:00
parent 8d1bc4cc34
commit 74a02a8657
5 changed files with 185 additions and 22 deletions

Binary file not shown.

View File

@@ -239,14 +239,15 @@ namespace TodoAPI2.Models
throw new Exception("ผู้รับการประเมิน ส่งแบบประเมินไปแล้ว บันทึกไม่ได้");
}
existingEntity.create_evaluation_detail_id = i.create_evaluation_detail_id;
existingEntity.behavior = i.behavior;
existingEntity.weight = i.weight;
existingEntity.target_score1 = i.target_score1;
existingEntity.target_score2 = i.target_score2;
existingEntity.target_score3 = i.target_score3;
existingEntity.target_score4 = i.target_score4;
existingEntity.target_score5 = i.target_score5;
//existingEntity.create_evaluation_detail_id = i.create_evaluation_detail_id;
//existingEntity.behavior = i.behavior;
//existingEntity.target_score1 = i.target_score1;
//existingEntity.target_score2 = i.target_score2;
//existingEntity.target_score3 = i.target_score3;
//existingEntity.target_score4 = i.target_score4;
//existingEntity.target_score5 = i.target_score5;
_repository.UpdateWithoutCommit(i.id.Value, existingEntity);
}

View File

@@ -312,9 +312,9 @@
<table id="eva_evaluation_achievementTable" class="display table table-bordered table-striped">
<thead>
<tr>
<th>เครื่องมือ</th>
<th width="70%"><label id='h_eva_evaluation_achievement_achievement'>ผลสัมฤทธิ์ตัวชี้วัดผลงาน</label></th>
<th><label id='h_eva_evaluation_achievement_weight'>น้ำหนัก</label></th>
<th width="100">เครื่องมือ</th>
<th><label id='h_eva_evaluation_achievement_achievement'>ผลสัมฤทธิ์ตัวชี้วัดผลงาน</label></th>
<th width="200"><label id='h_eva_evaluation_achievement_weight'>น้ำหนัก</label></th>
<th style="display:none;"><label id='h_eva_evaluation_achievement_target_score1'>1</label></th>
<th style="display:none;"><label id='h_eva_evaluation_achievement_target_score2'>2</label></th>
<th style="display:none;"><label id='h_eva_evaluation_achievement_target_score3'>3</label></th>
@@ -343,28 +343,31 @@
<br />
<section class="wrapper">
<div class="title col-md-12"><div class="line"></div>พฤติกรรมการปฏิบัติงาน (น้ำหนัก <span id="eva_create_evaluation_detail_agreement_score2"></span>%)</div>
<table id="eva_evaluation_behaviorTable" class="display table table-bordered table-striped">
<thead>
<tr>
<th>เครื่องมือ</th>
<th style="display:none;">ลำดับ</th>
<th><label id='h_eva_evaluation_behavior_behavior'>พฤติกรรมการปฏิบัติงาน</label></th>
<th><label id='h_eva_evaluation_achievement_weight'>น้ำหนัก</label></th>
<th width="200"><label id='h_eva_evaluation_behavior_weight'>น้ำหนัก</label></th>
</tr>
</thead>
<tbody></tbody>
<tbody class="thin-border-bottom" id="eva_evaluation_behaviorBody"></tbody>
<tfoot>
<tr>
<th></th>
<th style="display:none;"></th>
<th>รวมน้ำหนัก</th>
<th><span id="sum_weight_eva_evaluation_behavior"></span></th>
</tr>
</tfoot>
</table>
</section>
<p style="display:none;" id="sum_b"></p>
<br />
<br/>
<section class="wrapper">
@@ -410,7 +413,7 @@
<div class="row">
<div class="form-group col-md-12">
<button type="button" class="btn btn-danger" onclick="javascript:window_close()"><i class="fa fa-repeat"></i> กลับ</button>
<button type="button" class="btn btn-submit status_self" onclick="javascript:alert('บันทึกเรียบร้อย')">บันทึก</button>
<button type="button" class="btn btn-submit status_self" onclick="javascript:eva_evaluation_behavior_Save(getUrlParameter('id'))">บันทึก</button>
<button class="btn btn-secondary" onclick="javascript:print_report();">พิมพ์แบบประเมิน</button>
@@ -426,6 +429,7 @@
<script src="~/js/eva_create_evaluation_detail_agreement/eva_create_evaluation_detail_agreement_d.js?version=@MyHelper.GetDummyText()"></script>
<script src="~/js/eva_evaluation_achievement/eva_evaluation_achievement.js?version=@MyHelper.GetDummyText()"></script>
<script src="~/js/eva_evaluation_behavior/eva_evaluation_behavior.js?version=@MyHelper.GetDummyText()"></script>
<script src="~/js/eva_evaluation_behavior/eva_evaluation_behavior_inline.js?version=@MyHelper.GetDummyText()"></script>
<script src="~/js/eva_create_evaluation_detail_status/eva_create_evaluation_detail_status_d.js?version=@MyHelper.GetDummyText()"></script>
<script src="~/js/eva_idp_plan_owner/eva_idp_plan_owner.js?version=@MyHelper.GetDummyText()"></script>
<script src="~/js/rep_eva_x/rep_eva_x_report.js?version=@MyHelper.GetDummyText()"></script>
@@ -439,8 +443,7 @@
eva_create_evaluation_detail_agreement_SetEditForm(id);
eva_evaluation_achievement_InitiateDataTable(id);
eva_evaluation_achievement_InitialForm();
eva_evaluation_behavior_InitiateDataTable(id);
eva_evaluation_behavior_InitialForm();
eva_evaluation_behavior_InitialForm(id);
eva_create_evaluation_detail_status_SetEditForm(id);
eva_idp_plan_owner_InitiateDataTable(id);
eva_idp_plan_owner_InitialForm();
@@ -459,10 +462,11 @@
});
function CheckPermission() {
if (status_self === "Y") {
$(".status_self").hide();
$("#status").text("คุณส่งแบบประเมินไปแล้ว");
}
//if (status_self === "Y") {
// $(".status_self").hide();
// $(".status_self_text").attr("disabled", true);
// $("#status").text("คุณส่งแบบประเมินไปแล้ว");
//}
}
function OnWeightChanged(c) {
@@ -482,6 +486,17 @@
}
}
function cal_behavior_total() {
var w1 = 0;
$('#eva_evaluation_behaviorBody tr').each(function () {
var i = $(this).find("#rowCount").text();
var eva_evaluation_behavior = eva_evaluation_behavior_GetFromForm($(this), i);
w1 += parseFloat(eva_evaluation_behavior.weight);
});
$("#sum_weight_eva_evaluation_behavior").text(w1);
//console.log(w1);
}
function print_report() {
var eva_create_evaluation_detail_selectitem = [];
eva_create_evaluation_detail_selectitem.push(getUrlParameter("id"));

View File

@@ -69,6 +69,11 @@
<Folder Include="Seed\" CopyToOutputDirectory="Always" />
<None Include="Views\eva_create_evaluation_detail_firstdocView\eva_create_evaluation_detail_firstdoc.cshtml" />
<None Include="Views\eva_create_evaluation_detail_firstdocView\eva_create_evaluation_detail_firstdoc_d.cshtml" />
<None Include="Views\eva_evaluation_behaviorView\eva_evaluation_behavior.cshtml" />
<None Include="Views\eva_evaluation_behaviorView\eva_evaluation_behavior_d.cshtml" />
<None Include="Views\eva_evaluation_behaviorView\eva_evaluation_behavior_inline.cshtml" />
<None Include="Views\eva_evaluation_behaviorView\eva_evaluation_behavior_report.cshtml" />
<None Include="Views\eva_evaluation_behaviorView\eva_evaluation_behavior_wizardform.cshtml" />
<None Include="Views\eva_evaluation_operating_agreementView\eva_evaluation_operating_agreement.cshtml" />
<None Include="Views\eva_limit_frame_groupView\eva_limit_frame_group.cshtml" />
<None Include="Views\eva_limit_frame_groupView\eva_limit_frame_group_d.cshtml" />

View File

@@ -0,0 +1,142 @@
function eva_evaluation_behavior_ClearForm(i, blankItem) {
var data = blankItem;
$("#eva_evaluation_behavior_id_" + i).val("");
$("#eva_evaluation_behavior_create_evaluation_detail_id_" + i).val("");
$("#eva_evaluation_behavior_behavior_" + i).text("");
$("#eva_evaluation_behavior_weight_" + i).val("");
$("#eva_evaluation_behavior_score_" + i).val("");
$("#eva_evaluation_behavior_score2_" + i).val("");
$("#eva_evaluation_behavior_sumary_" + i).text("");
$("#eva_evaluation_behavior_sumary2_" + i).text("");
$("#eva_evaluation_behavior_target_score1_" + i).val("");
$("#eva_evaluation_behavior_target_score2_" + i).val("");
$("#eva_evaluation_behavior_target_score3_" + i).val("");
$("#eva_evaluation_behavior_target_score4_" + i).val("");
$("#eva_evaluation_behavior_target_score5_" + i).val("");
}
function eva_evaluation_behavior_FeedDataToForm(data, i, blankItem) {
$("#eva_evaluation_behavior_id_" + i).val(data.id);
$("#eva_evaluation_behavior_create_evaluation_detail_id_" + i).val(data.create_evaluation_detail_id);
$("#eva_evaluation_behavior_behavior_" + i).text(data.behavior);
$("#eva_evaluation_behavior_weight_" + i).val(data.weight);
$("#eva_evaluation_behavior_score_" + i).val(data.score);
$("#eva_evaluation_behavior_score2_" + i).val(data.score2);
$("#eva_evaluation_behavior_sumary_" + i).text(data.sumary);
$("#eva_evaluation_behavior_sumary2_" + i).text(data.sumary2);
$("#eva_evaluation_behavior_target_score1_" + i).val(data.target_score1);
$("#eva_evaluation_behavior_target_score2_" + i).val(data.target_score2);
$("#eva_evaluation_behavior_target_score3_" + i).val(data.target_score3);
$("#eva_evaluation_behavior_target_score4_" + i).val(data.target_score4);
$("#eva_evaluation_behavior_target_score5_" + i).val(data.target_score5);
}
function eva_evaluation_behavior_GetFromForm(obj, i) {
var eva_evaluation_behaviorObject = new Object();
eva_evaluation_behaviorObject.id = obj.find("#eva_evaluation_behavior_id_" + i).val();
eva_evaluation_behaviorObject.create_evaluation_detail_id = obj.find("#eva_evaluation_behavior_create_evaluation_detail_id_" + i).val();
eva_evaluation_behaviorObject.behavior = obj.find("#eva_evaluation_behavior_behavior_" + i).text();
eva_evaluation_behaviorObject.weight = obj.find("#eva_evaluation_behavior_weight_" + i).val();
eva_evaluation_behaviorObject.score = obj.find("#eva_evaluation_behavior_score_" + i).val();
eva_evaluation_behaviorObject.score2 = obj.find("#eva_evaluation_behavior_score2_" + i).val();
eva_evaluation_behaviorObject.sumary = obj.find("#eva_evaluation_behavior_sumary_" + i).text();
eva_evaluation_behaviorObject.sumary2 = obj.find("#eva_evaluation_behavior_sumary2_" + i).text();
eva_evaluation_behaviorObject.target_score1 = obj.find("#eva_evaluation_behavior_target_score1_" + i).val();
eva_evaluation_behaviorObject.target_score2 = obj.find("#eva_evaluation_behavior_target_score2_" + i).val();
eva_evaluation_behaviorObject.target_score3 = obj.find("#eva_evaluation_behavior_target_score3_" + i).val();
eva_evaluation_behaviorObject.target_score4 = obj.find("#eva_evaluation_behavior_target_score4_" + i).val();
eva_evaluation_behaviorObject.target_score5 = obj.find("#eva_evaluation_behavior_target_score5_" + i).val();
eva_evaluation_behaviorObject.active_mode = obj.find("#isActive_" + i + "_eva_evaluation_behavior").val();
return eva_evaluation_behaviorObject;
}
function eva_evaluation_behavior_GetAllData() {
//Insert eva_evaluation_behavior List
var eva_evaluation_behavior = [];
$('#eva_evaluation_behaviorBody tr').each(function () {
var i = $(this).find("#rowCount").text();
var eacheva_evaluation_behavior = eva_evaluation_behavior_GetFromForm($(this), i);
eva_evaluation_behavior.push(eacheva_evaluation_behavior);
});
return eva_evaluation_behavior;
}
function eva_evaluation_behavior_Save(id) {
//Insert eva_evaluation_behavior List
var eva_evaluation_behavior = eva_evaluation_behavior_GetAllData();
var successFunc = function (result) {
AlertSuccess("ปรับปรุงข้อมูลเรียบร้อยแล้ว");
endLoad();
};
startLoad();
AjaxPutRequest(apisite + '/api/eva_evaluation_behavior/UpdateMultiple', eva_evaluation_behavior, successFunc, AlertDanger);
}
function eva_evaluation_behavior_Get(id, blankItem) {
$('#eva_evaluation_behaviorBody').empty();
var successFunc = function (response) {
//console.log(response);
$.each(response, function (i, data) {
var tag = '<tr>';
tag += '<td style="display:none;"><label id="rowCount">' + (i + 1) + '</label><input type="hidden" id="isActive_' + (i + 1) + '_eva_evaluation_behavior" value="1" /><input class="form-control" type="hidden" id="eva_evaluation_behavior_id_' + (i + 1) + '" /><input class="form-control" type="hidden" id="eva_evaluation_behavior_create_evaluation_detail_id_' + (i + 1) + '" /></td>';
tag += '<td><p id="eva_evaluation_behavior_behavior_' + (i + 1) + '" /></td>';
tag += '<td><input class="form-control status_self_text" onchange="javascript:cal_behavior_total();" type="number" id="eva_evaluation_behavior_weight_' + (i + 1) + '" /></td>';
tag += '</tr>';
$('#eva_evaluation_behaviorBody').append($(tag));
eva_evaluation_behavior_FeedDataToForm(data, (i + 1), blankItem);
});
eva_evaluation_behavior_Summary();
endLoad();
};
startLoad();
AjaxGetRequest(apisite + '/api/eva_evaluation_behavior?create_evaluation_detail_id=' + getUrlParameter("id"), successFunc, AlertDanger);
}
function eva_evaluation_behavior_Removeeva_evaluation_behavior(e) {
if (confirm('กรุณากดตกลง เพื่อยืนยันการลบ?')) {
$(e).closest('tr').find("input,select,textarea").attr('disabled', true);
$(e).closest('tr').find("input,select,textarea").css({ opacity: '0.5' });
$(e).hide();
$(e).closest('tr').find("#restoreBtn").show();
$(e).closest('tr').find("input").first().val("0");
console.log($(e).closest('tr').find("input").first().val());
eva_evaluation_behavior_Summary();
}
}
function eva_evaluation_behavior_Restoreeva_evaluation_behavior(e) {
if (confirm('กรุณากดตกลง เพื่อยืนยันการกู้คืน?')) {
$(e).closest('tr').find("input,select,textarea").attr('disabled', false);
$(e).closest('tr').find("input,select,textarea").css({ opacity: '1' });
$(e).hide();
$(e).closest('tr').find("#removeBtn").show();
$(e).closest('tr').find("input").first().val("1");
console.log($(e).closest('tr').find("input").first().val());
eva_evaluation_behavior_Summary();
}
}
function eva_evaluation_behavior_Summary() {
cal_behavior_total();
}
function eva_evaluation_behavior_InitialForm(id) {
var successFunc = function (result) {
eva_evaluation_behavior_Get(id, result);
endLoad();
};
startLoad();
AjaxGetRequest(apisite + "/api/eva_evaluation_behavior/" + "GetBlankItem", successFunc, AlertDanger);
}