style(order-delivery-reply): 页面样式调整

This commit is contained in:
HTEWJ\26070045 committed 2026-09-21 17:29:54 +08:00
1 parent 49f6a0f222
commit 3de24fd373
12 files changed
+172 -111

No files matched your search

@@ -46,9 +46,8 @@ export interface OrderDeliveryLine {
}
export interface OrderDeliveryListParams {
order_no?: string;
product_q?: string;
customer_q?: string;
/** 合并搜索关键词:订单单号/客户订单/客户编号/客户简称/公司全名/产品编号/品名/客户产品编号命中任一 */
keyword?: string;
order_date?: string;
status?: '' | 'replied' | 'not_fully_replied';
page?: number;
@@ -89,12 +88,10 @@ export interface BatchSummary {
items: BatchItemResult[];
}
/** 分页查询已同步订单行(erp_missing 行由后端排除)。 */
/** 分页查询已同步订单行(erp_missing 行由后端排除;keyword 为合并搜索关键词)。 */
export const listOrderDeliveryLines = (params?: OrderDeliveryListParams) => {
const query = new URLSearchParams();
if (params?.order_no) query.set('order_no', params.order_no);
if (params?.product_q) query.set('product_q', params.product_q);
if (params?.customer_q) query.set('customer_q', params.customer_q);
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);
if (params?.page) query.set('page', String(params.page));
@@ -7,6 +7,9 @@
* 列顺序:客户编号(简称副文案) → 订单日期 → 订单单号:项次 → 产品编号(品名副文案) →
* 客户产品编号 → 数量 → 约定交货日 → 交期回复状态 → 交期回复 → 交期回复人员 →
* 业务员(部门副文案) → 客户订单 → 规格 → 单位;独立的部门列/品名列已并入合并展示。
* 浏览体验:页面高度收敛至视口(滚动全部发生在表格容器内 → 列头 sticky 固定、横向滚动条
* 常驻表格底缘);左侧冻结前四列标识区(勾选/客户编号/订单日期/订单单号:项次,
* 冻结单元格用实色背景防透出);筛选区与工具栏字号与表格统一(text-xs)并压缩高度。
*/
<script setup lang="ts">
@@ -39,7 +42,7 @@ const auth = useAuthStore();
const canManage = computed(() => auth.hasFeaturePermission(ORDER_DELIVERY_REPLY_MANAGE_PERMISSION));
/* ============ 列表查询 ============ */
const filters = reactive({ order_no: '', product_q: '', customer_q: '', order_date: '', status: '' as '' | 'replied' | 'not_fully_replied' });
const filters = reactive({ keyword: '', order_date: '', status: '' as '' | 'replied' | 'not_fully_replied' });
const appliedFilters = reactive({ ...filters });
const items = ref<OrderDeliveryLine[]>([]);
const total = ref(0);
@@ -78,7 +81,7 @@ function doSearch() {
}
function doReset() {
Object.assign(filters, { order_no: '', product_q: '', customer_q: '', order_date: '', status: '' });
Object.assign(filters, { keyword: '', order_date: '', status: '' });
doSearch();
}
@@ -303,10 +306,10 @@ const latestSyncText = computed(() => {
const latestSyncFailed = computed(() => latestSync.value?.status === 'failed');
onMounted(() => {
// 企微卡片 jump_path 带 order_no/line_no 直达:自动填入筛选并命中该行。
// 企微卡片 jump_path 带 order_no/line_no 直达:自动填入关键词筛选并命中该行(关键词命中订单单号)。
const query = useRoute().query;
if (typeof query.order_no === 'string' && query.order_no) {
filters.order_no = query.order_no;
filters.keyword = query.order_no;
Object.assign(appliedFilters, filters);
}
void loadLines();
@@ -316,7 +319,9 @@ onMounted(() => {
<template>
<!-- 全页统一字号:与表头一致(text-xs 12px),根容器设定基准,子元素不再覆写 -->
<div class="flex min-h-screen flex-col gap-4 p-6 text-xs">
<!-- 高度收敛至视口(h-screen + overflow-hidden):页面自身不滚动,滚动全部在表格容器内,
列头 sticky 固定、横向滚动条常驻表格底缘;聊天壳 iframe 与独立路由均适用 -->
<div class="flex h-screen flex-col gap-4 overflow-hidden p-6 text-xs">
<!-- 页头:标题 + 最近同步 + 手动刷新 -->
<div class="flex flex-wrap items-center gap-3">
<h1 class="font-bold text-primary">{{ t('workspace.nav.orderDeliveryReply') }}</h1>
@@ -329,51 +334,43 @@ onMounted(() => {
</button>
</div>
<!-- 搜索区 -->
<div class="flex flex-wrap items-end gap-4 rounded-2xl border border-default bg-surface px-4 py-4">
<!-- 搜索区:合并关键词搜索(订单/产品/客户命中任一字段),字号与表格统一(text-xs),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-xs text-muted">
{{ t('workspace.orderDeliveryReply.filterOrderNo') }}
<input v-model="filters.order_no" class="h-9 min-w-[168px] rounded-lg border border-default px-3 text-primary outline-none focus:border-blue-500" :placeholder="t('workspace.orderDeliveryReply.filterOrderNoPh')" />
</label>
<label class="flex flex-col gap-1 text-xs text-muted">
{{ t('workspace.orderDeliveryReply.filterProduct') }}
<input v-model="filters.product_q" class="h-9 min-w-[200px] rounded-lg border border-default px-3 text-primary outline-none focus:border-blue-500" :placeholder="t('workspace.orderDeliveryReply.filterProductPh')" />
</label>
<label class="flex flex-col gap-1 text-xs text-muted">
{{ t('workspace.orderDeliveryReply.filterCustomer') }}
<input v-model="filters.customer_q" class="h-9 min-w-[150px] rounded-lg border border-default px-3 text-primary outline-none focus:border-blue-500" :placeholder="t('workspace.orderDeliveryReply.filterCustomerPh')" />
{{ t('workspace.orderDeliveryReply.filterKeyword') }}
<input v-model="filters.keyword" class="h-8 min-w-[340px] rounded-lg border border-default px-3 text-xs 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-xs text-muted">
{{ t('workspace.orderDeliveryReply.filterOrderDate') }}
<input v-model="filters.order_date" type="date" class="h-9 rounded-lg border border-default px-3 text-primary outline-none focus:border-blue-500" />
<input v-model="filters.order_date" type="date" class="h-8 rounded-lg border border-default px-3 text-xs text-primary outline-none focus:border-blue-500" />
</label>
<label class="flex flex-col gap-1 text-xs text-muted">
{{ t('workspace.orderDeliveryReply.filterStatus') }}
<!-- 状态筛选选择即生效(无需再点查询);其余条件仍由「查询」统一提交 -->
<select v-model="filters.status" class="h-9 min-w-[140px] rounded-lg border border-default bg-white px-3 text-primary outline-none focus:border-blue-500" @change="doSearch">
<select v-model="filters.status" class="h-8 min-w-[140px] rounded-lg border border-default bg-white px-3 text-xs 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-9" @click="doSearch">{{ t('workspace.orderDeliveryReply.search') }}</button>
<button type="button" class="btn-ghost h-9" @click="doReset">{{ t('workspace.orderDeliveryReply.reset') }}</button>
<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-xs text-muted">{{ t('workspace.orderDeliveryReply.totalCount', { count: total }) }}</span>
</div>
<!-- 工具栏:全选 + 联合回复 + 批量通知 -->
<div class="flex flex-wrap items-center gap-3 rounded-2xl border border-default bg-surface px-4 py-3">
<!-- 工具栏:全选 + 联合回复 + 批量通知(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">
<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)" />
{{ 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-9" :disabled="selectedLines.length === 0" @click="openBatchReply">
<button type="button" class="btn-primary h-8" :disabled="selectedLines.length === 0" @click="openBatchReply">
{{ t('workspace.orderDeliveryReply.batchReply') }}
</button>
<button type="button" class="btn-primary h-9" :disabled="notifiableSelected.length === 0 || notifying" @click="doNotifyBatch">
<button type="button" class="btn-primary h-8" :disabled="notifiableSelected.length === 0 || notifying" @click="doNotifyBatch">
{{ t('workspace.orderDeliveryReply.batchNotify') }}
</button>
</template>
@@ -384,12 +381,14 @@ onMounted(() => {
<!-- 列表 -->
<div class="min-h-0 flex-1 overflow-auto rounded-2xl border border-default bg-surface">
<table class="w-full border-collapse">
<thead class="sticky top-0 z-10 bg-slate-50 text-xs text-muted [&_th]:whitespace-nowrap">
<!-- z-30 高于表体冻结单元格(z-20):纵向滚动时冻结列不会盖住表头 -->
<thead class="sticky top-0 z-30 bg-slate-50 text-xs text-muted [&_th]:whitespace-nowrap">
<tr>
<th class="w-10 px-2 py-2" />
<th class="px-2 py-2 text-left">{{ t('workspace.orderDeliveryReply.colCustomer') }}</th>
<th class="px-2 py-2 text-left">{{ t('workspace.orderDeliveryReply.colOrderDate') }}</th>
<th class="px-2 py-2 text-left">{{ t('workspace.orderDeliveryReply.colOrderLine') }}</th>
<!-- 左侧冻结标识区(前四列):勾选/客户编号/订单日期/订单单号:项次,宽度固定保证偏移对齐 -->
<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>
@@ -407,35 +406,49 @@ onMounted(() => {
<tr
v-for="line in items"
:key="lineKey(line)"
class="border-t border-default hover:bg-slate-50"
class="group border-t border-default hover:bg-slate-50"
:class="selected.includes(lineKey(line)) ? 'bg-blue-50/60' : ''"
>
<td class="px-2 py-2">
<!-- 冻结单元格必须实色背景(半透明会透出滚动内容),并用 group-hover 与整行悬停/选中联动 -->
<td
class="sticky left-0 z-20 px-2 py-1.5"
:class="selected.includes(lineKey(line)) ? 'bg-blue-100 group-hover:bg-blue-200' : 'bg-white group-hover:bg-slate-100'"
>
<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)" />
</td>
<td class="px-2 py-2" :title="line.customer_full_name || line.customer_short_name || ''">
<td
class="sticky left-8 z-20 w-32 min-w-[8rem] max-w-[8rem] px-2 py-1.5"
:class="selected.includes(lineKey(line)) ? 'bg-blue-100 group-hover:bg-blue-200' : 'bg-white group-hover:bg-slate-100'"
:title="line.customer_full_name || line.customer_short_name || ''"
>
<div>{{ line.customer_no || '—' }}</div>
<div class="text-xs text-muted">{{ line.customer_short_name || '' }}</div>
<div class="truncate text-xs text-muted">{{ line.customer_short_name || '' }}</div>
</td>
<td class="whitespace-nowrap px-2 py-2">{{ line.order_date || '—' }}</td>
<td class="whitespace-nowrap px-2 py-2 font-mono text-xs">{{ line.order_no }}:{{ line.line_no }}</td>
<td class="px-2 py-2" :title="line.part_name || ''">
<div class="whitespace-nowrap font-mono text-xs">{{ line.part_no || '—' }}</div>
<div class="text-xs text-muted">{{ line.part_name || '' }}</div>
<td
class="sticky left-[10rem] z-20 w-24 min-w-[6rem] max-w-[6rem] overflow-hidden px-2 py-1.5"
:class="selected.includes(lineKey(line)) ? 'bg-blue-100 group-hover:bg-blue-200' : 'bg-white group-hover:bg-slate-100'"
>{{ 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 text-xs shadow-[2px_0_6px_-2px_rgba(15,23,42,0.12)]"
:class="selected.includes(lineKey(line)) ? 'bg-blue-100 group-hover:bg-blue-200' : 'bg-white group-hover:bg-slate-100'"
>{{ 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 text-xs">{{ line.part_no || '—' }}</div>
<div class="max-w-[14rem] truncate text-xs text-muted">{{ line.part_name || '' }}</div>
</td>
<td class="whitespace-nowrap px-2 py-2 font-mono text-xs">{{ line.customer_part_no || '—' }}</td>
<td class="whitespace-nowrap px-2 py-1.5 font-mono text-xs">{{ line.customer_part_no || '—' }}</td>
<td class="px-2 py-2 text-right tabular-nums">{{ line.qty ?? '—' }}</td>
<td class="whitespace-nowrap px-2 py-2">{{ line.agreed_date || '—' }}</td>
<td class="px-2 py-2">
<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">
{{ statusMeta(line.status).label }}
</span>
</td>
<!-- 交期回复:无批次=回复交期;有批次可展开;锁定=已锁定 -->
<td class="px-2 py-2 align-top">
<td class="px-2 py-1.5 align-top">
<template v-if="line.batches.length === 0">
<span class="text-muted">{{ t('workspace.orderDeliveryReply.statusNotReplied') }}</span>
<div v-if="canManage" class="mt-1">
<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-xs text-blue-600" @click="openSingleReply(line)">
{{ t('workspace.orderDeliveryReply.replyAction') }}
</button>
@@ -443,7 +456,7 @@ onMounted(() => {
</template>
<template v-else>
<div class="flex items-center gap-2">
<span class="rounded-full border border-default bg-slate-50 px-2 py-0.5 text-xs text-muted">
<span class="whitespace-nowrap rounded-full border border-default bg-slate-50 px-2 py-0.5 text-xs 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>
@@ -452,18 +465,18 @@ onMounted(() => {
{{ expanded.includes(lineKey(line)) ? t('workspace.orderDeliveryReply.collapse') : t('workspace.orderDeliveryReply.expand', { count: line.batches.length - 1 }) }}
</button>
</div>
<div class="mt-1 flex flex-col gap-0.5">
<div class="mt-0.5 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="rounded border-l-[3px] border-blue-500 bg-blue-50/50 px-2 py-0.5 text-xs text-secondary"
class="max-w-[230px] truncate rounded border-l-[3px] border-blue-500 bg-blue-50/50 px-2 py-0.5 text-xs text-secondary"
>
{{ 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>
</div>
</div>
<div class="mt-1">
<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-xs text-blue-600" @click="openSingleReply(line)">
{{ t('workspace.orderDeliveryReply.editReplyAction') }}
@@ -472,7 +485,7 @@ onMounted(() => {
</template>
</td>
<!-- 交期回复人员:锁定行附带已通知对象与时间(原「通知业务部门」列已取消,信息并入此处) -->
<td class="px-2 py-2">
<td class="px-2 py-1.5">
<template v-if="line.notified_employee_id || line.notified_user_name">
<div class="font-mono text-xs">{{ line.notified_employee_id || '' }}</div>
<div class="text-xs text-muted">{{ line.notified_user_name || '' }}</div>
@@ -484,13 +497,13 @@ onMounted(() => {
<span v-else class="text-muted">{{ t('workspace.orderDeliveryReply.pendingNotify') }}</span>
</td>
<!-- 业务员(副文案部门):与客户编号/简称同款合并展示,独立部门列已取消 -->
<td class="px-2 py-2" :title="line.salesperson_code || ''">
<td class="px-2 py-1.5" :title="line.salesperson_code || ''">
<div class="whitespace-nowrap">{{ line.salesperson_name || line.salesperson_code || '—' }}</div>
<div class="text-xs text-muted">{{ line.dept_name || line.dept_code || '' }}</div>
</td>
<td class="whitespace-nowrap px-2 py-2 font-mono text-xs">{{ line.customer_po || '—' }}</td>
<td class="px-2 py-2">{{ line.spec || '—' }}</td>
<td class="px-2 py-2">{{ line.unit || '—' }}</td>
<td class="px-2 py-1.5 font-mono text-xs" :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">{{ line.unit || '—' }}</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>