แก้ไข op 10 ข้อ

This commit is contained in:
Nakorn Rientrakrunchai
2021-03-07 12:48:25 +07:00
parent 9530d1aa37
commit 9bac5ef7d3
23 changed files with 1567 additions and 355 deletions

View File

@@ -237,12 +237,51 @@ namespace TodoAPI2.Controllers
return BadRequest(ModelState); return BadRequest(ModelState);
} }
/// <summary>
/// reset_achievement
/// </summary>
/// <remarks>
/// </remarks>
/// <param name="id"></param>
/// <returns>Response Result Message</returns>
/// <response code="200">Response Result Message</response>
/// <response code="400">If the model is invalid</response>
/// <response code="500">Error Occurred</response>
[HttpPut("reset_achievement")]
[ProducesResponseType(typeof(CommonResponseMessage), 200)]
[ProducesResponseType(400)]
[ProducesResponseType(500)]
//[ValidateAntiForgeryToken]
public IActionResult reset_achievement(int id)
{
if (ModelState.IsValid)
{
try
{
if (!MyHelper.checkAuth(Configuration, HttpContext)) return Unauthorized();
_repository.reset_achievement(id);
var message = new CommonResponseMessage();
message.code = "200";
message.message = $"ปรับปรุงข้อมูล เรียบร้อย";
message.data = null;
return Ok(message);
}
catch (Exception ex)
{
_logger.LogCritical($"Exception while update {id.ToString()}.", ex);
return StatusCode(500, $"Exception while update {id.ToString()}. {ex.Message}");
}
}
return BadRequest(ModelState);
}
/// <summary> /// <summary>
/// Delete item /// Delete item
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// </remarks> /// </remarks>
/// <param name="id"></param> /// <param name="id"></param>
/// <returns>Response Result Message</returns> /// <returns>Response Result Message</returns>
/// <response code="200">Response Result Message</response> /// <response code="200">Response Result Message</response>
/// <response code="400">If the model is invalid</response> /// <response code="400">If the model is invalid</response>

View File

@@ -216,6 +216,26 @@ namespace TodoAPI2.Controllers
} }
reader.Close(); reader.Close();
if(model.is_print_22 == 1)
{
rep_eva_p01ReportRequestModel model2 = new rep_eva_p01ReportRequestModel();
model2.filetype = model.filetype;
model2.detail_id = k;
var data2x = GetReportP01(model2);
PdfReader reader2 = new PdfReader(data2x);
reader2.ConsolidateNamedDestinations();
for (int i = 1; i <= reader2.NumberOfPages; i++)
{
PdfImportedPage page = writer.GetImportedPage(reader2, i);
writer.AddPage(page);
}
reader2.Close();
}
} }
writer.Close(); writer.Close();

View File

