Project

General

Profile

Feature #26236

[OEE] Operation Mode : เพิ่ม Edit History Log & Popup Display

Added by Suphawan Phiwngam 20 days ago.

Status:
New
Priority:
Normal
Start date:
03/27/2026
Due date:
% Done:

0%

Estimated time:

Description

เพิ่มแสดงประวัติการแก้ไข (Edit History) Operation Mode ในหน้า Availability History / Performance History / Quality History เพื่อให้ตรวจสอบการแก้ไขข้อมูลย้อนหลังได้
  • Table: operation_edit_log
    ใช้สำหรับเก็บ log การแก้ไข เพิ่มที่ oee_main
    Fields
    id (PK)
    ref_id (FK) →อ้างอิง iot_a / iot_p / iot_q
    module (iot_a / iot_p / iot_q)
    action (edit / delete)
    old_data
    new_data
    created_date
    created_by
    
  • Add History Icon
    เพิ่ม icon (ℹ️ หรือ info icon) หลัง column Asset
    เมื่อกด icon → ให้แสดง Popup (Modal)
  • Popup – Edit History Table
    Popup ต้องแสดงข้อมูลในรูปแบบ table Columns
    Field Description
    Action edit / delete
    User ผู้ที่แก้ไข
    Datetime วันที่เวลาแก้ไข
    Old Data ข้อมูลก่อนแก้
    New Data ข้อมูลหลังแก้
  • Logic
    1. เมื่อมีการ Edit
      เก็บข้อมูลก่อนแก้ → old_data
      เก็บข้อมูลหลังแก้ → new_data
      action = edit
    2. เมื่อมีการ Delete
      เก็บข้อมูลก่อนลบ → old_data
      new_data = null
      action = delete
    3. การดึงข้อมูลไปแสดง
      query จาก operation_edit_log
      filter ด้วย ref_id ของ record นั้น
      order by created_at DESC

Files

Also available in: Atom PDF