ปรับปรุงหลายอย่าง

This commit is contained in:
nakorn
2022-03-19 11:32:56 +07:00
parent 61f067f150
commit c6d107e179
11 changed files with 2588 additions and 10 deletions

View File

@@ -17,19 +17,40 @@ function eva_create_evaluation_detail_FeedDataToSearchForm(data) {
//================= Form Data Customizaiton =========================================
function DropDownClearFormAndFeedWithDataHead(d, result, x, y, z, i) {
$(d).html('');
$(d).append($("<option></option>")
.attr("value", "")
.text("อ้างอิงตามแบบประเมิน"));
if (z !== "") {
$.each(result[z], function (key, value) {
$(d).append($("<option></option>")
.attr("value", value[x])
.text(value[y]));
});
} else {
$.each(result, function (key, value) {
$(d).append($("<option></option>")
.attr("value", value[x])
.text(value[y]));
});
}
$(d).val(i);
}
function eva_create_evaluation_detail_FeedDataToForm(data) {
$("#eva_create_evaluation_detail_id").val(data.id);
DropDownClearFormAndFeedWithData($("#eva_create_evaluation_detail_create_evaluation_id"), data, "external_id", "external_name", "item_create_evaluation_id", data.create_evaluation_id);
DropDownClearFormAndFeedWithData($("#eva_create_evaluation_detail_employee_id"), data, "id", "fullname", "item_employee_id", data.employee_id);
DropDownClearFormAndFeedWithData($("#eva_create_evaluation_detail_chief"), data, "id", "fullname", "item_chief", data.chief);
DropDownClearFormAndFeedWithData($("#eva_create_evaluation_detail_eva_employee_id"), data, "id", "fullname", "item_eva_employee_id", data.eva_employee_id);
DropDownClearFormAndFeedWithData($("#eva_create_evaluation_detail_supervisor1_id"), data, "id", "fullname", "item_supervisor1_id", data.supervisor1_id);
DropDownClearFormAndFeedWithData($("#eva_create_evaluation_detail_supervisor2_id"), data, "id", "fullname", "item_supervisor2_id", data.supervisor2_id);
DropDownClearFormAndFeedWithDataHead($("#eva_create_evaluation_detail_eva_employee_id"), data, "id", "fullname", "item_eva_employee_id", data.eva_employee_id);
DropDownClearFormAndFeedWithDataHead($("#eva_create_evaluation_detail_supervisor1_id"), data, "id", "fullname", "item_supervisor1_id", data.supervisor1_id);
DropDownClearFormAndFeedWithDataHead($("#eva_create_evaluation_detail_supervisor2_id"), data, "id", "fullname", "item_supervisor2_id", data.supervisor2_id);
$("#eva_create_evaluation_detail_work_period").val(data.work_period);
$("#eva_create_evaluation_detail_order_of_data").val(data.order_of_data);
DropDownClearFormAndFeedWithData($("#eva_create_evaluation_detail_help_org_id"), data, "id", "external_name", "item_help_org_id", data.help_org_id);
$("#eva_create_evaluation_detail_remark").val(data.remark);
DropDownClearFormAndFeedWithData($("#eva_create_evaluation_detail_supervisor3_id"), data, "id", "fullname", "item_supervisor3_id", data.supervisor3_id);
DropDownClearFormAndFeedWithDataHead($("#eva_create_evaluation_detail_supervisor3_id"), data, "id", "fullname", "item_supervisor3_id", data.supervisor3_id);
}
function eva_create_evaluation_detail_GetFromForm() {

View File

@@ -88,6 +88,10 @@ function eva_create_evaluation_detail_status_PutUpdate(a) {
else if (a === "nextB") {
data.status_chief_a = "Y";
}
else if (a === "backC") {
data.status_supervisor_a = "N";
data.status_chief_a = "";
}
else if (a === "nextC") {
data.status_supervisor_a = "Y";
}

View File

@@ -203,7 +203,7 @@ var eva_evaluation_achievement_setupTable = function (result) {
"targets": 0,
"data": "id",
"render": function (data, type, row, meta) {
return "<button type='button' class='btn btn-warning btn-sm status_self' onclick='javascript:eva_evaluation_achievement_GoEdit(" + tmp + data + tmp + ")'><i class='fa fa-pencil'></i></button> <button type='button' class='btn btn-danger btn-sm status_self' onclick='javascript:eva_evaluation_achievement_GoDelete(" + tmp + data + tmp + ")'><i class='fa fa-trash-o '></i></button> ";
return "<button type='button' class='btn btn-warning btn-sm status_self2' onclick='javascript:eva_evaluation_achievement_GoEdit(" + tmp + data + tmp + ")'><i class='fa fa-pencil'></i></button> <button type='button' class='btn btn-danger btn-sm status_self' onclick='javascript:eva_evaluation_achievement_GoDelete(" + tmp + data + tmp + ")'><i class='fa fa-trash-o '></i></button> ";
}
}, {
targets: [3, 4, 5, 6, 7],