@@ -0,0 +1,922 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using TTSW.EF;
namespace tb320eva.Migrations
{
[DbContext(typeof(DataContext))]
[Migration("25640307042106_IncreaseFieldSize")]
partial class IncreaseFieldSize
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn)
.HasAnnotation("ProductVersion", "2.2.4-servicing-10062")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
modelBuilder.Entity("TodoAPI2.Models.eva_adjust_postponementEntity", b =>
{
b.Property<int>("id");
b.Property<string>("command_no")
.HasMaxLength(4000);
b.Property<int?>("create_evaluation_id");
b.Property<DateTime>("created");
b.Property<int?>("fiscal_year");
b.Property<DateTime?>("imported_date");
b.Property<string>("imported_file")
.HasMaxLength(1000);
b.Property<bool>("isActive");
b.Property<decimal?>("limit");
b.Property<decimal?>("limit_frame");
b.Property<decimal?>("limit_frame_quota");
b.Property<decimal?>("limit_quota");
b.Property<int?>("managed_by");
b.Property<decimal?>("percentage");
b.Property<string>("report_type")
.HasMaxLength(1000);
b.Property<DateTime?>("theDate");
b.Property<int?>("theRound");
b.Property<DateTime>("updated");
b.HasKey("id");
b.HasIndex("create_evaluation_id");
b.ToTable("eva_adjust_postponement");
});
modelBuilder.Entity("TodoAPI2.Models.eva_adjust_postponement_detailEntity", b =>
{
b.Property<int>("id");
b.Property<int?>("adjust_postponement_id");
b.Property<int?>("adjust_postponement_quota_id");
b.Property<decimal?>("cost_living");
b.Property<DateTime>("created");
b.Property<int?>("employee_id");
b.Property<bool>("isActive");
b.Property<string>("level_this_time")
.HasMaxLength(1000);
b.Property<decimal?>("middle");
b.Property<string>("migration_eva_result")
.HasMaxLength(1000);
b.Property<decimal?>("migration_total_score");
b.Property<decimal?>("new_cost_living");
b.Property<decimal?>("new_sarary");
b.Property<decimal?>("new_sarary_with_quota");
b.Property<int?>("order_at_this_time");
b.Property<int?>("org_at_this_time");
b.Property<decimal?>("other_money_at_this_time");
b.Property<decimal?>("position_allowance_at_this_time");
b.Property<string>("position_this_time")
.HasMaxLength(1000);
b.Property<decimal?>("promoted_percentage");
b.Property<decimal?>("receive_quota");
b.Property<string>("remark")
.HasMaxLength(1000);
b.Property<decimal?>("sarary");
b.Property<decimal?>("total_promote");
b.Property<DateTime>("updated");
b.HasKey("id");
b.HasIndex("adjust_postponement_id");
b.HasIndex("adjust_postponement_quota_id");
b.ToTable("eva_adjust_postponement_detail");
});
modelBuilder.Entity("TodoAPI2.Models.eva_create_evaluationEntity", b =>
{
b.Property<int>("id");
b.Property<DateTime>("created");
b.Property<int?>("employee_id");
b.Property<Guid?>("evaluation_group_id");
b.Property<bool>("isActive");
b.Property<Guid?>("performance_plan_id");
b.Property<decimal?>("score1");
b.Property<decimal?>("score2");
b.Property<int?>("supervisor1_id");
b.Property<int?>("supervisor2_id");
b.Property<DateTime>("updated");
b.HasKey("id");
b.HasIndex("evaluation_group_id");
b.HasIndex("performance_plan_id");
b.ToTable("eva_create_evaluation");
});
modelBuilder.Entity("TodoAPI2.Models.eva_create_evaluation_detailEntity", b =>
{
b.Property<int>("id");
b.Property<decimal?>("Final_summary_chief");
b.Property<decimal?>("Final_summary_competency_chief");
b.Property<decimal?>("Final_summary_competency_supervisor");
b.Property<decimal?>("Final_summary_competency_supervisor1A");
b.Property<decimal?>("Final_summary_competency_supervisor2A");
b.Property<decimal?>("Final_summary_supervisor");
b.Property<decimal?>("Final_summary_supervisor1A");
b.Property<decimal?>("Final_summary_supervisor2A");
b.Property<decimal?>("achievement_chief");
b.Property<decimal?>("achievement_supervisor");
b.Property<decimal?>("achievement_supervisor1A");
b.Property<decimal?>("achievement_supervisor2A");
b.Property<int?>("chief");
b.Property<int?>("chief_a");
b.Property<DateTime?>("chief_a_date");
b.Property<string>("chief_a_reject_reason")
.HasMaxLength(1000);
b.Property<string>("chief_a_remark")
.HasMaxLength(1000);
b.Property<string>("chief_a_result")
.HasMaxLength(1);
b.Property<decimal?>("competency_chief");
b.Property<decimal?>("competency_supervisor");
b.Property<decimal?>("competency_supervisor1A");
b.Property<decimal?>("competency_supervisor2A");
b.Property<int?>("create_evaluation_id");
b.Property<DateTime>("created");
b.Property<int?>("employee_id");
b.Property<bool>("isActive");
b.Property<string>("level_score_chief")
.HasMaxLength(255);
b.Property<string>("level_score_supervisor")
.HasMaxLength(255);
b.Property<string>("level_score_supervisor1A")
.HasMaxLength(255);
b.Property<string>("level_score_supervisor2A")
.HasMaxLength(255);
b.Property<decimal?>("score_chief");
b.Property<decimal?>("score_supervisor");
b.Property<decimal?>("score_supervisor1A");
b.Property<decimal?>("score_supervisor2A");
b.Property<string>("status_chief")
.HasMaxLength(1);
b.Property<string>("status_chief_a")
.HasMaxLength(1);
b.Property<DateTime?>("status_chief_a_click_date");
b.Property<DateTime?>("status_chief_click_date");
b.Property<string>("status_self")
.HasMaxLength(1);
b.Property<string>("status_self_a")
.HasMaxLength(1);
b.Property<DateTime?>("status_self_a_click_date");
b.Property<DateTime?>("status_self_click_date");
b.Property<string>("status_supervisor")
.HasMaxLength(1);
b.Property<string>("status_supervisor1A")
.HasMaxLength(1);
b.Property<DateTime?>("status_supervisor1A_click_date");
b.Property<string>("status_supervisor2A")
.HasMaxLength(1);
b.Property<DateTime?>("status_supervisor2A_click_date");
b.Property<DateTime?>("status_supervisor_click_date");
b.Property<int?>("supervisor1");
b.Property<int?>("supervisor1A");
b.Property<DateTime?>("supervisor1A_date");
b.Property<string>("supervisor1A_remark")
.HasMaxLength(1000);
b.Property<string>("supervisor1A_result")
.HasMaxLength(1);
b.Property<DateTime?>("supervisor1_date");
b.Property<string>("supervisor1_remark")
.HasMaxLength(1000);
b.Property<string>("supervisor1_result")
.HasMaxLength(1);
b.Property<int?>("supervisor2");
b.Property<int?>("supervisor2A");
b.Property<DateTime?>("supervisor2A_date");
b.Property<string>("supervisor2A_remark")
.HasMaxLength(1000);
b.Property<string>("supervisor2A_result")
.HasMaxLength(1);
b.Property<DateTime?>("supervisor2_date");
b.Property<string>("supervisor2_remark")
.HasMaxLength(1000);
b.Property<string>("supervisor2_result")
.HasMaxLength(1);
b.Property<decimal?>("total_summary_chief");
b.Property<decimal?>("total_summary_competency_chief");
b.Property<decimal?>("total_summary_competency_supervisor");
b.Property<decimal?>("total_summary_competency_supervisor1A");
b.Property<decimal?>("total_summary_competency_supervisor2A");
b.Property<decimal?>("total_summary_supervisor");
b.Property<decimal?>("total_summary_supervisor1A");
b.Property<decimal?>("total_summary_supervisor2A");
b.Property<DateTime>("updated");
b.HasKey("id");
b.ToTable("eva_create_evaluation_detail");
});
modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_achievementEntity", b =>
{
b.Property<int>("id");
b.Property<string>("achievement")
.HasMaxLength(3000);
b.Property<int?>("create_evaluation_detail_id");
b.Property<DateTime>("created");
b.Property<bool>("isActive");
b.Property<decimal?>("score");
b.Property<decimal?>("score2");
b.Property<decimal?>("score3");
b.Property<decimal?>("score4");
b.Property<decimal?>("sumary");
b.Property<decimal?>("sumary2");
b.Property<decimal?>("sumary3");
b.Property<decimal?>("sumary4");
b.Property<string>("target_score1")
.HasMaxLength(255);
b.Property<string>("target_score2")
.HasMaxLength(255);
b.Property<string>("target_score3")
.HasMaxLength(255);
b.Property<string>("target_score4")
.HasMaxLength(255);
b.Property<string>("target_score5")
.HasMaxLength(255);
b.Property<string>("thefile")
.HasMaxLength(1000);
b.Property<DateTime>("updated");
b.Property<decimal?>("weight");
b.HasKey("id");
b.HasIndex("create_evaluation_detail_id");
b.ToTable("eva_evaluation_achievement");
});
modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_behaviorEntity", b =>
{
b.Property<int>("id");
b.Property<string>("behavior")
.HasMaxLength(1000);
b.Property<int?>("create_evaluation_detail_id");
b.Property<DateTime>("created");
b.Property<bool>("isActive");
b.Property<decimal?>("score");
b.Property<decimal?>("score2");
b.Property<decimal?>("score3");
b.Property<decimal?>("score4");
b.Property<decimal?>("sumary");
b.Property<decimal?>("sumary2");
b.Property<decimal?>("sumary3");
b.Property<decimal?>("sumary4");
b.Property<string>("target_score1")
.HasMaxLength(255);
b.Property<string>("target_score2")
.HasMaxLength(255);
b.Property<string>("target_score3")
.HasMaxLength(255);
b.Property<string>("target_score4")
.HasMaxLength(255);
b.Property<string>("target_score5")
.HasMaxLength(255);
b.Property<DateTime>("updated");
b.Property<decimal?>("weight");
b.HasKey("id");
b.HasIndex("create_evaluation_detail_id");
b.ToTable("eva_evaluation_behavior");
});
modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_groupEntity", b =>
{
b.Property<Guid>("id")
.ValueGeneratedOnAdd();
b.Property<string>("code")
.HasMaxLength(255);
b.Property<DateTime>("created");
b.Property<bool>("isActive");
b.Property<string>("thegroup")
.HasMaxLength(255);
b.Property<DateTime>("updated");
b.HasKey("id");
b.ToTable("eva_evaluation_group");
});
modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_group_detailEntity", b =>
{
b.Property<Guid>("id")
.ValueGeneratedOnAdd();
b.Property<DateTime>("created");
b.Property<int?>("employee_id");
b.Property<Guid?>("evaluation_group_id");
b.Property<bool>("isActive");
b.Property<DateTime>("updated");
b.HasKey("id");
b.HasIndex("evaluation_group_id");
b.ToTable("eva_evaluation_group_detail");
});
modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_operating_agreementEntity", b =>
{
b.Property<int>("id");
b.Property<int?>("create_evaluation_detail_id");
b.Property<DateTime>("created");
b.Property<string>("indicators")
.HasMaxLength(4000);
b.Property<bool>("isActive");
b.Property<string>("mission_detail")
.HasMaxLength(4000);
b.Property<int?>("mission_no");
b.Property<string>("target")
.HasMaxLength(4000);
b.Property<DateTime>("updated");
b.HasKey("id");
b.HasIndex("create_evaluation_detail_id");
b.ToTable("eva_evaluation_operating_agreement");
});
modelBuilder.Entity("TodoAPI2.Models.eva_idp_planEntity", b =>
{
b.Property<int>("id");
b.Property<int?>("create_evaluation_detail_id");
b.Property<DateTime>("created");
b.Property<string>("develop")
.HasMaxLength(1000);
b.Property<string>("development_method")
.HasMaxLength(1000);
b.Property<DateTime?>("end_date");
b.Property<bool>("isActive");
b.Property<string>("period_text")
.HasMaxLength(1000);
b.Property<DateTime?>("start_date");
b.Property<DateTime>("updated");
b.HasKey("id");
b.ToTable("eva_idp_plan");
});
modelBuilder.Entity("TodoAPI2.Models.eva_level_scoreEntity", b =>
{
b.Property<Guid>("id")
.ValueGeneratedOnAdd();
b.Property<string>("code")
.HasMaxLength(255);
b.Property<DateTime>("created");
b.Property<string>("detail")
.HasMaxLength(1000);
b.Property<bool>("isActive");
b.Property<decimal?>("max_score");
b.Property<decimal?>("min_score");
b.Property<DateTime>("updated");
b.HasKey("id");
b.ToTable("eva_level_score");
});
modelBuilder.Entity("TodoAPI2.Models.eva_limit_frame_employeeEntity", b =>
{
b.Property<Guid>("id");
b.Property<decimal?>("cost_of_living");
b.Property<DateTime>("created");
b.Property<int?>("employee_id");
b.Property<Guid?>("frame_group_guid");
b.Property<bool>("isActive");
b.Property<string>("level_text")
.HasMaxLength(1000);
b.Property<decimal?>("monthly_remuneration");
b.Property<int?>("order_of_data");
b.Property<int?>("org_id");
b.Property<decimal?>("position_allowance");
b.Property<string>("position_text")
.HasMaxLength(1000);
b.Property<decimal?>("salary");
b.Property<DateTime>("updated");
b.HasKey("id");
b.HasIndex("frame_group_guid");
b.ToTable("eva_limit_frame_employee");
});
modelBuilder.Entity("TodoAPI2.Models.eva_limit_frame_groupEntity", b =>
{
b.Property<Guid>("id");
b.Property<DateTime>("created");
b.Property<Guid?>("frame_plan_guid");
b.Property<Guid?>("group_guid");
b.Property<bool>("isActive");
b.Property<decimal?>("limit_frame_295");
b.Property<string>("remark")
.HasMaxLength(4000);
b.Property<decimal?>("total_salary");
b.Property<decimal?>("total_salary_limit");
b.Property<decimal?>("total_salary_limit_rounded");
b.Property<DateTime>("updated");
b.HasKey("id");
b.HasIndex("frame_plan_guid");
b.HasIndex("group_guid");
b.ToTable("eva_limit_frame_group");
});
modelBuilder.Entity("TodoAPI2.Models.eva_limit_frame_planEntity", b =>
{
b.Property<Guid>("id");
b.Property<DateTime>("created");
b.Property<DateTime?>("executed_date");
b.Property<bool>("isActive");
b.Property<decimal?>("limit_frame_005");
b.Property<decimal?>("limit_frame_005_total");
b.Property<decimal?>("limit_frame_005_total_rounded");
b.Property<Guid?>("plan_guid");
b.Property<DateTime?>("salary_adjustment_date");
b.Property<string>("status_chief")
.HasMaxLength(1);
b.Property<string>("status_self")
.HasMaxLength(1);
b.Property<int?>("supervisor1");
b.Property<DateTime?>("supervisor1_date");
b.Property<string>("supervisor1_remark")
.HasMaxLength(1000);
b.Property<string>("supervisor1_result")
.HasMaxLength(1);
b.Property<decimal?>("total_salary");
b.Property<DateTime>("updated");
b.HasKey("id");
b.HasIndex("plan_guid");
b.ToTable("eva_limit_frame_plan");
});
modelBuilder.Entity("TodoAPI2.Models.eva_performance_planEntity", b =>
{
b.Property<Guid>("id")
.ValueGeneratedOnAdd();
b.Property<DateTime>("created");
b.Property<int?>("fiscal_year");
b.Property<bool>("isActive");
b.Property<int?>("theTime");
b.Property<DateTime>("updated");
b.HasKey("id");
b.ToTable("eva_performance_plan");
});
modelBuilder.Entity("TodoAPI2.Models.eva_performance_plan_detailEntity", b =>
{
b.Property<Guid>("id")
.ValueGeneratedOnAdd();
b.Property<DateTime>("created");
b.Property<DateTime?>("end_date");
b.Property<bool>("isActive");
b.Property<int?>("list_no");
b.Property<Guid?>("performance_plan_id");
b.Property<string>("remark")
.HasMaxLength(1000);
b.Property<DateTime?>("start_date");
b.Property<string>("step")
.HasMaxLength(1000);
b.Property<DateTime>("updated");
b.HasKey("id");
b.HasIndex("performance_plan_id");
b.ToTable("eva_performance_plan_detail");
});
modelBuilder.Entity("TodoAPI2.Models.eva_promoted_percentageEntity", b =>
{
b.Property<Guid>("id")
.ValueGeneratedOnAdd();
b.Property<string>("code")
.HasMaxLength(255);
b.Property<DateTime>("created");
b.Property<string>("detail")
.HasMaxLength(1000);
b.Property<bool>("isActive");
b.Property<Guid?>("level_score_id");
b.Property<decimal?>("max_score");
b.Property<decimal?>("min_score");
b.Property<decimal?>("promoted_percentage");
b.Property<DateTime>("updated");
b.HasKey("id");
b.HasIndex("level_score_id");
b.ToTable("eva_promoted_percentage");
});
modelBuilder.Entity("TodoAPI2.Models.eva_salary_cylinderEntity", b =>
{
b.Property<int>("id");
b.Property<decimal?>("cost_living");
b.Property<DateTime>("created");
b.Property<bool>("isActive");
b.Property<decimal?>("middle");
b.Property<int?>("position_level");
b.Property<int?>("position_type");
b.Property<decimal?>("temporary_min");
b.Property<decimal?>("themax");
b.Property<decimal?>("themin");
b.Property<DateTime>("updated");
b.HasKey("id");
b.ToTable("eva_salary_cylinder");
});
modelBuilder.Entity("TodoAPI2.Models.eva_adjust_postponementEntity", b =>
{
b.HasOne("TodoAPI2.Models.eva_create_evaluationEntity", "eva_create_evaluation")
.WithMany()
.HasForeignKey("create_evaluation_id");
});
modelBuilder.Entity("TodoAPI2.Models.eva_adjust_postponement_detailEntity", b =>
{
b.HasOne("TodoAPI2.Models.eva_adjust_postponementEntity", "eva_adjust_postponement")
.WithMany()
.HasForeignKey("adjust_postponement_id");
b.HasOne("TodoAPI2.Models.eva_adjust_postponementEntity", "eva_adjust_postponement_quota")
.WithMany()
.HasForeignKey("adjust_postponement_quota_id")
.HasConstraintName("FK_eva_adjust_postponement_detail_eva_adjust_postponement_adj~1");
});
modelBuilder.Entity("TodoAPI2.Models.eva_create_evaluationEntity", b =>
{
b.HasOne("TodoAPI2.Models.eva_evaluation_groupEntity", "eva_evaluation_group")
.WithMany()
.HasForeignKey("evaluation_group_id");
b.HasOne("TodoAPI2.Models.eva_performance_planEntity", "eva_performance_plan")
.WithMany()
.HasForeignKey("performance_plan_id");
});
modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_achievementEntity", b =>
{
b.HasOne("TodoAPI2.Models.eva_create_evaluation_detailEntity", "eva_create_evaluation_detail")
.WithMany()
.HasForeignKey("create_evaluation_detail_id");
});
modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_behaviorEntity", b =>
{
b.HasOne("TodoAPI2.Models.eva_create_evaluation_detailEntity", "eva_create_evaluation_detail")
.WithMany()
.HasForeignKey("create_evaluation_detail_id");
});
modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_group_detailEntity", b =>
{
b.HasOne("TodoAPI2.Models.eva_evaluation_groupEntity", "eva_evaluation_group")
.WithMany()
.HasForeignKey("evaluation_group_id");
});
modelBuilder.Entity("TodoAPI2.Models.eva_evaluation_operating_agreementEntity", b =>
{
b.HasOne("TodoAPI2.Models.eva_create_evaluation_detailEntity", "eva_create_evaluation_detail_create_evaluation_detail_id")
.WithMany()
.HasForeignKey("create_evaluation_detail_id");
});
modelBuilder.Entity("TodoAPI2.Models.eva_limit_frame_employeeEntity", b =>
{
b.HasOne("TodoAPI2.Models.eva_limit_frame_groupEntity", "eva_limit_frame_group_frame_group_guid")
.WithMany()
.HasForeignKey("frame_group_guid");
});
modelBuilder.Entity("TodoAPI2.Models.eva_limit_frame_groupEntity", b =>
{
b.HasOne("TodoAPI2.Models.eva_limit_frame_planEntity", "eva_limit_frame_plan_frame_plan_guid")
.WithMany()
.HasForeignKey("frame_plan_guid");
b.HasOne("TodoAPI2.Models.eva_evaluation_groupEntity", "eva_evaluation_group_group_guid")
.WithMany()
.HasForeignKey("group_guid");
});
modelBuilder.Entity("TodoAPI2.Models.eva_limit_frame_planEntity", b =>
{
b.HasOne("TodoAPI2.Models.eva_performance_planEntity", "eva_performance_plan_plan_guid")
.WithMany()
.HasForeignKey("plan_guid");
});
modelBuilder.Entity("TodoAPI2.Models.eva_performance_plan_detailEntity", b =>
{
b.HasOne("TodoAPI2.Models.eva_performance_planEntity", "eva_performance_plan")
.WithMany()
.HasForeignKey("performance_plan_id");
});
modelBuilder.Entity("TodoAPI2.Models.eva_promoted_percentageEntity", b =>
{
b.HasOne("TodoAPI2.Models.eva_level_scoreEntity", "eva_level_score")
.WithMany()
.HasForeignKey("level_score_id");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -0,0 +1,31 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace tb320eva.Migrations
{
public partial class IncreaseFieldSize : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "achievement",
table: "eva_evaluation_achievement",
maxLength: 3000,
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 1000,
oldNullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "achievement",
table: "eva_evaluation_achievement",
maxLength: 1000,
nullable: true,
oldClrType: typeof(string),
oldMaxLength: 3000,
oldNullable: true);
}
}
}

