Merge branch 'dev' into order-delivery-reply
# Conflicts: # frontend/src/locales/en/admin.json # frontend/src/locales/th/admin.json # frontend/src/locales/zh-TW/admin.json
This commit is contained in:
commit
7fb36b301c
13 files changed
+285
-99
No files matched your search
@@ -1,14 +1,16 @@
|
||||
<!--
|
||||
features/contract-payment/components/ContractPaymentChatPanel.vue
|
||||
用途:合同付款预警 Chat 主区:管理员按钮、三 Tab、当前 Tab 内详情下钻。
|
||||
依赖:contract-payment 三页与详情、useContractPaymentAdminActions、vue-router query。
|
||||
依赖:contract-payment 三页与详情、useContractPaymentAdminActions、vue-router query、lucide-vue-next。
|
||||
逻辑:由 ChatViewContent 在 agent_code=contract_payment 时替换消息列表与输入框;
|
||||
view / contractId 写入 /chat/:agentId 查询参数,旧工作台地址重定向后仍可深链打开。
|
||||
列表 Tab 内容区 overflow-hidden,把纵向滚动交给子页表格区域;Chat 顶栏仅保留标题。
|
||||
管理员顶栏顺序:同步 OA → 发送预警 → 更多;前两者常显,低频操作收进「更多」以节省小屏高度。
|
||||
-->
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted, ref, watch } from 'vue';
|
||||
import { computed, onMounted, onUnmounted, ref, watch } from 'vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { CalendarClock, RefreshCw, Send } from 'lucide-vue-next';
|
||||
import { CalendarClock, ChevronDown, RefreshCw, Send } from 'lucide-vue-next';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import DeleteConfirmDialog from '@/shared/components/DeleteConfirmDialog.vue';
|
||||
import { listContractPaymentContracts } from '../api/contract-payment.api';
|
||||
@@ -31,6 +33,9 @@ const parsedQuery = computed(() => parseContractPaymentChatQuery(route.query.vie
|
||||
const activeView = computed<ContractPaymentView>(() => parsedQuery.value.view);
|
||||
const detailId = computed(() => parsedQuery.value.contractId);
|
||||
const reviewCount = ref(0);
|
||||
/** 管理员「更多」操作菜单是否展开。 */
|
||||
const moreMenuOpen = ref(false);
|
||||
const moreMenuRef = ref<HTMLElement | null>(null);
|
||||
|
||||
const {
|
||||
isAdmin,
|
||||
@@ -100,8 +105,39 @@ async function loadReviewCount(): Promise<void> {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 切换管理员「更多」菜单展开状态。
|
||||
*/
|
||||
function toggleMoreMenu(): void {
|
||||
moreMenuOpen.value = !moreMenuOpen.value;
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭「更多」菜单后执行低频管理操作,避免菜单遮挡确认弹窗。
|
||||
* @param action - force-sync / reparse-existing / scan
|
||||
*/
|
||||
function runFromMoreMenu(action: 'force-sync' | 'reparse-existing' | 'scan'): void {
|
||||
moreMenuOpen.value = false;
|
||||
run(action);
|
||||
}
|
||||
|
||||
/**
|
||||
* 点击菜单外区域时收起「更多」菜单。
|
||||
*/
|
||||
function onDocumentPointerDown(event: PointerEvent): void {
|
||||
const root = moreMenuRef.value;
|
||||
if (!moreMenuOpen.value || !root) return;
|
||||
if (event.target instanceof Node && root.contains(event.target)) return;
|
||||
moreMenuOpen.value = false;
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
void loadReviewCount();
|
||||
document.addEventListener('pointerdown', onDocumentPointerDown);
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
document.removeEventListener('pointerdown', onDocumentPointerDown);
|
||||
});
|
||||
|
||||
watch(
|
||||
@@ -116,36 +152,75 @@ watch(
|
||||
|
||||
<template>
|
||||
<section class="flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-[var(--surface-muted,#f4f7fb)]">
|
||||
<div class="flex flex-wrap items-start justify-between gap-3 px-5 pt-5">
|
||||
<div class="flex flex-wrap items-center justify-between gap-2 px-5 pt-3">
|
||||
<div class="min-w-0">
|
||||
<h1 class="text-xl font-bold text-primary">{{ t('admin.contractPayment.title') }}</h1>
|
||||
<p class="mt-1 text-sm text-muted">{{ t('admin.contractPayment.subtitle') }}</p>
|
||||
<h1 class="text-lg font-bold text-primary md:text-xl">{{ t('admin.contractPayment.title') }}</h1>
|
||||
</div>
|
||||
<div v-if="isAdmin" class="flex flex-wrap gap-2">
|
||||
<div v-if="isAdmin" class="flex flex-wrap items-center gap-2">
|
||||
<button class="btn-secondary-ds" type="button" :disabled="actionLoading" @click="run('sync')">
|
||||
<RefreshCw class="h-4 w-4" />{{ t('admin.contractPayment.sync') }}
|
||||
</button>
|
||||
<button class="btn-secondary-ds" type="button" :disabled="actionLoading" @click="run('force-sync')">
|
||||
<RefreshCw class="h-4 w-4" />{{ t('admin.contractPayment.forceSync') }}
|
||||
</button>
|
||||
<button class="btn-secondary-ds" type="button" :disabled="actionLoading" @click="run('reparse-existing')">
|
||||
<RefreshCw class="h-4 w-4" />{{ t('admin.contractPayment.reparseExisting') }}
|
||||
</button>
|
||||
<button class="btn-secondary-ds" type="button" :disabled="actionLoading" @click="run('scan')">
|
||||
<CalendarClock class="h-4 w-4" />{{ t('admin.contractPayment.scanAlerts') }}
|
||||
<RefreshCw class="h-4 w-4" aria-hidden="true" />{{ t('admin.contractPayment.sync') }}
|
||||
</button>
|
||||
<button class="btn-primary" type="button" :disabled="actionLoading" @click="run('weekly')">
|
||||
<Send class="h-4 w-4" />{{ t('admin.contractPayment.weeklySend') }}
|
||||
<Send class="h-4 w-4" aria-hidden="true" />{{ t('admin.contractPayment.weeklySend') }}
|
||||
</button>
|
||||
<div ref="moreMenuRef" class="relative">
|
||||
<button
|
||||
class="btn-secondary-ds"
|
||||
type="button"
|
||||
:disabled="actionLoading"
|
||||
:aria-expanded="moreMenuOpen"
|
||||
aria-haspopup="menu"
|
||||
@click="toggleMoreMenu"
|
||||
>
|
||||
{{ t('admin.contractPayment.moreActions') }}
|
||||
<ChevronDown class="h-4 w-4" :class="moreMenuOpen ? 'rotate-180' : ''" aria-hidden="true" />
|
||||
</button>
|
||||
<div
|
||||
v-if="moreMenuOpen"
|
||||
class="absolute right-0 z-20 mt-1 min-w-[14rem] overflow-hidden rounded-xl border border-default bg-surface py-1 shadow-lg"
|
||||
role="menu"
|
||||
>
|
||||
<button
|
||||
class="flex w-full items-center gap-2 px-3 py-2 text-left text-sm text-secondary hover:bg-surface-soft disabled:opacity-50"
|
||||
type="button"
|
||||
role="menuitem"
|
||||
:disabled="actionLoading"
|
||||
@click="runFromMoreMenu('force-sync')"
|
||||
>
|
||||
<RefreshCw class="h-4 w-4 shrink-0" aria-hidden="true" />
|
||||
{{ t('admin.contractPayment.forceSync') }}
|
||||
</button>
|
||||
<button
|
||||
class="flex w-full items-center gap-2 px-3 py-2 text-left text-sm text-secondary hover:bg-surface-soft disabled:opacity-50"
|
||||
type="button"
|
||||
role="menuitem"
|
||||
:disabled="actionLoading"
|
||||
@click="runFromMoreMenu('reparse-existing')"
|
||||
>
|
||||
<RefreshCw class="h-4 w-4 shrink-0" aria-hidden="true" />
|
||||
{{ t('admin.contractPayment.reparseExisting') }}
|
||||
</button>
|
||||
<button
|
||||
class="flex w-full items-center gap-2 px-3 py-2 text-left text-sm text-secondary hover:bg-surface-soft disabled:opacity-50"
|
||||
type="button"
|
||||
role="menuitem"
|
||||
:disabled="actionLoading"
|
||||
@click="runFromMoreMenu('scan')"
|
||||
>
|
||||
<CalendarClock class="h-4 w-4 shrink-0" aria-hidden="true" />
|
||||
{{ t('admin.contractPayment.scanAlerts') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-4 flex gap-0 border-b border-default px-5">
|
||||
<div class="mt-2 flex gap-0 border-b border-default px-5 md:mt-3">
|
||||
<button
|
||||
v-for="tab in tabs"
|
||||
:key="tab.key"
|
||||
type="button"
|
||||
class="mb-[-1px] border-b-2 px-4 py-2.5 text-sm font-bold"
|
||||
class="mb-[-1px] border-b-2 px-3 py-2 text-sm font-bold md:px-4 md:py-2.5"
|
||||
:class="activeView === tab.key
|
||||
? 'border-brand-500 text-brand-600'
|
||||
: 'border-transparent text-muted hover:text-secondary'"
|
||||
@@ -159,7 +234,10 @@ watch(
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="min-h-0 flex-1 overflow-auto px-5 py-4">
|
||||
<div
|
||||
class="flex min-h-0 flex-1 flex-col px-5 py-2 md:py-3"
|
||||
:class="detailId ? 'overflow-auto' : 'overflow-hidden'"
|
||||
>
|
||||
<ContractPaymentDetailPage
|
||||
v-if="detailId"
|
||||
:contract-id="detailId"
|
||||
@@ -168,16 +246,19 @@ watch(
|
||||
/>
|
||||
<ContractPaymentPage
|
||||
v-else-if="activeView === 'ledger'"
|
||||
class="h-full min-h-0 flex-1"
|
||||
embedded
|
||||
@open-detail="openDetail"
|
||||
/>
|
||||
<ContractPaymentReviewPage
|
||||
v-else-if="activeView === 'review'"
|
||||
class="h-full min-h-0 flex-1"
|
||||
embedded
|
||||
@open-detail="openDetail"
|
||||
/>
|
||||
<ContractPaymentWeeklyBatchesPage
|
||||
v-else
|
||||
class="h-full min-h-0 flex-1"
|
||||
embedded
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
用途:合同付款预警台账列表、汇总卡与本周待发送摘要。
|
||||
依赖:contract-payment.api、PaginationBar、统一消息提示。
|
||||
逻辑:Chat Tab 以 embedded 嵌入时隐藏页头;点行通过 open-detail 交给父级下钻详情;关键词可搜合同号、流程号、采购单号、供应商和申请人。
|
||||
嵌入布局为上半汇总卡/搜索与底部分页固定,仅表格区域双向滚动;汇总卡采用紧凑尺寸以留出小屏列表高度。
|
||||
-->
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted, ref } from 'vue';
|
||||
@@ -195,12 +196,12 @@ function openContractDetail(contractId: number): void {
|
||||
onMounted(() => void load());
|
||||
</script>
|
||||
<template>
|
||||
<section class="section-gap animate-fade-in-up">
|
||||
<div v-if="!props.embedded" class="mb-4">
|
||||
<section class="contract-ledger-page flex h-full min-h-0 flex-1 flex-col gap-2 animate-fade-in-up md:gap-3">
|
||||
<div v-if="!props.embedded" class="shrink-0">
|
||||
<h2 class="text-2xl font-bold text-primary">{{ t('admin.contractPayment.title') }}</h2>
|
||||
<p class="text-sm text-muted mt-1">{{ t('admin.contractPayment.subtitle') }}</p>
|
||||
</div>
|
||||
<div class="contract-stat-grid">
|
||||
<div class="contract-stat-grid shrink-0">
|
||||
<button
|
||||
v-for="card in ledgerFocusCards"
|
||||
:key="card.key"
|
||||
@@ -213,7 +214,7 @@ onMounted(() => void load());
|
||||
<strong class="contract-stat-value">{{ card.value }}</strong>
|
||||
</button>
|
||||
</div>
|
||||
<div class="contract-filter-bar">
|
||||
<div class="contract-filter-bar shrink-0">
|
||||
<div class="contract-filter-search">
|
||||
<Search class="contract-filter-icon" />
|
||||
<input
|
||||
@@ -226,7 +227,7 @@ onMounted(() => void load());
|
||||
<button type="button" class="contract-filter-submit" @click="load(true)">{{ t('admin.contractPayment.search') }}</button>
|
||||
<span v-if="weeklyPendingText" class="contract-filter-meta">{{ weeklyPendingText }}</span>
|
||||
</div>
|
||||
<div class="surface-panel contract-ledger-panel mt-4 overflow-x-auto">
|
||||
<div class="surface-panel contract-ledger-panel contract-scroll-panel min-h-0 flex-1">
|
||||
<table class="contract-ledger-table text-sm">
|
||||
<thead><tr>
|
||||
<th>{{ t('admin.contractPayment.contractSupplier') }}</th><th>{{ t('admin.contractPayment.amount') }}</th>
|
||||
@@ -245,47 +246,51 @@ onMounted(() => void load());
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<PaginationBar v-model:page="page" v-model:page-size="pageSize" :total="total" :pages="pages" :visible="total > 0 || !!keyword.trim() || !!ledgerFocus" @update:page="() => load()" @update:page-size="() => load()" />
|
||||
<PaginationBar class="shrink-0" v-model:page="page" v-model:page-size="pageSize" :total="total" :pages="pages" :visible="total > 0 || !!keyword.trim() || !!ledgerFocus" @update:page="() => load()" @update:page-size="() => load()" />
|
||||
</section>
|
||||
</template>
|
||||
<style scoped>
|
||||
.contract-stat-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, minmax(0, 1fr));
|
||||
gap: 12px;
|
||||
margin-top: 16px;
|
||||
gap: 8px;
|
||||
}
|
||||
.contract-stat-card {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
min-height: 88px;
|
||||
padding: 14px 16px 12px;
|
||||
min-height: 64px;
|
||||
padding: 8px 10px 7px;
|
||||
border: 1px solid #d7e1ef;
|
||||
border-radius: 14px;
|
||||
border-radius: 10px;
|
||||
background: #fff;
|
||||
box-shadow: 0 6px 20px rgba(33, 65, 111, .05);
|
||||
box-shadow: 0 4px 14px rgba(33, 65, 111, .04);
|
||||
text-align: left;
|
||||
cursor: pointer;
|
||||
}
|
||||
.contract-stat-card.is-selected { border-color: #93c5fd; box-shadow: 0 0 0 2px rgba(59, 130, 246, .16); }
|
||||
.contract-stat-label { color: #8aa0bd; font-size: 12px; font-weight: 600; line-height: 1.35; }
|
||||
.contract-stat-label small { margin-left: 2px; font-size: 12px; font-weight: 600; }
|
||||
.contract-stat-value { margin-top: 8px; font-size: 28px; font-weight: 800; line-height: 1; }
|
||||
.contract-stat-label { color: #8aa0bd; font-size: 11px; font-weight: 600; line-height: 1.25; }
|
||||
.contract-stat-label small { margin-left: 1px; font-size: 10px; font-weight: 600; }
|
||||
.contract-stat-value { margin-top: 4px; font-size: 22px; font-weight: 800; line-height: 1; }
|
||||
.contract-stat-card.due .contract-stat-value { color: #d97706; }
|
||||
.contract-stat-card.overdue .contract-stat-value { color: #dc2626; }
|
||||
.contract-stat-card.in-progress .contract-stat-value { color: #2563eb; }
|
||||
.contract-stat-card.month .contract-stat-value { color: #16a34a; }
|
||||
@media (max-width: 900px) { .contract-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
|
||||
@media (max-width: 900px) {
|
||||
.contract-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
|
||||
.contract-stat-card { min-height: 56px; padding: 6px 8px 5px; border-radius: 8px; }
|
||||
.contract-stat-label { font-size: 10px; line-height: 1.2; }
|
||||
.contract-stat-label small { font-size: 9px; }
|
||||
.contract-stat-value { margin-top: 2px; font-size: 18px; }
|
||||
}
|
||||
.contract-filter-bar {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
margin-top: 16px;
|
||||
padding: 10px 14px;
|
||||
padding: 8px 12px;
|
||||
border: 1px solid #d7e1ef;
|
||||
border-radius: 12px;
|
||||
border-radius: 10px;
|
||||
background: #fff;
|
||||
}
|
||||
.contract-filter-search { position: relative; width: min(100%, 320px); }
|
||||
@@ -326,9 +331,20 @@ onMounted(() => void load());
|
||||
}
|
||||
.contract-filter-submit:hover { background: #f7faff; color: #183c72; }
|
||||
.contract-filter-meta { color: #8aa0bd; font-size: 13px; line-height: 1.4; }
|
||||
.contract-ledger-panel { border: 1px solid #d7e1ef; border-radius: 14px; background: #fff; box-shadow: 0 6px 20px rgba(33, 65, 111, .05); }
|
||||
.contract-ledger-table { width: 100%; min-width: 1260px; border-collapse: collapse; color: #183c72; }
|
||||
.contract-ledger-table th { height: 59px; padding: 11px 12px; background: #f7faff; border-bottom: 1px solid #d7e1ef; color: #426493; font-size: 13px; font-weight: 700; line-height: 1.35; text-align: left; vertical-align: top; white-space: nowrap; }
|
||||
.contract-ledger-panel { min-height: 0; flex: 1 1 auto; border: 1px solid #d7e1ef; border-radius: 14px; background: #fff; box-shadow: 0 6px 20px rgba(33, 65, 111, .05); }
|
||||
.contract-scroll-panel {
|
||||
overflow: auto;
|
||||
overscroll-behavior: contain;
|
||||
scrollbar-gutter: stable;
|
||||
scrollbar-width: thin;
|
||||
scrollbar-color: #9eb1c9 #e8eef6;
|
||||
}
|
||||
.contract-scroll-panel::-webkit-scrollbar { width: 10px; height: 10px; }
|
||||
.contract-scroll-panel::-webkit-scrollbar-track { background: #e8eef6; border-radius: 8px; }
|
||||
.contract-scroll-panel::-webkit-scrollbar-thumb { background: #9eb1c9; border-radius: 8px; border: 2px solid #e8eef6; }
|
||||
.contract-scroll-panel::-webkit-scrollbar-thumb:hover { background: #7c93b0; }
|
||||
.contract-ledger-table { width: 100%; min-width: 1260px; border-collapse: separate; border-spacing: 0; color: #183c72; }
|
||||
.contract-ledger-table th { position: sticky; top: 0; z-index: 2; height: 59px; padding: 11px 12px; background: #f7faff; border-bottom: 1px solid #d7e1ef; color: #426493; font-size: 13px; font-weight: 700; line-height: 1.35; text-align: left; vertical-align: top; white-space: nowrap; }
|
||||
.contract-ledger-table th small { display: block; margin-top: 2px; font-size: 12px; font-weight: 600; }
|
||||
.contract-ledger-table td { padding: 12px; border-bottom: 1px solid #d7e1ef; vertical-align: top; line-height: 1.5; }
|
||||
.contract-ledger-table tbody tr:last-child td { border-bottom: 0; }
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
用途:集中展示关键解析事实缺失或冲突的合同,供管理员下载原文并人工确认。
|
||||
依赖:contract-payment.api、PaginationBar、统一消息提示。
|
||||
逻辑:后端以 review_only 过滤 needs_review 合同;关键词可搜合同号、采购单号、供应商和申请人;Chat 父级通过 open-detail 下钻详情。
|
||||
嵌入布局为搜索栏与底部分页固定,仅表格区域滚动,表头 sticky。
|
||||
-->
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref } from 'vue';
|
||||
@@ -68,12 +69,12 @@ onMounted(() => void load());
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<section class="section-gap animate-fade-in-up">
|
||||
<div v-if="!props.embedded">
|
||||
<section class="flex h-full min-h-0 flex-1 flex-col gap-3 animate-fade-in-up">
|
||||
<div v-if="!props.embedded" class="shrink-0">
|
||||
<h2 class="text-2xl font-bold text-primary">{{ t('admin.contractPaymentReview.title') }}</h2>
|
||||
<p class="mt-1 text-sm text-muted">{{ t('admin.contractPaymentReview.subtitle') }}</p>
|
||||
</div>
|
||||
<div class="contract-filter-bar">
|
||||
<div class="contract-filter-bar shrink-0">
|
||||
<div class="contract-filter-search">
|
||||
<Search class="contract-filter-icon" />
|
||||
<input
|
||||
@@ -85,12 +86,12 @@ onMounted(() => void load());
|
||||
</div>
|
||||
<button type="button" class="contract-filter-submit" @click="load(true)">{{ t('admin.contractPayment.search') }}</button>
|
||||
</div>
|
||||
<div class="surface-panel mt-4 overflow-x-auto rounded-2xl">
|
||||
<div class="surface-panel contract-scroll-panel min-h-0 flex-1 rounded-2xl">
|
||||
<table class="review-table text-sm"><thead><tr><th>{{ t('admin.contractPaymentReview.contractWorkflow') }}</th><th>{{ t('admin.contractPayment.purchaseOrder') }}</th><th>{{ t('admin.contractPayment.supplier') }}</th><th>{{ t('admin.contractPayment.amount') }}</th><th>{{ t('admin.contractPaymentReview.reason') }}</th></tr></thead>
|
||||
<tbody><tr v-for="item in contracts" :key="item.id" class="cursor-pointer hover:bg-surface-soft" @click="openContractDetail(item.id)"><td><strong>{{ item.contract_no || t('admin.contractPayment.contractNoPending') }}</strong><span>{{ item.workflow_no || '—' }}</span></td><td>{{ item.purchase_order_no || '—' }}</td><td>{{ item.supplier_name || '—' }}</td><td>{{ item.total_amount || '—' }}</td><td><ul><li v-for="issue in item.parse_issues || [t('admin.contractPaymentReview.fallbackIssue')]" :key="issue">{{ issue }}</li></ul></td></tr><tr v-if="!loading && !contracts.length"><td colspan="5" class="py-9 text-center text-muted">{{ t('admin.contractPaymentReview.empty') }}</td></tr></tbody>
|
||||
</table>
|
||||
</div>
|
||||
<PaginationBar v-model:page="page" v-model:page-size="pageSize" :total="total" :pages="pages" :visible="total > 0 || !!keyword.trim()" @update:page="() => load()" @update:page-size="() => load()" />
|
||||
<PaginationBar class="shrink-0" v-model:page="page" v-model:page-size="pageSize" :total="total" :pages="pages" :visible="total > 0 || !!keyword.trim()" @update:page="() => load()" @update:page-size="() => load()" />
|
||||
</section>
|
||||
</template>
|
||||
|
||||
@@ -100,7 +101,6 @@ onMounted(() => void load());
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
margin-top: 16px;
|
||||
padding: 10px 14px;
|
||||
border: 1px solid #d7e1ef;
|
||||
border-radius: 12px;
|
||||
@@ -143,5 +143,26 @@ onMounted(() => void load());
|
||||
font-weight: 600;
|
||||
}
|
||||
.contract-filter-submit:hover { background: #f7faff; color: #183c72; }
|
||||
.review-table { width: 100%; min-width: 980px; border-collapse: collapse; color: #183c72; }.review-table th { padding: 13px 14px; border-bottom: 1px solid #d7e1ef; background: #f7faff; color: #426493; text-align: left; }.review-table td { padding: 13px 14px; border-bottom: 1px solid #d7e1ef; vertical-align: top; }.review-table tbody tr:last-child td { border-bottom: 0; }.review-table strong, .review-table span { display: block; }.review-table strong { color: #102d59; }.review-table span, .review-table li { color: #9a3412; }.review-table ul { margin: 0; padding-left: 18px; }.review-table li + li { margin-top: 3px; }
|
||||
.contract-scroll-panel {
|
||||
min-height: 0;
|
||||
flex: 1 1 auto;
|
||||
overflow: auto;
|
||||
overscroll-behavior: contain;
|
||||
scrollbar-gutter: stable;
|
||||
scrollbar-width: thin;
|
||||
scrollbar-color: #9eb1c9 #e8eef6;
|
||||
}
|
||||
.contract-scroll-panel::-webkit-scrollbar { width: 10px; height: 10px; }
|
||||
.contract-scroll-panel::-webkit-scrollbar-track { background: #e8eef6; border-radius: 8px; }
|
||||
.contract-scroll-panel::-webkit-scrollbar-thumb { background: #9eb1c9; border-radius: 8px; border: 2px solid #e8eef6; }
|
||||
.contract-scroll-panel::-webkit-scrollbar-thumb:hover { background: #7c93b0; }
|
||||
.review-table { width: 100%; min-width: 980px; border-collapse: separate; border-spacing: 0; color: #183c72; }
|
||||
.review-table th { position: sticky; top: 0; z-index: 2; padding: 13px 14px; border-bottom: 1px solid #d7e1ef; background: #f7faff; color: #426493; text-align: left; }
|
||||
.review-table td { padding: 13px 14px; border-bottom: 1px solid #d7e1ef; vertical-align: top; }
|
||||
.review-table tbody tr:last-child td { border-bottom: 0; }
|
||||
.review-table strong, .review-table span { display: block; }
|
||||
.review-table strong { color: #102d59; }
|
||||
.review-table span, .review-table li { color: #9a3412; }
|
||||
.review-table ul { margin: 0; padding-left: 18px; }
|
||||
.review-table li + li { margin-top: 3px; }
|
||||
</style>
|
||||
@@ -3,6 +3,7 @@
|
||||
用途:独立展示合同付款预警的周汇总批次及其企业微信发送审计摘要,并下载 Excel 明细。
|
||||
依赖:contract-payment.api、统一消息提示。
|
||||
逻辑:后端扫描产生的批次在此集中查看;Excel 经受控接口下载;Chat 顶栏共用发送入口,本页 embedded 时隐藏页头与发送按钮。
|
||||
嵌入布局仅表格区域滚动,表头 sticky,滚动条常显。
|
||||
-->
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref } from 'vue';
|
||||
@@ -106,13 +107,13 @@ onMounted(() => void load());
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<section class="section-gap animate-fade-in-up">
|
||||
<div v-if="!props.embedded">
|
||||
<section class="flex h-full min-h-0 flex-1 flex-col gap-3 animate-fade-in-up">
|
||||
<div v-if="!props.embedded" class="shrink-0">
|
||||
<h2 class="text-2xl font-bold text-primary">{{ t('admin.contractPayment.weeklyBatchesTitle') }}</h2>
|
||||
<p class="mt-1 text-sm text-muted">{{ t('admin.contractPayment.weeklyBatchesSubtitle') }}</p>
|
||||
</div>
|
||||
|
||||
<div class="surface-panel mt-5 overflow-x-auto rounded-2xl">
|
||||
<div class="surface-panel contract-scroll-panel min-h-0 flex-1 rounded-2xl">
|
||||
<table class="weekly-batch-table text-sm">
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -159,8 +160,21 @@ onMounted(() => void load());
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.weekly-batch-table { width: 100%; min-width: 860px; border-collapse: collapse; color: #183c72; }
|
||||
.weekly-batch-table th { padding: 14px 16px; border-bottom: 1px solid #d7e1ef; background: #f7faff; color: #426493; font-size: 13px; font-weight: 700; text-align: left; white-space: nowrap; }
|
||||
.contract-scroll-panel {
|
||||
min-height: 0;
|
||||
flex: 1 1 auto;
|
||||
overflow: auto;
|
||||
overscroll-behavior: contain;
|
||||
scrollbar-gutter: stable;
|
||||
scrollbar-width: thin;
|
||||
scrollbar-color: #9eb1c9 #e8eef6;
|
||||
}
|
||||
.contract-scroll-panel::-webkit-scrollbar { width: 10px; height: 10px; }
|
||||
.contract-scroll-panel::-webkit-scrollbar-track { background: #e8eef6; border-radius: 8px; }
|
||||
.contract-scroll-panel::-webkit-scrollbar-thumb { background: #9eb1c9; border-radius: 8px; border: 2px solid #e8eef6; }
|
||||
.contract-scroll-panel::-webkit-scrollbar-thumb:hover { background: #7c93b0; }
|
||||
.weekly-batch-table { width: 100%; min-width: 860px; border-collapse: separate; border-spacing: 0; color: #183c72; }
|
||||
.weekly-batch-table th { position: sticky; top: 0; z-index: 2; padding: 14px 16px; border-bottom: 1px solid #d7e1ef; background: #f7faff; color: #426493; font-size: 13px; font-weight: 700; text-align: left; white-space: nowrap; }
|
||||
.weekly-batch-table td { padding: 14px 16px; border-bottom: 1px solid #d7e1ef; vertical-align: middle; }
|
||||
.weekly-batch-table tbody tr:last-child td { border-bottom: 0; }
|
||||
.weekly-batch-table tbody tr:hover { background: #fbfdff; }
|
||||
|
||||
@@ -2100,7 +2100,8 @@
|
||||
"agents": "App Ops",
|
||||
"ops_overview": "Ops Overview",
|
||||
"issue_analysis": "Issue Analysis",
|
||||
"usage_analysis": "Usage Analytics"
|
||||
"usage_analysis": "Usage Analytics",
|
||||
"permission_requests": "Permission Requests"
|
||||
},
|
||||
"feedbackValues": {
|
||||
"types": {
|
||||
@@ -2308,6 +2309,14 @@
|
||||
"topApp": "App to optimize",
|
||||
"topAppHint": "Attention signal share {ratio}%"
|
||||
}
|
||||
},
|
||||
"usageRangeLabel": "Time range",
|
||||
"usageRanges": {
|
||||
"7d": "Last 7 days",
|
||||
"30d": "Last 30 days",
|
||||
"90d": "Last 3 months",
|
||||
"180d": "Last 6 months",
|
||||
"365d": "Last 12 months"
|
||||
}
|
||||
},
|
||||
"batchEdit": {
|
||||
@@ -4994,7 +5003,7 @@
|
||||
"jobSubmitted": "Job submitted",
|
||||
"actionFailed": "Action failed",
|
||||
"loadFailed": "Failed to load contracts",
|
||||
"searchPlaceholder": "Search contract number, purchase order, or supplier",
|
||||
"searchPlaceholder": "Search contract number, purchase order, supplier, or applicant",
|
||||
"allStatus": "All",
|
||||
"search": "Search",
|
||||
"ledger": "Contract ledger",
|
||||
@@ -5018,7 +5027,8 @@
|
||||
"overdue": "Overdue unpaid",
|
||||
"needsCompletion": "Needs completion",
|
||||
"dueThisMonth": "Due this month",
|
||||
"dueThisMonthHint": "this calendar month"
|
||||
"dueThisMonthHint": "this calendar month",
|
||||
"active": "In progress"
|
||||
},
|
||||
"status": {
|
||||
"completed": "Completed",
|
||||
@@ -5137,7 +5147,9 @@
|
||||
"notStarted": "Not started",
|
||||
"overdue": "Overdue",
|
||||
"review": "Needs review"
|
||||
}
|
||||
},
|
||||
"sessionHint": "Chat and history are hidden in this phase. Use the tabs above to open the ledger.",
|
||||
"moreActions": "More"
|
||||
},
|
||||
"contractPaymentReview": {
|
||||
"title": "Contracts for Confirmation",
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
"summary": "Total {total} rows, page {page} / {pages}",
|
||||
"perPage": "Per page",
|
||||
"itemsUnit": "rows",
|
||||
"pageSizeLabel": "{size} / page",
|
||||
"prevPage": "Previous",
|
||||
"nextPage": "Next"
|
||||
},
|
||||
|
||||
@@ -2089,7 +2089,8 @@
|
||||
"agents": "แอปปฏิบัติการ",
|
||||
"ops_overview": "ภาพรวมการดำเนินงาน",
|
||||
"issue_analysis": "การวิเคราะห์ปัญหา",
|
||||
"usage_analysis": "วิเคราะห์การใช้งาน"
|
||||
"usage_analysis": "วิเคราะห์การใช้งาน",
|
||||
"permission_requests": "คำขอสิทธิ์"
|
||||
},
|
||||
"usageIntro": "ดูแนวโน้มการเรียกใช้แอป AI ผู้ใช้ที่ใช้งาน แอปที่ใช้น้อย และช่วงพีคผิดปกติ",
|
||||
"usageTotalSessions": "จำนวนแชทรวม",
|
||||
@@ -2279,6 +2280,14 @@
|
||||
"topApp": "แอปที่ควรปรับปรุง",
|
||||
"topAppHint": "สัดส่วนสัญญาณที่ต้องให้ความสนใจ {ratio}%"
|
||||
}
|
||||
},
|
||||
"usageRangeLabel": "ช่วงเวลา",
|
||||
"usageRanges": {
|
||||
"7d": "7 วันล่าสุด",
|
||||
"30d": "30 วันล่าสุด",
|
||||
"90d": "3 เดือนล่าสุด",
|
||||
"180d": "6 เดือนล่าสุด",
|
||||
"365d": "12 เดือนล่าสุด"
|
||||
}
|
||||
},
|
||||
"batchEdit": {
|
||||
@@ -4851,7 +4860,7 @@
|
||||
"jobSubmitted": "ส่งงานแล้ว",
|
||||
"actionFailed": "ดำเนินการไม่สำเร็จ",
|
||||
"loadFailed": "โหลดสัญญาไม่สำเร็จ",
|
||||
"searchPlaceholder": "ค้นหาเลขที่สัญญา ใบสั่งซื้อ หรือผู้ขาย",
|
||||
"searchPlaceholder": "ค้นหาเลขที่สัญญา ใบสั่งซื้อ ผู้ขาย หรือผู้ขอ",
|
||||
"allStatus": "ทั้งหมด",
|
||||
"search": "ค้นหา",
|
||||
"ledger": "ทะเบียนสัญญา",
|
||||
@@ -4875,7 +4884,8 @@
|
||||
"overdue": "ค้างชำระเกินกำหนด",
|
||||
"needsCompletion": "รอข้อมูลเพิ่ม",
|
||||
"dueThisMonth": "ถึงกำหนดเดือนนี้",
|
||||
"dueThisMonthHint": "เดือนปฏิทินนี้"
|
||||
"dueThisMonthHint": "เดือนปฏิทินนี้",
|
||||
"active": "กำลังดำเนินการ"
|
||||
},
|
||||
"status": {
|
||||
"completed": "เสร็จสิ้น",
|
||||
@@ -4994,7 +5004,9 @@
|
||||
"notStarted": "รอเริ่ม",
|
||||
"overdue": "เกินกำหนดชำระ",
|
||||
"review": "ต้องตรวจสอบ"
|
||||
}
|
||||
},
|
||||
"sessionHint": "ระยะนี้ยังไม่ใช้แชทและประวัติการสนทนา เปิดบัญชีจากแท็บด้านบน",
|
||||
"moreActions": "เพิ่มเติม"
|
||||
},
|
||||
"contractPaymentReview": {
|
||||
"title": "สัญญาที่รอยืนยัน",
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
"summary": "ทั้งหมด {total} รายการ, หน้า {page} / {pages}",
|
||||
"perPage": "ต่อหน้า",
|
||||
"itemsUnit": "รายการ",
|
||||
"pageSizeLabel": "{size} รายการ/หน้า",
|
||||
"prevPage": "ก่อนหน้า",
|
||||
"nextPage": "ถัดไป"
|
||||
},
|
||||
|
||||
@@ -4972,6 +4972,7 @@
|
||||
"subtitle": "同步 OA 合同、验收和厂商预付款请款作业,按三轮规则通知采购岗位",
|
||||
"sessionHint": "本期不使用对话和历史会话,请从上方 Tab 查看台账。",
|
||||
"sync": "同步 OA 数据",
|
||||
"moreActions": "更多",
|
||||
"forceSync": "强制覆盖 OA 字段",
|
||||
"forceSyncConfirm": "将用本次 OA 返回的非空字段覆盖已有 OA 数据,并记录变更审计。是否继续?",
|
||||
"reparseExisting": "批量重新解析存量合同",
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
"summary": "共 {total} 条,当前第 {page} / {pages} 页",
|
||||
"perPage": "每页",
|
||||
"itemsUnit": "条",
|
||||
"pageSizeLabel": "{size} 条/页",
|
||||
"prevPage": "上一页",
|
||||
"nextPage": "下一页"
|
||||
},
|
||||
|
||||
@@ -2094,7 +2094,8 @@
|
||||
"agents": "應用運營",
|
||||
"ops_overview": "營運總覽",
|
||||
"issue_analysis": "問題分析",
|
||||
"usage_analysis": "使用分析"
|
||||
"usage_analysis": "使用分析",
|
||||
"permission_requests": "權限申請"
|
||||
},
|
||||
"usageIntro": "查看 AI 應用呼叫趨勢、活躍使用者、低使用應用與異常高峰。",
|
||||
"usageTotalSessions": "對話總量",
|
||||
@@ -2284,6 +2285,14 @@
|
||||
"topApp": "優先優化應用",
|
||||
"topAppHint": "需要關注信號占比 {ratio}%"
|
||||
}
|
||||
},
|
||||
"usageRangeLabel": "統計範圍",
|
||||
"usageRanges": {
|
||||
"7d": "近一週",
|
||||
"30d": "近一月",
|
||||
"90d": "近三月",
|
||||
"180d": "近半年",
|
||||
"365d": "近一年"
|
||||
}
|
||||
},
|
||||
"batchEdit": {
|
||||
@@ -4856,7 +4865,7 @@
|
||||
"jobSubmitted": "工作已提交",
|
||||
"actionFailed": "操作失敗",
|
||||
"loadFailed": "載入合約失敗",
|
||||
"searchPlaceholder": "搜尋合約編號、採購單號或供應商",
|
||||
"searchPlaceholder": "搜尋合約編號、採購單號、供應商或申請人",
|
||||
"allStatus": "全部",
|
||||
"search": "查詢",
|
||||
"ledger": "合約台帳",
|
||||
@@ -4880,7 +4889,8 @@
|
||||
"overdue": "逾期未付",
|
||||
"needsCompletion": "待補充",
|
||||
"dueThisMonth": "本月應付",
|
||||
"dueThisMonthHint": "本自然月"
|
||||
"dueThisMonthHint": "本自然月",
|
||||
"active": "進行中"
|
||||
},
|
||||
"status": {
|
||||
"completed": "已完成",
|
||||
@@ -4999,7 +5009,9 @@
|
||||
"notStarted": "待起算",
|
||||
"overdue": "已逾期",
|
||||
"review": "待複核"
|
||||
}
|
||||
},
|
||||
"sessionHint": "本期不使用對話和歷史會話,請從上方 Tab 查看台帳。",
|
||||
"moreActions": "更多"
|
||||
},
|
||||
"contractPaymentReview": {
|
||||
"title": "待確認合約",
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
"summary": "共 {total} 條,當前第 {page} / {pages} 頁",
|
||||
"perPage": "每頁",
|
||||
"itemsUnit": "條",
|
||||
"pageSizeLabel": "{size} 條/頁",
|
||||
"prevPage": "上一頁",
|
||||
"nextPage": "下一頁"
|
||||
},
|
||||
|
||||
@@ -2,12 +2,13 @@
|
||||
/**
|
||||
* shared/components/PaginationBar.vue
|
||||
* 用途:通用偏移分页条(摘要、每页条数、页码按钮)。
|
||||
* 依赖:buildOffsetPageButtons、common.pagination i18n、components-ds 样式类。
|
||||
* 依赖:buildOffsetPageButtons、common.pagination i18n、components-ds 样式类、lucide-vue-next。
|
||||
* 逻辑:父组件 v-model:page / v-model:page-size,服务端或客户端分页均可复用。
|
||||
* 每页条数用自定义 SVG 箭头,并隐藏系统原生/::picker-icon,避免 Windows 下双箭头。
|
||||
* 每页条数下拉选项文案为「{size} 条/页」一体展示;上一页/下一页用 Chevron,文案仅作 aria-label。
|
||||
*/
|
||||
import { computed } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { ChevronLeft, ChevronRight } from 'lucide-vue-next';
|
||||
import { buildOffsetPageButtons } from '@/shared/composables/useOffsetPagination';
|
||||
|
||||
interface Props {
|
||||
@@ -94,40 +95,40 @@ const onPageSizeChange = (size: number): void => {
|
||||
{{ t('common.pagination.summary', { total, page: safePage, pages: totalPages }) }}
|
||||
</div>
|
||||
<div class="flex flex-wrap items-center gap-2">
|
||||
<label class="flex items-center gap-2 text-xs text-secondary">
|
||||
<span>{{ t('common.pagination.perPage') }}</span>
|
||||
<span class="pagination-page-size relative inline-flex items-center">
|
||||
<select
|
||||
:value="pageSize"
|
||||
class="admin-table-filter-input appearance-none bg-none pl-2 pr-7 py-1 text-xs leading-5"
|
||||
@change="onPageSizeChange(Number(($event.target as HTMLSelectElement).value))"
|
||||
>
|
||||
<option v-for="size in pageSizeOptions" :key="`page-size-${size}`" :value="size">
|
||||
{{ size }}
|
||||
</option>
|
||||
</select>
|
||||
<svg
|
||||
class="pointer-events-none absolute right-2 h-3.5 w-3.5 text-muted"
|
||||
viewBox="0 0 20 20"
|
||||
fill="currentColor"
|
||||
aria-hidden="true"
|
||||
>
|
||||
<path
|
||||
fill-rule="evenodd"
|
||||
d="M5.23 7.21a.75.75 0 0 1 1.06.02L10 11.168l3.71-3.938a.75.75 0 1 1 1.08 1.04l-4.25 4.5a.75.75 0 0 1-1.08 0l-4.25-4.5a.75.75 0 0 1 .02-1.06Z"
|
||||
clip-rule="evenodd"
|
||||
/>
|
||||
</svg>
|
||||
</span>
|
||||
<span>{{ t('common.pagination.itemsUnit') }}</span>
|
||||
<label class="pagination-page-size relative inline-flex items-center text-xs text-secondary">
|
||||
<span class="sr-only">{{ t('common.pagination.perPage') }}</span>
|
||||
<select
|
||||
:value="pageSize"
|
||||
class="admin-table-filter-input appearance-none bg-none pl-2.5 pr-7 py-1 text-xs leading-5"
|
||||
:aria-label="t('common.pagination.perPage')"
|
||||
@change="onPageSizeChange(Number(($event.target as HTMLSelectElement).value))"
|
||||
>
|
||||
<option v-for="size in pageSizeOptions" :key="`page-size-${size}`" :value="size">
|
||||
{{ t('common.pagination.pageSizeLabel', { size }) }}
|
||||
</option>
|
||||
</select>
|
||||
<svg
|
||||
class="pointer-events-none absolute right-2 h-3.5 w-3.5 text-muted"
|
||||
viewBox="0 0 20 20"
|
||||
fill="currentColor"
|
||||
aria-hidden="true"
|
||||
>
|
||||
<path
|
||||
fill-rule="evenodd"
|
||||
d="M5.23 7.21a.75.75 0 0 1 1.06.02L10 11.168l3.71-3.938a.75.75 0 1 1 1.08 1.04l-4.25 4.5a.75.75 0 0 1-1.08 0l-4.25-4.5a.75.75 0 0 1 .02-1.06Z"
|
||||
clip-rule="evenodd"
|
||||
/>
|
||||
</svg>
|
||||
</label>
|
||||
<button
|
||||
type="button"
|
||||
:disabled="safePage <= 1"
|
||||
class="admin-report-page-btn"
|
||||
class="admin-report-page-btn pagination-nav-btn"
|
||||
:aria-label="t('common.pagination.prevPage')"
|
||||
:title="t('common.pagination.prevPage')"
|
||||
@click="onPrevPage"
|
||||
>
|
||||
{{ t('common.pagination.prevPage') }}
|
||||
<ChevronLeft class="h-4 w-4" aria-hidden="true" />
|
||||
</button>
|
||||
<button
|
||||
v-for="btn in pageButtons"
|
||||
@@ -147,10 +148,12 @@ const onPageSizeChange = (size: number): void => {
|
||||
<button
|
||||
type="button"
|
||||
:disabled="safePage >= totalPages"
|
||||
class="admin-report-page-btn"
|
||||
class="admin-report-page-btn pagination-nav-btn"
|
||||
:aria-label="t('common.pagination.nextPage')"
|
||||
:title="t('common.pagination.nextPage')"
|
||||
@click="onNextPage"
|
||||
>
|
||||
{{ t('common.pagination.nextPage') }}
|
||||
<ChevronRight class="h-4 w-4" aria-hidden="true" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -176,4 +179,14 @@ const onPageSizeChange = (size: number): void => {
|
||||
display: none;
|
||||
content: none;
|
||||
}
|
||||
|
||||
/** 上一页/下一页改为图标按钮:固定方形点击区,与页码按钮对齐。 */
|
||||
.pagination-nav-btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-width: 2rem;
|
||||
padding-left: 0.35rem;
|
||||
padding-right: 0.35rem;
|
||||
}
|
||||
</style>
|
||||
Reference in new issue
Block a user