智能体按 reply_code 读后台回复语;陆运整车报价单顶栏色与填表更稳,工单页展示同步收紧。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
linmianxun
2026-10-07 11:41:09 +08:00
co-authored by Cursor
parent 177dd0b25f
commit 419b4a1bf7
35 changed files with 2439 additions and 268 deletions
@@ -1,4 +1,4 @@
<script setup lang="ts">
<script setup lang="ts">
/**
* 账号管理:对接 Jeecg /sys/user(主账登录账号)。
* 与员工岗位页分离——本页管后台登录,员工页管企微业务角色。
@@ -305,7 +305,7 @@ function removeAccount(row: AccountRow) {
</div>
</Teleport>
<div class="section-card">
<div class="section-card is-list-page">
<div class="toolbar">
<div class="search">
<ProtoIcon class="search-icon" name="search" :size="16" />
@@ -1,4 +1,4 @@
<script setup lang="ts">
<script setup lang="ts">
/**
* 角色管理:对接 Jeecg /sys/role 与菜单权限树。
* 数据权限按 Excel 线路目录树勾选,写入角色 description 的 [dataPerms:…],不另造 RBAC。
@@ -255,7 +255,7 @@ function onDataPermCheck(checked: string[] | { checked: string[] }) {
</button>
</Teleport>
<div class="section-card">
<div class="section-card is-list-page">
<div class="table-wrap">
<table class="data-table">
<thead>
@@ -494,7 +494,7 @@ function filterRouteOption(input: string, option: any) {
</div>
</Teleport>
<div class="section-card">
<div class="section-card is-list-page">
<div class="tabs-line-bar">
<div class="tabs-line">
<button type="button" :class="{ 'is-active': tab === 'all' }" @click="tab = 'all'">
@@ -30,6 +30,13 @@ body {
background: #f7f8fb !important;
min-width: 0 !important;
overflow-x: hidden;
/* 主区锁视口高度:列表页表格区内滚;看板等非列表页在 .admin-content 内滚 */
height: 100vh !important;
max-height: 100vh !important;
min-height: 0 !important;
overflow: hidden !important;
display: flex !important;
flex-direction: column !important;
}
.admin-content {
@@ -37,6 +44,9 @@ body {
gap: 12px !important;
min-width: 0 !important;
overflow-x: hidden;
flex: 1 1 auto !important;
min-height: 0 !important;
overflow: auto !important;
}
/*
@@ -559,12 +569,11 @@ body {
gap: 12px 16px !important;
}
/* 中间列横滑;左右 sticky 列固定 */
/* 中间列横滑;左右 sticky 列固定。竖滚改由 .is-list-page 表格区承接,勿再用 visible 把滚动甩给整页 */
.ticket-page .table-wrap,
.ticket-table-scroll {
border-radius: 10px !important;
overflow-x: auto !important;
overflow-y: visible;
-webkit-overflow-scrolling: touch;
}
@@ -1415,3 +1424,102 @@ textarea.field.field-tall {
align-items: start !important;
}
/**
* 列表页固定搜索区 / 表头 / 底部分页,表格区内双轴滚动。
* 根节点加 .is-list-page(工单、员工、账号、角色、报价模板)。
* 这样横向滚动条始终贴在表格可视区底部,不必滚到文档末尾才看到。
*/
.admin-content:has(> .is-list-page) {
overflow: hidden !important;
display: flex !important;
flex-direction: column !important;
padding-bottom: 16px !important;
}
.admin-content > .is-list-page {
flex: 1 1 auto !important;
min-height: 0 !important;
display: flex !important;
flex-direction: column !important;
overflow: hidden !important;
}
/* 工单页:外壳 is-list-page,内层 section-card 撑满 */
.admin-content > .is-list-page > .section-card {
flex: 1 1 auto !important;
min-height: 0 !important;
display: flex !important;
flex-direction: column !important;
overflow: hidden !important;
gap: 12px !important;
}
/* 账号/员工/角色/模板:section-card 自身即 is-list-page */
.admin-content > .section-card.is-list-page {
display: flex !important;
flex-direction: column !important;
gap: 12px !important;
}
.is-list-page .section-card-header,
.is-list-page .tabs-line-bar,
.is-list-page .toolbar,
.is-list-page .pagination {
flex-shrink: 0 !important;
}
.is-list-page .table-wrap,
.is-list-page .qt-template-table-wrap {
flex: 1 1 auto !important;
min-height: 0 !important;
overflow: auto !important;
overflow-x: auto !important;
overflow-y: auto !important;
-webkit-overflow-scrolling: touch;
}
/* 竖向滚动时表头钉在表格区顶部 */
.is-list-page .data-table thead th {
position: sticky !important;
top: 0 !important;
z-index: 4 !important;
background: #f8fafc !important;
box-shadow: 0 1px 0 var(--line, #d9e2ef);
}
/* 左/右冻结列与表头交叉处抬高层级,避免横滑时被盖住 */
.is-list-page .data-table thead th:first-child,
.is-list-page .data-table thead th.col-sticky-left {
left: 0 !important;
z-index: 6 !important;
}
.is-list-page .data-table thead th:last-child,
.is-list-page .data-table thead th.col-sticky-right {
right: 0 !important;
z-index: 6 !important;
}
.is-list-page .data-table tbody td:first-child,
.is-list-page .data-table tbody td.col-sticky-left {
position: sticky !important;
left: 0 !important;
z-index: 3 !important;
background: #fff !important;
}
.is-list-page .data-table tbody td:last-child,
.is-list-page .data-table tbody td.col-sticky-right {
position: sticky !important;
right: 0 !important;
z-index: 3 !important;
background: #fff !important;
}
.is-list-page .data-table tbody tr:hover td:first-child,
.is-list-page .data-table tbody tr:hover td:last-child,
.is-list-page .data-table tbody tr:hover td.col-sticky-left,
.is-list-page .data-table tbody tr:hover td.col-sticky-right {
background: #f8fbff !important;
}
@@ -688,7 +688,7 @@ async function downloadPreviewOrOriginal() {
</button>
</Teleport>
<div class="section-card qt-template-page">
<div class="section-card qt-template-page is-list-page">
<div class="toolbar">
<div class="search">
<ProtoIcon class="search-icon" name="search" :size="16" />
@@ -126,6 +126,17 @@ function asPriceLines(raw: any): PriceLine[] {
.filter((row) => row.name);
}
/**
* 未调价利润点必须是 0%。主账应已逐行给 0%;旧接口没给时,按成本/销售费用名补 0%。
* 禁止把金额拿来填利润点列。
*/
function displayProfitLines(row: TicketRow): PriceLine[] {
if (row.profitLines.length) return row.profitLines;
const src = row.saleLines.length ? row.saleLines : row.costLines;
if (!src.length) return [];
return src.map((line) => ({ name: line.name, text: "0%" }));
}
/**
* 后台报价来源:TMS标准报价 / 手工报价 / 销售调价。
* 禁止把产品报价或销售调价再显示成 TMS。
@@ -413,6 +424,44 @@ function quoteHasFees(row: TicketRow) {
return (row.quotes || []).some((q) => (q.fees || []).length > 0);
}
/**
* 报价信息 / 成本价 / 销售价 / 利润点共用一把「展开」:
* 收起时只留摘要(报价来源+总额、费用合计行),展开才看逐费明细。
* 避免只收起报价列、成本/利润仍撑很高。
*/
const priceExpandedMap = reactive<Record<string, boolean>>({});
const detailPriceExpanded = ref(false);
function detailPriceNeedsToggle(row: TicketRow | null) {
if (!row) return false;
return priceBlockNeedsToggle(row);
}
function isPriceExpanded(id: string) {
return !!priceExpandedMap[id];
}
function togglePriceExpanded(id: string) {
priceExpandedMap[id] = !priceExpandedMap[id];
}
function priceBlockNeedsToggle(row: TicketRow) {
return (
quoteHasFees(row) ||
row.costLines.length > 1 ||
row.saleLines.length > 1 ||
displayProfitLines(row).length > 1
);
}
/** 收起:优先只留「费用合计」;没有合计则留首行,避免整列空白。 */
function visiblePriceLines(lines: PriceLine[], expanded: boolean): PriceLine[] {
if (!lines.length) return [];
if (expanded || lines.length <= 1) return lines;
const totals = lines.filter((l) => l.name === "费用合计");
return totals.length ? totals : lines.slice(0, 1);
}
/** 列表询价需求第二行起:与旧后台 summary-cell 多行展示一致。 */
function demandDetailLines(row: TicketRow) {
return String(row?.demandDetail || "")
@@ -472,6 +521,7 @@ onMounted(() => loadList());
async function openDetail(row: TicketRow) {
current.value = row;
detailPriceExpanded.value = false;
detailOpen.value = true;
try {
const res: any = await getWorkOrderDetail(row.id);
@@ -540,7 +590,7 @@ function refresh() {
</div>
</Teleport>
<div class="ticket-page">
<div class="ticket-page is-list-page">
<div class="section-card">
<div class="section-card-header">
<h2 class="section-card-title">询价工单列表</h2>
@@ -664,35 +714,41 @@ function refresh() {
</ExpandableClamp>
</td>
<td class="align-top col-quote">
<ExpandableClamp
v-if="row.quotes.length"
v-slot="{ expanded }"
:content-key="row.id + '-quote-' + row.quotes.length"
:force-toggle="quoteHasFees(row)"
:clip-collapsed="false"
>
<div
v-for="q in row.quotes"
:key="q.source + q.price"
class="quote-row"
style="margin-bottom: 8px"
>
<div class="quote-source">{{ q.source }}</div>
<div class="quote-price" :style="q.highlight ? { color: '#1d4ed8' } : undefined">
{{ q.price }}
</div>
<template v-if="expanded && q.fees.length">
<div
v-for="(fee, fi) in q.fees"
:key="q.source + '-fee-' + fi"
class="quote-fee-line"
>
{{ fee.name }}:{{ fee.amount }}
<div class="ticket-price-expand">
<template v-if="row.quotes.length">
<div
v-for="q in row.quotes"
:key="q.source + q.price"
class="quote-row"
style="margin-bottom: 8px"
>
<div class="quote-source">{{ q.source }}</div>
<div class="quote-price" :style="q.highlight ? { color: '#1d4ed8' } : undefined">
{{ q.price }}
</div>
</template>
</div>
</ExpandableClamp>
<span v-else style="color: #94a3b8">-</span>
<template v-if="isPriceExpanded(row.id) && q.fees.length">
<div
v-for="(fee, fi) in q.fees"
:key="q.source + '-fee-' + fi"
class="quote-fee-line"
>
{{ fee.name }}:{{ fee.amount }}
</div>
</template>
</div>
</template>
<span v-else style="color: #94a3b8">-</span>
<button
v-if="priceBlockNeedsToggle(row)"
type="button"
class="ticket-price-toggle"
:class="{ 'is-open': isPriceExpanded(row.id) }"
:title="isPriceExpanded(row.id) ? '收起费用明细' : '展开费用明细'"
@click.stop="togglePriceExpanded(row.id)"
>
<ProtoIcon name="chevron" :size="14" />
</button>
</div>
</td>
<td class="align-top">
<div v-if="row.attachments.length" class="attach-tags">
@@ -702,9 +758,12 @@ function refresh() {
</td>
<td class="align-top"><span class="ticket-status">{{ row.status }}</span></td>
<td class="align-top">
<div v-if="row.costLines.length" class="ticket-price-lines">
<div
v-if="visiblePriceLines(row.costLines, isPriceExpanded(row.id)).length"
class="ticket-price-lines"
>
<div
v-for="(line, i) in row.costLines"
v-for="(line, i) in visiblePriceLines(row.costLines, isPriceExpanded(row.id))"
:key="row.id + '-cost-' + i"
class="ticket-price-line"
:class="{ 'is-total': line.name === '费用合计' }"
@@ -715,9 +774,12 @@ function refresh() {
<span v-else class="ticket-price-cell">{{ row.costPrice }}</span>
</td>
<td class="align-top">
<div v-if="row.saleLines.length" class="ticket-price-lines">
<div
v-if="visiblePriceLines(row.saleLines, isPriceExpanded(row.id)).length"
class="ticket-price-lines"
>
<div
v-for="(line, i) in row.saleLines"
v-for="(line, i) in visiblePriceLines(row.saleLines, isPriceExpanded(row.id))"
:key="row.id + '-sale-' + i"
class="ticket-price-line"
:class="{ 'is-total': line.name === '费用合计' }"
@@ -728,9 +790,12 @@ function refresh() {
<span v-else class="ticket-price-cell" style="font-weight: 800">{{ row.salePrice }}</span>
</td>
<td class="align-top">
<div v-if="row.profitLines.length" class="ticket-price-lines">
<div
v-if="visiblePriceLines(displayProfitLines(row), isPriceExpanded(row.id)).length"
class="ticket-price-lines"
>
<div
v-for="(line, i) in row.profitLines"
v-for="(line, i) in visiblePriceLines(displayProfitLines(row), isPriceExpanded(row.id))"
:key="row.id + '-profit-' + i"
class="ticket-price-line"
:class="{ 'is-total': line.name === '费用合计' }"
@@ -738,7 +803,7 @@ function refresh() {
{{ line.name }}:{{ line.text || "-" }}
</div>
</div>
<span v-else class="ticket-margin-cell">{{ row.profit }}</span>
<span v-else class="ticket-margin-cell">{{ row.profit === "-" ? "0%" : row.profit }}</span>
</td>
<td class="col-center">
<span v-if="row.eventException !== '-'" class="tag tag-rose">{{ row.eventException }}</span>
@@ -843,56 +908,60 @@ function refresh() {
<div class="ticket-detail-title">
<ProtoIcon name="gauge" :size="14" />价格与利润
</div>
<div class="ticket-detail-grid">
<div class="ticket-detail-item">
<label>成本价</label>
<div v-if="current.costLines.length" class="ticket-price-lines">
<div class="ticket-price-expand">
<div class="ticket-detail-grid">
<div class="ticket-detail-item">
<label>成本价</label>
<div
v-for="(line, i) in current.costLines"
:key="'detail-cost-' + i"
class="ticket-price-line"
:class="{ 'is-total': line.name === '费用合计' }"
v-if="visiblePriceLines(current.costLines, detailPriceExpanded).length"
class="ticket-price-lines"
>
{{ line.name }}:{{ line.text || "-" }}
<div
v-for="(line, i) in visiblePriceLines(current.costLines, detailPriceExpanded)"
:key="'detail-cost-' + i"
class="ticket-price-line"
:class="{ 'is-total': line.name === '费用合计' }"
>
{{ line.name }}:{{ line.text || "-" }}
</div>
</div>
<span v-else>{{ current.costPrice }}</span>
</div>
<span v-else>{{ current.costPrice }}</span>
</div>
<div class="ticket-detail-item">
<label>销售价</label>
<div v-if="current.saleLines.length" class="ticket-price-lines">
<div class="ticket-detail-item">
<label>销售价</label>
<div
v-for="(line, i) in current.saleLines"
:key="'detail-sale-' + i"
class="ticket-price-line"
:class="{ 'is-total': line.name === '费用合计' }"
v-if="visiblePriceLines(current.saleLines, detailPriceExpanded).length"
class="ticket-price-lines"
>
{{ line.name }}:{{ line.text || "-" }}
<div
v-for="(line, i) in visiblePriceLines(current.saleLines, detailPriceExpanded)"
:key="'detail-sale-' + i"
class="ticket-price-line"
:class="{ 'is-total': line.name === '费用合计' }"
>
{{ line.name }}:{{ line.text || "-" }}
</div>
</div>
<span v-else>{{ current.salePrice }}</span>
</div>
<span v-else>{{ current.salePrice }}</span>
</div>
<div class="ticket-detail-item">
<label>利润点</label>
<div v-if="current.profitLines.length" class="ticket-price-lines">
<div class="ticket-detail-item">
<label>利润点</label>
<div
v-for="(line, i) in current.profitLines"
:key="'detail-profit-' + i"
class="ticket-price-line"
:class="{ 'is-total': line.name === '费用合计' }"
v-if="visiblePriceLines(displayProfitLines(current), detailPriceExpanded).length"
class="ticket-price-lines"
>
{{ line.name }}:{{ line.text || "-" }}
<div
v-for="(line, i) in visiblePriceLines(displayProfitLines(current), detailPriceExpanded)"
:key="'detail-profit-' + i"
class="ticket-price-line"
:class="{ 'is-total': line.name === '费用合计' }"
>
{{ line.name }}:{{ line.text || "-" }}
</div>
</div>
<span v-else>{{ current.profit === "-" ? "0%" : current.profit }}</span>
</div>
<span v-else>{{ current.profit }}</span>
</div>
</div>
<ExpandableClamp
v-if="current.quotes.length"
class="ticket-detail-demand"
:content-key="current.id + '-detail-quote-' + current.quotes.length"
:max-height="220"
>
<div
v-for="q in current.quotes"
:key="q.source + q.price + (q.time || '')"
@@ -901,7 +970,7 @@ function refresh() {
<div class="quote-source">
{{ q.source }}<span v-if="q.time && q.time !== '-'"> · {{ q.time }}</span>
</div>
<div v-if="q.fees.length" class="quote-fee-list">
<div v-if="detailPriceExpanded && q.fees.length" class="quote-fee-list">
<div
v-for="(fee, fi) in q.fees"
:key="q.source + '-detail-fee-' + fi"
@@ -918,7 +987,17 @@ function refresh() {
合计 {{ q.price }}
</div>
</div>
</ExpandableClamp>
<button
v-if="detailPriceNeedsToggle(current)"
type="button"
class="ticket-price-toggle"
:class="{ 'is-open': detailPriceExpanded }"
:title="detailPriceExpanded ? '收起费用明细' : '展开费用明细'"
@click="detailPriceExpanded = !detailPriceExpanded"
>
<ProtoIcon name="chevron" :size="14" />
</button>
</div>
</section>
<section class="ticket-detail-section">
@@ -1032,4 +1111,32 @@ function refresh() {
color: #708090;
font-size: 12px;
}
/* 报价+成本+利润共用展开:箭头管整块费用明细 */
.ticket-price-expand {
position: relative;
min-width: 0;
}
.ticket-price-toggle {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
margin-top: 4px;
padding: 2px 0 0;
border: 0;
background: transparent;
color: #64748b;
cursor: pointer;
line-height: 1;
}
.ticket-price-toggle:hover {
color: #1d4ed8;
}
.ticket-price-toggle :deep(svg) {
transition: transform 0.15s ease;
}
.ticket-price-toggle.is-open :deep(svg) {
transform: rotate(180deg);
}
</style>