View File

@@ -347,7 +347,7 @@ namespace tb320eva.Migrations
b.Property<int>("id"); b.Property<int>("id");
b.Property<string>("achievement") b.Property<string>("achievement")
.HasMaxLength(1000); .HasMaxLength(3000);
b.Property<int?>("create_evaluation_detail_id"); b.Property<int?>("create_evaluation_detail_id");

View File

@@ -312,7 +312,7 @@ namespace TodoAPI2.Models
select i).FirstOrDefault(); select i).FirstOrDefault();
string sql = $@" string sql = $@"
insert into notifications(id,type,notifiable_type,notifiable_id,data,created_at) insert into notifications(id,type,notifiable_type,notifiable_id,data,created_at)
values('{Guid.NewGuid().ToString()}','App\Notifications\WorkflowNotification','App\Models\User',{noti_to_user_id.ToString()},@data,NOW()) values('{Guid.NewGuid().ToString()}','App\Notifications\WorkflowNotification','App\Models\User',{noti_to_user_id.ToString()},@data,NOW()now()+interval'7h')
"; ";
DataOfNotification d = new DataOfNotification(); DataOfNotification d = new DataOfNotification();
d.title = noti_message.Replace("{0}", owner_info.fullname); d.title = noti_message.Replace("{0}", owner_info.fullname);

View File

@@ -21,7 +21,7 @@ namespace TodoAPI2.Models
eva_evaluation_achievementWithSelectionViewModel GetWithSelection(int id); eva_evaluation_achievementWithSelectionViewModel GetWithSelection(int id);
eva_evaluation_achievementWithSelectionViewModel GetBlankItem(); eva_evaluation_achievementWithSelectionViewModel GetBlankItem();
void reset_achievement(int id);
} }
} }

View File

@@ -20,7 +20,7 @@ namespace TodoAPI2.Models
public eva_create_evaluation_detailEntity eva_create_evaluation_detail { get; set; } public eva_create_evaluation_detailEntity eva_create_evaluation_detail { get; set; }
public int? create_evaluation_detail_id { get; set; } public int? create_evaluation_detail_id { get; set; }
[MaxLength(1000)] [MaxLength(3000)]
public string achievement { get; set; } public string achievement { get; set; }
public decimal? weight { get; set; } public decimal? weight { get; set; }

View File

@@ -23,7 +23,8 @@ namespace TodoAPI2.Models
private IMyDatabase db; private IMyDatabase db;
private Iexternal_linkageService ext; private Iexternal_linkageService ext;
public eva_evaluation_achievementService(IBaseRepository2<eva_evaluation_achievementEntity, int> repository, IMyDatabase mydb, Iexternal_linkageService inext) public eva_evaluation_achievementService(IBaseRepository2<eva_evaluation_achievementEntity, int> repository,
IMyDatabase mydb, Iexternal_linkageService inext)
{ {
_repository = repository; _repository = repository;
db = mydb; db = mydb;
@@ -96,7 +97,7 @@ namespace TodoAPI2.Models
&& (m_eva_evaluation_achievement.create_evaluation_detail_id == model.create_evaluation_detail_id || !model.create_evaluation_detail_id.HasValue) && (m_eva_evaluation_achievement.create_evaluation_detail_id == model.create_evaluation_detail_id || !model.create_evaluation_detail_id.HasValue)
orderby m_eva_evaluation_achievement.achievement orderby m_eva_evaluation_achievement.created
select new eva_evaluation_achievementViewModel() select new eva_evaluation_achievementViewModel()
{ {
id = m_eva_evaluation_achievement.id, id = m_eva_evaluation_achievement.id,
@@ -161,7 +162,7 @@ namespace TodoAPI2.Models
where i.id == model.create_evaluation_detail_id where i.id == model.create_evaluation_detail_id
select i).FirstOrDefault(); select i).FirstOrDefault();
if(current_detail.status_self == "Y") if (current_detail.status_self == "Y")
{ {
throw new Exception("คุณนำส่งข้อตกลงการประเมินไปแล้ว ไม่สามารถบันทึกได้"); throw new Exception("คุณนำส่งข้อตกลงการประเมินไปแล้ว ไม่สามารถบันทึกได้");
} }
@@ -240,6 +241,47 @@ namespace TodoAPI2.Models
throw new NotificationException("No data to update"); throw new NotificationException("No data to update");
} }
public void reset_achievement(int id)
{
var current_detail = (from i in _repository.Context.eva_create_evaluation_detail
where i.id == id
select i).FirstOrDefault();
if(current_detail == null) throw new NotificationException("No data to update");
if (current_detail.status_self == "Y")
{
throw new Exception("คุณนำส่งข้อตกลงการประเมินไปแล้ว ไม่สามารถบันทึกได้");
}
var current_achievement = (from i in _repository.Context.eva_evaluation_achievement
where i.create_evaluation_detail_id == id
select i);
_repository.Context.RemoveRange(current_achievement);
var opt = (from i in _repository.Context.eva_evaluation_operating_agreement
where i.create_evaluation_detail_id == id
orderby i.mission_no
select i).ToList();
var newid = GetNewPrimaryKey();
var enter = "\n";
foreach (var i in opt)
{
var n = new eva_evaluation_achievementEntity();
n.id = newid;
n.create_evaluation_detail_id = id;
n.achievement = "รายละเอียดภารกิจ" + enter + enter + i.mission_detail + enter + enter + "เป้าหมาย" + enter + enter + i.target + enter + enter + "ตัวชี้วัด" + enter + enter + i.indicators;
n.weight = 0;
n.created = DateTime.Now.AddMinutes(-1 * newid);
newid++;
_repository.Context.Add(n);
}
_repository.Context.SaveChanges();
}
public string UpdateMultiple(List<eva_evaluation_achievementInputModel> model) public string UpdateMultiple(List<eva_evaluation_achievementInputModel> model)
{ {
foreach (var i in model) foreach (var i in model)

View File

@@ -42,7 +42,14 @@ namespace TodoAPI2.Models
public string target_score5 { get; set; } public string target_score5 { get; set; }
public int? create_evaluation_detail_id_eva_create_evaluation_detail_create_evaluation_id { get; set; } public int? create_evaluation_detail_id_eva_create_evaluation_detail_create_evaluation_id { get; set; }
public string achievement_display
{
get
{
if (achievement == null) achievement = "";
return achievement.Replace("\n", "<br/>");
}
}
} }
} }

View File

@@ -36,5 +36,13 @@ namespace TodoAPI2.Models
public int? create_evaluation_detail_id_eva_create_evaluation_detail_create_evaluation_id { get; set; } public int? create_evaluation_detail_id_eva_create_evaluation_detail_create_evaluation_id { get; set; }
public string achievement_display {
get
{
if (achievement == null) achievement = "";
return achievement.Replace("\n", "<br/>");
}
}
} }
} }

View File

@@ -58,5 +58,13 @@ namespace TodoAPI2.Models
public int? create_evaluation_detail_id_eva_create_evaluation_detail_create_evaluation_id { get; set; } public int? create_evaluation_detail_id_eva_create_evaluation_detail_create_evaluation_id { get; set; }
public string achievement_display
{
get
{
if (achievement == null) achievement = "";
return achievement.Replace("\n", "<br/>");
}
}
} }
} }

View File

@@ -18,6 +18,7 @@ namespace TodoAPI2.Models
public List<int> detail_id { get; set; } public List<int> detail_id { get; set; }
public int? is_print_22 { get; set; }
} }
} }

View File

@@ -133,9 +133,15 @@
eva_create_evaluation_InitiateDataTable(); eva_create_evaluation_InitiateDataTable();
eva_create_evaluation_InitialForm(); eva_create_evaluation_InitialForm();
SetupValidationRemark("eva_create_evaluation"); SetupValidationRemark("eva_create_evaluation");
$("#eva_create_evaluation_employee_id").select2(); $("#eva_create_evaluation_employee_id").select2({
$("#eva_create_evaluation_supervisor1_id").select2(); dropdownParent: $('#eva_create_evaluationModel')
$("#eva_create_evaluation_supervisor2_id").select2(); });
$("#eva_create_evaluation_supervisor1_id").select2({
dropdownParent: $('#eva_create_evaluationModel')
});
$("#eva_create_evaluation_supervisor2_id").select2({
dropdownParent: $('#eva_create_evaluationModel')
});
$("#eva_create_evaluation_detail_employee_id").select2(); $("#eva_create_evaluation_detail_employee_id").select2();
$("#eva_create_evaluation_detail_chief").select2(); $("#eva_create_evaluation_detail_chief").select2();
}); });

View File

