style(order-delivery-reply): 页面样式调整
This commit is contained in:
1 parent
49f6a0f222
commit
3de24fd373
12 files changed
+172
-111
No files matched your search
@@ -111,8 +111,9 @@ def list_lines():
|
||||
|
||||
用途与触发时机:工作台首屏与筛选刷新;全选仅作用于本页返回的 items。
|
||||
|
||||
参数与输出约束:查询参数 order_no/product_q/customer_q/order_date/status/page/page_size;
|
||||
status ∈ 空(全部) | replied(已回复) | not_fully_replied(未完全回复);
|
||||
参数与输出约束:查询参数 keyword/order_date/status/page/page_size——keyword 为合并搜索
|
||||
(订单单号/客户订单/客户编号/客户简称/公司全名/产品编号/品名/客户产品编号
|
||||
命中任一即返回);status ∈ 空(全部) | replied(已回复) | not_fully_replied(未完全回复);
|
||||
返回统一 envelope,data.items 为行序列化(含批次、状态、未交数量)。
|
||||
"""
|
||||
_require_access()
|
||||
|
||||
@@ -85,33 +85,24 @@ def _apply_filters(stmt: Select, params: dict[str, Any]) -> Select:
|
||||
"""
|
||||
应用列表筛选(AND 语义)与状态筛选下推。
|
||||
|
||||
核心逻辑:order_no 模糊;product_q 命中 产品编号/品名/客户产品编号;customer_q 命中
|
||||
客户编号/客户简称/公司全名;order_date 精确单日;status=replied → 已锁定,
|
||||
核心逻辑:keyword 关键词合并搜索——订单单号/客户订单/客户编号/客户简称/公司全名/
|
||||
产品编号/品名/客户产品编号命中任一字段即返回(OR,工作台单搜索框口径);
|
||||
order_date 精确单日;status=replied → 已锁定,
|
||||
status=not_fully_replied → 未锁定(未回复∪部分回复)。
|
||||
"""
|
||||
order_no = str(params.get("order_no") or "").strip()
|
||||
if order_no:
|
||||
stmt = stmt.where(OrderDeliveryErpLine.order_no.ilike(f"%{order_no}%"))
|
||||
|
||||
product_q = str(params.get("product_q") or "").strip()
|
||||
if product_q:
|
||||
like = f"%{product_q}%"
|
||||
stmt = stmt.where(
|
||||
or_(
|
||||
OrderDeliveryErpLine.part_no.ilike(like),
|
||||
OrderDeliveryErpLine.part_name.ilike(like),
|
||||
OrderDeliveryErpLine.customer_part_no.ilike(like),
|
||||
)
|
||||
)
|
||||
|
||||
customer_q = str(params.get("customer_q") or "").strip()
|
||||
if customer_q:
|
||||
like = f"%{customer_q}%"
|
||||
keyword = str(params.get("keyword") or "").strip()
|
||||
if keyword:
|
||||
like = f"%{keyword}%"
|
||||
stmt = stmt.where(
|
||||
or_(
|
||||
OrderDeliveryErpLine.order_no.ilike(like),
|
||||
OrderDeliveryErpLine.customer_po.ilike(like),
|
||||
OrderDeliveryErpLine.customer_no.ilike(like),
|
||||
OrderDeliveryErpLine.customer_short_name.ilike(like),
|
||||
OrderDeliveryErpLine.customer_full_name.ilike(like),
|
||||
OrderDeliveryErpLine.part_no.ilike(like),
|
||||
OrderDeliveryErpLine.part_name.ilike(like),
|
||||
OrderDeliveryErpLine.customer_part_no.ilike(like),
|
||||
)
|
||||
)
|
||||
|
||||
@@ -220,7 +211,7 @@ def list_lines(params: dict[str, Any]) -> dict[str, Any]:
|
||||
[STEP 3] 批量预取本页行的批次与锁定状态,避免 N+1,再逐行序列化。
|
||||
|
||||
Args:
|
||||
params: order_no / product_q / customer_q / order_date / status / page / page_size。
|
||||
params: keyword / order_date / status / page / page_size。
|
||||
Returns:
|
||||
{"items": [...], "page", "page_size", "total"};items 含批次与状态(见 _serialize_line)。
|
||||
"""
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
"""
|
||||
tests/test_order_delivery_query.py
|
||||
|
||||
用途:订单交期回复列表合并关键词搜索(keyword OR 语义)的单测。
|
||||
依赖:conftest 的 app 夹具(testing + sqlite create_all)、query_service.list_lines。
|
||||
逻辑:keyword 命中订单单号/客户编号/产品编号/品名等任一字段即返回该行;
|
||||
订单维度命中时该订单全部项次返回;日期与状态筛选行为不回归。
|
||||
"""
|
||||
|
||||
from datetime import date
|
||||
from decimal import Decimal
|
||||
|
||||
from app.extensions import db
|
||||
from app.models.order_delivery_reply import OrderDeliveryErpLine
|
||||
from app.services.order_delivery_reply.query_service import list_lines
|
||||
|
||||
|
||||
def _line(order_no, line_no, *, cust_no="C001", part_no="P-1", part_name="标准物料", cust_part="CP-1"):
|
||||
"""构造一行最小快照(字段名/值供 keyword 断言用)。"""
|
||||
row = OrderDeliveryErpLine(
|
||||
order_no=order_no,
|
||||
line_no=line_no,
|
||||
order_date=date(2024, 6, 1),
|
||||
customer_no=cust_no,
|
||||
customer_short_name="恒远电子",
|
||||
part_no=part_no,
|
||||
part_name=part_name,
|
||||
customer_part_no=cust_part,
|
||||
qty=Decimal("100"),
|
||||
delivered_qty=Decimal("0"),
|
||||
erp_missing=False,
|
||||
)
|
||||
db.session.add(row)
|
||||
return row
|
||||
|
||||
|
||||
def test_keyword_matches_any_field_or_semantics(app):
|
||||
"""keyword 命中订单单号/客户编号/品名任一字段即返回(OR)。"""
|
||||
_line("8301-A", 1, part_name="驱动齿轮")
|
||||
_line("8301-B", 1, cust_no="C999")
|
||||
_line("8301-C", 1, part_no="P-XYZ")
|
||||
db.session.commit()
|
||||
|
||||
# 断言:品名命中 → 只返回 8301-A
|
||||
assert [i["order_no"] for i in list_lines({"keyword": "齿轮"})["items"]] == ["8301-A"]
|
||||
# 断言:客户编号命中 → 只返回 8301-B
|
||||
assert [i["order_no"] for i in list_lines({"keyword": "C999"})["items"]] == ["8301-B"]
|
||||
# 断言:产品编号命中 → 只返回 8301-C(大小写不敏感)
|
||||
assert [i["order_no"] for i in list_lines({"keyword": "p-xyz"})["items"]] == ["8301-C"]
|
||||
# 断言:订单单号片段命中 → 8301-A
|
||||
assert [i["order_no"] for i in list_lines({"keyword": "8301-A"})["items"]] == ["8301-A"]
|
||||
# 断言:无命中 → 空
|
||||
assert list_lines({"keyword": "不存在"})["items"] == []
|
||||
# 断言:空关键词 = 全部
|
||||
assert list_lines({})["total"] == 3
|
||||
|
||||
|
||||
def test_keyword_and_date_status_filters_stack(app):
|
||||
"""keyword 与 order_date/status 叠加时仍为 AND 语义。"""
|
||||
_line("8301-D", 1, part_name="齿轮")
|
||||
_line("8301-E", 1, part_name="齿轮")
|
||||
db.session.commit()
|
||||
|
||||
from app.models.order_delivery_reply import OrderDeliveryBatch
|
||||
|
||||
db.session.add(OrderDeliveryBatch(line_id=2, seq=1, planned_date=date(2024, 7, 1), qty=1))
|
||||
db.session.commit()
|
||||
|
||||
# 断言:关键词 + 日期叠加 → 只留同时满足的行
|
||||
result = list_lines({"keyword": "齿轮", "order_date": "2024-06-01"})
|
||||
assert result["total"] == 2
|
||||
result = list_lines({"keyword": "齿轮", "order_date": "2024-06-02"})
|
||||
assert result["total"] == 0
|
||||
# 断言:status=not_fully_replied(未锁定)两行都算;有批次的行仍是未锁定(部分回复)
|
||||
assert list_lines({"keyword": "齿轮", "status": "not_fully_replied"})["total"] == 2
|
||||
@@ -173,7 +173,7 @@ flowchart TD
|
||||
|
||||
## 7. 查询与列表
|
||||
|
||||
筛选(AND):订单单号、产品编号/品名/客户产品编号、客户编号或客户简称、订单日期(单日)、交期回复状态。
|
||||
筛选(AND):**关键词**(合并搜索:订单单号/客户订单/客户编号/客户简称/公司全名/产品编号/品名/客户产品编号命中任一即返回,2026-09-21 由三个独立搜索框合并)、订单日期(单日)、交期回复状态。
|
||||
|
||||
交期回复状态筛选项:
|
||||
|
||||
|
||||
@@ -213,7 +213,7 @@ erDiagram
|
||||
| POST | `/sync` | 手动同步 |
|
||||
| GET | `/sync/latest` | 最近一次同步 |
|
||||
|
||||
GET `/lines` 查询:`order_no`、`product_q`、`customer_q`、`order_date`、`status`(空=`全部` / `已回复` / `未完全回复`)、`page`、`page_size`。默认排序 `order_date, customer_no, order_no, line_no, part_no` 升序。`page_size` 默认 50。全选仅本页。
|
||||
GET `/lines` 查询:`keyword`(合并搜索:订单单号/客户订单/客户编号/客户简称/公司全名/产品编号/品名/客户产品编号 OR 命中)、`order_date`、`status`(空=`全部` / `已回复` / `未完全回复`)、`page`、`page_size`。默认排序 `order_date, customer_no, order_no, line_no, part_no` 升序。`page_size` 默认 50。全选仅本页。
|
||||
|
||||
直链打开 `erp_missing` 的行:按不存在处理,不在工作台展示。
|
||||
|
||||
@@ -263,7 +263,7 @@ GET `/lines` 查询:`order_no`、`product_q`、`customer_q`、`order_date`、`
|
||||
|
||||
`frontend/src/features/order-delivery-reply/`:`constants.ts`(权限键)、`api/orderDeliveryReply.api.ts`(统一 `requestJson`)、`views/OrderDeliveryReplyPage.vue`(操作页)。交互以更新后的原型 v5 为准。工具栏:「联合回复交期」与「批量通知」分开;**通知唯一入口为「批量通知」**,列表不出「通知业务部门」列(行内不设发送按钮;已通知对象与时间并入「交期回复人员」列)。状态徽标按需求 §12,不用旧原型按数量覆盖的脚本。
|
||||
|
||||
列表(2026-09-21 修订列顺序,独立「部门」「品名」列取消)按序为:勾选、客户编号(副文案客户简称,全名 title)、订单日期、订单单号:项次、产品编号(副文案品名)、客户产品编号、数量、约定交货日、交期回复状态、交期回复、交期回复人员、业务员(副文案部门)、客户订单、规格、单位。不渲染订单类型、单别、已转请购、排定交货日,亦不出「已交数量 / 未交数量」列(`NVL(oeb24,0)=0` 过滤后无信息量;未交口径仍由后端计算,供回复弹窗超额提醒);表头与工具栏提示不换行(`whitespace-nowrap`,避免窄列中文竖排)。分页复用共享 `PaginationBar`(与管理控制台-数据报表同一组件:摘要 + 每页条数 20/50/100/200 + 页码按钮)。客户列:编号 + 简称,全名作 title;产品编号列:编号 + 品名;业务员列:姓名 + 部门,同款上下两行合并展示。仅 `access` 时隐藏回复、通知、同步按钮与手动刷新。用户管理勾选两键功能权限。一期无单别管理页。
|
||||
列表(2026-09-21 修订列顺序,独立「部门」「品名」列取消)按序为:勾选、客户编号(副文案客户简称,全名 title)、订单日期、订单单号:项次、产品编号(副文案品名)、客户产品编号、数量、约定交货日、交期回复状态、交期回复、交期回复人员、业务员(副文案部门)、客户订单、规格、单位。表格浏览体验(2026-09-21):页面高度收敛至视口(滚动全部发生在表格容器内 → 列头 sticky 固定、横向滚动条常驻表格底缘);左侧冻结前四列标识区(勾选/客户编号/订单日期/订单单号:项次,冻结单元格实色背景防透出,宽度已收窄至 2/8/6/10rem);行高紧凑(表体 py-1.5,产品编号/品名/规格/客户订单/客户简称长文本单行截断 + title 悬停看全文,交期回复批次条不折行);筛选区与工具栏字号与表格统一(text-xs)并压缩高度。列项与顺序不变。不渲染订单类型、单别、已转请购、排定交货日,亦不出「已交数量 / 未交数量」列(`NVL(oeb24,0)=0` 过滤后无信息量;未交口径仍由后端计算,供回复弹窗超额提醒);表头与工具栏提示不换行(`whitespace-nowrap`,避免窄列中文竖排)。分页复用共享 `PaginationBar`(与管理控制台-数据报表同一组件:摘要 + 每页条数 20/50/100/200 + 页码按钮)。客户列:编号 + 简称,全名作 title;产品编号列:编号 + 品名;业务员列:姓名 + 部门,同款上下两行合并展示。仅 `access` 时隐藏回复、通知、同步按钮与手动刷新。用户管理勾选两键功能权限。一期无单别管理页。
|
||||
|
||||
### 8.1 路由与入口
|
||||
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
| --- | --- | --- |
|
||||
| ERP 订单行同步 | 已实现 | 每天 07:00(Asia/Shanghai)排程 + 生管手动全量同步;开发环境无独立 schedule-worker 进程时由 Web 进程内兜底扫描线程触发到期排程(`SCHEDULE_WEB_SCANNER_ENABLED`,生产默认关);只拉已审核(`oeaconf='Y'`)+ 已核准(`oea49='1'`)+ 未结案(`oeb70≠Y`)+ 完全未交(`NVL(oeb24,0)=0`,已有交货的行不同步)的订单行到本地快照(`order_delivery_erp_lines`),upsert 仅更新 ERP 列白名单不覆盖回复;本轮未命中行标 `erp_missing` 不删除;失败保留上次快照并展示最近同步时间。 |
|
||||
| 同步完成提醒生管 | 已实现 | 07:00 排程同步成功后,按该排程任务的「通知开关 + 通知人」(管理端排程表单现成配置,人员可配置)给生管发企微提醒查看当天交期回复(复用 `send_wecom_event_message`,事件 `order_delivery_reply_notify`);通知失败不影响同步结果;已置 `domain_notification_managed` 抑制通用排程完成通知避免双重打扰。 |
|
||||
| 订单行查询台 | 已实现 | 工作台操作页筛选分页(订单单号 / 产品三字段 / 客户 / 订单日期 / 状态 全部·已回复·未完全回复),默认排序订单日期→客户→单号→项次,分页默认 50;列顺序:客户编号(副文案简称) → 订单日期 → 订单单号:项次 → 产品编号(副文案品名) → 客户产品编号 → 数量 → 约定交货日 → 交期回复状态 → 交期回复 → 交期回复人员 → 业务员(副文案部门) → 客户订单 → 规格 → 单位(独立的部门列/品名列已取消,与业务员/产品编号合并展示);列表不出已交/未交两列(完全未交过滤后无信息量);行状态读时推导未回复/部分回复/已回复;列表不出单别、订单类型、已转请购、排定交货日。 |
|
||||
| 订单行查询台 | 已实现 | 工作台操作页筛选分页:**关键词合并搜索**(订单单号/客户订单/客户编号/客户简称/公司全名/产品编号/品名/客户产品编号命中任一,2026-09-21 由三框合并)+ 订单日期 + 状态(全部·已回复·未完全回复),默认排序订单日期→客户→单号→项次,分页默认 50;列顺序:客户编号(副文案简称) → 订单日期 → 订单单号:项次 → 产品编号(副文案品名) → 客户产品编号 → 数量 → 约定交货日 → 交期回复状态 → 交期回复 → 交期回复人员 → 业务员(副文案部门) → 客户订单 → 规格 → 单位(独立的部门列/品名列已取消,与业务员/产品编号合并展示);表格浏览体验:页面高度收敛至视口(列头固定、横向滚动条常驻)、左侧冻结前四列标识区(勾选/客户编号/订单日期/订单单号:项次,已收窄)、行高紧凑(长文本截断悬停看全文、批次条不折行)、筛选区与工具栏字号与表格统一并压缩高度;列表不出已交/未交两列(完全未交过滤后无信息量);行状态读时推导未回复/部分回复/已回复;列表不出单别、订单类型、已转请购、排定交货日。 |
|
||||
| 每日提醒(出货 + 未回复) | 已实现 | 新排程 `order-delivery-remind`(日批 07:10,种子 `SCH-ORDER-DELIVERY-REMIND`):① 已回复(已锁定)行的回复交期距今 ≤「出货提醒提前天数」(默认 3,任务参数可配)时按业务员聚合发一条企微提醒安排出货,同一(行,交期)只提醒一次、发送失败次日自动补发;② 超过「未回复再次提醒天数」(默认 3,任务参数可配)仍未回复的行按收件人聚合一并企微提醒生管(收件人=该排程任务通知人配置,开关控制),同一行每 N 天最多提醒一次;两类提醒由任务参数 `ship_remind_enabled` / `unreplied_remind_enabled`(布尔,默认开)独立启停;提醒逐行写审计 `ship_remind` / `unreplied_remind`,只读业务数据不改批次/锁定。 |
|
||||
| 单行 / 拆分回复 | 已实现 | 弹窗维护 1..20 批「交期 + 数量 + 备注」,交期必填、数量>0、备注≤200、交期不重复,支持快速统一交期;未锁定行整表替换批次;超额仅标「超」提醒不拦截;已锁定行 409。 |
|
||||
| 联合回复与批量通知 | 已实现 | 勾选多行(全选仅本页)「联合回复交期」逐行保存批次(单次≤200 行,单行失败不回滚其它行);通知唯一入口为工具栏「批量通知」(列表不出通知列,已通知对象与时间并入「交期回复人员」列),对已有批次且未锁定的行逐行发送并锁定,无批次/已锁定跳过并汇总提示。 |
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -861,12 +861,8 @@
|
||||
"syncDone": "Sync completed, {count} lines",
|
||||
"syncSkipped": "A sync is already running; try again later",
|
||||
"syncFailedTitle": "Sync failed; last snapshot kept",
|
||||
"filterOrderNo": "Order No.",
|
||||
"filterOrderNoPh": "Enter order number",
|
||||
"filterProduct": "Part No. / Name / Customer Part",
|
||||
"filterProductPh": "Part number, name, or customer part number",
|
||||
"filterCustomer": "Customer No. / Short Name",
|
||||
"filterCustomerPh": "Customer number or short name",
|
||||
"filterKeyword": "Keyword (order / product / customer)",
|
||||
"filterKeywordPh": "Search by order no., product no., name, customer part no., or customer no.",
|
||||
"filterOrderDate": "Order Date",
|
||||
"filterStatus": "Reply Status",
|
||||
"statusAll": "All",
|
||||
|
||||
@@ -797,12 +797,8 @@
|
||||
"syncDone": "ซิงค์สำเร็จ รวม {count} รายการ",
|
||||
"syncSkipped": "มีการซิงค์กำลังทำงานอยู่ โปรดลองอีกครั้งภายหลัง",
|
||||
"syncFailedTitle": "ซิงค์ล้มเหลว ยังคงภาพรวมเดิมไว้",
|
||||
"filterOrderNo": "เลขที่คำสั่งซื้อ",
|
||||
"filterOrderNoPh": "กรอกเลขที่คำสั่งซื้อ",
|
||||
"filterProduct": "รหัสสินค้า / ชื่อ / รหัสลูกค้า",
|
||||
"filterProductPh": "รหัสสินค้า ชื่อสินค้า หรือรหัสสินค้าของลูกค้า",
|
||||
"filterCustomer": "รหัสลูกค้า / ชื่อย่อ",
|
||||
"filterCustomerPh": "รหัสลูกค้าหรือชื่อย่อ",
|
||||
"filterKeyword": "คำค้นหา (คำสั่งซื้อ / สินค้า / ลูกค้า)",
|
||||
"filterKeywordPh": "ค้นหาเลขที่คำสั่งซื้อ รหัสสินค้า ชื่อสินค้า รหัสสินค้าลูกค้า หรือรหัสลูกค้า",
|
||||
"filterOrderDate": "วันที่สั่งซื้อ",
|
||||
"filterStatus": "สถานะการตอบกลับ",
|
||||
"statusAll": "ทั้งหมด",
|
||||
|
||||
@@ -861,12 +861,8 @@
|
||||
"syncDone": "同步完成,共 {count} 行",
|
||||
"syncSkipped": "已有同步正在进行,请稍后再试",
|
||||
"syncFailedTitle": "同步失败,已保留上次快照",
|
||||
"filterOrderNo": "订单单号",
|
||||
"filterOrderNoPh": "输入订单单号",
|
||||
"filterProduct": "产品编号 / 品名 / 客户料号",
|
||||
"filterProductPh": "产品编号、品名或客户产品编号",
|
||||
"filterCustomer": "客户编号 / 简称",
|
||||
"filterCustomerPh": "客户编号或简称",
|
||||
"filterKeyword": "关键词(订单 / 产品 / 客户)",
|
||||
"filterKeywordPh": "订单单号、产品编号、品名、客户料号、客户编号均可搜索",
|
||||
"filterOrderDate": "订单日期",
|
||||
"filterStatus": "交期回复状态",
|
||||
"statusAll": "全部",
|
||||
|
||||
@@ -861,12 +861,8 @@
|
||||
"syncDone": "同步完成,共 {count} 行",
|
||||
"syncSkipped": "已有同步正在進行,請稍後再試",
|
||||
"syncFailedTitle": "同步失敗,已保留上次快照",
|
||||
"filterOrderNo": "訂單單號",
|
||||
"filterOrderNoPh": "輸入訂單單號",
|
||||
"filterProduct": "產品編號 / 品名 / 客戶料號",
|
||||
"filterProductPh": "產品編號、品名或客戶產品編號",
|
||||
"filterCustomer": "客戶編號 / 簡稱",
|
||||
"filterCustomerPh": "客戶編號或簡稱",
|
||||
"filterKeyword": "關鍵詞(訂單 / 產品 / 客戶)",
|
||||
"filterKeywordPh": "訂單單號、產品編號、品名、客戶料號、客戶編號均可搜尋",
|
||||
"filterOrderDate": "訂單日期",
|
||||
"filterStatus": "交期回覆狀態",
|
||||
"statusAll": "全部",
|
||||
|
||||
Reference in new issue
Block a user