ปรับปรุงหน้าจอ ประวัติการแก้ไข

This commit is contained in:
LAPTOP-KB8JC2K2\acer
2021-09-11 15:00:56 +07:00
parent fdb09a2427
commit 656d991f07
13 changed files with 1143 additions and 19 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,22 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace tb320eva.Migrations
{
public partial class AddHistoryField : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "history_group",
table: "eva_create_evaluation_detail_history",
nullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "history_group",
table: "eva_create_evaluation_detail_history");
}
}
}

View File

@@ -427,6 +427,8 @@ namespace tb320eva.Migrations
b.Property<int?>("evaluation_detail_id");
b.Property<int?>("history_group");
b.Property<bool>("isActive");
b.Property<DateTime>("updated");

View File

@@ -85,7 +85,7 @@ namespace TodoAPI2.Models
{
if (!string.IsNullOrEmpty(s))
{
return ("<br/><a href='javascript:window_open({0}../eva_create_evaluation_detail_historyView/eva_create_evaluation_detail_history?id=" + id.ToString() + "{0});'>ดูประวัติ</a>").Replace("{0}", '"'.ToString());
return ("<br/><a href='javascript:openHistory({0}../eva_create_evaluation_detail_historyView/eva_create_evaluation_detail_history?id=" + id.ToString() + "{0});'>ดูประวัติ</a>").Replace("{0}", '"'.ToString());
}
return "";
}

View File

@@ -27,8 +27,10 @@ namespace TodoAPI2.Models
public int? action_emp_id { get; set; }
public int? history_group { get; set; } // 1 = ข้อตกลง ,2 = การประเมินจริง
public void SetAutoField(DataContext context)
public void SetAutoField(DataContext context)
{
}

View File

@@ -18,6 +18,8 @@ namespace TodoAPI2.Models
public int? evaluation_detail_id { get; set; }
public int? history_group { get; set; }
}
}

View File

@@ -115,7 +115,8 @@ namespace TodoAPI2.Models
where
1 == 1
&& (!model.evaluation_detail_id.HasValue || m_eva_create_evaluation_detail_history.evaluation_detail_id == model.evaluation_detail_id)
&& m_eva_create_evaluation_detail_history.evaluation_detail_id == model.evaluation_detail_id
&& model.history_group == m_eva_create_evaluation_detail_history.history_group
orderby m_eva_create_evaluation_detail_history.action_dt
select new eva_create_evaluation_detail_historyViewModel()

View File

@@ -18,7 +18,7 @@ namespace TodoAPI2.Models
public DateTime? action_dt { get; set; }
public string txt_action_dt { get { return MyHelper.GetDateStringForReport(this.action_dt); } }
public string txt_action_dt { get { return MyHelper.GetDateStringForReport(this.action_dt) + " " + MyHelper.GetTimeStringFromDate(this.action_dt); } }
public string action_detail { get; set; }

View File

@@ -97,7 +97,7 @@ namespace TodoAPI2.Models
{
if (!string.IsNullOrEmpty(s))
{
return ("<br/><a href='javascript:window_open({0}../eva_create_evaluation_detail_historyView/eva_create_evaluation_detail_history?id=" + id.ToString() + "{0});'>ดูประวัติ</a>").Replace("{0}", '"'.ToString());
return ("<br/><a href='javascript:openHistory({0}../eva_create_evaluation_detail_historyView/eva_create_evaluation_detail_history?id=" + id.ToString() + "{0});'>ดูประวัติ</a>").Replace("{0}", '"'.ToString());
}
return "";
}

View File