@@ -6,6 +6,29 @@
} }
<div class="modal fade" id="report_xModel" style="z-index:1500" tabindex="-1" role="dialog" aria-labelledby="report_xModelLabel" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="report_xModelLabel">พิมพ์แบบประเมิน</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-12">
<iframe id="report_result" style="display:none; height:500px; width:100%;"></iframe>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">ปิด</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="eva_evaluation_behaviorModel" style="z-index:1500" role="dialog" aria-labelledby="eva_evaluation_behaviorModelLabel" aria-hidden="true"> <div class="modal fade" id="eva_evaluation_behaviorModel" style="z-index:1500" role="dialog" aria-labelledby="eva_evaluation_behaviorModelLabel" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document"> <div class="modal-dialog modal-lg" role="document">
<div class="modal-content"> <div class="modal-content">
@@ -278,8 +301,9 @@
<input class="form-control" type="hidden" id="s_eva_evaluation_achievement_create_evaluation_detail_id" /> <input class="form-control" type="hidden" id="s_eva_evaluation_achievement_create_evaluation_detail_id" />
<div class="col-md-3"> <div class="col-md-12">
<button class="btn btn-info status_self" onclick="javascript:eva_evaluation_achievement_GoCreate();"><i class="fa fa-plus" style="font-size: 14px;"></i> เพิ่มรายการ</button> <button class="btn btn-info status_self" onclick="javascript:eva_evaluation_achievement_GoCreate();"><i class="fa fa-plus" style="font-size: 14px;"></i> เพิ่มรายการ</button>
<button class="btn btn-info status_self" onclick="javascript:eva_evaluation_achievement_reset_achievement();"><i class="fa fa-plus" style="font-size: 14px;"></i> ดึงรายการจากแบบข้อตกลง</button>
</div> </div>
</div> </div>
@@ -303,7 +327,7 @@
<tfoot> <tfoot>
<tr> <tr>
<th>&nbsp;</th> <th>&nbsp;</th>
<th>&nbsp;</th> <th><center><label>รวมน้ำหนัก</label></center></th>
<th><p id="sum_a"></p></th> <th><p id="sum_a"></p></th>
<th style="display:none;">&nbsp;</th> <th style="display:none;">&nbsp;</th>
<th style="display:none;">&nbsp;</th> <th style="display:none;">&nbsp;</th>
@@ -378,10 +402,14 @@
<div class="row"> <div class="row">
<div class="form-group col-md-12"> <div class="form-group col-md-12">
<button type="button" class="btn btn-submit status_self" onclick="javascript:eva_create_evaluation_detail_status_PutUpdate('next0')">ส่งแบบประเมิน</button>
<button type="button" class="btn btn-submit status_self" onclick="javascript:alert('บันทึกเรียบร้อย')">บันทึก</button>
<button type="button" class="btn btn-danger" onclick="javascript:window_close()"><i class="fa fa-repeat"></i> กลับ</button> <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 class="btn btn-secondary" onclick="javascript:print_report();">พิมพ์แบบประเมิน</button>
<button type="button" class="btn btn-primary status_self" onclick="javascript:eva_create_evaluation_detail_status_PutUpdate('next0')">ส่งแบบประเมิน</button>
</div> </div>
</div> </div>
@@ -393,6 +421,7 @@
<script src="~/js/eva_evaluation_behavior/eva_evaluation_behavior.js?version=@MyHelper.GetDummyText()"></script> <script src="~/js/eva_evaluation_behavior/eva_evaluation_behavior.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_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/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>
<script> <script>
var status_self = ""; var status_self = "";
@@ -423,10 +452,10 @@
}); });
function CheckPermission() { function CheckPermission() {
if (status_self === "Y") { //if (status_self === "Y") {
$(".status_self").hide(); // $(".status_self").hide();
$("#status").text("คุณส่งแบบประเมินไปแล้ว"); // $("#status").text("คุณส่งแบบประเมินไปแล้ว");
} //}
} }
function OnWeightChanged(c) { function OnWeightChanged(c) {
@@ -446,6 +475,14 @@
} }
} }
function print_report() {
var eva_create_evaluation_detail_selectitem = [];
eva_create_evaluation_detail_selectitem.push(getUrlParameter("id"));
rep_eva_x_DoSearch("pdf", eva_create_evaluation_detail_selectitem, 1); // 1 คือให้ต่อท้าย แบบข้อตกลง ออกมาด้วย
}
</script> </script>
} }

View File

@@ -259,13 +259,16 @@
<button type="button" class="btn btn-danger" onclick="javascript:window_close()"><i class="fa fa-repeat"></i> กลับ</button> <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:alert('บันทึกเรียบร้อย')">บันทึก</button>
<button type="button" class="btn btn-submit status_self" onclick="javascript:eva_create_evaluation_detail_status_PutUpdate('nextA')">ส่งข้อตกลงการประเมิน</button>
<button type="button" class="btn btn-submit status_chief" onclick="javascript:eva_create_evaluation_detail_review0A_PutUpdate('backB')">ส่งเอกสารคืน</button> <button type="button" class="btn btn-submit status_chief" onclick="javascript:eva_create_evaluation_detail_review0A_PutUpdate('backB')">ส่งเอกสารคืน</button>
<button type="button" class="btn btn-submit status_chief" onclick="javascript:eva_create_evaluation_detail_review0A_PutUpdate('save')">บันทึก</button> <button type="button" class="btn btn-submit status_chief" onclick="javascript:eva_create_evaluation_detail_review0A_PutUpdate('save')">บันทึก</button>
<button type="button" class="btn btn-submit status_chief" onclick="javascript:eva_create_evaluation_detail_review0A_PutUpdate('nextB')">ส่งข้อตกลงการประเมิน</button>
<button class="btn btn-info" onclick="javascript:rep_eva_p01_DoSearch('pdf');">พิมพ์แบบข้อตกลง</button> <button class="btn btn-info" onclick="javascript:rep_eva_p01_DoSearch('pdf');">พิมพ์แบบข้อตกลง</button>
<button type="button" class="btn btn-submit status_self" onclick="javascript:eva_create_evaluation_detail_status_PutUpdate('nextA')">ส่งข้อตกลงการประเมิน</button>
<button type="button" class="btn btn-submit status_chief" onclick="javascript:eva_create_evaluation_detail_review0A_PutUpdate('nextB')">ส่งข้อตกลงการประเมิน</button>
</div> </div>
</div> </div>
<div class='row'> <div class='row'>

View File

@@ -5,6 +5,29 @@
Layout = "_LayoutDirect"; Layout = "_LayoutDirect";
} }
<div class="modal fade" id="report_xModel" style="z-index:1500" tabindex="-1" role="dialog" aria-labelledby="report_xModelLabel" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="report_xModelLabel">พิมพ์แบบประเมิน</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-12">
<iframe id="report_result" style="display:none; height:500px; width:100%;"></iframe>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">ปิด</button>
</div>
</div>
</div>
</div>
<div class="row page-title"> <div class="row page-title">
<div class="col-md-5"> <div class="col-md-5">
<div class="page-title"> <div class="page-title">
@@ -100,13 +123,13 @@
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<br/> <br />
<table class="display table table-bordered table-striped"> <table class="display table table-bordered table-striped">
<tr> <tr>
<td colspan="2">ลาป่วย</td> <td colspan="2">ลาป่วย</td>
<td colspan="2">ลากิจ</td> <td colspan="2">ลากิจ</td>
<td rowspan="2">ลาพักผ่อน</td> <td rowspan="2">ลาพักผ่อน</td>
<td rowspan="2">ขอกลับ<br/>ก่อนเวลา</td> <td rowspan="2">ขอกลับ<br />ก่อนเวลา</td>
<td rowspan="2" width="10%">สาย</td> <td rowspan="2" width="10%">สาย</td>
<td rowspan="2" width="10%">ขาด</td> <td rowspan="2" width="10%">ขาด</td>
<td colspan="2">รวม (ป่วย/กิจ)</td> <td colspan="2">รวม (ป่วย/กิจ)</td>
@@ -239,7 +262,7 @@
<div class="row"> <div class="row">
<div class="form-group col-md-12"> <div class="form-group col-md-12">
<button style="display:none;" id="btn02" type="button" class="btn btn-primary" onclick="javascript:eva_evaluation_behavior_process_Save(getUrlParameter('id'))">บันทึก</button> <button style="display:none;" id="btn02" type="button" class="btn btn-primary" onclick="javascript:eva_evaluation_behavior_process_Save(getUrlParameter('id'))">บันทึก</button>
</div> </div>
</div> </div>
@@ -293,7 +316,7 @@
<div class="row"> <div class="row">
<div class="form-group col-md-12"> <div class="form-group col-md-12">
<button style="display:none;" id="btn03" type="button" class="btn btn-submit" onclick="javascript:eva_create_evaluation_detail_summary1_PutUpdate()">บันทึก</button> <button style="display:none;" id="btn03" type="button" class="btn btn-submit" onclick="javascript:eva_create_evaluation_detail_summary1_PutUpdate()">บันทึก</button>
</div> </div>
</div> </div>
@@ -322,7 +345,7 @@
<div class='row'> <div class='row'>
<div class="form-group col-md-12"> <div class="form-group col-md-12">
<label id="lab_eva_create_evaluation_detail_review01_supervisor1_remark" for="eva_create_evaluation_detail_review01_supervisor1_remark">ความเห็นผู้ประเมิน</label> <label id="lab_eva_create_evaluation_detail_review01_supervisor1_remark" for="eva_create_evaluation_detail_review01_supervisor1_remark">ความเห็นผู้ประเมิน</label>
<textarea class="form-control" rows="4" cols="50" id="eva_create_evaluation_detail_review01_supervisor1_remark" iLabel="ความเห็นผู้ประเมิน" iRequire="true" iGroup="eva_create_evaluation_detail_review01"></textarea> <textarea class="form-control" rows="4" cols="50" id="eva_create_evaluation_detail_review01_supervisor1_remark" iLabel="ความเห็นผู้ประเมิน" iRequire="false" iGroup="eva_create_evaluation_detail_review01"></textarea>
</div> </div>
</div> </div>
@@ -345,6 +368,8 @@
<div class="form-group col-md-12"> <div class="form-group col-md-12">
<button id="btna01" type="button" class="btn btn-submit mycontrol01" onclick="javascript:saveAll()">บันทึก</button> <button id="btna01" type="button" class="btn btn-submit mycontrol01" onclick="javascript:saveAll()">บันทึก</button>
<button class="btn btn-secondary" onclick="javascript:print_report();">พิมพ์แบบประเมิน</button>
<button id="btna02" type="button" class="btn btn-submit mycontrol01" onclick="javascript:saveStatus('next1')">ส่งแบบประเมิน</button> <button id="btna02" type="button" class="btn btn-submit mycontrol01" onclick="javascript:saveStatus('next1')">ส่งแบบประเมิน</button>
<button id="btna03" type="button" class="btn btn-submit mycontrol01" onclick="javascript:saveStatus('back1')">ตีกลับแบบประเมิน</button> <button id="btna03" type="button" class="btn btn-submit mycontrol01" onclick="javascript:saveStatus('back1')">ตีกลับแบบประเมิน</button>
@@ -360,92 +385,100 @@
<script src="~/js/eva_create_evaluation_detail_summary1/eva_create_evaluation_detail_summary1_d.js?version=@MyHelper.GetDummyText()"></script> <script src="~/js/eva_create_evaluation_detail_summary1/eva_create_evaluation_detail_summary1_d.js?version=@MyHelper.GetDummyText()"></script>
<script src="~/js/eva_create_evaluation_detail_review01/eva_create_evaluation_detail_review01_d.js?version=@MyHelper.GetDummyText()"></script> <script src="~/js/eva_create_evaluation_detail_review01/eva_create_evaluation_detail_review01_d.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_create_evaluation_detail_status/eva_create_evaluation_detail_status_d.js?version=@MyHelper.GetDummyText()"></script>
<script src="~/js/rep_eva_x/rep_eva_x_report.js?version=@MyHelper.GetDummyText()"></script>
<script> <script>
$(document).ready(function () { $(document).ready(function () {
var id = getUrlParameter("id"); var id = getUrlParameter("id");
if (id) { if (id) {
eva_create_evaluation_detail_process_SetEditForm(id); eva_create_evaluation_detail_process_SetEditForm(id);
eva_evaluation_achievement_process_InitialForm(id); eva_evaluation_achievement_process_InitialForm(id);
eva_evaluation_behavior_process_InitialForm(id); eva_evaluation_behavior_process_InitialForm(id);
eva_create_evaluation_detail_summary1_SetEditForm(id); eva_create_evaluation_detail_summary1_SetEditForm(id);
eva_create_evaluation_detail_review01_SetEditForm(id); eva_create_evaluation_detail_review01_SetEditForm(id);
eva_create_evaluation_detail_status_SetEditForm(id); eva_create_evaluation_detail_status_SetEditForm(id);
setTimeout(Oneva_evaluation_achievement_process_scoreChange, 1000); setTimeout(Oneva_evaluation_achievement_process_scoreChange, 1000);
setTimeout(Oneva_evaluation_behavior_process_scoreChange, 1000); setTimeout(Oneva_evaluation_behavior_process_scoreChange, 1000);
} else { } else {
eva_create_evaluation_detail_process_SetCreateForm(); eva_create_evaluation_detail_process_SetCreateForm();
} }
SetupValidationRemark("eva_create_evaluation_detail_process"); SetupValidationRemark("eva_create_evaluation_detail_process");
SetupValidationRemark("eva_create_evaluation_detail_review01"); SetupValidationRemark("eva_create_evaluation_detail_review01");
}); });
function searchVacation_GetFromForm() { function searchVacation_GetFromForm() {
var searchVacationObject = new Object(); var searchVacationObject = new Object();
searchVacationObject.start_date = formatDateForGetParameter(getDate($("#date_from").val())); searchVacationObject.start_date = formatDateForGetParameter(getDate($("#date_from").val()));
searchVacationObject.end_date = formatDateForGetParameter(getDate($("#date_to").val())); searchVacationObject.end_date = formatDateForGetParameter(getDate($("#date_to").val()));
searchVacationObject.employee_id = $("#eva_create_evaluation_detail_process_employee_id").val(); searchVacationObject.employee_id = $("#eva_create_evaluation_detail_process_employee_id").val();
return searchVacationObject; return searchVacationObject;
}
function searchVacation() {
if($("#date_from").val() === "") {
alert("กรุณาระบุ วันเริ่มต้น");
return;
}
if($("#date_to").val() === "") {
alert("กรุณาระบุ วันสิ้นสุด");
return;
} }
var employee_API = "/api/external_employee/"; function searchVacation() {
var successFunc = function (result) { if ($("#date_from").val() === "") {
searchVacation_FeedDataToForm(result); alert("กรุณาระบุ วันเริ่มต้น");
endLoad(); return;
}; }
if ($("#date_to").val() === "") {
alert("กรุณาระบุ วันสิ้นสุด");
return;
}
var p = $.param(searchVacation_GetFromForm()); var employee_API = "/api/external_employee/";
startLoad(); var successFunc = function (result) {
AjaxGetRequest(apisite + employee_API + "GetLeaveOfEmployee?"+p, successFunc, AlertDanger); searchVacation_FeedDataToForm(result);
} endLoad();
};
function searchVacation_FeedDataToForm(data) { var p = $.param(searchVacation_GetFromForm());
$("#sum_day_sick_leave").text(data.sum_day_sick_leave);
$("#count_sick_leave").text(data.count_sick_leave);
$("#sum_day_personal_leave").text(data.sum_day_personal_leave);
$("#count_personal_leave").text(data.count_personal_leave);
$("#sum_day_vacation_leave").text(data.sum_day_vacation_leave);
$("#count_stop_working").text(data.count_stop_working);
$("#count_late_tad_processing_time_results").text(data.count_late_tad_processing_time_results);
$("#count_absence_tad_processing_time_results").text(data.count_absence_tad_processing_time_results);
$("#sum_day_sick_personal_leave").text(data.sum_day_sick_personal_leave);
$("#count_sick_personal_leave").text(data.count_sick_personal_leave);
}
function saveStatus(s){ startLoad();
if (!ValidateForm('eva_create_evaluation_detail_review01', eva_create_evaluation_detail_review01_customValidation)) AjaxGetRequest(apisite + employee_API + "GetLeaveOfEmployee?" + p, successFunc, AlertDanger);
{
return;
} }
saveAll();
setTimeout(function() {
eva_create_evaluation_detail_status_PutUpdate(s);
}, 1000);
}
function saveAll(){ function searchVacation_FeedDataToForm(data) {
eva_evaluation_achievement_process_Save(getUrlParameter('id')); $("#sum_day_sick_leave").text(data.sum_day_sick_leave);
eva_evaluation_behavior_process_Save(getUrlParameter('id')); $("#count_sick_leave").text(data.count_sick_leave);
eva_create_evaluation_detail_summary1_PutUpdate(); $("#sum_day_personal_leave").text(data.sum_day_personal_leave);
eva_create_evaluation_detail_review01_PutUpdate(); $("#count_personal_leave").text(data.count_personal_leave);
} $("#sum_day_vacation_leave").text(data.sum_day_vacation_leave);
$("#count_stop_working").text(data.count_stop_working);
$("#count_late_tad_processing_time_results").text(data.count_late_tad_processing_time_results);
$("#count_absence_tad_processing_time_results").text(data.count_absence_tad_processing_time_results);
$("#sum_day_sick_personal_leave").text(data.sum_day_sick_personal_leave);
$("#count_sick_personal_leave").text(data.count_sick_personal_leave);
}
function CheckWeightBeforeSubmitStatus(){ function saveStatus(s) {
return true; if (!ValidateForm('eva_create_evaluation_detail_review01', eva_create_evaluation_detail_review01_customValidation)) {
} return;
}
saveAll();
setTimeout(function () {
eva_create_evaluation_detail_status_PutUpdate(s);
}, 1000);
}
function saveAll() {
eva_evaluation_achievement_process_Save(getUrlParameter('id'));
eva_evaluation_behavior_process_Save(getUrlParameter('id'));
eva_create_evaluation_detail_summary1_PutUpdate();
eva_create_evaluation_detail_review01_PutUpdate();
}
function CheckWeightBeforeSubmitStatus() {
return true;
}
function print_report() {
var eva_create_evaluation_detail_selectitem = [];
eva_create_evaluation_detail_selectitem.push(getUrlParameter("id"));
rep_eva_x_DoSearch("pdf", eva_create_evaluation_detail_selectitem, 1); // 1 คือให้ต่อท้าย แบบข้อตกลง ออกมาด้วย
}
</script> </script>
} }

