[CLAUDE] FE-Admin: KHKK bo khung o nhap tren dong da co, giu khung dong them (FE-only, 0-mig)
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 6m54s

Anh khoanh 2 khoi doi nhau tren man nhap:
  - khoi bao 2 DONG DA CO  -> "Cac cai mau bo di nhe"
  - mui ten toi DONG THEM  -> "De mac dinh cai nay thoi"

Doc thanh MOT CAP: dong da co thi doc nhu DU LIEU (bo khung o nhap), rieng dong
them moi giu khung mac dinh vi no la FORM. Cach doc kia (xoa du lieu mau) khong
khop — anh da co nut thung rac, va "de mac dinh" khong ap duoc cho mot dong chua
co du lieu nao.

Da lam — CHI doi VE, KHONG doi hanh vi:
  - o Hang muc + o Gia cua DONG DA CO: border-slate-200 bg-white
    -> border-transparent bg-transparent + hover:border-slate-200
       + focus-visible:border-brand-500 focus-visible:bg-white
    Dung khuon o Ghi chu ngay duoi (da ghost tu S175) => 3 truong cua mot dong nay
    NOI CUNG mot ngon ngu.
  - Van la <select>/<input> that: sua duoc, tu luu khi roi o. Mui ten dropdown cua
    native select van hien nen khong mat tin-hieu "o nay bam duoc".
  - DONG THEM: KHONG dung mot ky tu nao ("de mac dinh cai nay thoi").

Do duoc (truoc/sau + control duong):
  - nguon o Hang muc CO khung: @HEAD = 2 (ca dong du lieu lan dong them) -> now = 1
    (chi con dong them). dist admin/user = 1/1.
  - CONTROL duong: lop ghost MOI cua dong du lieu = 1/1 o ca 2 dist => phep do dang
    chay, khong phai 0-vi-do-hong.
  - dem lop ghost trong nguon = 4 = select + gia + ghi chu (dong du lieu) + ghi chu
    (dong them, von da ghost).
  - 🔴 :554 va :685 co class GIONG HET NHAU => sua kem ngu canh, khong replace-all;
    da doi chieu sau khi sua: 2 o con khung deu nam trong dong them (:693 :718).

Diff CHI 2 file FE, 0 file BE => .NET test khong the bi anh huong, bo qua vong test do
(khai ro). 2 app build sach · SHA IDENTICAL (verify identical @HEAD TRUOC khi copy de).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
pqhuy1987
2026-08-06 16:55:38 +07:00
parent 35db51a3d9
commit ca9208f686
2 changed files with 20 additions and 4 deletions

View File

@ -551,7 +551,14 @@ export function KhkkDetailContent({
onChange={(e) => e.target.value && assignLine.mutate({ lineId: l.id, catalogEntryId: e.target.value })} onChange={(e) => e.target.value && assignLine.mutate({ lineId: l.id, catalogEntryId: e.target.value })}
disabled={assignLine.isPending} disabled={assignLine.isPending}
aria-label={`Chọn hạng mục cho dòng ${l.id}`} aria-label={`Chọn hạng mục cho dòng ${l.id}`}
className="h-8 w-full rounded-md border border-slate-200 bg-white px-2 text-xs text-slate-700 focus-visible:border-brand-500 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-500/30" // [S177 — anh: "Các cái mẫu bỏ đi nhé"] DÒNG ĐÃ CÓ = đọc như DỮ
// LIỆU, không như form: viền trong suốt + nền trong suốt, khung chỉ
// hiện khi rê chuột / vào ô. Đúng khuôn ô Ghi chú ngay dưới (đã ghost
// từ S175) ⇒ 3 trường của một dòng nay CÙNG một ngôn ngữ.
// 🔴 Chỉ đổi VẺ, KHÔNG đổi hành vi: vẫn `<select>` thật, vẫn sửa
// được, vẫn tự lưu. Mũi tên dropdown của native select vẫn hiện nên
// không mất tín-hiệu "ô này bấm được".
className="h-8 w-full rounded border border-transparent bg-transparent px-2 text-xs text-slate-700 hover:border-slate-200 focus-visible:border-brand-500 focus-visible:bg-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-500/30"
> >
<option value=""> Chọn hạng mục </option> <option value=""> Chọn hạng mục </option>
{l.catalogEntryId && !(catalogOptions.data ?? []).some((c) => c.id === l.catalogEntryId) && ( {l.catalogEntryId && !(catalogOptions.data ?? []).some((c) => c.id === l.catalogEntryId) && (
@ -607,7 +614,8 @@ export function KhkkDetailContent({
if (!Number.isFinite(v) || v < 0) { e.target.value = String(l.proposedAmount); return } if (!Number.isFinite(v) || v < 0) { e.target.value = String(l.proposedAmount); return }
if (v !== l.proposedAmount) saveLineField.mutate({ lineId: l.id, proposedAmount: v }) if (v !== l.proposedAmount) saveLineField.mutate({ lineId: l.id, proposedAmount: v })
}} }}
className="h-8 w-full rounded-md border border-slate-200 bg-white px-2 text-right text-xs tabular-nums text-brand-800 focus-visible:border-brand-500 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-500/30" // [S177] Cùng lý lẽ với ô hạng mục ngay trên — bỏ khung ở dòng ĐÃ CÓ.
className="h-8 w-full rounded border border-transparent bg-transparent px-2 text-right text-xs tabular-nums text-brand-800 hover:border-slate-200 focus-visible:border-brand-500 focus-visible:bg-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-500/30"
/> />
) : moneyOrDash(l.proposedAmount)} ) : moneyOrDash(l.proposedAmount)}
</td> </td>