@@ -162,7 +162,7 @@ namespace TodoAPI2.Models
return Get(inserted.id);
}
private void add_history(DateTime? dt, string action, int? action_user_id, int? detail_id)
private void add_history(DateTime? dt, string action, int? action_user_id, int? detail_id, int? group)
{
int? newkey = 0;
@@ -181,6 +181,7 @@ namespace TodoAPI2.Models
n.action_dt = dt;
n.action_emp_id = action_user_id;
n.evaluation_detail_id = detail_id;
n.history_group = group;
_repository.Context.Add(n);
}
@@ -225,7 +226,7 @@ namespace TodoAPI2.Models
noti_to_employee_id = existingEntity.chief;
noti_message = "กรุณาตรวจสอบ ข้อตกลงการประเมิน ของ {0}";
noti_url = "/eva/eva_create_evaluation_detail_firstdocView/eva_create_evaluation_detail_firstdoc_d?id=" + existingEntity.id.ToString();
add_history(DateTime.Now, "ส่งข้อตกลงการประเมิน", model.employee_id, existingEntity.id);
add_history(DateTime.Now, "ส่งข้อตกลงการประเมิน", model.employee_id, existingEntity.id, 1);
}
else if (model.status_mode == "backB")
{
@@ -234,7 +235,7 @@ namespace TodoAPI2.Models
noti_to_employee_id = existingEntity.employee_id;
noti_message = "ข้อตกลงการประเมินของคุณ ({0}) ถูกตีกลับ";
noti_url = "/eva/eva_create_evaluation_detail_firstdocView/eva_create_evaluation_detail_firstdoc_d?id=" + existingEntity.id.ToString();
add_history(DateTime.Now, "ข้อตกลงการประเมิน ถูกตีกลับ", model.employee_id, existingEntity.id);
add_history(DateTime.Now, "ข้อตกลงการประเมิน ถูกตีกลับ", model.employee_id, existingEntity.id, 1);
}
else if (model.status_mode == "nextB")
{
@@ -248,7 +249,7 @@ namespace TodoAPI2.Models
noti_to_employee_id = current_eva.employee_id;
}
need_noti = false;
add_history(DateTime.Now, "อนุมัติ ข้อตกลงการประเมิน", existingEntity.chief, existingEntity.id);
add_history(DateTime.Now, "อนุมัติ ข้อตกลงการประเมิน", existingEntity.chief, existingEntity.id, 1);
}
else if (model.status_mode == "next0")
{
@@ -260,7 +261,7 @@ namespace TodoAPI2.Models
noti_to_employee_id2 = owner_eva_employee_id;
noti_message2 = "แบบประเมินของ {0} ได้ถูกส่งต่อไปยังขั้นตอนถัดไปแล้ว";
noti_url2 = "/eva/eva_create_evaluation_detail_processView/eva_create_evaluation_detail_process_d?id=" + existingEntity.id.ToString();
add_history(DateTime.Now, "ส่งแบบประเมิน", model.employee_id, existingEntity.id);
add_history(DateTime.Now, "ส่งแบบประเมิน", model.employee_id, existingEntity.id, 2);
}
else if (model.status_mode == "next1")
{
@@ -279,9 +280,9 @@ namespace TodoAPI2.Models
existingEntity.status_chief_click_date = DateTime.Now;
existingEntity.status_self_click_date = null;
noti_to_employee_id = existingEntity.employee_id;
noti_message = "ข้อตกลงการประเมินของคุณ ({0}) ถูกตีกลับ";
noti_message = "แบบประเมินของคุณ ({0}) ถูกตีกลับ";
noti_url = "/eva/eva_create_evaluation_detail_agreementView/eva_create_evaluation_detail_agreement_d?id=" + existingEntity.id.ToString();
add_history(DateTime.Now, "ข้อตกลงการประเมิน ถูกตีกลับ โดยผู้ประเมิน", model.employee_id, existingEntity.id);
add_history(DateTime.Now, "ข้อตกลงการประเมิน ถูกตีกลับ โดยผู้ประเมิน", model.employee_id, existingEntity.id, 2);
}
else if (model.status_mode == "next2")
{
@@ -291,7 +292,7 @@ namespace TodoAPI2.Models
noti_to_employee_id2 = owner_eva_employee_id;
noti_message2 = "แบบประเมินของ {0} ได้ถูกส่งต่อไปยังขั้นตอนถัดไปแล้ว";
noti_url2 = "/eva/eva_create_evaluation_detail_processView/eva_create_evaluation_detail_process_d?id=" + existingEntity.id.ToString();
add_history(DateTime.Now, "ผู้ประเมินสูงสุด อนุมัติแบบประเมินแล้ว", model.employee_id, existingEntity.id);
add_history(DateTime.Now, "ผู้ประเมินสูงสุด อนุมัติแบบประเมินแล้ว", model.employee_id, existingEntity.id, 2);
}
else if (model.status_mode == "back2")
{
@@ -300,7 +301,7 @@ namespace TodoAPI2.Models
noti_to_employee_id = existingEntity.chief;
noti_message = "แบบประเมินของ {0} ถูกตีกลับ";
noti_url = "/eva/eva_create_evaluation_detail_agreementView/eva_create_evaluation_detail_agreement_d?id=" + existingEntity.id.ToString();
add_history(DateTime.Now, "แบบประเมิน ถูกตีกลับ โดยผู้ประเมินสูงสุด", model.employee_id, existingEntity.id);
add_history(DateTime.Now, "แบบประเมิน ถูกตีกลับ โดยผู้ประเมินสูงสุด", model.employee_id, existingEntity.id, 2);
}
else if (model.status_mode == "next3")
{
@@ -310,7 +311,7 @@ namespace TodoAPI2.Models
noti_to_employee_id2 = owner_eva_employee_id;
noti_message2 = "แบบประเมินของ {0} ได้ถูกส่งต่อไปยังขั้นตอนถัดไปแล้ว";
noti_url2 = "/eva/eva_create_evaluation_detail_processView/eva_create_evaluation_detail_process_d?id=" + existingEntity.id.ToString();
add_history(DateTime.Now, "ผู้บังคับบัญชาการเหนือขึ้นไปอีกชั้นหนึ่ง อนุมัติแบบประเมินแล้ว", model.employee_id, existingEntity.id);
add_history(DateTime.Now, "ผู้บังคับบัญชาการเหนือขึ้นไปอีกชั้นหนึ่ง อนุมัติแบบประเมินแล้ว", model.employee_id, existingEntity.id, 2);
}
else if (model.status_mode == "back3")
{
@@ -319,7 +320,7 @@ namespace TodoAPI2.Models
noti_to_employee_id = current_eva.employee_id;
noti_message = "แบบประเมินของ {0} ถูกตีกลับ";
noti_url = "/eva/eva_create_evaluation_detail_agreementView/eva_create_evaluation_detail_agreement_d2?id=" + existingEntity.id.ToString();
add_history(DateTime.Now, "แบบประเมินถูกตีกลับ โดย ผู้บังคับบัญชาการเหนือขึ้นไปอีกชั้นหนึ่ง", model.employee_id, existingEntity.id);
add_history(DateTime.Now, "แบบประเมินถูกตีกลับ โดย ผู้บังคับบัญชาการเหนือขึ้นไปอีกชั้นหนึ่ง", model.employee_id, existingEntity.id, 2);
}
else if (model.status_mode == "next4")
{
@@ -328,7 +329,7 @@ namespace TodoAPI2.Models
noti_to_employee_id2 = owner_eva_employee_id;
noti_message2 = "แบบประเมินของ {0} ได้รับการประเมินเรียบร้อยแล้ว";
noti_url2 = "/eva/eva_create_evaluation_detail_processView/eva_create_evaluation_detail_process_d?id=" + existingEntity.id.ToString();
add_history(DateTime.Now, "ผู้บังคับบัญชาการเหนือขึ้นไปอีกชั้นหนึ่ง (สูงสุด) อนุมัติแบบประเมินแล้ว", model.employee_id, existingEntity.id);
add_history(DateTime.Now, "ผู้บังคับบัญชาการเหนือขึ้นไปอีกชั้นหนึ่ง (สูงสุด) อนุมัติแบบประเมินแล้ว", model.employee_id, existingEntity.id, 2);
}
else if (model.status_mode == "back4")
{
@@ -337,7 +338,7 @@ namespace TodoAPI2.Models
noti_to_employee_id = current_eva.supervisor1_id;
noti_message = "แบบประเมินของ {0} ถูกตีกลับ";
noti_url = "/eva/eva_create_evaluation_detail_agreementView/eva_create_evaluation_detail_agreement_d2?id=" + existingEntity.id.ToString();
add_history(DateTime.Now, "แบบประเมินถูกตีกลับ โดย ผู้บังคับบัญชาการเหนือขึ้นไปอีกชั้นหนึ่ง (สูงสุด)", model.employee_id, existingEntity.id);
add_history(DateTime.Now, "แบบประเมินถูกตีกลับ โดย ผู้บังคับบัญชาการเหนือขึ้นไปอีกชั้นหนึ่ง (สูงสุด)", model.employee_id, existingEntity.id, 2);
}
if (need_noti)