View File

@@ -5,6 +5,29 @@
Layout = "_LayoutDirect"; Layout = "_LayoutDirect";
} }
<div class="modal fade" id="report_xModel" style="z-index:1500" tabindex="-1" role="dialog" aria-labelledby="report_xModelLabel" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="report_xModelLabel">พิมพ์แบบประเมิน</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-12">
<iframe id="report_result" style="display:none; height:500px; width:100%;"></iframe>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">ปิด</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="eva_idp_planModel" style="z-index:1500" role="dialog" aria-labelledby="eva_idp_planModelLabel" aria-hidden="true"> <div class="modal fade" id="eva_idp_planModel" style="z-index:1500" role="dialog" aria-labelledby="eva_idp_planModelLabel" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document"> <div class="modal-dialog modal-lg" role="document">
<div class="modal-content"> <div class="modal-content">
@@ -150,7 +173,7 @@
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<br/> <br />
<table class="display table table-bordered table-striped"> <table class="display table table-bordered table-striped">
<tr> <tr>
<td colspan="2">ลาป่วย</td> <td colspan="2">ลาป่วย</td>
@@ -259,8 +282,8 @@
<th><label>คะแนน</label></th> <th><label>คะแนน</label></th>
<th><label>รวมคะแนน</label></th> <th><label>รวมคะแนน</label></th>
<th><label>คะแนน <br/>(ระบุ 1.00-5.00)</label></th> <th><label>คะแนน <br />(ระบุ 1.00-5.00)</label></th>
<th><label>รวมคะแนน<br/>(น้ำหนัก x คะแนน / 100)</label></th> <th><label>รวมคะแนน<br />(น้ำหนัก x คะแนน / 100)</label></th>
</tr> </tr>
</thead> </thead>
<tfoot> <tfoot>
@@ -566,6 +589,8 @@
<div class="form-group col-md-12"> <div class="form-group col-md-12">
<button id="btnd01" type="button" class="btn btn-submit" onclick="javascript:saveReview04()">บันทึก</button> <button id="btnd01" type="button" class="btn btn-submit" onclick="javascript:saveReview04()">บันทึก</button>
<button class="btn btn-secondary" onclick="javascript:print_report();">พิมพ์แบบประเมิน</button>
<button id="btnd02" type="button" class="btn btn-submit" onclick="javascript:saveStatus('next4')">ส่งแบบประเมิน</button> <button id="btnd02" type="button" class="btn btn-submit" onclick="javascript:saveStatus('next4')">ส่งแบบประเมิน</button>
<button id="btnd03" type="button" class="btn btn-submit" onclick="javascript:saveStatus('back4')">ตีกลับแบบประเมิน</button> <button id="btnd03" type="button" class="btn btn-submit" onclick="javascript:saveStatus('back4')">ตีกลับแบบประเมิน</button>
@@ -587,180 +612,186 @@
<script src="~/js/eva_create_evaluation_detail_review04/eva_create_evaluation_detail_review04_d.js?version=@MyHelper.GetDummyText()"></script> <script src="~/js/eva_create_evaluation_detail_review04/eva_create_evaluation_detail_review04_d.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_create_evaluation_detail_status/eva_create_evaluation_detail_status_d.js?version=@MyHelper.GetDummyText()"></script>
<script src="~/js/eva_idp_plan/eva_idp_plan.js?version=@MyHelper.GetDummyText()"></script> <script src="~/js/eva_idp_plan/eva_idp_plan.js?version=@MyHelper.GetDummyText()"></script>
<script src="~/js/rep_eva_x/rep_eva_x_report.js?version=@MyHelper.GetDummyText()"></script>
<script> <script>
$(document).ready(function () { $(document).ready(function () {
var id = getUrlParameter("id"); var id = getUrlParameter("id");
if (id) { if (id) {
eva_create_evaluation_detail_process_SetEditForm(id); eva_create_evaluation_detail_process_SetEditForm(id);
eva_create_evaluation_detail_review01_SetEditForm(id); eva_create_evaluation_detail_review01_SetEditForm(id);
eva_create_evaluation_detail_review02_SetEditForm(id); eva_create_evaluation_detail_review02_SetEditForm(id);
eva_create_evaluation_detail_review03_SetEditForm(id); eva_create_evaluation_detail_review03_SetEditForm(id);
eva_create_evaluation_detail_review04_SetEditForm(id); eva_create_evaluation_detail_review04_SetEditForm(id);
eva_create_evaluation_detail_status_SetEditForm(id); eva_create_evaluation_detail_status_SetEditForm(id);
eva_idp_plan_InitiateDataTable(id); eva_idp_plan_InitiateDataTable(id);
eva_idp_plan_InitialForm(); eva_idp_plan_InitialForm();
setTimeout(Oneva_evaluation_achievement_process2_scoreChange, 1000); setTimeout(Oneva_evaluation_achievement_process2_scoreChange, 1000);
setTimeout(Oneva_evaluation_behavior_process2_scoreChange, 1000); setTimeout(Oneva_evaluation_behavior_process2_scoreChange, 1000);
} else { } else {
eva_create_evaluation_detail_process_SetCreateForm(); eva_create_evaluation_detail_process_SetCreateForm();
} }
SetupValidationRemark("eva_create_evaluation_detail_process"); SetupValidationRemark("eva_create_evaluation_detail_process");
SetupValidationRemark("eva_create_evaluation_detail_review02"); SetupValidationRemark("eva_create_evaluation_detail_review02");
SetupValidationRemark("eva_create_evaluation_detail_review03"); SetupValidationRemark("eva_create_evaluation_detail_review03");
SetupValidationRemark("eva_create_evaluation_detail_review04"); SetupValidationRemark("eva_create_evaluation_detail_review04");
SetupValidationRemark("eva_idp_plan"); SetupValidationRemark("eva_idp_plan");
}); });
function Oneva_create_evaluation_detail_review02_supervisor2_resultChanged(a){ function Oneva_create_evaluation_detail_review02_supervisor2_resultChanged(a) {
if($(a).val() == "Y"){ if ($(a).val() == "Y") {
$("#eva_create_evaluation_detail_review02_supervisor2_remark").attr("iRequire","false"); $("#eva_create_evaluation_detail_review02_supervisor2_remark").attr("iRequire", "false");
$("#eva_create_evaluation_detail_review02_supervisor2_remark").css('border-color', ''); $("#eva_create_evaluation_detail_review02_supervisor2_remark").css('border-color', '');
$("#review02x").hide(); $("#review02x").hide();
}else{ } else {
$("#eva_create_evaluation_detail_review02_supervisor2_remark").attr("iRequire","true"); $("#eva_create_evaluation_detail_review02_supervisor2_remark").attr("iRequire", "true");
$("#review02x").show(); $("#review02x").show();
} }
}
function Oneva_create_evaluation_detail_review03_supervisor1A_resultChanged(a){
if($(a).val() == "Y"){
$("#eva_create_evaluation_detail_review03_supervisor1A_remark").attr("iRequire","false");
$("#eva_create_evaluation_detail_review03_supervisor1A_remark").css('border-color', '');
$("#review03x").hide();
}else{
$("#eva_create_evaluation_detail_review03_supervisor1A_remark").attr("iRequire","true");
$("#review03x").show();
}
}
function Oneva_create_evaluation_detail_review04_supervisor2A_resultChanged(a){
if($(a).val() == "Y"){
$("#eva_create_evaluation_detail_review04_supervisor2A_remark").attr("iRequire","false");
$("#eva_create_evaluation_detail_review04_supervisor2A_remark").css('border-color', '');
$("#review04x").hide();
}else{
$("#eva_create_evaluation_detail_review04_supervisor2A_remark").attr("iRequire","true");
$("#review04x").show();
}
}
function searchVacation_GetFromForm() {
var searchVacationObject = new Object();
searchVacationObject.start_date = formatDateForGetParameter(getDate($("#date_from").val()));
searchVacationObject.end_date = formatDateForGetParameter(getDate($("#date_to").val()));
searchVacationObject.employee_id = $("#eva_create_evaluation_detail_process_employee_id").val();
//console.log(searchVacationObject);
return searchVacationObject;
}
function searchVacation() {
if($("#date_from").val() === "") {
alert("กรุณาระบุ วันเริ่มต้น");
return;
}
if($("#date_to").val() === "") {
alert("กรุณาระบุ วันสิ้นสุด");
return;
} }
var employee_API = "/api/external_employee/"; function Oneva_create_evaluation_detail_review03_supervisor1A_resultChanged(a) {
if ($(a).val() == "Y") {
$("#eva_create_evaluation_detail_review03_supervisor1A_remark").attr("iRequire", "false");
$("#eva_create_evaluation_detail_review03_supervisor1A_remark").css('border-color', '');
$("#review03x").hide();
} else {
$("#eva_create_evaluation_detail_review03_supervisor1A_remark").attr("iRequire", "true");
$("#review03x").show();
}
}
var successFunc = function (result) { function Oneva_create_evaluation_detail_review04_supervisor2A_resultChanged(a) {
searchVacation_FeedDataToForm(result); if ($(a).val() == "Y") {
endLoad(); $("#eva_create_evaluation_detail_review04_supervisor2A_remark").attr("iRequire", "false");
}; $("#eva_create_evaluation_detail_review04_supervisor2A_remark").css('border-color', '');
$("#review04x").hide();
} else {
$("#eva_create_evaluation_detail_review04_supervisor2A_remark").attr("iRequire", "true");
$("#review04x").show();
}
}
var p = $.param(searchVacation_GetFromForm()); function searchVacation_GetFromForm() {
var searchVacationObject = new Object();
searchVacationObject.start_date = formatDateForGetParameter(getDate($("#date_from").val()));
searchVacationObject.end_date = formatDateForGetParameter(getDate($("#date_to").val()));
searchVacationObject.employee_id = $("#eva_create_evaluation_detail_process_employee_id").val();
//console.log(searchVacationObject);
return searchVacationObject;
}
startLoad(); function searchVacation() {
AjaxGetRequest(apisite + employee_API + "GetLeaveOfEmployee?"+p, successFunc, AlertDanger);
}
function searchVacation_FeedDataToForm(data) { if ($("#date_from").val() === "") {
alert("กรุณาระบุ วันเริ่มต้น");
$("#sum_day_sick_leave").text(data.sum_day_sick_leave);
$("#count_sick_leave").text(data.count_sick_leave);
$("#sum_day_personal_leave").text(data.sum_day_personal_leave);
$("#count_personal_leave").text(data.count_personal_leave);
$("#sum_day_vacation_leave").text(data.sum_day_vacation_leave);
$("#count_stop_working").text(data.count_stop_working);
$("#count_late_tad_processing_time_results").text(data.count_late_tad_processing_time_results);
$("#count_absence_tad_processing_time_results").text(data.count_absence_tad_processing_time_results);
$("#sum_day_sick_personal_leave").text(data.sum_day_sick_personal_leave);
$("#count_sick_personal_leave").text(data.count_sick_personal_leave);
}
function saveReview02(){
saveAll();
setTimeout(function() {
eva_create_evaluation_detail_review02_PutUpdate(true);
}, 1000);
}
function saveReview03(){
saveAll();
setTimeout(function() {
eva_create_evaluation_detail_review03_PutUpdate(true);
}, 1000);
}
function saveReview04(){
saveAll();
setTimeout(function() {
eva_create_evaluation_detail_review04_PutUpdate(true);
}, 1000);
}
function saveStatus(s){
if(s === "next2" || s === "back2"){
if (!ValidateForm('eva_create_evaluation_detail_review02', eva_create_evaluation_detail_review02_customValidation))
{
return; return;
} }
saveAll(); if ($("#date_to").val() === "") {
eva_create_evaluation_detail_review02_PutUpdate(false); alert("กรุณาระบุ วันสิ้นสุด");
setTimeout(function() {
eva_create_evaluation_detail_status_PutUpdate(s);
}, 1000);
}
else if(s === "next3"){
if (!ValidateForm('eva_create_evaluation_detail_review03', eva_create_evaluation_detail_review03_customValidation))
{
return; return;
} }
var employee_API = "/api/external_employee/";
var successFunc = function (result) {
searchVacation_FeedDataToForm(result);
endLoad();
};
var p = $.param(searchVacation_GetFromForm());
startLoad();
AjaxGetRequest(apisite + employee_API + "GetLeaveOfEmployee?" + p, successFunc, AlertDanger);
}
function searchVacation_FeedDataToForm(data) {
$("#sum_day_sick_leave").text(data.sum_day_sick_leave);
$("#count_sick_leave").text(data.count_sick_leave);
$("#sum_day_personal_leave").text(data.sum_day_personal_leave);
$("#count_personal_leave").text(data.count_personal_leave);
$("#sum_day_vacation_leave").text(data.sum_day_vacation_leave);
$("#count_stop_working").text(data.count_stop_working);
$("#count_late_tad_processing_time_results").text(data.count_late_tad_processing_time_results);
$("#count_absence_tad_processing_time_results").text(data.count_absence_tad_processing_time_results);
$("#sum_day_sick_personal_leave").text(data.sum_day_sick_personal_leave);
$("#count_sick_personal_leave").text(data.count_sick_personal_leave);
}
function saveReview02() {
saveAll(); saveAll();
eva_create_evaluation_detail_review03_PutUpdate(false); setTimeout(function () {
setTimeout(function() { eva_create_evaluation_detail_review02_PutUpdate(true);
eva_create_evaluation_detail_status_PutUpdate(s);
}, 1000); }, 1000);
} }
else if(s === "next4"){
if (!ValidateForm('eva_create_evaluation_detail_review04', eva_create_evaluation_detail_review04_customValidation)) function saveReview03() {
{ saveAll();
return; setTimeout(function () {
eva_create_evaluation_detail_review03_PutUpdate(true);
}, 1000);
}
function saveReview04() {
saveAll();
setTimeout(function () {
eva_create_evaluation_detail_review04_PutUpdate(true);
}, 1000);
}
function saveStatus(s) {
if (s === "next2" || s === "back2") {
if (!ValidateForm('eva_create_evaluation_detail_review02', eva_create_evaluation_detail_review02_customValidation)) {
return;
}
saveAll();
eva_create_evaluation_detail_review02_PutUpdate(false);
setTimeout(function () {
eva_create_evaluation_detail_status_PutUpdate(s);
}, 1000);
}
else if (s === "next3") {
if (!ValidateForm('eva_create_evaluation_detail_review03', eva_create_evaluation_detail_review03_customValidation)) {
return;
}
saveAll();
eva_create_evaluation_detail_review03_PutUpdate(false);
setTimeout(function () {
eva_create_evaluation_detail_status_PutUpdate(s);
}, 1000);
}
else if (s === "next4") {
if (!ValidateForm('eva_create_evaluation_detail_review04', eva_create_evaluation_detail_review04_customValidation)) {
return;
}
saveAll();
eva_create_evaluation_detail_review04_PutUpdate(false);
setTimeout(function () {
eva_create_evaluation_detail_status_PutUpdate(s);
}, 1000);
} }
saveAll();
eva_create_evaluation_detail_review04_PutUpdate(false);
setTimeout(function() {
eva_create_evaluation_detail_status_PutUpdate(s);
}, 1000);
} }
}
function saveAll(){ function saveAll() {
eva_evaluation_achievement_process2_Save(getUrlParameter('id')); eva_evaluation_achievement_process2_Save(getUrlParameter('id'));
eva_evaluation_behavior_process2_Save(getUrlParameter('id')); eva_evaluation_behavior_process2_Save(getUrlParameter('id'));
eva_create_evaluation_detail_summary2_PutUpdate(); eva_create_evaluation_detail_summary2_PutUpdate();
} }
function CheckWeightBeforeSubmitStatus(){ function CheckWeightBeforeSubmitStatus() {
return true; return true;
} }
function print_report() {
var eva_create_evaluation_detail_selectitem = [];
eva_create_evaluation_detail_selectitem.push(getUrlParameter("id"));
rep_eva_x_DoSearch("pdf", eva_create_evaluation_detail_selectitem, 1); // 1 คือให้ต่อท้าย แบบข้อตกลง ออกมาด้วย
}
</script> </script>
} }

