!24 Merge branch 'dev' into change

Merge pull request !24 from 王瑞雪/change
This commit is contained in:
sophie authored and Gitee committed 2026-10-13 08:19:18 +00:00
commit c305d0544b
20 files changed
+904 -191

No files matched your search

@@ -3,9 +3,11 @@
* 依赖:统一 requestJson(失败抛 BusinessError);后端 /api/order-delivery-reply。
* 逻辑:列表筛选分页、保存批次(单行/联合)、单行与批量通知、手动同步与最近同步状态。
* 带 JSON 正文的写请求在本文件声明 Content-Type: application/json,供 Flask get_json 解析。
* 按当前筛选导出 Excel(后端生成 xlsx,blob 触发下载)。
*/
import { requestJson } from '@/shared/api/client';
import { getAuthHeaders } from '@/shared/utils/auth';
/**
* 组装带 JSON 正文的写请求。
@@ -157,3 +159,41 @@ export const runOrderDeliverySync = () =>
/** 最近一次同步运行记录;从未同步过返回 null。 */
export const getLatestOrderDeliverySync = () =>
requestJson<OrderDeliverySyncRun | null>('/api/order-delivery-reply/sync/latest');
/** 导出 Excel 查询参数(与列表筛选一致;导出全部命中行,不分页)。 */
export interface OrderDeliveryExportParams {
keyword?: string;
order_date?: string;
status?: '' | 'replied' | 'not_fully_replied';
}
/**
* 导出当前筛选下的全部订单行 Excel。
* 触发时机:工具栏「导出 Excel」按钮。后端生成 xlsx 文件流,此处 blob 触发浏览器下载,
* 文件名「订单交期回复_YYYY-MM-DD.xlsx」(日期取本地当天);失败抛 Error(HTTP 状态码)。
*/
export async function exportOrderDeliveryLines(params: OrderDeliveryExportParams): Promise<void> {
const query = new URLSearchParams();
if (params.keyword) query.set('keyword', params.keyword);
if (params.order_date) query.set('order_date', params.order_date);
if (params.status) query.set('status', params.status);
const response = await fetch(`/api/order-delivery-reply/lines/export?${query.toString()}`, {
method: 'GET',
headers: getAuthHeaders(),
});
if (!response.ok) {
throw new Error(`Export failed: HTTP ${response.status}`);
}
const blob = await response.blob();
const url = URL.createObjectURL(blob);
const link = document.createElement('a');
link.href = url;
// 文件名日期取浏览器本地时区(toISOString 为 UTC,北京时间 0-8 点导出会差一天)
const now = new Date();
const localDate = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, '0')}-${String(now.getDate()).padStart(2, '0')}`;
link.download = `订单交期回复_${localDate}.xlsx`;
document.body.appendChild(link);
link.click();
link.remove();
URL.revokeObjectURL(url);
}
@@ -0,0 +1,171 @@
/**
* features/order-delivery-reply/views/OrderDeliveryReplyPage.chipEdit.spec.ts
* 用途:锁定「批次条就地编辑」核心契约(回归用)。
* 依赖:vitest、@vue/test-utils、vue-i18n、vue-router memory history。
* 逻辑:完整挂载工作台页(mock API/权限/消息):
* 1) 未回复行点击空批次条进入编辑态,填写日期+数量失焦 → 调用单行保存接口(整行批次);
* 2) 只填数量不填日期失焦 → 不保存且行内红字提示(batchMissingDate);
* 3) 多批次行改其中一条数量致合计≠订单数量 → 不保存且红字提示(qtyTotalMismatchLine)。
*/
import { describe, expect, it, vi, beforeEach } from 'vitest';
import { flushPromises, mount } from '@vue/test-utils';
import { createI18n } from 'vue-i18n';
import { createRouter, createMemoryHistory } from 'vue-router';
import OrderDeliveryReplyPage from './OrderDeliveryReplyPage.vue';
const hoisted = vi.hoisted(() => ({
listMock: vi.fn(),
saveMock: vi.fn(),
batchMock: vi.fn(),
notifyMock: vi.fn(),
syncMock: vi.fn(),
latestSyncMock: vi.fn(),
requestJsonMock: vi.fn(),
messageMocks: { info: vi.fn(), success: vi.fn(), warning: vi.fn(), error: vi.fn() },
}));
vi.mock('@/features/order-delivery-reply/api/orderDeliveryReply.api', () => ({
listOrderDeliveryLines: hoisted.listMock,
saveOrderDeliveryBatches: hoisted.saveMock,
batchReplyOrderDelivery: hoisted.batchMock,
notifyOrderDeliveryBatch: hoisted.notifyMock,
runOrderDeliverySync: hoisted.syncMock,
getLatestOrderDeliverySync: hoisted.latestSyncMock,
}));
vi.mock('@/shared/api/client', () => ({
requestJson: hoisted.requestJsonMock,
}));
vi.mock('@/shared/composables/useMessage', () => ({
useMessage: () => hoisted.messageMocks,
}));
vi.mock('@/features/auth/stores/auth.store', () => ({
useAuthStore: () => ({ hasFeaturePermission: () => true }),
}));
/** 两行样例:A 未回复(空批次,订单数量 1);B 部分回复(3 批次 30/50/20,订单数量 100)。 */
const sampleLines = [
{
id: 1,
order_no: '8301-T1',
line_no: 4,
qty: '1',
unit: 'SET',
status: 'not_replied' as const,
locked: false,
batches: [] as { seq?: number; planned_date: string; qty: string; remark?: string | null }[],
undelivered_qty: '1',
},
{
id: 2,
order_no: '8301-T2',
line_no: 1,
qty: '100',
unit: 'PCS',
status: 'partial_replied' as const,
locked: false,
batches: [
{ seq: 1, planned_date: '2026-09-04', qty: '30', remark: null },
{ seq: 2, planned_date: '2026-09-11', qty: '50', remark: null },
{ seq: 3, planned_date: '2026-09-23', qty: '20', remark: null },
],
undelivered_qty: '0',
},
];
const mountPage = async () => {
const router = createRouter({
history: createMemoryHistory(),
routes: [{ path: '/:pathMatch(.*)*', component: { template: '<div />' } }],
});
router.push('/chat/39');
await router.isReady();
const i18n = createI18n({ legacy: false, locale: 'zh-CN', messages: { 'zh-CN': {} } });
const wrapper = mount(OrderDeliveryReplyPage, {
global: {
plugins: [router, i18n],
stubs: { PaginationBar: true, DeleteConfirmDialog: true },
},
});
await flushPromises();
return wrapper;
};
describe('OrderDeliveryReplyPage 批次条就地编辑', () => {
beforeEach(() => {
vi.clearAllMocks();
hoisted.listMock.mockResolvedValue({ items: sampleLines, page: 1, page_size: 50, total: 2 });
hoisted.latestSyncMock.mockResolvedValue(null);
hoisted.saveMock.mockResolvedValue({ order_no: '8301-T1', line_no: 4, batches: [], total_qty: '1' });
hoisted.requestJsonMock.mockResolvedValue(undefined);
});
it('未回复行:点击空批次条进入编辑,填写日期+数量失焦后调用单行保存', async () => {
const wrapper = await mountPage();
// 未回复行(8301-T1:4)的可编辑空批次条:title 为 replyAction 键(i18n 缺失时回退键名)
const emptyChip = wrapper.find('div[title="workspace.orderDeliveryReply.replyAction"]');
expect(emptyChip.exists()).toBe(true);
await emptyChip.trigger('click');
await flushPromises();
// 编辑态输入条出现(data-chip-edit),自动聚焦日期框
const editor = wrapper.find('[data-chip-edit]');
expect(editor.exists()).toBe(true);
const dateInput = editor.find('[data-chip-date]');
expect((dateInput.element as HTMLInputElement).value).toBe('');
// 填写日期 + 数量后失焦提交
await dateInput.setValue('2026-10-20');
await editor.find('input[type="number"]').setValue('1');
await editor.trigger('focusout');
await flushPromises();
expect(hoisted.saveMock).toHaveBeenCalledTimes(1);
expect(hoisted.saveMock).toHaveBeenCalledWith('8301-T1', 4, [
{ planned_date: '2026-10-20', qty: '1', remark: null },
]);
});
it('未回复行:只填数量不填日期失焦 → 不保存且红字提示缺交期', async () => {
const wrapper = await mountPage();
const emptyChip = wrapper.find('div[title="workspace.orderDeliveryReply.replyAction"]');
await emptyChip.trigger('click');
await flushPromises();
const editor = wrapper.find('[data-chip-edit]');
await editor.find('input[type="number"]').setValue('1');
await editor.trigger('focusout');
await flushPromises();
expect(hoisted.saveMock).not.toHaveBeenCalled();
const hint = wrapper.find('p.text-status-error');
expect(hint.exists()).toBe(true);
expect(hint.text()).toContain('batchMissingDate');
});
it('多批次行:改第 2 条数量致合计≠订单数量失焦 → 不保存且红字提示', async () => {
const wrapper = await mountPage();
// B 行(8301-T2:1)首条批次条:title 为 editReplyAction 键
const chips = wrapper.findAll('div[title="workspace.orderDeliveryReply.editReplyAction"]');
expect(chips.length).toBeGreaterThanOrEqual(1);
await chips[0].trigger('click');
await flushPromises();
const editor = wrapper.find('[data-chip-edit]');
// 预填首条批次当前值
expect((editor.find('[data-chip-date]').element as HTMLInputElement).value).toBe('2026-09-04');
// 只改数量为 60 → 30→60 后合计 130 ≠ 100
await editor.find('input[type="number"]').setValue('60');
await editor.trigger('focusout');
await flushPromises();
expect(hoisted.saveMock).not.toHaveBeenCalled();
const hint = wrapper.find('p.text-status-error');
expect(hint.exists()).toBe(true);
expect(hint.text()).toContain('qtyTotalMismatchLine');
});
});
@@ -1,7 +1,8 @@
/**
* features/order-delivery-reply/views/OrderDeliveryReplyPage.vue
* 用途:订单交期回复工作台操作页——筛选分页、单行/联合回复批次、单行/批量通知、手动同步。
* 依赖:api/orderDeliveryReply.api(统一 requestJson)、useMessage、auth store(manage/access 权限)。
* 依赖:api/orderDeliveryReply.api(统一 requestJson)、useMessage、auth store(manage/access 权限)、
* shared DeleteConfirmDialog(批量通知二次确认)、PaginationBar。
* 逻辑:所有数据只读本地快照;保存与通知是两步(联合回复只保存,批量通知才发送并锁定);
* 保存/通知成功后即时刷新列表(需求 §9);仅 access 用户隐藏全部写操作。
* 回复弹窗数量守恒(2026-09-23 由「超额仅提醒」修订):每行各批次合计必须等于订单数量
@@ -10,10 +11,30 @@
* wecom_trace 上报打开回执——保证「点卡片 → 登录 → 直达该 Agent 对应内容与位置」。
* 列顺序:客户编号(简称副文案) → 订单日期 → 订单单号:项次 → 产品编号(品名副文案) →
* 客户产品编号 → 数量 → 约定交货日 → 交期回复状态 → 交期回复 → 交期回复人员 →
* 业务员(部门副文案) → 客户订单 → 规格 → 单位;独立的部门列/品名列已并入合并展示。
* 业务员(部门副文案) → 客户订单 → 规格 → 单位 → 通知时间(2026-10-09 自交期回复人员列拆出);
* 独立的部门列/品名列已并入合并展示。
* 浏览体验:页面高度收敛至视口(滚动全部发生在表格容器内 → 列头 sticky 固定、横向滚动条
* 常驻表格底缘);左侧冻结前四列标识区(勾选/客户编号/订单日期/订单单号:项次,
* 冻结单元格用实色背景防透出);筛选区与工具栏字号与表格统一(text-sm 14px)并压缩高度。
* 冻结单元格用 utilities.css 的 frozen-cell 实色基底防透出,并随行悬停/选中/直达高亮联动);
* 筛选区无外置字段标签(提示字占位已取消,含义由 placeholder/选项承担,aria-label 保留无障碍语义),
* 输入框/按钮显式 text-sm + h-9(36px),与合同付款预警 .contract-filter-input/.contract-filter-submit
* (14px/600/36px/圆角8px)渲染规格逐项一致。
* 交期回复列批次交互(2026-10-09):动作入口统一为批次条前的加号(lucide Plus,title/aria 复用
* replyAction/editReplyAction 键)——未回复=空批次条(不显示时间/数量)+ 加号回复;
* 已回复/部分回复=加号修改回复(仅未锁定可管理);「交期已锁定」徽标已取消(锁定状态由
* 无加号与交期回复人员列「已通知」体现)。全表批次条左缘对齐:所有行首条批次前保留
* w-6 加号占位,展开行其余批次条加 pl-7 缩进;>1 批时首条批次后保留展开/收起小箭头
* (▼ 全部 / ▲ 收起只留第一批)。
* 批次条就地编辑(2026-10-09):未锁定可管理行点击批次条原地变「日期+数量」输入(预填当前值;
* 未回复行空批次条点击=新增第一条批次),输入条渲染后自动聚焦日期框;回车/失焦自动保存单行
* 接口(整行批次提交,与弹窗保存同口径校验);校验失败红字持续显示并重聚焦日期框,直至修正
* 保存或 Esc 取消;双清空=放弃编辑;批次条不显示备注内容;多批次/备注仍走加号弹窗。
* 表格对齐(2026-10-09):除交期回复列(批次条按既定左对齐布局)外,全列内容水平居中、
* 行内容垂直居中,列头文字全部居中;交期回复状态徽标统一等宽(min-w-68px)。
* 设计系统(docs/ui/DESIGN_SYSTEM.md):根节点挂 page-shell;区块容器用 surface-panel;
* 弹窗用 dialog-overlay/panel/header/body/footer;输入用 input-field/select-field;
* 状态与交互色一律走 --status-* 令牌(badge-*/bg-row-*/frozen-cell-*),品牌强调用 brand-*。
* 批量通知确认使用共享 DeleteConfirmDialog(confirmTone=primary),不再用原生 window.confirm。
*/
<script setup lang="ts">
@@ -24,11 +45,14 @@ import { useAuthStore } from '@/features/auth/stores/auth.store';
import { useMessage } from '@/shared/composables/useMessage';
import { requestJson } from '@/shared/api/client';
import PaginationBar from '@/shared/components/PaginationBar.vue';
import DeleteConfirmDialog from '@/shared/components/DeleteConfirmDialog.vue';
import { ChevronDown, ChevronUp, Download, Plus } from 'lucide-vue-next';
import {
ORDER_DELIVERY_REPLY_MANAGE_PERMISSION,
} from '@/features/order-delivery-reply/constants';
import {
batchReplyOrderDelivery,
exportOrderDeliveryLines,
getLatestOrderDeliverySync,
listOrderDeliveryLines,
notifyOrderDeliveryBatch,
@@ -158,15 +182,13 @@ function toggleExpand(key: string) {
}
/* ============ 派生展示 ============ */
const repliedQty = (line: OrderDeliveryLine) =>
line.batches.reduce((sum, batch) => sum + Number(batch.qty || 0), 0);
const undelivered = (line: OrderDeliveryLine) => Number(line.undelivered_qty || 0);
type LineStatus = OrderDeliveryLine['status'];
/** 状态徽章:颜色走 badge-success/warning/error(--status-* 令牌,亮暗自适应)。 */
const statusMeta = (status: LineStatus) => {
const map: Record<LineStatus, { label: string; cls: string }> = {
not_replied: { label: t('workspace.orderDeliveryReply.statusNotReplied'), cls: 'bg-rose-50 text-rose-600' },
partial_replied: { label: t('workspace.orderDeliveryReply.statusPartial'), cls: 'bg-orange-50 text-orange-600' },
replied: { label: t('workspace.orderDeliveryReply.statusReplied'), cls: 'bg-emerald-50 text-emerald-600' },
not_replied: { label: t('workspace.orderDeliveryReply.statusNotReplied'), cls: 'badge-error' },
partial_replied: { label: t('workspace.orderDeliveryReply.statusPartial'), cls: 'badge-warning' },
replied: { label: t('workspace.orderDeliveryReply.statusReplied'), cls: 'badge-success' },
};
return map[status];
};
@@ -184,6 +206,7 @@ const quickDate = ref('');
const saving = ref(false);
function openReplyModal(lines: OrderDeliveryLine[], title: string, mode: 'single' | 'batch') {
cancelChipEdit(); // 打开弹窗前退出批次条就地编辑,避免弹窗与行内编辑态叠加
modalLines.value = lines.map((line) => ({
line,
batches: line.batches.map((batch) => ({
@@ -203,10 +226,12 @@ function openReplyModal(lines: OrderDeliveryLine[], title: string, mode: 'single
}
function openSingleReply(line: OrderDeliveryLine) {
if (chipSaving.value) return; // 保存进行中禁止开弹窗:弹窗按旧批次数据提交会覆盖刚保存的编辑
openReplyModal([line], t('workspace.orderDeliveryReply.modalTitleSingle', { order: line.order_no, item: line.line_no }), 'single');
}
function openBatchReply() {
if (chipSaving.value) return;
const lines = selectedLines.value.filter((line) => !line.locked);
if (!lines.length) return;
openReplyModal(lines, t('workspace.orderDeliveryReply.modalTitleBatch', { count: lines.length }), 'batch');
@@ -316,15 +341,153 @@ async function saveReplies() {
}
}
/* ============ 批次条就地编辑(2026-10-09) ============ */
// 未锁定且可管理的行:点击批次条原地变「日期+数量」输入,回车/失焦自动保存单行接口;
// 校验与弹窗同口径(lineIssueText:缺交期/缺数量、同单交期重复、合计≠订单数量),红字阻断保存;
// 双清空=放弃编辑(行内不提供删除,结构调整/备注/多批次走加号弹窗)。
const editingChip = ref<{ key: string; idx: number } | null>(null);
const chipDraft = reactive({ planned_date: '', qty: '' });
const chipIssue = ref('');
// 单行保存进行中标志:整行提交语义下,禁止并发(再点其他批次条/开弹窗),
// 否则两个 in-flight 保存或「弹窗基于旧批次数据」会互相覆盖丢编辑
const chipSaving = ref(false);
const isChipEditable = (line: OrderDeliveryLine) => canManage.value && !line.locked;
const isChipEditing = (line: OrderDeliveryLine, idx: number) =>
editingChip.value?.key === lineKey(line) && editingChip.value?.idx === idx;
function startChipEdit(line: OrderDeliveryLine, idx: number) {
if (!isChipEditable(line) || chipSaving.value) return;
// 未回复行批次列表为空:idx=0 表示「新增第一条批次」,同样可进入编辑
if (line.batches.length > 0 && idx >= line.batches.length) return;
const batch = line.batches[idx];
editingChip.value = { key: lineKey(line), idx };
chipDraft.planned_date = batch?.planned_date ?? '';
chipDraft.qty = batch ? String(Number(batch.qty)) : '';
chipIssue.value = '';
// 输入条渲染后自动聚焦日期框,点击即可填
void nextTick(() => {
document.querySelector<HTMLInputElement>('[data-chip-edit] [data-chip-date]')?.focus();
});
}
function cancelChipEdit() {
editingChip.value = null;
chipIssue.value = '';
}
/** 失焦提交:relatedTarget 仍在输入条内(日期↔数量切换)时不提交。 */
function onChipFocusout(event: FocusEvent, line: OrderDeliveryLine, idx: number) {
const next = event.relatedTarget as Node | null;
if (next && (event.currentTarget as HTMLElement).contains(next)) return;
chipCommit(line, idx);
}
function chipCommit(line: OrderDeliveryLine, idx: number) {
if (!isChipEditing(line, idx) || chipSaving.value) return;
// 注意:v-model 在 type="number" 输入框上会自动把值转成 number,
// 这里必须统一 String() 容错,否则 qty.trim() 抛 TypeError 中断整个失焦提交
const date = String(chipDraft.planned_date ?? '').trim();
const qty = String(chipDraft.qty ?? '').trim();
// 双清空=放弃编辑;只填其一致「缺交期/缺数量」红字,保持编辑态
if (!date && !(qty !== '' && Number(qty) > 0)) {
cancelChipEdit();
return;
}
// 整行批次合并提交,与弹窗保存完全同口径:
// 编辑已有批次=仅替换该条;未回复行空批次条=新增第一条(line.batches 为空数组)
const source = line.batches[idx];
const edited: EditableBatch = { planned_date: date, qty, remark: source?.remark || '' };
const merged: EditableBatch[] =
idx < line.batches.length
? line.batches.map((b, i) =>
i === idx ? edited : { planned_date: b.planned_date, qty: String(Number(b.qty)), remark: b.remark || '' },
)
: [edited];
const issue = lineIssueText({ line, batches: merged });
if (issue) {
chipIssue.value = issue;
// 校验失败:保持编辑态并重新聚焦日期框,红字提示持续可见,直至修正保存或 Esc 取消
void nextTick(() => {
document.querySelector<HTMLInputElement>('[data-chip-edit] [data-chip-date]')?.focus();
});
return;
}
const cleaned = merged
.filter((b) => b.planned_date && Number(b.qty) > 0)
.map((b) => ({ planned_date: b.planned_date, qty: b.qty, remark: b.remark.trim() || null }));
if (!cleaned.length) {
cancelChipEdit();
return;
}
void saveChipEdit(line, idx, cleaned);
}
async function saveChipEdit(
line: OrderDeliveryLine,
idx: number,
cleaned: { planned_date: string; qty: string; remark: string | null }[],
) {
const target = { key: lineKey(line), idx };
chipSaving.value = true;
try {
await saveOrderDeliveryBatches(line.order_no, line.line_no, cleaned);
msg.success(t('workspace.orderDeliveryReply.saveSingleDone'));
// 仅当用户未切去编辑其他批次条时才退出编辑态
if (editingChip.value?.key === target.key && editingChip.value?.idx === target.idx) {
cancelChipEdit();
}
await loadLines();
// loadLines 重建行 DOM:若用户已切去编辑其他批次条,重聚焦其日期框,
// 否则焦点丢失后后续「失焦提交」永远不会触发(表现为填了不保存)
if (editingChip.value) {
void nextTick(() => {
document.querySelector<HTMLInputElement>('[data-chip-edit] [data-chip-date]')?.focus();
});
}
} catch (error) {
msg.error(error instanceof Error ? error.message : t('workspace.orderDeliveryReply.saveFailedTitle'));
const message = error instanceof Error ? error.message : '';
if (message.includes('LINE_NOT_FOUND') || message.includes('不在同步范围') || message.includes('not found')) {
editingChip.value = null;
chipIssue.value = '';
await loadLines();
}
} finally {
chipSaving.value = false;
}
}
/* ============ 导出 Excel(2026-10-09) ============ */
const exporting = ref(false);
/** 按当前筛选(appliedFilters)导出全部命中行;后端生成 xlsx,前端 blob 触发下载。 */
async function doExportExcel() {
exporting.value = true;
try {
await exportOrderDeliveryLines({ ...appliedFilters });
msg.success(t('workspace.orderDeliveryReply.exportDone'));
} catch (error) {
msg.error(error instanceof Error ? error.message : t('workspace.orderDeliveryReply.exportFailed'));
} finally {
exporting.value = false;
}
}
/* ============ 通知 ============ */
const notifying = ref(false);
const notifyConfirmVisible = ref(false);
/** 批量通知入口:先弹共享 DeleteConfirmDialog(primary 语气)二次确认,确认后执行 doNotifyBatch。 */
function requestNotifyBatch() {
if (!notifiableSelected.value.length) return;
notifyConfirmVisible.value = true;
}
/** 批量通知:部分成功 warning 汇总,全部失败 error;提示后刷新列表让锁定即时生效。 */
async function doNotifyBatch() {
const lines = notifiableSelected.value;
if (!lines.length) return;
const ok = window.confirm(t('workspace.orderDeliveryReply.notifyBatchConfirm', { count: lines.length }));
if (!ok) return;
notifying.value = true;
try {
const summary = await notifyOrderDeliveryBatch(lines.map((line) => ({ order_no: line.order_no, line_no: line.line_no })));
@@ -373,15 +536,16 @@ function clearHighlight() {
}
const isLineHighlighted = (line: OrderDeliveryLine) => highlightKey.value === lineKey(line);
const rowCls = (line: OrderDeliveryLine) =>
isLineHighlighted(line) ? 'bg-amber-50' : selected.value.includes(lineKey(line)) ? 'bg-blue-50/60' : '';
/** 冻结单元格必须实色背景(防透出滚动内容),且与整行高亮/勾选色联动;高亮优先于勾选。 */
const frozenCellCls = (line: OrderDeliveryLine) =>
isLineHighlighted(line)
? 'bg-amber-100 group-hover:bg-amber-200'
: selected.value.includes(lineKey(line))
? 'bg-blue-100 group-hover:bg-blue-200'
: 'bg-white group-hover:bg-slate-100';
/** 行交互态:直达高亮(warning)优先于勾选选中(info),均走状态令牌(亮暗自适应)。 */
const rowCls = (line: OrderDeliveryLine) => {
if (isLineHighlighted(line)) return 'bg-row-highlight';
return selected.value.includes(lineKey(line)) ? 'bg-row-selected' : '';
};
/** 冻结单元格用 utilities.css 的 frozen-cell(实色基底防透出滚动内容),状态与整行联动;高亮优先于勾选。 */
const frozenCellCls = (line: OrderDeliveryLine) => {
if (isLineHighlighted(line)) return 'frozen-cell frozen-cell--highlight';
return selected.value.includes(lineKey(line)) ? 'frozen-cell frozen-cell--selected' : 'frozen-cell';
};
/** 列表就绪后定位目标行:滚动到视口中央 + 高亮 8 秒;行不在当前筛选结果中时静默跳过。 */
async function focusTargetLine(orderNo: string, lineNo: number) {
@@ -430,15 +594,17 @@ onMounted(async () => {
</script>
<template>
<!-- 全页统一字号:与表头一致(text-sm 14px),根容器设定基准,子元素不再覆写;
唯一例外:交期回复状态/交期已锁定徽标保持 text-xs(12px)加粗 -->
<!-- 高度收敛至视口(h-screen + overflow-hidden):页面自身不滚动,滚动全部在表格容器内,
列头 sticky 固定、横向滚动条常驻表格底缘;聊天壳 iframe 与独立路由均适用 -->
<div class="flex h-screen flex-col gap-4 overflow-hidden p-6 text-sm">
<!-- 全页基准字号:text-sm 14px(表头/筛选区/工具栏/表格统一),子元素按需覆写;
例外:页头标题 text-lg→md:text-xl(18/20px,与合同付款预警页头对齐)、徽章类 badge 基类自带 text-xs(12px)
高度收敛至视口(h-screen + overflow-hidden):页面自身不滚动,滚动全部在表格容器内,
列头 sticky 固定、横向滚动条常驻表格底缘;聊天壳 iframe 与独立路由均适用。
page-shell:iframe 嵌入路由无外层布局壳,由本页根节点补齐 L1 页面底色与前景色 -->
<div class="page-shell flex h-screen flex-col gap-4 overflow-hidden p-6 text-sm">
<!-- 页头:标题 + 最近同步 + 手动刷新 -->
<div class="flex flex-wrap items-center gap-3">
<h1 class="font-bold text-primary">{{ t('workspace.nav.orderDeliveryReply') }}</h1>
<span class="rounded-full px-3 py-1" :class="latestSyncFailed ? 'bg-rose-50 text-rose-600' : 'bg-blue-50 text-blue-600'">
<!-- 页头标题字号与合同付款预警页头一致:小屏 text-lg 18px、≥768px md:text-xl 20px -->
<h1 class="text-lg font-bold text-primary md:text-xl">{{ t('workspace.nav.orderDeliveryReply') }}</h1>
<span class="badge whitespace-nowrap" :class="latestSyncFailed ? 'badge-error' : 'badge-info'">
{{ latestSyncText }}
</span>
<div class="flex-1" />
@@ -447,72 +613,70 @@ onMounted(async () => {
</button>
</div>
<!-- 搜索区:合并关键词搜索(订单/产品/客户命中任一字段),字号与表格统一(text-sm),shrink-0 防压缩 -->
<div class="flex shrink-0 flex-wrap items-end gap-3 rounded-2xl border border-default bg-surface px-4 py-2.5">
<label class="flex flex-col gap-1 text-muted">
{{ t('workspace.orderDeliveryReply.filterKeyword') }}
<input v-model="filters.keyword" class="h-8 min-w-[340px] rounded-lg border border-default px-3 text-primary outline-none focus:border-blue-500" :placeholder="t('workspace.orderDeliveryReply.filterKeywordPh')" @keyup.enter="doSearch" />
</label>
<label class="flex flex-col gap-1 text-muted">
{{ t('workspace.orderDeliveryReply.filterOrderDate') }}
<input v-model="filters.order_date" type="date" class="h-8 rounded-lg border border-default px-3 text-primary outline-none focus:border-blue-500" />
</label>
<label class="flex flex-col gap-1 text-muted">
{{ t('workspace.orderDeliveryReply.filterStatus') }}
<!-- 状态筛选选择即生效(无需再点查询);其余条件仍由「查询」统一提交 -->
<select v-model="filters.status" class="min-w-[140px] rounded-lg border border-default bg-white px-3 py-[5px] text-sm leading-5 text-primary outline-none focus:border-blue-500" @change="doSearch">
<option value="">{{ t('workspace.orderDeliveryReply.statusAll') }}</option>
<option value="replied">{{ t('workspace.orderDeliveryReply.statusReplied') }}</option>
<option value="not_fully_replied">{{ t('workspace.orderDeliveryReply.statusNotFully') }}</option>
</select>
</label>
<button type="button" class="btn-primary h-8" @click="doSearch">{{ t('workspace.orderDeliveryReply.search') }}</button>
<button type="button" class="btn-ghost h-8" @click="doReset">{{ t('workspace.orderDeliveryReply.reset') }}</button>
<div class="flex-1" />
<span class="text-muted">{{ t('workspace.orderDeliveryReply.totalCount', { count: total }) }}</span>
<!-- 搜索区:合并关键词搜索(订单/产品/客户命中任一字段),shrink-0 防压缩;surface-panel 为设计系统 L2 区块容器(无 hover 阴影)。
外置字段标签已取消(2026-10-09:去掉提示字及其占位,单行紧凑布局与合同付款预警筛选一致):
字段含义由输入框 placeholder / 选项承担,无障碍语义用 aria-label 保留(复用 filterKeyword 等 i18n 键)。
输入控件显式 text-sm(14px)+h-9(36px):与 .contract-filter-input(14px/36px/圆角8px)渲染规格逐项一致 -->
<div class="surface-panel flex shrink-0 flex-wrap items-center gap-3 px-4 py-2.5">
<input v-model="filters.keyword" class="input-field h-9 w-auto min-w-[340px] rounded-lg px-3 py-1 text-sm" :placeholder="t('workspace.orderDeliveryReply.filterKeywordPh')" :aria-label="t('workspace.orderDeliveryReply.filterKeyword')" @keyup.enter="doSearch" />
<input v-model="filters.order_date" type="date" class="input-field h-9 w-auto rounded-lg px-3 py-1 text-sm" :aria-label="t('workspace.orderDeliveryReply.filterOrderDate')" />
<!-- 状态筛选选择即生效(无需再点查询);其余条件仍由「查询」统一提交 -->
<select v-model="filters.status" class="select-field h-9 w-auto min-w-[140px] rounded-lg px-3 py-1 text-sm" :aria-label="t('workspace.orderDeliveryReply.filterStatus')" @change="doSearch">
<option value="">{{ t('workspace.orderDeliveryReply.statusAll') }}</option>
<option value="replied">{{ t('workspace.orderDeliveryReply.statusReplied') }}</option>
<option value="not_fully_replied">{{ t('workspace.orderDeliveryReply.statusNotFully') }}</option>
</select>
<!-- 查询/重置:text-sm(14px)+font-semibold(600)+h-9(36px),与合同付款预警 .contract-filter-submit 完全一致 -->
<button type="button" class="btn-primary h-9 text-sm font-semibold" @click="doSearch">{{ t('workspace.orderDeliveryReply.search') }}</button>
<button type="button" class="btn-ghost h-9 text-sm font-semibold" @click="doReset">{{ t('workspace.orderDeliveryReply.reset') }}</button>
</div>
<!-- 工具栏:全选 + 联合回复 + 批量通知(shrink-0 防压缩,py-2 紧凑高度) -->
<div class="flex shrink-0 flex-wrap items-center gap-3 rounded-2xl border border-default bg-surface px-4 py-2">
<div class="surface-panel flex shrink-0 flex-wrap items-center gap-3 px-4 py-2">
<label class="flex items-center gap-2 text-primary">
<input type="checkbox" class="h-4 w-4 rounded border-default text-blue-600" :checked="allChecked" :indeterminate.prop="someChecked" @change="togglePageAll(($event.target as HTMLInputElement).checked)" />
<input type="checkbox" class="admin-checkbox" :checked="allChecked" :indeterminate.prop="someChecked" @change="togglePageAll(($event.target as HTMLInputElement).checked)" />
{{ t('workspace.orderDeliveryReply.selectAll') }}
</label>
<span class="text-muted">{{ t('workspace.orderDeliveryReply.selectedCount', { count: selectedLines.length }) }}</span>
<template v-if="canManage">
<button type="button" class="btn-primary h-8" :disabled="selectedLines.length === 0" @click="openBatchReply">
<button type="button" class="btn-primary h-9 text-sm font-semibold" :disabled="selectedLines.length === 0" @click="openBatchReply">
{{ t('workspace.orderDeliveryReply.batchReply') }}
</button>
<button type="button" class="btn-primary h-8" :disabled="notifiableSelected.length === 0 || notifying" @click="doNotifyBatch">
<button type="button" class="btn-primary h-9 text-sm font-semibold" :disabled="notifiableSelected.length === 0 || notifying" @click="requestNotifyBatch">
{{ t('workspace.orderDeliveryReply.batchNotify') }}
</button>
</template>
<div class="flex-1" />
<span class="whitespace-nowrap rounded-full bg-slate-100 px-3 py-1 text-muted">{{ t('workspace.orderDeliveryReply.toolbarHint') }}</span>
<!-- 导出 Excel(2026-10-09 增补,原提示文字胶囊取消):按当前筛选导出全部行 -->
<button type="button" class="btn-primary h-9 text-sm font-semibold" :disabled="exporting" @click="doExportExcel">
<Download class="h-4 w-4" aria-hidden="true" />
{{ t('workspace.orderDeliveryReply.exportExcel') }}
</button>
</div>
<!-- 列表 -->
<div class="min-h-0 flex-1 overflow-auto rounded-2xl border border-default bg-surface">
<table class="w-full border-collapse">
<div class="surface-panel min-h-0 flex-1 overflow-auto">
<table class="w-full border-collapse text-center">
<!-- z-30 高于表体冻结单元格(z-20):纵向滚动时冻结列不会盖住表头 -->
<thead class="sticky top-0 z-30 bg-slate-50 text-muted [&_th]:whitespace-nowrap">
<thead class="sticky top-0 z-30 bg-surface-soft text-muted [&_th]:whitespace-nowrap">
<tr>
<!-- 左侧冻结标识区(前四列):勾选/客户编号/订单日期/订单单号:项次,宽度固定保证偏移对齐 -->
<th class="sticky left-0 z-30 w-8 bg-slate-50 px-2 py-2" />
<th class="sticky left-8 z-30 w-32 min-w-[8rem] bg-slate-50 px-2 py-2 text-left">{{ t('workspace.orderDeliveryReply.colCustomer') }}</th>
<th class="sticky left-[10rem] z-30 w-24 bg-slate-50 px-2 py-2 text-left">{{ t('workspace.orderDeliveryReply.colOrderDate') }}</th>
<th class="sticky left-[16rem] z-30 w-40 min-w-[10rem] border-r border-default bg-slate-50 px-2 py-2 text-left shadow-[2px_0_6px_-2px_rgba(15,23,42,0.12)]">{{ t('workspace.orderDeliveryReply.colOrderLine') }}</th>
<th class="px-2 py-2 text-left">{{ t('workspace.orderDeliveryReply.colPartNo') }}</th>
<th class="px-2 py-2 text-left">{{ t('workspace.orderDeliveryReply.colCustomerPartNo') }}</th>
<th class="px-2 py-2 text-right">{{ t('workspace.orderDeliveryReply.colQty') }}</th>
<th class="px-2 py-2 text-left">{{ t('workspace.orderDeliveryReply.colAgreedDate') }}</th>
<th class="px-2 py-2 text-left">{{ t('workspace.orderDeliveryReply.colStatus') }}</th>
<th class="px-2 py-2 text-left">{{ t('workspace.orderDeliveryReply.colReply') }}</th>
<th class="px-2 py-2 text-left">{{ t('workspace.orderDeliveryReply.colReplyPerson') }}</th>
<th class="px-2 py-2 text-left">{{ t('workspace.orderDeliveryReply.colSalesperson') }}</th>
<th class="px-2 py-2 text-left">{{ t('workspace.orderDeliveryReply.colCustomerPo') }}</th>
<th class="px-2 py-2 text-left">{{ t('workspace.orderDeliveryReply.colSpec') }}</th>
<th class="px-2 py-2 text-left">{{ t('workspace.orderDeliveryReply.colUnit') }}</th>
<th class="sticky left-0 z-30 w-8 bg-surface-soft px-2 py-2" />
<th class="sticky left-8 z-30 w-32 min-w-[8rem] bg-surface-soft px-2 py-2 text-center">{{ t('workspace.orderDeliveryReply.colCustomer') }}</th>
<th class="sticky left-[10rem] z-30 w-24 bg-surface-soft px-2 py-2 text-center">{{ t('workspace.orderDeliveryReply.colOrderDate') }}</th>
<th class="sticky left-[16rem] z-30 w-40 min-w-[10rem] border-r border-default bg-surface-soft px-2 py-2 text-center shadow-sticky-col">{{ t('workspace.orderDeliveryReply.colOrderLine') }}</th>
<th class="px-2 py-2 text-center">{{ t('workspace.orderDeliveryReply.colPartNo') }}</th>
<th class="px-2 py-2 text-center">{{ t('workspace.orderDeliveryReply.colCustomerPartNo') }}</th>
<th class="px-2 py-2 text-center">{{ t('workspace.orderDeliveryReply.colQty') }}</th>
<th class="px-2 py-2 text-center">{{ t('workspace.orderDeliveryReply.colAgreedDate') }}</th>
<th class="px-2 py-2 text-center">{{ t('workspace.orderDeliveryReply.colStatus') }}</th>
<th class="px-2 py-2 text-center">{{ t('workspace.orderDeliveryReply.colReply') }}</th>
<th class="px-2 py-2 text-center">{{ t('workspace.orderDeliveryReply.colReplyPerson') }}</th>
<th class="px-2 py-2 text-center">{{ t('workspace.orderDeliveryReply.colSalesperson') }}</th>
<th class="px-2 py-2 text-center">{{ t('workspace.orderDeliveryReply.colCustomerPo') }}</th>
<th class="px-2 py-2 text-center">{{ t('workspace.orderDeliveryReply.colSpec') }}</th>
<th class="px-2 py-2 text-center">{{ t('workspace.orderDeliveryReply.colUnit') }}</th>
<th class="px-2 py-2 text-center">{{ t('workspace.orderDeliveryReply.colNotifiedTime') }}</th>
</tr>
</thead>
<tbody>
@@ -520,15 +684,15 @@ onMounted(async () => {
v-for="line in items"
:key="lineKey(line)"
:data-line-key="lineKey(line)"
class="group border-t border-default hover:bg-slate-50"
class="hover-row border-t border-default"
:class="rowCls(line)"
>
<!-- 冻结单元格必须实色背景(半透明会透出滚动内容),并用 group-hover 与整行悬停/选中/直达高亮联动 -->
<!-- 冻结单元格:frozen-cell 实色基底(半透明会透出滚动内容),悬停/选中/直达高亮由 CSS 联动 -->
<td
class="sticky left-0 z-20 px-2 py-1.5"
:class="frozenCellCls(line)"
>
<input type="checkbox" class="h-4 w-4 rounded border-default text-blue-600" :checked="selected.includes(lineKey(line))" @change="toggleLine(line, ($event.target as HTMLInputElement).checked)" />
<input type="checkbox" class="admin-checkbox" :checked="selected.includes(lineKey(line))" @change="toggleLine(line, ($event.target as HTMLInputElement).checked)" />
</td>
<td
class="sticky left-8 z-20 w-32 min-w-[8rem] max-w-[8rem] px-2 py-1.5"
@@ -543,70 +707,132 @@ onMounted(async () => {
:class="frozenCellCls(line)"
>{{ line.order_date || '—' }}</td>
<td
class="sticky left-[16rem] z-20 w-40 min-w-[10rem] max-w-[10rem] overflow-hidden whitespace-nowrap border-r border-default px-2 py-1.5 font-mono shadow-[2px_0_6px_-2px_rgba(15,23,42,0.12)]"
class="sticky left-[16rem] z-20 w-40 min-w-[10rem] max-w-[10rem] overflow-hidden whitespace-nowrap border-r border-default px-2 py-1.5 font-mono text-left shadow-sticky-col"
:class="frozenCellCls(line)"
>{{ line.order_no }}:{{ line.line_no }}</td>
<td class="px-2 py-1.5" :title="line.part_name || ''">
<div class="max-w-[10rem] truncate font-mono">{{ line.part_no || '—' }}</div>
<div class="max-w-[14rem] truncate text-muted">{{ line.part_name || '' }}</div>
<!-- 截断盒 mx-auto:限宽盒在列内居中(继承 text-center),截断能力保留 -->
<div class="mx-auto max-w-[10rem] truncate font-mono">{{ line.part_no || '—' }}</div>
<div class="mx-auto max-w-[14rem] truncate text-muted">{{ line.part_name || '' }}</div>
</td>
<td class="whitespace-nowrap px-2 py-1.5 font-mono">{{ line.customer_part_no || '—' }}</td>
<td class="px-2 py-2 text-right tabular-nums">{{ line.qty ?? '—' }}</td>
<td class="px-2 py-2 text-center tabular-nums">{{ line.qty ?? '—' }}</td>
<td class="whitespace-nowrap px-2 py-1.5">{{ line.agreed_date || '—' }}</td>
<td class="px-2 py-1.5">
<span class="whitespace-nowrap rounded-full px-2.5 py-0.5 text-xs font-semibold" :class="statusMeta(line.status).cls">
<span class="badge inline-block min-w-[68px] whitespace-nowrap text-center font-semibold" :class="statusMeta(line.status).cls">
{{ statusMeta(line.status).label }}
</span>
</td>
<!-- 交期回复:无批次=回复交期;有批次可展开;锁定=已锁定 -->
<td class="px-2 py-1.5 align-top">
<!-- 交期回复:动作入口为批次条前的加号(lucide Plus);未回复=空批次条(不显示时间/数量);
所有行首条批次条前保留等宽加号占位(无动作时为透明占位)、展开行其余批次条加 pl-7 缩进,
保证全表批次条左缘对齐;「交期已锁定」徽标已取消(锁定状态由无加号与交期回复人员列「已通知」体现);
>1 批时首条批次后有展开/收起小箭头 -->
<td class="px-2 py-1.5">
<template v-if="line.batches.length === 0">
<span class="text-muted">{{ t('workspace.orderDeliveryReply.statusNotReplied') }}</span>
<div v-if="canManage" class="mt-0.5">
<button type="button" class="rounded-md border border-blue-200 bg-blue-50 px-2 py-0.5 text-blue-600" @click="openSingleReply(line)">
{{ t('workspace.orderDeliveryReply.replyAction') }}
<div class="flex items-center gap-1">
<button
v-if="canManage"
type="button"
class="btn-ghost h-6 w-6 shrink-0 rounded-md p-0"
:disabled="chipSaving"
:title="t('workspace.orderDeliveryReply.replyAction')"
:aria-label="t('workspace.orderDeliveryReply.replyAction')"
@click="openSingleReply(line)"
>
<Plus class="h-4 w-4" />
</button>
<span v-else class="w-6 shrink-0" aria-hidden="true" />
<!-- 未回复空批次条:可管理时可点击就地填写交期+数量(回车/失焦自动保存单行接口);不显示占位文字 -->
<div
v-if="isChipEditing(line, 0)"
data-chip-edit
class="flex items-center gap-1 rounded border-l-[3px] border-brand-500 bg-surface-soft px-1.5 py-0.5"
:class="chipSaving ? 'opacity-60' : ''"
@focusout="onChipFocusout($event, line, 0)"
@keydown.enter.prevent="chipCommit(line, 0)"
@keydown.esc.prevent="cancelChipEdit"
>
<input v-model="chipDraft.planned_date" data-chip-date type="date" class="h-6 w-[125px] rounded border border-default bg-surface px-1 text-sm text-primary outline-none focus:border-brand-500" :aria-label="t('workspace.orderDeliveryReply.filterOrderDate')" />
<input v-model="chipDraft.qty" type="number" min="0" class="h-6 w-16 rounded border border-default bg-surface px-1 text-sm text-primary outline-none focus:border-brand-500" :aria-label="t('workspace.orderDeliveryReply.colQty')" @focus="($event.target as HTMLInputElement).select()" />
<span v-if="line.unit" class="text-muted">{{ line.unit }}</span>
</div>
<div
v-else-if="isChipEditable(line)"
class="h-6 w-24 cursor-pointer rounded border-l-[3px] border-brand-500 bg-surface-soft transition-colors hover-surface-strong"
:title="t('workspace.orderDeliveryReply.replyAction')"
@click="startChipEdit(line, 0)"
/>
<div v-else class="h-6 w-24 rounded border-l-[3px] border-brand-500 bg-surface-soft" />
</div>
<p v-if="isChipEditing(line, 0) && chipIssue" class="mt-0.5 text-xs text-status-error">{{ chipIssue }}</p>
</template>
<template v-else>
<div class="flex items-center gap-2">
<span class="whitespace-nowrap rounded-full border border-default bg-slate-50 px-2 py-0.5 text-muted">
{{ t('workspace.orderDeliveryReply.batchCount', { count: line.batches.length }) }} ·
{{ t('workspace.orderDeliveryReply.repliedOf', { replied: repliedQty(line), remain: undelivered(line) }) }}
<span v-if="repliedQty(line) > undelivered(line)" class="ml-1 font-semibold text-orange-500">{{ t('workspace.orderDeliveryReply.overTag') }}</span>
</span>
<button v-if="line.batches.length > 1" type="button" class="rounded-full border border-default px-2 py-0.5 text-blue-600" @click="toggleExpand(lineKey(line))">
{{ expanded.includes(lineKey(line)) ? t('workspace.orderDeliveryReply.collapse') : t('workspace.orderDeliveryReply.expand', { count: line.batches.length - 1 }) }}
</button>
</div>
<div class="mt-0.5 flex flex-col gap-0.5">
<div class="flex flex-col gap-0.5">
<div
v-for="(batch, idx) in line.batches"
:key="batch.seq ?? idx"
v-show="expanded.includes(lineKey(line)) || idx === 0"
class="max-w-[230px] truncate rounded border-l-[3px] border-blue-500 bg-blue-50/50 px-2 py-0.5 text-secondary"
v-show="idx === 0 || expanded.includes(lineKey(line))"
class="flex items-center gap-1"
:class="idx > 0 ? 'pl-7' : ''"
>
{{ batch.planned_date }} · <b class="text-blue-600">{{ batch.qty }}</b> {{ line.unit }}
<i v-if="batch.remark" class="ml-1 not-italic text-muted">{{ batch.remark }}</i>
<template v-if="idx === 0">
<button
v-if="canManage && !line.locked"
type="button"
class="btn-ghost h-6 w-6 shrink-0 rounded-md p-0"
:disabled="chipSaving"
:title="t('workspace.orderDeliveryReply.editReplyAction')"
:aria-label="t('workspace.orderDeliveryReply.editReplyAction')"
@click="openSingleReply(line)"
>
<Plus class="h-4 w-4" />
</button>
<span v-else class="w-6 shrink-0" aria-hidden="true" />
</template>
<!-- 批次条:未锁定可管理行点击原地编辑(日期+数量,回车/失焦自动保存) -->
<div
v-if="isChipEditing(line, idx)"
data-chip-edit
class="flex items-center gap-1 rounded border-l-[3px] border-brand-500 bg-surface-soft px-1.5 py-0.5"
:class="chipSaving ? 'opacity-60' : ''"
@focusout="onChipFocusout($event, line, idx)"
@keydown.enter.prevent="chipCommit(line, idx)"
@keydown.esc.prevent="cancelChipEdit"
>
<input v-model="chipDraft.planned_date" data-chip-date type="date" class="h-6 w-[125px] rounded border border-default bg-surface px-1 text-sm text-primary outline-none focus:border-brand-500" :aria-label="t('workspace.orderDeliveryReply.filterOrderDate')" />
<input v-model="chipDraft.qty" type="number" min="0" class="h-6 w-16 rounded border border-default bg-surface px-1 text-sm text-primary outline-none focus:border-brand-500" :aria-label="t('workspace.orderDeliveryReply.colQty')" @focus="($event.target as HTMLInputElement).select()" />
<span v-if="line.unit" class="text-muted">{{ line.unit }}</span>
</div>
<div
v-else
class="max-w-[230px] truncate rounded border-l-[3px] border-brand-500 bg-surface-soft px-2 py-0.5 text-secondary"
:class="isChipEditable(line) ? 'cursor-pointer transition-colors hover-surface-strong' : ''"
:title="isChipEditable(line) ? t('workspace.orderDeliveryReply.editReplyAction') : undefined"
@click="startChipEdit(line, idx)"
>
{{ batch.planned_date }} · <b class="text-brand-600">{{ batch.qty }}</b> {{ line.unit }}
</div>
<button
v-if="idx === 0 && line.batches.length > 1"
type="button"
class="btn-ghost h-6 w-6 shrink-0 rounded-md p-0"
:title="expanded.includes(lineKey(line)) ? t('workspace.orderDeliveryReply.collapse') : t('workspace.orderDeliveryReply.expand', { count: line.batches.length - 1 })"
:aria-label="expanded.includes(lineKey(line)) ? t('workspace.orderDeliveryReply.collapse') : t('workspace.orderDeliveryReply.expand', { count: line.batches.length - 1 })"
@click="toggleExpand(lineKey(line))"
>
<ChevronUp v-if="expanded.includes(lineKey(line))" class="h-4 w-4" />
<ChevronDown v-else class="h-4 w-4" />
</button>
</div>
</div>
<div class="mt-0.5">
<span v-if="line.locked" class="rounded-full bg-emerald-50 px-2.5 py-0.5 text-xs font-semibold text-emerald-600">{{ t('workspace.orderDeliveryReply.lockedTag') }}</span>
<button v-else-if="canManage" type="button" class="rounded-md border border-blue-200 bg-blue-50 px-2 py-0.5 text-blue-600" @click="openSingleReply(line)">
{{ t('workspace.orderDeliveryReply.editReplyAction') }}
</button>
</div>
<p v-if="editingChip && editingChip.key === lineKey(line) && chipIssue" class="mt-0.5 text-xs text-status-error">{{ chipIssue }}</p>
</template>
</td>
<!-- 交期回复人员:锁定行附带已通知对象与时间(原「通知业务部门」列已取消,信息并入此处) -->
<!-- 交期回复人员:通知时间已拆至独立「通知时间」列(2026-10-09),本列仅工号/姓名/待通知提示 -->
<td class="px-2 py-1.5">
<template v-if="line.notified_employee_id || line.notified_user_name">
<div class="font-mono">{{ line.notified_employee_id || '' }}</div>
<div class="text-muted">{{ line.notified_user_name || '' }}</div>
<div v-if="line.locked" class="text-emerald-600">
{{ t('workspace.orderDeliveryReply.notifiedTag', { name: line.salesperson_name || line.salesperson_code || '' }) }}
<span class="text-muted">{{ line.notified_at || '' }}</span>
</div>
</template>
<span v-else class="text-muted">{{ t('workspace.orderDeliveryReply.pendingNotify') }}</span>
</td>
@@ -615,20 +841,21 @@ onMounted(async () => {
<div class="whitespace-nowrap">{{ line.salesperson_name || line.salesperson_code || '—' }}</div>
<div class="text-muted">{{ line.dept_name || line.dept_code || '' }}</div>
</td>
<td class="px-2 py-1.5 font-mono" :title="line.customer_po || ''"><span class="block max-w-[10rem] truncate">{{ line.customer_po || '—' }}</span></td>
<td class="px-2 py-1.5" :title="line.spec || ''"><span class="block max-w-[10rem] truncate">{{ line.spec || '—' }}</span></td>
<td class="px-2 py-1.5 font-mono" :title="line.customer_po || ''"><span class="mx-auto block max-w-[10rem] truncate">{{ line.customer_po || '—' }}</span></td>
<td class="px-2 py-1.5" :title="line.spec || ''"><span class="mx-auto block max-w-[10rem] truncate">{{ line.spec || '—' }}</span></td>
<td class="px-2 py-1.5">{{ line.unit || '—' }}</td>
<!-- 通知时间(2026-10-09 自「交期回复人员」列拆出独立列):锁定行展示通知时间戳,单行不折行 -->
<td class="whitespace-nowrap px-2 py-1.5" :class="line.locked ? 'text-status-success' : 'text-muted'">{{ line.locked ? (line.notified_at || '—') : '—' }}</td>
</tr>
<tr v-if="!loading && items.length === 0">
<td colspan="15" class="px-4 py-16 text-center text-muted">{{ t('workspace.orderDeliveryReply.empty') }}</td>
<td colspan="16" class="px-4 py-16 text-center text-muted">{{ t('workspace.orderDeliveryReply.empty') }}</td>
</tr>
</tbody>
</table>
</div>
<!-- 分页:复用管理控制台-数据报表的 PaginationBar(摘要 + 每页条数 + 页码按钮) -->
<!-- 分页:复用管理控制台-数据报表的 PaginationBar(摘要 + 每页条数 + 页码按钮),组件自带字号不再强改 -->
<PaginationBar
class="[&_*]:!text-sm"
:page="page"
:page-size="pageSize"
:total="total"
@@ -637,30 +864,29 @@ onMounted(async () => {
@update:page-size="changePageSize"
/>
<!-- 回复弹窗 -->
<div v-if="modalVisible" class="fixed inset-0 z-50 flex items-center justify-center bg-slate-900/40" @click.self="modalVisible = false">
<div class="flex max-h-[88vh] w-[min(960px,94vw)] flex-col overflow-hidden rounded-2xl bg-white shadow-2xl">
<div class="flex items-center gap-3 border-b border-default px-5 py-4">
<!-- 回复弹窗:dialog-overlay/panel/header/body/footer 设计系统 L2 结构 -->
<div v-if="modalVisible" class="dialog-overlay items-center" @click.self="modalVisible = false">
<div class="dialog-panel max-h-[88vh] w-[min(960px,94vw)]">
<div class="dialog-header">
<h3 class="font-bold text-primary">{{ modalTitle }}</h3>
<div class="flex-1" />
<button type="button" class="text-muted" @click="modalVisible = false">×</button>
<button type="button" class="btn-ghost h-8 w-8 px-0 text-lg leading-none" @click="modalVisible = false">×</button>
</div>
<div class="flex-1 overflow-auto px-5 py-4">
<div class="dialog-body">
<!-- 快速统一交期:仅联合回复弹窗显示;单行回复/修改回复弹窗已取消该区(2026-10-07),直接逐批次填写 -->
<div v-if="modalMode === 'batch'" class="mb-4 flex flex-wrap items-end gap-3 rounded-xl border border-default bg-blue-50/40 px-4 py-3">
<div v-if="modalMode === 'batch'" class="flex flex-wrap items-end gap-3 rounded-xl border border-default bg-surface-soft px-4 py-3">
<label class="flex flex-col gap-1 text-muted">
{{ t('workspace.orderDeliveryReply.quickDate') }}
<input v-model="quickDate" type="date" class="h-9 rounded-lg border border-default px-3 text-primary" />
<input v-model="quickDate" type="date" class="input-field h-9 w-auto rounded-lg px-3 py-1.5" />
</label>
<button type="button" class="h-9 rounded-lg border border-default px-3 text-primary" @click="applyQuickDate">
<button type="button" class="btn-secondary btn-sm h-9" @click="applyQuickDate">
{{ t('workspace.orderDeliveryReply.applyQuickDate') }}
</button>
<span class="text-muted">{{ t('workspace.orderDeliveryReply.modalHint') }}</span>
</div>
<!-- 每行批次编辑器 -->
<div v-for="entry in modalLines" :key="lineKey(entry.line)" class="mb-4 overflow-hidden rounded-xl border border-default">
<div class="flex flex-wrap items-center gap-2 bg-slate-50 px-3 py-2">
<span class="rounded bg-indigo-50 px-2 py-0.5 font-semibold text-indigo-600">{{ entry.line.order_no }}</span>
<div v-for="entry in modalLines" :key="lineKey(entry.line)" class="overflow-hidden rounded-xl border border-default">
<div class="flex flex-wrap items-center gap-2 bg-surface-soft px-3 py-2">
<span class="rounded bg-surface-strong px-2 py-0.5 font-semibold text-primary">{{ entry.line.order_no }}</span>
<span>{{ t('workspace.orderDeliveryReply.itemLabel', { item: entry.line.line_no }) }}</span>
<span class="text-muted">{{ entry.line.customer_no }} · {{ entry.line.customer_short_name }}</span>
<span class="text-muted">{{ entry.line.part_no }} · {{ entry.line.part_name }}</span>
@@ -669,27 +895,36 @@ onMounted(async () => {
</span>
</div>
<div class="flex flex-col gap-2 px-3 py-3">
<div v-for="(batch, idx) in entry.batches" :key="idx" class="grid grid-cols-[170px_120px_1fr_36px] items-center gap-2">
<input v-model="batch.planned_date" type="date" class="h-9 rounded-lg border border-default px-2 text-primary" />
<input v-model="batch.qty" type="number" min="0" :placeholder="t('workspace.orderDeliveryReply.qtyPh')" class="h-9 rounded-lg border border-default px-2 text-primary" />
<input v-model="batch.remark" :placeholder="t('workspace.orderDeliveryReply.remarkPh')" class="h-9 rounded-lg border border-default px-2 text-primary" />
<button type="button" class="h-9 rounded-lg bg-rose-50 text-rose-600" :title="t('workspace.orderDeliveryReply.removeBatch')" @click="entry.batches.splice(idx, 1)">✕</button>
<div v-for="(batch, idx) in entry.batches" :key="idx" class="grid grid-cols-[170px_120px_1fr_40px] items-center gap-2">
<input v-model="batch.planned_date" type="date" class="input-field h-9 rounded-lg px-2 py-1.5" />
<input v-model="batch.qty" type="number" min="0" :placeholder="t('workspace.orderDeliveryReply.qtyPh')" class="input-field h-9 rounded-lg px-2 py-1.5" />
<input v-model="batch.remark" :placeholder="t('workspace.orderDeliveryReply.remarkPh')" class="input-field h-9 rounded-lg px-2 py-1.5" />
<button type="button" class="btn-danger btn-sm" :title="t('workspace.orderDeliveryReply.removeBatch')" @click="entry.batches.splice(idx, 1)">✕</button>
</div>
<button type="button" class="w-full rounded-lg border border-dashed border-slate-300 py-2 text-blue-600" @click="entry.batches.push({ planned_date: '', qty: '', remark: '' })">
<button type="button" class="w-full rounded-lg border border-dashed border-default py-2 text-brand-600 transition-colors hover-surface-soft" @click="entry.batches.push({ planned_date: '', qty: '', remark: '' })">
{{ t('workspace.orderDeliveryReply.addBatch') }}
</button>
<!-- 行级实时校验提示:缺交期/缺数量按批次序号指出,合计不等给出已填/应填;随填写实时切换 -->
<p v-if="lineIssueText(entry)" class="text-rose-500">{{ lineIssueText(entry) }}</p>
<p v-if="lineIssueText(entry)" class="text-status-error">{{ lineIssueText(entry) }}</p>
</div>
</div>
</div>
<div class="flex justify-end gap-3 border-t border-default bg-slate-50 px-5 py-3">
<button type="button" class="btn-ghost" @click="modalVisible = false">{{ t('common.cancel') }}</button>
<div class="dialog-footer">
<button type="button" class="btn-secondary" @click="modalVisible = false">{{ t('common.cancel') }}</button>
<button type="button" class="btn-primary" :disabled="saving" @click="saveReplies">
{{ saving ? t('workspace.orderDeliveryReply.saving') : t('workspace.orderDeliveryReply.saveReply') }}
</button>
</div>
</div>
</div>
<!-- 批量通知二次确认:共享 DeleteConfirmDialog(primary 语气,非删除;确认/取消文案用组件默认 i18n) -->
<DeleteConfirmDialog
v-model="notifyConfirmVisible"
:title="t('workspace.orderDeliveryReply.batchNotify')"
:message="t('workspace.orderDeliveryReply.notifyBatchConfirm', { count: notifiableSelected.length })"
confirm-tone="primary"
@confirm="doNotifyBatch"
/>
</div>
</template>
+5 -8
View File
@@ -999,7 +999,7 @@
"syncSkipped": "A sync is already running; try again later",
"syncFailedTitle": "Sync failed; last snapshot kept",
"filterKeyword": "Keyword (order / product / customer / salesperson / replier)",
"filterKeywordPh": "Search by order no., part no., name, customer part no., customer, salesperson, or reply person",
"filterKeywordPh": "Order / product / customer / salesperson / reply person",
"filterOrderDate": "Order Date",
"filterStatus": "Reply Status",
"statusAll": "All",
@@ -1007,12 +1007,10 @@
"statusNotFully": "Not fully replied",
"statusNotReplied": "Not replied",
"statusPartial": "Partially replied",
"totalCount": "{count} product lines",
"selectAll": "Select all (this page)",
"selectedCount": "{count} lines selected",
"batchReply": "+ Batch reply",
"batchNotify": "Batch notify",
"toolbarHint": "Batch reply only saves; click \"Batch notify\" to send and lock.",
"colOrderLine": "Order : Item",
"colOrderDate": "Order Date",
"colCustomer": "Customer",
@@ -1024,6 +1022,7 @@
"colSpec": "Spec",
"colCustomerPartNo": "Customer Part No.",
"colAgreedDate": "Agreed Date",
"colNotifiedTime": "Notified at",
"colUnit": "Unit",
"colQty": "Qty",
"colDelivered": "Delivered",
@@ -1032,15 +1031,13 @@
"colReply": "Delivery Reply",
"colNotify": "Notify",
"colReplyPerson": "Replied By",
"batchCount": "{count} batches",
"repliedOf": "replied {replied}/{remain}",
"overTag": "OVER",
"collapse": "Collapse ▲",
"exportDone": "Exported",
"exportExcel": "Export Excel",
"exportFailed": "Export failed",
"expand": "+{count} more ▾",
"lockedTag": "Locked",
"replyAction": "Reply",
"editReplyAction": "Edit reply",
"notifiedTag": "Notified {name}",
"replyFirst": "Reply first",
"notifyAction": "Send notification",
"pendingNotify": "Recorded after notify",
+5 -8
View File
@@ -921,7 +921,7 @@
"syncSkipped": "มีการซิงค์กำลังทำงานอยู่ โปรดลองอีกครั้งภายหลัง",
"syncFailedTitle": "ซิงค์ล้มเหลว ยังคงภาพรวมเดิมไว้",
"filterKeyword": "คำค้นหา (คำสั่งซื้อ / ผลิตภัณฑ์ / ลูกค้า / พนักงานขาย / ผู้ตอบกำหนดส่ง)",
"filterKeywordPh": "ค้นหาด้วยเลขที่คำสั่งซื้อ รหัสสินค้า ชื่อสินค้า รหัสสินค้าลูกค้า ลูกค้า พนักงานขาย หรือผู้ตอบกำหนดส่งได้",
"filterKeywordPh": "คำสั่งซื้อ / สินค้า / ลูกค้า / พนักงานขาย / ผู้ตอบกำหนดส่ง",
"filterOrderDate": "วันที่สั่งซื้อ",
"filterStatus": "สถานะการตอบกลับ",
"statusAll": "ทั้งหมด",
@@ -929,12 +929,10 @@
"statusNotFully": "ยังตอบไม่ครบ",
"statusNotReplied": "ยังไม่ตอบกลับ",
"statusPartial": "ตอบบางส่วน",
"totalCount": "รวม {count} รายการสินค้า",
"selectAll": "เลือกทั้งหมด (หน้านี้)",
"selectedCount": "เลือกแล้ว {count} รายการ",
"batchReply": "+ ตอบกลับหลายรายการ",
"batchNotify": "แจ้งเตือนหลายรายการ",
"toolbarHint": "การตอบกลับหลายรายการเป็นเพียงบันทึก ต้องกดแจ้งเตือนจึงจะส่งและล็อก",
"colOrderLine": "เลขที่ : รายการ",
"colOrderDate": "วันที่สั่งซื้อ",
"colCustomer": "ลูกค้า",
@@ -946,6 +944,7 @@
"colSpec": "สเปก",
"colCustomerPartNo": "รหัสสินค้าลูกค้า",
"colAgreedDate": "กำหนดส่งตามข้อตกลง",
"colNotifiedTime": "เวลาแจ้งเตือน",
"colUnit": "หน่วย",
"colQty": "จำนวน",
"colDelivered": "ส่งแล้ว",
@@ -954,15 +953,13 @@
"colReply": "การตอบกลับกำหนดส่ง",
"colNotify": "แจ้งเตือน",
"colReplyPerson": "ผู้ตอบกลับ",
"batchCount": "{count} งวด",
"repliedOf": "ตอบแล้ว {replied}/{remain}",
"overTag": "เกิน",
"collapse": "ย่อ ▲",
"exportDone": "ส่งออกสำเร็จ",
"exportExcel": "ส่งออก Excel",
"exportFailed": "ส่งออกล้มเหลว",
"expand": "+{count} งวด ▾",
"lockedTag": "ล็อกแล้ว",
"replyAction": "ตอบกลับ",
"editReplyAction": "แก้ไขการตอบกลับ",
"notifiedTag": "แจ้งแล้ว {name}",
"replyFirst": "กรุณาตอบกลับก่อน",
"notifyAction": "ส่งการแจ้งเตือน",
"pendingNotify": "บันทึกหลังแจ้งเตือน",
+5 -8
View File
@@ -999,7 +999,7 @@
"syncSkipped": "已有同步正在进行,请稍后再试",
"syncFailedTitle": "同步失败,已保留上次快照",
"filterKeyword": "关键词(订单 / 产品 / 客户 / 业务员 / 回复人员)",
"filterKeywordPh": "订单单号、产品编号、品名、客户料号、客户编号、业务员、交期回复人员均可搜索",
"filterKeywordPh": "订单/产品/客户/业务员/回复人员",
"filterOrderDate": "订单日期",
"filterStatus": "交期回复状态",
"statusAll": "全部",
@@ -1007,12 +1007,10 @@
"statusNotFully": "未完全回复",
"statusNotReplied": "未回复",
"statusPartial": "部分回复",
"totalCount": "共 {count} 条产品行",
"selectAll": "全选(本页)",
"selectedCount": "已勾选 {count} 行",
"batchReply": "+ 联合回复交期",
"batchNotify": "批量通知",
"toolbarHint": "联合回复只保存批次;点「批量通知」才发送并锁定。",
"colOrderLine": "订单单号:项次",
"colOrderDate": "订单日期",
"colCustomer": "客户编号",
@@ -1024,6 +1022,7 @@
"colSpec": "规格",
"colCustomerPartNo": "客户产品编号",
"colAgreedDate": "约定交货日",
"colNotifiedTime": "通知时间",
"colUnit": "单位",
"colQty": "数量",
"colDelivered": "已交数量",
@@ -1032,15 +1031,13 @@
"colReply": "交期回复",
"colNotify": "通知业务部门",
"colReplyPerson": "交期回复人员",
"batchCount": "{count} 批",
"repliedOf": "已回复 {replied}/{remain}",
"overTag": "超",
"collapse": "收起 ▲",
"exportDone": "导出成功",
"exportExcel": "导出 Excel",
"exportFailed": "导出失败",
"expand": "+{count} 批 ▾",
"lockedTag": "交期已锁定",
"replyAction": "回复交期",
"editReplyAction": "修改回复",
"notifiedTag": "已通知 {name}",
"replyFirst": "请先回复交期",
"notifyAction": "发送通知业务部门",
"pendingNotify": "待通知后记录",
+5 -8
View File
@@ -999,7 +999,7 @@
"syncSkipped": "已有同步正在進行,請稍後再試",
"syncFailedTitle": "同步失敗,已保留上次快照",
"filterKeyword": "關鍵詞(訂單 / 產品 / 客戶 / 業務員 / 回覆人員)",
"filterKeywordPh": "訂單單號、產品編號、品名、客戶料號、客戶編號、業務員、交期回覆人員均可搜尋",
"filterKeywordPh": "訂單/產品/客戶/業務員/回覆人員",
"filterOrderDate": "訂單日期",
"filterStatus": "交期回覆狀態",
"statusAll": "全部",
@@ -1007,12 +1007,10 @@
"statusNotFully": "未完全回覆",
"statusNotReplied": "未回覆",
"statusPartial": "部分回覆",
"totalCount": "共 {count} 條產品行",
"selectAll": "全選(本頁)",
"selectedCount": "已勾選 {count} 行",
"batchReply": "+ 聯合回覆交期",
"batchNotify": "批量通知",
"toolbarHint": "聯合回覆只儲存批次;點「批量通知」才發送並鎖定。",
"colOrderLine": "訂單單號:項次",
"colOrderDate": "訂單日期",
"colCustomer": "客戶編號",
@@ -1024,6 +1022,7 @@
"colSpec": "規格",
"colCustomerPartNo": "客戶產品編號",
"colAgreedDate": "約定交貨日",
"colNotifiedTime": "通知時間",
"colUnit": "單位",
"colQty": "數量",
"colDelivered": "已交數量",
@@ -1032,15 +1031,13 @@
"colReply": "交期回覆",
"colNotify": "通知業務部門",
"colReplyPerson": "交期回覆人員",
"batchCount": "{count} 批",
"repliedOf": "已回覆 {replied}/{remain}",
"overTag": "超",
"collapse": "收起 ▲",
"exportDone": "匯出成功",
"exportExcel": "匯出 Excel",
"exportFailed": "匯出失敗",
"expand": "+{count} 批 ▾",
"lockedTag": "交期已鎖定",
"replyAction": "回覆交期",
"editReplyAction": "修改回覆",
"notifiedTag": "已通知 {name}",
"replyFirst": "請先回覆交期",
"notifyAction": "發送通知業務部門",
"pendingNotify": "待通知後記錄",
+20 -1
View File
@@ -1,6 +1,9 @@
/**
* shared/composables/useTheme.ts
* 主题 preference 与 dark/light 切换(全局单例)。
* 用途:主题 preference 与 dark/light 切换(单文档内全局单例)。
* 逻辑:initTheme 读 localStorage + matchMedia 完成本文档初始化;同时监听 storage 事件做跨文档同步——
* storage 事件只在「其他同源文档」触发,聊天壳父页面切换主题时,iframe 内嵌工作台页
* (如订单交期回复 /apps/order-delivery-reply)无需刷新即可实时跟随变暗/变亮。
*/
import { computed, ref } from 'vue';
@@ -15,6 +18,7 @@ const systemPrefersDark = ref(false);
let initialized = false;
let mediaListenerCleanup: (() => void) | null = null;
let storageListenerCleanup: (() => void) | null = null;
const appliedTheme = computed<AppliedTheme>(() => {
if (themePreference.value === 'system') {
@@ -68,6 +72,19 @@ const initTheme = () => {
media.addEventListener('change', onMediaChange);
mediaListenerCleanup = () => media.removeEventListener('change', onMediaChange);
// 跨文档主题同步:本监听只在「被其他文档修改 localStorage」时触发(自身切换走 setThemePreference),
// 使 iframe 等同源文档即时跟随父壳的亮暗切换。
const onStorageChange = (event: StorageEvent) => {
if (event.key !== THEME_KEY) return;
const stored = parseTheme(event.newValue);
if (stored) {
themePreference.value = stored;
applyTheme();
}
};
window.addEventListener('storage', onStorageChange);
storageListenerCleanup = () => window.removeEventListener('storage', onStorageChange);
const stored = parseTheme(localStorage.getItem(THEME_KEY));
if (stored) {
themePreference.value = stored;
@@ -78,6 +95,8 @@ const initTheme = () => {
const cleanupTheme = () => {
mediaListenerCleanup?.();
mediaListenerCleanup = null;
storageListenerCleanup?.();
storageListenerCleanup = null;
initialized = false;
};
+34
View File
@@ -28,4 +28,38 @@
.divide-subtle > :not([hidden]) ~ :not([hidden]) {
border-color: var(--border-subtle);
}
/* 状态前景文字:badge 之外的行内强调(如「超量」标记、成功/告警说明) */
.text-status-success { color: var(--status-success-fg); }
.text-status-info { color: var(--status-info-fg); }
.text-status-warning { color: var(--status-warning-fg); }
.text-status-error { color: var(--status-error-fg); }
/* 表格行交互态:选中=info、直达定位高亮=warning,状态令牌亮暗自适应 */
.bg-row-selected { background-color: var(--status-info-bg); }
.bg-row-highlight { background-color: var(--status-warning-bg); }
/* 表格行悬停:无交互态的行悬停压暗;选中/高亮行保持状态色不被悬停覆盖 */
.hover-row:hover:not(.bg-row-selected):not(.bg-row-highlight) {
background-color: var(--bg-surface-soft);
}
/* 表格冻结列单元格:必须实色基底(防透出横向滚动内容)。
选中/高亮态用「实色底 + 状态色平铺叠加」——暗色状态令牌为半透明 rgba,
直接当背景色会在横向滚动时透出下层内容。 */
.frozen-cell { background-color: var(--bg-surface); }
.hover-row:hover:not(.bg-row-selected):not(.bg-row-highlight) .frozen-cell {
background-color: var(--bg-surface-soft);
}
.frozen-cell--selected {
background-color: var(--bg-surface);
background-image: linear-gradient(var(--status-info-bg), var(--status-info-bg));
}
.frozen-cell--highlight {
background-color: var(--bg-surface);
background-image: linear-gradient(var(--status-warning-bg), var(--status-warning-bg));
}
/* 冻结列右缘分隔阴影(与 admin-table-sticky-right-cell 同型),亮暗共用 */
.shadow-sticky-col { box-shadow: 2px 0 6px -2px rgba(15, 23, 42, 0.12); }
}
+25
View File
@@ -189,6 +189,31 @@
@apply px-2.5 py-0.5 rounded-full text-xs font-medium border;
}
/* 徽章状态变体:颜色一律走 --status-* 令牌(亮暗自适应),禁止 rose/emerald 等原生色 */
.badge-success {
background-color: var(--status-success-bg);
border-color: var(--status-success-border);
color: var(--status-success-fg);
}
.badge-info {
background-color: var(--status-info-bg);
border-color: var(--status-info-border);
color: var(--status-info-fg);
}
.badge-warning {
background-color: var(--status-warning-bg);
border-color: var(--status-warning-border);
color: var(--status-warning-fg);
}
.badge-error {
background-color: var(--status-error-bg);
border-color: var(--status-error-border);
color: var(--status-error-fg);
}
.glass-panel {
@apply backdrop-blur-xl border;
background: var(--glass-panel-bg);