View File

@@ -122,6 +122,10 @@ function eva_create_evaluation_detail_firstdoc_RefreshTable() {
//window.parent.eva_create_evaluation_detail_firstdoc_DoSearch();
}
function openHistory(s) {
window_open(s + "&history_group=1");
}
//================= Update and Delete =========================================
var eva_create_evaluation_detail_firstdoc_customValidation = function (group) {

View File

@@ -6,6 +6,7 @@ var eva_create_evaluation_detail_history_API = "/api/eva_create_evaluation_detai
function eva_create_evaluation_detail_history_GetSearchParameter() {
var eva_create_evaluation_detail_historySearchObject = new Object();
eva_create_evaluation_detail_historySearchObject.evaluation_detail_id = getUrlParameter("id");
eva_create_evaluation_detail_historySearchObject.history_group = getUrlParameter("history_group");
return eva_create_evaluation_detail_historySearchObject;
}
@@ -22,7 +23,6 @@ function eva_create_evaluation_detail_history_FeedDataToForm(data) {
$("#eva_create_evaluation_detail_history_evaluation_detail_id").val(data.evaluation_detail_id);
$("#eva_create_evaluation_detail_history_action_dt").val(formatDate(data.action_dt));
$("#eva_create_evaluation_detail_history_action_detail").val(data.action_detail);
//DropDownClearFormAndFeedWithData($("#eva_create_evaluation_detail_history_action_emp_id"), data, "id", "employee_type", "item_action_emp_id", data.action_emp_id);
}

View File

@@ -124,6 +124,10 @@ function eva_create_evaluation_detail_process_RefreshTable() {
//window.parent.eva_create_evaluation_detail_process_DoSearch();
}
function openHistory(s) {
window_open(s+"&history_group=2");
}
//================= Update and Delete =========================================
var eva_create_evaluation_detail_process_customValidation = function (group) {