View File

@ -551,7 +551,14 @@ export function KhkkDetailContent({
onChange={(e) => e.target.value && assignLine.mutate({ lineId: l.id, catalogEntryId: e.target.value })} onChange={(e) => e.target.value && assignLine.mutate({ lineId: l.id, catalogEntryId: e.target.value })}
disabled={assignLine.isPending} disabled={assignLine.isPending}
aria-label={`Chọn hạng mục cho dòng ${l.id}`} aria-label={`Chọn hạng mục cho dòng ${l.id}`}
className="h-8 w-full rounded-md border border-slate-200 bg-white px-2 text-xs text-slate-700 focus-visible:border-brand-500 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-500/30" // [S177 — anh: "Các cái mẫu bỏ đi nhé"] DÒNG ĐÃ CÓ = đọc như DỮ
// LIỆU, không như form: viền trong suốt + nền trong suốt, khung chỉ
// hiện khi rê chuột / vào ô. Đúng khuôn ô Ghi chú ngay dưới (đã ghost
// từ S175) ⇒ 3 trường của một dòng nay CÙNG một ngôn ngữ.
// 🔴 Chỉ đổi VẺ, KHÔNG đổi hành vi: vẫn `<select>` thật, vẫn sửa
// được, vẫn tự lưu. Mũi tên dropdown của native select vẫn hiện nên
// không mất tín-hiệu "ô này bấm được".
className="h-8 w-full rounded border border-transparent bg-transparent px-2 text-xs text-slate-700 hover:border-slate-200 focus-visible:border-brand-500 focus-visible:bg-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-500/30"
> >
<option value=""> Chọn hạng mục </option> <option value=""> Chọn hạng mục </option>
{l.catalogEntryId && !(catalogOptions.data ?? []).some((c) => c.id === l.catalogEntryId) && ( {l.catalogEntryId && !(catalogOptions.data ?? []).some((c) => c.id === l.catalogEntryId) && (
@ -607,7 +614,8 @@ export function KhkkDetailContent({
if (!Number.isFinite(v) || v < 0) { e.target.value = String(l.proposedAmount); return } if (!Number.isFinite(v) || v < 0) { e.target.value = String(l.proposedAmount); return }
if (v !== l.proposedAmount) saveLineField.mutate({ lineId: l.id, proposedAmount: v }) if (v !== l.proposedAmount) saveLineField.mutate({ lineId: l.id, proposedAmount: v })
}} }}
className="h-8 w-full rounded-md border border-slate-200 bg-white px-2 text-right text-xs tabular-nums text-brand-800 focus-visible:border-brand-500 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-500/30" // [S177] Cùng lý lẽ với ô hạng mục ngay trên — bỏ khung ở dòng ĐÃ CÓ.
className="h-8 w-full rounded border border-transparent bg-transparent px-2 text-right text-xs tabular-nums text-brand-800 hover:border-slate-200 focus-visible:border-brand-500 focus-visible:bg-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-500/30"
/> />
) : moneyOrDash(l.proposedAmount)} ) : moneyOrDash(l.proposedAmount)}
</td> </td>