View File

@@ -2110,6 +2110,18 @@
<response code="400">If the model is invalid</response> <response code="400">If the model is invalid</response>
<response code="500">Error Occurred</response> <response code="500">Error Occurred</response>
</member> </member>
<member name="M:TodoAPI2.Controllers.eva_evaluation_achievementController.reset_achievement(System.Int32)">
<summary>
reset_achievement
</summary>
<remarks>
</remarks>
<param name="id"></param>
<returns>Response Result Message</returns>
<response code="200">Response Result Message</response>
<response code="400">If the model is invalid</response>
<response code="500">Error Occurred</response>
</member>
<member name="M:TodoAPI2.Controllers.eva_evaluation_achievementController.Delete(System.Int32)"> <member name="M:TodoAPI2.Controllers.eva_evaluation_achievementController.Delete(System.Int32)">
<summary> <summary>
Delete item Delete item

View File

@@ -5,32 +5,32 @@ var eva_create_evaluation_detail_API = "/api/eva_create_evaluation_detail/";
function eva_create_evaluation_detail_GetSearchParameter() { function eva_create_evaluation_detail_GetSearchParameter() {
var eva_create_evaluation_detailSearchObject = new Object(); var eva_create_evaluation_detailSearchObject = new Object();
eva_create_evaluation_detailSearchObject.create_evaluation_id = getUrlParameter("id"); //$("#s_eva_create_evaluation_detail_create_evaluation_id").val(); eva_create_evaluation_detailSearchObject.create_evaluation_id = getUrlParameter("id"); //$("#s_eva_create_evaluation_detail_create_evaluation_id").val();
return eva_create_evaluation_detailSearchObject; return eva_create_evaluation_detailSearchObject;
} }
function eva_create_evaluation_detail_FeedDataToSearchForm(data) { function eva_create_evaluation_detail_FeedDataToSearchForm(data) {
$("#s_eva_create_evaluation_detail_create_evaluation_id").val(data.create_evaluation_id); $("#s_eva_create_evaluation_detail_create_evaluation_id").val(data.create_evaluation_id);
} }
//================= Form Data Customizaiton ========================================= //================= Form Data Customizaiton =========================================
function eva_create_evaluation_detail_FeedDataToForm(data) { function eva_create_evaluation_detail_FeedDataToForm(data) {
$("#eva_create_evaluation_detail_id").val(data.id); $("#eva_create_evaluation_detail_id").val(data.id);
$("#eva_create_evaluation_detail_create_evaluation_id").val(data.create_evaluation_id); $("#eva_create_evaluation_detail_create_evaluation_id").val(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_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_chief"), data, "id", "fullname", "item_chief", data.chief);
} }
function eva_create_evaluation_detail_GetFromForm() { function eva_create_evaluation_detail_GetFromForm() {
var eva_create_evaluation_detailObject = new Object(); var eva_create_evaluation_detailObject = new Object();
eva_create_evaluation_detailObject.id = $("#eva_create_evaluation_detail_id").val(); eva_create_evaluation_detailObject.id = $("#eva_create_evaluation_detail_id").val();
eva_create_evaluation_detailObject.create_evaluation_id = $("#eva_create_evaluation_detail_create_evaluation_id").val(); eva_create_evaluation_detailObject.create_evaluation_id = $("#eva_create_evaluation_detail_create_evaluation_id").val();
eva_create_evaluation_detailObject.employee_id = $("#eva_create_evaluation_detail_employee_id").val(); eva_create_evaluation_detailObject.employee_id = $("#eva_create_evaluation_detail_employee_id").val();
eva_create_evaluation_detailObject.chief = $("#eva_create_evaluation_detail_chief").val(); eva_create_evaluation_detailObject.chief = $("#eva_create_evaluation_detail_chief").val();
return eva_create_evaluation_detailObject; return eva_create_evaluation_detailObject;
@@ -39,14 +39,14 @@ eva_create_evaluation_detailObject.chief = $("#eva_create_evaluation_detail_chie
function eva_create_evaluation_detail_InitialForm(s) { function eva_create_evaluation_detail_InitialForm(s) {
var successFunc = function (result) { var successFunc = function (result) {
eva_create_evaluation_detail_FeedDataToForm(result); eva_create_evaluation_detail_FeedDataToForm(result);
eva_create_evaluation_detail_FeedDataToSearchForm(result); eva_create_evaluation_detail_FeedDataToSearchForm(result);
if (s) { if (s) {
// Incase model popup // Incase model popup
$("#eva_create_evaluation_detailModel").modal("show"); $("#eva_create_evaluation_detailModel").modal("show");
} }
endLoad(); endLoad();
}; };
startLoad(); startLoad();
AjaxGetRequest(apisite + eva_create_evaluation_detail_API + "GetBlankItem", successFunc, AlertDanger); AjaxGetRequest(apisite + eva_create_evaluation_detail_API + "GetBlankItem", successFunc, AlertDanger);
} }
@@ -76,15 +76,15 @@ function eva_create_evaluation_detail_SetEditForm(a) {
eva_create_evaluation_detail_editMode = "UPDATE"; eva_create_evaluation_detail_editMode = "UPDATE";
eva_create_evaluation_detail_FeedDataToForm(result); eva_create_evaluation_detail_FeedDataToForm(result);
$("#eva_create_evaluation_detailModel").modal("show"); $("#eva_create_evaluation_detailModel").modal("show");
endLoad(); endLoad();
}; };
startLoad(); startLoad();
AjaxGetRequest(apisite + eva_create_evaluation_detail_API + a, successFunc, AlertDanger); AjaxGetRequest(apisite + eva_create_evaluation_detail_API + a, successFunc, AlertDanger);
} }
function eva_create_evaluation_detail_SetCreateForm(s) { function eva_create_evaluation_detail_SetCreateForm(s) {
eva_create_evaluation_detail_editMode = "CREATE"; eva_create_evaluation_detail_editMode = "CREATE";
eva_create_evaluation_detail_InitialForm(s); eva_create_evaluation_detail_InitialForm(s);
} }
function eva_create_evaluation_detail_RefreshTable() { function eva_create_evaluation_detail_RefreshTable() {
@@ -102,8 +102,7 @@ var eva_create_evaluation_detail_customValidation = function (group) {
}; };
function eva_create_evaluation_detail_PutUpdate() { function eva_create_evaluation_detail_PutUpdate() {
if (!ValidateForm('eva_create_evaluation_detail', eva_create_evaluation_detail_customValidation)) if (!ValidateForm('eva_create_evaluation_detail', eva_create_evaluation_detail_customValidation)) {
{
return; return;
} }
@@ -115,9 +114,9 @@ function eva_create_evaluation_detail_PutUpdate() {
$("#eva_create_evaluation_detailModel").modal("hide"); $("#eva_create_evaluation_detailModel").modal("hide");
AlertSuccess(result.message); AlertSuccess(result.message);
eva_create_evaluation_detail_RefreshTable(); eva_create_evaluation_detail_RefreshTable();
endLoad(); endLoad();
}; };
startLoad(); startLoad();
AjaxPutRequest(apisite + eva_create_evaluation_detail_API + data.id, data, successFunc1, AlertDanger); AjaxPutRequest(apisite + eva_create_evaluation_detail_API + data.id, data, successFunc1, AlertDanger);
} }
// Create mode // Create mode
@@ -126,9 +125,9 @@ function eva_create_evaluation_detail_PutUpdate() {
$("#eva_create_evaluation_detailModel").modal("hide"); $("#eva_create_evaluation_detailModel").modal("hide");
AlertSuccess(result.message); AlertSuccess(result.message);
eva_create_evaluation_detail_RefreshTable(); eva_create_evaluation_detail_RefreshTable();
endLoad(); endLoad();
}; };
startLoad(); startLoad();
AjaxPostRequest(apisite + eva_create_evaluation_detail_API, data, successFunc2, AlertDanger); AjaxPostRequest(apisite + eva_create_evaluation_detail_API, data, successFunc2, AlertDanger);
} }
} }
@@ -139,9 +138,9 @@ function eva_create_evaluation_detail_GoDelete(a) {
$("#eva_create_evaluation_detailModel").modal("hide"); $("#eva_create_evaluation_detailModel").modal("hide");
AlertSuccess(result.message); AlertSuccess(result.message);
eva_create_evaluation_detail_RefreshTable(); eva_create_evaluation_detail_RefreshTable();
endLoad(); endLoad();
}; };
startLoad(); startLoad();
AjaxDeleteRequest(apisite + eva_create_evaluation_detail_API + a, null, successFunc, AlertDanger); AjaxDeleteRequest(apisite + eva_create_evaluation_detail_API + a, null, successFunc, AlertDanger);
} }
} }
@@ -153,25 +152,25 @@ var eva_create_evaluation_detailTableV;
var eva_create_evaluation_detail_setupTable = function (result) { var eva_create_evaluation_detail_setupTable = function (result) {
console.log(result); console.log(result);
var groupColumn = 7; var groupColumn = 7;
tmp = '"'; tmp = '"';
eva_create_evaluation_detailTableV = $('#eva_create_evaluation_detailTable').DataTable({ eva_create_evaluation_detailTableV = $('#eva_create_evaluation_detailTable').DataTable({
"processing": true, "processing": true,
"serverSide": false, "serverSide": false,
"data": result, "data": result,
"select": { "select": {
"style": 'multi' "style": 'multi'
}, },
"columns": [ "columns": [
{ "data": "" }, { "data": "" },
{ "data": "employee_no" }, { "data": "employee_no" },
{ "data": "employee_id_external_linkage_external_name" }, { "data": "employee_id_external_linkage_external_name" },
{ "data": "position_name" }, { "data": "position_name" },
{ "data": "position_level_text" }, { "data": "position_level_text" },
{ "data": "txt_status_chief" }, { "data": "txt_status_chief" },
{ "data": "txt_status_supervisor" }, { "data": "txt_status_supervisor" },
{ "data": "department_name" }, { "data": "department_name" },
], ],
"columnDefs": [ "columnDefs": [
@@ -182,37 +181,37 @@ var eva_create_evaluation_detail_setupTable = function (result) {
orderable: false, orderable: false,
className: 'select-checkbox' className: 'select-checkbox'
}, },
{ "visible": false, "targets": groupColumn } { "visible": false, "targets": groupColumn }
], ],
"language": { "language": {
"url": appsite + "/DataTables-1.10.16/thai.json" "url": appsite + "/DataTables-1.10.16/thai.json"
}, },
"paging": true, "paging": true,
"searching": false, "searching": false,
"drawCallback": function ( settings ) { "drawCallback": function (settings) {
var api = this.api(); var api = this.api();
var rows = api.rows( {page:'current'} ).nodes(); var rows = api.rows({ page: 'current' }).nodes();
var last=null; var last = null;
api.column(groupColumn, {page:'current'} ).data().each( function ( group, i ) { api.column(groupColumn, { page: 'current' }).data().each(function (group, i) {
if ( last !== group ) { if (last !== group) {
$(rows).eq( i ).before( $(rows).eq(i).before(
'<tr class="group"><td colspan="9"><b>หน่วยงาน : '+group+'</b></td></tr>' '<tr class="group"><td colspan="9"><b>หน่วยงาน : ' + group + '</b></td></tr>'
); );
last = group; last = group;
} }
} ); });
} }
}); });
endLoad(); endLoad();
}; };
function eva_create_evaluation_detail_InitiateDataTable(id) { function eva_create_evaluation_detail_InitiateDataTable(id) {
startLoad(); startLoad();
$("#s_eva_create_evaluation_detail_create_evaluation_id").val(id); $("#s_eva_create_evaluation_detail_create_evaluation_id").val(id);
var p = $.param(eva_create_evaluation_detail_GetSearchParameter()); var p = $.param(eva_create_evaluation_detail_GetSearchParameter());
AjaxGetRequest(apisite + "/api/eva_create_evaluation_detail/GetListBySearch?"+p, eva_create_evaluation_detail_setupTable, AlertDanger); AjaxGetRequest(apisite + "/api/eva_create_evaluation_detail/GetListBySearch?" + p, eva_create_evaluation_detail_setupTable, AlertDanger);
} }
function eva_create_evaluation_detail_DoSearch() { function eva_create_evaluation_detail_DoSearch() {
@@ -220,10 +219,10 @@ function eva_create_evaluation_detail_DoSearch() {
var eva_create_evaluation_detail_reload = function (result) { var eva_create_evaluation_detail_reload = function (result) {
eva_create_evaluation_detailTableV.destroy(); eva_create_evaluation_detailTableV.destroy();
eva_create_evaluation_detail_setupTable(result); eva_create_evaluation_detail_setupTable(result);
endLoad(); endLoad();
}; };
startLoad(); startLoad();
AjaxGetRequest(apisite + "/api/eva_create_evaluation_detail/GetListBySearch?"+p, eva_create_evaluation_detail_reload, AlertDanger); AjaxGetRequest(apisite + "/api/eva_create_evaluation_detail/GetListBySearch?" + p, eva_create_evaluation_detail_reload, AlertDanger);
} }
function eva_create_evaluation_detail_GetSelect(f) { function eva_create_evaluation_detail_GetSelect(f) {
@@ -233,15 +232,15 @@ function eva_create_evaluation_detail_GetSelect(f) {
}); });
//alert(eva_create_evaluation_detail_selectitem); //alert(eva_create_evaluation_detail_selectitem);
rep_eva_x_DoSearch("pdf", eva_create_evaluation_detail_selectitem) rep_eva_x_DoSearch("pdf", eva_create_evaluation_detail_selectitem, 0); // 0 คือ ไม่ต้องต่อท้ายแบบข้อตกลง ออกมา
} }
function eva_create_evaluation_detail_SelectAll(){ function eva_create_evaluation_detail_SelectAll() {
eva_create_evaluation_detailTableV.rows().select(); eva_create_evaluation_detailTableV.rows().select();
} }
function eva_create_evaluation_detail_DeselectAll(){ function eva_create_evaluation_detail_DeselectAll() {
eva_create_evaluation_detailTableV.rows().deselect(); eva_create_evaluation_detailTableV.rows().deselect();
} }

View File

@@ -28,20 +28,20 @@ function eva_create_evaluation_detail_agreement_FeedDataToForm(data) {
function eva_create_evaluation_detail_agreement_GetFromForm() { function eva_create_evaluation_detail_agreement_GetFromForm() {
var eva_create_evaluation_detail_agreementObject = new Object(); var eva_create_evaluation_detail_agreementObject = new Object();
eva_create_evaluation_detail_agreementObject.id = $("#eva_create_evaluation_detail_agreement_id").val(); eva_create_evaluation_detail_agreementObject.id = $("#eva_create_evaluation_detail_agreement_id").val();
eva_create_evaluation_detail_agreementObject.evaluation_round = $("#eva_create_evaluation_detail_agreement_evaluation_round").text(); eva_create_evaluation_detail_agreementObject.evaluation_round = $("#eva_create_evaluation_detail_agreement_evaluation_round").text();
eva_create_evaluation_detail_agreementObject.employee_code = $("#eva_create_evaluation_detail_agreement_employee_code").text(); eva_create_evaluation_detail_agreementObject.employee_code = $("#eva_create_evaluation_detail_agreement_employee_code").text();
eva_create_evaluation_detail_agreementObject.employee_fullname = $("#eva_create_evaluation_detail_agreement_employee_fullname").text(); eva_create_evaluation_detail_agreementObject.employee_fullname = $("#eva_create_evaluation_detail_agreement_employee_fullname").text();
eva_create_evaluation_detail_agreementObject.employee_position = $("#eva_create_evaluation_detail_agreement_employee_position").text(); eva_create_evaluation_detail_agreementObject.employee_position = $("#eva_create_evaluation_detail_agreement_employee_position").text();
eva_create_evaluation_detail_agreementObject.employee_position_type = $("#eva_create_evaluation_detail_agreement_employee_position_type").text(); eva_create_evaluation_detail_agreementObject.employee_position_type = $("#eva_create_evaluation_detail_agreement_employee_position_type").text();
eva_create_evaluation_detail_agreementObject.employee_position_level = $("#eva_create_evaluation_detail_agreement_employee_position_level").text(); eva_create_evaluation_detail_agreementObject.employee_position_level = $("#eva_create_evaluation_detail_agreement_employee_position_level").text();
eva_create_evaluation_detail_agreementObject.employee_org = $("#eva_create_evaluation_detail_agreement_employee_org").text(); eva_create_evaluation_detail_agreementObject.employee_org = $("#eva_create_evaluation_detail_agreement_employee_org").text();
eva_create_evaluation_detail_agreementObject.chief_fullname = $("#eva_create_evaluation_detail_agreement_chief_fullname").text(); eva_create_evaluation_detail_agreementObject.chief_fullname = $("#eva_create_evaluation_detail_agreement_chief_fullname").text();
eva_create_evaluation_detail_agreementObject.chief_position = $("#eva_create_evaluation_detail_agreement_chief_position").text(); eva_create_evaluation_detail_agreementObject.chief_position = $("#eva_create_evaluation_detail_agreement_chief_position").text();
eva_create_evaluation_detail_agreementObject.create_evaluation_id = $("#eva_create_evaluation_detail_agreement_create_evaluation_id").val(); eva_create_evaluation_detail_agreementObject.create_evaluation_id = $("#eva_create_evaluation_detail_agreement_create_evaluation_id").val();
eva_create_evaluation_detail_agreementObject.org_id = $("#eva_create_evaluation_detail_agreement_org_id").val(); eva_create_evaluation_detail_agreementObject.org_id = $("#eva_create_evaluation_detail_agreement_org_id").val();
eva_create_evaluation_detail_agreementObject.search_employee_code = $("#eva_create_evaluation_detail_agreement_search_employee_code").val(); eva_create_evaluation_detail_agreementObject.search_employee_code = $("#eva_create_evaluation_detail_agreement_search_employee_code").val();
eva_create_evaluation_detail_agreementObject.search_employee_fullname = $("#eva_create_evaluation_detail_agreement_search_employee_fullname").val(); eva_create_evaluation_detail_agreementObject.search_employee_fullname = $("#eva_create_evaluation_detail_agreement_search_employee_fullname").val();
return eva_create_evaluation_detail_agreementObject; return eva_create_evaluation_detail_agreementObject;
@@ -50,9 +50,9 @@ eva_create_evaluation_detail_agreementObject.search_employee_fullname = $("#eva_
function eva_create_evaluation_detail_agreement_InitialForm() { function eva_create_evaluation_detail_agreement_InitialForm() {
var successFunc = function (result) { var successFunc = function (result) {
eva_create_evaluation_detail_agreement_FeedDataToForm(result); eva_create_evaluation_detail_agreement_FeedDataToForm(result);
endLoad(); endLoad();
}; };
startLoad(); startLoad();
AjaxGetRequest(apisite + eva_create_evaluation_detail_agreement_API + "GetBlankItem", successFunc, AlertDanger); AjaxGetRequest(apisite + eva_create_evaluation_detail_agreement_API + "GetBlankItem", successFunc, AlertDanger);
} }
@@ -62,15 +62,15 @@ function eva_create_evaluation_detail_agreement_SetEditForm(a) {
var successFunc = function (result) { var successFunc = function (result) {
eva_create_evaluation_detail_agreement_editMode = "UPDATE"; eva_create_evaluation_detail_agreement_editMode = "UPDATE";
eva_create_evaluation_detail_agreement_FeedDataToForm(result); eva_create_evaluation_detail_agreement_FeedDataToForm(result);
endLoad(); endLoad();
}; };
startLoad(); startLoad();
AjaxGetRequest(apisite + eva_create_evaluation_detail_agreement_API + a, successFunc, AlertDanger); AjaxGetRequest(apisite + eva_create_evaluation_detail_agreement_API + a, successFunc, AlertDanger);
} }
function eva_create_evaluation_detail_agreement_SetCreateForm() { function eva_create_evaluation_detail_agreement_SetCreateForm() {
eva_create_evaluation_detail_agreement_editMode = "CREATE"; eva_create_evaluation_detail_agreement_editMode = "CREATE";
eva_create_evaluation_detail_agreement_InitialForm(); eva_create_evaluation_detail_agreement_InitialForm();
} }
//================= Update and Delete ========================================= //================= Update and Delete =========================================
@@ -80,8 +80,7 @@ var eva_create_evaluation_detail_agreement_customValidation = function (group) {
}; };
function eva_create_evaluation_detail_agreement_PutUpdate() { function eva_create_evaluation_detail_agreement_PutUpdate() {
if (!ValidateForm('eva_create_evaluation_detail_agreement', eva_create_evaluation_detail_agreement_customValidation)) if (!ValidateForm('eva_create_evaluation_detail_agreement', eva_create_evaluation_detail_agreement_customValidation)) {
{
return; return;
} }
var data = eva_create_evaluation_detail_agreement_GetFromForm(); var data = eva_create_evaluation_detail_agreement_GetFromForm();
@@ -90,18 +89,18 @@ function eva_create_evaluation_detail_agreement_PutUpdate() {
if (eva_create_evaluation_detail_agreement_editMode === "UPDATE") { if (eva_create_evaluation_detail_agreement_editMode === "UPDATE") {
var successFunc1 = function (result) { var successFunc1 = function (result) {
AlertSuccess(result.message); AlertSuccess(result.message);
endLoad(); endLoad();
}; };
startLoad(); startLoad();
AjaxPutRequest(apisite + eva_create_evaluation_detail_agreement_API + data.id, data, successFunc1, AlertDanger); AjaxPutRequest(apisite + eva_create_evaluation_detail_agreement_API + data.id, data, successFunc1, AlertDanger);
} }
// Create mode // Create mode
else { else {
var successFunc2 = function (result) { var successFunc2 = function (result) {
AlertSuccess(result.message); AlertSuccess(result.message);
endLoad(); endLoad();
}; };
startLoad(); startLoad();
AjaxPostRequest(apisite + eva_create_evaluation_detail_agreement_API, data, successFunc2, AlertDanger); AjaxPostRequest(apisite + eva_create_evaluation_detail_agreement_API, data, successFunc2, AlertDanger);
} }
} }
@@ -111,9 +110,9 @@ function eva_create_evaluation_detail_agreement_GoDelete(a) {
var successFunc = function (result) { var successFunc = function (result) {
AlertSuccess(result.message); AlertSuccess(result.message);
eva_create_evaluation_detail_agreement_RefreshTable(); eva_create_evaluation_detail_agreement_RefreshTable();
endLoad(); endLoad();
}; };
startLoad(); startLoad();
AjaxDeleteRequest(apisite + eva_create_evaluation_detail_agreement_API + a, null, successFunc, AlertDanger); AjaxDeleteRequest(apisite + eva_create_evaluation_detail_agreement_API + a, null, successFunc, AlertDanger);
} }
} }

View File

@@ -143,6 +143,20 @@ function eva_evaluation_achievement_PutUpdate() {
} }
} }
function eva_evaluation_achievement_reset_achievement() {
if (!confirm("ระบบจะล้างข้อมูลที่มีอยู่เดิม และดึงข้อมูลจากแบบข้อตกลง งด2/2 มาสร้างเป็น ผลสัมฤทธิ์ของงาน, คุณยืนยันที่จะดำเนินการใช่หรือไม่?")) {
return;
}
var successFunc1 = function (result) {
AlertSuccess(result.message);
eva_evaluation_achievement_RefreshTable();
endLoad();
};
startLoad();
AjaxPutRequest(apisite + eva_evaluation_achievement_API + "reset_achievement?id=" + getUrlParameter("id"), null, successFunc1, AlertDanger);
}
function eva_evaluation_achievement_GoDelete(a) { function eva_evaluation_achievement_GoDelete(a) {
if (confirm('คุณต้องการลบข้อมูล ใช่หรือไม่?')) { if (confirm('คุณต้องการลบข้อมูล ใช่หรือไม่?')) {
var successFunc = function (result) { var successFunc = function (result) {
@@ -175,7 +189,7 @@ var eva_evaluation_achievement_setupTable = function (result) {
"select": false, "select": false,
"columns": [ "columns": [
{ "data": "id" }, { "data": "id" },
{ "data": "achievement" }, { "data": "achievement_display" },
{ "data": "weight" }, { "data": "weight" },
{ "data": "target_score1" }, { "data": "target_score1" },
{ "data": "target_score2" }, { "data": "target_score2" },

View File

@@ -2,10 +2,10 @@
//================= Search Customizaiton ========================================= //================= Search Customizaiton =========================================
function rep_eva_x_GetSearchParameter(fileType, data) { function rep_eva_x_GetSearchParameter(fileType, data, add22) {
var rep_eva_xSearchObject = new Object(); var rep_eva_xSearchObject = new Object();
rep_eva_xSearchObject.detail_id = data; rep_eva_xSearchObject.detail_id = data;
rep_eva_xSearchObject.is_print_22 = add22;
rep_eva_xSearchObject.fileType = fileType; rep_eva_xSearchObject.fileType = fileType;
@@ -15,7 +15,7 @@ rep_eva_xSearchObject.detail_id = data;
} }
function rep_eva_x_FeedDataToSearchForm(data) { function rep_eva_x_FeedDataToSearchForm(data) {
$("#s_rep_eva_x_detail_id").val(data.detail_id); $("#s_rep_eva_x_detail_id").val(data.detail_id);
} }
@@ -37,10 +37,10 @@ var s_rep_eva_x_customValidation = function (group) {
}; };
function rep_eva_x_DoSearch(fileType, data) { function rep_eva_x_DoSearch(fileType, data, add22) {
var p = $.param(rep_eva_x_GetSearchParameter(fileType, data)).replaceAll("%5B%5D", ''); var p = $.param(rep_eva_x_GetSearchParameter(fileType, data, add22)).replaceAll("%5B%5D", '');
//console.log(p); //console.log(p);
var report_url = apisite + "/api/rep_eva_x/rep_eva_x_report?" + p; var report_url = apisite + "/api/rep_eva_x/rep_eva_x_report?" + p;